diff --git a/.gitignore b/.gitignore
index 4ecc3356a1d4a5160682ddba2dbe3ca90b71436d..7ed00b371824a8816c3ef9d10c186352e00fef2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 .project
 *.pyc
 .asetup*
+.cproject
diff --git a/Build/AtlasBuildScripts/build_atlasexternals.sh b/Build/AtlasBuildScripts/build_atlasexternals.sh
index 1b0256cdda625ce5e327beaef6d8a424dd2e74bc..a87a86b6cd454475a878b6ba91f82d64cf0f1628 100755
--- a/Build/AtlasBuildScripts/build_atlasexternals.sh
+++ b/Build/AtlasBuildScripts/build_atlasexternals.sh
@@ -86,7 +86,7 @@ fi
 error_stamp=`mktemp .tmp.error.XXXXX` ; rm -f $error_stamp
 {
  cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \
-    ${EXTRACONF} \
+    -DLCG_VERSION_NUMBER:STRING=87 ${EXTRACONF} \
     ${SOURCEDIR}/Projects/${PROJECT}/ || touch $error_stamp
 } 2>&1 | tee cmake_config.log 
 test -f $error_stamp && ((ERROR_COUNT++)) 
diff --git a/Build/AtlasBuildScripts/checkout_atlasexternals.sh b/Build/AtlasBuildScripts/checkout_atlasexternals.sh
index 52fd9cd5e4c6b264df03840980780e04cb43207b..bdc803eba192c3689745d81b48157cd9200e3bda 100755
--- a/Build/AtlasBuildScripts/checkout_atlasexternals.sh
+++ b/Build/AtlasBuildScripts/checkout_atlasexternals.sh
@@ -46,7 +46,7 @@ _retry_ () {
 # Parse the command line arguments:
 TAGBRANCH=""
 SOURCEDIR=""
-EXTERNALSURL="https://:@gitlab.cern.ch:8443/atlas/atlasexternals.git"
+EXTERNALSURL="https://gitlab.cern.ch/atlas/atlasexternals.git"
 while getopts ":t:o:s:e:h" opt; do
     case $opt in
         t)
diff --git a/Control/AthenaServices/src/AthenaSharedMemoryTool.cxx b/Control/AthenaServices/src/AthenaSharedMemoryTool.cxx
index 98edaa2ce91b1312cb110041271c537704c59b9a..6ae939175a66eaa08b3ab567550c4e6a5747b71c 100644
--- a/Control/AthenaServices/src/AthenaSharedMemoryTool.cxx
+++ b/Control/AthenaServices/src/AthenaSharedMemoryTool.cxx
@@ -14,7 +14,6 @@
 #include <boost/interprocess/mapped_region.hpp>
 
 #include <sstream>
-
 const std::size_t maxTokenLength = 1024;
 
 struct ShareEventHeader {
diff --git a/DataQuality/DataQualityConfigurations/config/HLT/HLTmuon/cosmics_run.config b/DataQuality/DataQualityConfigurations/config/HLT/HLTmuon/cosmics_run.config
index 837ca2538944b265364b968a26d37da7479705fe..b7707a1b3d65044dc7c7db39630cfcf682405ee7 100644
--- a/DataQuality/DataQualityConfigurations/config/HLT/HLTmuon/cosmics_run.config
+++ b/DataQuality/DataQualityConfigurations/config/HLT/HLTmuon/cosmics_run.config
@@ -6,60 +6,24 @@
 # HLTmuon
 #######################
 
-#######################
+#############
 # Output
-#######################
+#############
 
 output top_level {
-
   output HLT {
-
     output TRMUO {
       algorithm = TRMUO_WorstCaseSummary  
-      output Shifter {
-        output L2MuonSA {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output L2muonCB {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output MuonEF {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-      }
-      output Expert {
-        algorithm = TRMUO_AlwaysGreenSummary  
-
-        output L2MuonSA {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output L2muonCB {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output TileMu {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output MuonEF {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output muChain1 {
-          algorithm = TRMUO_WorstCaseSummary  
-        }
-        output muChainMSonly1 {
-          algorithm = TRMUO_AlwaysGreenSummary  
-        }
-      }
     }
   }
 }
 
+
 #######################
 # Histogram Assessments
 #######################
 
 dir HLT {
-  algorithm = HLT_Histogram_Not_Empty&GatherData
-
   dir MuonMon {
     algorithm = Muon_Bins_LessThan_Threshold&GatherData
     output = HLT/TRMUO
@@ -219,6 +183,7 @@ dir HLT {
 	algorithm = alg_eta_vs_phi
         reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
         weight = 0.0
+        reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
       }
       hist EFMS_pt {
         output = HLT/TRMUO/Shifter/MuonEF
@@ -232,9 +197,9 @@ dir HLT {
         weight = 0.0
         reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
       }
-      hist EFCB_pt {
-        output = HLT/TRMUO/Shifter/MuonEF
-	algorithm = TRMUO_GatherData
+      hist EFCB_eta_vs_phi_in_10LBs {
+        output = HLT/TRMUO
+        algorithm = alg_eta_vs_phi
         weight = 0.0
         reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
       }
@@ -531,16 +496,19 @@ algorithm alg_L2MuonSA_residual_endcap {
   thresholds = th_L2MuonSA_residual_endcap
 }
 
+#############
+##Algorithms
+#############
 algorithm alg_eta_vs_phi {
   libname = libdqm_algorithms.so
   name = Bins_GreaterThanNonZeroMedian_Threshold
   thresholds = th_eta_vs_phi
   BinThreshold = 0.02
   MinBinThreshold = 1
-  MinStat = 20000
-# 108*96 = 10368
-# no trigger for |eta|>2.45 --> 10bins
-# 98*96 = 9408
+  MinStat = 2000
+# 16*27 = 432
+# no trigger for |eta|>2.45 --> 2bins
+# 16*25 = 400
 # 10% due to barrel holes
 # 8468
   TotalBins = 8468
@@ -639,20 +607,17 @@ algorithm TRMUO_fermi_fit_mu6_MSonly_L2MuonSA {
   LikelihoodFit = 2.0
 }
 
-algorithm TRMUO_fermi_fit_mu6_MSonly_MuonEFMS {
-  libname = libdqm_algorithms.so
-  name = Simple_fermi_Fit
-  thresholds = th_TRMUO_fermi_fit_mu6_MSonly_MuonEFMS
-  MinStat = 1000
-  LikelihoodFit = 2.0
-}
-
-algorithm TRMUO_fermi_fit_mu6_MSonly_MuonEFSA {
+algorithm alg_eta_vs_phi_tilemu {
   libname = libdqm_algorithms.so
-  name = Simple_fermi_Fit
-  thresholds = th_TRMUO_fermi_fit_mu6_MSonly_MuonEFSA
-  MinStat = 1000
-  LikelihoodFit = 2.0
+  name = Bins_GreaterThanNonZeroMedian_Threshold
+  thresholds = th_eta_vs_phi_tilemu
+  BinThreshold = 0.02
+  MinBinThreshold = 1
+  MinStat = 2000
+# 16*27 = 432
+# no trigger for |eta|>1.5 --> 14bins
+# 16*13 = 208
+  TotalBins = 208
 }
 
 #
@@ -726,25 +691,10 @@ thresholds th_L2MuonSA_residual_endcap {
 
 thresholds th_eta_vs_phi {
   limits NBins {
-# 8468*0.8 = 6774.4
-    warning = 6774
-    error = 6773.9
-  }
-}
-
-thresholds th_muComb_ptratio {
- limits Sigma {
-    warning = 0.4
-    error = 0.6
-  }
-  limits AbsMean {
-    warning = 0.4
-    error = 0.6
+# 360*0.9 = 324
+    warning = 324
+    error = 323
   }
-#  limits Chi2_per_NDF {
-#    warning = 30.
-#    error = 50.
-#  }
 }
 
 # muChainMSonly1
diff --git a/DataQuality/DataQualityUtils/scripts/readTier0TAGs.py b/DataQuality/DataQualityUtils/scripts/readTier0TAGs.py
index 172ee1b857e555982c3411d0c93e7744d4f371b0..8e9e85a7f6a2ded0b5bebc42dfbed197c466c67e 100644
--- a/DataQuality/DataQualityUtils/scripts/readTier0TAGs.py
+++ b/DataQuality/DataQualityUtils/scripts/readTier0TAGs.py
@@ -20,7 +20,6 @@ import xmlrpclib
 from ROOT import TFile,TChain
 from ROOT import gStyle
 
-
 #gROOT.Reset()
 gStyle.SetPalette(1)
 gStyle.SetOptStat("em")
diff --git a/DataQuality/GoodRunsLists/CMakeLists.txt b/DataQuality/GoodRunsLists/CMakeLists.txt
index 94a69aea4a7c632aaae233a324a9b92dfcc86d05..975b96805233ea33ba6981c8c94a7c6d5bc0fd6e 100644
--- a/DataQuality/GoodRunsLists/CMakeLists.txt
+++ b/DataQuality/GoodRunsLists/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id: CMakeLists.txt 754313 2016-06-12 10:28:19Z will $
+# $Id: CMakeLists.txt 777875 2016-10-11 17:17:13Z krasznaa $
 ################################################################################
 # Package: GoodRunsLists
 ################################################################################
@@ -12,6 +12,7 @@ if( XAOD_STANDALONE )
       PUBLIC
       Control/AthToolSupport/AsgTools
       Event/xAOD/xAODEventInfo
+      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
       PRIVATE
       Tools/PathResolver )
 else()
@@ -21,6 +22,7 @@ else()
       Control/AthenaBaseComps
       Control/AthenaKernel
       Event/xAOD/xAODEventInfo
+      PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
       GaudiKernel
       PRIVATE
       Control/StoreGate
@@ -47,7 +49,7 @@ atlas_add_library( GoodRunsListsLib
    PUBLIC_HEADERS GoodRunsLists
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo AsgAnalysisInterfaces
    PRIVATE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} PathResolver )
 
 if( NOT XAOD_STANDALONE )
diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h
index 4feb41b3b18ea97432664622f33fddecaf5f4954..a732e8bec0a677c03b4715b8223d6690e889ad7e 100644
--- a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h
+++ b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListSelectionTool.h
@@ -15,7 +15,7 @@
 #include "AsgTools/AsgTool.h"
 
 // Local include(s):
-#include "GoodRunsLists/IGoodRunsListSelectionTool.h"
+#include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
 #include "GoodRunsLists/TGRLCollection.h"
 
 /// Tool implementing the GRL selection
diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h
index 9c1d8896962d034b5dbdc948b178a85a5b7c8b70..cd881202c9dc6957f74ec7895568a864c71d1418 100644
--- a/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h
+++ b/DataQuality/GoodRunsLists/GoodRunsLists/GoodRunsListsDict.h
@@ -8,10 +8,13 @@
 
 #include "GoodRunsLists/GoodRunsListSelectionTool.h"
 
+/* removed for now ... maybe move to AsgAnalysisInterfaces if need a dictionary for specific ToolHandle
 #include "AsgTools/ToolHandle.h"
 
+
 struct dummyStruct {
   ToolHandle<IGoodRunsListSelectionTool> dummy1;
 };
+*/
 
 #endif
diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/IGoodRunsListSelectionTool.h b/DataQuality/GoodRunsLists/GoodRunsLists/IGoodRunsListSelectionTool.h
index 52b81aba0d2f47e90a4a2a68d1624a596bf830c9..0d633051e4285de5b2cf7db6e08d79490fe78d03 100644
--- a/DataQuality/GoodRunsLists/GoodRunsLists/IGoodRunsListSelectionTool.h
+++ b/DataQuality/GoodRunsLists/GoodRunsLists/IGoodRunsListSelectionTool.h
@@ -1,67 +1,10 @@
-// Dear emacs, this is -*- c++ -*-
-
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id$
-#ifndef GoodRunsLists_IGoodRunsListSelectionTool_H
-#define GoodRunsLists_IGoodRunsListSelectionTool_H
-
-// System include(s):
-#include <vector>
-#include <string>
-
-// Framework include(s):
-#include "AsgTools/IAsgTool.h"
-
-// EDM include(s):
-#include "xAODEventInfo/EventInfo.h"
-
-// Forward declaration(s):
-namespace Root {
-   class TGRLCollection;
-}
-
-/// Interface to the dual-use GRL tool
-///
-/// This interface should be used inside an analysis to make use of the
-/// GRL tool.
-///
-/// $Revision$
-/// $Date$
-///
-class IGoodRunsListSelectionTool : virtual public asg::IAsgTool {
-
-   ASG_TOOL_INTERFACE( IGoodRunsListSelectionTool )
-
-public:
-   /// Check if the current event passes the selection
-   virtual bool passRunLB( const std::vector< std::string >& grlnameVec =
-                              std::vector< std::string >(),
-                           const std::vector< std::string >& brlnameVec =
-                              std::vector< std::string >() ) const = 0;
-
-   /// Check if the event specified passes the selection
-   virtual bool passRunLB( const xAOD::EventInfo& event,
-                           const std::vector< std::string >& grlnameVec =
-                              std::vector< std::string >(),
-                           const std::vector< std::string >& brlnameVec =
-                              std::vector< std::string >() ) const = 0;
-
-   /// Check if the event specified passes the selection
-   virtual bool passRunLB( int runNumber, int lumiBlockNr,
-                           const std::vector< std::string >& grlnameVec =
-                              std::vector< std::string >(),
-                           const std::vector< std::string >& brlnameVec =
-                              std::vector< std::string >() ) const = 0;
 
-   /// Get the good runs list used by the tool
-   virtual const Root::TGRLCollection& getGRLCollection() const = 0;
 
-   /// Get the bad runs list used by the tool
-   virtual const Root::TGRLCollection& getBRLCollection() const = 0;
 
-}; // class IGoodRunsListSelectionTool
+#warning Please use AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h
 
-#endif // GoodRunsLists_IGoodRunsListSelectionTool_H
+#include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
diff --git a/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml b/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml
index 0f95c225fbc53e24a363a337d481ca23cf782b2f..5ed3d8b5608eb77117a301d2cf5538b3e0ff6063 100644
--- a/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml
+++ b/DataQuality/GoodRunsLists/GoodRunsLists/selection.xml
@@ -2,8 +2,6 @@
 
   <!-- GoodRunsListSelectionTool -->
   <class name="GoodRunsListSelectionTool" />
-  <class name="ToolHandle<IGoodRunsListSelectionTool>" />
-  <class name="IGoodRunsListSelectionTool" />
   
 
   <exclusion>
diff --git a/DataQuality/GoodRunsLists/cmt/Makefile.RootCore b/DataQuality/GoodRunsLists/cmt/Makefile.RootCore
index 69136cbe1107a00037683e3ce8c34ecc7665024f..87251dcb88a7aaeb46451e8a6caa55e94f10faa1 100644
--- a/DataQuality/GoodRunsLists/cmt/Makefile.RootCore
+++ b/DataQuality/GoodRunsLists/cmt/Makefile.RootCore
@@ -1,9 +1,8 @@
 # Author: Max Baak (mbaak@cern.ch)
-# GoodRunsLists root stand-alone makefile
 
 PACKAGE          = GoodRunsLists
 PACKAGE_PRELOAD  = Tree TreePlayer XMLParser XMLIO
-PACKAGE_TRYDEP   = AsgTools xAODEventInfo PathResolver
+PACKAGE_TRYDEP   = AsgTools xAODEventInfo PathResolver AsgAnalysisInterfaces
 PACKAGE_CXXFLAGS = -I/usr/include/libxml2
 PACKAGE_BINFLAGS = -lxml2
 PACKAGE_PEDANTIC = 1
diff --git a/DataQuality/GoodRunsLists/cmt/requirements b/DataQuality/GoodRunsLists/cmt/requirements
index b076b38e83c4b377f7e295a6e3ca3c52730e0fde..3057bd3974fcc7a419c90992eaf94cbf455c549f 100644
--- a/DataQuality/GoodRunsLists/cmt/requirements
+++ b/DataQuality/GoodRunsLists/cmt/requirements
@@ -12,6 +12,8 @@ use  GaudiInterface             GaudiInterface-*                External
 use  xAODEventInfo               xAODEventInfo-*                 Event/xAOD
 use  AsgTools                   AsgTools-*                      Control/AthToolSupport
 
+use AsgAnalysisInterfaces      AsgAnalysisInterfaces-*          PhysicsAnalysis/Interfaces
+
 private
 use  DetectorStatus             DetectorStatus-*                DetectorDescription/DetDescrCond
 use  EventInfo                  EventInfo-*                     Event
diff --git a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h b/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h
index 9a9e0fe16ea6064531b0635608dc711adfc1390f..0ef736fde7507bc0e237813bfae2ac4849e20209 100644
--- a/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h
+++ b/DataQuality/GoodRunsLists/src/GRLSelectorAlg.h
@@ -8,7 +8,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't!
 
-#include "GoodRunsLists/IGoodRunsListSelectionTool.h"
+#include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
 
 ///Author: will buttinger
 ///To use this alg in your joboptions:
diff --git a/DataQuality/HanConfigGenerator/CMakeLists.txt b/DataQuality/HanConfigGenerator/CMakeLists.txt
index 0729afcec3fd6ce747fb2d3e999520062f11db3b..ced2067b7c9b2156966299c2c3638625ad316003 100644
--- a/DataQuality/HanConfigGenerator/CMakeLists.txt
+++ b/DataQuality/HanConfigGenerator/CMakeLists.txt
@@ -10,7 +10,7 @@ find_package( ROOT COMPONENTS Graf Gpad Cint Core Tree MathCore Hist RIO pthread
 
 
 atlas_add_executable( hcg
-                      src/hcg.cxx src/addnode.cxx
+                      src/hcg.cxx src/addnode.cxx src/utils.cxx
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                       LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
diff --git a/DataQuality/HanConfigGenerator/src/addnode.cxx b/DataQuality/HanConfigGenerator/src/addnode.cxx
index fd296d3d48a508a482973364c489a0d08c39c41b..c9fdbfd8d58c465a605519469f418a16a84a1b44 100644
--- a/DataQuality/HanConfigGenerator/src/addnode.cxx
+++ b/DataQuality/HanConfigGenerator/src/addnode.cxx
@@ -32,7 +32,5 @@ node* addnode( node* np, const std::string& name, TObject* td, node::TYPE t ) {
   np_->name( name );
   np_->type( t );
   
-  np->push_back( np_ );
-
   return np_;
 }   
diff --git a/DataQuality/HanConfigGenerator/src/hcg.cxx b/DataQuality/HanConfigGenerator/src/hcg.cxx
index 6ef04f2a97db942a147e2ac8d0be31a45981d073..f7c60d2b9719e4b4a419c059bf6e98e647bc4206 100644
--- a/DataQuality/HanConfigGenerator/src/hcg.cxx
+++ b/DataQuality/HanConfigGenerator/src/hcg.cxx
@@ -11,6 +11,7 @@
 //   $Id: hcg.cxx  Sat 13 May 2017 15:07:09 CEST sutt$
 
 
+
 #include <iostream>
 #include <vector>
 #include <string>
@@ -30,6 +31,7 @@
 #include "addnode.h"
 #include "spacer.h"
 
+#include "TROOT.h"
 #include "TStyle.h"
 #include "TCanvas.h"
 #include "TKey.h"
@@ -43,6 +45,8 @@
 #include "TPad.h"
 #include "TStyle.h"
 
+#include "utils.h"
+#include "hmap.h"
 
 
 /// file names and file pointers
@@ -52,24 +56,9 @@ std::vector<TFile*>      fptr;
 std::vector<std::string> savedhistos;
 std::vector<std::string> mapped;
 
-
-/// get the date *without* the return
-std::string date() { 
-  time_t _t;
-  time(&_t);
-  std::string a = ctime(&_t);
-  std::string b = "";
-  for ( unsigned i=0 ; i<a.size()-1 ; i++ ) b+=a[i];
-  return b;
-}
-
-
-bool file_exists( const std::string& file ) { 
-  struct stat buff;
-  return stat(file.c_str(),&buff)==0;   
-}
-
-bool verbose = false; 
+bool   verbose = false; 
+bool  vverbose = false; 
+bool vvverbose = false; 
 
 /// send output to here ...
 std::ostream* outp = &std::cout;
@@ -79,6 +68,8 @@ bool allhists = true;
 
 std::string base     = "HLT";
 
+std::vector<std::string> subdirs;
+
 std::string outref = "";
 
 std::string algorithm = "HLT_Histogram_Not_Empty&GatherData";
@@ -93,46 +84,6 @@ std::string description = "https://twiki.cern.ch/twiki/bin/view/Atlas/HltTrackin
 /// list of directories to be explicitly remapped
 std::map<std::string, std::string> remap;
 
-/// list of directories to be excluded
-std::set<std::string> exclude; 
-
-/// list of directories to be explicitly included, together with 
-/// corresponding depths of subdirectories
-std::map<std::string, int> dirs;
-
-
-std::vector<std::string> tags;
-
-template<typename T>
-std::ostream& operator<<( std::ostream& s, const std::vector<T>& v ) {
-  if ( v.empty() ) return s;
-  for ( size_t i=0 ; i<v.size() ; i++ ) s << v[i] << "\n";
-  return s;
-}
-
-bool contains( const std::string& s, const std::string& regx ) { return s.find(regx)!=std::string::npos; } 
-
-
-
-template<typename T>
-std::ostream& operator<<( std::ostream& s, const std::vector<T*>& v ) {
-  if ( v.empty() ) return s;
-  for ( int i=0 ; i<v.size() ; i++ ) s << *v[i] << "\n";
-  return s;
-}
-
-
-
-/// get a TObject* from a TKey* 
-/// (why can't a TObject be a TKey?)
-template<class T>
-T* get( TKey* tobj ) { 
-  TObject* a = tobj->ReadObj()->Clone();
-  ((TH1*)a)->SetDirectory(0);
-  return (T*)a;
-}
-
-
 /// return a remapped string
 std::string find( const std::string& s ) { 
   std::map<std::string, std::string>::const_iterator itr = remap.find(s);
@@ -141,294 +92,14 @@ std::string find( const std::string& s ) {
 } 
 
 
-/// count how many occurances of a regx are in a string 
-int count( std::string s, const std::string& regx ) {
-  size_t p = s.find( regx );
-  int i=0;
-  while ( p!=std::string::npos ) {
-    i++;
-    s.erase( 0, p+1 );
-    p = s.find( regx );
-  } 
-  return i;
-}
-
-
-
-
-// chop tokens off the front of a string
-std::string chop(std::string& s1, const std::string& s2)
-{
-  std::string::size_type pos = s1.find(s2);
-  std::string s3;
-  if ( pos == std::string::npos ) {
-    s3 = s1;
-    s1.erase(0, s1.size());
-  }
-  else {
-    s3 = s1.substr(0, pos); 
-    s1.erase(0, pos+s2.size());
-  }
-  return s3;
-} 
-
-
-std::vector<std::string> split( const std::string& s, const std::string& t=":"  ) {
-    
-    std::string _s = s;
-    size_t pos = _s.find(t);
-    
-    std::vector<std::string> tags;
-    
-    while ( pos!=std::string::npos ) { 
-      tags.push_back( chop(_s,t) );
-      pos = _s.find(t);
-    }
-    
-    tags.push_back(_s);
-    
-    return tags;
-}
-
-
-// chop tokens off the front of a string but not including 
-// chop character
-std::string chopex(std::string& s1, const std::string& s2)
-{
-  std::string::size_type pos = s1.find(s2);
-  std::string s3;
-  if ( pos == std::string::npos ) {
-    s3 = s1;
-    s1.erase(0, s1.size());
-  }
-  else {
-    s3 = s1.substr(0, pos); 
-    s1.erase(0, pos+s2.size());
-  }
-  return s3;
-} 
-
-
-// chomp them off the end
-std::string chomp(std::string& s1, const std::string& s2)
-{
-  std::string::size_type pos = s1.find(s2);
-  std::string s3;
-  if ( pos == std::string::npos ) {
-    s3 = s1;
-    s1.erase(0,s1.size());    
-  }
-  else {
-    s3 = s1.substr(pos+s2.size(),s1.size());
-    s1.erase(pos,s1.size()); 
-  } 
-  return s3;
-} 
-
-
-
-// chop tokens off the end of a string, leave string unchanged
-// return choped string
-std::string choptoken(std::string& s1, const std::string& s2)
-{
-  std::string s3 = "";
-  std::string::size_type pos = s1.find(s2);
-  if ( pos != std::string::npos ) {
-    s3 = s1.substr(0, pos+s2.size()); 
-    s1.erase(0, pos+s2.size());
-  }
-  return s3;
-} 
-
-
-// chop tokens off the end of a string, leave string unchanged
-// return choped string
-std::string chomptoken(std::string& s1, const std::string& s2)
-{
-  std::string s3 = "";
-  std::string::size_type pos = s1.find(s2);
-  if ( pos != std::string::npos ) {
-    s3 = s1.substr(pos, s1.size());
-    s1.erase(pos, s1.size()); 
-  }
-  return s3;
-} 
-
-
-// chop tokens off the front of a string
-std::string chopfirst(std::string& s1, const std::string& s2)
-{
-  std::string s3;
-  std::string::size_type pos = s1.find_first_not_of(s2);
-  if ( pos != std::string::npos ) {
-    s3 = s1.substr(0, pos); 
-    s1.erase(0, pos);
-  }
-  else {
-    s3 = s1;
-    s1 = "";
-  } 
-  return s3;
-} 
-
-
-std::string choplast(std::string& s1, const std::string& s2)
-{
-  std::string s3 = "";
-  std::string::size_type pos = s1.find_last_not_of(s2);
-  if ( pos != std::string::npos ) {
-    s3 = s1.substr(pos+1, s1.size());
-    s1.erase(pos+1, s1.size());
-  }
-  return s3;
-} 
-
-
-
-// chop tokens off the front and end of a string
-std::string chopends(std::string& s1, const std::string& s2)
-{
-  chopfirst(s1, s2);
-  choplast(s1, s2);
-  return s1;
-} 
-
-
-
-// remove strings from a string
-void removespace(std::string& s, const std::string& s2) 
-{
-  std::string::size_type pos;
-  while ( (pos = s.find(s2))!=std::string::npos ) {
-    s.erase(pos, s2.size());
-  }
-} 
-
-
-// replace from a string
-std::string replace( std::string s, const std::string& s2, const std::string& s3) {
-  std::string::size_type pos;
-  //  while ( (pos = s.find(" "))!=std::string::npos ) {
-  //    s.replace(pos, 1, "-");
-  while ( (pos = s.find(s2))!=std::string::npos ) {
-    s.replace(pos, s2.size(), s3);
-    if ( contains(s3,s2) ) break;
-  }
-  return s;
-} 
-
-
-// remove regx from a string
-void depunctuate(std::string& s, const std::string& regx=":") 
-{
-  std::string::size_type pos;
-  while ( (pos = s.find(regx))!=std::string::npos ) {
-    s.erase(pos, regx.size());
-  }
-} 
-  
-
-
-
-std::string chopto( std::string& s, const std::string& pattern ) { 
-  std::string tag;
-  std::string::size_type pos = s.find_first_of( pattern );
-  if ( pos==std::string::npos ) { 
-    tag = s;
-    s = "";
-  }
-  else { 
-    tag = s.substr(0,pos);
-    s.erase( 0, pos ); 
-  }
-  return tag;
-}
-
-
-// remove strings from a string
-bool remove( std::string& s, const std::string& s2 ) 
-{
-  std::string::size_type ssize = s.size();
-  std::string::size_type pos;
-  while ( (pos=s.find(s2))==0 ) s.erase(pos, s2.size());
-  if ( ssize!=s.size() ) return true;
-  else                   return false;
-} 
-
-
-class histogram : public std::string { 
-  
-public:
-
-  histogram( std::string s="" ) : std::string(s) { construct( s ); }
-  histogram( const char* s    ) : std::string(s) { construct( std::string(s) ); }
-  
-  std::vector<std::string>&       dirs()       { return mdirs; }
-  const std::vector<std::string>& dirs() const { return mdirs; }
-
-private:
-  
-  void construct( std::string s ) { 
-    std::string::size_type pos = s.find("/");
-    while ( pos!=std::string::npos ) { 
-      std::string s0 = chop( s, "/" );
-      mdirs.push_back(s0);
-      pos = s.find("/");
-    } 
-    mdirs.push_back(s);
-  } 
-
-protected:
-
-  std::vector<std::string> mdirs;
-
-};
-
-
-
-/// simple error reporting class - should probably throw an exception, 
-/// only this is simpler
-void error( int i, std::ostream& s ) {  s << std::endl; std::exit(i);  }
-
-
-/// map instances to allow setting of the algorithms 
-/// and descriptions
-
-class hmap_t : public std::map<histogram,std::string> { 
-
-public:
-
-  /// sadly, when matching regular expressions, we need to iterate 
-  /// through the map and cannot use the standard map::find() methods
-  /// which sadly, slows the searching down
-
-  virtual std::map<histogram,std::string>::iterator find( const std::string& s ) {
-    return std::map<histogram,std::string>::find( s );
-  }
-
-  virtual std::map<histogram,std::string>::const_iterator find( const std::string& s ) const { 
-    return std::map<histogram,std::string>::find( s );
-  }
+/// list of directories to be excluded
+std::set<std::string> exclude; 
 
-  virtual std::map<histogram,std::string>::iterator match( const std::string& s ) {
-    std::map<histogram,std::string>::iterator  itr = begin();
-    while( itr!=end() ) { 
-      if ( std::regex_match( s, std::regex(itr->first) ) ) return itr;
-      itr++;
-    }
-    return itr;
-  }
+/// list of directories to be explicitly included, together with 
+/// corresponding depths of subdirectories
+std::map<std::string, int> dirs;
 
-  virtual std::map<histogram,std::string>::const_iterator match( const std::string& s ) const { 
-    std::map<histogram,std::string>::const_iterator  itr = begin();
-    while( itr!=end() ) { 
-      if ( std::regex_match( s, std::regex(itr->first) ) ) return itr;
-      itr++;
-    }
-    return itr;
-  }
-  
-};
+std::vector<std::string> tags;
 
 
 /// store any user histogram to algorithm mapping
@@ -449,8 +120,8 @@ hmap_t  wildcards;
 
 
 /// look in a histogram name map and return the regex mapped property name
-/// goes up the tree as far as to 2 subdirectory names of additional 
-/// specialisation for the histogram names  
+/// goes up the tree of subdirectory name of additional 
+/// specialisation for the histogram names all the way to the top if need be 
 /// NB: take care, this is a recursive algorithm !!!
  
 std::string match( const hmap_t& m, const node* n, const std::string& obj, const std::string& property ) {    
@@ -465,17 +136,9 @@ std::string match( const hmap_t& m, const node* n, const std::string& obj, const
 
 
 
-bool find( const std::string& s, const std::vector<std::string>& regexv ) { 
-  for ( unsigned i=regexv.size() ; i-- ; ) if ( std::regex_match( s, std::regex(regexv[i]) ) ) return true;
-  return false;
-} 
-
-
-
-
 /// look in a histogram name map and return the mapped property name
-/// goes up the tree as far as to 2 subdirectory names of additional 
-/// specialisation for the histogram names  
+/// goes up the tree of subdirectory names of additional 
+/// specialisation for the histogram names all the way to the top if need be 
 /// NB: take care, this is a recursive algorithm !!!
 
 std::string find_internal( const hmap_t& m, const node* n, const std::string& obj, const std::string& property ) {  
@@ -503,9 +166,9 @@ std::string find( const hmap_t& m, const node* n, const std::string& obj, const
 
 /// parse and individual line - must have the syntax: tag = "value";  
 
-bool parse( const std::string _line, histogram& tag, std::string& val, bool requirequotes=true ) {
+bool parse( const std::string& linein, histogram_name& tag, std::string& val, bool requirequotes=true ) {
   
-  std::string line = _line;
+  std::string line = linein;
 
   tag = "";
   val = "";
@@ -514,20 +177,20 @@ bool parse( const std::string _line, histogram& tag, std::string& val, bool requ
   if ( line.size()==0 ) return false;
   tag = chopto( line, " =" );
   remove( line, " " );  
-  if ( !remove( line, "=" ) ) error( 1, std::cerr << "error : tag incorrectly specified\n\t" << _line ); 
+  if ( !remove( line, "=" ) ) error( 1, std::cerr << "error : tag incorrectly specified\n\t" << linein ); 
   remove( line, " " ); 
   if ( requirequotes ) { 
-    if ( !( line.size()>1 && (val += line[0])=="\"" ) ) error( 1, std::cerr << "error : incorrect value syntax - no opening quote\n\t" << _line );
+    if ( !( line.size()>1 && (val += line[0])=="\"" ) ) error( 1, std::cerr << "error : incorrect value syntax - no opening quote\n\t" << linein );
     remove( line, "\"" );
     val += chopto( line, "\"" )+"\"";
-    if ( !( line.size()>0 && line[0]=='"' ) )  error( 1, std::cerr << "error : incorrect value syntax - no closing quote\n\t" << _line ); 
+    if ( !( line.size()>0 && line[0]=='"' ) )  error( 1, std::cerr << "error : incorrect value syntax - no closing quote\n\t" << linein ); 
     remove( line, "\"" );
   }
   else { 
     val += chopto( line, ";" );
   }
   remove( line, " " );
-  if ( line.size()<1 || line[0]!=';' )  error( 1, std::cerr << "error : incorrect value syntax - line not correctly terminated\n\t" << _line );
+  if ( line.size()<1 || line[0]!=';' )  error( 1, std::cerr << "error : incorrect value syntax - line not correctly terminated\n\t" << linein );
 
   return true;
 }
@@ -541,13 +204,12 @@ std::vector<std::string> read_lines( const std::string& filename ) {
   
   std::vector<std::string> lines;
   
-  std::string buffer;
-  
 
   /// add some padding at the beginning and end, extraxt file 
   /// contents to a more easily managed string 
+
   char c;
-  buffer = " ";
+  std::string buffer = " ";  
   while ( file.get(c) ) buffer += c;
   buffer += " ";
 
@@ -589,12 +251,13 @@ std::vector<std::string> read_lines( const std::string& filename ) {
 
 std::vector<std::string> parse_wc( const std::string& filename ) { 
   
-  std::vector<std::string> _lines = read_lines( filename ); 
+  std::vector<std::string> lines = read_lines( filename ); 
 
   std::vector<std::string> out;
-  
-  for ( unsigned i=0 ; i<_lines.size() ; i++ ) {
-    std::string line = _lines[i];
+  out.reserve( lines.size() );
+
+  for ( unsigned i=0 ; i<lines.size() ; i++ ) {
+    std::string line = lines[i];
     remove( line, " " );  
     std::string val = chopto( line, " ;" );
     if ( val.size() ) out.push_back( val );
@@ -612,8 +275,8 @@ hmap_t  parse( const std::string& filename, bool requirequotes=true ) {
   /// now parse each line 
     
   for ( unsigned i=0 ; i<lines.size() ; i++ ) { 
-    histogram     tag = "";
-    std::string value = "";
+    histogram_name     tag = "";
+    std::string      value = "";
     if ( parse( lines[i], tag, value, requirequotes ) ) lookup.insert( hmap_t::value_type( tag, value ) );
   }
 
@@ -767,7 +430,6 @@ public:
 	if ( contains( dir, "run_" ) ) {
 	  dir.erase( 0, std::string( "run_").size() ); 
 	  mrun = std::atoi( dir.c_str() );
-	  
 	  break;
 	}
        
@@ -875,16 +537,11 @@ public:
       
       /// always try to remap the name
 
-      //      bool exclude_dir = false;
-
       if ( exclude.find(n.name())!=exclude.end() )  { 
 	print = false;
-	//	exclude_dir = true;
 	return;
       }
 
-      //      if ( found && ( dirs.size() && dirs.find(n.name())==dirs.end() ) ) print = false;
-   
       std::string newspacer = space;
       
       if ( print ) newspacer += spacer;
@@ -979,18 +636,18 @@ public:
 	if       ( n[i]->type()!=node::HISTOGRAM ) makeass( *n[i], newspacer, path, rawpath, found ) ;
 	else if  ( n[i]->type()==node::HISTOGRAM ) { 
 
-	  std::string allhists = "";
-	  if ( n[i]->parent() ) allhists = find( wildcards, n[i]->parent(), n[i]->parent()->name(), "" ); 
+	  std::string allhst = "";
+	  if ( n[i]->parent() ) allhst = find( wildcards, n[i]->parent(), n[i]->parent()->name(), "" ); 
 
-	  //	  std::cerr << "allhists: " << n[i]->parent()->name() << "\tall: " << allhists << ":" << std::endl;
+	  //	  std::cerr << "allhst: " << n[i]->parent()->name() << "\tall: " << allhst << ":" << std::endl;
 
-	  std::string _algorithm = algorithm;
+	  std::string algorithm_tmp = algorithm;
 
-	  if ( !mallhists || allhists!="" ) { 
+	  if ( !mallhists || allhst!="" ) { 
 	    if ( first_hists ) {
-	      if ( allhists!="" ) _algorithm = allhists; 
+	      if ( allhst!="" ) algorithm_tmp = allhst; 
 	      (*outp) << space << "\t"   << "hist   all_in_dir {\n";
- 	      if ( _algorithm!="NULL" && _algorithm!="0" ) (*outp) << space << "\t\t" << "algorithm   \t= " << _algorithm << "\n";
+ 	      if ( algorithm_tmp!="NULL" && algorithm_tmp!="0" ) (*outp) << space << "\t\t" << "algorithm   \t= " << algorithm_tmp << "\n";
 	      (*outp) << space << "\t\t" << "description \t= " << description << "\n";
 	      (*outp) << space << "\t\t" << "output      \t= " << path << "\n";
 	      (*outp) << space << "\t\t" << "display     \t= StatBox\n";
@@ -1002,15 +659,16 @@ public:
 	  }
 	  else { 
 	    
-	    std::string _algorithm   = find( algorithms,   n[i], n[i]->name(), algorithm );
-	    std::string _description = find( descriptions, n[i], n[i]->name(), description );
-	    std::string _display     = find( displays,     n[i], n[i]->name(), "StatBox" );
+	    std::string algorithm_tmp   = find( algorithms,   n[i], n[i]->name(), algorithm );
+	    std::string description_tmp = find( descriptions, n[i], n[i]->name(), description );
+	    std::string display_tmp     = find( displays,     n[i], n[i]->name(), "StatBox" );
 
+	    if ( vverbose ) std::cout << "histogram: " << n[i]->path() << "\n";
 	    (*outp) << space << "\t"   << "hist " << n[i]->name() << " {\n";
-	    (*outp) << space << "\t\t" << "algorithm   \t= " << _algorithm << "\n";
-	    (*outp) << space << "\t\t" << "description \t= " << _description << "\n";
-	    (*outp) << space << "\t\t" << "output      \t= " << path << "\n";
-	    (*outp) << space << "\t\t" << "display     \t= " << _display << "\n";
+	    (*outp) << space << "\t\t" << "algorithm   \t= " << algorithm_tmp   << "\n";
+	    (*outp) << space << "\t\t" << "description \t= " << description_tmp << "\n";
+	    (*outp) << space << "\t\t" << "output      \t= " << path        << "\n";
+	    (*outp) << space << "\t\t" << "display     \t= " << display_tmp << "\n";
 	    /// extra user specified tags
 	    for ( unsigned it=0 ; it<tags.size() ; it++ ) (*outp) << space << "\t\t" << replace(tags[it],"=","\t=") << "\n";
 	    (*outp) << space << "\t"   << "}\n";
@@ -1054,6 +712,8 @@ void search( TDirectory* td, const std::string& s, std::string cwd, node* n ) {
   if ( std::string(td->GetName()).find("_LB")!=std::string::npos ) return;
   if ( std::string(td->GetName()).find("lb_")!=std::string::npos ) return;
 
+  if ( std::regex_match( std::string(td->GetName()), std::regex("run_.*") ) ) std::cerr << "run: " << td->GetName() << "\n";
+
   //  std::cout << "search() in  " << s << td->GetName() << ":    :" << cwd << ":" << std::endl;
 
   static int ir = 0;
@@ -1072,6 +732,8 @@ void search( TDirectory* td, const std::string& s, std::string cwd, node* n ) {
 
   //  gDirectory->pwd();
 
+  std::string basedir = here->GetName();
+
   td->cd();
   
   if ( cwd!="" ) cwd += "/";
@@ -1122,7 +784,8 @@ void search( TDirectory* td, const std::string& s, std::string cwd, node* n ) {
   }
   
 
-  if ( found_dir ) { 
+  if ( found_dir ) {
+    if ( basedir==base )  np->path( basedir );
     node* np_ = addnode( np, fulldir, td );
     np = np_;
   }
@@ -1226,6 +889,59 @@ void search( TDirectory* td, const std::string& s, std::string cwd, node* n ) {
 
 
 
+std::vector<int> lumiblockrange( TDirectory* idir, int depth=0 ) {
+  
+  std::string dir = idir->GetName();
+  
+  if ( depth>1 || ( depth>0 && !contains( dir, "run_" ) ) ) return std::vector<int>(0);
+  
+  TList* tl  = gDirectory->GetListOfKeys();
+  
+  /// go through sub directories                                                                                                                                                                         
+  
+  std::vector<int> limits;
+  
+  for ( int i=0 ; i<tl->GetSize() ; i++ ) {
+    
+    TKey* tobj = (TKey*)tl->At(i);
+    
+    if ( std::string(tobj->GetClassName()).find("TDirectory")!=std::string::npos ) {
+      
+      TDirectory* tnd = (TDirectory*)tobj->ReadObj();
+      
+      std::string tdir = tnd->GetName();
+      
+      if ( contains( tdir, "run_" ) ) { 
+        tnd->cd();
+        return lumiblockrange( tnd, depth+1 );
+      }
+      else { 
+        
+        /// search through for lumi block directories 
+        
+        if ( contains( tdir, "lb_" ) ) { 
+          
+          if ( limits.size()<2 ) { 
+            limits.resize(2);
+            limits[0] = limits[1] = 0;
+          }
+
+          int lb = std::atoi( tdir.erase( 0, std::string( "lb_").size() ).c_str()); 
+          if ( limits[0]==0 || ( limits[0]!=0 && lb<limits[0] ) ) limits[0] = lb;
+          if ( lb>limits[1] ) limits[1] = lb;
+
+        }
+      }
+      
+    }
+  }  
+
+  idir->cd();
+  return limits;
+}
+
+
+
 
 
 
@@ -1259,6 +975,13 @@ int cost( std::vector<std::string>& files, node& n, const std::string& directory
   
     fptr[i]->cd();
 
+    TDirectory* cwd = gDirectory;
+    std::vector<int> lbrange = lumiblockrange( gDirectory );
+
+    if ( lbrange.size()>1 ) std::cout << "lumiblockrange: blocks: " << lbrange[0] << "  " << lbrange[1] << std::endl; 
+    cwd->cd();
+
+
     if ( directory!="" ) fptr[i]->cd(directory.c_str());    
 
     TDirectory* here = gDirectory;
@@ -1268,7 +991,7 @@ int cost( std::vector<std::string>& files, node& n, const std::string& directory
     //    int tcount = 0;
 
     /// navigate the directory structure to 
-    /// extracting all the info
+    /// extract all the info
 
     search( gDirectory, "", "", &n );
 
@@ -1290,35 +1013,37 @@ int cost( std::vector<std::string>& files, node& n, const std::string& directory
       TFile* fnew = new TFile( outref.c_str(), "recreate" );
       fnew->cd();
 
-      TDirectory*  base = gDirectory;
+      TDirectory*  based = gDirectory;
 
       if ( mapped.size() != savedhistos.size() ) mapped = savedhistos;
 
       for ( unsigned ih=0 ; ih<savedhistos.size() ; ih++ ) { 
 	
-	std::vector<std::string> dirs = split( mapped[ih], "/" );
+	std::vector<std::string> ldirs = split( mapped[ih], "/" );
 
-	for ( unsigned jh=0 ; jh<dirs.size()-1 ; jh++ ) { 
-	  /// std::cerr << "\t" << dirs[jh] << std::endl;
-	  TDirectory* renedir = gDirectory->GetDirectory( dirs[jh].c_str() );
-	  if ( renedir==0 ) gDirectory->mkdir( dirs[jh].c_str() );
-	  gDirectory->cd( dirs[jh].c_str() );
+	for ( unsigned jh=0 ; jh<ldirs.size()-1 ; jh++ ) { 
+	  TDirectory* renedir = gDirectory->GetDirectory( ldirs[jh].c_str() );
+	  if ( renedir==0 ) gDirectory->mkdir( ldirs[jh].c_str() );
+	  gDirectory->cd( ldirs[jh].c_str() );
 	}
 	
 	TH1* href  = (TH1*)fptr[i]->Get( savedhistos[ih].c_str() );
 	if ( href ) {
 	  //	  std::cerr << ih << " " << savedhistos[ih] << " 0x" << href << std::endl;
-	  href->Write( dirs.back().c_str() );
+	  href->Write( ldirs.back().c_str() );
 	}
 
-	base->cd();
+	based->cd();
       }
 
 
     }
 
     std::cerr << "closing files" << std::endl; 
-        
+
+    /// why, why, why, why, why-oh-why does root take such a 
+    /// long time to close the file without this ?
+    gROOT->GetListOfFiles()->Remove(fptr[i]);
     fptr[i]->Close();
 
     delete fptr[i];
@@ -1344,6 +1069,7 @@ int cost( std::vector<std::string>& files, node& n, const std::string& directory
 
 int usage(std::ostream& s, int , char** argv, int status=-1) { 
   s << "Usage: " << argv[0] << " [OPTIONS] input1.root ... inputN.root\n\n";
+  s << "Options:\n";
   s << "    -o                FILENAME  \tname of output (filename required)\n";
   s << "    -b,   --base      DIR       \tuse directory DIR as the base for the han config\n";
   s << "    -d,   --dir       DIR       \tonly directories below DIR where DIR is a structure such as HLT/TRIDT etc\n";
@@ -1365,6 +1091,8 @@ int usage(std::ostream& s, int , char** argv, int status=-1) {
   s << "    -ref, --reference TAG FILE  \tadd FILE as a reference file with tag TAG\n";
   s << "    -rc,  --refconf       FILE  \tadd FILE to the config as a reference block\n";
   s << "    -v,   --verbose             \tprint verbose output\n";
+  s << "    -vv,  --vverbose            \tprint very verbose output\n";
+  s << "    -vvv, --vvverbose           \tprint very, very verbose output\n";
   s << "    -h,   --help                \tdisplay this help\n";
   s << std::endl;
   return status;
@@ -1411,8 +1139,6 @@ int main(int argc, char** argv) {
   
   std::string dir = "";
 
-  std::vector<std::string> subdirs;
-
   std::string              wildcardfile;
 
 
@@ -1429,12 +1155,15 @@ int main(int argc, char** argv) {
 
   int offset = 1;
 
+  bool basechanged = false;
 
   for ( int i=1 ; i<argc ; i++ ) { 
 
     std::string argvi = std::string(argv[i]);
 
-    if      ( argvi=="-v" || argvi=="--verbose" ) verbose = true;
+    if      ( argvi=="-v"   || argvi=="--verbose"  )  verbose = true;
+    else if ( argvi=="-vv"  || argvi=="--vverbose" )  verbose = vverbose = true;
+    else if ( argvi=="-vvv" || argvi=="--vvverbose" ) verbose = vverbose = vvverbose = true;
     else if ( argvi=="-o" ) {
       if ( ++i<argc-offset ) outfile = argv[i];
       else  return usage( std::cerr, argc, argv );
@@ -1471,7 +1200,8 @@ int main(int argc, char** argv) {
 	  do { 
 	    subdirs.push_back( chop( tdir, "/" ) );
 	  } 
-	  while ( tdir.size() ); 
+	  while ( tdir.size() );
+	  if ( !basechanged && subdirs.size() ) base = subdirs[0];
       }
       else  return usage( std::cerr, argc, argv );
     } 
@@ -1497,8 +1227,8 @@ int main(int argc, char** argv) {
     } 
     else if ( argvi=="-wd" || argvi.find("--wcdir")==0 ) {
       if ( ++i<argc-offset ) { 
-	histogram     tag="";
-	std::string value="";
+	histogram_name     tag="";
+	std::string      value="";
 	/// parse the input string - add a terminating ";" just in case 
 	if ( parse( std::string(argv[i])+";", tag, value, false ) ) wildcards.insert( hmap_t::value_type( tag, value ) );
 	else  return usage( std::cerr << "Could not parse wildcard directory", argc, argv );
@@ -1514,7 +1244,10 @@ int main(int argc, char** argv) {
       else  return usage( std::cerr, argc, argv );
     } 
     else if ( argvi=="-b" || argvi=="--base" ) {
-      if ( ++i<argc-offset ) base = argv[i] ;
+      if ( ++i<argc-offset ) { 
+	base = argv[i] ;
+	basechanged = true;
+      }
       else  return usage( std::cerr, argc, argv );
     } 
     else if ( argvi=="-a" || argvi=="--algorithm" ) {
@@ -1599,11 +1332,15 @@ int main(int argc, char** argv) {
 
   /// create the structure ...
 
-  node n(0, "" );
+  node n(0, "");
   n.name( "top_level" );
 
+  //  if ( verbose ) std::cout << "run: " << mrun << " " << dir << "\n"; 
+
   int status = cost( files, n, "", deleteref, relocate );
 
+  if ( vvverbose )  travel( &n );
+
   //  std::cerr << "\n\nnodes " << n << std::endl;
 
   if ( status ) return status;
diff --git a/DataQuality/HanConfigGenerator/src/hmap.h b/DataQuality/HanConfigGenerator/src/hmap.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a5b635afa53eb043cd90dcd39dc3997dcb15361
--- /dev/null
+++ b/DataQuality/HanConfigGenerator/src/hmap.h
@@ -0,0 +1,94 @@
+// emacs: this is -*- c++ -*-
+//
+//   @file    hmap.h        
+//            class to store map of regular expressions and corresponding
+//            values 
+//                    
+//   @author M.Sutton
+// 
+//   Copyright (C) 2013 M.Sutton (sutt@cern.ch)    
+//
+//   Mon  6 Aug 2017 03:13:34 CEST sutt
+
+
+#ifndef  HANCONFIGGENERATOR_HMAP_H
+#define  HANCONFIGGENERATOR_HMAP_H
+
+#include <iostream>
+#include <regex>
+
+
+typedef std::string histogram_name;
+
+
+/// map class to allow setting of the algorithms 
+/// and descriptions
+
+class hmap_t : private std::map<histogram_name,std::string> { 
+
+public:
+
+  typedef std::map<histogram_name,std::string> map_type;
+
+  using map_type::value_type;
+  using map_type::insert;
+
+  using map_type::size;
+  using map_type::const_iterator;
+  using map_type::begin;
+  using map_type::end;
+
+public:
+
+  /// sadly, when matching regular expressions, we need to iterate 
+  /// through the map and cannot use the standard map::find() methods
+  /// which sadly, slows the searching down
+
+  virtual std::map<histogram_name,std::string>::iterator find( const std::string& s ) {
+    return std::map<histogram_name,std::string>::find( s );
+  }
+
+  virtual std::map<histogram_name,std::string>::const_iterator find( const std::string& s ) const { 
+    return std::map<histogram_name,std::string>::find( s );
+  }
+
+  virtual std::map<histogram_name,std::string>::iterator match( const std::string& s ) {
+    std::map<histogram_name,std::string>::iterator  itr = begin();
+    while( itr!=end() ) { 
+      if ( std::regex_match( s, std::regex(itr->first) ) ) return itr;
+      itr++;
+    }
+    return itr;
+  }
+
+  virtual std::map<histogram_name,std::string>::const_iterator match( const std::string& s ) const { 
+    std::map<histogram_name,std::string>::const_iterator  itr = begin();
+    while( itr!=end() ) { 
+      if ( std::regex_match( s, std::regex(itr->first) ) ) return itr;
+      itr++;
+    }
+    return itr;
+  }
+  
+};
+
+
+inline std::ostream& operator<<( std::ostream& s, const hmap_t& h ) { 
+  for ( hmap_t::const_iterator itr=h.begin() ; itr!=h.end() ; itr++ ) {
+    s << "[ " << itr->first << "\t : " << itr->second << " ]\n";
+  }
+  return s;
+}
+
+
+#endif  // HANCONFIGGENERATOR_HMAP_H 
+
+
+
+
+
+
+
+
+
+
diff --git a/DataQuality/HanConfigGenerator/src/makefile b/DataQuality/HanConfigGenerator/src/makefile
index 74930eec4662b31d8a896ac50cd953498b2f16d6..6e4e5a20aa457072d3c46413336cc508d1852be1 100644
--- a/DataQuality/HanConfigGenerator/src/makefile
+++ b/DataQuality/HanConfigGenerator/src/makefile
@@ -1,15 +1,27 @@
 
 
+
+ifeq ($(AtlasEvent_PLATFORM),)
+  ifeq ($(PLATFORM),)
+    ATLAS_ARCH = $(shell uname)
+  else 
+    ATLAS_ARCH = $(PLATFORM)
+  endif
+else
+  ATLAS_ARCH = $(AtlasEvent_PLATFORM)
+endif
+
+
+
 ROOTCFLAGS = $(shell root-config --cflags)
 ROOTLIBS   = $(shell root-config --libs)
 
-SOURCES = hcg.cxx addnode.cxx
+SOURCES = hcg.cxx addnode.cxx utils.cxx
 
-# install : hcg
-# 	cp hcg $(HOME)/bin 
+INSTALLDIR=$(TestArea)/build/$(ATLAS_ARCH)/bin
 
 hcg : $(SOURCES) 
-	g++ $(ROOTCFLAGS) -O3 -o $@ $(SOURCES) $(ROOTLIBS) $(READLIB)
+	g++ $(ROOTCFLAGS) -Wall -O3 -o $@ $(SOURCES) $(ROOTLIBS) $(READLIB)
 
 archive :  $(SOURCES) node.h addnode.h simpletimer.h spacer.h makefile README
 	tar -czf hcg.tgz $?
@@ -17,5 +29,8 @@ archive :  $(SOURCES) node.h addnode.h simpletimer.h spacer.h makefile README
 install : hcg
 	cp hcg $(HOME)/bin
 
+ginstall : hcg
+	cp hcg $(INSTALLDIR)
+
 clean : 
-	rm hcg
+	rm -f hcg
diff --git a/DataQuality/HanConfigGenerator/src/node.h b/DataQuality/HanConfigGenerator/src/node.h
index cbf5fcfaf59fe81089f145cad48236fb77c7f0fb..ed3cad163206d8c759d1628d05b13fe0fa1a5f5c 100644
--- a/DataQuality/HanConfigGenerator/src/node.h
+++ b/DataQuality/HanConfigGenerator/src/node.h
@@ -2,38 +2,56 @@
 //
 //   @file    node.h        
 //
-//                   
-//  
+//                    
 //   Copyright (C) 2016 M.Sutton (sutt@cern.ch)    
 //
 //   $Id: node.h, v0.0   Fri  8 Apr 2016 00:57:16 CEST sutt $
 
 
-#ifndef  NODE_H
-#define  NODE_H
+#ifndef  HANCONFIGGENERATOR_NODE_H
+#define  HANCONFIGGENERATOR_NODE_H
 
 #include <iostream>
 #include <string>
 #include <vector>
+#include <regex>
 
 
 #include "TObject.h"
 
-class node : public std::vector<node*> {
+class node : private std::vector<node*> { 
 
 public: 
 
   enum TYPE { HISTOGRAM, DIRECTORY, DUFF }; 
-  
+
 public:
+
+  using std::vector<node*>::size;
+  using std::vector<node*>::operator[];
+  using std::vector<node*>::at;
+  using std::vector<node*>::push_back;
   
+public:
+
+  /// if they have a parent, nodes push themselves back onto 
+  /// their parent's child list 
+ 
   node( node* n=0, const std::string d="", TObject* t=0 ) : 
-    mname("duff"), mparent(n), mtype(DUFF), mpath(""), mdepth(d), mobj(t) { 
+    mname("duff"), mparent(n), mtype(DUFF), mpath( n && n->path()!="" ? n->path()+"/" : "" ), mdepth(d), mobj(t) { 
     if ( t!=0 )  mname = t->GetName();
-    mhirate = std::pair<std::string, double>( "", 0); 
+    mhirate = std::pair<std::string, double>( "", 0);
+    if ( t!=0 ) mpath += mname;
+    if ( mparent ) mparent->push_back( this );
   } 
   
-  virtual ~node() { } 
+  virtual ~node() { 
+    /// delete the children
+    for ( int i=0 ; i<size(); i++ ) delete at(i);
+    /// now clear the vector in code this node in a tree and is 
+    /// being deleted before the head of the tree  
+    clear();
+  } 
 
   void               name( const std::string& n)  { mname=n; }
   const std::string& name() const { return mname; }
@@ -68,8 +86,7 @@ public:
 
   const std::pair<std::string, double>& rate() const { return mhirate; }
 
-
-public:
+private:
 
   std::string mname;
   node*       mparent;
@@ -83,6 +100,8 @@ public:
 
   std::pair<std::string, double> mhirate; 
 
+  std::vector<node*> mchildren;
+
 };
 
 
@@ -93,7 +112,7 @@ inline std::ostream& operator<<( std::ostream& s, const node& n ) {
   else if ( n.size() ) {  
     if ( n.parent() ) s << "\t( parent " << n.parent()->name() << " )";
     if ( n.rate().first!="" )s << "\t\t:::(max rate chain " << n.rate().first << " " << n.rate().second << " ):::";
-    for ( unsigned i=0 ; i<n.size() ; i++ ) { 
+    for ( size_t i=0 ; i<n.size() ; i++ ) { 
       //      if ( n[i]->type()!=node::HISTOGRAM ) 
       s << "\n" << i << " " << n.depth() << " " << *n[i];
     }
@@ -104,7 +123,35 @@ inline std::ostream& operator<<( std::ostream& s, const node& n ) {
 
 
 
-#endif  // NODE_H 
+/// lovely recursive function to traverse the 
+/// entire tree
+
+inline std::string travel( node* n, const std::string& regx="", int depth=0 ) { 
+  if ( n==0 ) return ""; 
+
+  if ( regx!="" && std::regex_match( n->name(), std::regex(regx) ) ) return n->name();
+  
+  if ( regx=="" ) {
+    for ( int i=0 ; i<depth ; i++ ) std::cout << "\t";
+    std::cout << n->name()  << "\t" << n->path();
+    //   if  ( n->size()==0 && n->type()==node::HISTOGRAM ) std::cout << " ::H";
+    std::cout << "\n";
+  }
+
+  for ( size_t i=0 ; i<n->size() ; i++ ) {
+    std::string s = travel( n->at(i), regx, depth+1 );
+    if ( s!="" ) return s;
+  }
+
+  return "";
+}
+
+
+
+
+
+
+#endif  // HANCONFIGGENERATOR_NODE_H
 
 
 
diff --git a/DataQuality/HanConfigGenerator/src/utils.cxx b/DataQuality/HanConfigGenerator/src/utils.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c0a51481a7b971ad6b81d159030e9c4c6af8bf52
--- /dev/null
+++ b/DataQuality/HanConfigGenerator/src/utils.cxx
@@ -0,0 +1,274 @@
+// emacs: this is -*- c++ -*-
+//
+//   @file    utils.cxx        
+//            utility functions
+//                    
+//   @author M.Sutton
+// 
+//   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+//   Copyright (C) 2013 M.Sutton (sutt@cern.ch)    
+//
+//   Mon 31 July 2017 08:42:16 CEST sutt
+
+
+
+
+#include <sys/stat.h>
+#include <regex>
+
+
+#include "utils.h"
+
+
+/// get the date *without* the return
+std::string date() { 
+  time_t _t;
+  time(&_t);
+  std::string a = ctime(&_t);
+  std::string b = "";
+  for ( unsigned i=0 ; i<a.size()-1 ; i++ ) b+=a[i];
+  return b;
+}
+
+
+bool file_exists( const std::string& file ) { 
+  struct stat buff;
+  return stat(file.c_str(),&buff)==0;   
+}
+
+
+
+/// match a pattern from a vector of possible patterns
+bool find( const std::string& s, const std::vector<std::string>& regexv ) { 
+  for ( unsigned i=regexv.size() ; i-- ; ) if ( std::regex_match( s, std::regex(regexv[i]) ) ) return true;
+  return false;
+} 
+
+
+/// count how many occurances of a regx are in a string 
+int count( std::string s, const std::string& regx ) {
+  size_t p = s.find( regx );
+  int i=0;
+  while ( p!=std::string::npos ) {
+    i++;
+    s.erase( 0, p+1 );
+    p = s.find( regx );
+  } 
+  return i;
+}
+
+
+
+
+// chop tokens off the front of a string
+std::string chop(std::string& s1, const std::string& s2)
+{
+  std::string::size_type pos = s1.find(s2);
+  std::string s3;
+  if ( pos == std::string::npos ) {
+    s3 = s1;
+    s1.erase(0, s1.size());
+  }
+  else {
+    s3 = s1.substr(0, pos); 
+    s1.erase(0, pos+s2.size());
+  }
+  return s3;
+} 
+
+/// split a string on a token
+std::vector<std::string> split( const std::string& s, const std::string& t  ) {
+    
+    std::string _s = s;
+    size_t pos = _s.find(t);
+    
+    std::vector<std::string> tags;
+    
+    while ( pos!=std::string::npos ) { 
+      tags.push_back( chop(_s,t) );
+      pos = _s.find(t);
+    }
+    
+    tags.push_back(_s);
+    
+    return tags;
+}
+
+
+// chop tokens off the front of a string but not including 
+// chop character
+std::string chopex(std::string& s1, const std::string& s2)
+{
+  std::string::size_type pos = s1.find(s2);
+  std::string s3;
+  if ( pos == std::string::npos ) {
+    s3 = s1;
+    s1.erase(0, s1.size());
+  }
+  else {
+    s3 = s1.substr(0, pos); 
+    s1.erase(0, pos+s2.size());
+  }
+  return s3;
+} 
+
+
+// chomp them off the end
+std::string chomp(std::string& s1, const std::string& s2)
+{
+  std::string::size_type pos = s1.find(s2);
+  std::string s3;
+  if ( pos == std::string::npos ) {
+    s3 = s1;
+    s1.erase(0,s1.size());    
+  }
+  else {
+    s3 = s1.substr(pos+s2.size(),s1.size());
+    s1.erase(pos,s1.size()); 
+  } 
+  return s3;
+} 
+
+
+
+// chop tokens off the end of a string, leave string unchanged
+// return choped string
+std::string choptoken(std::string& s1, const std::string& s2)
+{
+  std::string s3 = "";
+  std::string::size_type pos = s1.find(s2);
+  if ( pos != std::string::npos ) {
+    s3 = s1.substr(0, pos+s2.size()); 
+    s1.erase(0, pos+s2.size());
+  }
+  return s3;
+} 
+
+
+// chop tokens off the end of a string, leave string unchanged
+// return choped string
+std::string chomptoken(std::string& s1, const std::string& s2)
+{
+  std::string s3 = "";
+  std::string::size_type pos = s1.find(s2);
+  if ( pos != std::string::npos ) {
+    s3 = s1.substr(pos, s1.size());
+    s1.erase(pos, s1.size()); 
+  }
+  return s3;
+} 
+
+
+// chop tokens off the front of a string
+std::string chopfirst(std::string& s1, const std::string& s2)
+{
+  std::string s3;
+  std::string::size_type pos = s1.find_first_not_of(s2);
+  if ( pos != std::string::npos ) {
+    s3 = s1.substr(0, pos); 
+    s1.erase(0, pos);
+  }
+  else {
+    s3 = s1;
+    s1 = "";
+  } 
+  return s3;
+} 
+
+
+std::string choplast(std::string& s1, const std::string& s2)
+{
+  std::string s3 = "";
+  std::string::size_type pos = s1.find_last_not_of(s2);
+  if ( pos != std::string::npos ) {
+    s3 = s1.substr(pos+1, s1.size());
+    s1.erase(pos+1, s1.size());
+  }
+  return s3;
+} 
+
+
+
+// chop tokens off the front and end of a string
+std::string chopends(std::string& s1, const std::string& s2)
+{
+  chopfirst(s1, s2);
+  choplast(s1, s2);
+  return s1;
+} 
+
+
+
+// remove strings from a string
+void removespace(std::string& s, const std::string& s2) 
+{
+  std::string::size_type pos;
+  while ( (pos = s.find(s2))!=std::string::npos ) {
+    s.erase(pos, s2.size());
+  }
+} 
+
+
+// replace from a string
+std::string replace( std::string s, const std::string& s2, const std::string& s3 ) {
+  std::string::size_type pos;
+  //  while ( (pos = s.find(" "))!=std::string::npos ) {
+  //    s.replace(pos, 1, "-");
+  while ( (pos = s.find(s2))!=std::string::npos ) {
+    s.replace(pos, s2.size(), s3);
+    if ( contains(s3,s2) ) break;
+  }
+  return s;
+} 
+
+
+// remove regx from a string
+void depunctuate(std::string& s, const std::string& regx ) 
+{
+  std::string::size_type pos;
+  while ( (pos = s.find(regx))!=std::string::npos ) {
+    s.erase(pos, regx.size());
+  }
+} 
+  
+
+
+
+std::string chopto( std::string& s, const std::string& pattern ) { 
+  std::string tag;
+  std::string::size_type pos = s.find_first_of( pattern );
+  if ( pos==std::string::npos ) { 
+    tag = s;
+    s = "";
+  }
+  else { 
+    tag = s.substr(0,pos);
+    s.erase( 0, pos ); 
+  }
+  return tag;
+}
+
+
+// remove strings from a string
+bool remove( std::string& s, const std::string& s2 ) 
+{
+  std::string::size_type ssize = s.size();
+  std::string::size_type pos;
+  while ( (pos=s.find(s2))==0 ) s.erase(pos, s2.size());
+  if ( ssize!=s.size() ) return true;
+  else                   return false;
+} 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DataQuality/HanConfigGenerator/src/utils.h b/DataQuality/HanConfigGenerator/src/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..59a0620fdfaa0f96bd739ab2e5db5ae1991487cf
--- /dev/null
+++ b/DataQuality/HanConfigGenerator/src/utils.h
@@ -0,0 +1,154 @@
+// emacs: this is -*- c++ -*-
+//
+//   @file    utils.h        
+//            utility functions
+//                    
+//   @author M.Sutton
+// 
+//   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+//   Copyright (C) 2013 M.Sutton (sutt@cern.ch)    
+//
+//   Mon 31 July 2017 08:41:27 CEST sutt
+
+
+#ifndef  UTILS_H
+#define  UTILS_H
+
+#include <cstdlib>
+#include <vector>
+#include <string>
+#include <iostream>
+
+#include "TObject.h"
+#include "TKey.h"
+#include "TH1D.h"
+
+
+
+template<typename T>
+std::ostream& operator<<( std::ostream& s, const std::vector<T>& v ) {
+  if ( v.empty() ) return s;
+  for ( size_t i=0 ; i<v.size() ; i++ ) s << v[i] << "\n";
+  return s;
+}
+
+
+template<typename T>
+std::ostream& operator<<( std::ostream& s, const std::vector<T*>& v ) {
+  if ( v.empty() ) return s;
+  for ( int i=0 ; i<v.size() ; i++ ) s << *v[i] << "\n";
+  return s;
+}
+
+
+
+/// get a TObject* from a TKey* 
+/// (why can't a TObject be a TKey?)
+template<class T>
+T* get( TKey* tobj ) { 
+  TObject* a = tobj->ReadObj()->Clone();
+  ((TH1*)a)->SetDirectory(0); /// shouldn't this crash if it is not a TH1* ?  
+  return (T*)a;
+}
+
+
+/// does a string conatian a pattern  
+inline bool contains( const std::string& s, const std::string& pattern ) { return s.find(pattern)!=std::string::npos; } 
+
+
+/// simple error reporting class - should probably throw an exception, 
+/// only this is simpler
+inline void error( int i, std::ostream& s ) {  s << std::endl; std::exit(i);  }
+
+
+
+/// get the date *without* the return
+std::string date();
+
+/// does a file exist 
+bool file_exists( const std::string& file );
+
+
+/// match a pattern from a vector of possible patterns
+bool find( const std::string& s, const std::vector<std::string>& regexv );
+
+
+
+/// count how many occurances of a regx are in a string 
+int count( std::string s, const std::string& regx );
+
+
+
+// chop tokens off the front of a string
+std::string chop(std::string& s1, const std::string& s2);
+
+
+/// split a string on a token
+std::vector<std::string> split( const std::string& s, const std::string& t=":"  );
+
+
+// chop tokens off the front of a string but not including 
+// chop character
+std::string chopex(std::string& s1, const std::string& s2);
+
+
+
+// chomp them off the end
+std::string chomp(std::string& s1, const std::string& s2);
+
+
+// chop tokens off the end of a string, leave string unchanged
+// return choped string
+std::string choptoken(std::string& s1, const std::string& s2);
+
+
+// chop tokens off the end of a string, leave string unchanged
+// return choped string
+std::string chomptoken(std::string& s1, const std::string& s2);
+
+
+// chop tokens off the front of a string
+std::string chopfirst(std::string& s1, const std::string& s2);
+
+
+// chop off the end of the string
+std::string choplast(std::string& s1, const std::string& s2);
+
+
+// chop tokens off the front and end of a string
+std::string chopends(std::string& s1, const std::string& s2);
+
+
+// remove strings from a string
+void removespace(std::string& s, const std::string& s2); 
+
+
+// replace from a string
+std::string replace( std::string s, const std::string& s2, const std::string& s3);
+
+
+// remove regx from a string
+void depunctuate(std::string& s, const std::string& regx=":"); 
+
+
+// chop up to the first character matching any of those 
+// in the pattern
+std::string chopto( std::string& s, const std::string& pattern );
+
+
+// remove strings from a string
+bool remove( std::string& s, const std::string& s2 ); 
+
+
+
+#endif  // UTILS_H 
+
+
+
+
+
+
+
+
+
+
diff --git a/Database/AthenaRoot/AthenaRootComps/share/POOLEventSelector_testJobOptions.py b/Database/AthenaRoot/AthenaRootComps/share/POOLEventSelector_testJobOptions.py
deleted file mode 100644
index c03b9bd21742c0a201289e23e7c06ecdea6b2793..0000000000000000000000000000000000000000
--- a/Database/AthenaRoot/AthenaRootComps/share/POOLEventSelector_testJobOptions.py
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-#this joboption is used in performance monitoring to compare to xAODEventSelector
-
-theApp.EvtMax = -1
-
-import os
-
-jps.AthenaCommonFlags.FilesInput = [os.environ.get("ASG_TEST_FILE_MC","/afs/cern.ch/user/a/asgbase/patspace/xAODs/r7725/mc15_13TeV.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.AOD.e3698_s2608_s2183_r7725_r7676/AOD.07915862._000100.pool.root.1")]
-
-
-
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-
-algseq = CfgMgr.AthSequencer("AthAlgSeq")
-algseq += CfgMgr.EventCounterAlg(BookkeepOtherMCEventWeights=True)
diff --git a/Database/AthenaRoot/AthenaRootComps/share/xAODEventSelector_testJobOptions.py b/Database/AthenaRoot/AthenaRootComps/share/xAODEventSelector_testJobOptions.py
deleted file mode 100644
index 224aebf4e92b8f3f766b04a855cbf9ac14008180..0000000000000000000000000000000000000000
--- a/Database/AthenaRoot/AthenaRootComps/share/xAODEventSelector_testJobOptions.py
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-#this joboption is used in performance monitoring to compare to POOL
-
-theApp.EvtMax = -1
-
-import os
-
-jps.AthenaCommonFlags.FilesInput = [os.environ.get("ASG_TEST_FILE_MC","/afs/cern.ch/user/a/asgbase/patspace/xAODs/r7725/mc15_13TeV.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.AOD.e3698_s2608_s2183_r7725_r7676/AOD.07915862._000100.pool.root.1")]
-
-
-
-import AthenaRootComps.ReadAthenaxAODHybrid
-
-
-algseq = CfgMgr.AthSequencer("AthAlgSeq")
-algseq += CfgMgr.EventCounterAlg(BookkeepOtherMCEventWeights=True)
diff --git a/DetectorDescription/GeoModel/GeoModelKernel/src/GeoMaterial.cxx b/DetectorDescription/GeoModel/GeoModelKernel/src/GeoMaterial.cxx
index 665bd3359d397564717e8b168351f0244c76301d..805a50536d4f2f231e0967ed54607a8d82e992b2 100755
--- a/DetectorDescription/GeoModel/GeoModelKernel/src/GeoMaterial.cxx
+++ b/DetectorDescription/GeoModel/GeoModelKernel/src/GeoMaterial.cxx
@@ -29,6 +29,7 @@
 #include <cfloat>
 #include <iostream>
 #include <algorithm>
+#include <iterator>
 
 //## end module%3CD878BB0006.includes
 
@@ -379,7 +380,10 @@ void GeoMaterial::lock ()
       int iZ = (int) (m_element[e]->getZ () + 0.5) - 1;	// Atomic number index     
 
       dEDxConstant += w * C0 * dovera * Z;
-      dEDxI0 += w * s_ionizationPotential[iZ];
+      // Make sure we don't overflow the table:
+      // the `Ether' special `element' has Z set to 500.
+      if (iZ >= 0 && iZ < (std::end(s_ionizationPotential)-std::begin(s_ionizationPotential)))
+        dEDxI0 += w * s_ionizationPotential[iZ];
       NILinv += n * pow (N, 2.0 / 3.0) * CLHEP::amu * inv_lambda0;
 
       double nAtomsPerVolume = A ? CLHEP::Avogadro*m_density*m_fraction[e]/A : 0.;
diff --git a/DetectorDescription/RegionSelector/RegionSelector/RegSelectorHashMap.h b/DetectorDescription/RegionSelector/RegionSelector/RegSelectorHashMap.h
index bfbd7dc3943fdde3c060e4bb6a4ea40d28fb67fd..9d9047e67271998552269b048d31af6940c9d872 100755
--- a/DetectorDescription/RegionSelector/RegionSelector/RegSelectorHashMap.h
+++ b/DetectorDescription/RegionSelector/RegionSelector/RegSelectorHashMap.h
@@ -101,8 +101,6 @@ class RegSelectorHashMap{
   std::vector<std::vector<uint32_t> > m_robId;
   double m_etaminDet, m_etamaxDet;
   double m_phiminDet, m_phimaxDet;
-  double m_numCols, m_numLines;
-  double m_phiMinVal, m_etaMinVal;
   int m_NumSamples;
   int m_iColumns, m_iLines;
   bool m_readFromFile;
diff --git a/DetectorDescription/RegionSelector/src/RegSelSvc.cxx b/DetectorDescription/RegionSelector/src/RegSelSvc.cxx
index 30ef68ad454eee74564ac5d584bf0db6033a2108..e8e5b7c5303203c3228b67144d7d4d1a6766cfcc 100755
--- a/DetectorDescription/RegionSelector/src/RegSelSvc.cxx
+++ b/DetectorDescription/RegionSelector/src/RegSelSvc.cxx
@@ -779,35 +779,35 @@ void RegSelSvc::getRoIData(DETID detectorID,
   //  std::cout << "RegSelSvc::getRoIData()" << detectorID << std::endl; 
 
 
-  RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+  RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
 
   switch(detectorID){
   case PIXEL: { // Pixel
-    if ( m_newpixel) m_newpixel->getRoIData( _roi, modules );
+    if ( m_newpixel) m_newpixel->getRoIData( selroi, modules );
     break;    
   }
   case SCT:  { // Semiconductor Tracker
-    if ( m_newsct ) m_newsct->getRoIData( _roi, modules );    
+    if ( m_newsct ) m_newsct->getRoIData( selroi, modules );    
     break;
   }
   case TRT:  { // TRT
-    if ( m_newtrt ) m_newtrt->getRoIData( _roi, modules );    
+    if ( m_newtrt ) m_newtrt->getRoIData( selroi, modules );    
     break;
   }
   case RPC: { // RPC (obviously)
-    if ( m_newrpc ) m_newrpc->getRoIData(_roi, modules); 
+    if ( m_newrpc ) m_newrpc->getRoIData(selroi, modules); 
     break;
   }
   case MDT: { // MDT (obviously)
-    if ( m_newmdt ) m_newmdt->getRoIData(_roi, modules); 
+    if ( m_newmdt ) m_newmdt->getRoIData(selroi, modules); 
     break;
   }
   case TGC: { // TGC (obviously)
-    if ( m_newtgc ) m_newtgc->getRoIData(_roi, modules); 
+    if ( m_newtgc ) m_newtgc->getRoIData(selroi, modules); 
     break;
   }
   case CSC: { // CSC (obviously)
-    if ( m_newcsc ) m_newcsc->getRoIData(_roi, modules); 
+    if ( m_newcsc ) m_newcsc->getRoIData(selroi, modules); 
     break;
   }
   default:
@@ -857,43 +857,43 @@ void RegSelSvc::DetHashIDList(DETID detectorID,
 
   switch(detectorID){
   case PIXEL: { // Pixel    
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newpixel ) m_newpixel->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newpixel ) m_newpixel->getHashList(selroi, IDList); 
     break;
   }
   case SCT: { // Semiconductor Tracker (and pixel)
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newsct ) m_newsct->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newsct ) m_newsct->getHashList(selroi, IDList); 
     break;
   }
   case TRT: { // TRT (obviously)
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtrt ) m_newtrt->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtrt ) m_newtrt->getHashList(selroi, IDList); 
     break;
   }
   case MDT: { // etc
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newmdt ) m_newmdt->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newmdt ) m_newmdt->getHashList(selroi, IDList); 
     break;
   }
   case RPC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newrpc ) m_newrpc->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newrpc ) m_newrpc->getHashList(selroi, IDList); 
     break;
   }
   case TGC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtgc ) m_newtgc->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtgc ) m_newtgc->getHashList(selroi, IDList); 
     break;
   }
   case CSC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newcsc ) m_newcsc->getHashList(_roi, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newcsc ) m_newcsc->getHashList(selroi, IDList); 
     break;
   }
   case FTK: { // FTK    
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_ftklut ) m_ftklut->getHashList(_roi, IDList); 
+    RegSelRoI roi2( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_ftklut ) m_ftklut->getHashList(roi2, IDList); 
     break;
   }
   case LAR: {  // Liquid Argon Calorimeter
@@ -963,43 +963,43 @@ void RegSelSvc::DetHashIDList(DETID detectorID, long layer,
 
   switch(detectorID){
   case PIXEL: { // Pixel    
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newpixel ) m_newpixel->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newpixel ) m_newpixel->getHashList(selroi, layer, IDList); 
     break;
   }
   case SCT: { // Semiconductor Tracker 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newsct ) m_newsct->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newsct ) m_newsct->getHashList(selroi, layer, IDList); 
     break;
   }
   case TRT: { // TRT (obviously)
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtrt ) m_newtrt->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtrt ) m_newtrt->getHashList(selroi, layer, IDList); 
     break;
   }
   case MDT: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newmdt ) m_newmdt->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newmdt ) m_newmdt->getHashList(selroi, layer, IDList); 
     break;
   }
   case RPC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newrpc ) m_newrpc->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newrpc ) m_newrpc->getHashList(selroi, layer, IDList); 
     break;
   }
   case TGC: {
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtgc ) m_newtgc->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtgc ) m_newtgc->getHashList(selroi, layer, IDList); 
     break;
   }
   case CSC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newcsc ) m_newcsc->getHashList(_roi, layer, IDList); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newcsc ) m_newcsc->getHashList(selroi, layer, IDList); 
     break;
   }
   case FTK: { // FTK    
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_ftklut ) m_ftklut->getHashList(_roi, layer, IDList); 
+    RegSelRoI roi2( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_ftklut ) m_ftklut->getHashList(roi2, layer, IDList); 
     break;
   }
   case LAR: { // Liquid Argon Calorimeter
@@ -1241,43 +1241,43 @@ void RegSelSvc::DetROBIDListUint(DETID detectorID,
 
   switch (detectorID) {
   case PIXEL: { // Pixel
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newpixel ) m_newpixel->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newpixel ) m_newpixel->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case SCT: {  // SCT
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newsct ) m_newsct->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newsct ) m_newsct->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case TRT: {  // TRT
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtrt ) m_newtrt->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtrt ) m_newtrt->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case MDT: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newmdt ) m_newmdt->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newmdt ) m_newmdt->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case RPC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newrpc ) m_newrpc->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newrpc ) m_newrpc->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case TGC: {
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtgc ) m_newtgc->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtgc ) m_newtgc->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case CSC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newcsc ) m_newcsc->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newcsc ) m_newcsc->getRobList(selroi, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case FTK: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_ftklut ) m_ftklut->getRobList(_roi, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI roi2( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_ftklut ) m_ftklut->getRobList(roi2, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case LAR: {  // Liquid Argon Calorimeter
@@ -1348,43 +1348,43 @@ void RegSelSvc::DetROBIDListUint(DETID detectorID, long layer,
 
   switch (detectorID) {
   case PIXEL: { // Pixel
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newpixel ) m_newpixel->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval );
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newpixel ) m_newpixel->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval );
     break;
   }
   case SCT: {  // SCT
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newsct ) m_newsct->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newsct ) m_newsct->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case TRT: { // TRT
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtrt ) m_newtrt->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtrt ) m_newtrt->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case MDT: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newmdt ) m_newmdt->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newmdt ) m_newmdt->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case RPC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newrpc ) m_newrpc->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newrpc ) m_newrpc->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case TGC: {
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newtgc ) m_newtgc->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newtgc ) m_newtgc->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case CSC: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_newcsc ) m_newcsc->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI selroi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_newcsc ) m_newcsc->getRobList(selroi, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case FTK: { 
-    RegSelRoI _roi( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
-    if ( m_ftklut ) m_ftklut->getRobList(_roi, layer, outputROBIDList, m_duplicateRemoval ); 
+    RegSelRoI roi2( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
+    if ( m_ftklut ) m_ftklut->getRobList(roi2, layer, outputROBIDList, m_duplicateRemoval ); 
     break;
   }
   case LAR: { // Liquid Argon Calorimeter
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/FullEventAssembler.icc b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/FullEventAssembler.icc
index 3573ab6ea595afc59d9f767778d257cad1e49681..45f098a571fa9764f58473d7745ed64af2e9d104 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/FullEventAssembler.icc
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/FullEventAssembler.icc
@@ -88,7 +88,9 @@ void
 FullEventAssembler<IDMAP>::RodToRob(RODMAP& rodMap,
 			ROBMAP& robMap,  MsgStream& log ) 
 { 
-  log << MSG::DEBUG << " RodToRob " << endmsg;
+  if (log.level() <= MSG::DEBUG) {
+    log << MSG::DEBUG << " RodToRob " << endmsg;
+  }
 
   // loop over all the RODs 
   RODMAP::iterator it_rod     = rodMap.begin(); 
@@ -97,10 +99,11 @@ FullEventAssembler<IDMAP>::RodToRob(RODMAP& rodMap,
     {
       uint32_t rodid = (*it_rod).first; 
       RODDATA*  intv = (*it_rod).second; 
-
-      std::ios_base::fmtflags oflags=log.stream().flags();
-      log << MSG::DEBUG << " Rod id = " << MSG::hex << rodid << endmsg;
-      log.flags(oflags); // reset precision after use of hex
+      if (log.level() <= MSG::DEBUG) {
+        std::ios_base::fmtflags oflags=log.stream().flags();
+        log << MSG::DEBUG << " Rod id = " << MSG::hex << rodid << endmsg;
+        log.flags(oflags); // reset precision after use of hex
+      }
 
       // make an ROB id from an ROD id. 
       uint32_t robid = m_idmap.getRobID(rodid); 
@@ -109,9 +112,12 @@ FullEventAssembler<IDMAP>::RodToRob(RODMAP& rodMap,
       ROBMAP::iterator itr2 = robMap.find(robid); 
       if(itr2!=robMap.end())
 	{
-          oflags=log.stream().flags();
-	  log << MSG::ERROR << " More than one RODs in ROB:" << MSG::hex << (*itr2).first << endmsg;
-          log.flags(oflags); // reset precision after use of hex
+          if (log.level() <= MSG::ERROR) {
+            std::ios_base::fmtflags oflags=log.stream().flags();
+            oflags=log.stream().flags();
+            log << MSG::ERROR << " More than one RODs in ROB:" << MSG::hex << (*itr2).first << endmsg;
+            log.flags(oflags); // reset precision after use of hex
+          }
         }
       else 
         { // Make a new ROBFragment 
@@ -130,7 +136,9 @@ FullEventAssembler<IDMAP>::RodToRob(RODMAP& rodMap,
 template <class IDMAP> 
 void FullEventAssembler<IDMAP>::RobToEvt(ROBMAP& robMap, RawEventWrite* re, MsgStream& log ) 
 {
-  log << MSG::DEBUG<< " RobToEvt, number of ROBFrag= " << robMap.size() << endmsg;
+      if (log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG<< " RobToEvt, number of ROBFrag= " << robMap.size() << endmsg;
+      }
   OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment* theROB; 
   
   ROBMAP::iterator it_rob = robMap.begin(); 
@@ -139,13 +147,17 @@ void FullEventAssembler<IDMAP>::RobToEvt(ROBMAP& robMap, RawEventWrite* re, MsgS
     {
       theROB = (*it_rob).second; 
       std::ios_base::fmtflags oflags=log.stream().flags();
-      log << MSG::DEBUG << " RobToEvt: adding ROB " << MSG::hex <<
+      if (log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << " RobToEvt: adding ROB " << MSG::hex <<
  	theROB->source_id() << endmsg; 
       log.flags(oflags); // reset precision after use of hex
+      }
       re->append((*it_rob).second); 
     } 
 
-  log << MSG::DEBUG << " FullEventFragment is done " << re << endmsg;
+  if (log.level() <= MSG::DEBUG) {
+    log << MSG::DEBUG << " FullEventFragment is done " << re << endmsg;
+  }
 }
 
 
diff --git a/HLT/HLTUtils/python/hltOksUtils.py b/HLT/HLTUtils/python/hltOksUtils.py
index 8060580ab0b451ebedda9f865f1d0f3af401ed5e..4ce66e9ee37e5a162eb26c84d381dc31cb0a3714 100644
--- a/HLT/HLTUtils/python/hltOksUtils.py
+++ b/HLT/HLTUtils/python/hltOksUtils.py
@@ -4,14 +4,14 @@
 Utilities for HLT OKS file generation
 """
 
+import os
+
 def defaultTags():
    """Return list of supported CMTCONFIG tags"""
    
    import pm.common
-   import os
 
-   project = os.environ.get('AtlasProject','')
-   tag = os.environ.get('%s_PLATFORM' % project, os.environ.get('CMTCONFIG',None))
+   tag = platform()
    opt_tag = '-'.join(tag.split('-')[:-1])+'-opt'
    dbg_tag = '-'.join(tag.split('-')[:-1])+'-dbg'
    tags = [pm.common.tdaqRepository.getObject('Tag', opt_tag),
@@ -19,3 +19,12 @@ def defaultTags():
    
    return tags
 
+def platform():
+   """Return current CMTCONFIG tag"""
+
+   project = os.environ.get('AtlasProject','')
+   tag = os.environ.get('%s_PLATFORM' % project, os.environ.get('CMTCONFIG',None))
+
+   return tag
+
+
diff --git a/HLT/HLTUtils/share/make_hlt_rep.py b/HLT/HLTUtils/share/make_hlt_rep.py
index c152496d2e6dc29b9f86009af30d899f91633289..796da5859df1dc6c0a6fad36035d2493ac55eff0 100755
--- a/HLT/HLTUtils/share/make_hlt_rep.py
+++ b/HLT/HLTUtils/share/make_hlt_rep.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import optparse
 import os
@@ -42,22 +43,24 @@ else:
     # numbered releases
     atlas_version = os.environ.get('AtlasVersion')
 
+platform = hltOksUtils.platform()
+
 swvars = [
-    dal.SW_PackageVariable('XMLPATH%s' % modifier,
+    dal.SW_PackageVariable('XMLPATH',
                            Name='XMLPATH',
-                           Suffix="XML"),
-    dal.SW_PackageVariable('DATAPATH%s' % modifier,
+                           Suffix=os.path.join(platform,"XML")),
+    dal.SW_PackageVariable('DATAPATH',
                            Name='DATAPATH',
-                           Suffix="share"),
-    dal.SW_PackageVariable('CALIBPATH%s' % modifier,
+                           Suffix=os.path.join(platform,"share")),
+    dal.SW_PackageVariable('CALIBPATH',
                            Name='CALIBPATH',
-                           Suffix="share"),                           
-    dal.SW_PackageVariable('JOBOPTSEARCHPATH%s' % modifier,
+                           Suffix=os.path.join(platform,"share")),                           
+    dal.SW_PackageVariable('JOBOPTSEARCHPATH',
                            Name='JOBOPTSEARCHPATH',
-                           Suffix="jobOptions"),
-    dal.SW_PackageVariable('PYTHONPATH%s' % modifier,
+                           Suffix=os.path.join(platform,"jobOptions")),
+    dal.SW_PackageVariable('PYTHONPATH',
                            Name='PYTHONPATH',
-                           Suffix="python")
+                           Suffix=os.path.join(platform,"python"))
 ]
 
 puvars = [
@@ -92,7 +95,7 @@ pars = dal.VariableSet('%s-Parameters' % prefix,
                                                  Description='%s release version' % prefix) ])
 
 apps = [
-    dal.Script('HLTMPPU_asetup',
+    dal.Binary('HLTMPPU_asetup',
                BinaryName='asetup_wrapper',
                Description='HLTMPPU_main with asetup environment',
                DefaultParameters='HLTMPPU_main',
@@ -104,8 +107,8 @@ hltRep = dal.SW_Repository('%s-Repository' % prefix,
                            Name=('%s-Repository' % prefix),
                            InstallationPath="%s/InstallArea" % os.environ.get('AtlasArea'),
                            SW_Objects=apps,
-                           Tags=hltOksUtils.defaultTags(),
-                           ISInfoDescriptionFiles=['share/data/daq/schema/is_trigconf_hlt.schema.xml'],
+                           Tags=[pm.common.tdaqRepository.getObject('Tag',hltOksUtils.platform())],
+                           ISInfoDescriptionFiles=[os.path.join(platform,'share/data/daq/schema/is_trigconf_hlt.schema.xml')],
                            AddProcessEnvironment = swvars
                            )
 
diff --git a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/CMakeLists.txt b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/CMakeLists.txt
index 16a6a5bc40f57f68e33e07d5a86daf961d3307b6..d359f2b9deb3e05d5faf62430e360544e1734aef 100644
--- a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/CMakeLists.txt
+++ b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 773563 2016-09-16 11:02:38Z smh $
 ################################################################################
 # Package: TrigConf2COOLOnline
 ################################################################################
@@ -17,49 +16,13 @@ atlas_depends_on_subdirs(
 find_package( Boost COMPONENTS program_options )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
 find_package( tdaq COMPONENTS daq-core-dal daq-hlt-dal 
-              rc_CmdLine rc_ItemCtrl rc_OnlSvc rc_RCCommands omniORB4 omnithread owl is ipc config)
+              rc_CmdLine rc_ItemCtrl rc_OnlSvc rc_RCCommands omniORB4 omnithread owl is ipc config TTCInfo)
 find_package( tdaq-common COMPONENTS ers )
 find_package( TBB )
 
-# Names of the auto-generated headers:
-set( _autogenHeaders
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline/TrigConfSmKeyNamed.h
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline/TrigConfL1PsKeyNamed.h
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline/TrigConfL1BgKeyNamed.h
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline/TrigConfHltPsKeyNamed.h
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline/TrigConfReleaseNamed.h )
-
-# The hardcoded location of the Java executable:
-set( _javaHome
-   /afs/cern.ch/atlas/project/tdaq/inst/sw/lcg/external/Java/JDK/1.8.0/amd64 )
-
-# Construct a functional CLASSPATH from the .jar files in tdaq:
-file( GLOB _jarFiles "${TDAQ_ROOT}/installed/share/lib/*.jar" )
-set( _classpath "." )
-foreach( _jar ${_jarFiles} )
-   set( _classpath "${_classpath}:${_jar}" )
-endforeach()
-unset( _jarFiles )
-
-# Set up a rule generating some header files:
-add_custom_command( OUTPUT ${_autogenHeaders}
-   COMMAND ${CMAKE_COMMAND} -E make_directory
-   ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline
-   COMMAND ${CMAKE_COMMAND} -E env TDAQ_JAVA_HOME=${_javaHome}
-   CLASSPATH=${_classpath}
-   ${CMAKE_BINARY_DIR}/atlas_build_run.sh is_generator.sh
-   -d ${CMAKE_CURRENT_BINARY_DIR}/TrigConf2COOLOnline --cpp
-   -n ${CMAKE_CURRENT_SOURCE_DIR}/schema/is_trigconf_hlt.schema.xml
-   ${CMAKE_CURRENT_SOURCE_DIR}/schema/is_trigconf_l1.schema.xml )
-unset( _classpath )
-
-# Clean up the files on "make clean":
-set_directory_properties( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
-   "${_autogenHeaders}" )
-
 # Component(s) in the package:
 atlas_add_library( TrigConf2COOLOnline
-   src/*.cxx ${_autogenHeaders}
+   src/*.cxx
    PUBLIC_HEADERS TrigConf2COOLOnline
    INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${TDAQ_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS}
@@ -75,7 +38,3 @@ atlas_add_executable( TrigConf2CoolOnline
    LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES}
    TrigConf2COOLOnline )
 
-# Install files from the package:
-atlas_install_generic( schema/*.xml
-   DESTINATION share/data/daq/schema
-   TYPENAME Schema )
diff --git a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/cmt/requirements b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/cmt/requirements
deleted file mode 100644
index 2cf53b6ba1b85181be94f404cafd5d34c40b17db..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/cmt/requirements
+++ /dev/null
@@ -1,53 +0,0 @@
-# $Revision: 1.2 $
-
-package TrigConf2COOLOnline
-
-author  Joerg.Stelzer@cern.ch
-
-use  AtlasHLTPolicy             AtlasHLTPolicy-*     HLT 
-use  HLTtdaq	                HLTtdaq-*            HLT/HLTExternal
-
-private
-#use  HLTPUDal                   HLTPUDal-*           
-use  AtlasCOOL                  AtlasCOOL-*          External
-use  AtlasBoost                 AtlasBoost-*         External
-use  TrigConfL1Data             TrigConfL1Data-*     Trigger/TrigConfiguration
-use  TrigConfHLTData            TrigConfHLTData-*    Trigger/TrigConfiguration
-use  TrigConfStorage            TrigConfStorage-*    Trigger/TrigConfiguration
-
-
-
-# Remove to avoid compiler warning
-macro_remove_regexp AtlasCxxPolicy_pp_cppflags "'-DPACKAGE_VERSION=.*'"
-
-library TrigConf2COOLOnline *.cxx
-
-apply_pattern linked_library
-
-apply_tag NEEDS_CORAL_BASE
-apply_tag NEEDS_COOL_FACTORY
-
-application   TrigConf2CoolOnline   TrigConf2CoolOnline.cxx
-
-macro TrigConf2COOLOnline_dependencies " is_conf "
-
-macro TrigConf2CoolOnline_dependencies " TrigConf2COOLOnline "
-
-macro TrigConf2CoolOnlinelinkopts   "-ldaq-hlt-dal -lrc_CmdLine -lrc_ItemCtrl -lers -lTrigConf2COOLOnline $(Boost_linkopts_program_options)"
-
-action is_conf "is_generator.sh -d ../TrigConf2COOLOnline --cpp -n ../schema/is_trigconf_hlt.schema.xml ../schema/is_trigconf_l1.schema.xml "
-action is_confcln "rm -f ../TrigConf2COOLOnline/TrigConfHlt*.h"
-
-declare_hlt_db_schema files="../schema/is_trigconf_hlt.schema.xml" 
-
-private
-
-set JAVA_HOME $(java_home_linux)
-
-# until checkreq is fixed to translate RunControl to HLTtdaq
-
-#action checkreq "checkreq.py -i 3 -n"
-
-# disable it completely
-action checkreq "true"
-
diff --git a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_hlt.schema.xml b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_hlt.schema.xml
deleted file mode 100644
index de27c863c1ddd006a90d61f3dcefc693cebed3fa..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_hlt.schema.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-
-<!-- oks-schema version 2.0 -->
-
-
-<!DOCTYPE oks-schema [
-  <!ELEMENT oks-schema (info, (include)?, (class)+)>
-  <!ELEMENT info EMPTY>
-  <!ATTLIST info
-      name CDATA #REQUIRED
-      type CDATA #REQUIRED
-      num-of-includes CDATA #REQUIRED
-      num-of-items CDATA #REQUIRED
-      oks-format CDATA #FIXED "schema"
-      oks-version CDATA #REQUIRED
-      created-by CDATA #REQUIRED
-      created-on CDATA #REQUIRED
-      creation-time CDATA #REQUIRED
-      last-modified-by CDATA #REQUIRED
-      last-modified-on CDATA #REQUIRED
-      last-modification-time CDATA #REQUIRED
-  >
-  <!ELEMENT include (file)+>
-  <!ELEMENT file EMPTY>
-  <!ATTLIST file
-      path CDATA #REQUIRED
-  >
-  <!ELEMENT class (superclass | attribute | relationship | method)*>
-  <!ATTLIST class
-      name CDATA #REQUIRED
-      description CDATA ""
-      is-abstract (yes|no) "no"
-  >
-  <!ELEMENT superclass EMPTY>
-  <!ATTLIST superclass name CDATA #REQUIRED>
-  <!ELEMENT attribute EMPTY>
-  <!ATTLIST attribute
-      name CDATA #REQUIRED
-      description CDATA ""
-      type (bool|s8|u8|s16|u16|s32|u32|float|double|date|time|string|uid|enum) #REQUIRED
-      range CDATA ""
-      format (dec|hex|oct) "dec"
-      is-multi-value (yes|no) "no"
-      multi-value-implementation (list|vector) "list"
-      init-value CDATA ""
-      is-not-null (yes|no) "no"
-  >
-  <!ELEMENT relationship EMPTY>
-  <!ATTLIST relationship
-      name CDATA #REQUIRED
-      description CDATA ""
-      class-type CDATA #REQUIRED
-      low-cc (zero|one) #REQUIRED
-      high-cc (one|many) #REQUIRED
-      is-composite (yes|no) #REQUIRED
-      is-exclusive (yes|no) #REQUIRED
-      is-dependent (yes|no) #REQUIRED
-      multi-value-implementation (list|vector) "list"
-  >
-  <!ELEMENT method (method-implementation*)>
-  <!ATTLIST method
-      name CDATA #REQUIRED
-      description CDATA ""
-  >
-  <!ELEMENT method-implementation EMPTY>
-  <!ATTLIST method-implementation
-      language CDATA #REQUIRED
-      prototype CDATA #REQUIRED
-      body CDATA ""
-  >
-]>
-
-<oks-schema>
-
-  <info name="" type="" num-of-includes="1" num-of-items="2" oks-format="schema" oks-version="oks-03-07-02 built &quot;Jul 23 2007&quot;" created-by="pauly" created-on="pcphate12.cern.ch" creation-time="20/7/06 15:42:51" last-modified-by="pauly" last-modified-on="pcphate14" last-modification-time="20/8/07 14:44:05"/>
-  
-  <include>
-    <file path="is/is.xml"/>
-  </include>
-  
-  <class name="TrigConfSmKey" description="Trigger configuration database key in use">
-    <superclass name="Info"/>
-    <attribute name="SuperMasterKey" description="Supermaster key of the trigger configuration" type="u32"/>
-    <attribute name="SuperMasterComment" description="Supermaster comment" type="string"/>
-  </class>
-  
-  <class name="TrigConfHltPsKey" description="Current HLT prescale key">
-    <superclass name="Info"/>
-    <attribute name="HltPrescaleKey" description="HLT prescale key of the trigger configuration" type="u32"/>
-    <attribute name="HltPrescaleComment" description="HLT prescale comment" type="string"/>
-  </class>
-  
-  <class name="TrigConfRelease" description="HLT Release description">
-    <superclass name="Info"/>
-    <attribute name="HLTReleaseVersion" description="Release and patch version like 15.5.1.2" type="string"/>
-    <attribute name="HLTPatchProject" description="Name of patch project, usualy AtlasP1HLT" type="string"/>
-    <attribute name="HLTExtraPatch" description="Path to extra patch area, should be empty except during commissioning" type="string"/>
-  </class>
-  
-</oks-schema>
diff --git a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_l1.schema.xml b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_l1.schema.xml
deleted file mode 100644
index 73bcf9766cf0e7da905ca051aff069fcc281a3ad..0000000000000000000000000000000000000000
--- a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/schema/is_trigconf_l1.schema.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-
-<!-- oks-schema version 2.0 -->
-
-
-<!DOCTYPE oks-schema [
-  <!ELEMENT oks-schema (info, (include)?, (class)+)>
-  <!ELEMENT info EMPTY>
-  <!ATTLIST info
-      name CDATA #REQUIRED
-      type CDATA #REQUIRED
-      num-of-includes CDATA #REQUIRED
-      num-of-items CDATA #REQUIRED
-      oks-format CDATA #FIXED "schema"
-      oks-version CDATA #REQUIRED
-      created-by CDATA #REQUIRED
-      created-on CDATA #REQUIRED
-      creation-time CDATA #REQUIRED
-      last-modified-by CDATA #REQUIRED
-      last-modified-on CDATA #REQUIRED
-      last-modification-time CDATA #REQUIRED
-  >
-  <!ELEMENT include (file)+>
-  <!ELEMENT file EMPTY>
-  <!ATTLIST file
-      path CDATA #REQUIRED
-  >
-  <!ELEMENT class (superclass | attribute | relationship | method)*>
-  <!ATTLIST class
-      name CDATA #REQUIRED
-      description CDATA ""
-      is-abstract (yes|no) "no"
-  >
-  <!ELEMENT superclass EMPTY>
-  <!ATTLIST superclass name CDATA #REQUIRED>
-  <!ELEMENT attribute EMPTY>
-  <!ATTLIST attribute
-      name CDATA #REQUIRED
-      description CDATA ""
-      type (bool|s8|u8|s16|u16|s32|u32|float|double|date|time|string|uid|enum) #REQUIRED
-      range CDATA ""
-      format (dec|hex|oct) "dec"
-      is-multi-value (yes|no) "no"
-      multi-value-implementation (list|vector) "list"
-      init-value CDATA ""
-      is-not-null (yes|no) "no"
-  >
-  <!ELEMENT relationship EMPTY>
-  <!ATTLIST relationship
-      name CDATA #REQUIRED
-      description CDATA ""
-      class-type CDATA #REQUIRED
-      low-cc (zero|one) #REQUIRED
-      high-cc (one|many) #REQUIRED
-      is-composite (yes|no) #REQUIRED
-      is-exclusive (yes|no) #REQUIRED
-      is-dependent (yes|no) #REQUIRED
-      multi-value-implementation (list|vector) "list"
-  >
-  <!ELEMENT method (method-implementation*)>
-  <!ATTLIST method
-      name CDATA #REQUIRED
-      description CDATA ""
-  >
-  <!ELEMENT method-implementation EMPTY>
-  <!ATTLIST method-implementation
-      language CDATA #REQUIRED
-      prototype CDATA #REQUIRED
-      body CDATA ""
-  >
-]>
-
-<oks-schema>
-
-  <info name="" type="" num-of-includes="1" num-of-items="2" oks-format="schema" oks-version="oks-03-07-02 built &quot;Jul 23 2007&quot;" created-by="pauly" created-on="pcphate12.cern.ch" creation-time="20/7/06 15:42:51" last-modified-by="pauly" last-modified-on="pcphate14" last-modification-time="20/8/07 14:44:05"/>
-  
-  <include>
-    <file path="is/is.xml"/>
-  </include>
-  
-  <class name="TrigConfL1PsKey" description="Current L1 prescale key">
-    <superclass name="Info"/>
-    <attribute name="L1PrescaleKey" description="L1 prescale key of the trigger configuration" type="u32"/>
-    <attribute name="L1PrescaleComment" description="L1 prescale comment" type="string"/>
-  </class>
-  
-  <class name="TrigConfL1BgKey" description="Current L1 bunch group key">
-    <superclass name="Info"/>
-    <attribute name="L1BunchGroupKey" description="LVL1 bunch group key of the trigger configuration" type="u32"/>
-    <attribute name="L1BunchGroupComment" description="LVL1 bunch group comment" type="string"/>
-  </class>
-  
-  <class name="TrigConfRelease" description="HLT Release description">
-    <superclass name="Info"/>
-    <attribute name="HLTReleaseVersion" description="Release and patch version like 15.5.1.2" type="string"/>
-    <attribute name="HLTPatchProject" description="Name of patch project, usualy AtlasP1HLT" type="string"/>
-    <attribute name="HLTExtraPatch" description="Path to extra patch area, should be empty except during commissioning" type="string"/>
-  </class>
-  
-</oks-schema>
diff --git a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/src/OnlTrigC2CWriter.cxx b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/src/OnlTrigC2CWriter.cxx
index 6748c9115f9e70ba339aac1cc111885f38e0c146..ac2f485b8f785e5a564080aa094a4ee9d503cd17 100644
--- a/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/src/OnlTrigC2CWriter.cxx
+++ b/HLT/Trigger/TrigConfiguration/TrigConf2COOLOnline/src/OnlTrigC2CWriter.cxx
@@ -17,10 +17,10 @@
 
 #include "TrigConf2COOLOnline/OnlTrigC2CWriter.h"
 
-#include "TrigConf2COOLOnline/TrigConfSmKeyNamed.h"
-#include "TrigConf2COOLOnline/TrigConfL1PsKeyNamed.h"
-#include "TrigConf2COOLOnline/TrigConfHltPsKeyNamed.h"
-#include "TrigConf2COOLOnline/TrigConfReleaseNamed.h"
+#include "TTCInfo/TrigConfSmKeyNamed.h"
+#include "TTCInfo/TrigConfL1PsKeyNamed.h"
+#include "TTCInfo/TrigConfHltPsKeyNamed.h"
+#include "TTCInfo/TrigConfReleaseNamed.h"
 
 #include "config/Configuration.h"
 
diff --git a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h
index 99f929717bd765877e091d60e773cfc24b651abc..a5a9ae206e0ab3dc798dd005210162c26b764792 100644
--- a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h
+++ b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h
@@ -380,7 +380,10 @@ private:
   
   StringProperty            m_jobOptionsType;        //!< JobOptions type (="NONE" or "DB", same as in PSC)
 
-  Histo1DProperty           m_histProp_Hlt_result_size;  
+  Histo1DProperty           m_histProp_Hlt_result_size;
+  Histo1DProperty           m_histProp_Hlt_result_size_physics;
+  Histo1DProperty           m_histProp_Hlt_result_size_express;
+  Histo1DProperty           m_histProp_Hlt_result_size_DataScouting;
   Histo1DProperty           m_histProp_numStreamTags;              
   Histo1DProperty           m_histProp_streamTagNames;  
   Histo1DProperty           m_histProp_num_partial_eb_robs;
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
index 0b3d8e892d0f7ff4c9bb27cc4f83714aa4b6c59d..ba76d69d12244cb32d92d5bf4ff85a4b65557102 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py
@@ -160,7 +160,7 @@ def _setupCommonServicesEnd():
     svcMgr.CoreDumpSvc.CoreDumpStream = "stdout"
     svcMgr.CoreDumpSvc.CallOldHandler = True
     svcMgr.CoreDumpSvc.FatalHandler = 0   # no extra fatal handler
-    svcMgr.CoreDumpSvc.TimeOut = 0        # no timeout for stack trace generation
+    svcMgr.CoreDumpSvc.TimeOut = 60000000000        # no timeout for stack trace generation -> changed to 60s (ATR17112)
 
     # Disable StatusCodeSvc (causes problems with shutting down children at stop in HLTPU)
     svcMgr.StatusCodeSvc.SuppressCheck = True
diff --git a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py
index 9eaddbeae6b051a44b2f5933317fd3656ba06e25..cfe7025763737933db62d30d31087557cac5e345 100644
--- a/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py
+++ b/HLT/Trigger/TrigControl/TrigServices/share/TrigServicesEventLoopMgr.py
@@ -34,10 +34,13 @@ HltEventLoopMgr.HltResultName = "HLTResult_HLT"
 #HltEventLoopMgr.ExcludeFromHltTruncationDebugStream = ["CostMonitoring"]
 
 #
-# properties for the HLT result size histogram
+# properties for the HLT result size histograms
 # --> set upper edge of histogram to maximum allowed number of words in HLT
 #
-HltEventLoopMgr.histHltResultSize=("HltResultSize",0,125000,100)
+# HltEventLoopMgr.histHltResultSize=("HltResultSize",0,500000,100)
+# HltEventLoopMgr.histHltResultSizePhysics=("HltResultSize-(Stream (Main_physics))",0,500000,100)
+# HltEventLoopMgr.histHltResultSizeExpress=("HltResultSize-(Stream (express_express))",0,250000,100)
+# HltEventLoopMgr.histHltResultSizeDS=("HltResultSize-(Streams (DataScouting_*_calibration))",0,125000,100)
 
 #
 # Configuration of EDM size monitoring plots
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
index 91ad5beaad66d16d47db2b025db0b9522fea7e93..554f107ef2060be3cd37de97c8b6e48b31a046cf 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
@@ -279,7 +279,10 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& nam,
   m_detector_mask(0xffffffff, 0xffffffff, 0, 0),
   m_l1_hltPrescaleUpdateLB(0xffffffff),
   m_mandatoryL1ROBs{{begin(L1R_MANDATORY_ROBS), end(L1R_MANDATORY_ROBS)}},
-  m_histProp_Hlt_result_size(Gaudi::Histo1DDef("HltResultSize",0,200000,100)),
+  m_histProp_Hlt_result_size(Gaudi::Histo1DDef("HltResultSize",0,500000,100)),
+  m_histProp_Hlt_result_size_physics(Gaudi::Histo1DDef("HltResultSize-(Stream (Main_physics))",0,500000,100)),
+  m_histProp_Hlt_result_size_express(Gaudi::Histo1DDef("HltResultSize-(Stream (express_express))",0,250000,100)),
+  m_histProp_Hlt_result_size_DataScouting(Gaudi::Histo1DDef("HltResultSize-(Streams (DataScouting_*_calibration))",0,125000,100)),
   m_histProp_numStreamTags(Gaudi::Histo1DDef("NumberOfStreamTags",-.5,19.5,20)),
   m_histProp_streamTagNames(Gaudi::Histo1DDef("StreamTagNames",-.5,.5,1)),
   m_histProp_num_partial_eb_robs(Gaudi::Histo1DDef("NumberROBsPartialEB",-.5,199.5,200)),
@@ -297,7 +300,10 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& nam,
   declareProperty("HltEDMCollectionNames",    m_hltEdmCollectionNames, "Names of all HLT EDM Collections");
   declareProperty("JobOptionsType",           m_jobOptionsType="NONE");
   declareProperty("doMonitoring",             m_doMonitoring=true, "Produce framework monitoring histograms");
-  declareProperty("histHltResultSize",        m_histProp_Hlt_result_size, "Histogram for HLT result size in words");
+  declareProperty("histHltResultSize",        m_histProp_Hlt_result_size, "Histogram for HLT result size in words (overall)");
+  declareProperty("histHltResultSizePhysics", m_histProp_Hlt_result_size_physics, "Histogram for HLT result size in words for physics stream ");
+  declareProperty("histHltResultSizeExpress", m_histProp_Hlt_result_size_express, "Histogram for HLT result size in words for express stream ");
+  declareProperty("histHltResultSizeDS",      m_histProp_Hlt_result_size_DataScouting, "Histogram for HLT result size in words for DataScouting stream ");
   declareProperty("histNumberOfStreamTags",   m_histProp_numStreamTags, "Histogram with number of stream tags");
   declareProperty("histStreamTagNames",       m_histProp_streamTagNames,"Histogram with stream tag names");  
   declareProperty("histNumberROBsPartialEB",  m_histProp_num_partial_eb_robs, "Histogram with number of ROBs for PEB" );
@@ -472,18 +478,21 @@ StatusCode HltEventLoopMgr::initialize()
   }
   msgStream() << endmsg;
 
-  msgStream() << MSG::INFO << " ---> Fill monitoring histograms   = " << m_doMonitoring << endmsg ;
-  msgStream() << MSG::INFO << " ---> Hist: histHltResultSize      = " << m_histProp_Hlt_result_size << endmsg ;
-  msgStream() << MSG::INFO << " ---> Hist: histNumberOfStreamTags = " << m_histProp_numStreamTags << endmsg ;
-  msgStream() << MSG::INFO << " ---> Hist: histStreamTagNames     = " << m_histProp_streamTagNames << endmsg ;
-  msgStream() << MSG::INFO << " ---> Hist: histNumberROBsPartialEB= " << m_histProp_num_partial_eb_robs << endmsg ;
-  msgStream() << MSG::INFO << " ---> Hist: histHltEdmSizes        = " << m_histProp_Hlt_Edm_Sizes << endmsg;
-  msgStream() << MSG::INFO << " ---> HLT EDM Collection Names     = " << m_hltEdmCollectionNames << endmsg;
-  msgStream() << MSG::INFO << " ---> HltResult SG key             = " << m_HltResultName << endmsg ;
-  msgStream() << MSG::INFO << " ---> HLT debug stream name        = " << m_HltDebugStreamName << endmsg ;
-  msgStream() << MSG::INFO << " ---> HLT stream for forced events = " << m_HltForcedStreamName << endmsg ;
-  msgStream() << MSG::INFO << " ---> ForceHltReject               = " << m_forceHltReject << endmsg ;
-  msgStream() << MSG::INFO << " ---> ForceHltAccept               = " << m_forceHltAccept << endmsg;
+  msgStream() << MSG::INFO << " ---> Fill monitoring histograms             = " << m_doMonitoring << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histHltResultSize (overall)      = " << m_histProp_Hlt_result_size << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histHltResultSize (physics)      = " << m_histProp_Hlt_result_size_physics << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histHltResultSize (express)      = " << m_histProp_Hlt_result_size_express << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histHltResultSize (DataScouting) = " << m_histProp_Hlt_result_size_DataScouting << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histNumberOfStreamTags           = " << m_histProp_numStreamTags << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histStreamTagNames               = " << m_histProp_streamTagNames << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histNumberROBsPartialEB          = " << m_histProp_num_partial_eb_robs << endmsg ;
+  msgStream() << MSG::INFO << " ---> Hist: histHltEdmSizes                  = " << m_histProp_Hlt_Edm_Sizes << endmsg;
+  msgStream() << MSG::INFO << " ---> HLT EDM Collection Names               = " << m_hltEdmCollectionNames << endmsg;
+  msgStream() << MSG::INFO << " ---> HltResult SG key                       = " << m_HltResultName << endmsg ;
+  msgStream() << MSG::INFO << " ---> HLT debug stream name                  = " << m_HltDebugStreamName << endmsg ;
+  msgStream() << MSG::INFO << " ---> HLT stream for forced events           = " << m_HltForcedStreamName << endmsg ;
+  msgStream() << MSG::INFO << " ---> ForceHltReject                         = " << m_forceHltReject << endmsg ;
+  msgStream() << MSG::INFO << " ---> ForceHltAccept                         = " << m_forceHltAccept << endmsg;
 
   if (m_forceHltReject.value()) {
     msgStream() << MSG::INFO << " +------------------------------------------+ "  << endmsg ;
@@ -1935,7 +1944,6 @@ void HltEventLoopMgr::bookHistograms()
                                      m_histProp_Hlt_result_size.value().lowEdge(),
                                      m_histProp_Hlt_result_size.value().highEdge());
 
-  m_hist_Hlt_result_size->SetCanExtend(TH1::kAllAxes);
   regHistsTH1F.push_back(&m_hist_Hlt_result_size);
 
   // *-- HLT result status codes
@@ -1964,43 +1972,40 @@ void HltEventLoopMgr::bookHistograms()
   m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 3, std::string("Truncated HLT result (not send to debug stream)").c_str() );
   regHistsTH1F.push_back(&m_hist_Hlt_truncated_result);
 
-  // *-- HLT result size plot (Stream Physiscs Main)
+  // *-- HLT result size plot (Stream Physics Main)
   m_hist_Hlt_result_size_physics = 
-    new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (Main:physics))").c_str(),
-              (m_histProp_Hlt_result_size.value().title() + "-(Stream (Main:physics))" + ";words;entries").c_str(),
-              m_histProp_Hlt_result_size.value().bins(),
-              m_histProp_Hlt_result_size.value().lowEdge(),
-              m_histProp_Hlt_result_size.value().highEdge());
+    new TH1F ((m_histProp_Hlt_result_size_physics.value().title()).c_str(),
+              (m_histProp_Hlt_result_size_physics.value().title() + ";words;entries").c_str(),
+              m_histProp_Hlt_result_size_physics.value().bins(),
+              m_histProp_Hlt_result_size_physics.value().lowEdge(),
+              m_histProp_Hlt_result_size_physics.value().highEdge());
 
-  m_hist_Hlt_result_size_physics->SetCanExtend(TH1::kAllAxes);
   regHistsTH1F.push_back(&m_hist_Hlt_result_size_physics);
 
 
   // *-- HLT result size plot (Stream Express)
   m_hist_Hlt_result_size_express = 
-    new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (express:express))").c_str(),
-              (m_histProp_Hlt_result_size.value().title() + "-(Stream (express:express))" + ";words;entries").c_str(),
-              m_histProp_Hlt_result_size.value().bins(),
-              m_histProp_Hlt_result_size.value().lowEdge(),
-              m_histProp_Hlt_result_size.value().highEdge());
+    new TH1F ((m_histProp_Hlt_result_size_express.value().title()).c_str(),
+              (m_histProp_Hlt_result_size_express.value().title() + ";words;entries").c_str(),
+              m_histProp_Hlt_result_size_express.value().bins(),
+              m_histProp_Hlt_result_size_express.value().lowEdge(),
+              m_histProp_Hlt_result_size_express.value().highEdge());
 
-  m_hist_Hlt_result_size_express->SetCanExtend(TH1::kAllAxes);
   regHistsTH1F.push_back(&m_hist_Hlt_result_size_express);
 
 
   // *-- HLT result size plot (Stream calibration, DataScouting results)
   m_hist_Hlt_result_size_DataScouting = 
-    new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Streams (DataScouting_*:calibration))").c_str(),
-              (m_histProp_Hlt_result_size.value().title() + "-(Streams (DataScouting_*:calibration))" + ";words;entries").c_str(),
-              m_histProp_Hlt_result_size.value().bins(),
-              m_histProp_Hlt_result_size.value().lowEdge(),
-              m_histProp_Hlt_result_size.value().highEdge());
+    new TH1F ((m_histProp_Hlt_result_size_DataScouting.value().title()).c_str(),
+              (m_histProp_Hlt_result_size_DataScouting.value().title() + ";words;entries").c_str(),
+              m_histProp_Hlt_result_size_DataScouting.value().bins(),
+              m_histProp_Hlt_result_size_DataScouting.value().lowEdge(),
+              m_histProp_Hlt_result_size_DataScouting.value().highEdge());
 
-  m_hist_Hlt_result_size_DataScouting->SetCanExtend(TH1::kAllAxes);
   regHistsTH1F.push_back(&m_hist_Hlt_result_size_DataScouting);
 
 
-  // *-- HLT result size profile plot for all stream types "physiscs"
+  // *-- HLT result size profile plot for all stream types "physics"
   m_hist_HltResultSizes_Stream_physics = new TProfile( "Average Hlt Result size for physics streams",
                                                        "Average Hlt Result size for physics streams;Stream Name;Average size in words",
                                                        1,
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
index 767a1b993fde473b71967b1c2c8f2a70583ab917..5ee09e8910effdbfbb5b56308644010dc6302f39 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
@@ -35,7 +35,7 @@ namespace HltROBDataProviderConstants {
   // reserve a number of ROB monitor collections
   static const int Number_of_Rob_Monitor_Structs = 10;
   // number of ROBs in an event, used to reserve space in an array
-  static const int Max_Number_Of_ROBs = 1800;
+  static const int Max_Number_Of_ROBs = 2000;
 }
 
 // Constructor.
@@ -331,6 +331,11 @@ void HltROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
     if (m_enabledTileMetROBs.value().size() != 0) robIdsUnique.insert(robIdsUnique.end(),m_enabledTileMetROBs.value().begin(),m_enabledTileMetROBs.value().end());
   }
 
+  //---------------------------------------------
+  // preload only requests with more than one ROB
+  //---------------------------------------------
+  if (robIdsUnique.size() <= 1) return;
+
   //-------------------
   //--- offline running
   //-------------------
@@ -389,99 +394,14 @@ void HltROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
 
     // for online running the requested ROBs should be not found in cache
     // ------------------------------------------------------------------
-    // vector with missing ROB ids for DataCollector
-    std::vector<uint32_t> vRobIds;
-    vRobIds.reserve( robIdsUnique.size() ) ;
 
     // find missing ROB ids which should be retrieved  
     ATH_MSG_DEBUG(" ---> addROBData: Number of ROB Ids requested : " << robIdsUnique.size());
 
-    for (uint32_t id : robIdsUnique) {
-
-      // check if ROB is already in cache
-      ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(id) ;
-      if(map_it != m_online_robmap.end()) {
-        ATH_MSG_DEBUG(" ---> addROBData: Found   ROB Id : 0x" << MSG::hex << (*map_it).second.source_id());
-        
-        continue;
-      } 
-
-      // check if ROB should be ignored
-      if (m_ignoreROB.value().size() != 0) {
-        std::vector<uint32_t>::const_iterator rob_ignore_it =
-            std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id);
-        if(rob_ignore_it != m_ignoreROB.value().end()) {
-          ATH_MSG_DEBUG(" ---> addROBData: ROB Id : 0x" << MSG::hex << id << MSG::dec << " will be not retrieved, since it is on the veto list.");
-          
-          
-          continue;
-        }
-      }
-
-      // check if ROB is actually enabled for readout
-      // do not perform this check for MET ROBs
-      if ( (m_enabledROBs.value().size() != 0) && 
-          (eformat::helper::SourceIdentifier(id).subdetector_id() != eformat::TDAQ_LAR_MET) &&
-          (eformat::helper::SourceIdentifier(id).subdetector_id() != eformat::TDAQ_TILE_MET) ){
-        std::vector<uint32_t>::const_iterator rob_enabled_it =
-            std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),id);
-        if(rob_enabled_it == m_enabledROBs.value().end()) {
-          ATH_MSG_DEBUG(" ---> addROBData: ROB Id : 0x" << MSG::hex << id << MSG::dec
-                        << " will be not retrieved, since it is not on the list of enabled ROBs.");
-          
-          
-          continue;
-        }
-      }
-      // Only Monitor SCHEDULED ROBs
-      if ( p_robMonStruct ) {
-      		
-          (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::SCHEDULED;
-        }
-
-      // the ROB should be retrieved from the ROS
-      ATH_MSG_DEBUG(" ---> addROBData: Request ROB Id : 0x" << MSG::hex << id <<" from ROS ");
-      vRobIds.push_back( id ) ;
-    } // end loop over requested input ROBs
-
-    if (vRobIds.size() == 0) {
-      ATH_MSG_DEBUG(" ---> addROBData: either all requested ROBs are found in cache for running mode ONLINE, \n"
-                    << "      or input ROB Id list was empty, \n"
-                    << "      or all requested ROBs were not retrieved due to the veto list.\n"
-                    << "      Number of requested ROB Ids = " << robIdsUnique.size() << "\n"
-                    << "      Lvl1 id                     = " << m_currentLvl1ID);
-      // Set ROB request time also in the case when no DataCollector request is necessary 
-      // to allow correlation with RoI request times
-      // start and stop times will be equal
-      if ( p_robMonStruct ) {
-        struct timeval time_start;
-        struct timeval time_stop;
-
-        gettimeofday(&time_start, 0);
-        gettimeofday(&time_stop, 0);
-
-        p_robMonStruct->start_time_of_ROB_request    = time_start;
-        p_robMonStruct->end_time_of_ROB_request      = time_stop;
-      }
-    } else {
-      //
-      // Tell the DCM that these ROBs may be needed
-      // ---------------------------------------------------------------
-      //
-      if (msgLvl(MSG::DEBUG)) {
-        std::ostringstream ost;
-        ost << "      Number of scheduled ROB Ids = " << vRobIds.size() << "\n" ;
-        unsigned int rob_counter = 1;
-        for (uint32_t rob : vRobIds) {
-          ost << "       # = "<< std::setw(5) << rob_counter++ << " ROB id = 0x" << std::hex << rob << std::dec << "\n";
-        }
-        ATH_MSG_DEBUG(" ---> addROBData: The following ROB Ids are scheduled for retrieval and are reserved in the DCM: \n"
-                      << "      Lvl1 id                     = " << m_currentLvl1ID << "\n"
-                      << ost.str());                      
-      }
-      // reserve the ROBs in the DCM
-      hltinterface::DataCollector::instance()->reserveROBData(m_currentLvl1ID, vRobIds);
-    }
+    //--------------------------
+    // update internal ROB cache
+    //--------------------------
+    addROBDataToCache(robIdsUnique, p_robMonStruct);
 
     // add the ROB monitoring structure to the collection
     if ( p_robMonCollection && p_robMonStruct ) p_robMonCollection->push_back( p_robMonStruct );
@@ -1066,37 +986,33 @@ void HltROBDataProviderSvc::addROBDataToCache(std::vector<uint32_t>& robIdsForRe
     // check if ROB is actually enabled for readout
     // do not perform this check for MET ROBs
     if (m_enabledROBs.value().size() != 0) { 
-	 if ( (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_LAR_MET) &&
-	 (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_TILE_MET) ){
-      std::vector<uint32_t>::const_iterator rob_enabled_it =
-	std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),(*rob_it));
-      if(rob_enabled_it == m_enabledROBs.value().end()) {
-        ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << (*rob_it) << MSG::dec
-                      << " will be not retrieved, since it is not on the list of enabled ROBs.");
-        if ( p_robMonStruct ) {
-        	
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::DISABLED;
-        
-      }
-	continue;
+      if ( (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_LAR_MET) &&
+	   (eformat::helper::SourceIdentifier(*rob_it).subdetector_id() != eformat::TDAQ_TILE_MET) ){
+	std::vector<uint32_t>::const_iterator rob_enabled_it =
+	  std::find(m_enabledROBs.value().begin(), m_enabledROBs.value().end(),(*rob_it));
+	if(rob_enabled_it == m_enabledROBs.value().end()) {
+	  ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << (*rob_it) << MSG::dec
+			<< " will be not retrieved, since it is not on the list of enabled ROBs.");
+	  if ( p_robMonStruct ) {
+	    (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::DISABLED;
+	  }
+	  continue;
+	}
       }
     }
-    
-  }
 
     if (m_ignoreROB.value().size() != 0) {
-    std::vector<uint32_t>::const_iterator rob_ignore_it =
-    std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id);
-    if(rob_ignore_it != m_ignoreROB.value().end()) {
-      ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << id << MSG::dec
-      << " will be not retrieved, since it is on the veto list.");
-      if ( p_robMonStruct ) {
-      	
-        (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
-       }
-       continue;
-     }
-   }
+      std::vector<uint32_t>::const_iterator rob_ignore_it =
+	std::find(m_ignoreROB.value().begin(), m_ignoreROB.value().end(),id);
+      if(rob_ignore_it != m_ignoreROB.value().end()) {
+	ATH_MSG_DEBUG(" ---> addROBDataToCache: ROB Id : 0x" << MSG::hex << id << MSG::dec
+		      << " will be not retrieved, since it is on the veto list.");
+	if ( p_robMonStruct ) {
+	  (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::IGNORED;
+	}
+	continue;
+      }
+    }
 
     // separate MET and detector ROBs if requested
     if ( (m_separateMETandDetROBRetrieval.value()) &&
@@ -1129,14 +1045,8 @@ void HltROBDataProviderSvc::addROBDataToCache(std::vector<uint32_t>& robIdsForRe
 
     // add MET ROBs to Det ROBs
     vRobInfos.insert( vRobInfos.end(), vMETRobInfos.begin(), vMETRobInfos.end() );
-
-    
   }
 
-
-
-  
-
   if(msgLvl(MSG::DEBUG) && ((vRobIds.size()!=0) || (vMETRobIds.size()!=0))) {
     std::ostringstream ost;
     unsigned int rob_counter = 1;
@@ -1209,6 +1119,10 @@ void HltROBDataProviderSvc::updateROBDataCache(std::vector<hltinterface::DCM_ROB
   typedef std::vector<hltinterface::DCM_ROBInfo> ROBInfoVec;
   for(ROBInfoVec::const_iterator it=vRobInfo.begin(); it!=vRobInfo.end(); ++it) {
     uint32_t id = it->robFragment.source_id() ;
+
+    // check first if ROB is already in cache (for full event requests)
+    ONLINE_ROBMAP::iterator map_it = m_online_robmap.find(id) ;
+    if(map_it != m_online_robmap.end()) continue;
     
     if ((it->robFragment.rod_ndata() == 0) && (m_removeEmptyROB)) {
       ATH_MSG_DEBUG(" ---> addROBDataToCache: Empty ROB Id = 0x" << MSG::hex << id << MSG::dec
@@ -1236,18 +1150,17 @@ void HltROBDataProviderSvc::updateROBDataCache(std::vector<hltinterface::DCM_ROB
       m_online_robmap[id]= (it->robFragment);
 
       //* detailed monitoring
-    if ( p_robMonStruct ) {
-    	
-      (p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::RETRIEVED;
-      (p_robMonStruct->requested_ROBs)[id].rob_size    = it->robFragment.fragment_size_word();
-      if ( it->robFragment.nstatus() != 0 ) {
-        const uint32_t* it_status;
-        it->robFragment.status(it_status);
-        for (uint32_t k=0; k < it->robFragment.nstatus(); k++) {
-          (p_robMonStruct->requested_ROBs)[id].rob_status_words.push_back( *(it_status+k) );
-        }
-      }
-    } // end detailed monitoring
+      if ( p_robMonStruct ) {
+	(p_robMonStruct->requested_ROBs)[id].rob_history = robmonitor::RETRIEVED;
+	(p_robMonStruct->requested_ROBs)[id].rob_size    = it->robFragment.fragment_size_word();
+	if ( it->robFragment.nstatus() != 0 ) {
+	  const uint32_t* it_status;
+	  it->robFragment.status(it_status);
+	  for (uint32_t k=0; k < it->robFragment.nstatus(); k++) {
+	    (p_robMonStruct->requested_ROBs)[id].rob_status_words.push_back( *(it_status+k) );
+	  }
+	}
+      } // end detailed monitoring
     }
 
     //* fill monitoring histogram for ROB generic status
@@ -1274,8 +1187,6 @@ void HltROBDataProviderSvc::updateROBDataCache(std::vector<hltinterface::DCM_ROB
         }
       }
     }
-    
-    
   }   // end loop over ROBInfo records
   return;
 } // end void updateROBDataCache(...)
diff --git a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigL1TopoROBMonitor.cxx b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigL1TopoROBMonitor.cxx
index cebf7abfa7152e5d7035847eb4b1d1088f29cf8d..25157d3ffa53a84963c3a3934d6ec74f630db50f 100644
--- a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigL1TopoROBMonitor.cxx
+++ b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigL1TopoROBMonitor.cxx
@@ -471,6 +471,7 @@ StatusCode TrigL1TopoROBMonitor::doCnvMon(bool prescalForDAQROBAccess) {
   m_triggerBits.reset();
   m_overflowBits.reset();
   m_topoSimResult.reset();
+  m_topoSimOverfl.reset();
   m_topoCtpResult.reset();
   m_triggerBitsDaqRob.reset();
   m_overflowBitsDaqRob.reset();
diff --git a/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgAnalysis.py b/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgAnalysis.py
index 93b7fab31293110c696cb1dd75268a39439e724b..2657baa2bd28f23835d88beae541e6b29e8dc145 100644
--- a/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgAnalysis.py
+++ b/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgAnalysis.py
@@ -28,7 +28,7 @@ def dbgPreRun(inputFileList,outputFileList):
     total = 0
     #open root output file
     out_file = outputFileList[0]
-    hfile = TFile( out_file , 'UPDATE' )
+    hfile = TFile( out_file , 'RECREATE' )
     #inicialize dbgEventInfo,  this is the main event analysis class
     eventInfo = dbgEventInfo("_Pre",inputFileList.value[0])
     data = []
@@ -264,13 +264,13 @@ def getAsetupString(release):
     #If TestArea is for tzero (tzero/software/patches/AtlasP1HLT-RELEASE), then returns tzero/software/patches/AtlasP1HLT-release where release is the parameter given to this function getAsetupString(release)    
     if eVarDic.get('TestArea') :
         TestArea = eVarDic['TestArea']
-        if  TestArea.find("tzero/software/patches/AtlasP1HLT-") > 0 :
+        if  TestArea.find("tzero/software/patches/AthenaP1-") > 0 :
             testarea = TestArea.split('-')
             TestArea = testarea[0]+'-'+release
-        asetupString = AtlasProject + ',' + release + ',gcc49,cvmfs --testarea '+ TestArea
+        asetupString = AtlasProject + ',' + release + ',gcc62 --testarea '+ TestArea
         return asetupString
 
     #else, there is no TestArea,  then use the local directory    
     else :
-        asetupString = AtlasProject + ',' + release + ',gcc49,here'
+        asetupString = AtlasProject + ',' + release + ',gcc62,here'
     return asetupString
diff --git a/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgEventInfo.py b/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgEventInfo.py
index e9ce500f4f44fc85fe52fa7c134384b1804966ae..579683da3b1b3b9bd1be426d5af3707535525c9e 100644
--- a/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgEventInfo.py
+++ b/HLT/Trigger/TrigTransforms/TrigTransform/python/dbgEventInfo.py
@@ -405,7 +405,6 @@ class dbgEventInfo:
 
 
     def root_definitions(self,dbgStep,inputFile):
-        gROOT.Reset()
         gStyle.SetCanvasColor(0)
         gStyle.SetOptStat(000000)
         gROOT.SetStyle("Plain")
diff --git a/HLT/Trigger/TrigTransforms/TrigTransform/python/trigRecoExe.py b/HLT/Trigger/TrigTransforms/TrigTransform/python/trigRecoExe.py
index 5e5b57a923670f870ed7f964ca722800595da339..8726c20d3edd14120f200da041ed11359594acaa 100644
--- a/HLT/Trigger/TrigTransforms/TrigTransform/python/trigRecoExe.py
+++ b/HLT/Trigger/TrigTransforms/TrigTransform/python/trigRecoExe.py
@@ -16,7 +16,7 @@ import re
 from PyJobTransforms.trfExe import athenaExecutor
 
 #imports for preExecute
-from PyJobTransforms.trfUtils import asetupReport
+from PyJobTransforms.trfUtils import asetupReport, cvmfsDBReleaseCheck
 import PyJobTransforms.trfEnv as trfEnv
 import PyJobTransforms.trfExceptions as trfExceptions
 from PyJobTransforms.trfExitCodes import trfExit as trfExit
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h b/InnerDetector/InDetConditions/SCT_ConditionsServices/SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h
index 8b937a9ad424f3ef3e195e47a35544882bb1ba60..60e51a0725520b6e8dc363cec24dae1c88013f95 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsServices/SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h
@@ -52,7 +52,7 @@ public:
   /** Map of chips status for all modules with at least one bad chip (packed as 1st 12 bits of unsigned int)*/
   virtual std::map<Identifier, unsigned int>*            badChips()                                                                                          = 0;  
   /** Chips status for a particular module (packed as 1st 12 bits of unsigned int)*/ 
-  virtual unsigned int                                   badChips(const Identifier & moduleId)                                                                       = 0;  
+  virtual unsigned int                                   badChips(const Identifier & moduleId) const                                                                      = 0;
 
   /** Set of bad strip Identifiers */ 
   virtual void                                           badStrips(std::set<Identifier>& strips, bool ignoreBadModules = false, bool ignoreBadChips = false) = 0;  
@@ -60,7 +60,7 @@ public:
   virtual void                                           badStrips(const Identifier & moduleId, std::set<Identifier>& strips, bool ignoreBadModules = false, bool ignoreBadChips = false) = 0;
 
   /** Get the chip number containing a particular strip*/
-  virtual int                                            getChip(const Identifier & stripId) = 0;
+  virtual int                                            getChip(const Identifier & stripId) const = 0;
 
 private:
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.cxx b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.cxx
index 3a9ea8a69c1d889f1c09bf2503f160a653308dce..84d5811bba99034a451deafa87e37ef50ee3bcf9 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.cxx
@@ -22,6 +22,8 @@
 #include "Identifier/IdentifierHash.h"
 #include "SCT_Cabling/ISCT_CablingSvc.h"
 #include "SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h"
+#include "InDetReadoutGeometry/SCT_DetectorManager.h"
+#include "InDetReadoutGeometry/SiDetectorElement.h"
 
 ///Read Handle
 #include "StoreGate/ReadHandle.h"
@@ -43,7 +45,8 @@ SCT_ByteStreamErrorsSvc::SCT_ByteStreamErrorsSvc( const std::string& name, ISvcL
   m_numRODsHVon(0),
   m_numRODsTotal(0),
   m_condensedMode(true),
-  m_rodFailureFraction(0.1)
+  m_rodFailureFraction(0.1),
+  m_pManager{nullptr}
 {
   declareProperty("EventStore",m_storeGate);
   declareProperty("DetectorStore",m_detStore);
@@ -122,6 +125,8 @@ SCT_ByteStreamErrorsSvc::initialize(){
 
   m_tempMaskedChips = new std::map<Identifier, unsigned int>;
 
+  ATH_CHECK(m_detStore->retrieve(m_pManager, "SCT"));
+
   // Read Handle Key
   ATH_CHECK(m_bsErrContainerName.initialize());
 
@@ -286,7 +291,7 @@ SCT_ByteStreamErrorsSvc::addRODHVCounter(bool HVisOn) {
 
 bool 
 SCT_ByteStreamErrorsSvc::canReportAbout(InDetConditions::Hierarchy h){
-  return (h==InDetConditions::SCT_SIDE); 
+  return (h==InDetConditions::SCT_SIDE or h==InDetConditions::SCT_CHIP);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -370,15 +375,103 @@ SCT_ByteStreamErrorsSvc::isGood(const IdentifierHash & elementIdHash) {
 
 bool 
 SCT_ByteStreamErrorsSvc::isGood(const Identifier & elementId, InDetConditions::Hierarchy h){
+  if (not canReportAbout(h)) return true;
   
   if (m_isRODSimulatedData) return false;
+
   if (h==InDetConditions::SCT_SIDE) {
     const IdentifierHash elementIdHash = m_sct_id->wafer_hash(elementId);
     return isGood(elementIdHash);
   }
+  if (h==InDetConditions::SCT_CHIP) {
+    return isGoodChip(elementId);
+  }
+
   return true;
 }
 
+bool
+SCT_ByteStreamErrorsSvc::isGoodChip(const Identifier& stripId) const {
+  // This check assumes present SCT.
+  // Get module number
+  const Identifier moduleId{m_sct_id->module_id(stripId)};
+  if (not moduleId.is_valid()) {
+    ATH_MSG_WARNING("moduleId obtained from stripId " << stripId << " is invalid.");
+    return false;
+  }
+
+  // tempMaskedChips and abcdErrorChips hold 12 bits.
+  // bit 0 (LSB) is chip 0 for side 0.
+  // bit 5 is chip 5 for side 0.
+  // bit 6 is chip 6 for side 1.
+  // bit 11 is chip 11 for side 1.
+  // Temporarily masked chip information
+  const unsigned int v_tempMaskedChips{tempMaskedChips(moduleId)};
+  // Information of chips with ABCD errors
+  const unsigned int v_abcdErrorChips{abcdErrorChips(moduleId)};
+  // Take 'OR' of tempMaskedChips and abcdErrorChips
+  const unsigned int badChips{v_tempMaskedChips | v_abcdErrorChips};
+
+  // If there is no bad chip, this check is done.
+  if (badChips==0) return true;
+
+  const int side{m_sct_id->side(stripId)};
+  // Check the six chips on the side
+  // 0x3F  = 0000 0011 1111
+  // 0xFC0 = 1111 1100 0000
+  // If there is no bad chip on the side, this check is done.
+  if ((side==0 and (badChips & 0x3F)==0) or (side==1 and (badChips & 0xFC0)==0)) return true;
+
+  int chip{getChip(stripId)};
+  if (chip<0 or chip>=12) {
+    ATH_MSG_WARNING("chip number is invalid: " << chip);
+    return false;
+  }
+
+  // Check if the chip is bad
+  const bool badChip{badChips & (1<<chip)};
+
+  return (not badChip);
+}
+
+int
+SCT_ByteStreamErrorsSvc::getChip(const Identifier& stripId) const {
+  const InDetDD::SiDetectorElement* siElement{m_pManager->getDetectorElement(stripId)};
+  if (!siElement) {
+    ATH_MSG_DEBUG ("InDetDD::SiDetectorElement is not obtained from stripId " << stripId);
+    return -1;
+  }
+
+  // Get strip number
+  const int strip{m_sct_id->strip(stripId)};
+  if (strip<0 or strip>=768) {
+    // This check assumes present SCT.
+    ATH_MSG_WARNING("strip number is invalid: " << strip);
+    return -1;
+  }
+
+  // Conversion from strip to chip (specific for present SCT)
+  int chip{strip/128}; // One ABCD chip reads 128 strips
+  // Relation between chip and offline strip is determined by the swapPhiReadoutDirection method.
+  // If swap is false
+  //  offline strip:   0            767
+  //  chip on side 0:  0  1  2  3  4  5
+  //  chip on side 1: 11 10  9  8  7  6
+  // If swap is true
+  //  offline strip:   0            767
+  //  chip on side 0:  5  4  3  2  1  0
+  //  chip on side 1:  6  7  8  9 10 11
+  const bool swap{siElement->swapPhiReadoutDirection()};
+  const int side{m_sct_id->side(stripId)};
+  if (side==0) {
+    chip = swap ?  5 - chip :     chip;
+  } else {
+    chip = swap ? 11 - chip : 6 + chip;
+  }
+
+  return chip;
+}
+
 /////////////////////////////////////////////////////////////////////////
 
 /** reset everything at the start of every event. */
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.h b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.h
index 633b57af2b8228134e3bc79e5ce399e3849bd791..1947ae797c8aee1fab0bd7c367d93974f6df5c9c 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ByteStreamErrorsSvc.h
@@ -41,6 +41,9 @@ class IdentifierHash;
 class StatusCode;
 class ISCT_CablingSvc;
 class ISCT_ConfigurationConditionsSvc;
+namespace InDetDD {
+  class SCT_DetectorManager;
+}
 
 /**
  * @class SCT_ByteStreamErrorsSvc
@@ -146,6 +149,11 @@ private:
   unsigned int m_randomSeed; // The seed of random numbers for ROD disabling
 
   std::map<boost::uint32_t, bool> m_rodDecodeStatuses;
+
+  const InDetDD::SCT_DetectorManager* m_pManager; //!< SCT detector manager
+
+  bool isGoodChip(const Identifier& stripId) const;
+  int getChip(const Identifier& stripId) const;
 };
 
 #endif
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.cxx b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.cxx
index 529efde3349d8da1f26e2a1c7daa750b35ab2e19..dcf8decf0d2346e2a7182407f63eb343f49a4d98 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.cxx
@@ -119,8 +119,11 @@ StatusCode SCT_ConfigurationConditionsSvc::queryInterface(const InterfaceID& rii
 
 // What level of element can this service report about
 bool SCT_ConfigurationConditionsSvc::canReportAbout(InDetConditions::Hierarchy h){
-  return (h == InDetConditions::SCT_STRIP or h == InDetConditions::SCT_MODULE or 
-    h == InDetConditions::SCT_SIDE or h == InDetConditions::DEFAULT); 
+  return (h == InDetConditions::SCT_STRIP or
+          h == InDetConditions::SCT_CHIP or
+          h == InDetConditions::SCT_SIDE or
+          h == InDetConditions::SCT_MODULE or
+          h == InDetConditions::DEFAULT);
 }
 
 // Is an element with this Identifier and hierachy good?
@@ -136,6 +139,8 @@ bool SCT_ConfigurationConditionsSvc::isGood(const Identifier & elementId, InDetC
     result = (m_badModuleIds->find(elementId) == m_badModuleIds->end());
   } else if (h == InDetConditions::SCT_SIDE or h == InDetConditions::DEFAULT) {
     result = (m_badWaferIds->find(elementId) == m_badWaferIds->end());
+  } else if (h == InDetConditions::SCT_CHIP) {
+    result = isGoodChip(elementId);
   }
   return result;
 }
@@ -146,6 +151,46 @@ bool SCT_ConfigurationConditionsSvc::isGood(const IdentifierHash & hashId){
   return isGood(elementId);
 }
 
+// Is a chip with this Identifier good?
+bool SCT_ConfigurationConditionsSvc::isGoodChip(const Identifier& stripId) const {
+  // This check assumes present SCT.
+  // Get module number
+  const Identifier moduleId{m_pHelper->module_id(stripId)};
+  if (not moduleId.is_valid()) {
+    ATH_MSG_WARNING("moduleId obtained from stripId " << stripId << " is invalid.");
+    return false;
+  }
+
+  // badChips word for the module
+  const unsigned int v_badChips{badChips(moduleId)};
+  // badChips holds 12 bits.
+  // bit 0 (LSB) is chip 0 for side 0.
+  // bit 5 is chip 5 for side 0.
+  // bit 6 is chip 6 for side 1.
+  // bit 11 is chip 11 for side 1.
+
+  // If there is no bad chip, this check is done.
+  if (v_badChips==0) return true;
+
+  const int side{m_pHelper->side(stripId)};
+  // Check the six chips on the side
+  // 0x3F  = 0000 0011 1111
+  // 0xFC0 = 1111 1100 0000
+  // If there is no bad chip on the side, this check is done.
+  if ((side==0 and (v_badChips & 0x3F)==0) or (side==1 and (v_badChips & 0xFC0)==0)) return true;
+
+  int chip{getChip(stripId)};
+  if (chip<0 or chip>=12) {
+    ATH_MSG_WARNING("chip number is invalid: " << chip);
+    return false;
+  }
+
+  // Check if the chip is bad
+  const bool badChip{v_badChips & (1<<chip)};
+
+  return (not badChip);
+}
+
   // Callback funtion (with arguments required by IovDbSvc) to fill channel, module and link info
 StatusCode SCT_ConfigurationConditionsSvc::fillData(int& /*i*/ , std::list<std::string>& l){  
   std::list<std::string>::iterator itr(l.begin());
@@ -482,7 +527,7 @@ bool SCT_ConfigurationConditionsSvc::isWaferInBadModule(const Identifier& waferI
 }
 
 // Find the chip number containing a particular strip Identifier
-int SCT_ConfigurationConditionsSvc::getChip(const Identifier & stripId) {
+int SCT_ConfigurationConditionsSvc::getChip(const Identifier & stripId) const {
 
   // Find side and strip number
   const int side(m_pHelper->side(stripId));
@@ -529,7 +574,7 @@ std::pair<bool, bool> SCT_ConfigurationConditionsSvc::badLinks(const Identifier
   return ((linkItr != m_badLinks->end()) ? (*linkItr).second : std::make_pair(true,true));
 }
 
-unsigned int SCT_ConfigurationConditionsSvc::badChips(const Identifier & moduleId) {
+unsigned int SCT_ConfigurationConditionsSvc::badChips(const Identifier & moduleId) const {
   // Bad chips for a given module
   std::map<Identifier, unsigned int>::const_iterator chipItr(m_badChips->find(moduleId));  
   return ((chipItr != m_badChips->end()) ? (*chipItr).second : static_cast<unsigned int>(0));
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.h b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.h
index 9b8347515092d3990ca1f3cd2460f7172c94e7c8..cc8032616e0053f64a0ecaf1bfa60f3ec2e84555 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_ConfigurationConditionsSvc.h
@@ -105,9 +105,9 @@ public:
   /**List of bad chips*/
   virtual std::map<Identifier, unsigned int>*           badChips() {return m_badChips;}
   /**Bad chips for a given module*/
-  virtual unsigned int                  badChips(const Identifier & moduleId);
+  virtual unsigned int                  badChips(const Identifier & moduleId) const;
   /** Get the chip number containing a particular strip*/
-  int                                   getChip(const Identifier & stripId);
+  int                                   getChip(const Identifier & stripId) const;
 
 private:
   std::set<Identifier>*                 m_badChannelIds;                 //!< Set of bad strip identifiers (not those in bad strips)
@@ -144,8 +144,8 @@ private:
   /** Is a wafer in a bad module*/
   bool                                  isWaferInBadModule(const Identifier& waferId);
   
-  ///** Get the chip number containing a particular strip*/
-  //int                                   getChip(Identifier stripId);
+  /**Is a chip with this Identifier good?*/
+  bool isGoodChip(const Identifier& stripId) const;
 
   /** enum for constants*/
   enum {badLink=255, stripsPerChip=128, lastStrip=767};
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleSvc.h b/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleSvc.h
index 3302571af26abaa9fb3ad09a6465de7f92962c6d..a30c4b1d19ac9fc716b2d86b1f579479d12d6260 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleSvc.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/SiLorentzAngleSvc.h
@@ -146,7 +146,6 @@ private:
   const DataHandle<AthenaAttributeList> m_dbData;
 
   bool m_isPixel;  
-  bool m_magFieldInit;
 
   InDet::SiliconProperties m_siProperties;
   const InDetDD::SiDetectorManager * m_detManager;
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleSvc.cxx b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleSvc.cxx
index 764d82e5cbc976b6df8a9cfe441e36903b93c81e..d7a2397e06ca34f338679bedb0fa88922f8c7c4e 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleSvc.cxx
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleSvc.cxx
@@ -30,7 +30,6 @@ SiLorentzAngleSvc::SiLorentzAngleSvc( const std::string& name, ISvcLocator* pSvc
   m_detStore("StoreGateSvc/DetectorStore", name),
   m_geoModelSvc("GeoModelSvc", name),
   m_isPixel(true),
-  m_magFieldInit(false),
   m_detManager(0)
  
 {
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index a1a7efa92059cab369c2f91fed4352413036badf..aca1fc0949fc8af185cd4edf548fc160bf17ee15 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -252,12 +252,14 @@ if DetFlags.haveRIO.SCT_on():
       if (InDetFlags.doPrintConfigurables()):
         print InDetSCT_ModuleVetoSvc
 
-    # Load bytestream errors service
-    from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ByteStreamErrorsSvc
-    InDetSCT_ByteStreamErrorsSvc = SCT_ByteStreamErrorsSvc(name = "InDetSCT_ByteStreamErrorsSvc")
-    ServiceMgr += InDetSCT_ByteStreamErrorsSvc
+    # Load bytestream errors service (use default instance without "InDet")
+    # @TODO find a better to solution to get the correct service for the current job.
+    if not hasattr(ServiceMgr, "SCT_ByteStreamErrorsSvc"):
+        from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ByteStreamErrorsSvc
+        SCT_ByteStreamErrorsSvc = SCT_ByteStreamErrorsSvc(name = "SCT_ByteStreamErrorsSvc")
+        ServiceMgr += SCT_ByteStreamErrorsSvc
     if (InDetFlags.doPrintConfigurables()):
-        print InDetSCT_ByteStreamErrorsSvc
+        print ServiceMgr.SCT_ByteStreamErrorsSvc
     
     if InDetFlags.useSctDCS():
         if not conddb.folderRequested('/SCT/DCS/CHANSTAT'):
@@ -295,7 +297,7 @@ if DetFlags.haveRIO.SCT_on():
         # Configure summary service
         InDetSCT_ConditionsSummarySvc.ConditionsServices= [ "InDetSCT_ConfigurationConditionsSvc",
                                                             "InDetSCT_FlaggedConditionSvc",
-                                                            "InDetSCT_ByteStreamErrorsSvc",
+                                                            "SCT_ByteStreamErrorsSvc",
                                                             "InDetSCT_ReadCalibDataSvc",
                                                             "InDetSCT_TdaqEnabledSvc"]
         if not athenaCommonFlags.isOnline():
@@ -312,7 +314,7 @@ if DetFlags.haveRIO.SCT_on():
         InDetSCT_ConditionsSummarySvc.ConditionsServices= [ "InDetSCT_ConfigurationConditionsSvc",
                                                             "InDetSCT_FlaggedConditionSvc",
                                                             "InDetSCT_MonitorConditionsSvc",
-                                                            "InDetSCT_ByteStreamErrorsSvc",
+                                                            "SCT_ByteStreamErrorsSvc",
                                                             "InDetSCT_ReadCalibDataSvc"]
 
 
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPostProcessing.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPostProcessing.py
index e3e761f6237297ea13eb49be63c50ca50d331482..acc7068f4007cca45f9359a53d8864f6844db152 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPostProcessing.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecPostProcessing.py
@@ -278,6 +278,10 @@ class InDetTrigTrackingxAODCnv_EF( InDet__TrigTrackingxAODCnv ):
       if "_IDTrig" in name and (type=="muon" or type=="electron"):
         self.doIBLresidual = True
 
+      #for FTK commissioning
+      if "_FTK" in name:
+        self.doIBLresidual = True
+
       #monitoring
       self.MonSliceSpecific = True
       from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigSliceSettings.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigSliceSettings.py
index 704ebda2c7c01d8330e5acc7c9fcf2c885de2cc4..b00f153bbc1eb12c17eb61276baef586b20817a5 100644
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigSliceSettings.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigSliceSettings.py
@@ -33,6 +33,7 @@ class InDetTrigSliceSettingsDB:
                'minBias2',            #two pass (low-pt tracking)
                'heavyIon', 'heavyIonFS',   #RoI and FS instances for the heavy ion
                'minBias400',          #another minBias with 400MeV threshold
+               'fullScan2',           #2GeV threshold for MET
                'tauCore', 'tauIso',
                'beamSpot', 'cosmics',
                'bjetVtx',
@@ -54,7 +55,6 @@ class InDetTrigSliceSettingsDB:
     seedradbinwidth = {}
     d0seedmax = {}
     d0seedppsmax = {}
-    d0trackinitialmax = {}
     checkseedredundancy = {}
     dospphifiltering = {}
     dozfinder = {}
@@ -75,6 +75,7 @@ class InDetTrigSliceSettingsDB:
     ptmin['heavyIonFS'] = 0.4 * GeV
     ptmin['hadCalib'] = 0.5 * GeV
     ptmin['fullScan500'] = 0.5 * GeV
+    ptmin['fullScan2'] = 2. * GeV
     ptmin['minBias400'] = 0.39 * GeV
     ptmin['bphysHighPt'] = 2. * GeV
     ptmin['bjetVtx'] = 5. * GeV
@@ -84,7 +85,7 @@ class InDetTrigSliceSettingsDB:
     for i in _slices:
       d0seedmax[i] = 4.0
       d0seedppsmax[i] = 1.7
-      d0trackinitialmax[i] = 20.0
+
     d0seedmax['bphysics'] = 10.0
     d0seedmax['bphysHighPt'] = 10.0
     d0seedmax['muon'] = 10.0
@@ -92,11 +93,9 @@ class InDetTrigSliceSettingsDB:
 
     d0seedmax['cosmics'] = 1000.0
     d0seedppsmax['cosmics'] = 1000.0
-    d0trackinitialmax['cosmics'] = 1000.0
 
     self.db['d0SeedMax']=d0seedmax
     self.db['d0SeedPPSMax']=d0seedppsmax
-    self.db['d0TrackInitialMax']=d0trackinitialmax
 
     for i in _slices:
       dozfinder[i] = False 
@@ -158,6 +157,7 @@ class InDetTrigSliceSettingsDB:
       'hadCalib'  : 0.4,
       'fullScan'  : 3.0,
       'fullScan500': 3.0,
+      'fullScan2' : 3.0,
       'minBias'   : 3.0,
       'minBias2'  : 3.0,
       'beamgas'   : 3.0,
@@ -188,6 +188,7 @@ class InDetTrigSliceSettingsDB:
       'hadCalib'  : 0.4,
       'fullScan'  : 3.14159,
       'fullScan500' : 3.14159,
+      'fullScan2' : 3.14159,
       'minBias'   : 3.14159,
       'minBias2'  : 3.14159,
       'beamgas'   : 3.14159,
@@ -208,6 +209,7 @@ class InDetTrigSliceSettingsDB:
     for i in _slices:
       fullscan[i] = False
     fullscan['fullScan'] = True
+    fullscan['fullScan2']= True
     fullscan['fullScan500'] = True
     fullscan['minBias']  = True
     fullscan['minBias2'] = True
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
index 61dd4ca8296592cd454126c4bee6e2db728ba387..44889df305bf8521ac3a7fc85305e069f86051bd 100755
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
@@ -33,7 +33,6 @@
 
 // conditions stuff
 #include "InDetConditionsSummaryService/InDetHierarchy.h"
-#include "SCT_ConditionsServices/ISCT_ByteStreamErrorsSvc.h"
 #include "TMath.h"
 #include "TH1F.h"
 #include "TH2I.h"
diff --git a/InnerDetector/InDetRecTools/InDetAssociationTools/src/InDetPRD_AssociationToolGangedPixels.cxx b/InnerDetector/InDetRecTools/InDetAssociationTools/src/InDetPRD_AssociationToolGangedPixels.cxx
index fe53e17a390850414e7da21e6b667f3a988b7709..3c156c02c8991173023e5105f812e925548e5f2b 100755
--- a/InnerDetector/InDetRecTools/InDetAssociationTools/src/InDetPRD_AssociationToolGangedPixels.cxx
+++ b/InnerDetector/InDetRecTools/InDetAssociationTools/src/InDetPRD_AssociationToolGangedPixels.cxx
@@ -47,7 +47,7 @@ StatusCode InDet::InDetPRD_AssociationToolGangedPixels::addPRDs( const Trk::Trac
   TrackPrepRawDataMap::const_iterator itvec = m_trackPrepRawDataMap.find(&track);
   if (itvec!=m_trackPrepRawDataMap.end())
   {
-    msg(MSG::ERROR)<<"track already found in cache, should not happen"<<endreq;
+    ATH_MSG_ERROR("track already found in cache, should not happen");
     return StatusCode::FAILURE;
   }
   // get all prds on 'track'
@@ -63,14 +63,14 @@ StatusCode InDet::InDetPRD_AssociationToolGangedPixels::addPRDs( const Trk::Trac
      const PixelCluster* pixel = dynamic_cast<const PixelCluster*> (*it);
      if (pixel!=0) {
        if (pixel->gangedPixel()) {
-	 if (msgLvl(MSG::DEBUG)) msg() << "Found ganged pixel, search for mirror" << endreq;
-	 std::pair<PixelGangedClusterAmbiguities::const_iterator,
-	           PixelGangedClusterAmbiguities::const_iterator> ambi = m_gangedAmbis->equal_range(pixel);
-	 for (; ambi.first != ambi.second ; ++(ambi.first) ) {
-	   // add ambiguity as used by this track as well
-	   if (msgLvl(MSG::DEBUG)) msg() << "Found mirror pixel, add mirror to association map" << endreq;
-	   m_prepRawDataTrackMap.insert(std::make_pair(ambi.first->second, &track) );
-	 }
+         ATH_MSG_DEBUG("Found ganged pixel, search for mirror");
+         std::pair<PixelGangedClusterAmbiguities::const_iterator,
+           PixelGangedClusterAmbiguities::const_iterator> ambi = m_gangedAmbis->equal_range(pixel);
+         for (; ambi.first != ambi.second ; ++(ambi.first) ) {
+           // add ambiguity as used by this track as well
+           if (msgLvl(MSG::DEBUG)) msg() << "Found mirror pixel, add mirror to association map" << endreq;
+           m_prepRawDataTrackMap.insert(std::make_pair(ambi.first->second, &track) );
+         }
        }
      }
   }
@@ -78,8 +78,7 @@ StatusCode InDet::InDetPRD_AssociationToolGangedPixels::addPRDs( const Trk::Trac
   // cache this using m_trackPrepRawDataMap
   m_trackPrepRawDataMap.insert( std::make_pair(&track, prds) );
     
-  if (msgLvl(MSG::DEBUG)) msg()<<"Added PRDs from Track at ("<<&track<<") - map now has size: \t"
-			       <<m_prepRawDataTrackMap.size()<<endreq;
+  ATH_MSG_DEBUG("Added PRDs from Track at ("<<&track<<") - map now has size: \t" <<m_prepRawDataTrackMap.size());
   return StatusCode::SUCCESS;
 }
 
@@ -137,7 +136,7 @@ StatusCode InDet::InDetPRD_AssociationToolGangedPixels::removePRDs( const Trk::T
 	          PixelGangedClusterAmbiguities::const_iterator> ambi = m_gangedAmbis->equal_range(pixel);
 	for (; ambi.first != ambi.second ; ++(ambi.first) ) {
 	  // add ambiguity as used by this track as well
-	  if (msgLvl(MSG::DEBUG)) msg()<<MSG::DEBUG<<"Found ganged pixel, remove also mirror from association map"<<endreq;
+    ATH_MSG_DEBUG("Found ganged pixel, remove also mirror from association map");
 
 	  range = m_prepRawDataTrackMap.equal_range(ambi.first->second);
 	  // get iterators for range
@@ -159,9 +158,9 @@ StatusCode InDet::InDetPRD_AssociationToolGangedPixels::removePRDs( const Trk::T
   // remove cached PRD vector
   m_trackPrepRawDataMap.erase( itvec );
  
-  if (msgLvl(MSG::DEBUG)) msg()<<"Removed  PRDs from track ("
+  ATH_MSG_DEBUG("Removed  PRDs from track ("
 			       <<&track<<") \t- map has changed size from \t"
-			       <<oldSize <<" \tto "<<m_prepRawDataTrackMap.size()<<endreq;
+			       <<oldSize <<" \tto "<<m_prepRawDataTrackMap.size());
   return StatusCode::SUCCESS;
 }
 
@@ -200,8 +199,7 @@ Trk::IPRD_AssociationTool::TrackSet
   // don't forget to remove the input track
   connectedTracks.erase(&track);
 
-  if (msgLvl(MSG::VERBOSE)) msg()<<"Added in connected tracks for track "<<&track
-				 << "\tsize of list is "<<connectedTracks.size()<<endreq;
+  ATH_MSG_VERBOSE("Added in connected tracks for track "<<&track << "\tsize of list is "<<connectedTracks.size());
 
   return connectedTracks;
 }
@@ -215,12 +213,12 @@ std::vector< const Trk::PrepRawData* > InDet::InDetPRD_AssociationToolGangedPixe
   TrackPrepRawDataMap::const_iterator itvec = m_trackPrepRawDataMap.find(&track);
   if (itvec!=m_trackPrepRawDataMap.end())
   {
-    msg(MSG::VERBOSE)<<"found track in cache, return cached PRD vector for track"<<endreq;
+    ATH_MSG_VERBOSE("found track in cache, return cached PRD vector for track");
     return itvec->second;
   }
 
   if (track.measurementsOnTrack()==0) {
-    msg(MSG::WARNING)<<"Track has no RoTs"<<endreq;
+    ATH_MSG_WARNING("Track has no RoTs");
     return PRDs_t(); // return vector optimization
    }
 
@@ -246,8 +244,7 @@ std::vector< const Trk::PrepRawData* > InDet::InDetPRD_AssociationToolGangedPixe
       vec.push_back(rot->prepRawData());
   }
   
-  if (msgLvl(MSG::DEBUG)) msg()<<" Getting "<<vec.size()
-			       <<" PRDs from track at:"<<&track<<endreq;
+  ATH_MSG_DEBUG(" Getting "<<vec.size() <<" PRDs from track at:"<<&track);
   
   // new mode, we add the outleirs in the TRT
   if (m_addTRToutliers) {
@@ -271,8 +268,7 @@ std::vector< const Trk::PrepRawData* > InDet::InDetPRD_AssociationToolGangedPixe
 	}
       }
   
-    if (msgLvl(MSG::DEBUG)) msg()<<" Getting "<<vec.size()
-				 <<" PRDs including TRT outlier from track at:"<<&track<<endreq;
+    ATH_MSG_DEBUG(" Getting "<<vec.size() <<" PRDs including TRT outlier from track at:"<<&track);
   }
 
   return vec;
@@ -292,14 +288,14 @@ void InDet::InDetPRD_AssociationToolGangedPixels::reset()
       StatusCode sc = evtStore()->retrieve(m_gangedAmbis, m_pixelClusterAmbiguitiesMapName );
       
       if (sc.isFailure()) {
-	msg(MSG::ERROR) << "Could not retrieve "<< m_pixelClusterAmbiguitiesMapName << endreq;
+        ATH_MSG_ERROR("Could not retrieve "<< m_pixelClusterAmbiguitiesMapName);
       } else {
-	if (msgLvl(MSG::DEBUG)) msg() << "Retrieved " << m_pixelClusterAmbiguitiesMapName
+	ATH_MSG_DEBUG("Retrieved " << m_pixelClusterAmbiguitiesMapName
 				      << ", number of entries for this event:"
-				      << m_gangedAmbis->size() << endreq;
+				      << m_gangedAmbis->size());
       }
     } else {
-      if (msgLvl(MSG::DEBUG)) msg() << "Could not retrieve "<< m_pixelClusterAmbiguitiesMapName << " this is ok if pixel is off." << endreq;
+      ATH_MSG_DEBUG("Could not retrieve "<< m_pixelClusterAmbiguitiesMapName << " this is ok if pixel is off.");
     } 
   m_prepRawDataTrackMap.clear();
   m_trackPrepRawDataMap.clear();
diff --git a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiCombinatorialTrackFinder.h b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiCombinatorialTrackFinder.h
index a32c76056156db1e6f16eaaf1aad0ce21f251170..32db63cf7d183ebd5ab733cc450def0f8397ffc3 100755
--- a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiCombinatorialTrackFinder.h
+++ b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiCombinatorialTrackFinder.h
@@ -61,21 +61,21 @@ namespace InDet {
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 const TrackQualityCuts&)=0;
 
       virtual const std::list<Trk::Track*>& getTracks
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&)=0;
 
       virtual const std::list<Trk::Track*>& getTracksWithBrem
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&,
 	 bool)=0;
 
diff --git a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiDetElementsRoadMaker.h b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiDetElementsRoadMaker.h
index f683315f6d032bbda00957a8902e7939cb32783a..e7dc9a8a8adbac9688524973167cd9db2bd299e2 100755
--- a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiDetElementsRoadMaker.h
+++ b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiDetElementsRoadMaker.h
@@ -57,15 +57,15 @@ namespace InDet {
       
       virtual void detElementsRoad
 	(const std::list<const Trk::SpacePoint*>&,
-	std::list<const InDetDD::SiDetectorElement*>&)=0;
+	std::vector<const InDetDD::SiDetectorElement*>&)=0;
 
       virtual void detElementsRoad
 	(std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&)=0;
+	 std::vector<const InDetDD::SiDetectorElement*>&)=0;
     
       virtual void detElementsRoad
 	(const Trk::TrackParameters&,Trk::PropDirection, 
-	 std::list<const InDetDD::SiDetectorElement*>&)=0;
+	 std::vector<const InDetDD::SiDetectorElement*>&)=0;
       
       ///////////////////////////////////////////////////////////////////
       // Print internal tool parameters and status
diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h
index 6e36c0b4d1082086575b27d38f47e2353bdf9b63..a0cbe1f69d1a673e895e47447190ce69ffffe88e 100644
--- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h
@@ -19,12 +19,9 @@
 #include <map>
 
 class AtlasDetectorID;
-class SCT_ID;
 class Identifier;
 class AtlasID;
 class IInDetConditionsSvc;
-class ISCT_ConfigurationConditionsSvc;
-class ISCT_ByteStreamErrorsSvc;
 namespace InDet {class IInDetTestPixelLayerTool; }
 class IGeoModelSvc;
 
@@ -117,16 +114,10 @@ namespace InDet
       /** Handles to IConditionsSummaryServices for Pixels and SCT*/
       ServiceHandle <IInDetConditionsSvc> m_pixelCondSummarySvc, m_sctCondSummarySvc;
       ToolHandle< IInDetTestPixelLayerTool >  m_pixelLayerTool;
-      ServiceHandle <ISCT_ConfigurationConditionsSvc> m_sctConfCondSvc;
-
-      /** Handle to ISCT_ByteStreamErrorsSvc*/
-      ServiceHandle <ISCT_ByteStreamErrorsSvc> m_sctBsErrSvc;
 
       /** Handle for IGeoModelSvc to retrieve geo model information */
       ServiceHandle<IGeoModelSvc> m_geoModelSvc;
 
-      const SCT_ID* m_sct_id;
-
       /** Configure outwards hole search */
       bool m_extendedListOfHoles,m_cosmic;
 
diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx
index a3dca9c31e57f41d2221ab4ddbcb860d68638e0d..7eb1ac924288804c0fcf8e182af001984ac03e61 100644
--- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx
@@ -21,11 +21,8 @@
 #include "TrkDetDescrUtils/SharedObject.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "Identifier/Identifier.h"
-#include "InDetIdentifier/SCT_ID.h"
 #include "AtlasDetDescr/AtlasDetectorID.h"
 #include "InDetConditionsSummaryService/IInDetConditionsSvc.h"
-#include "SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h"
-#include "SCT_ConditionsServices/ISCT_ByteStreamErrorsSvc.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "InDetRecToolInterfaces/IInDetTestPixelLayerTool.h"
 #include "TrkVolumes/Volume.h"
@@ -42,10 +39,7 @@ InDet::InDetTrackHoleSearchTool::InDetTrackHoleSearchTool(const std::string& t,
   m_pixelCondSummarySvc("PixelConditionsSummarySvc",n),
   m_sctCondSummarySvc  ("SCT_ConditionsSummarySvc",n),
   m_pixelLayerTool("InDet::InDetTestPixelLayerTool"),
-  m_sctConfCondSvc("SCT_ConfigurationConditionsSvc", n),
-  m_sctBsErrSvc("SCT_ByteStreamErrorsSvc", n),
   m_geoModelSvc("GeoModelSvc", n),
-  m_sct_id(nullptr),
   m_extendedListOfHoles(false),
   m_cosmic(false),
   m_usepix(true),
@@ -57,8 +51,6 @@ InDet::InDetTrackHoleSearchTool::InDetTrackHoleSearchTool(const std::string& t,
   declareProperty("Extrapolator"         , m_extrapolator);
   declareProperty("PixelSummarySvc"      , m_pixelCondSummarySvc);
   declareProperty("SctSummarySvc"        , m_sctCondSummarySvc);
-  declareProperty("SctConfCondSvc"       , m_sctConfCondSvc);
-  declareProperty("SctBsErrSvc"          , m_sctBsErrSvc);
   declareProperty("PixelLayerTool"       , m_pixelLayerTool);
   declareProperty("GeoModelService"      , m_geoModelSvc);
   declareProperty("ExtendedListOfHoles"  , m_extendedListOfHoles = false);
@@ -125,26 +117,6 @@ StatusCode InDet::InDetTrackHoleSearchTool::initialize()
     }
 
     if(m_checkBadSCTChip) {
-      // Get SctConditionsSummarySvc
-      if ( m_sctConfCondSvc.retrieve().isFailure() ) {
-	ATH_MSG_FATAL("Failed to retrieve service " << m_sctConfCondSvc);
-	return StatusCode::FAILURE;
-      } else {
-	ATH_MSG_INFO("Retrieved service " << m_sctConfCondSvc);
-      }
-      // Get SCT_ByteStreamErrorsSvc
-      if ( m_sctBsErrSvc.retrieve().isFailure() ) {
-	ATH_MSG_FATAL("Failed to retrieve service " << m_sctBsErrSvc);
-	return StatusCode::FAILURE;
-      } else {
-	ATH_MSG_INFO("Retrieved service " << m_sctBsErrSvc);
-      }
-      // Get SCT_ID helper
-      if( detStore()->retrieve(m_sct_id, "SCT_ID").isFailure() ) {
-	ATH_MSG_FATAL("Cannot retrieve SCT ID helper!");
-	return StatusCode::FAILURE;
-      }
-
       // Check if ITk Strip is used because isBadSCTChip method is valid only for SCT.
       if(m_geoModelSvc.retrieve().isFailure()) {
 	ATH_MSG_FATAL("Could not locate GeoModelSvc");
@@ -1071,35 +1043,6 @@ bool InDet::InDetTrackHoleSearchTool::isBadSCTChip(const Identifier& waferId,
     return true;
   }
 
-  // wafer id -> module id
-  const Identifier moduleId(m_sct_id->module_id(waferId));
-  // badChips word for the module from SCT_ConfigurationConditionsSvc
-  // tempMaskedChips word for the module from SCT_ByteStreamErrorSvc should also be added.
-  // https://its.cern.ch/jira/browse/ATLASRECTS-4011
-  unsigned int badChips(m_sctConfCondSvc->badChips(moduleId));
-  // badChips holds 12 bits. 
-  // bit 0 (LSB) is chip 0 for side 0.
-  // bit 5 is chip 5 for side 0.
-  // bit 6 is chip 6 for side 1.
-  // bit 11 is chip 11 for side 1.
-  // Temporarily masked chip information from SCT_ByteStreamErrorsSvc
-  const unsigned int tempMaskedChips(m_sctBsErrSvc->tempMaskedChips(moduleId));
-  // Information of chips with ABCD errors from SCT_ByteStreamErrorsSvc
-  const unsigned int abcdErrorChips(m_sctBsErrSvc->abcdErrorChips(moduleId));
-  // Take 'OR' of badChips, tempMaskedChips and abcdErrorChips
-  badChips |= tempMaskedChips;
-  badChips |= abcdErrorChips;
-
-  // If there is no bad chip, this check is done.
-  if(badChips==0) return false;
-
-  const int side(m_sct_id->side(waferId));
-  // Check the six chips on the side
-  // 0x3F  = 0000 0011 1111
-  // 0xFC0 = 1111 1100 0000
-  // If there is no bad chip on the side, this check is done.
-  if((side==0 and (badChips & 0x3F)==0) or (side==1 and (badChips & 0xFC0)==0)) return false;
-  
   // There is at least one bad chip on the side.
   // Get strip id from local position
   const Amg::Vector2D localPos(parameters.localPosition());
@@ -1109,33 +1052,5 @@ bool InDet::InDetTrackHoleSearchTool::isBadSCTChip(const Identifier& waferId,
     return true;
   }
   
-  // Get strip number from strip id
-  const int strip(m_sct_id->strip(stripIdentifier));
-  if(strip<0 or strip>=768) {
-    ATH_MSG_WARNING("strip number is invalid: " << strip);
-    return true;
-  }
-
-  // Conversion from strip to chip (specific for present SCT)
-  int chip(strip/128); // One ABCD chip reads 128 strips
-  // Relation between chip and offline strip is determined by the swapPhiReadoutDirection method.
-  // If swap is false
-  //  offline strip:   0            767
-  //  chip on side 0:  0  1  2  3  4  5
-  //  chip on side 1: 11 10  9  8  7  6
-  // If swap is true
-  //  offline strip:   0            767
-  //  chip on side 0:  5  4  3  2  1  0
-  //  chip on side 1:  6  7  8  9 10 11
-  const bool swap(siElement.swapPhiReadoutDirection());
-  if(side==0) {
-    chip = swap ?  5 - chip :     chip;
-  } else {
-    chip = swap ? 11 - chip : 6 + chip;
-  }
-  
-  // Check if the chip is bad
-  const bool badChip(badChips & (1<<chip));
-
-  return badChip;
+  return (not m_sctCondSummarySvc->isGood(stripIdentifier, InDetConditions::SCT_CHIP));
 }
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
index f34c8635c040575d5c21ff336094e6824b166072..07156a6662e92152ca334abfcdd6bc810d86c841 100755
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
@@ -664,8 +664,7 @@ PixelCluster* MergedPixelsTool::makeCluster
     double splitProb1,
     double splitProb2) const
 {
-    if ( outputLevel() < MSG::INFO ) 
-        ATH_MSG_VERBOSE("makeCluster called, number " << clusterNumber);
+    ATH_MSG_VERBOSE("makeCluster called, number " << clusterNumber);
 
     Identifier gangedID;
     Identifier elementID = element->identify();
@@ -715,10 +714,10 @@ PixelCluster* MergedPixelsTool::makeCluster
 
         // check overflow for IBL
         int realtot = *tot;
-	if( m_IBLParameterSvc->containsIBL() && pixelID.barrel_ec(rId) == 0 && pixelID.layer_disk(rId) == 0 ) {
-	  if (*tot >= m_overflowIBLToT ) realtot = m_overflowIBLToT;
-          msg(MSG::DEBUG) << "barrel_ec = " << pixelID.barrel_ec(rId) << " layer_disque = " <<  pixelID.layer_disk(rId) << " ToT = " << *tot << " Real ToT = " << realtot << endreq;
-	}
+        if( m_IBLParameterSvc->containsIBL() && pixelID.barrel_ec(rId) == 0 && pixelID.layer_disk(rId) == 0 ) {
+          if (*tot >= m_overflowIBLToT ) realtot = m_overflowIBLToT;
+          ATH_MSG_DEBUG("barrel_ec = " << pixelID.barrel_ec(rId) << " layer_disque = " <<  pixelID.layer_disk(rId) << " ToT = " << *tot << " Real ToT = " << realtot);
+        }
 	   
         if (row == rowMin) qRowMin += realtot;
         if (row < rowMin){ 
@@ -832,16 +831,14 @@ PixelCluster* MergedPixelsTool::makeCluster
 
     Amg::Vector2D position(centroid.xPhi(),centroid.xEta());
 
-    if (msgLvl(MSG::VERBOSE)){
-        msg() << "Cluster ID =" << id << endreq; 
-        msg() << "Cluster width (eta x phi) = " << colWidth 
-            << " x " << rowWidth << endreq;
-        msg() << "Cluster width (eta x phi) = " << etaWidth 
-            << " x " << phiWidth << endreq;
-        msg() << "Cluster local position (eta,phi) = " 
-            << (position)[0] << " " 
-            << (position)[1] << endreq;
-    }
+    ATH_MSG_VERBOSE("Cluster ID =" << id); 
+    ATH_MSG_VERBOSE("Cluster width (eta x phi) = " << colWidth 
+        << " x " << rowWidth);
+    ATH_MSG_VERBOSE("Cluster width (eta x phi) = " << etaWidth 
+        << " x " << phiWidth);
+    ATH_MSG_VERBOSE("Cluster local position (eta,phi) = " 
+        << (position)[0] << " " 
+        << (position)[1]);
 
     if(!m_clusterMaker){
       PixelCluster* cluster = new PixelCluster(id,position,DVid,lvl1min,totgroup,siWidth,element,0);
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinder_xk.h b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinder_xk.h
index 7e4a56c9b995916dba68fdbf00046f81a83032f4..9bf8c31229d25c0f2f5083bc22bf377759e99cf5 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinder_xk.h
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinder_xk.h
@@ -73,21 +73,21 @@ namespace InDet{
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 const TrackQualityCuts&);
 
       virtual const std::list<Trk::Track*>& getTracks
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&);
 
       virtual const std::list<Trk::Track*>& getTracksWithBrem
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&,
 	 bool);
    
@@ -170,7 +170,7 @@ namespace InDet{
 	(const Trk::TrackParameters&, 
 	 const std::list<const Trk::SpacePoint*>&,
 	 const std::list<Amg::Vector3D>&,
-	 std::list<const InDetDD::SiDetectorElement*>&,
+	 std::vector<const InDetDD::SiDetectorElement*>&,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&);
 
       void getTrackQualityCuts(const TrackQualityCuts&);
@@ -187,8 +187,8 @@ namespace InDet{
 	 std::list<const InDet::SiCluster*>     &); 
 
       void detectorElementLinks
-	(std::list<const InDetDD::SiDetectorElement*>        &,
-	 std::list<const InDet::SiDetElementBoundaryLink_xk*>&);
+	(std::vector<const InDetDD::SiDetectorElement*>        &,
+	 std::vector<const InDet::SiDetElementBoundaryLink_xk*>&);
 
       MsgStream&    dumpconditions(MsgStream&    out) const;
       MsgStream&    dumpevent     (MsgStream&    out) const;
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectoryElement_xk.h b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectoryElement_xk.h
index 96a33df58be67415d55800902480623ce2f00dd2..b33be14068195f2bba718fcc23f01f29a1d00c9e 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectoryElement_xk.h
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectoryElement_xk.h
@@ -125,7 +125,7 @@ namespace InDet{
       // Main methods
       ///////////////////////////////////////////////////////////////////
 
-      bool set(int,
+      void set(int,
 	       const InDet::SiDetElementBoundaryLink_xk*&       ,
 	       const InDet::SiClusterCollection::const_iterator&, 
 	       const InDet::SiClusterCollection::const_iterator&,
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectory_xk.h b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectory_xk.h
index b1d7da692d5178b6e6a502af7782a79d658d91e1..ea549ff67eb5bb932233cbcb569699964955a9be 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectory_xk.h
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/SiCombinatorialTrackFinderTool_xk/SiTrajectory_xk.h
@@ -66,14 +66,14 @@ namespace InDet{
 	 const InDet::SiClusterContainer*                    ,
 	 const Trk::TrackParameters                          &,
 	 std::list<const InDet::SiCluster*>                  &,
-	 std::list<const InDet::SiDetElementBoundaryLink_xk*>&,
+	 std::vector<const InDet::SiDetElementBoundaryLink_xk*>&,
 	 bool                                                &);
 
       bool trackParametersToClusters
 	(const InDet::SiClusterContainer*                        ,
 	 const InDet::SiClusterContainer*                        ,
 	 const Trk::TrackParameters                              &,
-	 std::list<const InDet::SiDetElementBoundaryLink_xk*>    &,
+	 std::vector<const InDet::SiDetElementBoundaryLink_xk*>    &,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&,
 	 std::list<const InDet::SiCluster*>                      &);
       
@@ -81,7 +81,7 @@ namespace InDet{
  	(const InDet::SiClusterContainer*                        ,
 	 const InDet::SiClusterContainer*                        ,
 	 const std::list<Amg::Vector3D>                          &,
-	 std::list<const InDet::SiDetElementBoundaryLink_xk*>    &,
+	 std::vector<const InDet::SiDetElementBoundaryLink_xk*>    &,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>&,
 	 std::list<const InDet::SiCluster*>                      &); 
 
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
index 6b121b6d623e3b1db24e6512ce526c9d18ab10d3..a617b33520b71e3d071a57fdfd1a3d51439f0212 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
@@ -446,7 +446,7 @@ void InDet::SiCombinatorialTrackFinder_xk::endEvent()
 const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracks
 (const Trk::TrackParameters& Tp,
  const std::list<const Trk::SpacePoint*>& Sp,const std::list<Amg::Vector3D>& Gp,
- std::list<const InDetDD::SiDetectorElement*>& DE,const TrackQualityCuts& Cuts)
+ std::vector<const InDetDD::SiDetectorElement*>& DE,const TrackQualityCuts& Cuts)
 {
   m_tools.setBremNoise(false,false);
   m_tracks.erase(m_tracks.begin(),m_tracks.end());
@@ -488,7 +488,7 @@ const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracks
 const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracks
 (const Trk::TrackParameters& Tp,
  const std::list<const Trk::SpacePoint*>& Sp,const std::list<Amg::Vector3D>& Gp,
- std::list<const InDetDD::SiDetectorElement*>& DE,
+ std::vector<const InDetDD::SiDetectorElement*>& DE,
  std::multimap<const Trk::PrepRawData*,const Trk::Track*>& PT)
 {
   m_tools.setBremNoise(false,false);
@@ -530,7 +530,7 @@ const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracks
 const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracksWithBrem
 (const Trk::TrackParameters& Tp,
  const std::list<const Trk::SpacePoint*>& Sp,const std::list<Amg::Vector3D>& Gp,
- std::list<const InDetDD::SiDetectorElement*>& DE,
+ std::vector<const InDetDD::SiDetectorElement*>& DE,
  std::multimap<const Trk::PrepRawData*,const Trk::Track*>& PT,
  bool isCaloCompatible)
 {
@@ -604,12 +604,12 @@ const std::list<Trk::Track*>&  InDet::SiCombinatorialTrackFinder_xk::getTracksWi
 bool InDet::SiCombinatorialTrackFinder_xk::findTrack
 (const Trk::TrackParameters& Tp,
  const std::list<const Trk::SpacePoint*>& Sp,const std::list<Amg::Vector3D>& Gp,
- std::list<const InDetDD::SiDetectorElement*>& DE,
+ std::vector<const InDetDD::SiDetectorElement*>& DE,
  std::multimap<const Trk::PrepRawData*,const Trk::Track*>& PT)
 {
   // List detector element links preparation
   //
-  std::list<const InDet::SiDetElementBoundaryLink_xk*> DEL; 
+  std::vector<const InDet::SiDetElementBoundaryLink_xk*> DEL; 
   detectorElementLinks(DE,DEL);
 
   // List cluster preparation
@@ -915,10 +915,10 @@ bool InDet::SiCombinatorialTrackFinder_xk::spacePointsToClusters
 ///////////////////////////////////////////////////////////////////
 
 void InDet::SiCombinatorialTrackFinder_xk::detectorElementLinks
-(std::list<const InDetDD::SiDetectorElement*>        & DE,
- std::list<const InDet::SiDetElementBoundaryLink_xk*>& DEL)
+(std::vector<const InDetDD::SiDetectorElement*>        & DE,
+ std::vector<const InDet::SiDetElementBoundaryLink_xk*>& DEL)
 {
-  std::list<const InDetDD::SiDetectorElement*>::iterator d = DE.begin(),de = DE.end();
+  std::vector<const InDetDD::SiDetectorElement*>::iterator d = DE.begin(),de = DE.end();
  
   for(; d!=de; ++d) {
  
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectoryElement_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectoryElement_xk.cxx
index 52ac6c9dc2b48c529a7e0df9574d73c9ea561959..7c004747ed9740010d647141fec364b1b336da40 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectoryElement_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectoryElement_xk.cxx
@@ -20,7 +20,7 @@
 // Set trajectory element
 ///////////////////////////////////////////////////////////////////
 
-bool InDet::SiTrajectoryElement_xk::set
+void InDet::SiTrajectoryElement_xk::set
 (int                                               st,
  const InDet::SiDetElementBoundaryLink_xk*&        dl,
  const InDet::SiClusterCollection::const_iterator& sb, 
@@ -46,7 +46,7 @@ bool InDet::SiTrajectoryElement_xk::set
   m_ntsos        = 0                       ;
   m_detelement   = dl->detElement()        ;
   m_detlink      = dl                      ;
-  m_surface      = &m_detelement->surface(); if(!m_surface) return false;
+  m_surface      = &m_detelement->surface();
   m_sibegin      = sb                      ;
   m_siend        = se                      ; 
   m_cluster      = si                      ;
@@ -87,7 +87,7 @@ bool InDet::SiTrajectoryElement_xk::set
   m_Tr[ 9] = T(0,3); m_Tr[10]=T(1,3); m_Tr[11]=T(2,3);
   m_Tr[12] = m_Tr[ 9]*m_Tr[ 6]+m_Tr[10]*m_Tr[ 7]+m_Tr[11]*m_Tr[ 8];
   m_A[0] = 1.; m_A[1] = 0.; m_A[2] = 0.;
-  return true;
+  return;
 }
 
 ///////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectory_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectory_xk.cxx
index 8d25961a5d43aef42949dfcd0c70dd364a5ee24f..407c7125e24b144069c651094d88762c415d2cba 100755
--- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectory_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiTrajectory_xk.cxx
@@ -486,7 +486,7 @@ bool InDet::SiTrajectory_xk::initialize
  const InDet::SiClusterContainer*                     SCTc      ,
  const Trk::TrackParameters                          & Tp        ,
  std::list<const InDet::SiCluster*>                  & lSiCluster, 
- std::list<const InDet::SiDetElementBoundaryLink_xk*>& DE        ,
+ std::vector<const InDet::SiDetElementBoundaryLink_xk*>& DE        ,
  bool                                                & rquality   )
 {
   m_nholes          =    0;
@@ -508,7 +508,7 @@ bool InDet::SiTrajectory_xk::initialize
   std::list<const InDet::SiCluster*>::iterator c;
   if(lSiCluster.size() < 2) return false;
 
-  std::list<const InDet::SiDetElementBoundaryLink_xk*>::iterator r,re=DE.end();
+  std::vector<const InDet::SiDetElementBoundaryLink_xk*>::iterator r,re=DE.end();
   InDet::SiClusterCollection::const_iterator  sib,sie;
 
   int up    = 0;
@@ -537,11 +537,11 @@ bool InDet::SiTrajectory_xk::initialize
 	      ++m_nclusters; m_ndfcut+=2; sic=(*c); lSiCluster.erase(c); break;
 	    }
 	  }
-	  if(!m_elements[m_nElements].set(1,(*r),sib,sie,sic)) return false; 
+	  m_elements[m_nElements].set(1,(*r),sib,sie,sic);
 	  ++m_naElements;
 	}
 	else if(m_naElements) {
-	  if(!m_elements[m_nElements].set(0,(*r),sib,sie,sic)) return false;
+	  m_elements[m_nElements].set(0,(*r),sib,sie,sic);
 	}
 	else continue;
 
@@ -563,11 +563,11 @@ bool InDet::SiTrajectory_xk::initialize
 	    ++m_nclusters; m_ndfcut+=1; sic=(*c); lSiCluster.erase(c); break;
 	  }
 	}
-	if(!m_elements[m_nElements].set(1,(*r),sib,sie,sic)) return false; 
+	m_elements[m_nElements].set(1,(*r),sib,sie,sic);
 	++m_naElements;
       }
       else if(m_naElements) {
-	if(!m_elements[m_nElements].set(0,(*r),sib,sie,sic)) return false;
+        m_elements[m_nElements].set(0,(*r),sib,sie,sic);
       }
       else continue;
 
@@ -656,7 +656,7 @@ bool InDet::SiTrajectory_xk::trackParametersToClusters
 (const InDet::SiClusterContainer*                         PIXc      ,
  const InDet::SiClusterContainer*                         SCTc      ,
  const Trk::TrackParameters                              & Tp        ,
- std::list<const InDet::SiDetElementBoundaryLink_xk*>    & DE        ,
+ std::vector<const InDet::SiDetElementBoundaryLink_xk*>  & DE        ,
  std::multimap<const Trk::PrepRawData*,const Trk::Track*>& PT        ,
  std::list<const InDet::SiCluster*>                      & lSiCluster) 
 {
@@ -666,7 +666,7 @@ bool InDet::SiTrajectory_xk::trackParametersToClusters
   std::multimap<double,const InDet::SiCluster*> xi2cluster;
 
   InDet::SiClusterCollection::const_iterator  sib,sie;
-  std::list<const InDet::SiDetElementBoundaryLink_xk*>::iterator r,re=DE.end();
+  std::vector<const InDet::SiDetElementBoundaryLink_xk*>::iterator r,re=DE.end();
   std::multimap<const Trk::PrepRawData*,const Trk::Track*>::const_iterator t, te =PT.end();
 
   double xi2Cut = .5;
@@ -740,11 +740,11 @@ bool InDet::SiTrajectory_xk::globalPositionsToClusters
  	(const InDet::SiClusterContainer*                         PIXc      ,
 	 const InDet::SiClusterContainer*                         SCTc      ,  
 	 const std::list<Amg::Vector3D>                          & Gp        ,
-	 std::list<const InDet::SiDetElementBoundaryLink_xk*>    & DE        ,
+	 std::vector<const InDet::SiDetElementBoundaryLink_xk*>    & DE        ,
 	 std::multimap<const Trk::PrepRawData*,const Trk::Track*>& PT        ,
 	 std::list<const InDet::SiCluster*>                      & lSiCluster)
 {
-  std::list<const InDet::SiDetElementBoundaryLink_xk*>::iterator r = DE.begin(), re = DE.end();
+  std::vector<const InDet::SiDetElementBoundaryLink_xk*>::iterator r = DE.begin(), re = DE.end();
   std::list<Amg::Vector3D>::const_iterator                    g,gb = Gp.begin(), ge = Gp.end();
   InDet::SiClusterCollection::const_iterator                  sib,sie;
   std::multimap<const Trk::PrepRawData*,const Trk::Track*>::const_iterator t, te =PT.end();
diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsLayer_xk.h b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsLayer_xk.h
index fc2a5ac8915ff6af2930d8280f7ce56a51f71ad5..354d538b1f212cd5ac5f19e37cb68034f48eb609 100755
--- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsLayer_xk.h
+++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsLayer_xk.h
@@ -56,9 +56,9 @@ namespace InDet{
       void  add(const SiDetElementLink_xk&);
       int   nElements() const;
       void getBarrelDetElements
-	(float*,float*,std::list<InDet::SiDetElementLink_xk*>&);
+	(float*,float*,std::vector<InDet::SiDetElementLink_xk*>&);
       void getEndcapDetElements
-	(float*,float*,std::list<InDet::SiDetElementLink_xk*>&);
+	(float*,float*,std::vector<InDet::SiDetElementLink_xk*>&);
       void sortDetectorElements();
 
     protected:
@@ -78,7 +78,7 @@ namespace InDet{
       // Methods
       ///////////////////////////////////////////////////////////////////
       void getDetElements(float*,float*,float,float,
-			  std::list<InDet::SiDetElementLink_xk*>&);
+          std::vector<InDet::SiDetElementLink_xk*>&);
       
     };
   
diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsRoadMaker_xk.h b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsRoadMaker_xk.h
index 6aad00694cf355482f9ee2b0a71276b3a07c71bb..e96dced821fa8a36416213a53a24f110779d9f19 100755
--- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsRoadMaker_xk.h
+++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/SiDetElementsRoadTool_xk/SiDetElementsRoadMaker_xk.h
@@ -74,15 +74,15 @@ namespace InDet{
       
       virtual void detElementsRoad
 	(const std::list<const Trk::SpacePoint*>&,
-	 std::list<const InDetDD::SiDetectorElement*>&);
+	 std::vector<const InDetDD::SiDetectorElement*>&);
   
       virtual void detElementsRoad
 	(std::list<Amg::Vector3D>&, 
-	 std::list<const InDetDD::SiDetectorElement*>&);
+	 std::vector<const InDetDD::SiDetectorElement*>&);
 
       virtual void detElementsRoad
 	(const Trk::TrackParameters&,Trk::PropDirection,
-	 std::list<const InDetDD::SiDetectorElement*>&);
+	 std::vector<const InDetDD::SiDetectorElement*>&);
 
       ///////////////////////////////////////////////////////////////////
       // Print internal tool parameters and status
diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsLayer_xk.cxx b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsLayer_xk.cxx
index 6bd33feb3f9ba4e79384c2b0cd45c45d921339d1..774f411ae9c5e016ebf142b6b2be66e04188aae9 100755
--- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsLayer_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsLayer_xk.cxx
@@ -26,7 +26,7 @@
 ///////////////////////////////////////////////////////////////////
 
 void InDet::SiDetElementsLayer_xk::getBarrelDetElements
-(float* P ,float* A,std::list<InDet::SiDetElementLink_xk*>& lDE)
+(float* P ,float* A,std::vector<InDet::SiDetElementLink_xk*>& lDE)
 {
   float a  = (A[0]*P[0]+A[1]*P[1])*2.; 
   float d  = (m_r-P[0]-P[1])*(m_r+P[0]+P[1])+2.*P[0]*P[1];
@@ -56,7 +56,7 @@ void InDet::SiDetElementsLayer_xk::getBarrelDetElements
 ///////////////////////////////////////////////////////////////////
 
 void InDet::SiDetElementsLayer_xk::getEndcapDetElements
-(float* P ,float* A,std::list<InDet::SiDetElementLink_xk*>& lDE)
+(float* P ,float* A,std::vector<InDet::SiDetElementLink_xk*>& lDE)
 {
   float s   =(m_z-P[2])/A[2];
   float xc  = P[0]+A[0]*s;
@@ -80,7 +80,7 @@ void InDet::SiDetElementsLayer_xk::getEndcapDetElements
 ///////////////////////////////////////////////////////////////////
 
 void InDet::SiDetElementsLayer_xk::getDetElements
-(float* P,float* A,float Fc,float dW,std::list<InDet::SiDetElementLink_xk*>& lDE)
+(float* P,float* A,float Fc,float dW,std::vector<InDet::SiDetElementLink_xk*>& lDE)
 {
   const float pi = M_PI, pi2 = 2.*pi; 
   int im  = int(m_elements.size())-1; if(im<0) return;
diff --git a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx
index 3678b7a3cc165c0ada6fd4bb6edd486b9fce22ed..6c3f3cfd4e39e427939fdccab9cfa576bfba7026 100755
--- a/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiDetElementsRoadTool_xk/src/SiDetElementsRoadMaker_xk.cxx
@@ -374,7 +374,7 @@ std::ostream& InDet::operator <<
 
 void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
 (const std::list<const Trk::SpacePoint*>& Sp,
- std::list<const InDetDD::SiDetectorElement*>& Road)
+ std::vector<const InDetDD::SiDetectorElement*>& Road)
 {
   if ((!m_usePIX && !m_useSCT)) return;
   
@@ -390,7 +390,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
 
 void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
 (std::list<Amg::Vector3D>& GP,
- std::list<const InDetDD::SiDetectorElement*>& Road) 
+ std::vector<const InDetDD::SiDetectorElement*>& Road) 
 {  
   if (!m_usePIX && !m_useSCT) return;
 
@@ -407,7 +407,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
   for(; n1!=m_map[1]; ++n1) {if(Po[3] < m_layer[1][n1].r()) break;}
   for(; n2!=m_map[2]; ++n2) {if(Po[2] < m_layer[2][n2].z()) break;}
 
-  std::list<InDet::SiDetElementLink_xk*> lDE;
+  std::vector<InDet::SiDetElementLink_xk*> lDE;
 
   ++g; while(g!=ge) {
 
@@ -498,7 +498,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
 
   // Sort list in propogation order
   //
-  std::list<InDet::SiDetElementLink_xk*>::iterator l=lDE.begin(),le=lDE.end(),n,m;
+  std::vector<InDet::SiDetElementLink_xk*>::iterator l=lDE.begin(),le=lDE.end(),n,m;
   if(l==le) return;
 
   bool nc =true;
@@ -531,7 +531,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
 
 void InDet::SiDetElementsRoadMaker_xk::detElementsRoad 
 (const Trk::TrackParameters& Tp,Trk::PropDirection D,
- std::list<const InDetDD::SiDetectorElement*>& R)
+ std::vector<const InDetDD::SiDetectorElement*>& R)
 {
   if (!m_usePIX && !m_useSCT) return;
   
diff --git a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/SiTrackMakerTool_xk/SiTrackMaker_xk.h b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/SiTrackMakerTool_xk/SiTrackMaker_xk.h
index 96e141cacccd1d6210e3d5ed480f67b94ad25ab2..875e3a5e7938c1038e3059285ed6d3790e73cde4 100755
--- a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/SiTrackMakerTool_xk/SiTrackMaker_xk.h
+++ b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/SiTrackMakerTool_xk/SiTrackMaker_xk.h
@@ -176,7 +176,7 @@ namespace InDet{
       bool globalPosition(const Trk::SpacePoint*,double*,double*);
       void globalDirections(double*,double*,double*,double*,double*,double*);
       void setTrackQualityCuts();
-      void detectorElementsSelection(std::list<const InDetDD::SiDetectorElement*>&);
+      void detectorElementsSelection(std::vector<const InDetDD::SiDetectorElement*>&);
       bool newSeed    (const std::list<const Trk::SpacePoint*>&);
       bool isNewTrack(Trk::Track*);
       bool isCaloCompatible   ();
diff --git a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
index 03aae96673685944b4f172789ab04fa150205d04..d157b7ea881fa773c84bd23a06e9f95cfd138878 100755
--- a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
@@ -515,7 +515,7 @@ const std::list<Trk::Track*>& InDet::SiTrackMaker_xk::getTracks
 
   // Get detector elements road
   //
-  std::list<const InDetDD::SiDetectorElement*> DE;
+  std::vector<const InDetDD::SiDetectorElement*> DE;
   if(!m_cosmicTrack) m_roadmaker->detElementsRoad(*Tp,Trk::alongMomentum,   DE);
   else               m_roadmaker->detElementsRoad(*Tp,Trk::oppositeMomentum,DE);
 
@@ -574,7 +574,7 @@ const std::list<Trk::Track*>& InDet::SiTrackMaker_xk::getTracks
 
   // Get detector elements road
   //
-  std::list<const InDetDD::SiDetectorElement*> DE;
+  std::vector<const InDetDD::SiDetectorElement*> DE;
   if(!m_cosmicTrack) m_roadmaker->detElementsRoad(Tp,Trk::alongMomentum,   DE);
   else               m_roadmaker->detElementsRoad(Tp,Trk::oppositeMomentum,DE);
 
@@ -820,9 +820,9 @@ void  InDet::SiTrackMaker_xk::setTrackQualityCuts()
 // Detector elements selection
 ///////////////////////////////////////////////////////////////////
 
-void InDet::SiTrackMaker_xk::detectorElementsSelection(std::list<const InDetDD::SiDetectorElement*>& DE)
+void InDet::SiTrackMaker_xk::detectorElementsSelection(std::vector<const InDetDD::SiDetectorElement*>& DE)
 {
-  std::list<const InDetDD::SiDetectorElement*>::iterator d = DE.begin();
+  std::vector<const InDetDD::SiDetectorElement*>::iterator d = DE.begin();
   if(!m_dbm) {
 
     while(d!=DE.end()) {
diff --git a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
index 33edda88ed4754761d766c8d1014a37f8d597ff7..9c14ba095724ca4a1d347b949bb3790cf9210a83 100755
--- a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
+++ b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
@@ -958,7 +958,7 @@ StatusCode TRT_DriftFunctionTool::update( IOVSVC_CALLBACK_ARGS_P(I,keys) ) {
               citr!=atrlistcol->end();++citr) {
 
 	    //get Barrel (1) or Endcap (2)
-	   channel = abs(citr->first);
+	   channel = citr->first;
 
 	   if ((channel == 1) || (channel == 2)) {
              const coral::AttributeList& atrlist = citr->second;
@@ -990,7 +990,7 @@ StatusCode TRT_DriftFunctionTool::update( IOVSVC_CALLBACK_ARGS_P(I,keys) ) {
 	 for (CondAttrListCollection::const_iterator citr=atrlistcol->begin();
               citr!=atrlistcol->end();++citr) {
 	      
-	   channel = abs(citr->first);
+	   channel = citr->first;
 
 	   if (channel == 1) {
              const coral::AttributeList& atrlist = citr->second;
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
index 56276cb119f79980724d20bc0b1879e63981f9c5..a3e34bccddebb1bd62897ff318d5dcadbc1192fb 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
@@ -2,528 +2,528 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// TRT_ElectronPidToolRun2.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-
-#include "TRT_ElectronPidTools/BaseTRTPIDCalculator.h"
-#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h"
-#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h"
-
-// StoreGate, Athena, and Database stuff:
-#include "Identifier/Identifier.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "CoralBase/AttributeListSpecification.h"
-#include "CoralBase/Blob.h"
-#include "AthenaPoolUtilities/CondAttrListVec.h"
-// Tracking:
-#include "TrkTrack/Track.h"
-#include "TrkTrack/TrackStateOnSurface.h"
-#include "TrkMeasurementBase/MeasurementBase.h"
-#include "TrkRIO_OnTrack/RIO_OnTrack.h"
-#include "TrkParameters/TrackParameters.h"
-#include "TrkSurfaces/Surface.h"
-#include "TrkTrack/TrackInfo.h"
-
-// Drift circles and TRT identifiers:
-#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
-#include "InDetIdentifier/TRT_ID.h"
-
-// ToT Tool Interface
-#include "TRT_ToT_Tools/ITRT_ToT_dEdx.h"
-
-// Particle masses
-
-// Math functions:
-#include <cmath>
-
-//STL includes
-#include <sstream>
-
-//#define TRTDBG ATH_MSG_INFO("To line "<<__LINE__);
-//#define TRTDBG 0;
-
-#include "TRT_ElectronPidToolRun2_HTcalculation.cxx"
-
-
-/*****************************************************************************\
-|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%  PID Tool Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::TRT_ElectronPidToolRun2(const std::string& t, const std::string& n, const IInterface* p )
-  :
-  AthAlgTool(t,n,p),
-  m_trtId(0),
-  m_minTRThits(5),
-  HTcalc(*(new HTcalculator(*this))),
-  m_TRTdEdxTool("TRT_ToT_dEdx"),
-  m_LocalOccTool(),
-  m_TRTStrawSummarySvc("InDetTRTStrawStatusSummarySvc",n)
-{
-  declareInterface<ITRT_ElectronPidTool>(this);
-  declareInterface<ITRT_ElectronToTTool>(this);
-  //  template for property decalration
-  //declareProperty("PropertyName", m_propertyName);
-  declareProperty("MinimumTRThitsForIDpid", m_minTRThits);
-  declareProperty("TRT_ToT_dEdx_Tool", m_TRTdEdxTool);
-  declareProperty("TRT_LocalOccupancyTool", m_LocalOccTool);
-  declareProperty("isData", m_DATA = true);
-  declareProperty("TRTStrawSummarySvc",    m_TRTStrawSummarySvc);
-  declareProperty("OccupancyUsedInPID", m_OccupancyUsedInPID=true);
-}
-
-
-/*****************************************************************************\
-|*%%%  PID Tool Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2()
-{
-  delete &HTcalc;
-}
-
-/*****************************************************************************\
-|*%%%  Initialisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-StatusCode InDet::TRT_ElectronPidToolRun2::initialize()
-{
-  StatusCode sc = AthAlgTool::initialize();
-  if (sc.isFailure()) return sc;
-
-  // Get the TRT Identifier-helper:
-  if (detStore()->retrieve(m_trtId, "TRT_ID").isFailure()) {
-    ATH_MSG_FATAL ("Could not get TRT ID helper");
-    return StatusCode::FAILURE;
-  }
-
-  // Register callback function for cache updates - HT:
-  const DataHandle<CondAttrListVec> aptr;;
-  if (StatusCode::SUCCESS == detStore()->regFcn(&InDet::TRT_ElectronPidToolRun2::update,this, aptr, "/TRT/Calib/PID_vector" )) {
-    ATH_MSG_DEBUG ("Registered callback for TRT_ElectronPidToolRun2 - HT.");
-  } else {
-    ATH_MSG_ERROR ("Callback registration failed for TRT_ElectronPidToolRun2 - HT! ");
-  }
-
-  /* Get the TRT_ToT_dEdx tool */
-  if ( m_TRTdEdxTool.retrieve().isFailure() )
-    ATH_MSG_DEBUG("Failed to retrieve ToT dE/dx tool " << m_TRTdEdxTool);
-  else
-    ATH_MSG_DEBUG("Retrieved tool " << m_TRTdEdxTool);
-
-  if ( m_LocalOccTool.retrieve().isFailure() ){
-    ATH_MSG_WARNING("Failed retrieve Local Occ tool " << m_LocalOccTool << " the tool will not be called!!!" );
-  }
-  else ATH_MSG_INFO("Retrieved tool " << m_LocalOccTool);
-
-  sc = m_TRTStrawSummarySvc.retrieve();
-  if (StatusCode::SUCCESS!= sc ){
-    ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummarySvc);
-    ATH_MSG_ERROR ("configure as 'None' to avoid its loading.");
-    return sc;
-  } else {
-    if ( !m_TRTStrawSummarySvc.empty()) msg(MSG::INFO) << "Retrieved tool " << m_TRTStrawSummarySvc << endreq;
-  }
-
-  ATH_MSG_INFO ("initialize() successful in " << name());
-  return StatusCode::SUCCESS;
-}
-
-
-
-/*****************************************************************************\
-|*%%%  Finalisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-StatusCode InDet::TRT_ElectronPidToolRun2::finalize()
-{
-  return AthAlgTool::finalize();
-}
-
-/* Jared - remove ToTcalc
-double InDet::TRT_ElectronPidToolRun2::GetD(double R_Track)const {
-  R_Track=fabs(R_Track);
-  if(R_Track>2.) return 0;
-  return 2. * sqrt( 4. - R_Track * R_Track );
-}
-
-double InDet::TRT_ElectronPidToolRun2::GetToT(unsigned int bitpattern, double HitZ, double HitR, int BEC, int Layer, int Strawlayer)const {
-  return -999.99; //ToTcalc.GetToT( bitpattern, HitZ, HitR, BEC, Layer, Strawlayer);
-}
-*/
-
-// Kept for backward compatibility.
-// See TRT_ElectronPidTools-01-00-28 for the full (commented) code.
-std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability_old(const Trk::Track& track)
-{
-  // Simply return values without calculation
-  std::vector<float> PIDvalues(4);
-  PIDvalues[0] = 0.5;
-  PIDvalues[1] = 0.5;
-  PIDvalues[2] = 0.0;
-  PIDvalues[3] = 0.5;
-  const Trk::TrackParameters* perigee = track.perigeeParameters();
-  if (!perigee) { return PIDvalues; }
-  return PIDvalues;
-}
-
-
-/*****************************************************************************\
-|*%%%  electronProbability - The interface method during reconstruction  %%%%*|
-\*****************************************************************************/
-
-std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) {
-
-  //ATH_MSG_INFO("started electronProbabaility");
-  //Intialize the return vector
-  std::vector<float> PIDvalues(5);
-  float & prob_El_Comb      = PIDvalues[0] = 0.5;
-  float & prob_El_HT        = PIDvalues[1] = 0.5;
-  float & prob_El_ToT       = PIDvalues[2] = 0.5;
-  float & prob_El_Brem      = PIDvalues[3] = 0.5;
-  float & occ_local         = PIDvalues[4] = 0.0;
-
-  //  float & dEdx              = PIDvalues[2] = 0.0;
-  float dEdx = 0.0;
-
-  // Check for perigee:
-  const Trk::TrackParameters* perigee = track.perigeeParameters();
-  if (!perigee) return PIDvalues;
-
-  // Get parameters at perigee and check that they are reasonable:
-  const Amg::VectorX& parameterVector = perigee->parameters();
-  double qOverP = parameterVector[Trk::qOverP];
-  double theta  = parameterVector[Trk::theta];
-  double phi    = parameterVector[Trk::phi];
-
-  // Check the parameters are reasonable:
-  if (tan(theta/2.0) < 0.0001) {
-    ATH_MSG_DEBUG ("  Track has negative theta or is VERY close to beampipe! (tan(theta/2) < 0.0001). Returning default Pid values.");
-    return PIDvalues;
-  }
-
-  if (qOverP == 0.0) {
-    ATH_MSG_DEBUG ("  Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
-    return PIDvalues;
-  }
-
-  double pTrk = fabs(1.0 / qOverP);
-  double pT   = pTrk * sin(theta);
-  double eta  = -log(tan(theta/2.0));
-
-  // Check the tool to get the local occupancy (i.e. for the track in question):
-  occ_local = m_LocalOccTool->LocalOccupancy(track);
-
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi);
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
- 
-  // Jared - Development Output... 
-  /*
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << "check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi << std::endl;
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  */
-
-  // For calculation of HT probability:
-  double pHTel_prod = 1.0;
-  double pHTpi_prod = 1.0;
-
-  // ------------------------------------------------------------------------------------
-  // Loop over TRT hits on track, and calculate HT and R-ToT probability:
-  // ------------------------------------------------------------------------------------
-
-  unsigned int nTRThits     = 0;
-  unsigned int nTRThitsHTMB = 0;
-
-  // Check for track states:
-  const DataVector<const Trk::TrackStateOnSurface>* recoTrackStates = track.trackStateOnSurfaces();
-  if (not recoTrackStates) {
-    ATH_MSG_DEBUG("track.trackStateOnSurfaces() was zero");
-    //m_timingProfile->chronoStop("Tool::electronProb");
-    return PIDvalues;
-  }
-
-  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIter    = recoTrackStates->begin();
-  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIterEnd = recoTrackStates->end();
-
-  // Loop over track states on surfaces (i.e. generalized hits):
-  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
-
-    const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
-    if (!measurement) continue;
-
-    // Get drift circle (ensures that hit is from TRT):
-    const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
-    if (!driftcircle) continue;
-
-    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
-    bool isHTMB  = ((driftcircle->prepRawData()->getWord() & 0x00020000) > 0) ? true : false; 
-
-    nTRThits++;
-    if (isHTMB) nTRThitsHTMB++;
-
-
-    // ------------------------------------------------------------------------------------
-    // Get the necessary input for the probability calculations:
-    // ------------------------------------------------------------------------------------
-    Identifier DCid = driftcircle->identify();
-
-    // Part of TRT hit belongs to (TrtPart = 0: Barrel, 1: EndcapA, 2: EndcapB).
-    int TrtPart = 0;                      // 0: Barrel, 1: EndcapA, 2: EndcapB
-    if (abs(m_trtId->barrel_ec(DCid)) == 2)
-      TrtPart = (m_trtId->layer_or_wheel(DCid) < 6) ? 1 : 2;
-
-    // Get Straw Layer (Barrel: 0-72, EndcapA: 0-95 (16 layers in 6 modules), EndcapB: 0-63 (8 layers in 8 modules)):
-    int StrawLayer = 0;
-    if (TrtPart == 0) {
-      // Barrel:
-      if      (m_trtId->layer_or_wheel(DCid) == 0) StrawLayer = m_trtId->straw_layer(DCid);
-      else if (m_trtId->layer_or_wheel(DCid) == 1) StrawLayer = 19 + m_trtId->straw_layer(DCid);
-      else                                         StrawLayer = 19 + 24 + m_trtId->straw_layer(DCid);
-    } else {
-      // Endcap:
-      if (m_trtId->layer_or_wheel(DCid) < 6) StrawLayer = 16*m_trtId->layer_or_wheel(DCid) + m_trtId->straw_layer(DCid);
-      else                                   StrawLayer = 8*(m_trtId->layer_or_wheel(DCid)-6) + m_trtId->straw_layer(DCid);
-    }
-
-    // Get Z (Barrel) or R (Endcap) location of the hit, and distance from track to wire (i.e. anode) in straw:
-    double HitZ, HitR, rTrkWire;
-    bool hasTrackParameters= true; // Keep track of this for HT prob calculation
-    if ((*tsosIter)->trackParameters()) {
-      // If we have precise information (from hit), get that:
-      const Amg::Vector3D& gp = driftcircle->globalPosition();
-      HitR = gp.perp();
-      HitZ = gp.z();
-      rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[Trk::driftRadius]);
-    } else {
-      // Otherwise just use the straw coordinates:
-      hasTrackParameters = false; // Jared - pass this to HT calculation
-      HitZ = driftcircle->associatedSurface().center().z();
-      HitR = driftcircle->associatedSurface().center().perp();
-      rTrkWire = 0;
-    }
-
-
-    // ------------------------------------------------------------------------------------
-    // Collection and checks of input variables for HT probability calculation:
-    // ------------------------------------------------------------------------------------
-
-    int SL_max[3] = {73, 96, 64};
-    if (StrawLayer > SL_max[TrtPart]  ||  StrawLayer < 0) {
-      ATH_MSG_WARNING("  StrawLayer was outside allowed range!  TrtPart = " << TrtPart << "  SL = " << StrawLayer);
-      continue;
-    }
-
-    double ZRpos[3] = {fabs(HitZ), HitR, HitR};
-    double ZRpos_min[3] = {  0.0,  630.0,  630.0};
-    double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
-    if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
-      ATH_MSG_WARNING("  ZRpos was above allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
-      ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
-    }
-    if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
-      ATH_MSG_WARNING("  ZRpos was below allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
-      ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
-    }
-
-    if (rTrkWire > 2.2) rTrkWire = 2.175;   // Happens once in a while - no need for warning!
-
-    if (occ_local > 1.0  ||  occ_local < 0.0) {
-      ATH_MSG_WARNING("  Occupancy was outside allowed range!  TrtPart = " << TrtPart << "  Occupancy = " << occ_local);
-      continue;
-    }
-
-    // ------------------------------------------------------------------------------------
-    // Calculate the HT probability:
-    // ------------------------------------------------------------------------------------
-
-    // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}.
-    // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
-    int GasType=0; // Xenon is default
-    if (!m_TRTStrawSummarySvc.empty()) {
-      int stat = m_TRTStrawSummarySvc->getStatusHT(DCid);
-      if       ( stat==2 || stat==3 ) { GasType = 0; } // Xe
-      else if  ( stat==1 || stat==4 ) { GasType = 1; } // Ar
-      else if  ( stat==5 )            { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
-      else if  ( stat==6 )            { GasType = 1; } // Emulated Ar
-      else if  ( stat==7 )            { GasType = 1; } // Emulated Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
-      else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
-             throw std::exception();
-           }
-    }
-
-    ATH_MSG_DEBUG ("check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
-             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local << "  HTMB: " << isHTMB );
-
-
-    // Jared - Development Output... 
-    /*
-    std::cout << "check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
-             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local 
-            << "  HTMB: " << isHTMB << std::endl;
-            */
-
-    // Then call pHT functions with these values:
-    // ------------------------------------------
-    double pHTel = HTcalc.getProbHT( pTrk, Trk::electron, TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
-    double pHTpi = HTcalc.getProbHT( pTrk, Trk::pion,     TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
-
-    if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
-      ATH_MSG_DEBUG("  pHT outside allowed range!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
-      continue;
-    }
-
-    if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
-      ATH_MSG_DEBUG("  pHT has abnormal value!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
-      continue;
-    }
-
-    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
-    if (isHTMB) {pHTel_prod *=     pHTel;  pHTpi_prod *=     pHTpi;}
-    else        {pHTel_prod *= 1.0-pHTel;  pHTpi_prod *= 1.0-pHTpi;}
-    ATH_MSG_DEBUG ("check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi );
-    
-    // Jared - Development Output... 
-    //std::cout << "check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi << std::endl;
-
-  }//of loop over hits
-
-
-  // If number of hits is adequate (default is 5 hits), calculate HT and ToT probability.
-  if (not (nTRThits >= m_minTRThits)) return PIDvalues;
-
-  // Calculate electron probability (HT)
-  prob_El_HT = pHTel_prod / (pHTel_prod + pHTpi_prod);
-
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT);
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("");
-    
-  // Jared - Development Output... 
-  /*
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << "check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT << std::endl;
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << std::endl << std::endl;
-  */
-
-  // Jared - ToT Implementation
-  dEdx = m_TRTdEdxTool->dEdx( &track, true, false, true); // Divide by L, exclude HT hits 
-  double usedHits = m_TRTdEdxTool->usedHits( &track, true, false);
-  prob_El_ToT = m_TRTdEdxTool->getTest( dEdx, pTrk, Trk::electron, Trk::pion, usedHits, true ); 
-  
-  // Limit the probability values the the upper and lower limits that are given/trusted for each part:
-  double limProbHT = HTcalc.Limit(prob_El_HT); 
-  double limProbToT = HTcalc.Limit(prob_El_ToT); 
-  
-  // Calculate the combined probability, assuming no correlations (none are expected).
-  prob_El_Comb = (limProbHT * limProbToT ) / ( (limProbHT * limProbToT) + ( (1.0-limProbHT) * (1.0-limProbToT)) );
-  
-  // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014):
-  prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) 
-
-  //std::cout << "Prob_HT = " << prob_El_HT << "   Prob_ToT = " << prob_El_ToT << "   Prob_Comb = " << prob_El_Comb << std::endl;
-     
-  return PIDvalues;  
-}
-
-/* ----------------------------------------------------------------------------------- */
-// Callback function to update constants from database: 
-/* ----------------------------------------------------------------------------------- */
-
-StatusCode InDet::TRT_ElectronPidToolRun2::update( IOVSVC_CALLBACK_ARGS_P(I,keys) ) {
-
-  ATH_MSG_DEBUG ("Updating constants for the TRT_ElectronPidToolRun2! ");
-
-  // Callback function to update HT onset parameter cache when condDB data changes:
-  for(std::list<std::string>::const_iterator key=keys.begin(); key != keys.end(); ++key)
-    ATH_MSG_DEBUG("IOVCALLBACK for key " << *key << " number " << I);
-
-	// NEW reading from DB
-  StatusCode sc = StatusCode::SUCCESS;
-  ATH_MSG_INFO("HT Calculator : Reading vector format");
-
-  const DataHandle<CondAttrListVec> channel_values;
-  if (StatusCode::SUCCESS == detStore()->retrieve(channel_values, "/TRT/Calib/PID_vector" )){
-        sc = HTcalc.ReadVectorDB(        channel_values  );
-  } else {
-        ATH_MSG_ERROR ("Problem reading condDB object. HT Calculator.");
-  }
-
-  return sc;
-}
-
-/*****************************************************************************\
-|*%%%  TRT straw address check, done once per hit.  %%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%  Nowhere else are these numbers checked. If this is deemed  %%%%%%%%%%%*|
-|*%%%  unnecessary it can be taken out by simply letting the function %%%%%%%*|
-|*%%%  return true every time  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int StrawLayer){
-
-  //first check that the BEC is valid:
-  if(not ( BEC==-2 || BEC ==-1 || BEC==1 || BEC==2)){
-    ATH_MSG_ERROR("Found a wrong TRT part: "<<BEC<<" expected one of (-2,-1,1,2)");
-    return false;
-  }
-  const int part = abs(BEC)-1;
-
-  //next check that the layer is valid
-  if( Layer < 0){
-    ATH_MSG_ERROR("Found a negative TRT Layer");
-    return false; //must be positive
-  }
-  
-  static const int nlayers[2]={3,14};
-  
-  if( not ( Layer < nlayers[part] ) ){
-    ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers.");
-    return false;
-  }
-
-  //and finally check that the StrawLayer is valid:
-  if( StrawLayer < 0){
-    ATH_MSG_ERROR("Found a negative TRT StrawLayer");
-    return false; //must be positive
-  }
-  
-  static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
-                                        {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
-  
-  if(not(StrawLayer < strawsPerBEC[part][Layer])){
-    ATH_MSG_ERROR("TRT part "<<BEC<<" Layer "<<Layer<<" only has "<<strawsPerBEC[part][Layer]<<" straws. Found index "<<StrawLayer);
-    return false;
-  }
-  
-  return true;
-}
-
-/*****************************************************************************\
-|*%%%  Auxiliary function to return the HT pobability to Atlfast  %%%%%%%%%%%*|
-|*%%%  a geometry ckeck is perfored every time here  %%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-double InDet::TRT_ElectronPidToolRun2::probHT( const double /*pTrk*/, const Trk::ParticleHypothesis /*hypothesis*/, const int HitPart, const int Layer, const int StrawLayer){
-  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
-    ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
-    return 0.5;
-  }
-  //return HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
-  // FIXME
-  return 1.0;//HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
-}
-
-
-double InDet::TRT_ElectronPidToolRun2::probHTRun2( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy ){
-   return HTcalc.getProbHT( pTrk, hypothesis, TrtPart, GasType, StrawLayer, ZR, rTrkWire, Occupancy );
-}
+///////////////////////////////////////////////////////////////////
+// TRT_ElectronPidToolRun2.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+
+#include "TRT_ElectronPidTools/BaseTRTPIDCalculator.h"
+#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h"
+#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h"
+
+// StoreGate, Athena, and Database stuff:
+#include "Identifier/Identifier.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoralBase/AttributeListSpecification.h"
+#include "CoralBase/Blob.h"
+#include "AthenaPoolUtilities/CondAttrListVec.h"
+// Tracking:
+#include "TrkTrack/Track.h"
+#include "TrkTrack/TrackStateOnSurface.h"
+#include "TrkMeasurementBase/MeasurementBase.h"
+#include "TrkRIO_OnTrack/RIO_OnTrack.h"
+#include "TrkParameters/TrackParameters.h"
+#include "TrkSurfaces/Surface.h"
+#include "TrkTrack/TrackInfo.h"
+
+// Drift circles and TRT identifiers:
+#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
+#include "InDetIdentifier/TRT_ID.h"
+
+// ToT Tool Interface
+#include "TRT_ToT_Tools/ITRT_ToT_dEdx.h"
+
+// Particle masses
+
+// Math functions:
+#include <cmath>
+
+//STL includes
+#include <sstream>
+
+//#define TRTDBG ATH_MSG_INFO("To line "<<__LINE__);
+//#define TRTDBG 0;
+
+#include "TRT_ElectronPidToolRun2_HTcalculation.cxx"
+
+
+/*****************************************************************************\
+|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%  PID Tool Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+InDet::TRT_ElectronPidToolRun2::TRT_ElectronPidToolRun2(const std::string& t, const std::string& n, const IInterface* p )
+  :
+  AthAlgTool(t,n,p),
+  m_trtId(0),
+  m_minTRThits(5),
+  HTcalc(*(new HTcalculator(*this))),
+  m_TRTdEdxTool("TRT_ToT_dEdx"),
+  m_LocalOccTool(),
+  m_TRTStrawSummarySvc("InDetTRTStrawStatusSummarySvc",n)
+{
+  declareInterface<ITRT_ElectronPidTool>(this);
+  declareInterface<ITRT_ElectronToTTool>(this);
+  //  template for property decalration
+  //declareProperty("PropertyName", m_propertyName);
+  declareProperty("MinimumTRThitsForIDpid", m_minTRThits);
+  declareProperty("TRT_ToT_dEdx_Tool", m_TRTdEdxTool);
+  declareProperty("TRT_LocalOccupancyTool", m_LocalOccTool);
+  declareProperty("isData", m_DATA = true);
+  declareProperty("TRTStrawSummarySvc",    m_TRTStrawSummarySvc);
+  declareProperty("OccupancyUsedInPID", m_OccupancyUsedInPID=true);
+}
+
+
+/*****************************************************************************\
+|*%%%  PID Tool Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2()
+{
+  delete &HTcalc;
+}
+
+/*****************************************************************************\
+|*%%%  Initialisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+StatusCode InDet::TRT_ElectronPidToolRun2::initialize()
+{
+  StatusCode sc = AthAlgTool::initialize();
+  if (sc.isFailure()) return sc;
+
+  // Get the TRT Identifier-helper:
+  if (detStore()->retrieve(m_trtId, "TRT_ID").isFailure()) {
+    ATH_MSG_FATAL ("Could not get TRT ID helper");
+    return StatusCode::FAILURE;
+  }
+
+  // Register callback function for cache updates - HT:
+  const DataHandle<CondAttrListVec> aptr;;
+  if (StatusCode::SUCCESS == detStore()->regFcn(&InDet::TRT_ElectronPidToolRun2::update,this, aptr, "/TRT/Calib/PID_vector" )) {
+    ATH_MSG_DEBUG ("Registered callback for TRT_ElectronPidToolRun2 - HT.");
+  } else {
+    ATH_MSG_ERROR ("Callback registration failed for TRT_ElectronPidToolRun2 - HT! ");
+  }
+
+  /* Get the TRT_ToT_dEdx tool */
+  if ( m_TRTdEdxTool.retrieve().isFailure() )
+    ATH_MSG_DEBUG("Failed to retrieve ToT dE/dx tool " << m_TRTdEdxTool);
+  else
+    ATH_MSG_DEBUG("Retrieved tool " << m_TRTdEdxTool);
+
+  if ( m_LocalOccTool.retrieve().isFailure() ){
+    ATH_MSG_WARNING("Failed retrieve Local Occ tool " << m_LocalOccTool << " the tool will not be called!!!" );
+  }
+  else ATH_MSG_INFO("Retrieved tool " << m_LocalOccTool);
+
+  sc = m_TRTStrawSummarySvc.retrieve();
+  if (StatusCode::SUCCESS!= sc ){
+    ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummarySvc);
+    ATH_MSG_ERROR ("configure as 'None' to avoid its loading.");
+    return sc;
+  } else {
+    if ( !m_TRTStrawSummarySvc.empty()) msg(MSG::INFO) << "Retrieved tool " << m_TRTStrawSummarySvc << endreq;
+  }
+
+  ATH_MSG_INFO ("initialize() successful in " << name());
+  return StatusCode::SUCCESS;
+}
+
+
+
+/*****************************************************************************\
+|*%%%  Finalisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+StatusCode InDet::TRT_ElectronPidToolRun2::finalize()
+{
+  return AthAlgTool::finalize();
+}
+
+/* Jared - remove ToTcalc
+double InDet::TRT_ElectronPidToolRun2::GetD(double R_Track)const {
+  R_Track=fabs(R_Track);
+  if(R_Track>2.) return 0;
+  return 2. * sqrt( 4. - R_Track * R_Track );
+}
+
+double InDet::TRT_ElectronPidToolRun2::GetToT(unsigned int bitpattern, double HitZ, double HitR, int BEC, int Layer, int Strawlayer)const {
+  return -999.99; //ToTcalc.GetToT( bitpattern, HitZ, HitR, BEC, Layer, Strawlayer);
+}
+*/
+
+// Kept for backward compatibility.
+// See TRT_ElectronPidTools-01-00-28 for the full (commented) code.
+std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability_old(const Trk::Track& track)
+{
+  // Simply return values without calculation
+  std::vector<float> PIDvalues(4);
+  PIDvalues[0] = 0.5;
+  PIDvalues[1] = 0.5;
+  PIDvalues[2] = 0.0;
+  PIDvalues[3] = 0.5;
+  const Trk::TrackParameters* perigee = track.perigeeParameters();
+  if (!perigee) { return PIDvalues; }
+  return PIDvalues;
+}
+
+
+/*****************************************************************************\
+|*%%%  electronProbability - The interface method during reconstruction  %%%%*|
+\*****************************************************************************/
+
+std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) {
+
+  //ATH_MSG_INFO("started electronProbabaility");
+  //Intialize the return vector
+  std::vector<float> PIDvalues(5);
+  float & prob_El_Comb      = PIDvalues[0] = 0.5;
+  float & prob_El_HT        = PIDvalues[1] = 0.5;
+  float & prob_El_ToT       = PIDvalues[2] = 0.5;
+  float & prob_El_Brem      = PIDvalues[3] = 0.5;
+  float & occ_local         = PIDvalues[4] = 0.0;
+
+  //  float & dEdx              = PIDvalues[2] = 0.0;
+  float dEdx = 0.0;
+
+  // Check for perigee:
+  const Trk::TrackParameters* perigee = track.perigeeParameters();
+  if (!perigee) return PIDvalues;
+
+  // Get parameters at perigee and check that they are reasonable:
+  const Amg::VectorX& parameterVector = perigee->parameters();
+  double qOverP = parameterVector[Trk::qOverP];
+  double theta  = parameterVector[Trk::theta];
+  double phi    = parameterVector[Trk::phi];
+
+  // Check the parameters are reasonable:
+  if (tan(theta/2.0) < 0.0001) {
+    ATH_MSG_DEBUG ("  Track has negative theta or is VERY close to beampipe! (tan(theta/2) < 0.0001). Returning default Pid values.");
+    return PIDvalues;
+  }
+
+  if (qOverP == 0.0) {
+    ATH_MSG_DEBUG ("  Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
+    return PIDvalues;
+  }
+
+  double pTrk = fabs(1.0 / qOverP);
+  double pT   = pTrk * sin(theta);
+  double eta  = -log(tan(theta/2.0));
+
+  // Check the tool to get the local occupancy (i.e. for the track in question):
+  occ_local = m_LocalOccTool->LocalOccupancy(track);
+
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi);
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+ 
+  // Jared - Development Output... 
+  /*
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << "check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi << std::endl;
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  */
+
+  // For calculation of HT probability:
+  double pHTel_prod = 1.0;
+  double pHTpi_prod = 1.0;
+
+  // ------------------------------------------------------------------------------------
+  // Loop over TRT hits on track, and calculate HT and R-ToT probability:
+  // ------------------------------------------------------------------------------------
+
+  unsigned int nTRThits     = 0;
+  unsigned int nTRThitsHTMB = 0;
+
+  // Check for track states:
+  const DataVector<const Trk::TrackStateOnSurface>* recoTrackStates = track.trackStateOnSurfaces();
+  if (not recoTrackStates) {
+    ATH_MSG_DEBUG("track.trackStateOnSurfaces() was zero");
+    //m_timingProfile->chronoStop("Tool::electronProb");
+    return PIDvalues;
+  }
+
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIter    = recoTrackStates->begin();
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIterEnd = recoTrackStates->end();
+
+  // Loop over track states on surfaces (i.e. generalized hits):
+  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
+
+    const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
+    if (!measurement) continue;
+
+    // Get drift circle (ensures that hit is from TRT):
+    const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
+    if (!driftcircle) continue;
+
+    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
+    bool isHTMB  = ((driftcircle->prepRawData()->getWord() & 0x00020000) > 0) ? true : false; 
+
+    nTRThits++;
+    if (isHTMB) nTRThitsHTMB++;
+
+
+    // ------------------------------------------------------------------------------------
+    // Get the necessary input for the probability calculations:
+    // ------------------------------------------------------------------------------------
+    Identifier DCid = driftcircle->identify();
+
+    // Part of TRT hit belongs to (TrtPart = 0: Barrel, 1: EndcapA, 2: EndcapB).
+    int TrtPart = 0;                      // 0: Barrel, 1: EndcapA, 2: EndcapB
+    if (abs(m_trtId->barrel_ec(DCid)) == 2)
+      TrtPart = (m_trtId->layer_or_wheel(DCid) < 6) ? 1 : 2;
+
+    // Get Straw Layer (Barrel: 0-72, EndcapA: 0-95 (16 layers in 6 modules), EndcapB: 0-63 (8 layers in 8 modules)):
+    int StrawLayer = 0;
+    if (TrtPart == 0) {
+      // Barrel:
+      if      (m_trtId->layer_or_wheel(DCid) == 0) StrawLayer = m_trtId->straw_layer(DCid);
+      else if (m_trtId->layer_or_wheel(DCid) == 1) StrawLayer = 19 + m_trtId->straw_layer(DCid);
+      else                                         StrawLayer = 19 + 24 + m_trtId->straw_layer(DCid);
+    } else {
+      // Endcap:
+      if (m_trtId->layer_or_wheel(DCid) < 6) StrawLayer = 16*m_trtId->layer_or_wheel(DCid) + m_trtId->straw_layer(DCid);
+      else                                   StrawLayer = 8*(m_trtId->layer_or_wheel(DCid)-6) + m_trtId->straw_layer(DCid);
+    }
+
+    // Get Z (Barrel) or R (Endcap) location of the hit, and distance from track to wire (i.e. anode) in straw:
+    double HitZ, HitR, rTrkWire;
+    bool hasTrackParameters= true; // Keep track of this for HT prob calculation
+    if ((*tsosIter)->trackParameters()) {
+      // If we have precise information (from hit), get that:
+      const Amg::Vector3D& gp = driftcircle->globalPosition();
+      HitR = gp.perp();
+      HitZ = gp.z();
+      rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[Trk::driftRadius]);
+    } else {
+      // Otherwise just use the straw coordinates:
+      hasTrackParameters = false; // Jared - pass this to HT calculation
+      HitZ = driftcircle->associatedSurface().center().z();
+      HitR = driftcircle->associatedSurface().center().perp();
+      rTrkWire = 0;
+    }
+
+
+    // ------------------------------------------------------------------------------------
+    // Collection and checks of input variables for HT probability calculation:
+    // ------------------------------------------------------------------------------------
+
+    int SL_max[3] = {73, 96, 64};
+    if (StrawLayer > SL_max[TrtPart]  ||  StrawLayer < 0) {
+      ATH_MSG_WARNING("  StrawLayer was outside allowed range!  TrtPart = " << TrtPart << "  SL = " << StrawLayer);
+      continue;
+    }
+
+    double ZRpos[3] = {fabs(HitZ), HitR, HitR};
+    double ZRpos_min[3] = {  0.0,  630.0,  630.0};
+    double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
+    if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
+      ATH_MSG_WARNING("  ZRpos was above allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
+      ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
+    }
+    if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
+      ATH_MSG_WARNING("  ZRpos was below allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
+      ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
+    }
+
+    if (rTrkWire > 2.2) rTrkWire = 2.175;   // Happens once in a while - no need for warning!
+
+    if (occ_local > 1.0  ||  occ_local < 0.0) {
+      ATH_MSG_WARNING("  Occupancy was outside allowed range!  TrtPart = " << TrtPart << "  Occupancy = " << occ_local);
+      continue;
+    }
+
+    // ------------------------------------------------------------------------------------
+    // Calculate the HT probability:
+    // ------------------------------------------------------------------------------------
+
+    // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}.
+    // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
+    int GasType=0; // Xenon is default
+    if (!m_TRTStrawSummarySvc.empty()) {
+      int stat = m_TRTStrawSummarySvc->getStatusHT(DCid);
+      if       ( stat==2 || stat==3 ) { GasType = 0; } // Xe
+      else if  ( stat==1 || stat==4 ) { GasType = 1; } // Ar
+      else if  ( stat==5 )            { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
+      else if  ( stat==6 )            { GasType = 1; } // Emulated Ar
+      else if  ( stat==7 )            { GasType = 1; } // Emulated Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
+      else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
+             throw std::exception();
+           }
+    }
+
+    ATH_MSG_DEBUG ("check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
+             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local << "  HTMB: " << isHTMB );
+
+
+    // Jared - Development Output... 
+    /*
+    std::cout << "check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
+             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local 
+            << "  HTMB: " << isHTMB << std::endl;
+            */
+
+    // Then call pHT functions with these values:
+    // ------------------------------------------
+    double pHTel = HTcalc.getProbHT( pTrk, Trk::electron, TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
+    double pHTpi = HTcalc.getProbHT( pTrk, Trk::pion,     TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
+
+    if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
+      ATH_MSG_DEBUG("  pHT outside allowed range!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
+      continue;
+    }
+
+    if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
+      ATH_MSG_DEBUG("  pHT has abnormal value!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
+      continue;
+    }
+
+    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
+    if (isHTMB) {pHTel_prod *=     pHTel;  pHTpi_prod *=     pHTpi;}
+    else        {pHTel_prod *= 1.0-pHTel;  pHTpi_prod *= 1.0-pHTpi;}
+    ATH_MSG_DEBUG ("check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi );
+    
+    // Jared - Development Output... 
+    //std::cout << "check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi << std::endl;
+
+  }//of loop over hits
+
+
+  // If number of hits is adequate (default is 5 hits), calculate HT and ToT probability.
+  if (not (nTRThits >= m_minTRThits)) return PIDvalues;
+
+  // Calculate electron probability (HT)
+  prob_El_HT = pHTel_prod / (pHTel_prod + pHTpi_prod);
+
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT);
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("");
+    
+  // Jared - Development Output... 
+  /*
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << "check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT << std::endl;
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << std::endl << std::endl;
+  */
+
+  // Jared - ToT Implementation
+  dEdx = m_TRTdEdxTool->dEdx( &track, true, false, true); // Divide by L, exclude HT hits 
+  double usedHits = m_TRTdEdxTool->usedHits( &track, true, false);
+  prob_El_ToT = m_TRTdEdxTool->getTest( dEdx, pTrk, Trk::electron, Trk::pion, usedHits, true ); 
+  
+  // Limit the probability values the the upper and lower limits that are given/trusted for each part:
+  double limProbHT = HTcalc.Limit(prob_El_HT); 
+  double limProbToT = HTcalc.Limit(prob_El_ToT); 
+  
+  // Calculate the combined probability, assuming no correlations (none are expected).
+  prob_El_Comb = (limProbHT * limProbToT ) / ( (limProbHT * limProbToT) + ( (1.0-limProbHT) * (1.0-limProbToT)) );
+  
+  // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014):
+  prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) 
+
+  //std::cout << "Prob_HT = " << prob_El_HT << "   Prob_ToT = " << prob_El_ToT << "   Prob_Comb = " << prob_El_Comb << std::endl;
+     
+  return PIDvalues;  
+}
+
+/* ----------------------------------------------------------------------------------- */
+// Callback function to update constants from database: 
+/* ----------------------------------------------------------------------------------- */
+
+StatusCode InDet::TRT_ElectronPidToolRun2::update( IOVSVC_CALLBACK_ARGS_P(I,keys) ) {
+
+  ATH_MSG_DEBUG ("Updating constants for the TRT_ElectronPidToolRun2! ");
+
+  // Callback function to update HT onset parameter cache when condDB data changes:
+  for(std::list<std::string>::const_iterator key=keys.begin(); key != keys.end(); ++key)
+    ATH_MSG_DEBUG("IOVCALLBACK for key " << *key << " number " << I);
+
+	// NEW reading from DB
+  StatusCode sc = StatusCode::SUCCESS;
+  ATH_MSG_INFO("HT Calculator : Reading vector format");
+
+  const DataHandle<CondAttrListVec> channel_values;
+  if (StatusCode::SUCCESS == detStore()->retrieve(channel_values, "/TRT/Calib/PID_vector" )){
+        sc = HTcalc.ReadVectorDB(        channel_values  );
+  } else {
+        ATH_MSG_ERROR ("Problem reading condDB object. HT Calculator.");
+  }
+
+  return sc;
+}
+
+/*****************************************************************************\
+|*%%%  TRT straw address check, done once per hit.  %%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%  Nowhere else are these numbers checked. If this is deemed  %%%%%%%%%%%*|
+|*%%%  unnecessary it can be taken out by simply letting the function %%%%%%%*|
+|*%%%  return true every time  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int StrawLayer){
+
+  //first check that the BEC is valid:
+  if(not ( BEC==-2 || BEC ==-1 || BEC==1 || BEC==2)){
+    ATH_MSG_ERROR("Found a wrong TRT part: "<<BEC<<" expected one of (-2,-1,1,2)");
+    return false;
+  }
+  const int part = abs(BEC)-1;
+
+  //next check that the layer is valid
+  if( Layer < 0){
+    ATH_MSG_ERROR("Found a negative TRT Layer");
+    return false; //must be positive
+  }
+  
+  static const int nlayers[2]={3,14};
+  
+  if( not ( Layer < nlayers[part] ) ){
+    ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers.");
+    return false;
+  }
+
+  //and finally check that the StrawLayer is valid:
+  if( StrawLayer < 0){
+    ATH_MSG_ERROR("Found a negative TRT StrawLayer");
+    return false; //must be positive
+  }
+  
+  static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
+                                        {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
+  
+  if(not(StrawLayer < strawsPerBEC[part][Layer])){
+    ATH_MSG_ERROR("TRT part "<<BEC<<" Layer "<<Layer<<" only has "<<strawsPerBEC[part][Layer]<<" straws. Found index "<<StrawLayer);
+    return false;
+  }
+  
+  return true;
+}
+
+/*****************************************************************************\
+|*%%%  Auxiliary function to return the HT pobability to Atlfast  %%%%%%%%%%%*|
+|*%%%  a geometry ckeck is perfored every time here  %%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+double InDet::TRT_ElectronPidToolRun2::probHT( const double /*pTrk*/, const Trk::ParticleHypothesis /*hypothesis*/, const int HitPart, const int Layer, const int StrawLayer){
+  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
+    ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
+    return 0.5;
+  }
+  //return HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
+  // FIXME
+  return 1.0;//HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
+}
+
+
+double InDet::TRT_ElectronPidToolRun2::probHTRun2( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy ){
+   return HTcalc.getProbHT( pTrk, hypothesis, TrtPart, GasType, StrawLayer, ZR, rTrkWire, Occupancy );
+}
diff --git a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx
index 358ddd1f97cd6e47af23823c60a9300a5b189985..28f8456fcad7a5e10ddabfd9114113ae824359ff 100755
--- a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx
+++ b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx
@@ -703,7 +703,7 @@ std::list<Trk::Track*> InDet::TRT_SeededTrackFinder_ATL::findTrack
     }
 
     //Get list of InDet Elements
-    std::list<const InDetDD::SiDetectorElement*> DE;
+    std::vector<const InDetDD::SiDetectorElement*> DE;
     m_roadmaker->detElementsRoad(*per,Trk::alongMomentum,DE);
     delete per;
     if( int(DE.size()) < m_nclusmin){ //Not enough detector elements to satisfy the minimum number of clusters requirement. Stop
diff --git a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLink_xk.h b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLinkN_xk.h
similarity index 78%
rename from InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLink_xk.h
rename to InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLinkN_xk.h
index 3fad06c4775e8b8ec0a69e709bfd1a28466185ae..2b155c758abf34b72a20fbf4842dce166b2a5050 100755
--- a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLink_xk.h
+++ b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_DriftCircleLinkN_xk.h
@@ -12,14 +12,14 @@
 // Version 1.0 3/10/2004 I.Gavrilenko
 /////////////////////////////////////////////////////////////////////////////////
 
-#ifndef TRT_DriftCircleLink_xk_H
-#define TRT_DriftCircleLink_xk_H
+#ifndef TRT_DriftCircleLinkN_xk_H
+#define TRT_DriftCircleLinkN_xk_H
 
 #include "InDetPrepRawData/TRT_DriftCircle.h"
 
 namespace InDet{
 
-  class TRT_DriftCircleLink_xk
+  class TRT_DriftCircleLinkN_xk
     {
       ///////////////////////////////////////////////////////////////////
       // Public methods:
@@ -27,10 +27,10 @@ namespace InDet{
       
     public:
       
-      TRT_DriftCircleLink_xk();
-      TRT_DriftCircleLink_xk(const TRT_DriftCircleLink_xk&);
-      ~TRT_DriftCircleLink_xk();
-      TRT_DriftCircleLink_xk& operator  = (const TRT_DriftCircleLink_xk&);
+      TRT_DriftCircleLinkN_xk();
+      TRT_DriftCircleLinkN_xk(const TRT_DriftCircleLinkN_xk&);
+      ~TRT_DriftCircleLinkN_xk();
+      TRT_DriftCircleLinkN_xk& operator  = (const TRT_DriftCircleLinkN_xk&);
 
       ///////////////////////////////////////////////////////////////////
       // Main methods
@@ -63,20 +63,20 @@ namespace InDet{
   // Inline methods
   /////////////////////////////////////////////////////////////////////////////////
 
-  inline TRT_DriftCircleLink_xk::TRT_DriftCircleLink_xk()
+  inline TRT_DriftCircleLinkN_xk::TRT_DriftCircleLinkN_xk()
     {
       m_circle =  0 ;
       m_phi     = 0.;
       m_address = 0 ;
     }
 
-  inline TRT_DriftCircleLink_xk::TRT_DriftCircleLink_xk(const TRT_DriftCircleLink_xk& L)
+  inline TRT_DriftCircleLinkN_xk::TRT_DriftCircleLinkN_xk(const TRT_DriftCircleLinkN_xk& L)
     {
       *this = L;
     }
   
-  inline TRT_DriftCircleLink_xk& TRT_DriftCircleLink_xk::operator = 
-    (const TRT_DriftCircleLink_xk& L) 
+  inline TRT_DriftCircleLinkN_xk& TRT_DriftCircleLinkN_xk::operator = 
+    (const TRT_DriftCircleLinkN_xk& L) 
     {
       if(&L!=this) {
 	m_circle  = L.m_circle ;
@@ -86,9 +86,9 @@ namespace InDet{
       return(*this);
     }
 
-  inline TRT_DriftCircleLink_xk::~TRT_DriftCircleLink_xk() {}
+  inline TRT_DriftCircleLinkN_xk::~TRT_DriftCircleLinkN_xk() {}
 
-  inline void TRT_DriftCircleLink_xk::set
+  inline void TRT_DriftCircleLinkN_xk::set
     (const TRT_DriftCircle* const& d, const float& p, const unsigned int& a) 
     {
       m_circle  = d;
@@ -98,6 +98,6 @@ namespace InDet{
 
 } // end of name space
 
-#endif // TRT_DriftCircleLink_xk
+#endif // TRT_DriftCircleLinkN_xk
 
 
diff --git a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsMaker_ATLxk.h b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsMaker_ATLxk.h
index 7549fb7332de7b3c016fddc145238b79247d24ae..ad61464356db1ccc6133e8e8ddb7d72d691fc35b 100755
--- a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsMaker_ATLxk.h
+++ b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsTool_xk/TRT_TrackSegmentsMaker_ATLxk.h
@@ -25,7 +25,7 @@
 #include "TrkGeometry/MagneticFieldProperties.h"
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
 #include "InDetReadoutGeometry/TRT_DetectorManager.h"
-#include "TRT_TrackSegmentsTool_xk/TRT_DriftCircleLink_xk.h"
+#include "TRT_TrackSegmentsTool_xk/TRT_DriftCircleLinkN_xk.h"
 
 class MsgStream;
 
@@ -136,7 +136,7 @@ namespace InDet{
       int                                    m_nMom            ; // number momentum  channel
       int                                    m_histsize        ; // histogram size
       int                                    m_cirsize         ; // Size of m_circles
-      TRT_DriftCircleLink_xk*                m_circles         ;
+      TRT_DriftCircleLinkN_xk*               m_circles         ;
 
       union {unsigned char H[227500*4]; unsigned int H4[227500];} m_U;
       std::multimap<unsigned int,unsigned int> 
diff --git a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/src/TRT_TrackSegmentsMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/src/TRT_TrackSegmentsMaker_ATLxk.cxx
index 0afacb4b16c8f9fc3b50ad267d73ea12de720907..be4526ae0a8cc3eb82d11f55834d30ca752fd357 100755
--- a/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/src/TRT_TrackSegmentsMaker_ATLxk.cxx
+++ b/InnerDetector/InDetRecTools/TRT_TrackSegmentsTool_xk/src/TRT_TrackSegmentsMaker_ATLxk.cxx
@@ -798,7 +798,7 @@ void InDet::TRT_TrackSegmentsMaker_ATLxk::mapStrawsProduction()
   m_islope   = new          int[n];
   m_slope    = new float       [n];
   m_cirsize  = m_nstraws[0]+m_nstraws[1];
-  m_circles  = new TRT_DriftCircleLink_xk[m_cirsize];
+  m_circles  = new TRT_DriftCircleLinkN_xk[m_cirsize];
 
   n          = 0;
   for(int b=0; b!=4; ++b) {
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/FTK_TrackMaker.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/FTK_TrackMaker.h
index 6f63495a41af84bd0def65757e53457186cf9148..c0bcc7a1777d979a6e2631afb74931d373b068bd 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/FTK_TrackMaker.h
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/FTK_TrackMaker.h
@@ -1,17 +1,5 @@
 /*
   Copyright (C) 1995-2017 CERN for the benefit of the ATLAS collaboration
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
 */
 
 /////////////////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/python/InDetTrigPrepRawDataFormatMonitoring.py b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/python/InDetTrigPrepRawDataFormatMonitoring.py
index a298d1350daf20d07262089342fd06eb6f493bcb..642d4e7a9f7546f6294e81aedfd7de1160d7013e 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/python/InDetTrigPrepRawDataFormatMonitoring.py
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/python/InDetTrigPrepRawDataFormatMonitoring.py
@@ -12,6 +12,7 @@ class SctTrigPrepRawDataFormatMonitorBase(TrigGenericMonitoringToolConfig):
 
     maxclu = 200
     maxid = 400
+    maxerrbins = 45
     from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings
     deta = InDetTrigSliceSettings[('etaHalfWidth',type)]
     if deta>3.:
@@ -37,8 +38,8 @@ class SctTrigPrepRawDataFormatMonitorBase(TrigGenericMonitoringToolConfig):
     self.Histograms += [ defineHistogram('SctBSErr',
                                          type='TH1F',
                                          title="SCT BS decoding errors", 
-                                         xbins = 15, xmin=0., xmax=20,
-                                         labels='ByteStreamParseError: TimeOutError: BCIDError: LVL1IDError: PreambleError: FormatterError: TrailerError: TrailerOverflowError: HeaderTrailerLimitError: ABCDError: RawError: MaskedLink: RODClockError: TruncatedROD: ROBFragmentError'
+                                         xbins = maxerrbins, xmin=0.5, xmax=maxerrbins+0.5,
+                                         labels='ByteStreamParseError: TimeOutError: BCIDError: LVL1IDError: PreambleError: FormatterError: TrailerError: TrailerOverflowError: HeaderTrailerLimitError: ABCDError: RawError: MaskedLink: RODClockError: TruncatedROD: ROBFragmentError: MissingLinkHeaderError: MaskedROD: ABCDError_Chip0:xxxxx ABCDError_Chip1: ABCDError_Chip2: ABCDError_Chip3: ABCDError_Chip4: ABCDError_Chip5: ABCDError_Error1: ABCDError_Error2: ABCDError_Error4: TempMaskedChip0: TempMaskedChip1: TempMaskedChip2: TempMaskedChip3: TempMaskedChip4: TempMaskedChip5: ABCDError_Error7: ABCDError_Invalid'
                                          ) ]
 
     self.Histograms += [ defineHistogram('SctHashId',
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/FTK_TrackMaker.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/FTK_TrackMaker.cxx
index cf1a731eb8d63cf1e9c91aaa9341133a7525f7bc..e2d5c99994e3b73e99d1e47930329825f2661515 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/FTK_TrackMaker.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/FTK_TrackMaker.cxx
@@ -1,17 +1,5 @@
 /*
   Copyright (C) 1995-2017 CERN for the benefit of the ATLAS collaboration
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
 */
 
 //***************************************************************************
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/TRT_TrgRIO_Maker.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/TRT_TrgRIO_Maker.cxx
index 32cfe4f391162a46e64607603a01b428e40634e5..653efc3f99b6e6736d3fa2dffb8e5d1d4b232fba 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/TRT_TrgRIO_Maker.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/TRT_TrgRIO_Maker.cxx
@@ -532,9 +532,8 @@ namespace InDet{
   //--------------------------------
   HLT::ErrorCode TRT_TrgRIO_Maker::prepareRobRequests(const HLT::TriggerElement* inputTE){
 
-    ATH_MSG_INFO( "TRT_TrgRIO_Maker::prepareRobRequests()" );
+    ATH_MSG_DEBUG( "TRT_TrgRIO_Maker::prepareRobRequests()" );
 
-    //Calculate ROBs needed - this code should be shared with hltExecute to avoid slightly different requests
     const TrigRoiDescriptor* roi = 0;
 
     if (getFeature(inputTE, roi) != HLT::OK || roi == 0){
@@ -542,15 +541,10 @@ namespace InDet{
       return HLT::NAV_ERROR;
     }
 
-    ATH_MSG_DEBUG( "REGTEST prepareROBs / event RoI ID " << roi->roiId()
-		   << " located at   phi = " << roi->phi()
-		   << ", eta = " << roi->eta() );
-
-    //const TrigRoiDescriptor fs(true);
+    ATH_MSG_DEBUG( "REGTEST prepareROBs / event RoI " << *roi);
 
     std::vector<unsigned int> uIntListOfRobs;
     m_regionSelector->DetROBIDListUint( TRT, *roi, uIntListOfRobs );
-    //m_regionSelector->DetROBIDListUint( TRT, fs, uIntListOfRobs );
 
     ATH_MSG_DEBUG( "list of pre-registered ROB ID in TRT: ");
     for(auto i : uIntListOfRobs)
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/CMakeLists.txt b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/CMakeLists.txt
index d311f19ebab3ab10f4a5632edd231a6102f2da4c..d849f68c2e86b405cd96c2df004d7cbdcb0c79bd 100644
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/CMakeLists.txt
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/CMakeLists.txt
@@ -19,6 +19,8 @@ atlas_depends_on_subdirs( PUBLIC
                           Tracking/TrkEvent/TrkParameters
                           Tracking/TrkEvent/TrkParticleBase
                           Tracking/TrkEvent/TrkTrack
+                          Tracking/TrkEvent/TrkTrackLink
+                          Tracking/TrkEvent/VxVertex
                           Event/xAOD/xAODTracking
                           Trigger/TrigEvent/TrigParticle )
 
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/InDetTrigPriVxFinder/TrigVxPrimary.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/InDetTrigPriVxFinder/TrigVxPrimary.h
index d7ea5c0b1914844e8bb35e9c317021ecb105c76d..c9e97d42b12083ec904b22d491e84d932682afd7 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/InDetTrigPriVxFinder/TrigVxPrimary.h
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/InDetTrigPriVxFinder/TrigVxPrimary.h
@@ -63,6 +63,8 @@ namespace InDet
     std::vector<float>   m_zOfPileUp;
     std::vector<float>   m_zOfNoVtx;
     bool                 m_runWithoutField;
+    bool                 m_useTracksAsInput;
+    bool                 m_createVtxTPLinks;
     
     ToolHandle< IVertexFinder > m_VertexFinderTool;
     ServiceHandle< MagField::IMagFieldSvc> m_fieldSvc;
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/src/TrigVxPrimary.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/src/TrigVxPrimary.cxx
index d77fd736c8238143ed00ebea0ed0a3fc511a781b..3a41f17b4d04e755d91c108c760767e935dd8e05 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/src/TrigVxPrimary.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPriVxFinder/src/TrigVxPrimary.cxx
@@ -22,6 +22,9 @@
 #include "TrkParameters/TrackParameters.h"
 #include "xAODTracking/VertexContainer.h"
 #include "xAODTracking/VertexAuxContainer.h"
+#include "VxVertex/VxTrackAtVertex.h"
+#include "TrkTrackLink/ITrackLink.h"
+#include "TrkTrack/LinkToTrack.h"
 
 #include "TrkEventPrimitives/ParamDefs.h"
 
@@ -37,6 +40,8 @@ namespace InDet
   TrigVxPrimary::TrigVxPrimary(const std::string &n, ISvcLocator *pSvcLoc)
     : HLT::FexAlgo(n, pSvcLoc),
       m_runWithoutField(false),
+      m_useTracksAsInput(false),
+      m_createVtxTPLinks(false),
       m_VertexFinderTool("InDet::InDetPriVxFinderTool/InDetTrigPriVxFinderTool"),
       m_fieldSvc("AtlasFieldSvc", n),
       m_BeamCondSvc("BeamCondSvc", n)
@@ -44,6 +49,8 @@ namespace InDet
     declareProperty("VertexFinderTool",m_VertexFinderTool);
     declareProperty("RunWithoutField", m_runWithoutField, "It may be unsafe to run vertexing w/o field on");
     declareProperty("BeamCondSvc", m_BeamCondSvc);
+    declareProperty("UseTracksAsInput", m_useTracksAsInput, "If TrackParticle exist, do not use tracks");
+    declareProperty("CreateVtxTrackParticleLinks", m_createVtxTPLinks);
 
     
     declareMonitoredVariable("numTracks", m_nTracks   );
@@ -59,33 +66,34 @@ namespace InDet
   //-------------------------------------------------------------------------
   HLT::ErrorCode TrigVxPrimary::hltInitialize() {
     
-    msg() << MSG::INFO << "TrigVxPrimary::initialize(). "<< endreq;
+    ATH_MSG_INFO("TrigVxPrimary::initialize(). ");
     
     /* Get the VertexFinderTool */
     if ( m_VertexFinderTool.retrieve().isFailure() ) {
-      msg() << MSG::FATAL << "Failed to retrieve tool " << m_VertexFinderTool << endreq;
+      ATH_MSG_FATAL("Failed to retrieve tool " << m_VertexFinderTool);
       return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
     }
     else{
-      msg() << MSG::INFO << "Retrieved tool " << m_VertexFinderTool << endreq;
+      ATH_MSG_INFO("Retrieved tool " << m_VertexFinderTool);
     }
     
     if (m_fieldSvc.retrieve().isFailure()){
-      msg() << MSG::FATAL << "Failed to retrieve tool " << m_fieldSvc << endreq;
+      ATH_MSG_FATAL("Failed to retrieve tool " << m_fieldSvc);
       return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
     } 
     else {
-      msg() << MSG::INFO << "Retrieved service " << m_fieldSvc << endreq;
+      ATH_MSG_INFO("Retrieved service " << m_fieldSvc);
     }
 
     if (m_BeamCondSvc.retrieve().isFailure()){
-      msg() << MSG::FATAL << "Failed to retrieve tool " << m_BeamCondSvc << endreq;
+      ATH_MSG_FATAL("Failed to retrieve tool " << m_BeamCondSvc);
       return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
     } 
     else {
-      msg() << MSG::INFO << "Retrieved service " << m_fieldSvc << endreq;
+      ATH_MSG_INFO("Retrieved service " << m_fieldSvc);
     }
 
+    ATH_MSG_INFO("UseTracksAsInput: " << m_useTracksAsInput << " CreateVtxTrackParticleLinks: " << m_createVtxTPLinks);
     return HLT::OK;
   }
 
@@ -102,75 +110,95 @@ namespace InDet
     m_zOfNoVtx.clear();
     bool runVtx(true);
     
-    int outputLevel = msgLvl();
     
-    if(outputLevel <= MSG::DEBUG)
-      msg() << MSG::DEBUG << " In execHLTAlgorithm()" << endreq;
+    ATH_MSG_DEBUG(" In execHLTAlgorithm()");
+
+    if (!m_runWithoutField && !m_fieldSvc->solenoidOn()){
+      ATH_MSG_DEBUG("Solenoid Off and RunWithoutField=False. Algorithm not executed!");
+      runVtx = false;
+    }
+
     
     //----------------------------------------------------------------------
-    // Trigger specific part: navigate throw the trigger element to get the
-    // input track collection.
+    // get input track/ trackparticle  collection.
     //----------------------------------------------------------------------
     
     const TrackCollection* trackTES=0;
-    
-    if ( HLT::OK != getFeature(outputTE, trackTES)) {
-      msg() << MSG::ERROR << "Input track collection could not be found " << endreq;
-      return HLT::NAV_ERROR;
-    } 
-   
-    if (!trackTES){
-      if(outputLevel <= MSG::DEBUG)
-	msg() << MSG::DEBUG
-	      << "Input tracks by getFeature NULL, a previous algo attached nothing?" << endreq;
-      runVtx = false;
-    }
-    else if(trackTES->size()==0){
-      if(outputLevel <= MSG::DEBUG)
-	msg() << MSG::DEBUG << " Input track collection has 0 size. Algorithm not executed!" << endreq;
-      runVtx = false;
-    }
+    if (m_useTracksAsInput){
 
-    if (!m_runWithoutField && !m_fieldSvc->solenoidOn()){
-      if(outputLevel <= MSG::DEBUG)
-	msg() << MSG::DEBUG << "Solenoid Off and RunWithoutField=False. Algorithm not executed!" << endreq;
-      runVtx = false;
-    }
+      if  (HLT::OK != getFeature(outputTE, trackTES)) {
+	ATH_MSG_ERROR("Input track collection could not be found ");
+	return HLT::NAV_ERROR;
+      } 
 
-    if (runVtx){
-      m_nTracks = trackTES->size();
-      if (outputLevel <= MSG::DEBUG)
-	msg() << MSG::DEBUG << "REGTEST: Retrieved input track collection with "
-	      << m_nTracks << " tracks. " << endreq;
+      if (!trackTES){
+	ATH_MSG_DEBUG("Input tracks by getFeature NULL, a previous algo attached nothing?");
+	runVtx = false;
+      }
+      else if(trackTES->size()==0){
+	ATH_MSG_DEBUG("Input track collection has 0 size. Algorithm not executed!");
+	runVtx = false;
+      }
       
-      //check whether measured perigees are available, if not vertexing crashes
-      for (int i=0; i<m_nTracks; i++){
-	const Trk::Perigee *mp = (trackTES->at(i)->perigeeParameters());
-	if (mp){
-	  if (std::isnan(mp->parameters()[Trk::d0])){
-	    if(outputLevel <= MSG::DEBUG)
-	      msg() << MSG::DEBUG
-		    << "Algorithm not executed as measured perigees are not valid" << endreq;
+      //this is probably not needed anymore / will remove in the next iteration
+      if (runVtx){
+	m_nTracks = trackTES->size();
+	ATH_MSG_DEBUG("REGTEST: Retrieved input track collection with "
+		      << m_nTracks << " tracks. ");
+	
+	//
+	for (int i=0; i<m_nTracks; i++){
+	  const Trk::Perigee *mp = (trackTES->at(i)->perigeeParameters());
+	  if (mp){
+	    if (std::isnan(mp->parameters()[Trk::d0])){
+	      ATH_MSG_WARNING("Algorithm not executed as measured track parameters are not valid");
+	      runVtx = false;
+	    }
+	  }
+	  else {
+	    ATH_MSG_WARNING("Algorithm not executed as measured perigees are empty");
 	    runVtx = false;
 	  }
 	}
-	else {
-	  if(outputLevel <= MSG::DEBUG)
-	    msg() << MSG::DEBUG
-		  << "Algorithm not executed as measured perigees are empty" << endreq;
-	  runVtx = false;
-	}
       }
     }
 
+    const xAOD::TrackParticleContainer *xTPCont = 0;
+    if (!m_useTracksAsInput || m_createVtxTPLinks) {
+      if ( HLT::OK != getFeature(outputTE, xTPCont)) {
+	ATH_MSG_ERROR("xAOD Track particle collection could not be found ");
+	return HLT::NAV_ERROR;
+      } 
+
+      if (!xTPCont){
+	ATH_MSG_DEBUG("Input track particles by getFeature NULL, a previous algo attached nothing?");
+	runVtx = false;
+      }
+      else if(xTPCont->size()==0){
+	ATH_MSG_DEBUG("Input track particles have 0 size. Algorithm not executed!");
+	runVtx = false;
+      }
+    }
+   
+
+
+    //
     // Create the xAOD container and its auxiliary store:
+
     xAOD::VertexContainer* theVxContainer = 0;
     xAOD::VertexAuxContainer* theVxAuxContainer = 0;
     std::pair<xAOD::VertexContainer*,xAOD::VertexAuxContainer*> theVxContainers
 	= std::make_pair( theVxContainer, theVxAuxContainer );
     
+    //
+    // Run the vertexing
+
     if (runVtx) {
-      theVxContainers = m_VertexFinderTool->findVertex(trackTES);
+      if (m_useTracksAsInput) {
+	theVxContainers = m_VertexFinderTool->findVertex(trackTES);
+      } else {
+	theVxContainers = m_VertexFinderTool->findVertex(xTPCont);
+      }
       theVxContainer = theVxContainers.first;
       theVxAuxContainer = theVxContainers.second;  // the vertex finder has already called setStore
     }
@@ -192,11 +220,43 @@ namespace InDet
 
     }
 
+
+
+    //
+    // Create links to TrackParticles if they are available but Trk::Tracks were used on input
+
+    if (m_useTracksAsInput && m_createVtxTPLinks){
+      if (trackTES->size() == xTPCont->size()){
+	auto itr = theVxContainer->begin();
+	auto end = theVxContainer->end();
+	for ( ; itr != end; itr++){
+	  std::vector<Trk::VxTrackAtVertex> trks = (*itr)->vxTrackAtVertex();
+	  size_t VTAVsize = trks.size();
+	  for (size_t i=0; i<VTAVsize; i++){
+	    Trk::ITrackLink*      trklink = trks[i].trackOrParticleLink();
+	    Trk::LinkToTrack* linkToTrackPB = dynamic_cast<Trk::LinkToTrack*>(trklink);  
+	    if (!linkToTrackPB) 
+	      {
+		ATH_MSG_DEBUG ("Cast of element link failed, skip this track !!!!!");
+	      } 
+	    else
+	      {
+		ElementLink<xAOD::TrackParticleContainer> newLink(*xTPCont, linkToTrackPB->index());
+		//Now set the newlink to the new xAOD vertex
+		(*itr)->addTrackAtVertex(newLink, trks[i].vtxCompatibility()); 
+	      } 
+	  }
+	}
+      } else {
+	ATH_MSG_WARNING("Inconsistent set of tracks and track particles, linking not done");
+      }
+    }
+
     //
     //  Attach resolved tracks to the trigger element.
     
     if ( HLT::OK !=  attachFeature(outputTE, theVxContainer, "xPrimVx") ) {
-      msg() << MSG::ERROR << "Could not attach feature to the TE" << endreq;
+      ATH_MSG_ERROR("Could not attach feature to the TE");
 
       delete theVxAuxContainer; theVxAuxContainer=0;
       return HLT::NAV_ERROR;
@@ -216,33 +276,28 @@ namespace InDet
 	const Amg::MatrixX& verr = mvtx->covariancePosition();
 	if (mvtx->vertexType()==xAOD::VxType::PriVtx){
 	  ++privtxcount;
-	  if(outputLevel <= MSG::DEBUG){
-	    msg() << MSG::DEBUG << "REGTEST " << privtxcount
-		  << std::setw(10)
-		  << " x=" << vtx.x() << "+/-" << Amg::error(verr, Trk::x)
-		  << " y=" << vtx.y() << "+/-" << Amg::error(verr, Trk::y)
-		  << " z=" << vtx.z() << "+/-" << Amg::error(verr, Trk::z)
-		  << endreq; 
-	  }
+	  ATH_MSG_DEBUG("REGTEST " << privtxcount
+			<< std::setw(10)
+			<< " x=" << vtx.x() << "+/-" << Amg::error(verr, Trk::x)
+			<< " y=" << vtx.y() << "+/-" << Amg::error(verr, Trk::y)
+			<< " z=" << vtx.z() << "+/-" << Amg::error(verr, Trk::z)); 
+	  
 	  m_zOfPriVtx.push_back(vtx.z());
 	}
 	else if (mvtx->vertexType()==xAOD::VxType::PileUp){
 	  ++pileupvtxcount;
-	  if(outputLevel <= MSG::DEBUG){
-	    msg() << MSG::DEBUG << "REGTEST " << pileupvtxcount
-		  << std::setw(10)
-		  << " x=" << vtx.x()
-	      	  << " y=" << vtx.y()
-		  << " z=" << vtx.z()
-		  << endreq; 
-	  }
+	  ATH_MSG_DEBUG("REGTEST " << pileupvtxcount
+			<< std::setw(10)
+			<< " x=" << vtx.x()
+			<< " y=" << vtx.y()
+			<< " z=" << vtx.z());
 	  m_zOfPileUp.push_back(vtx.z());
 	}
 	else if (mvtx->vertexType()==xAOD::VxType::NoVtx){
 	  m_zOfNoVtx.push_back(vtx.z());
 	}
       } else {
-	msg() << MSG::DEBUG << "Bad VxCandidate=" << iv << endreq;
+	ATH_MSG_DEBUG("Bad VxCandidate=" << iv);
       }
     }
     
@@ -253,7 +308,7 @@ namespace InDet
   //---------------------------------------------------------------------------
   HLT::ErrorCode TrigVxPrimary::hltFinalize() {
 
-    msg() << MSG::INFO << "TrigVxPrimary::finalize()" << endreq;
+    ATH_MSG_DEBUG("TrigVxPrimary::finalize()");
 
     return HLT::OK;
   }
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py
index 126b87738266135bb6bb61670152cfe4c2c99b99..fda325522c33f77f65e6f9db0e9870d4ab0e37c0 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py
@@ -122,11 +122,18 @@ class InDetHoleSearchTool(object) :
 
       @checkKWArgs
       def __init__(self, **kwargs) :
-          from AthenaCommon.AppMgr import ToolSvc
+          from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
+          # If InDetSCT_ConditionsSummarySvc instance configured by InDetRecConditionsAccess.py is available, use it.
+          # Otherwise, the default SCT_ConditionsSummarySvc instance is used.
+          # @TODO find a better to solution to get the correct service for the current job.
+          SctSummarySvc = "InDetSCT_ConditionsSummarySvc"
+          if not hasattr(ServiceMgr, SctSummarySvc):
+              SctSummarySvc = "SCT_ConditionsSummarySvc"
           from InDetRecExample.InDetJobProperties import InDetFlags
           super(InDetHoleSearchTool.PhysValMonInDetHoleSearchTool,self).__init__(**_args( kwargs,
                                                                                                  name         = self.__class__.__name__,
                                                                                                  Extrapolator = ToolSvc.InDetExtrapolator,
+                                                                                                 SctSummarySvc = SctSummarySvc,
                                                                                                  usePixel     = True,
                                                                                                  useSCT       = True,
                                                                                                  checkBadSCTChip = InDetFlags.checkDeadElementsOnTrack(),
diff --git a/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx b/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx
index 63a1ad8838ff154bd01f4cf66f25212db02d2462..b9e57c9f2234bec18aed06e152941c2711e05fe6 100644
--- a/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx
+++ b/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx
@@ -60,7 +60,9 @@ LArNoisyROTool::LArNoisyROTool( const std::string& type,
 	                                              961052672, // EMBA FT 9 Slot 2
   	                                              961839104, // EMBA FT 10 Slot 10
 	                                              961970176, // EMBA FT 10 Slot 14
-	                                              972980224  // EMBA FT 31 Slot 14
+	                                              972980224,  // EMBA FT 31 Slot 14
+	961445888, // EMBA FT 9 Slot 14 - added August 1st 2017
+	944144384  // EMBC FT 8 Slot 14 - added August 1st 2017
 	                                             });
 
   declareProperty( "MNBLooseCut",m_MNBLooseCut=5,"Number of cells above CellQualityCut");
diff --git a/MagneticField/MagFieldServices/src/AtlasFieldSvc.cxx b/MagneticField/MagFieldServices/src/AtlasFieldSvc.cxx
index 3f3c615b3264bfcb289e2fb71151ff767f33e4a5..6be9894bb548d9950be1c12ab7cd340ce93790ef 100644
--- a/MagneticField/MagFieldServices/src/AtlasFieldSvc.cxx
+++ b/MagneticField/MagFieldServices/src/AtlasFieldSvc.cxx
@@ -447,10 +447,6 @@ void MagField::AtlasFieldSvc::getField(const double *xyz, double *bxyz, double *
       bxyz[0] = bxyz[1] = bxyz[2] = defaultB;
       // return zero gradient if requested
       if ( deriv ) for ( int i = 0; i < 9; i++ ) deriv[i] = 0.;
-      // check NaN in input
-      if ( x!=x || y!=y || z!=z ) {
-        ATH_MSG_WARNING( "getFieldStandard was called for xyz = " << x << "," << y << "," << z );
-      }
       return;
     }
   }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MdtIntersectGeometry.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MdtIntersectGeometry.cxx
index d84adedebcc8107dc433a867da5fda14955b6e92..cabbdea8f10cca2845d3226b1a1fe3c0ed52bb02 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MdtIntersectGeometry.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MdtIntersectGeometry.cxx
@@ -244,9 +244,10 @@ namespace Muon{
       for(int layer = 1; layer <= mydetEl->getNLayers(); layer++){
          for(int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++){
             bool tubefound = false;
-            for(unsigned int kk=0; kk < cv->getNChildVols(); kk++) {
-               int tubegeo = cv->getIdOfChildVol(kk) % 100;
-               int layergeo = ( cv->getIdOfChildVol(kk) - tubegeo ) / 100;
+            for(int kk=0; kk < nGrandchildren; kk++) {
+               auto idOfChildVol = cv->getIdOfChildVol(kk);
+               int tubegeo = idOfChildVol % 100;
+               int layergeo = ( idOfChildVol - tubegeo ) / 100;
                if( tubegeo == tube && layergeo == layer ) {
                  tubefound=true;
                  break;
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt
index 3a749655c9a2767a84e8fecc7d6ba7e9f58e7c5f..26af9264cec31d1564d4aa126a63f187dd6c433d 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/CMakeLists.txt
@@ -5,73 +5,79 @@
 # Declare the package name:
 atlas_subdir( PileupReweighting )
 
+# Extra dependencies based on the environment:
+set( extra_dep )
+if( XAOD_STANDALONE )
+   set( extra_dep PhysicsAnalysis/AnalysisCommon/ReweightUtils )
+else()
+   set( extra_Dep GaudiKernel Control/AthenaBaseComps )
+endif()
+
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthToolSupport/AsgTools
-                          DataQuality/GoodRunsLists
-                          Event/xAOD/xAODEventInfo
-                          GaudiKernel
-                          PhysicsAnalysis/AnalysisCommon/PATInterfaces
-                          PRIVATE
-                          AtlasTest/TestTools
-                          Control/AthenaBaseComps
-                          Tools/PathResolver )
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   PhysicsAnalyis/Interfaces/AsgAnalysisInterfaces
+   Trigger/TrigEvent/TrigDecisionInterface
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces
+   DataQuality/GoodRunsLists
+   PRIVATE
+   Event/xAOD/xAODEventInfo
+   Tools/PathResolver
+   ${extra_dep} )
 
 # External dependencies:
-find_package( ROOT COMPONENTS MathCore RIO Cint Core Tree Hist pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
-
-# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake
+find_package( ROOT COMPONENTS MathCore RIO Core Tree Hist )
 
-# tag ROOTCintexLibs was not recognized in automatic conversion in cmt2cmake
+# Libraries in the package:
+atlas_add_root_dictionary( PileupReweightingLib PileupReweightingDictSource
+   ROOT_HEADERS PileupReweighting/TPileupReweighting.h Root/LinkDef.h
+   EXTERNAL_PACKAGES ROOT )
 
-# Component(s) in the package:
-atlas_add_root_dictionary( PileupReweightingLib
-                           PileupReweightingLibDictSource
-                           ROOT_HEADERS PileupReweighting/TPileupReweighting.h Root/LinkDef.h
-                           EXTERNAL_PACKAGES ROOT )
+set( extra_libs )
+if( XAOD_STANDALONE )
+   set( extra_libs ReweightUtilsLib )
+endif()
 
 atlas_add_library( PileupReweightingLib
-                   Root/*.cxx
-                   ${PileupReweightingLibDictSource}
-                   PUBLIC_HEADERS PileupReweighting
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AsgTools xAODEventInfo GaudiKernel PATInterfaces GoodRunsListsLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthenaBaseComps PathResolver )
+   PileupReweighting/*.h Root/*.cxx ${PileupReweightingDictSource}
+   PUBLIC_HEADERS PileupReweighting
+   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES AsgTools PATInterfaces AsgAnalysisInterfaces
+   TrigDecisionInterface GoodRunsListsLib
+   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} PathResolver ${extra_libs} )
 
-atlas_add_component( PileupReweighting
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( PileupReweighting
+      src/components/*.cxx
+      LINK_LIBRARIES AsgAnalysisInterfaces AthenaBaseComps xAODEventInfo
+      PATInterfaces GaudiKernel PileupReweightingLib )
+endif()
 
 atlas_add_dictionary( PileupReweightingDict
-                      PileupReweighting/PileupReweightingDict.h
-                      PileupReweighting/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
+   PileupReweighting/PileupReweightingDict.h
+   PileupReweighting/selection.xml
+   LINK_LIBRARIES PileupReweightingLib )
 
-atlas_add_executable( testPRW
-                      src/testPRW.C
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
+# Executable(s) in the package:
+macro( _add_exec name )
+   atlas_add_executable( ${name}
+      src/${name}.C
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} PileupReweightingLib )
+endmacro( _add_exec )
 
-atlas_add_executable( testPRWTool
-                      src/testPRWTool.C
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
-
-atlas_add_executable( checkPRWConfigFile
-                      src/checkPRWConfigFile.C
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
+_add_exec( testPRW )
+_add_exec( testPRWTool )
+_add_exec( checkPRWConfigFile )
 
+# Test(s) in the package:
 atlas_add_test( ut_PRWExample_test
-                SOURCES
-                test/ut_PRWExample_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools GoodRunsListsLib xAODEventInfo GaudiKernel PATInterfaces TestTools AthenaBaseComps PathResolver PileupReweightingLib )
+   SOURCES test/ut_PRWExample_test.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} PileupReweightingLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
 atlas_install_data( share/*.root )
-
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/IPileupReweightingTool.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/IPileupReweightingTool.h
index f67613f6c0f3ca35088bd2c0a7897cff3f440370..f810f25df1fc3cccd076a65722361f7b5d81a652 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/IPileupReweightingTool.h
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/IPileupReweightingTool.h
@@ -3,120 +3,6 @@
 */
 
 
-///ASG PileupReweightingTool interface
-///author: will@cern.ch
-#ifndef PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
-#define PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
+#warning Please use AsgAnalysisInterfaces/IPileupReweightingTool.h
 
-#include "AsgTools/IAsgTool.h"
-#include "TString.h"
-#include "xAODEventInfo/EventInfo.h"
-
-#include "PATInterfaces/ISystematicsTool.h"
-#include "GoodRunsLists/IGoodRunsListSelectionTool.h"
-
-
-
-class TH1;
-
-namespace CP {
-class TPileupReweighting;
-
-   class IPileupReweightingTool : virtual public CP::ISystematicsTool
-{
-
-      ASG_TOOL_INTERFACE( CP::IPileupReweightingTool )
-
-      public:
-
-
-         /// Return combined pileup weight
-         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo ) = 0;
-
-         /// Same as above, but for a 'custom weight' variable
-         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo,Double_t x, Double_t y=0. ) = 0;
-
-         /// get combined weight (i.e. pileup weight) but with a 1./dataWeight factor applied, this if used for 'prescaling' MC
-         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo , const TString& trigger, bool mu_dependent=true ) = 0;
-
-         /// When using UnrepresentedDataAction=2, you may want to apply this additional weight to ensure sum of weights are preserved
-         virtual float getUnrepresentedDataWeight( const xAOD::EventInfo& eventInfo ) = 0;
-
-         /// Get the dataWeight used to 'unprescale' data collected from a given trigger combination. mu_dependency is recommended to be true
-         virtual float getDataWeight( const xAOD::EventInfo& eventInfo, const TString& trigger, bool mu_dependent=true ) = 0;
-
-         /// Get a random run number for this MC event, mu_dependency is recommended ... jetetmiss seem to like it muchly
-         virtual int getRandomRunNumber( const xAOD::EventInfo& eventInfo , bool mu_dependent=true) = 0;
-
-         /// Get the corrected average mu of a lumiblock ... (averaging is over all filled BCID in the fill)
-         /// The additional flag indicates if the returned value should include the data scale factor or not.
-         /// Note: if the lumiblock is not present in the input lumicalc file, then -1.0 will be returned
-         /// This method will soon be deprecated in favour of the new naming: getCorrectedAverageInteractionsPerCrossing
-         virtual float getCorrectedMu( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) {
-            return getCorrectedAverageInteractionsPerCrossing( eventInfo, includedDataScaleFactor );
-         }
-         virtual float getCorrectedAverageInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
-         
-         /// Get the actual mu of a lumiblock ... (BCID-specific mu)
-         /// The additional flag indicates if the returned value should include the data scale factor or not.
-         /// Note: if the lumiblock is not present in the input lumicalc file, then -1.0 will be returned
-         virtual float getCorrectedActualInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
-         
-         /// Get the integrated lumi of a lumiblock (in pb-1)
-         virtual double getLumiBlockIntegratedLumi( const xAOD::EventInfo& eventInfo ) = 0;
-
-         /// Decorates with: 
-         /// MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]), RandomRunNumber, RandomLumiBlockNumber, PRWHash
-         /// Data: corrected_averageInteractionsPerCrossing
-         /// mu_dependent says if the mu_dependency should be used for random run numbers or the data weights. You will get random run numbers of 0 for events with zero pileup weight
-         virtual StatusCode apply ( const xAOD::EventInfo& eventInfo, bool mu_dependent=true ) = 0;
-
-
-         /// return the prw hash used for fast updates of weights at the post-processing level ... see the share/makeWeightTree.C script for usage
-         virtual ULong64_t getPRWHash( const xAOD::EventInfo& eventInfo ) = 0;
-
-         // methods that go straight to the underlying pileup tool 
-
-         /// Get a random lumiblock number for the given run number 
-         virtual UInt_t GetRandomLumiBlockNumber(UInt_t runNumber) = 0;
-
-         /// possible alternative to using the EventBookkeepers info ... assuming you made your PRW Config file!!
-         virtual Double_t GetSumOfEventWeights(Int_t channel) = 0;
-         virtual Double_t GetNumberOfEvents(Int_t channel) = 0;
-
-         /// Get the integrated luminosity (in pb-1) between start and end run (inclusive)
-         virtual Double_t GetIntegratedLumi(UInt_t start, UInt_t end) = 0;
-         /// Total lumi (in pb-1) for a given trigger combination .. leave blank for the unprescaled
-         virtual Double_t GetIntegratedLumi(const TString& trigger="") = 0;
-         /** similar to above, but for only the given mcRunNumber/periodNumber */
-         virtual Double_t GetIntegratedLumi(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
-         /** return fraction of lumi assigned to periodNumber (or mcRunNumber) that is between start and end data run numbers*/
-         virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
-         /** return fraction of lumi assigned to periodNumber (or mcRunNumber) with given mu, that is between start and end data run numbers*/
-         virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, Double_t mu, UInt_t start, UInt_t end) = 0;
-
-
-         /// use these methods when generating config files 
-         virtual Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
-         virtual Int_t SetBinning(Int_t nbinsx, Double_t* xbins, Int_t nbinsy=0, Double_t* ybins=0) = 0;
-         virtual Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0) = 0;
-         virtual Int_t SetBinning(TH1* hist) = 0;
-
-         /// Call this method once per event when in config file generating mode and you want standard mu reweighting
-         virtual int fill( const xAOD::EventInfo& eventInfo ) = 0;
-
-         /// Use this method if you want to do a generic reweighting instead
-         virtual int fill( const xAOD::EventInfo& eventInfo, Double_t x, Double_t y=0.) = 0;
-
-
-         /// Get pointer to the underlying tool - expert use only:  Will require #include "PileupReweighting/TPileupReweighting.h"
-         virtual CP::TPileupReweighting* expert() = 0;
-
-
-   };
-
-}
-
-
-
-#endif
\ No newline at end of file
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingDict.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingDict.h
index 7802e348cbdd054724e0fd8a453b16e484c3932a..f83d558833bd09ce3739f7614a9c0b13e4c303b5 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingDict.h
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingDict.h
@@ -6,7 +6,7 @@
 #define PILEUPREWEIGHTINGDICT_H
 
 #include "PileupReweighting/PileupReweightingTool.h"
-#include "PileupReweighting/IPileupReweightingTool.h"
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
 
 #ifdef XAOD_ANALYSIS
 #include "AsgTools/AnaToolHandle.h"
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingTool.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingTool.h
index abc956ce29c726e3e1fe89ce9898f87d8ad78b1b..c87c6e31b63585aa9bcc054df203153198ad77bd 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingTool.h
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/PileupReweightingTool.h
@@ -9,15 +9,16 @@
 // Framework include(s):
 #include "AsgTools/AsgTool.h"
 
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
 
 // Local include(s):
-#include "PileupReweighting/IPileupReweightingTool.h"
+
 #include "PileupReweighting/TPileupReweighting.h"
 
 #include "AsgTools/ToolHandle.h"
 #include "PATInterfaces/IWeightTool.h"
 
-
+#include "TrigDecisionInterface/ITrigDecisionTool.h"
 
 namespace CP {
 
@@ -127,6 +128,7 @@ namespace CP {
 
    protected:
       virtual bool runLbnOK(Int_t runNbr, Int_t lbn);
+      virtual bool passTriggerBeforePrescale(const TString& trigger) const;
 
    private:
       std::string m_configStream;
@@ -150,6 +152,7 @@ namespace CP {
 
       ToolHandle<IWeightTool> m_weightTool;
       ToolHandle<IGoodRunsListSelectionTool> m_grlTool;
+      ToolHandle<Trig::ITrigDecisionTool> m_tdt;
 
       // MN:  this prevents ROOT dict generator from complaining about lack of ClassDef()
       // Note: inheriting from TObject and not having ClassDef makes this class unsuitable for I/O
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/TPileupReweighting.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/TPileupReweighting.h
index 6787f166faa9374718b7ab6a6c4d5ea44bb38e97..7438cf7bf0a0759e13b6e6a414e51024b4951d56 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/TPileupReweighting.h
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/TPileupReweighting.h
@@ -35,6 +35,7 @@
 #include <iostream>
 #include <stdexcept>
 
+#include "TH1.h"
 
 
 class TH1;
@@ -59,7 +60,7 @@ namespace CP {
   public:
 
       /** use a hardcoded period configuration */
-      Int_t UsePeriodConfig(const TString configName);
+      Int_t UsePeriodConfig(const TString& configName);
       /** Add a histogram binning config. To modify the pileup histo binning, use "pileup" as name */
       Int_t SetBinning(Int_t nbinsx, Double_t* xbins, Int_t nbinsy=0, Double_t* ybins=0);
       Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0);
@@ -162,9 +163,9 @@ namespace CP {
       //-----------------------------------------------------
       //Methods to load config files
       //-----------------------------------------------------
-      Int_t AddConfigFile(const TString fileName);
-      Int_t AddLumiCalcFile(const TString fileName, const TString trigger="None");
-      Int_t AddMetaDataFile(const TString fileName,const TString channelBranchName="mc_channel_number");
+      Int_t AddConfigFile(const TString& fileName);
+      Int_t AddLumiCalcFile(const TString& fileName, const TString& trigger="None");
+      Int_t AddMetaDataFile(const TString& fileName,const TString& channelBranchName="mc_channel_number");
 
       /** Removes a channel from the inputs ... this is for experts only */
       Bool_t RemoveChannel(int chanNum);
@@ -186,7 +187,7 @@ namespace CP {
       //-----------------------------------------------------
       //Methods to work with the metadata
       //-----------------------------------------------------
-      Double_t GetMetaData(const TString metadataName,Int_t channelNumber) {
+      Double_t GetMetaData(const TString& metadataName,Int_t channelNumber) {
          if(m_metadata.find(metadataName)==m_metadata.end()) {
             Error("GetMetaData","Metadata %s not known",metadataName.Data());
             return 0;
@@ -199,14 +200,14 @@ namespace CP {
       }
       /** combines loaded metadata with channel sumsofweights and entry counts */
       TTree* GetMetaDataTree(); 
-      Int_t GenerateMetaDataFile(const TString fileName,const TString channelBranchName="mc_channel_number");
+      Int_t GenerateMetaDataFile(const TString& fileName,const TString& channelBranchName="mc_channel_number");
 
 
       //-----------------------------------------------------
       //Methods to generate config files
       //-----------------------------------------------------
       Int_t Fill(Int_t runNumber,Int_t channelNumber,Float_t w,Float_t x, Float_t y=0.);
-      Int_t WriteToFile(const TString filename=""); //if no name given, will use tool name
+      Int_t WriteToFile(const TString& filename=""); //if no name given, will use tool name
       Int_t WriteToFile(TFile* outFile);
 
 
@@ -259,22 +260,29 @@ namespace CP {
          return m_periods[periodNumber]->primaryHists[channelNumber];
       }
 
-      TH1D* GetPrimaryTriggerDistribution(const TString trigger, Int_t periodNumber) {
-         if(m_periods.find(periodNumber)==m_periods.end()||
-            m_periods[periodNumber]->triggerHists.find(trigger)==m_periods[periodNumber]->triggerHists.end()) {
-            return 0;
-         }
-         return m_periods[periodNumber]->triggerHists[trigger];
+      TH1D* GetPrimaryTriggerDistribution(const TString& trigger, Int_t periodNumber, long triggerBits)  {
+         if(m_triggerObjs.find(trigger)==m_triggerObjs.end() || m_triggerObjs[trigger]->triggerHists.find(periodNumber) ==m_triggerObjs[trigger]->triggerHists.end() ||
+            m_triggerObjs[trigger]->triggerHists[periodNumber].find(triggerBits) == m_triggerObjs[trigger]->triggerHists[periodNumber].end()) return 0;
+      /*
+         if(m_triggerObjs.find(trigger)==m_triggerObjs.end() || m_triggerObjs.at(trigger).second->triggerHists.find(periodNumber)==m_triggerObjs.at(trigger).second->->triggerHists.end() ||
+            m_triggerObjs.at(trigger).second->triggerHists.at(periodNumber).find(triggerBits) == m_triggerObjs.at(trigger).second.at(periodNumber).end()) return 0;
+      */
+         
+         return m_triggerObjs[trigger]->triggerHists[periodNumber][triggerBits];
       }
 
       /** Method for weighting data to account for prescales and mu bias. Use by giving the tool multiple lumicalc files, one for each trigger */
-      Double_t GetDataWeight(Int_t runNumber, TString trigger, Double_t x);
-      Double_t GetDataWeight(Int_t runNumber, TString trigger);//version without mu dependence
+      Double_t GetDataWeight(Int_t runNumber, const TString& trigger, Double_t x);
+      Double_t GetDataWeight(Int_t runNumber, const TString& trigger);//version without mu dependence
+
+    /** Method for prescaling MC to account for prescales in data */
+      Double_t GetPrescaleWeight(Int_t runNumber, const TString& trigger, Double_t x);
+      Double_t GetPrescaleWeight(Int_t runNumber, const TString& trigger);//version without mu dependence
 
 
       // other methods 
       Bool_t IsInitialized() { return m_isInitialized; }
-
+// 
       Int_t AddDistribution(TH1* hist, Int_t runNumber, Int_t channelNumber);
 
       /** This method is DEFINITELY EXPERT USE ONLY. Used in the checkPRWConfigFile utitlity */
@@ -285,8 +293,22 @@ namespace CP {
 
       Float_t GetDataScaleFactor() const { return m_dataScaleFactorX; }
 
+      void SetTriggerBit(const TString& trigger, bool in=true) { m_triggerPassBits[trigger]=in; }
+      void ResetTriggerBits() { m_triggerPassBits.clear(); }
+
+      double GetRunAverageMu(int run) { return m_runs[run].inputHists["None"]->GetMean(); }
+
   protected:
       virtual bool runLbnOK(Int_t /*runNbr*/, Int_t /*lbn*/) { return true; } //override in the ASG tool
+      virtual bool passTriggerBeforePrescale(const TString& trigger) const { 
+        if(m_triggerPassBits.size()==0) return true;
+        try {
+          return m_triggerPassBits.at(trigger); 
+        } catch(...) { return true; }
+      } //override in the ASG tool
+      std::map<TString, bool> m_triggerPassBits;
+      
+      
       Int_t GetNearestGoodBin(Int_t thisMCRunNumber, Int_t bin);
       Int_t IsBadBin(Int_t thisMCRunNumber, Int_t bin);
 
@@ -297,7 +319,7 @@ namespace CP {
       void AddDistributionTree(TTree *tree, TFile *file);
       //*Int_t FactorizeDistribution(TH1* hist, const TString weightName, Int_t channelNumber, Int_t periodNumber,bool includeInMCRun,bool includeInGlobal);
 
-      void CalculatePrescaledLuminosityHistograms(const TString trigger);
+      void CalculatePrescaledLuminosityHistograms(const TString& trigger);
 
       //********** Private members*************************
       TPileupReweighting* m_parentTool; //points to self if not a 'systematic varion' tool instance
@@ -313,6 +335,7 @@ namespace CP {
       TTree *m_metadatatree;
       Double_t m_unrepDataTolerance;
       Bool_t m_doGlobalDataWeight; //used in GetDataWeight to flag mu-independent version
+      Bool_t m_doPrescaleWeight = false;
       Int_t m_lumicalcRunNumberOffset; //used for 'faking' a lumicalc file for run2
 
       /** map storing the lumicalc file locations - used when building DataPileupWeights */
@@ -332,19 +355,21 @@ namespace CP {
       /** channel metadata map */
       std::map<TString, std::map<Int_t, Double_t> > m_metadata; 
 
-
+public:
       struct CompositeTrigger {
          int op;
          CompositeTrigger* trig1;
          CompositeTrigger* trig2;
          TString val;
+         std::vector<TString> subTriggers; //only set for top-level object
          CompositeTrigger() : op(0),trig1(0),trig2(0),val("") { }
          ~CompositeTrigger() { if(trig1) delete trig1; if(trig2) delete trig2; }
-         double eval(std::map<TString, std::map<Int_t, std::map<Int_t, Float_t> > >& m, int run, int lbn) {
+         double eval(std::map<TString, std::map<Int_t, std::map<Int_t, Float_t> > >& m, int run, int lbn, const TPileupReweighting* tool) {
             switch(op) {
-               case 0: if(m[val][run].find(lbn)==m[val][run].end() || !m[val][run][lbn]) return 0; /*trigger disabled, so cannot contribute*/   return 1./m[val][run][lbn];
-               case 1: return 1. - (1. - trig1->eval(m,run,lbn))*(1.-trig2->eval(m,run,lbn)); //OR
-               case 2: return trig1->eval(m,run,lbn)*trig2->eval(m,run,lbn);
+               case 0: if(m[val][run].find(lbn)==m[val][run].end() || !m[val][run][lbn] || !tool->passTriggerBeforePrescale(val)) return 0; /*trigger/failed disabled, so cannot contribute*/   
+                        return 1./m[val][run][lbn];
+               case 1: return 1. - (1. - trig1->eval(m,run,lbn,tool))*(1.-trig2->eval(m,run,lbn,tool)); //OR
+               case 2: return trig1->eval(m,run,lbn,tool)*trig2->eval(m,run,lbn,tool);
                default: return 1;
             }
          }
@@ -352,12 +377,22 @@ namespace CP {
             if(trig1==0&&trig2==0&&val.Length()>0) s.push_back(val);
             else { trig1->getTriggers(s); trig2->getTriggers(s); }
          }
+         
+         long getBits(const TPileupReweighting* tool) {
+          long out(0);
+          for(uint i=0;i<subTriggers.size();i++) out += (tool->passTriggerBeforePrescale(subTriggers[i]) << i);
+          return out;
+         }
+         
+         std::map<int, std::map<long, TH1D*> > triggerHists; //unnormalized ... i.e. integral should be equal to the lumi! ... indexed by PeriodID,tbits
+         
       };
+protected:
 
+      std::map<TString, CompositeTrigger*> m_triggerObjs; //map from trigger string to composite trigger object
 
-      
-
-      CompositeTrigger* makeTrigger(TString s);
+      CompositeTrigger* makeTrigger(const TString& s);
+      void calculateHistograms(CompositeTrigger* trigger);
 
 public:
       inline void PrintPeriods() { for(auto p : m_periods) {std::cout << p.first << " -> "; p.second->print("");} }
@@ -376,7 +411,7 @@ public:
          std::map<Int_t, Int_t> numberOfEntries;
          std::map<Int_t, TH1D*> primaryHists; //normalized histograms, indexed by channelNumber. -1 holds the data
          std::map<Int_t, TH2D*> secondaryHists; //semi-normalized histograms, only used in 2D reweighting
-         std::map<TString, TH1D*> triggerHists; //unnormalized ... i.e. integral should be equal to the lumi! ... should really only be filled in the channel=-1 case (i.e. data)
+         //std::map<TString, TH1D*> triggerHists; //unnormalized ... i.e. integral should be equal to the lumi! ... should really only be filled in the channel=-1 case (i.e. data)
          bool contains(unsigned int runNumber) {
             if(runNumber >= start && runNumber <= end) return true;
             for(auto p : subPeriods) if(p->contains(runNumber)) return true;
@@ -414,7 +449,11 @@ protected:
       TRandom3 *m_random3;
 
       Bool_t m_ignoreBadChannels; //if true, will print a warning about any channels with too much unrepresented data, but will then just ignore them
+      Bool_t m_useMultiPeriods = true; //if true, will allow for runDependentMC 
 
+    //these two numbers are used in the auto-configurations, e.g. "Run2" .. fills additional periods
+    int m_autoRunStart = 0;
+    int m_autoRunEnd = 0;
       
 public:
       //this method is a convenience for copying over properties to the tools that are used for systematic variations
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/selection.xml b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/selection.xml
index 8d5b7ce44f0a44506b040a2f1f0376bfe960d249..3c9af526f6e08572a859ef31efaad2e9530c3a94 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/selection.xml
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/PileupReweighting/selection.xml
@@ -1,6 +1,5 @@
- <lcgdict>      
-      <namespace name="CP"/>
-        <class name="CP::PileupReweightingTool" />
-        <class name="CP::IPileupReweightingTool" />
-      <class name="asg::AnaToolHandle<CP::IPileupReweightingTool>" />
-</lcgdict> 
\ No newline at end of file
+<lcgdict>      
+  <namespace name="CP"/>
+  <class name="CP::PileupReweightingTool" />
+  <class name="asg::AnaToolHandle<CP::IPileupReweightingTool>" />
+</lcgdict> 
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/PileupReweightingTool.cxx b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/PileupReweightingTool.cxx
index 497ded7048f69301d37cfe5ca2ce9436636a3767..7c8a6f6c90a2949ff5461b575279d7269f470023 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/PileupReweightingTool.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/PileupReweightingTool.cxx
@@ -31,7 +31,9 @@ PileupReweightingTool::PileupReweightingTool( const std::string& name ) :CP::TPi
    m_activeTool(this), 
    m_noWeightsMode(false), 
    m_weightTool("McEventWeight/myWeightTool"),
-   m_grlTool("") {
+   m_grlTool(""), m_tdt("") {
+
+   m_defaultChannel=0;
 
 #ifndef XAOD_STANDALONE
    declareProperty("ConfigOutputStream", m_configStream="", "When creating PRW config files, this is the THistSvc stream it goes into. If blank, it wont write this way");
@@ -43,18 +45,15 @@ PileupReweightingTool::PileupReweightingTool( const std::string& name ) :CP::TPi
    declareProperty("Prefix",m_prefix="","Prefix to attach to all decorations ... only used in the 'apply' method");
    declareProperty("UnrepresentedDataAction",m_unrepresentedDataAction=3,"1 = remove unrepresented data, 2 = leave it there, 3 = reassign it to nearest represented bin");
    declareProperty("UnrepresentedDataThreshold",m_unrepDataTolerance=0.05,"When unrepresented data is above this level, will require the PRW config file to be repaired");
-   declareProperty("DataScaleFactor",m_dataScaleFactorX=1./1.16);
-   declareProperty("DefaultChannel",m_defaultChannel=0); //when channel info not present in config file, use this channel instead
+   declareProperty("UseMultiPeriods",m_useMultiPeriods=false,"If true, will try to treat each mc runNumber in a single mc dataset (channel) as a modelling a distinct period of data taking");
+   declareProperty("DataScaleFactor",m_dataScaleFactorX=1./1.09);
    declareProperty("UsePeriodConfig",m_usePeriodConfig="auto","Use this period configuration when in config generating mode. Set to 'auto' to auto-detect");
-
    declareProperty("IgnoreBadChannels",m_ignoreBadChannels=true,"If true, will ignore channels with too much unrepresented data, printing a warning for them");
-
    declareProperty("DataScaleFactorUP",m_upVariation=1./1.,"Set to a value representing the 'up' fluctuation - will report a PRW_DATASF uncertainty to Systematic Registry");
-   declareProperty("DataScaleFactorDOWN",m_downVariation=1./1.23,"Set to a value representing the 'down' fluctuation - will report a PRW_DATASF uncertainty to Systematic Registry");
-
-   //REMOVED ... obsolete declareProperty("LumiCalcRunNumberOffset",m_lumicalcRunNumberOffset=0,"Use to 'fake' a Run2 lumicalc file. Suggest using a value of 22000 to do this from an 8TeV lumicalc file");
-
+   declareProperty("DataScaleFactorDOWN",m_downVariation=1./1.18,"Set to a value representing the 'down' fluctuation - will report a PRW_DATASF uncertainty to Systematic Registry");
+   
    declareProperty("GRLTool", m_grlTool, "If you provide a GoodRunsListSelectionTool, any information from lumicalc files will be automatically filtered" );
+   declareProperty("TrigDecisionTool",m_tdt, "When using the getDataWeight method, the TDT will be used to check decisions before prescale. Alternatively do expert()->SetTriggerBit('trigger',0) to flag which triggers are not fired before prescale (assumed triggers are fired if not specified)");
 
 #ifdef XAOD_STANDALONE
    declareProperty( "WeightTool", m_weightTool = new McEventWeight("myWeightTool"),"The tool to compute the weight in the sumOfWeights");
@@ -90,6 +89,15 @@ bool PileupReweightingTool::runLbnOK(Int_t runNbr, Int_t lbn) {
    return m_grlTool->passRunLB(runNbr,lbn);
 }
 
+bool PileupReweightingTool::passTriggerBeforePrescale(const TString& trigger) const {
+  if(m_tdt.empty()) return TPileupReweighting::passTriggerBeforePrescale(trigger); 
+  ATH_MSG_VERBOSE("Checking tdt decision of " << trigger);
+  //Note that the trigger *must* be a rerun trigger if this result is to be valid ... could check this in the trigconf is absolutely necessary
+  //but for now we just assume it's a rerun
+  //if it's not rerun, all we will get back here is the TAP result
+  return m_tdt->isPassed( trigger.Data() , 37 /*physics|allowRessurectedDecision*/ ); //FIXME: need Trigger people to move Condition.h to interface package!
+}
+
 bool PileupReweightingTool::isAffectedBySystematic( const CP::SystematicVariation& systematic ) const {
    CP::SystematicSet sys = affectingSystematics(); return sys.find( systematic ) != sys.end();
 }
@@ -378,6 +386,7 @@ int PileupReweightingTool::fill( const xAOD::EventInfo& eventInfo, Double_t x, D
             case 222222: UsePeriodConfig("MC14_13TeV");break;
             case 222510: case 222525: case 222526: case 284500: UsePeriodConfig("MC15"); break;
          }
+	 if(eventInfo.runNumber()>284500) UsePeriodConfig("Run2"); //this is the automatic period config, allows any run numbers to be added
       }
       m_doneConfigs[eventInfo.runNumber()] = true;
    }
@@ -394,7 +403,7 @@ StatusCode PileupReweightingTool::apply(const xAOD::EventInfo& eventInfo, bool m
    }
 
    if(!eventInfo.eventType(xAOD::EventInfo::IS_SIMULATION)) {
-      eventInfo.auxdecor<float>(m_prefix+"corrected_averageInteractionsPerCrossing") = getCorrectedMu(eventInfo,false);
+      eventInfo.auxdecor<float>(m_prefix+"corrected_averageInteractionsPerCrossing") = getCorrectedAverageInteractionsPerCrossing(eventInfo,false);
       return StatusCode::SUCCESS;
    }
 
@@ -408,7 +417,8 @@ StatusCode PileupReweightingTool::apply(const xAOD::EventInfo& eventInfo, bool m
       eventInfo.auxdecor<float>(m_prefix+"PileupWeight") = weight;
    }
    //decorate with random run number etc
-   eventInfo.auxdecor<unsigned int>(m_prefix+"RandomRunNumber") = /*m_tool->*/getRandomRunNumber( eventInfo, mu_dependent );
+   unsigned int rrn = getRandomRunNumber( eventInfo, mu_dependent );
+   eventInfo.auxdecor<unsigned int>(m_prefix+"RandomRunNumber") = (rrn==0) ? getRandomRunNumber(eventInfo, false) : rrn;
    eventInfo.auxdecor<unsigned int>(m_prefix+"RandomLumiBlockNumber") = (eventInfo.auxdecor<unsigned int>(m_prefix+"RandomRunNumber")==0) ? 0 : /*m_tool->*/GetRandomLumiBlockNumber(  eventInfo.auxdecor<unsigned int>(m_prefix+"RandomRunNumber")  );
 
    eventInfo.auxdecor<ULong64_t>(m_prefix+"PRWHash") = getPRWHash( eventInfo );
@@ -426,16 +436,25 @@ float PileupReweightingTool::getDataWeight(const xAOD::EventInfo& eventInfo, con
    }
 
    if(!mu_dependent) return /*m_tool->*/m_activeTool->GetDataWeight(eventInfo.runNumber(), trigger);
-   return /*m_tool->*/m_activeTool->GetDataWeight( eventInfo.runNumber(), trigger, getCorrectedMu(eventInfo,false) /*use the 'correct' mu instead of the one from the file!!*/ );
+   
+   double correctedMu = getCorrectedAverageInteractionsPerCrossing(eventInfo,false);
+   if(correctedMu<0) {
+      ATH_MSG_ERROR("Unrecognised run+lumiblock number (" << eventInfo.runNumber() << "," << eventInfo.lumiBlock() << ") ... please ensure your lumicalc files are complete! Returning 1.");
+      return 1;
+   }
+   
+   return /*m_tool->*/m_activeTool->GetDataWeight( eventInfo.runNumber(), trigger,  correctedMu/*use the 'correct' mu instead of the one from the file!!*/ );
 
 }
 
 float PileupReweightingTool::getCombinedWeight( const xAOD::EventInfo& eventInfo , const TString& trigger, bool mu_dependent ) {
    float out = getCombinedWeight(eventInfo);
+   if(!out) return out; //don't try to evaluate DataWeight if our PRW is 0 ... means there is no data available at that mu anyway
+
    //need to use the random run number ... only used to pick the subperiod, but in run2 so far we only have one subperiod
    unsigned int randomRunNum = (eventInfo.isAvailable<unsigned int>(m_prefix+"RandomRunNumber")) ? eventInfo.auxdataConst<unsigned int>(m_prefix+"RandomRunNumber") : getRandomRunNumber( eventInfo, mu_dependent );
-   if(!mu_dependent) out /= m_activeTool->GetDataWeight(randomRunNum, trigger);
-   out /= m_activeTool->GetDataWeight( randomRunNum, trigger, getCorrectedMu(eventInfo,false) /*use the 'correct' mu instead of the one from the file!!*/ );
+   if(!mu_dependent) out *= m_activeTool->GetPrescaleWeight(randomRunNum, trigger);
+   out *= m_activeTool->GetPrescaleWeight( randomRunNum, trigger, getCorrectedAverageInteractionsPerCrossing(eventInfo,false) /*use the 'correct' mu instead of the one from the file!!*/ );
    return out;
 }
 
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/TPileupReweighting.cxx b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/TPileupReweighting.cxx
index b8f968ed574180d362e66c756084297698d092c9..0ed0e4bd37c24789de3c83a833875d1d8ca63d19 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/TPileupReweighting.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/Root/TPileupReweighting.cxx
@@ -125,13 +125,15 @@ Double_t CP::TPileupReweighting::GetIntegratedLumi(const TString& trigger) {
    }
    if(trigger=="" || trigger=="None") return GetSumOfEventWeights(-1)/1E6; 
    //check the triggerPrimaryDistributions in the global period, if not present, build it
-   Period* global = m_periods[-1];
-   if(global->triggerHists.find(trigger)==global->triggerHists.end()) {
-      //try to do a subtrigger calculation we need to reopen all the lumicalc files and do the fiddily prescaled luminosity calculation
-      //will throw errors if can't
+   //Period* global = m_periods[-1];
+   
+   if(m_triggerObjs.find(trigger)==m_triggerObjs.end()) {
       CalculatePrescaledLuminosityHistograms(trigger);
    }
-   return global->triggerHists[trigger]->Integral(0,global->triggerHists[trigger]->GetNbinsX()+1)/1E6;
+   
+   auto h = m_triggerObjs[trigger]->triggerHists[-1][m_triggerObjs[trigger]->getBits(this)];
+   
+   return h->Integral(0,h->GetNbinsX()+1)/1E6;
 }
 
 
@@ -190,8 +192,11 @@ Double_t CP::TPileupReweighting::GetIntegratedLumiFraction(Int_t periodNumber, D
    //determine the mubin
    if(!m_emptyHistogram) { Error("GetIntegratedLumiFraction", "Cannot do this without a lumicalc file!"); return 0; }
    Int_t muBin = m_emptyHistogram->FindFixBin(mu);
-   //the total mu in this bin in this period is given by the triggerHist = "None" hist 
-   double total = m_periods[periodNumber]->triggerHists["None"]->GetBinContent(muBin);
+   //the total mu in this bin in this period is given by the triggerHist = "None" hist
+    
+   
+    
+   double total = m_triggerObjs["None"]->triggerHists[periodNumber][0]->GetBinContent(muBin); //m_periods[periodNumber]->triggerHists["None"]->GetBinContent(muBin);
    //loop over assigned runs, if in range then include in numerator 
    double numer = 0;
    for(auto run : m_periods[periodNumber]->runNumbers) {
@@ -203,7 +208,7 @@ Double_t CP::TPileupReweighting::GetIntegratedLumiFraction(Int_t periodNumber, D
 
 
 
-Int_t CP::TPileupReweighting::UsePeriodConfig(const TString configName) {
+Int_t CP::TPileupReweighting::UsePeriodConfig(const TString& configName) {
    if(configName=="MC11a") {
       AddPeriod(180164, 177986,180481); //associates mc runnumber 180164 with data period 177986 to 180481 (period B-D)
       AddPeriod(183003, 180614,184169); //period E-H
@@ -285,6 +290,7 @@ Int_t CP::TPileupReweighting::UsePeriodConfig(const TString configName) {
       AddPeriod(222525,222222,999999);
       AddPeriod(222526,222222,999999);
       AddPeriod(284500,222222,999999);
+      AddPeriod(295000,222222,999999); //mc15c for pPb data in 2016
       if(m_emptyHistogram && (m_emptyHistogram->GetNbinsX()!=100 || fabs(m_emptyHistogram->GetXaxis()->GetBinLowEdge(1))>0.01 || fabs(m_emptyHistogram->GetXaxis()->GetBinUpEdge(100)-100.)>0.01) ) {
          Error("UsePeriodConfig","Cannot use MC15, an incompatible config has already been set up");
          throw std::runtime_error("Throwing 13: Cannot use MC15, an incompatible config has already been set up");
@@ -293,6 +299,15 @@ Int_t CP::TPileupReweighting::UsePeriodConfig(const TString configName) {
       SetUniformBinning(100,0,100); //Thanks Eric </sarcasm>
       Info("UsePeriodConfig","Using MC15 Period configuration");
       return 0;
+   } else if(configName=="Run2") {
+     m_autoRunStart = 222222; m_autoRunEnd = 999999; //periods will be automatically added during Fill
+     if(m_emptyHistogram && (m_emptyHistogram->GetNbinsX()!=100 || fabs(m_emptyHistogram->GetXaxis()->GetBinLowEdge(1))>0.01 || fabs(m_emptyHistogram->GetXaxis()->GetBinUpEdge(100)-100.)>0.01) ) {
+         Error("UsePeriodConfig","Cannot use open Run2, an incompatible config has already been set up");
+         throw std::runtime_error("Throwing 13: Cannot use Run2 config, an incompatible config has already been set up");
+         return -1;
+      }
+      SetUniformBinning(100,0,100); //Thanks Eric </sarcasm>
+      Info("UsePeriodConfig","Using Run2 Period configuration, which assumes period assignment of 222222 to 999999");
    }
    Error("UsePeriodConfig","Unrecognized period config");
    return -1;
@@ -385,7 +400,7 @@ TH1* CP::TPileupReweighting::CloneEmptyHistogram(Int_t runNumber, Int_t channelN
 
 }
 
-Int_t CP::TPileupReweighting::GenerateMetaDataFile(const TString fileName,const TString channelBranchName) {
+Int_t CP::TPileupReweighting::GenerateMetaDataFile(const TString& fileName,const TString& channelBranchName) {
 
    TTree inTree("in","in");
    inTree.ReadFile(fileName);
@@ -429,7 +444,7 @@ Int_t CP::TPileupReweighting::GenerateMetaDataFile(const TString fileName,const
       return 0;
 }
 
-Int_t CP::TPileupReweighting::AddMetaDataFile(const TString fileName,const TString channelBranchName) {
+Int_t CP::TPileupReweighting::AddMetaDataFile(const TString& fileName,const TString& channelBranchName) {
    TDirectory* origDir = gDirectory;
    TTree* tmp = 0;
    TFile* rootFile = 0;
@@ -649,6 +664,8 @@ void CP::TPileupReweighting::AddDistributionTree(TTree *tree, TFile *file) {
 //data is signalled by a negative channel number
 Int_t CP::TPileupReweighting::AddDistribution(TH1* hist,Int_t runNumber, Int_t channelNumber) {
 
+  //NOTE: should probably just ignore histograms with 0 entries
+
    if(m_isInitialized) {
       Error("AddDistribution","You cannot AddDistribution after initializing the tool. Reorder your code!");
       throw std::runtime_error("Throwing 5: You cannot AddLumiCalcFile after initializing the tool. Reorder your code!");
@@ -658,6 +675,21 @@ Int_t CP::TPileupReweighting::AddDistribution(TH1* hist,Int_t runNumber, Int_t c
       Error("AddDistribution","Unrecognised periodNumber: %d .. please use AddPeriod to define a period",runNumber);
       throw std::runtime_error("Throwing 6: Unrecognised periodNumber. Please use AddPeriod to define a period");
    }
+   
+   if(!m_useMultiPeriods && runNumber>=0) {
+      //not allowing multi periods in a single channel, so before we go any further, require no periods other than this incoming one to have a hist defined for this channel
+      //the global one can though
+      for(auto& period : m_periods) {
+        if(period.first<0) continue; //global sum period
+        if(period.first==runNumber) continue; //ok to add to this
+        if(period.second->inputHists.find(channelNumber)!=period.second->inputHists.end()) {
+          TString myMsg = TString::Format("Attempt to add distribution for channel %d to period %d, but this channels already has period %d defined.\nThis is indicative of use of incompatible PRW config files, please check your config files for multiple periods/runNumbers for the same channel.",channelNumber,runNumber,period.first);
+          Error("AddDistribution",myMsg);
+          throw std::runtime_error(myMsg.Data());
+        }
+      }
+   }
+   
 
    TH1*& inputHist = (channelNumber<0) ? m_runs[runNumber].inputHists["None"] : m_periods[runNumber]->inputHists[channelNumber];
 
@@ -722,7 +754,7 @@ Int_t CP::TPileupReweighting::AddDistribution(TH1* hist,Int_t runNumber, Int_t c
 } 
 
 
-Int_t CP::TPileupReweighting::AddLumiCalcFile(const TString fileName, const TString trigger) {
+Int_t CP::TPileupReweighting::AddLumiCalcFile(const TString& fileName, const TString& trigger) {
 
    if(m_isInitialized) {
       Error("AddLumiCalcFile","You cannot AddLumiCalcFile after initializing the tool. Reorder your code!");
@@ -798,7 +830,7 @@ Int_t CP::TPileupReweighting::AddLumiCalcFile(const TString fileName, const TStr
    return 0;
 }
 
-Int_t CP::TPileupReweighting::AddConfigFile(const TString fileName) {
+Int_t CP::TPileupReweighting::AddConfigFile(const TString& fileName) {
 
    //open the file and look for config TTrees 
    //recognised TTrees are: ChannelMetaData, MCPileupReweighting, MCCustomReweighting, DataCustomReweighting
@@ -1001,6 +1033,9 @@ Int_t CP::TPileupReweighting::Initialize() {
    }
 
 
+   //need a CompositeTrigger to hold the unprescaled lumi hists ...
+   m_triggerObjs["None"] = new CompositeTrigger;
+
    //go through all periods, use inputHists to populate the primary and secondary dists, and fill sumOfWeights and numberOfEntries
    for(auto period : m_periods) {
       if(period.first != period.second->id) continue; //skips remappings 
@@ -1070,7 +1105,8 @@ Int_t CP::TPileupReweighting::Initialize() {
          if( hist->GetDimension()==1 ) {
               if(!period.second->primaryHists[-1] )  {
                   period.second->primaryHists[-1] = dynamic_cast<TH1D*>(CloneEmptyHistogram(period.first,-1));
-                  period.second->triggerHists["None"] = dynamic_cast<TH1D*>(CloneEmptyHistogram(period.first,-1)); //this will remain unnormalized, unlike the 'primaryHist'
+                  //period.second->triggerHists["None"] = dynamic_cast<TH1D*>(CloneEmptyHistogram(period.first,-1)); //this will remain unnormalized, unlike the 'primaryHist'
+                  m_triggerObjs["None"]->triggerHists[period.second->id][0] = dynamic_cast<TH1D*>(CloneEmptyHistogram(period.first,-1)); //this will remain unnormalized, unlike the 'primaryHist'
                }
          }
          else if( hist->GetDimension()==2 ) {
@@ -1078,8 +1114,10 @@ Int_t CP::TPileupReweighting::Initialize() {
                period.second->secondaryHists[-1] =  dynamic_cast<TH2D*>(CloneEmptyHistogram(period.first,-1));
                period.second->primaryHists[-1] = period.second->secondaryHists[-1]->ProjectionX(); period.second->primaryHists[-1]->SetDirectory(0);
                period.second->primaryHists[-1]->Reset();
-               period.second->triggerHists["None"] = static_cast<TH1D*>(period.second->primaryHists[-1]->Clone("triggerHist"));
-               period.second->triggerHists["None"]->SetDirectory(0);
+               //period.second->triggerHists["None"] = static_cast<TH1D*>(period.second->primaryHists[-1]->Clone("triggerHist"));
+               //period.second->triggerHists["None"]->SetDirectory(0);
+               m_triggerObjs["None"]->triggerHists[period.second->id][0] = static_cast<TH1D*>(period.second->primaryHists[-1]->Clone("triggerHist"));
+               m_triggerObjs["None"]->triggerHists[period.second->id][0]->SetDirectory(0);
             }
             
          }
@@ -1101,12 +1139,12 @@ Int_t CP::TPileupReweighting::Initialize() {
          if(period.first!=-1) covered=true; //don't count the global period
          if(hist->GetDimension()==1) {
             period.second->primaryHists[-1]->Add(hist);
-            period.second->triggerHists["None"]->Add(hist);
+            m_triggerObjs["None"]->triggerHists[period.second->id][0]->Add(hist);//period.second->triggerHists["None"]->Add(hist);
          } else if(hist->GetDimension()==2) {
             period.second->secondaryHists[-1]->Add(hist);
             TH1* proj = ((TH2*)hist)->ProjectionX();
             period.second->primaryHists[-1]->Add(proj);
-            period.second->triggerHists["None"]->Add(proj);
+            m_triggerObjs["None"]->triggerHists[period.second->id][0]->Add(proj);//period.second->triggerHists["None"]->Add(proj);
             delete proj;
          }
          period.second->sumOfWeights[-1] += hist->GetSumOfWeights();
@@ -1505,7 +1543,7 @@ Float_t CP::TPileupReweighting::GetSecondaryWeight(Int_t periodNumber, Int_t cha
    return l/n;
 }
 
-Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, TString trigger) {
+Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, const TString& trigger) {
    //special mu-independent version of GetDataWeight. Will just use the global luminosity
    m_doGlobalDataWeight=true;
    double out = GetDataWeight(runNumber, trigger, 0);
@@ -1513,13 +1551,13 @@ Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, TString trigger)
    return out;
 }
 
-Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, TString trigger, Double_t x) {
+Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, const TString& trigger, Double_t x) {
 
    if(!m_isInitialized) { Info("GetDataWeight","Initializing the subtool.."); Initialize(); }
    if(m_countingMode) return 0.;
    if(m_countingMode) {
-      Error("GetDataWeight","You cannot get a weight when in config file generating mode. Please use FillWeight method");
-      throw std::runtime_error("GetDataWeight: You cannot get a weight when in config file generating mode. Please use FillWeight method");
+      Error("GetDataWeight","You cannot get a weight when in config file generating mode. Please use Fill method");
+      throw std::runtime_error("GetDataWeight: You cannot get a weight when in config file generating mode. Please use Fill method");
    }
    //determine which period this run number is in
    Int_t periodNumber = GetFirstFoundPeriodNumber(runNumber);
@@ -1531,19 +1569,48 @@ Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, TString trigger,
    }
 
    //see if we already made this trigger hist 
+   auto tobj = m_triggerObjs.find(trigger);
    
 
-   if(p->triggerHists.find(trigger)==p->triggerHists.end()) {
+   if(tobj==m_triggerObjs.end()) {
       //try to do a subtrigger calculation we need to reopen all the lumicalc files and do the fiddily prescaled luminosity calculation
       //will throw errors if can't
       CalculatePrescaledLuminosityHistograms(trigger);
+      tobj = m_triggerObjs.find(trigger);
    }
-   TH1D* denomHist = p->triggerHists[trigger];
-   if(denomHist==0) {
-      Error("GetDataWeight","Could not find trigger %s in period %d",trigger.Data(),p->id);
-      throw std::runtime_error("GetDataWeight: Could not find trigger");
+   
+   //check 
+
+   
+   if(tobj->second->triggerHists.find(p->id) == tobj->second->triggerHists.end()) {
+    Error("GetDataWeight","Could not find trigger %s in period %d",trigger.Data(),p->id);
+    throw std::runtime_error("GetDataWeight: Could not find trigger 1");
+   }
+   
+      
+   //now we need to evaluate the trigger bits, and if necessary calculate the new trigger hist for the new bits combination
+   long tbits = tobj->second->getBits(this);
+   
+   if(tbits==0) return 1; //no trigger passed
+   
+   auto dItr = tobj->second->triggerHists[p->id].find(tbits);
+   
+   TH1D* denomHist = 0;
+   if(dItr == tobj->second->triggerHists[p->id].end()) {
+      //possible that the tbits for this event have not been encountered before, so just redo the calculation ...
+      calculateHistograms(tobj->second);
+   
+      denomHist = tobj->second->triggerHists[p->id][tbits];
+      if(denomHist==0) {
+        Error("GetDataWeight","Could not find trigger %s in period %d with bits %ld",trigger.Data(),p->id, tbits);
+        throw std::runtime_error("GetDataWeight: Could not find trigger 2");
+      }
+   } else {
+    denomHist = dItr->second;
    }
-   TH1D* numerHist = p->triggerHists["None"];
+
+   
+   TH1D* numerHist = m_triggerObjs["None"]->triggerHists[p->id][0];
    if(numerHist==0) {
       Error("GetDataWeight","Could not find unprescaled trigger in period %d",p->id);
       throw std::runtime_error("GetDataWeight: Could not find unprescaled trigger. Please AddLumiCalc with a 'None' trigger");
@@ -1552,10 +1619,36 @@ Double_t CP::TPileupReweighting::GetDataWeight(Int_t runNumber, TString trigger,
    if(m_doGlobalDataWeight) return numerHist->Integral(0,numerHist->GetNbinsX()+1)/denomHist->Integral(0,denomHist->GetNbinsX()+1);
 
    Int_t bin=numerHist->FindFixBin(x*m_dataScaleFactorX); //MUST SCALE BY THE DATA SCALE FACTOR!
+   
+   if(!denomHist->GetBinContent(bin)) {
+     if(m_doPrescaleWeight) return -1; //happens if trigger was disabled/unavailable for that mu, even though that mu is in the dataset
+      Error("GetDataWeight","Unrecognised mu value %f ... are you sure you included all lumicalc files",x);
+      throw std::runtime_error("GetDataWeight: Unrecognised mu value. Please AddLumiCalc enough lumi with 'None' trigger");
+   }
+   
    return numerHist->GetBinContent(bin)/denomHist->GetBinContent(bin);
+}
+
+
+Double_t CP::TPileupReweighting::GetPrescaleWeight(Int_t runNumber, const TString& trigger) {
+   //special mu-independent version of GetPrescaleWeight. Will just use the global luminosity
+   m_doGlobalDataWeight=true;
+   double out = GetPrescaleWeight(runNumber, trigger, 0);
+   m_doGlobalDataWeight=false;
+   return out;
+}
+
+Double_t CP::TPileupReweighting::GetPrescaleWeight(Int_t runNumber, const TString& trigger, Double_t x) {
+
+  m_doPrescaleWeight = true;
+  double out = GetDataWeight(runNumber,trigger,x);
+  m_doPrescaleWeight = false;
+  if(out<=0) return 0; //happens when triggers disabled/unavailable for a given mu ... therefore the prescale weight is 0
+  return 1./out;
 
 }
 
+
 //fills the appropriate inputHistograms
 Int_t CP::TPileupReweighting::Fill(Int_t runNumber,Int_t channelNumber,Float_t w,Float_t x, Float_t y) {
    if(!m_isInitialized) { Info("Fill","Initializing the subtool.."); Initialize(); }
@@ -1566,8 +1659,14 @@ Int_t CP::TPileupReweighting::Fill(Int_t runNumber,Int_t channelNumber,Float_t w
    //get the period if mc, get the data run if data 
    if(channelNumber>=0) {
       if(m_periods.find(runNumber)==m_periods.end()) {
-         Error("Fill","Unrecognised runNumber: %d.  Check your period configuration (AddPeriod or UsePeriodConfig)",runNumber);
-         throw std::runtime_error("Throwing 1: Unrecognised periodNumber");
+	//if assume default binning is true, will add binning from 0 to 100 for this run number
+	if(m_autoRunStart || m_autoRunEnd) {
+	  AddPeriod(runNumber,m_autoRunStart,m_autoRunEnd);
+	}
+	 if(m_periods.find(runNumber)==m_periods.end()) {
+	   Error("Fill","Unrecognised runNumber: %d.  Check your period configuration (AddPeriod or UsePeriodConfig)",runNumber);
+	   throw std::runtime_error("Throwing 1: Unrecognised periodNumber");
+	 }
       }
       Period* p = m_periods[runNumber];
       if(!p) {
@@ -1598,7 +1697,7 @@ Int_t CP::TPileupReweighting::Fill(Int_t runNumber,Int_t channelNumber,Float_t w
    return -1;
 }
 
-Int_t CP::TPileupReweighting::WriteToFile(const TString fname) {
+Int_t CP::TPileupReweighting::WriteToFile(const TString& fname) {
    
    if(!m_countingMode) {Warning("WriteToFile","Not in counting mode, so no file will be written");return 0;}
 
@@ -1786,7 +1885,7 @@ Int_t CP::TPileupReweighting::Merge(TCollection *coll) {
 }
 
 
-void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TString trigger) {
+void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TString& trigger) {
    //check if this is a composite trigger (user has provided OR of triggers that are passed before prescale)
    
    TString triggerCopy = trigger; triggerCopy.ReplaceAll(" ",""); triggerCopy.ReplaceAll("&&","&");triggerCopy.ReplaceAll("||","|");
@@ -1800,6 +1899,19 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
 
    t->getTriggers(subTriggers); //fills the vector
 
+   t->subTriggers = subTriggers; //cache the vector of triggers
+   
+   calculateHistograms(t);
+   
+   //save trigger object
+   m_triggerObjs[trigger] = t;
+
+}
+
+void CP::TPileupReweighting::calculateHistograms(CompositeTrigger* t) {
+   
+   //now we need the trigger bits for this trigger for this event
+   long tbits = t->getBits(this);
    //1. Open all the lumicalc files
    //2. For each entry in the 'None' lumicalc file, lookup the run and lb in the subTriggers, and get the prescales (if not found, assume trigger not in, prescale=infinity)
    //3. perform calculation of lumi as: Lumi*(1 - Prod_triggers(1-1/prescale)) .. sum this up into the output histogram
@@ -1810,7 +1922,7 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
    std::map<TString, std::map<Int_t, std::map<Int_t, Float_t> > > prescaleByRunAndLbn;
 
    //Load the prescales for each lumicalc subTrigger 
-   for(std::vector<TString>::iterator it = subTriggers.begin();it!=subTriggers.end();++it) {
+   for(std::vector<TString>::iterator it = t->subTriggers.begin();it!=t->subTriggers.end();++it) {
       //Info("aa","subtrigger %s Int lumi is %f", it->Data(), m_triggerPrimaryDistributions[*it][1]->Integral());
       for(auto& fileName : m_lumicalcFiles[*it]) {
         TFile* rootFile = TFile::Open( fileName, "READ" );
@@ -1845,7 +1957,8 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
                 b_runNbr->GetEntry(i);b_L1Presc->GetEntry(i);b_L2Presc->GetEntry(i);b_L3Presc->GetEntry(i);b_lbn->GetEntry(i);
                 runNbr += m_lumicalcRunNumberOffset;
                 //save the prescale by run and lbn 
-                //if(runNbr==215643) Info("...","prescale in [%d,%d] = %f %f %f", runNbr,lbn,ps1,ps2,ps3);
+                //if(runNbr==215643) 
+                if(m_debugging) Info("...","prescale in [%d,%d] = %f %f %f", runNbr,lbn,ps1,ps2,ps3);
                 if(ps1>0&&ps2>0&&ps3>0) prescaleByRunAndLbn[*it][runNbr][lbn] = ps1*ps2*ps3;
               }
           }
@@ -1881,6 +1994,7 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
               Error("CalculatePrescaledLuminosityHistograms","Could not find LBStart branch in Data TTree");throw std::runtime_error("Could not find LBStart branch in Data TTree");
           }
           long nEntries = tmp->GetEntries();
+          //this loop ends up calling the triggerBeforePrescale method each time, but this should hopefully stop once the loading is done
           for(long i=0;i<nEntries;i++) {
               b_runNbr->GetEntry(i);b_intLumi->GetEntry(i);b_mu->GetEntry(i);
               b_lbn->GetEntry(i);
@@ -1896,8 +2010,8 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
               }
               pFactor = 1. - pFactor;
   */
-  
-              double pFactor = t->eval(prescaleByRunAndLbn,runNbr,lbn);
+              
+              double pFactor = t->eval(prescaleByRunAndLbn,runNbr,lbn,this);
   
               //Info("...","prescale in [%d,%d] = %f", runNbr,lbn,1./pFactor);
   
@@ -1907,15 +2021,19 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
               for(auto p : m_periods) {
                 if(p.first != p.second->id) continue; //skips remappings 
                 if(!p.second->contains(runNbr)) continue;
-                std::map<TString,TH1D*>& triggerHists = p.second->triggerHists;
-                if(triggerHists.find(trigger) == triggerHists.end()) {
-                    triggerHists[trigger] = dynamic_cast<TH1D*>(CloneEmptyHistogram(p.first,-1));
-                    if(m_debugging) Info("CalculatePrescaledLuminosityHistograms","Created Data Weight Histogram for [%s,%d]",trigger.Data(),p.first);
+                
+                
+                
+                
+                std::map<long,TH1D*>& triggerHists = t->triggerHists[p.second->id];
+                if(triggerHists.find(tbits) == triggerHists.end()) {
+                    triggerHists[tbits] = dynamic_cast<TH1D*>(CloneEmptyHistogram(p.first,-1));
+                    if(m_debugging) Info("CalculatePrescaledLuminosityHistograms","Created Data Weight Histogram for [%s,%d,%ld]",t->val.Data(),p.first, tbits);
                 }
                   //check if we were about to fill a bad bin ... if we are, we either skipp the fill (unrep action=1) or redirect (unrep action=3)
                 if( (m_unrepresentedDataAction==1) && p.second->inputBinRedirect[bin]!=bin) { } //do nothing
-                else if( m_unrepresentedDataAction==3 ) {triggerHists[trigger]->Fill(triggerHists[trigger]->GetBinCenter(p.second->inputBinRedirect[bin]), intLumi*pFactor);}
-                else triggerHists[trigger]->Fill(mu*m_dataScaleFactorX,intLumi*pFactor);
+                else if( m_unrepresentedDataAction==3 ) {triggerHists[tbits]->Fill(triggerHists[tbits]->GetBinCenter(p.second->inputBinRedirect[bin]), intLumi*pFactor);}
+                else triggerHists[tbits]->Fill(mu*m_dataScaleFactorX,intLumi*pFactor);
                 
               }
           }
@@ -1923,7 +2041,7 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
     }
     delete rootFile;
    } //end loop over unprescaled lumicalc files
-   delete t;
+   
 
    //Info("aa","Int lumi is %f", m_triggerPrimaryDistributions[trigger][1]->Integral());
 
@@ -1935,7 +2053,7 @@ void CP::TPileupReweighting::CalculatePrescaledLuminosityHistograms(const TStrin
 
 }
 
-CP::TPileupReweighting::CompositeTrigger* CP::TPileupReweighting::makeTrigger(TString s) {
+CP::TPileupReweighting::CompositeTrigger* CP::TPileupReweighting::makeTrigger(const TString& s) {
    if(m_debugging) Info("makeTrigger","Doing %s",s.Data());
    //find the first operand
    TString oper1; CompositeTrigger* cOper1 = 0;
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/debugExample.C b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/debugExample.C
new file mode 100644
index 0000000000000000000000000000000000000000..d2357d0013874b2477ed2458b13f3a933f615dc6
--- /dev/null
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/debugExample.C
@@ -0,0 +1,37 @@
+//This is an example ROOT macro for running PRW
+//If you want me to help you debug a problem, please 
+//copy this macro and modify it so that it reproduces your issue
+//please locate all the input files on public (afs) space
+
+//execute with: root debugExample.C
+
+#define GAUDI_V20_COMPAT
+#include "GaudiKernel/ToolHandle.h"
+
+void debugExample() {
+  
+  POOL::TEvent evt(POOL::TEvent::kClassAccess);
+
+  evt.readFrom("$ASG_TEST_FILE_MC"); //replace with your input file
+
+  ToolHandle<CP::IPileupReweightingTool> prw("CP::PileupReweightingTool/tool");
+
+  //update the following two lines to point to your config and lumicalc files
+  //(if they are not in the calib area)
+  AAH::setProperty( prw, "ConfigFiles" , "['dev/PileupReweighting/mc15c_v2_defaults.NotRecommended.prw.root']");
+  AAH::setProperty( prw, "LumiCalcFiles" , "['GoodRunsLists/data15_13TeV/20160720/physics_25ns_20.7.lumicalc.OflLumi-13TeV-005.root','GoodRunsLists/data16_13TeV/20170215/physics_25ns_20.7.lumicalc.OflLumi-13TeV-008.root']");
+
+  prw.retrieve(); //initializes the tool
+
+
+  evt.getEntry(0); //update to go to the problematic event;
+
+  const xAOD::EventInfo_v1* ei = 0;
+  evt.retrieve( ei );
+
+  prw->getCombinedWeight( *ei ); //change this to reproduce your problem
+		   
+  
+
+
+}
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/generatePRW_jobOptions.py b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/generatePRW_jobOptions.py
index f3ef8a0f74225a203a53ad6feb9ea9f4ec821aee..0d36542a935fb6c9e3e233ac2f7a3d0e7c1185b1 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/generatePRW_jobOptions.py
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/share/generatePRW_jobOptions.py
@@ -5,7 +5,7 @@ theApp.EvtMax=-1                                         #says how many events t
 import AthenaRootComps.ReadAthenaxAODHybrid
 svcMgr.EventSelector.AccessMode=1 #use class access mode ... I know it's wrong, but it should be ok just for the EventInfo information
 from glob import glob
-svcMgr.EventSelector.InputCollections=glob( vars().get("FILES",os.environ['ROOTCORE_TEST_FILE']).strip() )
+svcMgr.EventSelector.InputCollections=glob( vars().get("FILES",os.environ['ASG_TEST_FILE_MC']).strip() )
 
 if len(svcMgr.EventSelector.InputCollections)==0:
    print("WARNING  >>>>>>>>>>  generatePRW_jobOptions.py:   NO INPUT FILES PROVIDED/FOUND FROM: %s ... this will produce a failure unless you are sending this job to the grid <<<<<<<<<<<<" % vars().get("FILES","/afs/cern.ch/atlas/project/PAT/xAODs/r5591/mc14_8TeV.117050.PowhegPythia_P2011C_ttbar.recon.AOD.e1727_s1933_s1911_r5591/AOD.01494882._111853.pool.root.1").strip())
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h
index 3f063cc4d95830f6b29bb91fbe80be02121ffc88..7be829d5e557d3ee965efb08df305eb07e8dfd46 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/PileupReweightingProvider.h
@@ -5,7 +5,7 @@
 #ifndef PILEUPREWEIGHTINGPROVIDER
 #define PILEUPREWEIGHTINGPROVIDER
 
-#include "PileupReweighting/IPileupReweightingTool.h"
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRW.C b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRW.C
index 81f897fb2d63dc85b3a91b1f849bb725adf7acd6..2490efc3c22b25dc40ee7671de68b32d6ef0e7ce 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRW.C
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRW.C
@@ -124,7 +124,17 @@ int main() {
 
    //now check the dataweight .. remember the runNumber is converted into a periodNumber (i.e. the weights aren't unique to a runNumber, they are unique to the periodNumber)
    std::cout << "prw TriggerA DataWeights (mu independent): " << prw1.GetDataWeight(1,"TriggerA") << " (expected=2.63415) " << prw1.GetDataWeight(2,"TriggerA") << " (expected=2.63415) " << prw1.GetDataWeight(3,"TriggerA") << " (expected=3.2727)" << std::endl;
-   std::cout << "prw TriggerA DataWeights (mu dependent): " << prw1.GetDataWeight(1,"TriggerA",0.5) << " (expected=2) " << prw1.GetDataWeight(1,"TriggerA",1.5) << " (expected=3) " << prw1.GetDataWeight(2,"TriggerA",1.5) << " (expected=3.0000) " << prw1.GetDataWeight(3,"TriggerA",1.5) << " (expected=4) " << prw1.GetDataWeight(3,"TriggerA",2.5) << " (expected=2) " << prw1.GetDataWeight(3,"TriggerA",3.5) << " (expected=nan) " << std::endl;
+   std::cout << "prw TriggerA DataWeights (mu dependent): " << prw1.GetDataWeight(1,"TriggerA",0.5) << " (expected=2) " << prw1.GetDataWeight(1,"TriggerA",1.5) << " (expected=3) " << prw1.GetDataWeight(2,"TriggerA",1.5) << " (expected=3.0000) " << prw1.GetDataWeight(3,"TriggerA",1.5) << " (expected=4) " << prw1.GetDataWeight(3,"TriggerA",2.5) << " (expected=2) " << std::endl;
+    
+    
+   //check that doing a weight for mu value that is out of range throws exception
+   try {
+      prw1.GetDataWeight(3,"TriggerA",3.5);
+   } catch(...) {
+     std::cout << "exception thrown as expected for mu value out of range in GetDataWeight" << std::endl;
+   }
+   
+   
    testValue(prw1.GetDataWeight(1,"TriggerA"),2.63415);
    testValue(prw1.GetDataWeight(2,"TriggerA"),2.63415);
    testValue(prw1.GetDataWeight(3,"TriggerA"),3.2727);
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C
index 5a6853a2c33770e2f7242527fa22570ae8e28381..856074f06b8648f52b7b9eb77615b0c2453d465a 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/src/testPRWTool.C
@@ -88,13 +88,27 @@ int main() {
    genConfig->WriteToFile("dummy2.prw.root");
 
 
-   //repeat with action=3 ... 
-   CP::IPileupReweightingTool* prw = new CP::PileupReweightingTool("prw");
    std::vector<std::string> configFiles = {"dummy2.prw.root"};
    std::vector<std::string> lumicalcFiles = {"dummy.None.lumicalc.root"};
 
+   //check multi period failure
+   CP::IPileupReweightingTool* prw_bad = new CP::PileupReweightingTool("prw_bad");
+   asg::setProperty(prw_bad,"ConfigFiles",configFiles);
+   asg::setProperty(prw_bad,"LumiCalcFiles",lumicalcFiles);
+   
+   try {
+    prw_bad->initialize();
+   } catch(std::runtime_error e) {
+    std::cout << "correctly caught:" << e.what() << std::endl;
+   }
+   
+   
+
+   //repeat with action=3 ... 
+   CP::IPileupReweightingTool* prw = new CP::PileupReweightingTool("prw");
    asg::setProperty(prw,"ConfigFiles",configFiles);
    asg::setProperty(prw,"LumiCalcFiles",lumicalcFiles);
+   asg::setProperty(prw,"UseMultiPeriods",true); //channel 2000 has periods 100 and 101
    prw->initialize();
 
 
@@ -115,6 +129,7 @@ int main() {
    std::vector<std::string> lumicalcFiles1 = {"dummy.None.lumicalc.root","dummy.TriggerA.lumicalc.root:TriggerA","dummy.TriggerB.lumicalc.root:TriggerB"};
    asg::setProperty(prw1, "ConfigFiles",configFiles1);
    asg::setProperty(prw1, "LumiCalcFiles",lumicalcFiles1);
+   asg::setProperty(prw1,"UseMultiPeriods",true); //channel 2000 has periods 100 and 101
    prw1->initialize();
 
    std::cout << "prw1 Integrated lumi = " << prw1->GetIntegratedLumi() << " (expected=2.7e-5) " << std::endl;  testValue(prw1->GetIntegratedLumi(),2.7e-5);
@@ -144,8 +159,15 @@ int main() {
    std::cout << "prw1 TriggerA&&TriggerB lumi = " << prw1->expert()->GetIntegratedLumi("TriggerA&&TriggerB") << " (expected=1.81597e-6) " << std::endl;testValue(prw1->expert()->GetIntegratedLumi("TriggerA&&TriggerB"),1.81597e-6);
 
    //now check the dataweight .. remember the runNumber is converted into a periodNumber (i.e. the weights aren't unique to a runNumber, they are unique to the periodNumber)
-   std::cout << "prw TriggerA DataWeights (mu independent): " << prw1->expert()->GetDataWeight(1,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(2,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(3,"TriggerA") << " (expected=3.2727)" << std::endl;
-   std::cout << "prw TriggerA DataWeights (mu dependent): " << prw1->expert()->GetDataWeight(1,"TriggerA",0.5) << " (expected=2) " << prw1->expert()->GetDataWeight(1,"TriggerA",1.5) << " (expected=3) " << prw1->expert()->GetDataWeight(2,"TriggerA",1.5) << " (expected=3.0000) " << prw1->expert()->GetDataWeight(3,"TriggerA",1.5) << " (expected=4) " << prw1->expert()->GetDataWeight(3,"TriggerA",2.5) << " (expected=2) " << prw1->expert()->GetDataWeight(3,"TriggerA",3.5) << " (expected=nan) " << std::endl;
+   std::cout << "prw1 TriggerA DataWeights (mu independent): " << prw1->expert()->GetDataWeight(1,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(2,"TriggerA") << " (expected=2.63415) " << prw1->expert()->GetDataWeight(3,"TriggerA") << " (expected=3.2727)" << std::endl;
+   std::cout << "prw1 TriggerA DataWeights (mu dependent): " << prw1->expert()->GetDataWeight(1,"TriggerA",0.5) << " (expected=2) " << prw1->expert()->GetDataWeight(1,"TriggerA",1.5) << " (expected=3) " << prw1->expert()->GetDataWeight(2,"TriggerA",1.5) << " (expected=3.0000) " << prw1->expert()->GetDataWeight(3,"TriggerA",1.5) << " (expected=4) " << prw1->expert()->GetDataWeight(3,"TriggerA",2.5) << " (expected=2) " << std::endl;
+   
+   try {
+    prw1->expert()->GetDataWeight(3,"TriggerA",3.5);
+   } catch(...) {
+    std::cout << "correctly threw exception for out of range mu" << std::endl;
+   }
+   
    testValue(prw1->expert()->GetDataWeight(1,"TriggerA"),2.63415);
    testValue(prw1->expert()->GetDataWeight(2,"TriggerA"),2.63415);
    testValue(prw1->expert()->GetDataWeight(3,"TriggerA"),3.2727);
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWDataWeightExample_test.cxx b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWDataWeightExample_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..607aaf18e0f63716453765f36c3573e1f0eb152f
--- /dev/null
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWDataWeightExample_test.cxx
@@ -0,0 +1,117 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+
+//example program for how to use Data weight for unprescaling data
+
+#ifdef XAOD_ANALYSIS
+#ifndef XAOD_STANDALONE
+
+#include "AsgTools/AnaToolHandle.h"
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
+#include "TrigDecisionInterface/ITrigDecisionTool.h"
+
+#include "PileupReweighting/TPileupReweighting.h"
+
+#include "TROOT.h"
+
+#include "POOLRootAccess/TEvent.h"
+
+#include <assert.h>
+
+using namespace asg::msgUserCode;
+
+int main() {
+  ANA_CHECK_SET_TYPE (int); //makes ANA_CHECK return ints if exiting function
+
+  POOL::TEvent evt;
+  evt.readFrom("/r04/atlas/will/xAOD/data16_13TeV/DAOD_HIGG3D1.08297165._000001.pool.root.1");//"$ASG_TEST_FILE_DATA");
+
+  asg::AnaToolHandle<CP::IPileupReweightingTool> prwTool("CP::PileupReweightingTool/prw");
+  
+  std::vector<std::string> lcFiles = {"GoodRunsLists/data16_13TeV/20160803/physics_25ns_20.7.lumicalc.OflLumi-13TeV-005.root", //the unprescaled lc file
+                                      "dev/PileupReweighting/ilumicalc_histograms_HLT_e12_lhvloose_nod0_L1EM10VH_297730-304494_OflLumi-13TeV-005.root:HLT_e12_lhvloose_nod0_L1EM10VH",
+                                      "dev/PileupReweighting/ilumicalc_histograms_HLT_e24_lhvloose_nod0_L1EM20VH_297730-304494_OflLumi-13TeV-005.root:HLT_e24_lhvloose_nod0_L1EM20VH"}; //feed with lc files for each trigger
+  
+  
+  
+  prwTool.setProperty( "LumiCalcFiles" , lcFiles );
+  
+  
+ 
+  //prwTool.setProperty( "OutputLevel", 1 ); //VERBOSE OUTPUT LEVEL
+
+  prwTool.initialize();
+  
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl;
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 8797.7) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value 8797.7");
+  }
+  
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH", 4)  - 109.155) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value 109.155");
+  }
+  
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 107.829) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value  107.829");
+  }
+
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH&&HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH&&HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 960312) < 1.0) ) {
+    throw std::runtime_error("data weight not expected value 960312");
+  }
+  
+  //in this version 4.0 onwards, trigger bits default to assuming the trigger passed
+  
+  prwTool->expert()->SetTriggerBit("HLT_e12_lhvloose_nod0_L1EM10VH" , 1);
+  prwTool->expert()->SetTriggerBit("HLT_e24_lhvloose_nod0_L1EM20VH" , 0);
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 8797.7) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value 8797.7");
+  }
+  
+  prwTool->expert()->SetTriggerBit("HLT_e24_lhvloose_nod0_L1EM20VH" , 1);
+  std::cout << prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 107.829) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value 107.829");
+  }
+  
+  prwTool->expert()->SetTriggerBit("HLT_e12_lhvloose_nod0_L1EM10VH" , 0);
+  std::cout << prwTool->expert()->GetDataWeight( 297730 ,  "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  if(! ( fabs(prwTool->expert()->GetDataWeight( 297730 , "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4)  - 109.155) < 1e-3 ) ) {
+    throw std::runtime_error("data weight not expected value 109.155");
+  }
+  
+  
+  
+  /*
+  asg::AnaToolHandle<CP::IPileupReweightingTool> prwTool2("CP::PileupReweightingTool/prw2");
+  prwTool2.setProperty( "LumiCalcFiles" , lcFiles );
+  prwTool2.setProperty( "TrigDecisionTool" , "Trig::TrigDecisionTool/TrigDecisionTool" ); //only works for athena, not for eventloop
+  prwTool2.initialize();
+  evt.getEntry(0);
+  ToolHandle<Trig::ITrigDecisionTool> tdt("Trig::TrigDecisionTool/TrigDecisionTool");
+  tdt.retrieve();
+  evt.getEntry(0);
+  std::cout << prwTool2->expert()->GetDataWeight( 297730 ,  "HLT_e24_lhvloose_nod0_L1EM20VH||HLT_e12_lhvloose_nod0_L1EM10VH", 4) << std::endl; 
+  */
+
+   return 0;
+}
+
+#else //don't run this test in EventLoop release
+int main() {
+  return 0;
+}
+#endif
+#else //AnaToolHandle not yet in AtlasDerivation
+
+int main() {
+  return 0;
+}
+
+#endif
diff --git a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWExample_test.cxx b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWExample_test.cxx
index eeb0a8a663879a4cefcdd77121b8adafbceec1b2..011b328469acf5d8e60070dfdd9cc1bc8e46b077 100644
--- a/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWExample_test.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/PileupReweighting/test/ut_PRWExample_test.cxx
@@ -47,7 +47,7 @@ void testValue(double v1, double v2) {
 #ifdef XAOD_ANALYSIS
 
 #include "AsgTools/AnaToolHandle.h"
-#include "PileupReweighting/IPileupReweightingTool.h"
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
 
 #include "TROOT.h"
 
@@ -66,6 +66,7 @@ int main() {
    asg::AnaToolHandle<CP::IPileupReweightingTool> prwTool("CP::PileupReweightingTool/prw");
    ANA_CHECK( prwTool.setProperty( "ConfigFiles", std::vector<std::string>({"dummy1.prw.root"}) ) );
    ANA_CHECK( prwTool.setProperty( "LumiCalcFiles",  std::vector<std::string>({"dummy.None.lumicalc.root"}) ) );
+   ANA_CHECK( prwTool.setProperty( "UseMultiPeriods",true) ); //channel 2000 has periods 100 and 101
    ANA_CHECK( prwTool.initialize() );
 
    ///This is an example of retrieving the pileup weight
diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt
index e5b650f3bc50da04f2634c3ec5cf5ef8829743d5..289ca2486b153dc0ac4b32eccf5be370a87481ff 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt
@@ -35,6 +35,7 @@ atlas_depends_on_subdirs(
    PhysicsAnalysis/CommonTools/ExpressionEvaluation
    PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
    Tracking/TrkTools/TrkToolInterfaces	
+   PhysicsAnalysis/MCTruthClassifier	
    ${extra_deps} )
 
 # Component(s) in the package:
@@ -42,7 +43,7 @@ atlas_add_component(ThinningUtils
    src/*.h src/*.cxx src/components/*.cxx
    LINK_LIBRARIES AthLinks AthenaBaseComps AthenaKernel EventInfo xAODBase
    xAODCaloEvent xAODEgamma xAODJet xAODMuon xAODParticleEvent xAODTau
-   xAODTracking xAODTruth GaudiKernel ExpressionEvaluationLib TrkToolInterfaces ${extra_libs})
+   xAODTracking xAODTruth GaudiKernel ExpressionEvaluationLib TrkToolInterfaces MCTruthClassifierLib ${extra_libs})
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx
index 9b7dbb6ca511eeb85444b141fbbecea9632ce4ae..81cb709dc8e1e8f455b9d12aef6259fc0ba17406 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx
@@ -27,7 +27,9 @@
 #include "xAODMuon/MuonContainer.h"
 #include "xAODEgamma/ElectronContainer.h"
 #include "xAODEgamma/PhotonContainer.h"
-
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaTruthxAODHelpers.h"
+#include "MCTruthClassifier/MCTruthClassifierDefs.h"
 // STL includes
 #include <algorithm> 
 
@@ -35,6 +37,9 @@
 #include "GaudiKernel/Property.h"
 #include "GaudiKernel/IJobOptionsSvc.h"
 
+//Standard includes
+#include <cstdlib>
+
 ///////////////////////////////////////////////////////////////////
 // Public methods:
 ///////////////////////////////////////////////////////////////////
@@ -53,6 +58,7 @@ m_truthVerticesKey("TruthVertices"),
 m_muonsKey("Muons"),
 m_electronsKey("Electrons"),
 m_photonsKey("Photons"),
+m_egammaTruthKey("egammaTruthParticles"),
 m_nEventsProcessed(0),
 m_nParticlesProcessed(0),
 m_nVerticesProcessed(0),
@@ -60,7 +66,7 @@ m_nParticlesThinned(0),
 m_nVerticesThinned(0)
 {
    
-    declareProperty("ThinningSvc",          m_thinningSvc,
+    declareProperty("ThinningSvc", m_thinningSvc,
                     "The ThinningSvc instance for a particular output stream" );
     
     declareProperty("ThinGeantTruth", m_doThinning,
@@ -87,6 +93,9 @@ m_nVerticesThinned(0)
     declareProperty("PhotonsKey", m_photonsKey,
                     "StoreGate key for photons container");
 
+    declareProperty("EGammaTruthKey", m_egammaTruthKey,
+                    "StoreGate key for e-gamma truth container");
+
 }
 
 // Destructor
@@ -202,6 +211,43 @@ StatusCode ThinGeantTruthAlg::execute()
         } 
     }
 
+    //Set up the indices for the egamma Truth Particles to keep
+    const xAOD::TruthParticleContainer* egammaTruthParticles(0);
+    if (evtStore()->contains<xAOD::TruthParticleContainer>(m_egammaTruthKey)) {
+      CHECK( evtStore()->retrieve( egammaTruthParticles , m_egammaTruthKey ) );
+    } else {
+      ATH_MSG_WARNING("No e-gamma truth container with key "+m_egammaTruthKey+" found.");
+    }
+
+    std::vector<int> egammaTruthIndices{};
+    if (egammaTruthParticles!=nullptr) {
+
+      for (auto egTruthParticle : *egammaTruthParticles) {
+
+	static const SG::AuxElement::ConstAccessor<int> accType("truthType");
+
+	if(!accType.isAvailable(*egTruthParticle) || 
+	   accType(*egTruthParticle)!=MCTruthPartClassifier::IsoElectron || 
+	   std::abs(egTruthParticle->eta()) > 2.525){
+	  continue;
+	}
+
+
+	//Only central isolated true electrons	
+	typedef ElementLink<xAOD::TruthParticleContainer> TruthLink_t;
+	static SG::AuxElement::ConstAccessor<TruthLink_t> linkToTruth("truthParticleLink");
+	if (!linkToTruth.isAvailable(*egTruthParticle)) {
+	  continue;
+	}
+
+	const TruthLink_t& truthegamma = linkToTruth(*egTruthParticle);
+	if (!truthegamma.isValid()) {
+	  continue;
+	} 
+
+	egammaTruthIndices.push_back( (*truthegamma)->index());
+	}
+    }     
     // Set up masks
     std::vector<bool> particleMask, vertexMask;
     int nTruthParticles = truthParticles->size();
@@ -243,6 +289,7 @@ StatusCode ThinGeantTruthAlg::execute()
                 }        
             }
         }  
+
         // Retain particles and their descendants/ancestors associated with the reconstructed objects
         if ( std::find(recoParticleTruthIndices.begin(), recoParticleTruthIndices.end(), i) != recoParticleTruthIndices.end() ) { 
             if (abs(particle->barcode()) > m_geantOffset) { // only need to do this for Geant particles since non-Geant are kept anyway 
@@ -252,6 +299,13 @@ StatusCode ThinGeantTruthAlg::execute()
                 encounteredBarcodes.clear();
             }
         }
+
+        // Retain particles and their descendants  associated with the egamma Truth Particles
+        if ( std::find(egammaTruthIndices.begin(), egammaTruthIndices.end(), i) != egammaTruthIndices.end() ) { 
+	  descendants(particle,particleMask,encounteredBarcodes);
+	  encounteredBarcodes.clear();
+        }
+
         if (abs(particle->barcode()) < m_geantOffset) {
             particleMask[i] = true;
         }         
diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h
index ea11eafaea4abafd47ba2c067d6ad86a47fef760..15c4eac30594570b0d91c9bfa191b4ed4ea60ffa 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h
@@ -24,10 +24,10 @@
 #include "xAODTruth/TruthParticleContainer.h"
 
 class ThinGeantTruthAlg
-: public ::AthAlgorithm
+  : public ::AthAlgorithm
 {
 public:
-    
+  
     /// Constructor with parameters:
     ThinGeantTruthAlg( const std::string& name, ISvcLocator* pSvcLocator );
     
@@ -73,6 +73,7 @@ private:
     std::string m_muonsKey;
     std::string m_electronsKey;
     std::string m_photonsKey;   
+    std::string m_egammaTruthKey;
  
     /// Counters
     unsigned long m_nEventsProcessed;
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/CMakeLists.txt
index 683b8814079bf713522c0adb4bf96944bbe9ea3b..d4d91d67803920e2b45f8e0df6259854d87a48b3 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/CMakeLists.txt
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/CMakeLists.txt
@@ -11,8 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           PhysicsAnalysis/AnalysisCommon/PATCore
                           PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool
+                          PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
                           PRIVATE
                           Event/xAOD/xAODBase
                           Event/xAOD/xAODCaloEvent
@@ -32,13 +31,14 @@ atlas_add_library( DerivationFrameworkEGammaLib
                    src/*.cxx
                    PUBLIC_HEADERS DerivationFrameworkEGamma
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AsgTools AthenaBaseComps PATCoreLib ElectronPhotonSelectorToolsLib ElectronPhotonShowerShapeFudgeToolLib ExpressionEvaluationLib MCTruthClassifierLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} xAODBase xAODCaloEvent xAODEgamma xAODMissingET xAODMuon xAODTruth GaudiKernel )
+                   LINK_LIBRARIES AsgTools AthenaBaseComps PATCoreLib EgammaAnalysisInterfacesLib ExpressionEvaluationLib MCTruthClassifierLib CaloCalibHitRecLib
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} xAODBase xAODCaloEvent xAODEgamma xAODMissingET xAODMuon xAODTruth )
 
 atlas_add_component( DerivationFrameworkEGamma
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps PATCoreLib ElectronPhotonSelectorToolsLib ElectronPhotonShowerShapeFudgeToolLib xAODBase xAODCaloEvent xAODEgamma xAODMissingET xAODMuon xAODTruth GaudiKernel ExpressionEvaluationLib MCTruthClassifierLib DerivationFrameworkEGammaLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES}  AsgTools AthenaBaseComps PATCoreLib  EgammaAnalysisInterfacesLib xAODBase 
+		     xAODCaloEvent xAODEgamma xAODMissingET xAODMuon xAODTruth GaudiKernel ExpressionEvaluationLib MCTruthClassifierLib CaloCalibHitRecLib DerivationFrameworkEGammaLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
index 7a977df7beac677ce5cce5c42996092a3a5ae72b..51dc98099843f3e15ca95df5038adcfc76f6cea7 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h
@@ -13,10 +13,8 @@
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "DerivationFrameworkInterfaces/IAugmentationTool.h"
-#include "ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h"
-//#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
-//#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
-#include "ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h"
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h"
 #include "PATCore/IAsgSelectionTool.h"
 #include "AsgTools/IAsgTool.h"
 #include "GaudiKernel/ToolHandle.h"
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/ElectronsCPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/ElectronsCPContent.py
index 553b7f01663b7547971a05b659774779cacee2a1..6b6edbafe7164aa93e434ff6430da7426db7e0e5 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/ElectronsCPContent.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/ElectronsCPContent.py
@@ -2,7 +2,7 @@
 
 ElectronsCPContent = [
 "Electrons",
-"ElectronsAux.trackParticleLinks.pt.eta.phi.m.truthParticleLink.truthOrigin.truthType.caloClusterLinks.author.OQ.ethad1.ethad.f1.f3.f3core.e233.e237.e277.weta1.weta2.e2tsts1.fracs1.wtots1.emins1.emaxs1.etcone20.ptcone30.deltaEta1.deltaPhi2.deltaPhiRescaled2.Loose.Medium.Tight.DFCommonElectronsLHLoose.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsML.ptcone20.ptcone30.ptcone40.ptvarcone20.ptvarcone30.ptvarcone40.topoetcone20.topoetcone30.topoetcone40.charge.Reta.Rphi.Eratio.Rhad.Rhad1.DeltaE.DFCommonElectronsIsEMLoose.DFCommonElectronsIsEMMedium.DFCommonElectronsIsEMTight.topoetcone20ptCorrection.topoetcone30ptCorrection.topoetcone40ptCorrection.etcone20ptCorrection.etcone30ptCorrection.etcone40ptCorrection.LHLoose",
+"ElectronsAux.trackParticleLinks.pt.eta.phi.m.caloClusterLinks.author.OQ.ethad1.ethad.f1.f3.f3core.e233.e237.e277.weta1.weta2.e2tsts1.fracs1.wtots1.emins1.emaxs1.etcone20.ptcone30.deltaEta1.deltaPhi1.deltaPhi2.deltaPhiRescaled2.deltaPhiFromLastMeasurement.Loose.Medium.Tight.LHLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsML.ptcone20.ptcone30.ptcone40.ptvarcone20.ptvarcone30.ptvarcone40.topoetcone20.topoetcone30.topoetcone40.charge.Reta.Rphi.Eratio.Rhad.Rhad1.DeltaE.DFCommonElectronsIsEMLoose.DFCommonElectronsIsEMMedium.DFCommonElectronsIsEMTight.topoetcone20ptCorrection.topoetcone30ptCorrection.topoetcone40ptCorrection.etcone20ptCorrection.etcone30ptCorrection.etcone40ptCorrection.ambiguityLink.truthParticleLink.truthOrigin.truthType.truthPdgId.firstEgMotherTruthType.firstEgMotherTruthOrigin.firstEgMotherTruthParticleLink.firstEgMotherPdgId.lastEgMotherTruthType.lastEgMotherTruthOrigin.lastEgMotherTruthParticleLink.lastEgMotherPdgId.ambiguityType",
 "GSFTrackParticles",
 "GSFTrackParticlesAux.phi.d0.theta.qOverP.definingParametersCovMatrix.parameterX.parameterPX.parameterPY.parameterPZ.parameterPosition.numberOfBLayerHits.numberOfBLayerOutliers.expectBLayerHit.numberOfPixelHits.numberOfPixelOutliers.numberOfPixelDeadSensors.numberOfSCTHits.numberOfSCTOutliers.numberOfSCTDeadSensors.numberOfTRTHits.numberOfTRTOutliers.numberOfTRTHighThresholdHits.numberOfTRTHighThresholdOutliers.numberOfTRTXenonHits.z0.vz.vertexLink.numberOfInnermostPixelLayerHits.numberOfInnermostPixelLayerOutliers.numberOfNextToInnermostPixelLayerOutliers.expectInnermostPixelLayerHit.eProbabilityComb.truthParticleLink.originalTrackParticle.eProbabilityHT.numberOfNextToInnermostPixelLayerHits.expectNextToInnermostPixelLayerHit",
 "GSFConversionVertices",
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
index d8f4c0dbeb5a455011a94023f7f532318017bd37..60c0f4b7040606d309446a1586302c41085d82bd 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx
@@ -91,13 +91,13 @@ namespace DerivationFramework {
 	// apply the shower shape corrections
 	CP::CorrectionCode correctionCode = CP::CorrectionCode::Ok;
 	if (type==xAOD::Type::Electron) {
-	    const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(*pItr);
+	    const xAOD::Electron* eg = static_cast<const xAOD::Electron*>(*pItr);
 	    xAOD::Electron* el = 0;
 	    correctionCode = m_fudgeMCTool->correctedCopy(*eg, el);
 	    pCopy = el;
 	}
 	else {
-	    const xAOD::Photon* eg = dynamic_cast<const xAOD::Photon*>(*pItr);
+	    const xAOD::Photon* eg = static_cast<const xAOD::Photon*>(*pItr);
 	    xAOD::Photon* ph = 0;
 	    correctionCode = m_fudgeMCTool->correctedCopy(*eg, ph);
 	    pCopy = ph;
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d09e31f90dcac9fd0964eb1df8e46ef64877bc09
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/CMakeLists.txt
@@ -0,0 +1,33 @@
+################################################################################
+# Package: EgammaAnalysisHelpers
+################################################################################
+
+# Declare the package name:
+atlas_subdir(EgammaAnalysisHelpers )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs(
+  PUBLIC
+  Event/xAOD/xAODEgamma
+  PRIVATE
+  Control/AthToolSupport/AsgTools
+  Event/xAOD/xAODCaloEvent
+  ${extra_dep} )
+
+# External dependencies:
+find_package( ROOT COMPONENTS Core MathCore Hist MathMore )
+
+# Component(s) in the package:
+atlas_add_library( EgammaAnalysisHelpersLib
+  EgammaAnalysisHelpers/*.h Root/*.cxx
+  PUBLIC_HEADERS EgammaAnalysisHelpers
+  PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+  LINK_LIBRARIES xAODEgamma 
+  PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent)
+
+atlas_add_dictionary( EgammaAnalysisHelpersDict
+  EgammaAnalysisHelpers/EgammaAnalysisHelpersDict.h
+  EgammaAnalysisHelpers/selection.xml
+  LINK_LIBRARIES EgammaAnalysisHelpersLib )
+
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/EgammaAnalysisHelpersDict.h b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/EgammaAnalysisHelpersDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf7eaf83d4996fbcf63dd044e4023d816e659044
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/EgammaAnalysisHelpersDict.h
@@ -0,0 +1,10 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef __EGAMMAANALYSISHELPERSDICT__
+#define __EGAMMAANALYSISHELPERSDICT__
+
+#include "EgammaAnalysisHelpers/PhotonHelpers.h"
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/PhotonHelpers.h b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/PhotonHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b05feaa04a4906fd43847e36ee59f7a94e9b3c2
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/PhotonHelpers.h
@@ -0,0 +1,21 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef __PHOTONHELPERS__
+#define __PHOTONHELPERS__
+
+// Atlas includes
+#include "xAODEgamma/PhotonFwd.h"
+#include <cstddef>
+
+namespace PhotonHelpers{
+  ///@brief Helper to ease the implemmantation of the pass Quality requirements
+  bool passOQquality(const xAOD::Photon *ph);
+  ///@brief Helpers to ease the implementation of the pass Quality requirements
+  bool passOQqualityDelayed(const xAOD::Photon *ph);
+}
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/selection.xml b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..979ffbfb2b66cd9de846cd042cb761a0f8db3e09
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/selection.xml
@@ -0,0 +1,4 @@
+<lcgdict>
+<!--Add Helper Functions -->
+<function pattern="PhotonHelpers::*"/>
+</lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b2dc23c91721b918fd9ff42a407638946aee4b9e
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx
@@ -0,0 +1,47 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "EgammaAnalysisHelpers/PhotonHelpers.h"
+#include "xAODEgamma/Photon.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "AsgTools/AsgMessaging.h"
+
+// ==================================================================
+bool PhotonHelpers::passOQquality(const xAOD::Photon *ph){
+
+  static const asg::AsgMessaging msg("PhotonHelpers");
+  if(!ph){
+    msg.msg(MSG::WARNING) << "No photon found!" << endmsg;
+    return 0;
+  }
+  
+  if( !( ( ph->OQ() & 1073741824 )!=0 ||
+	 ( ( ph->OQ() & 134217728 )!=0 &&
+	   ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98
+	    || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4
+	    || (ph->OQ() & 67108864) !=0)
+	   ) ) ){
+    return true;
+  } 
+  return false;
+}
+// ==================================================================
+bool PhotonHelpers::passOQqualityDelayed(const xAOD::Photon *ph){
+
+  static const asg::AsgMessaging msg("PhotonHelpers");
+  if(!ph){
+    msg.msg(MSG::WARNING) << "No photon found!" << endmsg;
+    return 0;
+  }
+  
+  if( !( ( ph->OQ() & 1073741824)!=0 ||
+	 ( ( ph->OQ() & 134217728)!=0 &&
+	   ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98
+	     || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4
+	     ) ) ) ) {
+    return true;
+  }
+  return false;
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/CMakeLists.txt
index dbfd2c228ec235cb4e32ab8bcca7b4b5e3a01a73..630e1508b0288a3fa412378e514b2aba154ff70d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/CMakeLists.txt
@@ -5,50 +5,98 @@
 # Declare the package name:
 atlas_subdir( ElectronEfficiencyCorrection )
 
+# Extra dependencies when not in AnalysisBase:
+set( extra_deps )
+if( NOT XAOD_STANDALONE )
+   set( extra_deps Control/AthenaBaseComps GaudiKernel )
+else()
+   set( extra_deps Control/xAODRootAccess )
+endif()
+
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthContainers
-                          Control/AthToolSupport/AsgTools
-                          Event/xAOD/xAODEgamma
-                          PhysicsAnalysis/AnalysisCommon/PATCore
-                          PhysicsAnalysis/AnalysisCommon/PATInterfaces
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Control/CxxUtils
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODCore
-                          Event/xAOD/xAODEventInfo
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          Tools/PathResolver )
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthContainers
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   PhysicsAnalysis/AnalysisCommon/PATCore
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces
+   PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces
+   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces	
+   PRIVATE
+   Control/AthAnalysisBaseComps
+   Tools/PathResolver
+   Control/CxxUtils
+   Event/xAOD/xAODCaloEvent
+   Event/xAOD/xAODCore
+   Event/xAOD/xAODEventInfo
+   Event/xAOD/xAODTracking
+   Event/xAOD/xAODMetaData
+   PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools	
+   ${extra_deps} )
 
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint PyROOT )
-
-# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake
+find_package( Boost )
+find_package( ROOT COMPONENTS Core MathCore Hist RIO MathMore )
 
 # Component(s) in the package:
 atlas_add_library( ElectronEfficiencyCorrectionLib
-                   src/*.cxx
-                   Root/*.cxx
-                   PUBLIC_HEADERS ElectronEfficiencyCorrection
-                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AsgTools xAODEgamma PATInterfaces PATCoreLib
-                   PRIVATE_LINK_LIBRARIES AthenaBaseComps xAODCaloEvent xAODCore xAODEventInfo xAODTracking GaudiKernel PathResolver )
-
-atlas_add_component( ElectronEfficiencyCorrection
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AsgTools xAODEgamma PATCoreLib PATInterfaces AthenaBaseComps xAODCaloEvent xAODCore xAODEventInfo xAODTracking GaudiKernel PathResolver ElectronEfficiencyCorrectionLib )
+   ElectronEfficiencyCorrection/*.h Root/*.cxx
+   PUBLIC_HEADERS ElectronEfficiencyCorrection
+   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AsgTools
+   xAODEgamma PATInterfaces PATCoreLib AsgAnalysisInterfaces EgammaAnalysisInterfacesLib
+   PRIVATE_LINK_LIBRARIES xAODCaloEvent xAODCore xAODEventInfo xAODTracking
+   xAODMetaData PathResolver )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( ElectronEfficiencyCorrection
+      src/*.h src/*.cxx src/components/*.cxx
+      LINK_LIBRARIES xAODEgamma PATInterfaces AthenaBaseComps xAODCore
+      xAODEventInfo GaudiKernel ElectronEfficiencyCorrectionLib )
+endif()
 
 atlas_add_dictionary( ElectronEfficiencyCorrectionDict
-                      ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h
-                      ElectronEfficiencyCorrection/selection.xml
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AsgTools xAODEgamma PATCoreLib PATInterfaces AthenaBaseComps CxxUtils xAODCaloEvent xAODCore xAODEventInfo xAODTracking GaudiKernel PathResolver ElectronEfficiencyCorrectionLib )
+   ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h
+   ElectronEfficiencyCorrection/selection.xml
+   LINK_LIBRARIES ElectronEfficiencyCorrectionLib )
+
+# Utilities provided by the package:
+atlas_add_executable( EgEfficiencyCorr_mem_check
+   util/EgEfficiencyCorr_mem_check.cxx
+   LINK_LIBRARIES AsgTools ElectronEfficiencyCorrectionLib )
+
+# AnalysisBase-only utilities:
+if( XAOD_STANDALONE )
+
+   atlas_add_executable( EgEfficiencyCorr_testCorrelationModels
+      util/testCorrelationModels.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCore xAODCaloEvent xAODTracking AsgTools PATInterfaces
+      ElectronEfficiencyCorrectionLib )
+
+   atlas_add_executable( EgEfficiencyCorr_testEgEfficiencyCorr
+      util/testEgEfficiencyCorr.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCore ElectronEfficiencyCorrectionLib )
+
+   atlas_add_executable( EgEfficiencyCorr_testEgEfficiencyCorrWithoutFile
+      util/testEgEfficiencyCorrWithoutFile.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCore xAODCaloEvent xAODTracking AsgTools PATInterfaces
+      ElectronEfficiencyCorrectionLib )
+
+   atlas_add_executable( EgEfficiencyCorr_testEgChargeCorr
+      util/testEgChargeCorr.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCore ElectronPhotonSelectorToolsLib ElectronEfficiencyCorrectionLib )
+
+endif()
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
-atlas_install_data( data/*.root )
-
+atlas_install_data( data/*.root data/*.txt )
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h
index e28a3dee951cdb7d0f55b8fe010b8a33fe3563ca..f1894cafa48fb5de0a322bc971c156ad07d583ff 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h
@@ -18,26 +18,26 @@
 // STL includes
 #include <vector>
 #include <string>
-
+#include <iterator>
+#include <map>
 // Utility includes
 #include "boost/unordered_map.hpp"
-
 // Include the return object and the underlying ROOT tool
 #include "PATCore/TResult.h"
 #include "AthContainers/AuxElement.h"
-
 //xAOD includes
 #include "AsgTools/AsgTool.h"
+#include "AsgTools/AsgMetadataTool.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
+
 #include "PATInterfaces/ISystematicsTool.h"
 #include "PATInterfaces/SystematicRegistry.h"
 #include "PATInterfaces/CorrectionCode.h"
 #include "ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h"
-#include "ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 
 class AsgElectronEfficiencyCorrectionTool
-  : virtual public IAsgElectronEfficiencyCorrectionTool,
-    public asg::AsgTool
+  : virtual public IAsgElectronEfficiencyCorrectionTool, public asg::AsgMetadataTool
 {
   ASG_TOOL_CLASS(AsgElectronEfficiencyCorrectionTool, IAsgElectronEfficiencyCorrectionTool)
 
@@ -56,6 +56,11 @@ public:
   /// Gaudi Service Interface method implementations
   virtual StatusCode finalize();
 
+  // Introducing to check if  METADATA working
+  virtual StatusCode beginInputFile();    
+  virtual StatusCode beginEvent();
+  virtual StatusCode endInputFile();    
+ 
   // Main methods from IUserDataCalcTool
 public:
 
@@ -76,7 +81,7 @@ public:
     ATH_MSG_INFO("TOTAL");
   } ;
 
-  /// returns: whether this tool is affected by the given systematis
+ /// returns: whether this tool is affected by the given systematis
   virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const ;
   
   /// returns: the list of all systematics this tool can be affected by
@@ -95,11 +100,22 @@ public:
 
   CP::SystematicCode registerSystematics();
 
+  int systUncorrVariationIndex( const xAOD::Electron &inputObject) const;
+
   // Private member variables
 private:
+  // To check if the metadat can be retrieved 
+  bool m_metadata_retrieved = false;
+
+  // Get the simulation type from metadata
+  StatusCode get_simType_from_metadata(PATCore::ParticleDataType::DataType& result) const;
+
+  int currentSimplifiedUncorrSystRegion(const double cluster_eta, const double et) const ;
+  int currentUncorrSystRegion(const double cluster_eta, const double et) const ;
+
 
   /// The main calculate method: the actual correction factors are determined here
-  const Root::TResult& calculate( const xAOD::Electron& egam, const unsigned int runnumber, int &currentElectronSimplifiedUncorrSystRegion, int& currentElectronUncorrSystRegion ) const ;
+  const Root::TResult& calculate( const double cluster_eta, const double et, const unsigned int runnumber ) const ;
   CP::SystematicCode InitSystematics();
 
   // struct for toys
@@ -109,6 +125,27 @@ private:
     float m_toy_scale;
   };
 
+  // Gets the correction filename from map  
+  virtual StatusCode getFile(const std::string& recokey, const std::string& idkey, const std::string& isokey, const std::string& trigkey);
+
+  // Convert reco, ID, iso and trigger key values into a 
+  // single key according to the map file key format
+  std::string convertToOneKey(const std::string& recokey, const std::string& idkey, const std::string& isokey, const std::string& trigkey) const;
+
+  // Retrieves the value from the provided map file as 
+  // associated with the provided key
+  std::string getValueByKey(const std::string& mapFile, const std::string& key);
+
+  // Reads the provided map file
+  // and construct the map
+  StatusCode read (const std::string& strFile);
+      
+  // Retrieves the value from the provided map file if 
+  // even the provided key is found. If the key has an 
+  // association then, the actual retrieved value would
+  // be assigned to the 2nd argument of this method 
+  std::string getValue(const std::string& strKey, std::string& strValue);  
+
   /// Pointer to the underlying ROOT based tool
   Root::TElectronEfficiencyCorrectionTool* m_rootTool;
 
@@ -124,9 +161,20 @@ private:
   /// Currently applied systematics
   CP::SystematicSet* m_appliedSystematics;
 
-  // Properties
+  // Correlation Model
   std::string m_correlation_model_name;
+  int  m_correlation_model;
 
+  // Map-key properties
+  std::map<std::string,std::string> m_map;
+  std::string  m_mapFile;
+  
+  //Four SF key Properties 
+  std::string  m_recoKey;
+  std::string  m_idKey;
+  std::string  m_isoKey;
+  std::string  m_trigKey;
+  
   /// The list of file names
   std::vector< std::string > m_corrFileNameList;
 
@@ -170,6 +218,8 @@ private:
   TH2F * m_UncorrRegions;
   int m_nSimpleUncorrSyst;
 
+
+
 }; // End: class definition
 
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..edd860c578fea318222b14777f4400009781392a
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h
@@ -0,0 +1,174 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ELECTRONCHARGECORRECTION__ELECTRONCHARGECORRECTIONTOOL__H
+#define ELECTRONCHARGECORRECTION__ELECTRONCHARGECORRECTIONTOOL__H
+
+#include "AsgTools/AsgTool.h"
+//#include "ElectronChargeEfficiencyCorrectionTool/IElectronChargeEfficiencyCorrectionTool.h"
+#include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
+#include "PATInterfaces/ISystematicsTool.h"
+#include "TH2.h"
+// #include "xAODTruth/TruthParticle.h"
+#include "AthContainers/AuxElement.h"
+#include "xAODEgamma/ElectronFwd.h"
+
+#include <string>
+#include <vector>
+#include <map>
+
+// Forward declaration(s):
+namespace xAOD {
+  class IParticle;
+}
+//class TH2D;
+
+
+namespace CP {
+
+  class ElectronChargeEfficiencyCorrectionTool
+    : virtual public CP::IEfficiencyScaleFactorTool,
+    public asg::AsgTool
+  {
+    ASG_TOOL_CLASS2(ElectronChargeEfficiencyCorrectionTool, CP::IEfficiencyScaleFactorTool, CP:: ISystematicsTool)
+
+  public:
+
+    /// Standard constructor
+    ElectronChargeEfficiencyCorrectionTool(const std::string name);
+
+
+    /// Standard destructor
+    virtual ~ElectronChargeEfficiencyCorrectionTool();
+
+    // METADATA  // TO DO
+    //    virtual StatusCode beginInputFile();
+    //    virtual StatusCode beginEvent();
+    // virtual StatusCode endInputFile();
+
+
+
+  public:
+    /// Gaudi Service Interface method implementations
+    virtual StatusCode initialize();
+
+    /// Gaudi Service Interface method implementations
+    virtual StatusCode finalize();
+
+    /// Retrieve the Scale factor
+    virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::IParticle& part, double& sf) const;
+
+    /// Decorate the electron
+    virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::IParticle& part) const;
+
+    /// Systematics
+    //  void applySysVariation();
+
+    /// Returns whether this tool is affected by the given systematics
+    virtual bool  isAffectedBySystematic( const SystematicVariation& systematic ) const;
+
+    /// Returns the list of all systematics this tool can be affected by
+    virtual SystematicSet affectingSystematics() const;
+
+    /// Returns the list of all systematics this tool recommends to use
+    virtual CP::SystematicSet  recommendedSystematics() const;
+
+    virtual CP::SystematicCode applySystematicVariation( const SystematicSet& systConfig );
+
+    CP::SystematicCode registerSystematics();
+
+ /// returns: the currently applied systematics
+  const CP::SystematicSet& appliedSystematics() const {
+       return *m_appliedSystematics;
+    }
+ 
+
+
+ //
+
+  private:
+
+    /// Get the charge flip rate rate given pt, eta, histogram
+    float getChargeFlipRate( double eta, double pt, TH2D *hrates, double& flipRate) const;
+
+    /// Get the charge of the original electron
+    CP::CorrectionCode getEleTruthCharge( const xAOD::Electron& ele, int& truthcharge) const;
+
+    /// Return true if it's prompt ele
+    CP::CorrectionCode isGoodEle( const xAOD::Electron& ele, bool& goodele) const;
+
+    /// Force the data type to a given value
+    int m_dataTypeOverwrite;
+    //
+    //
+    /// The Event info collection name
+    std::string m_eventInfoCollectionName;
+
+    /// Histogram that holds the correction rates for Monte Carlo
+    std::map<std::string, std::vector<TH2D*> > m_SF_SS;     // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
+    std::map<std::string, std::vector<TH2D*> > m_SF_OS;     // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
+
+    //cuts // further variables to bin in
+    std::vector<unsigned int> m_RunNumbers;
+    bool m_useRandomRunNumber;
+    unsigned int m_defaultRandomRunNumber;
+
+    /// The name of the input file that contains the histograms
+    std::string m_filename;
+
+    /// The name of the folder defining the LH/iso working point
+    std::string m_workingPoint;
+
+    /// Lower limit of eta range where corrections are available; taken from histogram
+    double m_eta_lowlimit;
+
+    /// Upper limit of eta range where corrections are available; taken from histogram
+    double m_eta_uplimit;
+
+    /// Lower limit of pt range where corrections are available; taken from histogram
+    double m_pt_lowlimit;
+
+    /// Upper limit of pt range where corrections are available; taken from histogram
+    double m_pt_uplimit;
+
+    /// Factor for GeV <-> MeV switching
+    float m_gevmev;
+
+
+    /// Truth charge
+    mutable int m_truthCharge;
+
+    //const xAOD::TruthParticle *m_truthparticle;
+
+    /// Random number generator for throwing the dice
+    //    TRandom3 *m_Rndm;
+
+    // Systematics
+    std::vector<std::string> m_systematics;
+
+    std::map<CP::SystematicSet, CP::SystematicSet> m_filtered_sys_sets;
+    //boost::unordered_map<SystematicSet,EffiCollection*> m_sf_sets;
+    CP::SystematicSet m_mySysConf;
+    CP::SystematicSet m_affectingSys;
+
+ /// Currently applied systematics
+   CP::SystematicSet* m_appliedSystematics;
+ 
+    /// Decorator
+    std::string m_sf_decoration_name;
+    SG::AuxElement::Decorator< float >* m_sfDec;
+
+
+  };
+
+} // End namespace CP
+
+#endif
+
+/// Apply the correction on a modifyable object
+//......virtual CP::CorrectionCode applyCorrection( xAOD::Electron& ele );
+
+/// Create a corrected copy from a constant muon
+//...virtual CP::CorrectionCode correctedCopy( const xAOD::Electron& input,
+//...					      xAOD::Electron*& output );
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h
index 481f720fbd9d2b15722a40ea8f1913bb84ffa6e0..e04e4a69af7dfcd2f5cda6ea5512cafec9002ebe 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronEfficiencyCorrectionDict.h
@@ -6,9 +6,6 @@
 
 #ifndef __ELECTRONEFFICIENCYCORRECTIONDICT__
 #define __ELECTRONEFFICIENCYCORRECTIONDICT__
-
-
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
-#include "ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h"
-
+#include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
index 4e2a255dd07c667bf35a79e43c208ddd41b04b3a..ea8aeb75e81543ebe1d7c4f5a3a8da1861687e7b 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h
@@ -6,32 +6,7 @@
 #ifndef __IASGELECTRONEFFICIENCYCORRECTION__
 #define __IASGELECTRONEFFICIENCYCORRECTION__
 
-#include "AsgTools/IAsgTool.h"
-#include "xAODEgamma/ElectronFwd.h"
-#include "PATInterfaces/CorrectionCode.h"
-#include "PATInterfaces/ISystematicsTool.h"
-namespace xAOD{
-  class IParticle;
-}
-
-
-class IAsgElectronEfficiencyCorrectionTool : virtual public CP::ISystematicsTool
-{
-  ASG_TOOL_INTERFACE(IAsgElectronEfficiencyCorrectionTool)
-
-  public:
-  ///The interface for Scale Factors
-  virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Electron& inputObject, double& efficiencyScaleFactor) const = 0;
-  virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::Electron& inputObject) const = 0;
-  virtual ~IAsgElectronEfficiencyCorrectionTool() {}
-
-};
-
-
-
-
-
-
-
+#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h
index ad0df55c2db0652bba78f7324419717d0d616acc..6385e65d44623c37208891a8d6b8474a23a5a4b9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h
@@ -32,20 +32,12 @@
 #include "TH1.h"
 #include "TH2.h"
 #include "TRandom3.h"
-
 // Include the return object and the base class
 #include "PATCore/TResult.h"
 #include "PATCore/TCalculatorToolBase.h"
 #include "PATCore/PATCoreEnums.h"
 #include "AsgTools/AsgMessaging.h"
 
-template <class T>
-inline std::string toString(const T& in)
-{
-  std::stringstream stream;
-  stream << in;
-  return stream.str();
-}
 
 namespace Root {
   class TElectronEfficiencyCorrectionTool : public Root::TCalculatorToolBase,public asg::AsgMessaging
@@ -94,15 +86,15 @@ namespace Root {
       }
   
       /// helper functions to retrieve the position of the first/last toy MC scale factors and correlated systematics in the result
-      int getFirstToyMCPosition();
-      int getLastToyMCPosition();
-      int getFirstCorrSysPosition();
-      int getLastCorrSysPosition();
-      int getGlobalBinNumberPosition();
-      int getNbins(std::map<float, std::vector<float> >&); 
-      int getNSyst() {return m_nSysMax;};
+      int getFirstToyMCPosition() const ;
+      int getLastToyMCPosition() const ;
+      int getFirstCorrSysPosition() const ;
+      int getLastCorrSysPosition() const ;
+      int getGlobalBinNumberPosition() const ;
+      int getNbins(std::map<float, std::vector<float> >&) const; 
+      int getNSyst() const {return m_nSysMax;}  ;
 
-      void printResultMap();
+      void printResultMap() const;
 
       enum detailLevel{simple,medium,detailed};
 
@@ -116,76 +108,51 @@ namespace Root {
 
       // Private methods
     private:
+
       /// Load all histograms from the input file(s)
       int getHistograms();
       int getHistogramInDirectory( TKey *key );
-      int setupHistogramsInFolder( TObjArray* dirNameArray, int lastIdx );
-
+      int setupHistogramsInFolder( const TObjArray& dirNameArray, int lastIdx );
       void calcDetailLevels(TH1D *eig) ;
-      std::vector<TObjArray*> *buildToyMCTable(TObjArray *sf, TObjArray *eig, TObjArray* stat, TObjArray* uncorr, std::vector<TObjArray*> *corr);
-      std::vector<TH2D*> *buildSingleToyMC(TH2D *sf, TH2D* stat, TH2D* uncorr, TObjArray *corr);
-      TH2D *buildSingleCombToyMC(TH2D *sf, TH2D* stat, TH2D* uncorr, TObjArray *corr);
+
+      std::vector<TObjArray> buildToyMCTable (const TObjArray &sf, const TObjArray &eig, 
+					      const TObjArray& stat, const TObjArray& uncorr, const std::vector<TObjArray> &corr);
+
+      std::vector<TH2D*> buildSingleToyMC(TH2D *sf, TH2D* stat, TH2D* uncorr, const TObjArray& corr);
+
+      TH2D* buildSingleCombToyMC(TH2D *sf, TH2D* stat, TH2D* uncorr, const TObjArray& corr);
 
       /// Fill and interpret the setup, depending on which histograms are found in the input file(s)
-      int setup( TObjArray* hist,
-		 std::vector< TObjArray* >& histList,
+      int setup( const TObjArray& hist,
+		 std::vector< TObjArray >& histList,
 		 std::vector< unsigned int >& beginRunNumberList,
 		 std::vector< unsigned int >& endRunNumberList );
     
-      int setupSys( std::vector<TObjArray*> *hist,
-		    std::vector< std::vector< TObjArray* > *> & histList);
+      int setupSys( std::vector<TObjArray> & hist,
+		    std::vector< std::vector< TObjArray>> & histList);
 
-      void printDefaultReturnMessage(TString reason, int line);
+      void printDefaultReturnMessage(const TString& reason, int line) const;
 
-      /// A debug flag: if true, print out more statements
-      TRandom3 *m_Rndm;
+      TRandom3 m_Rndm;
       int m_randomCounter;
-    
+      ///
       bool m_isInitialized;
-
       /// The detail level
       int m_detailLevel;
-
+      ///
       int m_toyMCSF;
-
+      //
       /// The seed
       int m_seed;
+      ///
       bool m_doToyMC;
       bool m_doCombToyMC;
       int m_nToyMC;
-      std::vector< std::vector<TObjArray*> *> *m_uncorrToyMCSystFull, *m_uncorrToyMCSystFast;
-
       int m_sLevel[3];
       int m_nSys;
       int m_nSysMax;
-
-
-      /// The list of file name(s)
-      std::vector< std::string > m_corrFileNameList;
-    
-      /// List of run numbers where histgrams become valid for full simulation
-      std::vector< unsigned int > m_begRunNumberList;
-    
-      /// List of run numbers where histgrams stop being valid for full simulation
-      std::vector< unsigned int > m_endRunNumberList;
-    
-
-      int m_runNumBegin, m_runNumEnd;
-      /// List of run numbers where histgrams become valid for fast simulation
-      std::vector< unsigned int > m_begRunNumberListFastSim;
-    
-      /// List of run numbers where histgrams stop being valid for fast simulation
-      std::vector< unsigned int > m_endRunNumberListFastSim;
-    
-    
-      /// List of histograms for full Geant4 simulation
-      std::map<TString, std::vector< TObjArray* > > m_histList;
-      std::vector< std::vector< TObjArray* > > m_sysList;
-
-      /// List of histograms for fast simulation
-      std::map<TString, std::vector< TObjArray* > > m_fastHistList;
-      std::vector< std::vector< TObjArray* > > m_fastSysList;
-
+      int m_runNumBegin;
+      int m_runNumEnd;
 
       /// The prefix string for the result
       std::string m_resultPrefix;
@@ -211,25 +178,37 @@ namespace Root {
       /// total number of bins in the efficiency tables
       int m_nbins; 
 
+      /// Number of uncorelated systematucs
       int m_nSimpleUncorrSyst;
 
+      /// The position of the efficiency scale factor uncorrelated systematic uncertainty in the result
+      int m_position_globalBinNumber; 
+
+      ///Uncorrelated toy systematics
+      std::vector< std::vector<TObjArray>> m_uncorrToyMCSystFull;
+      std::vector< std::vector<TObjArray>> m_uncorrToyMCSystFast;
+      /// The list of file name(s)
+      std::vector< std::string > m_corrFileNameList;
+      /// List of run numbers where histgrams become valid for full simulation
+      std::vector< unsigned int > m_begRunNumberList;
+      /// List of run numbers where histgrams stop being valid for full simulation
+      std::vector< unsigned int > m_endRunNumberList;
+      /// List of run numbers where histgrams become valid for fast simulation
+      std::vector< unsigned int > m_begRunNumberListFastSim;
+      /// List of run numbers where histgrams stop being valid for fast simulation
+      std::vector< unsigned int > m_endRunNumberListFastSim;    
+      /// List of histograms for full Geant4 simulation
+      std::map<int, std::vector< TObjArray > > m_histList;
+      std::vector< std::vector< TObjArray > > m_sysList;
+      /// List of histograms for fast simulation
+      std::map<int, std::vector< TObjArray > > m_fastHistList;
+      std::vector< std::vector< TObjArray > > m_fastSysList;
       /// The positions of the efficiency scale factor correlated sustematic uncertainties in the result
       std::vector<int> m_position_corrSys; 
-
       /// The positions of the toy MC scale factors
       std::vector<int> m_position_uncorrToyMCSF; 
-
-      /// The position of the efficiency scale factor uncorrelated systematic uncertainty in the result
-      int m_position_globalBinNumber; 
-
-      std::vector<std::string> m_keys;
-
-      int m_runnumberIndex;
-      unsigned int m_last_runnumber;
-      PATCore::ParticleDataType::DataType m_last_dataType;
-      std::map<std::string, const TH1*> *m_last_hist;
-      std::map<std::string, const TObjArray*> *m_last_hists;
-    
+      ///The vector holding the keys
+      std::vector<int> m_keys;
     
     }; // End: class definition
   
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/selection.xml b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/selection.xml
index 9d9ed8400e545ed6113517b7673801ace930032a..42ea137ec7cbce54e7094956c02ece2869683584 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/selection.xml
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/selection.xml
@@ -1,4 +1,4 @@
 <lcgdict>
     <class name="AsgElectronEfficiencyCorrectionTool" /> 
-    <class name="IAsgElectronEfficiencyCorrectionTool" /> 
+    <class name="CP::ElectronChargeEfficiencyCorrectionTool" /> 
 </lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx
index 82886ac9b073b90ca60c9b8912e6120b138a585e..ca93f17b86be8fa41bd6d67f59788170ab4ef551 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx
@@ -5,45 +5,62 @@
 /**
    @class AthElectronEfficiencyCorrectionTool
    @brief Calculate the egamma scale factors in Athena
-
-   @author Rob Roy Fletcher <rob.fletcher@cern.ch>, Karsten Koeneke
-   @date   May 2014
 */
 
 // Include this class's header
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
+#include "PathResolver/PathResolver.h"
 
 // STL includes
 #include <string>
 #include <cfloat>
-// #include <climits>
+#include <iostream>
 #include <iomanip>
 #include <iostream>
 #include <limits.h>
-
+#include <fstream>
+#include <sys/types.h>
+#include <dirent.h>
+#include <errno.h>
 // Include the return object
-#include "PATCore/TResult.h"
 #include "PATCore/PATCoreEnums.h"
-
 // xAOD includes
 #include "xAODEgamma/Electron.h"
 #include "xAODEventInfo/EventInfo.h"
+
+#include <boost/algorithm/string.hpp>
+
+#ifndef ROOTCORE
+#include "AthAnalysisBaseComps/AthAnalysisHelper.h"
+#endif
+
+#include "xAODMetaData/FileMetaData.h"
 #include "PathResolver/PathResolver.h"
+#include "ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h"
 
 
 // ROOT includes
 #include "TSystem.h"
 
-
+namespace correlationModel{
+  enum model { COMBMCTOYS =0,
+	       MCTOYS=1,
+	       FULL=2,
+	       SIMPLIFIED=3,
+	       TOTAL=4,
+	       SYST=5
+  };
+}
 
 // =============================================================================
 // Standard constructor
 // =============================================================================
 AsgElectronEfficiencyCorrectionTool::AsgElectronEfficiencyCorrectionTool(std::string myname) :
-  AsgTool(myname),
+  asg::AsgMetadataTool(myname),
   m_rootTool(0),
   m_affectedSys(),
   m_appliedSystematics(0),
+  m_correlation_model(correlationModel::SIMPLIFIED),
   m_sysSubstring(""),
   m_dataType(PATCore::ParticleDataType::Full),
   m_nCorrSyst(0),
@@ -52,13 +69,22 @@ AsgElectronEfficiencyCorrectionTool::AsgElectronEfficiencyCorrectionTool(std::st
   m_nSimpleUncorrSyst(0) {
   // Create an instance of the underlying ROOT tool
   m_rootTool = new Root::TElectronEfficiencyCorrectionTool(("T" + (this->name())).c_str());
-
   // Declare the needed properties
   declareProperty("CorrectionFileNameList", m_corrFileNameList,
-                  "List of file names that store the correction factors for simulation.");
+		  "List of file names that store the correction factors for simulation.");
+  declareProperty("MapFilePath", m_mapFile = "ElectronEfficiencyCorrection/2015_2016/rel20.7/Moriond_February2017_v2/map0.txt" ,
+		  "Full path to the map file");
+  declareProperty("RecoKey", m_recoKey = "" ,
+		  "Key associated with reconstruction");
+  declareProperty("IdKey", m_idKey = "" ,
+		  "Key associated with identification working point");
+  declareProperty("IsoKey", m_isoKey = "" ,
+		  "Key associated with isolation working point");
+  declareProperty("TriggerKey", m_trigKey = "" ,
+		  "Key associated with trigger working point");
 
   declareProperty("ForceDataType", m_dataTypeOverwrite = -1,
-                  "Force the DataType of the electron to specified value (to circumvent problem of incorrect DataType for forward electrons in some old releases)");
+		  "Force the DataType of the electron to specified value (to circumvent problem of incorrect DataType for forward electrons in some old releases)");
 
   declareProperty("ResultPrefix", m_resultPrefix = "", "The prefix string for the result");
   declareProperty("ResultName", m_resultName = "", "The string for the result");
@@ -71,7 +97,6 @@ AsgElectronEfficiencyCorrectionTool::AsgElectronEfficiencyCorrectionTool(std::st
   declareProperty("EventInfoCollectionName",  m_eventInfoCollectionName= "EventInfo", "The EventInfo Collection Name");
   declareProperty("UseRandomRunNumber",  m_useRandomRunNumber = true);
   declareProperty("DefaultRandomRunNumber",  m_defaultRandomRunNumber = 999999);
-
 }
 
 // =============================================================================
@@ -84,7 +109,6 @@ AsgElectronEfficiencyCorrectionTool::~AsgElectronEfficiencyCorrectionTool() {
   if (finalize().isFailure()) {
     ATH_MSG_ERROR("Failure in AsgElectronEfficiencyCorrectionTool finalize()");
   }
-
   delete m_rootTool;
 }
 
@@ -95,26 +119,38 @@ StatusCode
 AsgElectronEfficiencyCorrectionTool::initialize() {
   // Forward the message level
   m_rootTool->msg().setLevel(this->msg().level());
-  if (m_corrFileNameList.empty()) {
-    ATH_MSG_ERROR("CorrectionFileNameList is empty! Please configure it properly...");
+
+  if (m_corrFileNameList.empty() &&  m_recoKey == ""  &&  m_idKey == "" && m_trigKey == "" && m_isoKey== "" ) {
+    ATH_MSG_ERROR("CorrectionFileNameList as well as SFKeys are empty! Please configure it properly...");
     return StatusCode::FAILURE;
   }
 
   // The user wants to overwrite the m_dataType
   // Otherwise it will be full
   // When we will use metadata  m_dataType will be whatever the metadata says i.e Full or Fast
-  // And we will need to check for the existence of overwrite also there so as it not get overwritten again.
+  // We will need to check for the existence of overwrite
+  // and if overwrite is not set we will set the m_dataType based on metadata
   if (m_dataTypeOverwrite != -1) {
     if (m_dataTypeOverwrite != static_cast<int> (PATCore::ParticleDataType::Full)
-        && m_dataTypeOverwrite != static_cast<int> (PATCore::ParticleDataType::Fast)) {
+	&& m_dataTypeOverwrite != static_cast<int> (PATCore::ParticleDataType::Fast)) {
       ATH_MSG_ERROR("Unsupported Particle Data Type Overwrite" << m_dataTypeOverwrite);
       return StatusCode::FAILURE;
     }
     m_dataType = static_cast<PATCore::ParticleDataType::DataType>(m_dataTypeOverwrite);
   }
 
+  //Find the relevant input files
+  //Fill the vector with filename using keys if the user
+  //has not passed the full filename as a property
+  if (m_corrFileNameList.size() == 0) {
+    if(getFile(m_recoKey, m_idKey, m_isoKey, m_trigKey).isFailure()){
+      ATH_MSG_ERROR("No Root file input specified, and not available map file");
+      return StatusCode::FAILURE;
+    }
+  }
   // Resolve the paths to the input files for the full Geant4 simualtion corrections
-  for (unsigned int i = 0; i < m_corrFileNameList.size(); ++i) {
+  for (size_t i = 0; i < m_corrFileNameList.size(); ++i) {
+
     std::string filename = PathResolverFindCalibFile(m_corrFileNameList.at(i));
     if (filename.empty()) {
       ATH_MSG_ERROR("Could NOT resolve file name " << m_corrFileNameList.at(i));
@@ -122,51 +158,67 @@ AsgElectronEfficiencyCorrectionTool::initialize() {
     }else {
       ATH_MSG_INFO(" Path found = " << filename);
     }
-    m_corrFileNameList.at(i) = filename;
-  }
-
-  // Configure the underlying Root tool
-  for (unsigned int i = 0; i < m_corrFileNameList.size(); ++i) {
-    m_rootTool->addFileName(m_corrFileNameList[i]);
-
+    m_rootTool->addFileName(filename);
     // Determine the systematics substring according to the name of the input file
-    if (m_corrFileNameList[i].find("efficiencySF.") != std::string::npos) {
+    if (m_corrFileNameList.at(i).find("efficiencySF.") != std::string::npos) {
       m_sysSubstring = "Trigger_";
     }
-    if (m_corrFileNameList[i].find("efficiencySF.offline") != std::string::npos) {
+    if (m_corrFileNameList.at(i).find("efficiencySF.offline") != std::string::npos) {
       m_sysSubstring = "ID_";
     }
-    if (m_corrFileNameList[i].find("efficiencySF.offline.RecoTrk") != std::string::npos) {
+    if (m_corrFileNameList.at(i).find("efficiencySF.offline.RecoTrk") != std::string::npos) {
       m_sysSubstring = "Reco_";
     }
-    if (m_corrFileNameList[i].find("efficiencySF.Isolation") != std::string::npos) {
+    if (m_corrFileNameList.at(i).find("efficiencySF.Isolation") != std::string::npos) {
       m_sysSubstring = "Iso_";
     }
-    if (m_corrFileNameList[i].find("efficiency.") != std::string::npos) {
+    if (m_corrFileNameList.at(i).find("efficiency.") != std::string::npos) {
       m_sysSubstring = "TriggerEff_";
     }
+    if (m_corrFileNameList.at(i).find("efficiencySF.ChargeID") != std::string::npos) {
+      m_sysSubstring = "ChargeIDSel_";
+    }
     if (m_sysSubstring == "") {
+      ATH_MSG_ERROR("Could NOT find systematics Substring file name " << m_sysSubstring);
       return StatusCode::FAILURE;
     }
   }
-
+  //
   m_rootTool->setResultPrefix(m_resultPrefix);
   m_rootTool->setResultName(m_resultName);
-
-  if (m_correlation_model_name != "COMBMCTOYS"
-      && m_correlation_model_name != "MCTOYS"
-      && m_correlation_model_name != "FULL"
-      && m_correlation_model_name != "SIMPLIFIED"
-      && m_correlation_model_name != "TOTAL"
-      && m_correlation_model_name != "SYST"
-      ) {
+  //
+  //
+  //Find the proper correlation Model
+  if (m_correlation_model_name == "COMBMCTOYS"){
+    m_correlation_model= correlationModel::COMBMCTOYS;
+  }
+  else if(m_correlation_model_name == "MCTOYS"){
+    m_correlation_model= correlationModel::MCTOYS;
+  }
+  else if(m_correlation_model_name == "FULL"){
+    m_correlation_model= correlationModel::FULL;
+  }
+  else if(m_correlation_model_name == "SIMPLIFIED"){
+    m_correlation_model= correlationModel::SIMPLIFIED;
+  }
+  else if(m_correlation_model_name == "TOTAL"){
+    m_correlation_model= correlationModel::TOTAL;
+  }
+  else if(m_correlation_model_name == "SYST"){
+    m_correlation_model= correlationModel::SYST;
+  }
+  else{
     ATH_MSG_ERROR("Unknown correlation model " + m_correlation_model_name);
     return StatusCode::FAILURE;
   }
+  ATH_MSG_INFO("Correlation model: " + m_correlation_model_name << " Enum " << m_correlation_model);
 
-  ATH_MSG_INFO("Correlation model: " + m_correlation_model_name);
-
-  if (m_correlation_model_name == "SIMPLIFIED") {
+  //
+  //Finish the preaparation of the underlying tool
+  //
+  //
+  //
+  if (m_correlation_model == correlationModel::SIMPLIFIED) {
     // cretate uncorrelated eta/pt bins
     //
     std::vector<float> eta;
@@ -176,8 +228,8 @@ AsgElectronEfficiencyCorrectionTool::initialize() {
     // eta.push_back(2.01);
     eta.push_back(2.47);
 
-
     std::vector<float> pt;
+    pt.push_back(4500);
     pt.push_back(7000);
     pt.push_back(10000);
     pt.push_back(15000);
@@ -192,42 +244,43 @@ AsgElectronEfficiencyCorrectionTool::initialize() {
     // bins not entries here
     m_nSimpleUncorrSyst = (eta.size() - 1) * (pt.size() - 1);
   }
-
+  //
   if (m_seed_toys != 0) {
     m_rootTool->setSeed(m_seed_toys);
   }
-
-  if (m_correlation_model_name == "COMBMCTOYS") {
+  //
+  if (m_correlation_model == correlationModel::COMBMCTOYS) {
     m_rootTool->bookCombToyMCScaleFactors(m_number_of_toys);
   }
-  if (m_correlation_model_name == "MCTOYS") {
+  //
+  if (m_correlation_model == correlationModel::MCTOYS) {
     m_rootTool->bookToyMCScaleFactors(m_number_of_toys);
   }
-
   // We need to initialize the underlying ROOT TSelectorTool
   if (0 == m_rootTool->initialize()) {
     ATH_MSG_ERROR("Could not initialize the TElectronEfficiencyCorrectionTool!");
     return StatusCode::FAILURE;
   }
+  //
   // Copy the now filled TResult to the dummy
   m_resultDummy = m_rootTool->getTResult();
   // get Nsyst
   m_nCorrSyst = m_rootTool->getNSyst();
-
-  if (m_correlation_model_name == "FULL") {
+  //
+  if (m_correlation_model == correlationModel::FULL) {
     m_nUncorrSyst = m_rootTool->getNbins(m_pteta_bins);
   }
-
-  // Add the recommended systematics to the registry
-  if (registerSystematics() != CP::SystematicCode::Ok) {
-    return StatusCode::FAILURE;
-  }
-
+  //
+  //
+  //
+  //Initialize the systematics
   if (InitSystematics() != CP::SystematicCode::Ok) {
+    ATH_MSG_ERROR("(InitSystematics() != CP::SystematicCode::Ok)");
     return StatusCode::FAILURE;
   }
   // Add the recommended systematics to the registry
   if (registerSystematics() != CP::SystematicCode::Ok) {
+    ATH_MSG_ERROR("(registerSystematics() != CP::SystematicCode::Ok)");
     return StatusCode::FAILURE;
   }
   // Configure for nominal systematics
@@ -238,7 +291,7 @@ AsgElectronEfficiencyCorrectionTool::initialize() {
   return StatusCode::SUCCESS;
 }
 
-// =============================================================================
+/// =============================================================================
 // Athena finalize method
 // =============================================================================
 StatusCode
@@ -252,12 +305,10 @@ AsgElectronEfficiencyCorrectionTool::finalize() {
 
 CP::CorrectionCode
 AsgElectronEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Electron &inputObject,
-                                                              double &efficiencyScaleFactor) const {
-  int currentUncorrSystRegion = 0;
-  int currentSimplifiedUncorrSystRegion = 0;
+							      double &efficiencyScaleFactor) const {
 
+  //Retrieve the proper random Run Number
   unsigned int runnumber = m_defaultRandomRunNumber;
-
   if (m_useRandomRunNumber) {
     const xAOD::EventInfo *eventInfo = evtStore()->retrieve< const xAOD::EventInfo> (m_eventInfoCollectionName);
     if (!eventInfo) {
@@ -265,8 +316,7 @@ AsgElectronEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Electr
       efficiencyScaleFactor = 1;
       return CP::CorrectionCode::Error;
     }
-
-    static SG::AuxElement::Decorator<unsigned int> randomrunnumber("RandomRunNumber");
+    static const SG::AuxElement::Accessor<unsigned int> randomrunnumber("RandomRunNumber");
     if (!randomrunnumber.isAvailable(*eventInfo)) {
       efficiencyScaleFactor = 1;
       ATH_MSG_WARNING(
@@ -275,8 +325,19 @@ AsgElectronEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Electr
     }
     runnumber = randomrunnumber(*(eventInfo));
   }
-  const Root::TResult result = calculate(inputObject, runnumber, currentSimplifiedUncorrSystRegion,
-					 currentUncorrSystRegion);
+  //
+  //Get the result 
+  double cluster_eta(-9999.9);
+  double et(0.0);
+
+
+  et = inputObject.pt();
+  const xAOD::CaloCluster *cluster = inputObject.caloCluster();
+  if (cluster) {
+    cluster_eta = cluster->etaBE(2);
+  }
+
+  const Root::TResult& result = calculate(cluster_eta,et, runnumber);
   efficiencyScaleFactor = result.getScaleFactor();
 
   // The default of the underlying tool is -999 , if we are in a valid range
@@ -285,94 +346,142 @@ AsgElectronEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Electr
     efficiencyScaleFactor = 1;
     return CP::CorrectionCode::OutOfValidityRange;
   }
-
   if (appliedSystematics().empty()) {
     return CP::CorrectionCode::Ok;
   }
+  // ==============================================================================//
+  //Systematic Variations
+  //We pass only one variation per time
   // The applied systemetic is always one
   // Either is relevant and acquires a values
   // or stays 0.
   double sys(0);
-  // ==============================================================================//
   // First the Toys
-  if (m_correlation_model_name == "MCTOYS" || m_correlation_model_name == "COMBMCTOYS") {
-    // Check if more than one set is requested
-    if (appliedSystematics().size() > 1) {
-      // This should not pass applySystematicVariation ...
-      efficiencyScaleFactor = 1.0;
-      return CP::CorrectionCode::Error;
-    }else {
-      if (m_correlation_model_name == "MCTOYS") {
-        auto toy = appliedSystematics().getToyVariationByBaseName("EL_EFF_" + m_sysSubstring + "MCTOY");
-        toy.second = m_scale_toys;
-        sys = result.getResult((m_rootTool->getFirstToyMCPosition() - 1 + toy.first + 1) * m_scale_toys);
-      }
-      if (m_correlation_model_name == "COMBMCTOYS") {
-        auto toy = appliedSystematics().getToyVariationByBaseName("EL_EFF_" + m_sysSubstring + "COMBMCTOY");
-        toy.second = m_scale_toys;
-        sys = result.getResult((m_rootTool->getFirstToyMCPosition() - 1 + toy.first) * m_scale_toys);
-      }
+  if (m_correlation_model == correlationModel::MCTOYS || m_correlation_model == correlationModel::COMBMCTOYS) {
+    if (m_correlation_model == correlationModel::MCTOYS) {
+      auto toy = appliedSystematics().getToyVariationByBaseName("EL_EFF_" + m_sysSubstring + "MCTOY");
+      toy.second = m_scale_toys;
+      sys = result.getResult((m_rootTool->getFirstToyMCPosition() - 1 + toy.first) * m_scale_toys);
+    }
+    else if (m_correlation_model == correlationModel::COMBMCTOYS) {
+      auto toy = appliedSystematics().getToyVariationByBaseName("EL_EFF_" + m_sysSubstring + "COMBMCTOY");
+      toy.second = m_scale_toys;
+      sys = result.getResult((m_rootTool->getFirstToyMCPosition() - 1 + toy.first) * m_scale_toys);
     }
     // return here for Toy variations
     efficiencyScaleFactor = sys;
     return CP::CorrectionCode::Ok;
   }
-
-  // ==============================================================================//
-  //We pass only one variation per time
-  std::string variation("__" + appliedSystematics().begin()->subvariation());
-  float param = appliedSystematics().begin()->parameter();
+  //The rest of the models
+  //
+  //Helper function
+  //
+  //Calculate and return at the spot
   auto func = [](double &sf, const double input) {
     sf = sf + input;
     return CP::CorrectionCode::Ok;
   };
-  // ==============================================================================//
-  // First the correlated
+  //
+  //
+  if (m_correlation_model == correlationModel::TOTAL) { // one "TOTAL" uncertainty
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     m_correlation_model_name + "_" +
+								     "1NPCOR_PLUS_UNCOR" ,1))) {
+      sys = result.getTotalUncertainty();
+      func(efficiencyScaleFactor, sys);
+    }
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     m_correlation_model_name + "_" +
+								     "1NPCOR_PLUS_UNCOR" ,-1))) {
+      sys =  -1*result.getTotalUncertainty();
+      func(efficiencyScaleFactor, sys);
+    }
+  }
+  //If there are not correlated systematic
   if (m_nCorrSyst == 0) {
-    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty" +
-                                                                     variation))) {
-      sys = param * sqrt(result.getTotalUncertainty() * result.getTotalUncertainty() 
-			 - result.getResult(4) * result.getResult(4)); // total -stat
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty",1))) {
+
+      sys = sqrt(result.getTotalUncertainty() * result.getTotalUncertainty()
+		 - result.getResult(4) * result.getResult(4)); // total -stat
       func(efficiencyScaleFactor, sys);
     }
-  }else if (m_correlation_model_name == "TOTAL") { // one "TOTAL" uncertainty
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty" ,-1))) {
+
+      sys = -1* sqrt(result.getTotalUncertainty() * result.getTotalUncertainty()
+		     - result.getResult(4) * result.getResult(4)); // total -stat
+      func(efficiencyScaleFactor, sys);
+    }
+  }else if (m_correlation_model == correlationModel::TOTAL) { // one "TOTAL" uncertainty
     if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
                                                                      m_correlation_model_name + "_" +
-                                                                     "1NPCOR_PLUS_UNCOR" + variation))) {
-      sys = param * result.getTotalUncertainty();
+                                                                     "1NPCOR_PLUS_UNCOR" ,1))) {
+      sys = result.getTotalUncertainty();
       func(efficiencyScaleFactor, sys);
     }
-  }else { // Then do the proper models
-    for (int i = 0; i < m_nCorrSyst; ++i) {/// number of correlated sources
-      if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
-                                                                       Form("CorrUncertaintyNP%d", i) + variation))) {
-        sys = param * result.getResult(5 + i);
-        func(efficiencyScaleFactor, sys);
-      }
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+                                                                     m_correlation_model_name + "_" +
+                                                                     "1NPCOR_PLUS_UNCOR" ,-1))) {
+      sys =  -1*result.getTotalUncertainty();
+      func(efficiencyScaleFactor, sys);
     }
   }
   // =======================================================================
   // Then the uncorrelated, we just need to see if the applied matches the current electron pt and eta
-  if (m_correlation_model_name == "FULL") {// The Full Model
+  if (m_correlation_model == correlationModel::FULL) {// The Full Model
+
+    int currentUncorrSystReg = currentUncorrSystRegion( cluster_eta, et);
+
     if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
-                                                                     m_correlation_model_name + "_" +
-                                                                     Form("UncorrUncertaintyNP%d",
-                                                                          currentUncorrSystRegion) + variation))) {
-      sys = param * result.getResult(4);//
+								     m_correlation_model_name + "_" +
+								     Form("UncorrUncertaintyNP%d",
+									  currentUncorrSystReg),1))) {
+      sys = result.getResult(4);//
+      func(efficiencyScaleFactor, sys);
+    }
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     m_correlation_model_name + "_" +
+								     Form("UncorrUncertaintyNP%d",
+									  currentUncorrSystReg),-1))) {
+      sys = -1*result.getResult(4);//
       func(efficiencyScaleFactor, sys);
     }
   }
-  if (m_correlation_model_name == "SIMPLIFIED") {
+  else if (m_correlation_model == correlationModel::SIMPLIFIED) {
+
+    int currentSimplifiedUncorrSystReg = currentSimplifiedUncorrSystRegion( cluster_eta, et);
+
     if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
-                                                                     m_correlation_model_name + "_" +
-                                                                     Form("UncorrUncertaintyNP%d",
-                                                                          currentSimplifiedUncorrSystRegion) +
-								     variation))) {
-      sys = param * result.getResult(4);//
+								     m_correlation_model_name + "_" +
+								     Form("UncorrUncertaintyNP%d",
+									  currentSimplifiedUncorrSystReg),1))) {
+      sys = result.getResult(4);//
+      func(efficiencyScaleFactor, sys);
+    }
+
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     m_correlation_model_name + "_" +
+								     Form("UncorrUncertaintyNP%d",
+									  currentSimplifiedUncorrSystReg),-1))) {
+      sys = -1*result.getResult(4);//
+      func(efficiencyScaleFactor, sys);
+    }
+  }
+
+  //If it has not returned so far , it means we wants to do the correlated for the full models
+  for (int i = 0; i < m_nCorrSyst; ++i) {/// number of correlated sources
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     Form("CorrUncertaintyNP%d", i),1))) {
+      sys = result.getResult(5 + i);
+      func(efficiencyScaleFactor, sys);
+    }
+    if (appliedSystematics().matchSystematic(CP::SystematicVariation("EL_EFF_" + m_sysSubstring +
+								     Form("CorrUncertaintyNP%d", i),-1))) {
+      sys = -1* result.getResult(5 + i);
       func(efficiencyScaleFactor, sys);
     }
   }
   return CP::CorrectionCode::Ok;
+
 }
 
 CP::CorrectionCode
@@ -390,11 +499,20 @@ AsgElectronEfficiencyCorrectionTool::applyEfficiencyScaleFactor(const xAOD::Elec
 // =======================================================================
 bool
 AsgElectronEfficiencyCorrectionTool::isAffectedBySystematic(const CP::SystematicVariation &systematic) const {
-  if (!systematic.empty()) {
-    CP::SystematicSet sys = affectingSystematics();
-    return sys.find(systematic) != sys.end();
+
+  if (systematic.empty()) {
+    return false;
+  }
+
+  CP::SystematicSet sys = affectingSystematics();
+
+  if (m_correlation_model == correlationModel::MCTOYS
+      || m_correlation_model == correlationModel::COMBMCTOYS ){
+    return(sys.begin()->ensembleContains(systematic)) ;
+  }
+  else{
+    return (sys.find(systematic) != sys.end());
   }
-  return true;
 }
 
 /// returns: the list of all systematics this tool can be affected by
@@ -449,7 +567,7 @@ AsgElectronEfficiencyCorrectionTool::applySystematicVariation(const CP::Systemat
     if (filteredSys.size() == 0 && systConfig.size() > 0) {
       ATH_MSG_DEBUG("systematics : ");
       for (auto &syst : systConfig) {
-        ATH_MSG_DEBUG(syst.name());
+	ATH_MSG_DEBUG(syst.name());
       }
       ATH_MSG_DEBUG(" Not supported ");
     }
@@ -468,116 +586,351 @@ AsgElectronEfficiencyCorrectionTool::applySystematicVariation(const CP::Systemat
 // The main Result  method:
 // TRANSFER RESULT OF UNDERLYING TOOL TO xAOD TOOL
 // =============================================================================
-const Root::TResult &
-AsgElectronEfficiencyCorrectionTool::calculate(const xAOD::Electron &egam, const unsigned int runnumber,
-                                               int &currentSimplifiedUncorrSystRegion, int &currentUncorrSystRegion
-                                               ) const {
-  double cluster_eta(-9999.9);
-  double et(0.0);
-
-  et = egam.pt();
-  const xAOD::CaloCluster *cluster = egam.caloCluster();
-  if (cluster) {
-    cluster_eta = cluster->etaBE(2);
-  }
+const Root::TResult& AsgElectronEfficiencyCorrectionTool::calculate(const double cluster_eta, const double et, const unsigned int runnumber) const {
 
-  //  std::cout<< cluster_eta << std::endl;
-  /* For now the dataType must be set by the user. May be added to the IParticle class later.  */
-  if (m_correlation_model_name == "SIMPLIFIED") {
-    int ptbin = m_UncorrRegions->GetXaxis()->FindBin(et) - 1;
-    int etabin = m_UncorrRegions->GetYaxis()->FindBin(fabs(cluster_eta)) - 1;
-    int reg = ((etabin) * m_UncorrRegions->GetNbinsX() + ptbin);
-    currentSimplifiedUncorrSystRegion = reg;
-  }
-  if (m_correlation_model_name == "FULL") {
-    int etabin = -1;
-    int reg = 0;
-    bool found = false;
-    float cluster_eta_electron = 0;
-
-    std::map<float, std::vector<float> >::const_iterator itr_ptBEGIN = m_pteta_bins.begin();
-    std::map<float, std::vector<float> >::const_iterator itr_ptEND = m_pteta_bins.end();
-
-    // Consider using std::map::lower_bound, returns the iterator to the first element that is greater-or-equal to a pt
-
-    for (; itr_ptBEGIN != itr_ptEND; itr_ptBEGIN++) {
-      std::map<float, std::vector<float> >::const_iterator itr_ptBEGINplusOne = itr_ptBEGIN;
-      itr_ptBEGINplusOne++;
-
-      if ((et > itr_ptBEGIN->first && itr_ptBEGINplusOne == itr_ptEND) ||
-          (et > itr_ptBEGIN->first && et < itr_ptBEGINplusOne->first)) {// find the pt bin
-        etabin++;
-        // if it is ordered in eta from smaller to larger ascending order
-        // consider using std::lower_bound(begin,end) to find the position?
-        if ((itr_ptBEGIN->second).at(0) >= 0) {
-          cluster_eta_electron = fabs(cluster_eta);
-        }else {
-          cluster_eta_electron = (cluster_eta);
-        };
-
-        for (unsigned int etab = 0; etab < ((itr_ptBEGIN->second).size() - 1); ++etab) {// find the eta bin
-          if ((cluster_eta_electron) > (itr_ptBEGIN->second).at(etab) &&
-              (cluster_eta_electron) < (itr_ptBEGIN->second).at(etab + 1)) {
-            found = true;
-            break;
-          } // if ( (cluster_eta_electron)
-        } // for (unsigned int etab=0;etab<((itr_ptBEGIN->second).size()-1) ; ++etab)
-      }
-      if (found) {
-        break;
-      }
-      reg = reg + (itr_ptBEGIN->second).size();
-    }
-    reg = reg + etabin;
-    currentUncorrSystRegion = reg;
-  }
   // Call the ROOT tool to get an answer
   return m_rootTool->calculate(m_dataType,
-                               runnumber,
-                               cluster_eta,
-                               et /* in MeV */
-                               );
+			       runnumber,
+			       cluster_eta,
+			       et /* in MeV */
+			       );
 }
-
 /// returns: initialized the list for a specific model
+
 CP::SystematicCode
 AsgElectronEfficiencyCorrectionTool::InitSystematics() {
 
   // Correlated
-  if (m_correlation_model_name == "COMBMCTOYS") {
+  if (m_correlation_model == correlationModel::COMBMCTOYS) {
     m_affectedSys.insert((CP::SystematicVariation::makeToyEnsemble("EL_EFF_" + m_sysSubstring + "COMBMCTOY")));
-  }else if (m_correlation_model_name == "MCTOYS") {
+  }else if (m_correlation_model == correlationModel::MCTOYS) {
     m_affectedSys.insert((CP::SystematicVariation::makeToyEnsemble("EL_EFF_" + m_sysSubstring + "MCTOY")));
+
   }else if (m_nCorrSyst == 0) {
     m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty", 1));
     m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty", -1));
-  }else if (!(m_correlation_model_name == "TOTAL")) {
-    for (int i = 0; i < m_nCorrSyst; ++i) {
-      m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + Form("CorrUncertaintyNP%d", i), 1));
-      m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + Form("CorrUncertaintyNP%d", i), -1));
-    }
+
+  }else if (m_correlation_model != correlationModel::TOTAL) {
+    if ( m_nCorrSyst == 0 ) {
+      m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty", 1));
+      m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + "CorrUncertainty", -1));
+    } else for (int i = 0; i < m_nCorrSyst; ++i) {
+	m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + Form("CorrUncertaintyNP%d", i), 1));
+	m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + Form("CorrUncertaintyNP%d", i), -1));
+      }
   }
   // Different tratement for the uncorrelated
-  if (m_correlation_model_name == "TOTAL") {
+  if (m_correlation_model == correlationModel::TOTAL) {
     m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                 "1NPCOR_PLUS_UNCOR", 1));
+						 "1NPCOR_PLUS_UNCOR", 1));
     m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                 "1NPCOR_PLUS_UNCOR", -1));
-  }else if (m_correlation_model_name == "FULL") {
+						 "1NPCOR_PLUS_UNCOR", -1));
+  }else if (m_correlation_model == correlationModel::FULL) {
     for (int i = 0; i < m_nUncorrSyst; ++i) {
       m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                   Form("UncorrUncertaintyNP%d", i), 1));
+						   Form("UncorrUncertaintyNP%d", i), 1));
       m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                   Form("UncorrUncertaintyNP%d", i), -1));
+						   Form("UncorrUncertaintyNP%d", i), -1));
     }
-  }else if (m_correlation_model_name == "SIMPLIFIED") {
+  }else if (m_correlation_model == correlationModel::SIMPLIFIED) {
     for (int i = 0; i < m_nSimpleUncorrSyst; ++i) {
       m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                   Form("UncorrUncertaintyNP%d", i), 1));
+						   Form("UncorrUncertaintyNP%d", i), 1));
       m_affectedSys.insert(CP::SystematicVariation("EL_EFF_" + m_sysSubstring + m_correlation_model_name + "_" +
-                                                   Form("UncorrUncertaintyNP%d", i), -1));
+						   Form("UncorrUncertaintyNP%d", i), -1));
     }
   }
-
   return CP::SystematicCode::Ok;
 }
+
+//===============================================================================
+// begin input file
+//===============================================================================
+StatusCode AsgElectronEfficiencyCorrectionTool::beginInputFile(){
+
+  // User preference of dataType, already done in initialize
+  if (m_dataTypeOverwrite != -1) return StatusCode::SUCCESS;
+
+  PATCore::ParticleDataType::DataType dataType_metadata;
+  const StatusCode status = get_simType_from_metadata(dataType_metadata);
+
+  if (status == StatusCode::SUCCESS) {
+    //m_metadata_retrieved isn't useful (might remove it later)
+    m_metadata_retrieved = true;
+    ATH_MSG_DEBUG("metadata from new file: " << (dataType_metadata == PATCore::ParticleDataType::Data ? "data" : (dataType_metadata == PATCore::ParticleDataType::Full ? "full simulation" : "fast simulation")));
+
+    if (dataType_metadata != PATCore::ParticleDataType::Data) {
+
+      if (m_dataTypeOverwrite == -1) { m_dataType = dataType_metadata; }
+      else {ATH_MSG_DEBUG("Use should set the dataType, otherwise it will take FullSim Type");}
+    }
+  }
+
+  else { // not able to retrieve metadata
+    m_metadata_retrieved = false;
+    ATH_MSG_DEBUG("not able to retrieve metadata, please set the dataType");
+  }
+
+  return StatusCode::SUCCESS;
+}
+//===============================================================================
+// end input file
+//===============================================================================
+StatusCode AsgElectronEfficiencyCorrectionTool::endInputFile(){
+  m_metadata_retrieved = false;
+  return StatusCode::SUCCESS;
+
+}
+//===============================================================================
+// end input file
+//===============================================================================
+StatusCode AsgElectronEfficiencyCorrectionTool::beginEvent(){
+
+  return StatusCode::SUCCESS;
+}
+
+//===============================================================================
+// Get Simulation flavor (FastSim or FullSim) from METADATA
+//===============================================================================
+StatusCode
+AsgElectronEfficiencyCorrectionTool::get_simType_from_metadata(PATCore::ParticleDataType::DataType& result) const
+{
+  // adapted from https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/AnalysisCommon/CPAnalysisExamples/trunk/Root/MetadataToolExample.cxx
+
+#ifndef ROOTCORE
+  //Determine MC/Data
+  std::string dataType("");
+  if ( (AthAnalysisHelper::retrieveMetadata("/TagInfo", "project_name", dataType, inputMetaStore())).isFailure() ){
+    ATH_MSG_DEBUG("Failure to retrieve the project_name, Either running on data or something is wrong?");
+  }
+  if (!(dataType == "IS_SIMULATION")) {
+    result = PATCore::ParticleDataType::Data;
+    ATH_MSG_DEBUG("Running on simulation");
+    return StatusCode::SUCCESS;
+  }
+
+  // Determine Fast/FullSim
+  if (dataType == "IS_SIMULATION") {
+    std::string simType("");
+    ATH_CHECK(AthAnalysisHelper::retrieveMetadata("/Simulation/Parameters", "SimulationFlavour", simType, inputMetaStore()));
+    boost::to_upper(simType);
+    result = (simType.find("ATLFASTII")==std::string::npos) ?  PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast;
+    return StatusCode::SUCCESS;
+  }
+#endif
+
+  //Here's how things will work dual use, when file metadata is available in files
+  if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
+    const xAOD::FileMetaData* fmd = 0;
+    ATH_CHECK(inputMetaStore()->retrieve(fmd, "FileMetaData"));
+
+    std::string simType("");
+    const bool s = fmd->value(xAOD::FileMetaData::simFlavour, simType);
+    if (!s) {
+      ATH_MSG_DEBUG("no sim flavour from metadata: must be data");
+      result = PATCore::ParticleDataType::Data;
+      return StatusCode::SUCCESS;
+    }
+    else {
+      ATH_MSG_DEBUG("sim type = " + simType);
+      boost::to_upper(simType);
+      result = (simType.find("ATLFASTII")==std::string::npos) ?  PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast;
+      return StatusCode::SUCCESS;
+    }
+  }
+  else {  // no metadata in the file
+    ATH_MSG_DEBUG("no metadata found in the file");
+    return StatusCode::FAILURE;
+  }
+
+}
+
+//===============================================================================
+// Map Key Feature
+//===============================================================================
+// Gets the correction filename from map
+StatusCode
+AsgElectronEfficiencyCorrectionTool::getFile(const std::string& recokey, const std::string& idkey, const std::string& isokey, const std::string& trigkey) {
+
+  std::string key = convertToOneKey(recokey, idkey, isokey, trigkey);
+  std::string mapFileName = PathResolverFindCalibFile(m_mapFile);
+  std::string value = getValueByKey(mapFileName, key);
+
+  if (value != "") {
+    m_corrFileNameList.push_back(value);
+  } else {
+    if (mapFileName == "") {
+      ATH_MSG_ERROR("Map file does not exist, Please set the path and version properly..");
+    }
+    else {
+      ATH_MSG_ERROR("Key does not exist in the map file, Please configure it properly..");
+    }
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_DEBUG("Full File Name is " + value);
+  return StatusCode::SUCCESS;
+}
+
+// Convert reco, ID, iso and trigger key values into a
+// single key according to the map file key format
+std::string
+AsgElectronEfficiencyCorrectionTool::convertToOneKey(const std::string& recokey, const std::string& idkey, const std::string& isokey, const std::string& trigkey) const {
+
+  std::string key;
+
+  // Reconstruction Key
+  if (recokey != ""){ key = recokey; }
+
+  // Identification Key
+  if (idkey != "" && (recokey == "" && isokey == "" && trigkey == "")){ key = idkey; }
+
+  // Isolation Key
+  if ((idkey != "" && isokey != "") && recokey == "" && trigkey == ""){ key = std::string(idkey + "_" + isokey); }
+
+  // Trigger Key
+  if (trigkey != "" && idkey != "") {
+
+    // Trigger SF file with isolation
+    if (isokey != "") {
+      key = std::string (trigkey + "_" + idkey + "_" + isokey);
+    } else {
+      // Trigger SF file without isolation
+      key = std::string(trigkey + "_" + idkey);
+    }
+  }
+  ATH_MSG_DEBUG("Full Key is " + key);
+  return key;
+}
+
+// Retrieves the value from the provided map file as
+// associated with the provided key
+std::string
+AsgElectronEfficiencyCorrectionTool::getValueByKey(const std::string& mapFile, const std::string& key) {
+
+  std::string value;
+  if (read(mapFile).isFailure()) {
+    ATH_MSG_ERROR("Couldn't read Map File" + mapFile);
+    return "" ;
+  }
+  if (getValue(key, value) == "") {
+    ATH_MSG_DEBUG("Error(" + key + ") not found ");
+    return "";
+  } else {
+    ATH_MSG_DEBUG("Full Path of the correction file is " + value);
+    return value;
+  }
+}
+// Reads the provided map file
+// and construct the map
+StatusCode
+AsgElectronEfficiencyCorrectionTool::read(const std::string& strFile) {
+
+  std::ifstream is(strFile.c_str());
+  if (!is.is_open()){
+    ATH_MSG_ERROR("Couldn't read Map File" + strFile);
+    return StatusCode::FAILURE;
+  }
+  while (!is.eof()) {
+    std::string strLine;
+    getline(is,strLine);
+
+    int nPos = strLine.find('=');
+
+    if ((signed int)std::string::npos == nPos) continue; // no '=', invalid line;
+    std::string strKey = strLine.substr(0,nPos);
+    std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
+    m_map.insert(std::map<std::string,std::string>::value_type(strKey,strVal));
+  }
+  return StatusCode::SUCCESS;
+}
+// Retrieves the value from the map file if
+// the provided key is found. If the key has an
+// association then, the actual retrieved value would
+// be assigned to the 2nd argument of this method
+std::string
+AsgElectronEfficiencyCorrectionTool::getValue(const std::string& strKey, std::string& strValue) {
+
+  std::map<std::string,std::string>::const_iterator i;
+  i = m_map.find(strKey);
+
+  if (i != m_map.end()) {
+    strValue = i->second;
+    return strValue;
+  }
+  return "";
+}
+
+int AsgElectronEfficiencyCorrectionTool::currentSimplifiedUncorrSystRegion(const double cluster_eta, const double et) const {
+  int ptbin = m_UncorrRegions->GetXaxis()->FindBin(et) - 1;
+  int etabin = m_UncorrRegions->GetYaxis()->FindBin(fabs(cluster_eta)) - 1;
+  int reg = ((etabin) * m_UncorrRegions->GetNbinsX() + ptbin);
+  return reg;
+}
+
+
+
+int AsgElectronEfficiencyCorrectionTool::currentUncorrSystRegion(const double cluster_eta, const double et) const {
+  int etabin = -1;
+  int reg = 0; 
+  bool found = false;
+  float cluster_eta_electron = 0;
+  std::map<float, std::vector<float> >::const_iterator itr_ptBEGIN = m_pteta_bins.begin();
+  std::map<float, std::vector<float> >::const_iterator itr_ptEND = m_pteta_bins.end();
+  // Consider using std::map::lower_bound, returns the iterator to the first element that is greater-or-equal to a pt
+  for (; itr_ptBEGIN != itr_ptEND; itr_ptBEGIN++) {
+    std::map<float, std::vector<float> >::const_iterator itr_ptBEGINplusOne = itr_ptBEGIN;
+    itr_ptBEGINplusOne++;
+
+    if ((et > itr_ptBEGIN->first && itr_ptBEGINplusOne == itr_ptEND) ||
+	(et > itr_ptBEGIN->first && et <= itr_ptBEGINplusOne->first)) {// find the pt bin
+      etabin=0;
+      // if it is ordered in eta from smaller to larger ascending order
+      // consider using std::lower_bound(begin,end) to find the position?
+      if ((itr_ptBEGIN->second).at(0) >= 0) {
+	cluster_eta_electron = fabs(cluster_eta);
+      }else {
+	cluster_eta_electron = (cluster_eta);
+      };
+      for (unsigned int etab = 0; etab < ((itr_ptBEGIN->second).size() - 1); ++etab) {// find the eta bin
+	etabin++;       
+	if ((cluster_eta_electron) > (itr_ptBEGIN->second).at(etab) &&
+	    (cluster_eta_electron) <= (itr_ptBEGIN->second).at(etab + 1)) {
+	  found = true;
+	  break;
+	} // if ( (cluster_eta_electron)
+      } // for (unsigned int etab=0;etab<((itr_ptBEGIN->second).size()-1) ; ++etab)
+    } 
+    if (found) {
+      break;
+    } 
+    reg = reg + (itr_ptBEGIN->second).size();
+  } 
+  reg = reg + etabin;
+  return reg;
+}
+
+int AsgElectronEfficiencyCorrectionTool::systUncorrVariationIndex( const xAOD::Electron &inputObject) const{
+  int currentSystRegion=-999;
+  double cluster_eta(-9999.9);
+  double et(0.0);
+ 
+  et = inputObject.pt();
+  const xAOD::CaloCluster *cluster = inputObject.caloCluster();
+  if (cluster) {
+    cluster_eta = cluster->etaBE(2);
+  }
+
+
+
+  if (m_correlation_model == correlationModel::SIMPLIFIED) {
+    currentSystRegion = currentSimplifiedUncorrSystRegion( cluster_eta, et);
+  }
+
+  if (m_correlation_model == correlationModel::FULL) {
+    currentSystRegion = currentUncorrSystRegion( cluster_eta, et);
+  }
+
+  return currentSystRegion;
+}
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..ffe1d0f85a1175f9d22da1227ad65c6d0b5d82b2
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx
@@ -0,0 +1,732 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+   @class ElectronChargeEfficiencyCorrectionTool
+   @brief Apply the correction for the electrons charge mis-ID different rates in MC/data
+
+   @author Giulia Gonella <giulia.gonella@cern.ch>
+   @date   September 2015
+*/
+// Include this class's header
+// #include "ElectronChargeEfficiencyCorrectionTool/ElectronChargeEfficiencyCorrectionTool.h"
+#include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
+// xAOD includes
+#include "PathResolver/PathResolver.h"
+// #include "xAODTruth/TruthEventContainer.h"
+// #include "xAODEgamma/EgammaTruthxAODHelpers.h"
+// #include "MCTruthClassifier/IMCTruthClassifier.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/Electron.h"
+
+// ROOT includes
+#include "TFile.h"
+// #include "TRandom.h"
+
+// STL includes
+#include <stdlib.h>     /* atoi */
+
+
+// =============================================================================
+// Standard constructor
+// =============================================================================
+CP::ElectronChargeEfficiencyCorrectionTool::ElectronChargeEfficiencyCorrectionTool(std::string name) :
+  AsgTool(name),
+  m_dataTypeOverwrite(-1),
+  m_eventInfoCollectionName("EventInfo"),
+  m_SF_SS(),
+  m_SF_OS(),
+  m_RunNumbers(),
+  m_useRandomRunNumber(true),
+  m_defaultRandomRunNumber(999999),
+  m_filename(""),
+  m_workingPoint(""),
+  m_eta_lowlimit(0.0),
+  m_eta_uplimit(0.0),
+  m_pt_lowlimit(0.0),
+  m_pt_uplimit(0.0),
+  m_gevmev(0.0),
+  m_truthCharge(0),
+  m_filtered_sys_sets(),
+  m_mySysConf(),
+  m_affectingSys(),
+  m_sf_decoration_name("chargeIDEffiSF"),
+  m_sfDec(0)
+{
+  // Declare the needed properties
+  declareProperty("CorrectionFileName",        m_filename,     "Name of the file with charge flipping rates");
+  declareProperty("WorkingPoint",              m_workingPoint, "Name of working point folder in the file");
+  declareProperty("ScaleFactorDecorationName", m_sf_decoration_name);
+  declareProperty("ForceDataType",             m_dataTypeOverwrite,
+                  "Force the DataType of the electron to specified value (to circumvent problem of incorrect DataType for forward electrons in some old releases)");
+  declareProperty("EventInfoCollectionName",   m_eventInfoCollectionName, "The EventInfo Collection Name");
+  declareProperty("UseRandomRunNumber",        m_useRandomRunNumber);
+  declareProperty("DefaultRandomRunNumber",    m_defaultRandomRunNumber);
+
+}
+
+// =============================================================================
+// Standard destructor
+// =============================================================================
+CP::ElectronChargeEfficiencyCorrectionTool::~ElectronChargeEfficiencyCorrectionTool()
+{
+  if(m_sfDec) delete m_sfDec;
+}
+
+
+// =============================================================================
+// Athena initialize method
+// =============================================================================
+StatusCode CP::ElectronChargeEfficiencyCorrectionTool::initialize()
+{
+  ATH_MSG_DEBUG("initializing");
+
+  // initialize the random number generator (used in case of charge flip approach)
+  //m_Rndm = new TRandom3(1);
+
+  if(m_sfDec) delete m_sfDec;
+  m_sfDec = new SG::AuxElement::Decorator< float>(m_sf_decoration_name);//xxxx
+
+  //Resolve the path to the input file for the charge flip rates
+  const std::string rootfilename = PathResolverFindCalibFile(m_filename);
+  if (m_filename.empty()) {
+    ATH_MSG_ERROR ( " PathResolver was not able to find the file ... aborting" );
+    return StatusCode::FAILURE;
+  }
+
+  // Getting the root file and histograms
+  TFile* rootFile = TFile::Open( rootfilename.c_str() );
+
+  // protection against bad file
+  if ( rootFile==0 ) {
+    ATH_MSG_ERROR ( " Was not able to open file: " <<  rootfilename << " ...... aborting" );
+    return StatusCode::FAILURE;
+  }
+
+  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // explanation: attempt to loop generally over a file
+  // -- if certain SINGALWORD is present -- then this is taken as a signal,
+  // that this is another dimension... can be dynamically added.
+  // e.g.
+  // SFSyst<number>_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
+  // SFStat_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
+  // SFCentral_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
+
+  //     Then can create a key that will dynamically give us access to a map:
+  //    std::map<std::string key, std::vector<TH2D *>> m_SF_SS;     // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
+  //     std::map<std::string key, std::vector<TH2D *>> m_SF_OS;     // keys (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
+  // TFile*         data/ChMisIDSF_TightLL_FixedCutTight.root
+  //  KEY: TH2F     SFCentral_RunNumber296939_311481_SS;1   SFCentral_RunNumber296939_311481_SS
+  //  KEY: TH2F     SFCentral_RunNumber296939_311481_OS;1   SFCentral_RunNumber296939_311481_OS
+  //  KEY: TH2F     STAT_RunNumber296939_311481_SS;1        STAT_RunNumber296939_311481_SS
+  //  KEY: TH2F     STAT_RunNumber296939_311481_OS;1        STAT_RunNumber296939_311481_OS
+  //  KEY: TH2F     SYST_RunNumber296939_311481_total_SS;1  SYST_RunNumber296939_311481_SS: total
+  //  KEY: TH2F     SYST_RunNumber296939_311481_total_OS;1  SYST_RunNumber296939_311481_OS: total
+
+
+  m_SF_SS.clear();
+  m_SF_OS.clear();
+  TList* keyListfolder = rootFile->GetListOfKeys();
+std::vector<std::string> names;
+
+  for ( int j=0; j<keyListfolder->GetEntries(); j++ ){
+names.push_back(( keyListfolder->At(j)->GetName() ));
+}
+std::sort(names.begin(), names.end());
+
+ for ( unsigned int j=0; j<names.size(); j++ ){
+
+    std::string name = names.at(j);
+    ATH_MSG_DEBUG("Got ROOT object with name: " << name);
+    if ( name.find(Form("SFCentral_") ) != std::string::npos){
+      ATH_MSG_VERBOSE("Found name 'SFCentral_' in ROOT object name");
+      // Check for opposite-sign (=opposite-charge)
+      bool isOS = false;
+      if ( name.find(Form("_OS") ) != std::string::npos ){
+        isOS = true;
+        ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
+      }
+      if (isOS){
+        std::string histid = ( names.at(j) );
+        histid.erase(0,10);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using histid: " << histid);
+
+        if ( histid.find("RunNumber") != std::string::npos ){
+          ATH_MSG_VERBOSE("Found name 'RunNumber' in histid");
+          std::string runlow = histid;
+          runlow.erase(histid.find(Form("RunNumber") ),9);
+          runlow.erase(runlow.find("_"),runlow.size() );
+          m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runlow.c_str())) );
+          std::string runhigh = histid;
+          runhigh.erase(histid.find(Form("RunNumber") ),9);
+          runhigh.erase(0,runhigh.find("_")+1);
+          m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runhigh.c_str())) );
+        }
+        ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
+        m_SF_OS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+      else {
+        std::string histid = ( names.at(j) );
+        histid.erase(0,10);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
+        m_SF_SS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+    }///// if ( name.find(Form("SFCentral_") ) != std::string::npos)
+
+
+    /// STAT ERROR
+    if ( name.find(Form("STAT_") ) != std::string::npos ){
+      ATH_MSG_VERBOSE("Found name 'STAT_' in ROOT object name");
+      bool isOS = false;
+      if ( name.find(Form("_OS") ) != std::string::npos ){
+        isOS = true;
+        ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
+      }
+      if ( isOS ){
+        std::string histid = ( names.at(j) );
+        histid.erase(0,5);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using histid: " << histid);
+
+        if ( histid.find("RunNumber") != std::string::npos ){
+          ATH_MSG_VERBOSE("Found name 'RunNumber' in histid");
+          std::string runlow = histid;
+          runlow.erase(histid.find(Form("RunNumber") ),9);
+          runlow.erase(runlow.find("_"),runlow.size() );
+//          m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runlow.c_str())) );
+          std::string runhigh = histid;
+          runhigh.erase(histid.find(Form("RunNumber") ),9);
+          runhigh.erase(0,runhigh.find("_")+1);
+//          m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runhigh.c_str())) );
+        }
+        ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
+        m_SF_OS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+      else {
+        std::string histid = ( names.at(j) );
+        ATH_MSG_VERBOSE("Found  histid: " << histid);
+        histid.erase(0,5);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
+        m_SF_SS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+
+    }///// if ( name.find(Form("SYST") ) != std::string::npos)
+
+
+    /// STAT ERROR
+    if ( name.find(Form("SYST") ) != std::string::npos ){
+      ATH_MSG_VERBOSE("Found name 'SYST' in ROOT object name");
+      bool isOS = false;
+      if ( name.find(Form("_OS") ) != std::string::npos ){
+        isOS = true;
+        ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
+      }
+      if ( isOS ){
+        std::string histid = ( names.at(j) );
+        histid.erase(0,4);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+
+        std::string sysname = histid;
+        sysname.erase(sysname.find("_"),sysname.size());
+        m_systematics.push_back(sysname);
+
+        histid.erase(0,histid.find("_")+1);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using syst histid: " << histid);
+
+        if (histid.find("RunNumber") != std::string::npos ) {
+          std::string runlow = histid;
+          runlow.erase(histid.find(Form("RunNumber") ),9);
+          runlow.erase(runlow.find("_"),runlow.size() );
+  //        m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runlow.c_str())) );
+          std::string runhigh = histid;
+          runhigh.erase(histid.find(Form("RunNumber") ),9);
+          runhigh.erase(0,runhigh.find("_")+1);
+    //      m_RunNumbers.push_back( static_cast<unsigned int>(atoi(runhigh.c_str())) );
+        }
+        ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
+        m_SF_OS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+      else {
+        std::string histid = ( names.at(j) );
+        histid.erase(0,4);
+        histid.erase(histid.size()-3,3);// remove _SS, _OS
+        histid.erase(0,histid.find("_")+1);// remove _SS, _OS
+        ATH_MSG_VERBOSE("Using histid (sys ? SS): " << histid);
+        m_SF_SS[histid].push_back( (TH2D*)rootFile->Get( names.at(j).c_str() ));
+      }
+
+    }///end // if ( name.find(Form("SYST") ) != std::string::npos)
+
+  }
+
+  /////////// checks ... --> same vector length... all files there?
+
+  if ( m_SF_OS.size() <1 || m_SF_SS.size() <1 || m_SF_SS.size()!=m_SF_OS.size() ) {
+    ATH_MSG_ERROR("OS/SS SF vectors not filled or of different size. -- Problem with files. -- Report to <hn-atlas-EGammaWG@cern.ch>");
+    return CP::CorrectionCode::Error;
+}
+
+
+  std::sort(m_RunNumbers.begin(),m_RunNumbers.end());
+  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+  //  rootFile->Close();
+
+  // Determine the limits of validity
+
+  /// here: need to use iterator over map!!!
+  ATH_MSG_DEBUG("Having m_SF_OS.size() = " << m_SF_OS.size());
+  std::map<std::string,std::vector<TH2D*> >::iterator it = m_SF_OS.begin();
+
+  // Get the kinematic limits
+  m_eta_lowlimit   = (*it).second.at(0)->GetYaxis()->GetXmin();
+  m_eta_uplimit    = (*it).second.at(0)->GetYaxis()->GetXmax();
+  ATH_MSG_VERBOSE("|eta| limits " << m_eta_lowlimit << ", " << m_eta_uplimit);
+
+  m_pt_lowlimit =  (*it).second.at(0)->GetXaxis()->GetXmin();
+  m_pt_uplimit  = (*it).second.at(0)->GetXaxis()->GetXmax();
+  ATH_MSG_VERBOSE("pt limits " << m_pt_lowlimit << ", " << m_pt_uplimit);
+
+  // Check if the input file is in GeV or MeV
+  if ( m_pt_uplimit > 1500 ) {
+    ATH_MSG_VERBOSE("Rates in input file are in MeV");
+    m_gevmev = 1.;
+  }
+  else {
+    ATH_MSG_VERBOSE("Rates in input file are in GeV");
+    m_gevmev = 0.001;
+  }
+
+  // Systematics // dynamic too?
+  m_affectingSys = affectingSystematics();
+
+
+  return StatusCode::SUCCESS;
+}
+
+
+// =============================================================================
+// Athena finalize method
+// =============================================================================
+StatusCode CP::ElectronChargeEfficiencyCorrectionTool::finalize()
+{
+  return StatusCode::SUCCESS ;
+}
+
+
+
+//---------------------------------------------------------------------------------------
+// Get the scale factor for the electron
+//---------------------------------------------------------------------------------------
+
+//
+
+CP::CorrectionCode
+CP::ElectronChargeEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::IParticle& part, double& sf) const {
+  ATH_MSG_DEBUG("In CP::ElectronChargeEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::IParticle& part, double& sf) const");
+  if ( part.type() != xAOD::Type::Electron ){
+    ATH_MSG_ERROR("This function requires an electron to be passed. Failing!");
+    return CP::CorrectionCode::Error;
+  }
+  const xAOD::Electron& ele = static_cast<const xAOD::Electron&>(part);
+
+  // initialize the SF at 1
+  sf = 1.0;
+
+  // checking on the truth electron: up to now if this is not a good ele it's returning
+  bool goodEle = false;
+  CP::CorrectionCode goodEle_result = this->isGoodEle( ele, goodEle); //// ## Giulia: This is to change
+  if ( goodEle_result != CP::CorrectionCode::Ok ) {
+    sf = -999.0;
+    ATH_MSG_DEBUG("This is the check of goodeleCC in getscalefactor. Scale factor set to -999");
+    return goodEle_result;
+  }
+
+  if ( goodEle == false ) {
+    // electron is background electron and should not be corrected
+    return CP::CorrectionCode::Ok;
+    ATH_MSG_DEBUG("Here goodele is false but CC ok");
+  }
+
+  // taking reconstructed variables
+  int reco_ele_charge  = ele.charge();
+  const double ele_pt  = ele.pt()*m_gevmev;
+  const double ele_eta = std::abs( ele.caloCluster()->etaBE(2)   );
+
+   // getting the truth charge
+  int truth_ele_charge = 9999;
+  CP::CorrectionCode charge_result = this->getEleTruthCharge( ele, truth_ele_charge); //// ## Giulia: second function to change
+  if ( charge_result != CP::CorrectionCode::Ok ) {
+    sf = -9999.0;
+    ATH_MSG_VERBOSE("This is check of geteletruthchargeCC in getscalefactor. Scale factor set to -9999");
+    return charge_result;
+  }
+
+  if ( truth_ele_charge == 0 ) {
+    ATH_MSG_DEBUG("Here truth charge is =0!!");
+    return CP::CorrectionCode::Ok;
+  }
+
+  ATH_MSG_DEBUG("Reco charge = " << reco_ele_charge << "; Truth charge = " << truth_ele_charge);
+
+  // getting the rates from file....
+  float retVal(0.0);
+
+  //////////////////////////////////////
+  // here determine, WHICH of the [histid] to choose (after cuuts on runnumber etc....)
+  std::string cutRunNumber = "all";
+
+  if (m_RunNumbers.size()>0) {
+    unsigned int runnumber = m_defaultRandomRunNumber;
+    ATH_MSG_DEBUG("RandomRunNumber: " << runnumber << " " << m_useRandomRunNumber);
+    if (m_useRandomRunNumber) {
+      const xAOD::EventInfo *eventInfo = evtStore()->retrieve< const xAOD::EventInfo> (m_eventInfoCollectionName);
+      if (!eventInfo) {
+        ATH_MSG_ERROR("Could not retrieve EventInfo object!");
+        sf = 1.0;
+        return CP::CorrectionCode::Error;
+      }
+      static const SG::AuxElement::Accessor<unsigned int> randomrunnumber("RandomRunNumber");
+      if (!randomrunnumber.isAvailable(*eventInfo)) {
+        sf = 1.0;
+        ATH_MSG_WARNING("Pileup tool not run before using ElectronEfficiencyTool! SFs do not reflect PU distribution in data");
+        return CP::CorrectionCode::Error;
+      }
+      runnumber = randomrunnumber(*(eventInfo));
+    }
+    ATH_MSG_DEBUG("Number of RunNumbers: " << m_RunNumbers.size() );
+    for ( std::size_t r=0; r<m_RunNumbers.size(); r++ ){
+ATH_MSG_DEBUG(  m_RunNumbers.at(r) );
+	}
+ATH_MSG_VERBOSE("DONE");
+
+    for ( std::size_t r=0; r<m_RunNumbers.size()-1; r++ ){
+      ATH_MSG_VERBOSE(m_RunNumbers.size()-1 << "  " << m_RunNumbers.at(r) << "  " << m_RunNumbers.at(r+1) << "  " << runnumber);
+      if ( runnumber > (unsigned int)m_RunNumbers.at(r) && runnumber <= (unsigned int)m_RunNumbers.at(r+1) ) {
+        cutRunNumber.clear();
+        cutRunNumber = Form("RunNumber%d_%d",m_RunNumbers.at(r) ,m_RunNumbers.at(r+1));
+        ATH_MSG_DEBUG(m_RunNumbers.at(r));
+      }
+    }
+
+    if (runnumber<m_RunNumbers.at(0) || (runnumber>m_RunNumbers.at(m_RunNumbers.size()-1) )) {
+    ATH_MSG_DEBUG("RunNumber not in valid RunNumber Range ");
+    sf = -9999.0;
+    return CP::CorrectionCode::OutOfValidityRange;
+      }
+
+  }
+
+   // Determine WHICH histograms to use here
+  const std::vector<TH2D*>& SShistograms = m_SF_SS.at(cutRunNumber.c_str());
+  const std::vector<TH2D*>& OShistograms = m_SF_OS.at(cutRunNumber.c_str());
+
+
+  // here check OS or SS
+  bool isOS=false;
+
+  if (truth_ele_charge * reco_ele_charge > 0) isOS=true;
+
+  if (isOS) {
+    retVal = this->getChargeFlipRate( ele_eta, ele_pt,OShistograms.at(0), sf);
+    if ( retVal != 0 ) {
+      sf = -9999.0;
+      return CP::CorrectionCode::OutOfValidityRange;
+    }
+  }
+  else {
+    ATH_MSG_DEBUG("Get SS his");
+    retVal = this->getChargeFlipRate( ele_eta, ele_pt, SShistograms.at(0), sf);
+    if ( retVal != 0 ) {
+      sf = -9999.0;
+      return CP::CorrectionCode::OutOfValidityRange;
+    }
+  }
+
+   ATH_MSG_DEBUG("eta: " << ele_eta << "  pt: "<< ele_pt );
+   ATH_MSG_DEBUG("SF Rates---- . SF: " << sf );
+
+
+  // Systematics ------------------------------------------------------------------------------------------------------
+  double val_stat;
+
+   /// STAT
+  if (isOS) {
+    retVal = this->getChargeFlipRate( ele_eta, ele_pt,OShistograms.at(1), val_stat);
+    if ( retVal != 0 ) {
+      sf = -9999.0;
+      return CP::CorrectionCode::OutOfValidityRange;
+    }
+  }
+  else {
+    ATH_MSG_DEBUG("Get SS his");
+    retVal = this->getChargeFlipRate( ele_eta, ele_pt, SShistograms.at(1), val_stat);
+    if ( retVal != 0 ) {
+      sf = -9999.0;
+      return CP::CorrectionCode::OutOfValidityRange;
+    }
+  }
+
+  std::vector<float> systs;
+  double val_sys{0.0};
+   /// STAT
+  for (unsigned int s=2;s<OShistograms.size();s++){
+    if (isOS) {
+      retVal = this->getChargeFlipRate( ele_eta, ele_pt,OShistograms.at(s), val_sys);
+      if ( retVal != 0 ) {
+        val_sys = -9999.0;
+        return CP::CorrectionCode::OutOfValidityRange;
+      }
+    }
+    else {
+      ATH_MSG_DEBUG("Get SS his");
+      retVal = this->getChargeFlipRate( ele_eta, ele_pt, SShistograms.at(s), val_sys);
+      if ( retVal != 0 ) {
+        val_sys = -9999.0;
+        return CP::CorrectionCode::OutOfValidityRange;
+      }
+    }
+    systs.push_back(static_cast<float>(val_sys));
+  }
+
+    ATH_MSG_DEBUG(" ... nominal SF: "   << sf);
+
+
+  if ( m_mySysConf.size()==0 ) {
+    ATH_MSG_DEBUG(" ... nominal SF: "   << sf);
+  }
+  else if (*(m_mySysConf.begin()) == SystematicVariation ("EL_CHARGEID_STAT",  1)) { sf=(sf+(val_stat)); ATH_MSG_DEBUG("SF after STATup = "   << sf); }
+  else if (*(m_mySysConf.begin()) == SystematicVariation ("EL_CHARGEID_STAT", -1)) { sf=(sf-(val_stat)); ATH_MSG_DEBUG("SF after STATdown = " << sf); }
+  else {
+
+    for (unsigned int i=0;i<m_systematics.size();i++){
+      if (*(m_mySysConf.begin()) == SystematicVariation (Form("EL_CHARGEID_SYS%s",m_systematics.at(i).c_str()), 1)) { sf=(sf+(val_sys));  ATH_MSG_DEBUG("SF after SYSup = "    << sf); }
+
+      if (*(m_mySysConf.begin()) == SystematicVariation (Form("EL_CHARGEID_SYS%s",m_systematics.at(i).c_str()), -1)) { sf=(sf-(val_sys));  ATH_MSG_DEBUG("SF after SYSdown = "    << sf); }
+
+    }
+
+    // else if (*(m_mySysConf.begin()) == SystematicVariation ("EL_CHARGEID_SYS" , -1)) { val_sf*=(1-(val_sf_sys*0.01));  ATH_MSG_DEBUG("SF after SYSdown = "  << val_sf); }
+    // else ATH_MSG_ERROR("No systematic string found");
+  }
+
+  return CP::CorrectionCode::Ok;
+}
+
+
+
+//---------------------------------------------------------------------------------------
+// Decorate the electron with the scale factor
+//---------------------------------------------------------------------------------------
+
+
+CP::CorrectionCode
+CP::ElectronChargeEfficiencyCorrectionTool::applyEfficiencyScaleFactor(const xAOD::IParticle& part) const {
+  ATH_MSG_DEBUG("In CP::ElectronChargeEfficiencyCorrectionTool::applyEfficiencyScaleFactor(const xAOD::IParticle& part) const");
+  double sf = 0.0;
+  CP::CorrectionCode result = this->getEfficiencyScaleFactor(part,sf);
+  //Decorate the electron
+  (*m_sfDec)(part) = static_cast<float>(sf);
+  return result;
+
+}
+
+
+//// Giulia: This one won't exist!! ################################################ Kristin: But ok to just comment out for the moment
+
+// //---------------------------------------------------------------------------------------
+// // Get the efficiency for data only
+// //---------------------------------------------------------------------------------------
+
+// CP::CorrectionCode CP::ElectronChargeEfficiencyCorrectionTool::getDataEfficiency(const xAOD::Electron& ele, float& rate) {
+
+//   const double ele_pt  = ele.pt()*m_gevmev;
+//   const double ele_eta = fabs(ele.eta());
+//   rate = 999.;
+
+//   float syst_err(-1.0);
+//   float stat_err(-1.0);
+//   float retVal(0.0);
+
+//   retVal= this->getChargeFlipRate(ele_eta, ele_pt, m_correctionRates_data[0], rate);
+//   if ( retVal != 0 ) return CP::CorrectionCode::OutOfValidityRange;
+
+//   //.......sys.......
+//   retVal = this->getChargeFlipRate( ele_eta, ele_pt, m_correctionRates_data[1], syst_err);
+//   if ( retVal != 0 )  return CP::CorrectionCode::OutOfValidityRange;
+
+//   //.......stat.......
+//   retVal = this->getChargeFlipRate( ele_eta, ele_pt, m_correctionRates_data[2], stat_err);
+//   if ( retVal != 0 )  return CP::CorrectionCode::OutOfValidityRange;
+
+//   float total=sqrt( syst_err*syst_err + stat_err*stat_err );
+
+//   ATH_MSG_VERBOSE("Rates---- data: " << rate);
+
+
+//   // Systematics ------------------------------------------------------------------------------------------------------
+//   if ( m_mySysConf.size() >1 )  ATH_MSG_ERROR("m_mySysConf.size() >1 !! By now just one systematic implemented!!");
+
+//   if ( m_mySysConf.empty() ) ATH_MSG_VERBOSE("mySysConf is empty. NOMINAL value for rate!!!--->" << rate);
+
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_STAT",  1)) {rate*=(1+(stat_err*0.01)); ATH_MSG_VERBOSE("Rate data after STATup = "   << rate); }
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_STAT", -1)) {rate*=(1-(stat_err*0.01)); ATH_MSG_VERBOSE("Rate data after STATdown = " << rate); }
+
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_SYS" ,  1)) {rate*=(1+(syst_err*0.01)); ATH_MSG_VERBOSE("Rate data after SYSup = "    << rate); }
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_SYS" , -1)) {rate*=(1-(syst_err*0.01)); ATH_MSG_VERBOSE("Rate data after SYSdown = "  << rate); }
+
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_TOT" ,  1)) {rate*=(1+(total*0.01)); ATH_MSG_VERBOSE("Rate data after TOTup = "    << rate); }
+//   else if (*(m_mySysConf.begin()) == SystematicVariation ("ELE_ChargeMisID_TOT" , -1)) {rate*=(1-(total*0.01)); ATH_MSG_VERBOSE("Rate data after TOTdown = "  << rate); }
+
+//   else ATH_MSG_ERROR("No systematic string found");
+
+
+//   return CP::CorrectionCode::Ok;
+// }
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Get the charge of the original electron
+// Giulia: not needed anymore!
+
+CP::CorrectionCode CP::ElectronChargeEfficiencyCorrectionTool::getEleTruthCharge( const xAOD::Electron& ele,  int& truthcharge) const
+{
+  // if ( !(ele.isAvailable<int>("firstEgMotherPdgId")) || !(ele.isAvailable<int>("truthPdgId")) ) {
+  if ( !(ele.isAvailable<int>("firstEgMotherPdgId")) ) {
+    ATH_MSG_ERROR("Link not available for firstEgMotherPdgId...BAD!!!");
+    ATH_MSG_ERROR("Need to have present: ( !(ele.isAvailable<int>('firstEgMotherPdgId')) )" );
+    return CP::CorrectionCode::OutOfValidityRange;
+  }
+
+  //don't you need a - sign? like electron pdg is +11? or am I wrong?
+  truthcharge = (-1)*ele.auxdata<int>("firstEgMotherPdgId");
+  // Make truthcharge -1, 0, +1
+  truthcharge = (0 < truthcharge) - (truthcharge < 0);
+
+  return CP::CorrectionCode::Ok;
+
+}
+
+
+
+//Giulia: already changed -> need to be checked --> Kristin: Looks good!
+
+CP::CorrectionCode CP::ElectronChargeEfficiencyCorrectionTool::isGoodEle( const xAOD::Electron& ele, bool& goodele) const
+{
+
+   // good ele => (firstEgMotherPdgId) == 11 ## valid for both iso and conversion ele
+
+  goodele = false;
+  int firstEgPdgId = -9999;
+
+  if ( !(ele.isAvailable<int>("firstEgMotherPdgId")) ) {
+    ATH_MSG_ERROR( "firstEgMotherPdgId IS NOT AVAILABLE!!" );
+    return CP::CorrectionCode::OutOfValidityRange;
+  }
+  else {
+
+    firstEgPdgId = ele.auxdata<int>("firstEgMotherPdgId");
+
+    if ( std::abs(firstEgPdgId) != 11) {
+
+      goodele = false;
+      ATH_MSG_VERBOSE( "  electron is not GOOD .... returning ...." );
+      return CP::CorrectionCode::Ok;
+
+    }
+    else {
+
+      goodele = true;
+      return CP::CorrectionCode::Ok;
+
+    }
+  }
+
+  return CP::CorrectionCode::OutOfValidityRange;
+}
+
+
+// Get the correction rate given pt (E), eta, histogram
+float CP::ElectronChargeEfficiencyCorrectionTool::getChargeFlipRate( double eta, double pt, TH2D *hrates, double& flipRate) const
+{
+  ATH_MSG_VERBOSE(" -> in: getChargeFlipRate(" << pt <<", " << eta << " TH2D, double&)");
+
+  if ( eta < m_eta_lowlimit || eta > m_eta_uplimit ) {
+
+    ATH_MSG_ERROR("Got an electron outside of the range of ETA validity " << eta);
+    return 1;
+  }
+
+  if ( pt < m_pt_lowlimit ) {
+
+    ATH_MSG_ERROR("Got an electron outside of the range of pt validity: pt lower than lower limit");
+    return 2;
+  }
+
+  if ( pt > m_pt_uplimit ) pt=m_pt_uplimit*0.999;
+
+  int bin2D = hrates->FindBin(pt, eta);
+  flipRate  = hrates->GetBinContent(bin2D);
+
+  ATH_MSG_VERBOSE(" -> flipRate is " << flipRate <<", for histogram " << hrates->GetName() );
+
+
+  return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// returns whether this tool is affected by the given systematics
+bool  CP::ElectronChargeEfficiencyCorrectionTool::isAffectedBySystematic( const SystematicVariation& systematic ) const {
+
+  CP::SystematicSet sys = affectingSystematics();
+  return sys.find (systematic) != sys.end ();
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// returns the list of all systematics this tool can be affected by
+
+CP::SystematicSet CP::ElectronChargeEfficiencyCorrectionTool::affectingSystematics() const{
+  CP::SystematicSet result;
+  result.insert (SystematicVariation ("EL_CHARGEID_STAT" , 1));
+  result.insert (SystematicVariation ("EL_CHARGEID_STAT" , -1));
+
+  for (unsigned int i=0;i< m_systematics.size();i++){
+    result.insert (SystematicVariation (Form("EL_CHARGEID_SYS%s",m_systematics.at(i).c_str()), 1));
+    result.insert (SystematicVariation (Form("EL_CHARGEID_SYS%s",m_systematics.at(i).c_str()), -1));
+  }
+   return result;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// returns the list of all systematics this tool recommends to use
+CP::SystematicSet  CP::ElectronChargeEfficiencyCorrectionTool::recommendedSystematics() const {
+
+  return affectingSystematics();
+
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Gets a SystematicSet and filters it
+CP::SystematicCode CP::ElectronChargeEfficiencyCorrectionTool::applySystematicVariation( const SystematicSet& systConfig ) {
+
+  if (!SystematicSet::filterForAffectingSystematics(systConfig, m_affectingSys, m_mySysConf)){
+    ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool! ");
+    return SystematicCode::Unsupported;
+  }
+
+
+
+  return SystematicCode::Ok;
+
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/TElectronEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/TElectronEfficiencyCorrectionTool.cxx
index 57b6b4ea214b5fc0a6ba33ddf7d642b2a0af02c4..dde285749ae5d5e5669dbe78c21feb2b8186c41a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/TElectronEfficiencyCorrectionTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/TElectronEfficiencyCorrectionTool.cxx
@@ -21,7 +21,6 @@
 #include <limits.h>
 #include "CxxUtils/make_unique.h"
 #include <memory>
-
 // ROOT includes
 #include "TString.h"
 #include "TSystem.h"
@@ -31,6 +30,40 @@
 #include "TClass.h"
 #include "TMD5.h"
 
+namespace{
+
+  template <class T>
+    inline std::string toString(const T& in){
+    std::stringstream stream;
+    stream << in;
+    return stream.str();
+  }
+}
+
+namespace mapkey{
+  enum key{ sf =1,
+	    stat=2,
+	    eig=3,
+	    uncorr=4,	      
+	    sys=5
+
+  };
+  std::string keytostring (int input){
+    switch(input){
+    case(sf) : 
+      return "sf";
+    case(stat) : 
+      return "stat";
+    case(eig) : 
+      return "eig";
+    case(uncorr) : 
+      return "uncorr";
+    case(sys) : 
+      return "sys";
+    }
+    return "";
+  }
+}
 
 // =============================================================================
 // Constructor
@@ -38,7 +71,7 @@
 Root::TElectronEfficiencyCorrectionTool::TElectronEfficiencyCorrectionTool(const char *name) :
   Root::TCalculatorToolBase(name),
   asg::AsgMessaging(std::string(name)),
-  m_Rndm(0),
+  m_Rndm(),
   m_randomCounter(0),
   m_isInitialized(false),
   m_detailLevel(2),
@@ -47,8 +80,6 @@ Root::TElectronEfficiencyCorrectionTool::TElectronEfficiencyCorrectionTool(const
   m_doToyMC(false),
   m_doCombToyMC(false),
   m_nToyMC(0),
-  m_uncorrToyMCSystFull(0),
-  m_uncorrToyMCSystFast(0),
   m_nSys(0),
   m_nSysMax(0),
   m_runNumBegin(0),
@@ -62,12 +93,14 @@ Root::TElectronEfficiencyCorrectionTool::TElectronEfficiencyCorrectionTool(const
   m_position_uncorrSys(0),
   m_nbins(0),
   m_nSimpleUncorrSyst(0),
-  m_position_globalBinNumber(0),
-  m_runnumberIndex(-1),
-  m_last_runnumber(0),
-  m_last_dataType(PATCore::ParticleDataType::Full),
-  m_last_hist(0),
-  m_last_hists(0) {
+  m_position_globalBinNumber(0)
+{
+  //Setup the keys
+  m_keys.push_back(mapkey::sf);
+  m_keys.push_back(mapkey::stat);
+  m_keys.push_back(mapkey::eig);
+  m_keys.push_back(mapkey::uncorr);
+  //
 }
 
 // =============================================================================
@@ -75,228 +108,65 @@ Root::TElectronEfficiencyCorrectionTool::TElectronEfficiencyCorrectionTool(const
 // =============================================================================
 
 Root::TElectronEfficiencyCorrectionTool::~TElectronEfficiencyCorrectionTool() {
-  if (m_last_hist) {
-    delete m_last_hist;
-  }
-  if (m_last_hists) {
-    delete m_last_hists;
-  }
-  if (m_Rndm) {
-    delete m_Rndm;
-  }
-  for (auto const &tempit : m_histList) {
+
+  //Need some gymnastic to make sure that the TObjArray elements are owned
+  //and deleted ... 
+  for (auto  &tempit : m_histList) {
     for (unsigned int i = 0; i < tempit.second.size(); ++i) {
-      if (tempit.second.at(i)) {
-        tempit.second.at(i)->SetOwner(kTRUE);
-        delete tempit.second.at(i);
-      }
+        tempit.second.at(i).SetOwner(kTRUE);
     }
   }
-
-  for (auto const &tempit : m_fastHistList) {
+  for (auto  &tempit : m_fastHistList) {
     for (unsigned int i = 0; i < tempit.second.size(); ++i) {
-      if (tempit.second.at(i)) {
-        tempit.second.at(i)->SetOwner(kTRUE);
-        delete tempit.second.at(i);
-      }
+        tempit.second.at(i).SetOwner(kTRUE);
     }
   }
-}
-
-// =============================================================================
-// Calculate the detail levels for a given eigenvector histogram
-// =============================================================================
-void
-Root::TElectronEfficiencyCorrectionTool::calcDetailLevels(TH1D *eig) {
-  m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] = 0;
-  m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] = 0;
-  m_sLevel[Root::TElectronEfficiencyCorrectionTool::detailed] = 0;
-  int nSys = eig->GetNbinsX() - 1;
-  double sign = 0;
-  // Calculate detail level
-  for (int i = nSys + 1; i >= 2; i--) {
-    sign += eig->GetBinContent(i);
-    if (sign > 0.8 && m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] == 0) {
-      m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] = i - 2;
-    }
-    if (sign > 0.95 && m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] == 0) {
-      m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] = i - 2;
+  for (auto  &tempit : m_sysList) {
+    for (auto  &i : tempit) {
+      i.SetOwner(kTRUE);
     }
   }
- 
-    m_nSys = nSys;
-}
-
-// =============================================================================
-// Build the toyMC tables from inputs
-// =============================================================================
-std::vector<TH2D *> *
-Root::TElectronEfficiencyCorrectionTool::buildSingleToyMC(TH2D *sf, TH2D *stat, TH2D *uncorr, TObjArray *corr) {
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")! " << "entering function buildSingleToyMC");
-
-  std::vector<TH2D *> *tmpHists = new std::vector<TH2D *>;
-  int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
-  for (int toy = 0; toy < m_nToyMC; toy++) {
-    tmpHists->push_back((TH2D *) corr->At(0)->Clone());
-  }
-  // Loop over all bins
-  for (int bin = 0; bin < nBins; bin++) {
-    double val = stat->GetBinContent(bin);
-
-    // Add uncorrelated systematics
-    if (uncorr != NULL) {
-      double valAdd = uncorr->GetBinContent(bin);
-      val = sqrt(val * val + valAdd * valAdd);
+  for (auto  &tempit :  m_fastSysList) {
+    for (auto  &i : tempit) {
+      i.SetOwner(kTRUE);
     }
-
-    // Add smaller correlated systematics as uncorrelated
-    for (int i = 0; i < m_sLevel[m_detailLevel]; ++i) {
-      if (corr->At(i) != NULL) {
-        double valAdd = ((TH2D *) corr->At(i))->GetBinContent(bin);
-        val = sqrt(val * val + valAdd * valAdd);
-      }
-    }
-    for (int toy = 0; toy < m_nToyMC; toy++) {
-      tmpHists->at(toy)->SetBinContent(bin, (val * m_Rndm->Gaus(0, 1)) + sf->GetBinContent(bin));
-      m_randomCounter++;
-      tmpHists->at(toy)->SetDirectory(0);
-    }
-  }
-
-  return tmpHists;
-}
-
-// =============================================================================
-// Build the combined toyMC tables from inputs
-// =============================================================================
-TH2D *
-Root::TElectronEfficiencyCorrectionTool::buildSingleCombToyMC(TH2D *sf, TH2D *stat, TH2D *uncorr, TObjArray *corr) {
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function buildSingleCombToyMC");
-
-  TH2D *tmpHist;
-  int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
-  tmpHist = (TH2D *) corr->At(0)->Clone();
-
-
-  // Create random numbers for the corr. uncertainties
-  double *rnd = new double[m_nSys];
-  for (int s = 0; s < m_nSys; s++) {
-    rnd[s] = m_Rndm->Gaus(0, 1);
-    m_randomCounter++;
-  }
-
-  // Loop over all bins
-  for (int bin = 0; bin < nBins; bin++) {
-    double val = stat->GetBinContent(bin);
-
-
-    // Add uncorrelated systematics
-    if (uncorr != NULL) {
-      double valAdd = uncorr->GetBinContent(bin);
-      val = sqrt(val * val + valAdd * valAdd);
-    }
-    // Add smaller correlated systematics as uncorrelated
-
-    for (int s = 0; s < m_sLevel[m_detailLevel]; s++) {
-      if (corr->At(s) != NULL) {
-        double valAdd = ((TH2D *) corr->At(s))->GetBinContent(bin);
-        val = sqrt(val * val + valAdd * valAdd);
-      }
-    }
-
-    val = val * m_Rndm->Gaus(0, 1);
-    m_randomCounter++;
-
-    // Add larger correlated systematics
-    for (int s = m_sLevel[m_detailLevel]; s < m_nSys; s++) {
-       if (corr->At(s) != NULL) {
-        val += ((TH2D *) corr->At(s))->GetBinContent(bin) * rnd[s];
-      }
-    }
-     tmpHist->SetBinContent(bin, val + sf->GetBinContent(bin));
   }
-
-  tmpHist->SetDirectory(0);
-
-  delete[]rnd;
-  return tmpHist;
-}
-
-// =============================================================================
-// Build the toyMC tables from inputs
-// =============================================================================
-std::vector<TObjArray *> *
-Root::TElectronEfficiencyCorrectionTool::buildToyMCTable(TObjArray *sf, TObjArray *eig, TObjArray *stat,
-                                                         TObjArray *uncorr, std::vector<TObjArray *> *corr) {
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function buildToyMCTable");
-
-  std::vector<TObjArray *> *tmpVec = new std::vector<TObjArray *>;
-  TObjArray *tmpArray;
-  if (m_doCombToyMC) {
-    for (int toyMC = 0; toyMC < m_nToyMC; toyMC++) {
-      tmpArray = new TObjArray();
-      for (int i = 0; i < stat->GetEntries(); ++i) {
-        if (eig != NULL && uncorr != NULL) {
-          calcDetailLevels((TH1D *) eig->At(i));
-          tmpArray->Add(buildSingleCombToyMC((TH2D *) sf->At(i), (TH2D *) stat->At(i), (TH2D *) uncorr->At(i),
-                                             corr->at(i)));
-        }else {
-          tmpArray->Add(buildSingleCombToyMC((TH2D *) sf->At(i), (TH2D *) stat->At(i), NULL, corr->at(i)));
-        }
-      }
-      tmpVec->push_back(tmpArray);
+  for (auto  &tempit : m_uncorrToyMCSystFull) {
+    for (auto & i : tempit) {
+      i.SetOwner(kTRUE);
     }
-  }else {
-    std::vector< std::vector<TH2D *> *> *tmpVec2 = new  std::vector< std::vector<TH2D *> *>;
-    for (int i = 0; i < stat->GetEntries(); ++i) {
-      calcDetailLevels((TH1D *) eig->At(i));
-      tmpVec2->push_back(buildSingleToyMC((TH2D *) sf->At(i), (TH2D *) stat->At(i), (TH2D *) uncorr->At(i),
-                                          corr->at(i)));
-    }
-    for (int toy = 0; toy < m_nToyMC; toy++) {
-      tmpArray = new TObjArray();
-      for (unsigned int i = 0; i < tmpVec2->size(); ++i) {
-        tmpArray->Add(tmpVec2->at(i)->at(toy));
-      }
-      tmpVec->push_back(tmpArray);
+  }  
+  for (auto  &tempit : m_uncorrToyMCSystFast) {
+    for (auto & i : tempit) {
+      i.SetOwner(kTRUE);
     }
-    delete tmpVec2;
   }
-
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "m_Rndm->Uniform(0, 1) after throwing " << m_randomCounter
-		<< " random numbers: " << m_Rndm->Uniform(0,
-                                                          1));
-  return tmpVec;
 }
 
 // =============================================================================
 // Initialize this correction tool
 // =============================================================================
-int
-Root::TElectronEfficiencyCorrectionTool::initialize() {
+int Root::TElectronEfficiencyCorrectionTool::initialize() {
   // use an int as a StatusCode
   int sc(1);
-
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: "
 		<< __LINE__ << ") " << "Debug flag set. Printing verbose output!");
 
+  //Avoid double init
   if (m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "tool initialized twice!");
     return 0;
   }
-
+  //Check if files are present
   if (m_corrFileNameList.size() == 0) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << " No file added!");
     return 0;
   }
-
   ATH_MSG_INFO("Initializing tool with " << m_corrFileNameList.size() << " configuration file(s)");
-
-  ///////////////////////////////////////////////////
+  //
   // Check if the first file can be opened (needed for auto-setting of the seed based on the md5-sum of the file)
-  const char *fname;
-  fname = gSystem->ExpandPathName(m_corrFileNameList[0].c_str());
-  std::unique_ptr<TFile> rootFile_tmp = CxxUtils::make_unique<TFile> (fname, "READ");
+  const std::unique_ptr<char> fname(gSystem->ExpandPathName(m_corrFileNameList[0].c_str()));
+  std::unique_ptr<TFile> rootFile_tmp = CxxUtils::make_unique<TFile> (fname.get(), "READ");
   if (!rootFile_tmp) {
     ATH_MSG_ERROR(
 		  " (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "No ROOT file found here: " << m_corrFileNameList[0]);
@@ -304,40 +174,29 @@ Root::TElectronEfficiencyCorrectionTool::initialize() {
   }
   rootFile_tmp->Close();
   // close it back again
-  ///////////////////////////////////////////////////
-
+  //
+  //invalid input requested
   if (m_doToyMC && m_doCombToyMC) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << " Both regular and combined toy MCs booked!"
 		  << " Only use one!");
     return 0;
   }
 
-  m_keys.push_back("sf");
-  m_keys.push_back("stat");
-  m_keys.push_back("eig");
-  m_keys.push_back("uncorr");
-  //
-  // Cache for the last hist
-  m_last_runnumber = 0;
-  m_last_dataType = PATCore::ParticleDataType::Full;
-  m_last_hist = new  std::map<std::string, const TH1 *>;
-  m_last_hists = new std::map<std::string, const TObjArray *>;
-  //
-  //
-  // initialize the random number generated if toyMC propagation booked
+  // initialize the random number generator if toyMC propagation booked
   if (m_doToyMC || m_doCombToyMC) {
     if (m_seed == 0) {
-      TMD5 *tmd = new TMD5();
-      m_seed = *reinterpret_cast<const int *>(tmd->FileChecksum(fname)->AsString());
+      std::unique_ptr<TMD5> tmd=CxxUtils::make_unique<TMD5>();
+      const char* tmd_as_string=tmd->FileChecksum(fname.get())->AsString();
+      m_seed = *reinterpret_cast<const int*>(tmd_as_string);
       ATH_MSG_INFO("Seed (automatically) set to " << m_seed);
     }else {
       ATH_MSG_INFO("Seed set to " << m_seed);
     }
-    m_Rndm = new TRandom3(m_seed);
+    m_Rndm= TRandom3(m_seed);
   }
   //
   // Load the needed histograms
-  if (0 == this->getHistograms()) {
+  if (0 == getHistograms()) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Problem when calling getHistograms()");
     return 0;
   }
@@ -346,15 +205,15 @@ Root::TElectronEfficiencyCorrectionTool::initialize() {
 
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") "
 		<< "Found " << nRunNumbersFast << " run number ranges for fast sim with a total of " <<
-                m_fastHistList["sf"].size() << " scale factor histograms.");
+                m_fastHistList[mapkey::sf].size() << " scale factor histograms.");
 
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") "
 		<< "Found " << nRunNumbersFull << " run number ranges for full sim with a total of " <<
-                m_histList["sf"].size() << " scale factor histograms.");
-
+                m_histList[mapkey::sf].size() << " scale factor histograms.");
+  //
   // --------------------------------------------------------------------------
-  // Register the cuts and check that the registration worked:
-  // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,...
+  // Register the output / results
+  // NOTE: THE ORDER IS IMPORTANT!!! 
   m_position_eff = m_result.addResult((m_resultPrefix + m_resultName).c_str(), "efficiency scale factor");
   if (m_position_eff < 0) {
     sc = 0; // Exceeded the number of allowed results
@@ -412,8 +271,8 @@ Root::TElectronEfficiencyCorrectionTool::initialize() {
   m_result.setResult(m_position_nSys, 0);
   m_result.setResult(m_position_uncorrSys, 0);
   m_isInitialized = kTRUE;
-
-  ATH_MSG_INFO("Tool succesfully initialized!"<< m_nSys << "  " << m_nSysMax);
+  // --------------------------------------------------------------------------
+  ATH_MSG_INFO("Tool succesfully initialized!");
   return sc;
 }
 
@@ -429,6 +288,11 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << this->getName()
 		<< "  entering function calculate");
 
+  // A few helpful strings
+  static const std::string LowPt_string("LowPt");
+  //
+  //
+  //
   // check if a file is given and tool correctly initialized
   if (!m_isInitialized) {
     ATH_MSG_ERROR(
@@ -436,14 +300,13 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
 		  " Tool not correctly initialized or no scale factor file given. ");
     return m_result;
   }
-
-  ATH_MSG_DEBUG(
-		" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << this->getName() << " n Systematics: " << m_nSysMax);
+  ATH_MSG_DEBUG("(file: " << __FILE__ << ", line: " << __LINE__ << ") " << this->getName() << " n Systematics: " << m_nSysMax);
   // Reset the results to default values
   m_result.setResult(m_position_eff, -999.0);
   m_result.setResult(m_position_err, 1.0);
   m_result.setResult(m_position_statErr, 0.0);
   m_result.setResult(m_position_uncorrSys, 0);
+  //
   for (int sys = 0; sys < m_nSysMax; sys++) {
     m_result.setResult(m_position_corrSys.at(sys), 0);
   }
@@ -451,105 +314,107 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
     m_result.setResult(m_position_uncorrToyMCSF.at(toy), 0);
   }
   m_result.setResult(m_position_globalBinNumber, 0);
-
-  bool isFastSim(false);
-  if (dataType == PATCore::ParticleDataType::Fast) {
-    isFastSim = true;
-  }
-
-  bool sameHistos = kFALSE;
-  if (m_last_runnumber == runnumber && m_last_dataType == dataType) {
-    sameHistos = kTRUE;
-  }
-  m_last_runnumber = runnumber;
-  m_last_dataType = dataType;
-
-  // Only find histogram if not the same as last call
-  if (sameHistos) {
-    // Do not touch m_last histos cache
-  }else {
-    // else clear the last hist
-    m_last_hist->clear();
-    m_last_hists->clear();
-    std::vector<TObjArray *> tmpVec;
-    if (isFastSim) {
-      for (unsigned int i = 0; i < m_begRunNumberListFastSim.size(); ++i) {
-        if (m_begRunNumberListFastSim[i] <= runnumber && runnumber <= m_endRunNumberListFastSim[i]) {
-          for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-            tmpVec = m_fastHistList[m_keys.at(ikey)];
-            if (tmpVec.size() > 0) {
-              m_last_hists->insert(std::make_pair(m_keys.at(ikey), tmpVec.at(i)));
-            }
-          }
-          m_runnumberIndex = i;
-          break;
-        }
+  //
+  //
+  //See if fastsim
+  bool isFastSim=(dataType == PATCore::ParticleDataType::Fast) ? true: false;
+  //
+  //Find the corresponding run index for this period
+  int runnumberIndex = -1;
+  if (isFastSim) {
+    for (unsigned int i = 0; i < m_begRunNumberListFastSim.size(); ++i) {
+      if (m_begRunNumberListFastSim[i] <= runnumber && runnumber <= m_endRunNumberListFastSim[i]) {
+	runnumberIndex=i;
+	break;
       }
-    }else {
-      for (unsigned int i = 0; i < m_begRunNumberList.size(); ++i) {
-        if (m_begRunNumberList[i] <= runnumber && runnumber <= m_endRunNumberList[i]) {
-          for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-            tmpVec = m_histList[m_keys.at(ikey)];
-            if (tmpVec.size() > 0 && i < tmpVec.size()) {
-              m_last_hists->insert(std::make_pair(m_keys.at(ikey), tmpVec.at(i)));
-            }
-          }
-          m_runnumberIndex = i;
-          break;
-        }
+    }  
+  }else {
+    for (unsigned int i = 0; i < m_begRunNumberList.size(); ++i) {
+      if (m_begRunNumberList[i] <= runnumber && runnumber <= m_endRunNumberList[i]) {
+	runnumberIndex=i;
+	break;
       }
     }
-    // If no valid hist, then, run number was out of range
-    if (m_last_hists->find("sf") == m_last_hists->end()) {
+  }
+  //
+  if(runnumberIndex <0 ){
+    if (this->msgLvl(MSG::DEBUG)){
+      printDefaultReturnMessage(TString::Format(
+						"No valid run number period  found for the current run number: %i for simulation type: %i",
+						runnumber, dataType),
+				__LINE__);
+    }    
+    return m_result;
+  }
+  //
+  //
+  //What we have is a map 
+  //key is sf,stat,eigen, uncorr
+  //The vector has as many entries as supported run period
+  //The TobjArray has 2D histos for  high, low et, or forward
+  //The 2D Histo has the number we want.
+  const std::map<int, std::vector< TObjArray > >& currentmap = (isFastSim)? m_fastHistList : m_histList;
+  std::map<int, std::vector< TObjArray > >::const_iterator currentVector_itr = currentmap.find(mapkey::sf); //find the vector
+  //See if we can find a SF vector in the map and the corresponding TobjArray for this run period 
+  if (currentVector_itr == currentmap.end()) {
+    if (this->msgLvl(MSG::DEBUG)){	
       printDefaultReturnMessage(TString::Format(
-						"No valid histogram found for the current run number: %i for simulation type: %i",
+						"No valid vector of sf ObjArray found for the current run number: %i for simulation type: %i",
 						runnumber, dataType),
-                                __LINE__);
-      return m_result;
+				__LINE__);
     }
+    return m_result;
   }
-
-  // Get the actual scale factor and its uncertainty from the current histogram
+  //Get a reference (synonym) to this vector 
+  const std::vector<TObjArray>& currentVector=currentVector_itr->second;
+  if (currentVector.size()<=0 || runnumberIndex>= static_cast <signed> (currentVector.size())) {
+    if (this->msgLvl(MSG::DEBUG)){
+      printDefaultReturnMessage(TString::Format(
+						"No valid sf ObjArrays found for the current run number: %i for simulation type: %i",
+						runnumber, dataType),
+				__LINE__);
+    }
+    return m_result;
+  }
+  //
+  //
+  //Now we can get the corresponding Object array 
+  const TObjArray& currentObjectArray = currentVector.at(runnumberIndex);
+  //
+  //This is the number of entries in the TObjArray  
+  const int entries = currentObjectArray.GetEntries();
+  //Find the correct histogram in the TObjArray (Low, high Et or forward)
   double xValue, yValue;
   xValue = et;
   yValue = cluster_eta;
   int smallEt(0), etaCov(0), nSF(0);
-
   bool block = kFALSE;
   bool changed = kFALSE;
-  bool isLowPt;
   int index = -1;
-  TH2 *tmpHist(NULL);
-  if (m_last_hists->find("sf") == m_last_hists->end()) {
-    printDefaultReturnMessage("Could not find a histogram that ends with _sf, please check your input file!", __LINE__);
-    return m_result;
-  }
-  for (int i = 0; i < (m_last_hists->find("sf"))->second->GetEntries(); ++i) {
-    isLowPt = kFALSE;
-    block = kFALSE;
-    tmpHist = (TH2 *) (m_last_hists->find("sf")->second->At(i));
-    if (TString(tmpHist->GetName()).Contains("LowPt")) {
-      isLowPt = kTRUE;
-    }
+  TH2 *tmpHist(0);
+  for (int i = 0; i < entries ; ++i) {
     block = kFALSE;
+    tmpHist = (TH2 *) (currentObjectArray.At(i));
+
+    //block if we are below minimum et 
     if (et < tmpHist->GetXaxis()->GetXmin()) {
       smallEt++;
       block = kTRUE;
     }
 
+    //block if we are above max eta 
     if (TMath::Abs(yValue) >= tmpHist->GetYaxis()->GetXmax()) {
       etaCov++;
       block = kTRUE;
     }
-
-    // this is for forward electrons (eta-histos start at eta=2.47
+    // Blocj if we are less than minimum (fwd electrons)
     if (TMath::Abs(yValue) < tmpHist->GetYaxis()->GetXmin()) {
       etaCov++;
       block = kTRUE;
     }
-
+    //Block if above max et and is the low Et histo
     if (et > tmpHist->GetXaxis()->GetXmax()) {
-      if (isLowPt) {
+      if (TString(tmpHist->GetName()).Contains(LowPt_string)) {
         block = kTRUE;
       } else {
         xValue = tmpHist->GetXaxis()->GetBinCenter(tmpHist->GetNbinsX());
@@ -563,38 +428,43 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
       }
     }
   }
-
-  if (index >= 0) {
-    if (m_last_hist->find("sf") == m_last_hist->end()) {
-      m_last_hist->insert(std::make_pair("sf", (TH2 *) m_last_hists->find("sf")->second->At(index)));
-    } else {
-      m_last_hist->find("sf")->second = (TH2 *) m_last_hists->find("sf")->second->At(index);
+  //We are out of bounds 
+  //
+  if (smallEt == entries) {
+    if (this->msgLvl(MSG::DEBUG)){
+      printDefaultReturnMessage(TString::Format("No correction factor provided for et=%f", xValue), __LINE__);
     }
-  }else {
-    printDefaultReturnMessage(TString::Format(
-					      "No correction factor provided because there was an index problem"), __LINE__);
-    return m_result;
-  }
-
-  if (smallEt == m_last_hists->find("sf")->second->GetEntries()) {
-    printDefaultReturnMessage(TString::Format("No correction factor provided for et=%f", xValue), __LINE__);
     return m_result;
   }
-
-  if (etaCov == m_last_hists->find("sf")->second->GetEntries()) {
-    printDefaultReturnMessage(TString::Format("No correction factor provided for eta=%f", yValue), __LINE__);
+  if (etaCov == entries) {
+    if (this->msgLvl(MSG::DEBUG)){
+      printDefaultReturnMessage(TString::Format("No correction factor provided for eta=%f", yValue), __LINE__);
+    }
     return m_result;
   }
-
   if (nSF > 1) {
     ATH_MSG_WARNING(
 		    "More than 1 SF found for eta=" << yValue << " , et = " << et << " , run number = " << runnumber <<
 		    " . Please check your input files!");
   }
-
+  //
+  //
+  //Now we have the index of the histogram for this region in the TObjectarray 
+  TH2* currentHist(0);
+  if (index >= 0) {
+    currentHist = static_cast<TH2*> (currentObjectArray.At(index));
+  }
+  else {
+    if (this->msgLvl(MSG::DEBUG)){
+      printDefaultReturnMessage(TString::Format(
+						"No correction factor provided because there was an index problem"), __LINE__);
+    }
+    return m_result;
+  }
+  ///
   // If SF is only given in Abs(eta) convert eta input to TMath::Abs()
   float epsilon = 1e-6;
-  if (m_last_hist->find("sf")->second->GetYaxis()->GetBinLowEdge(1) >= 0 - epsilon) {
+  if (currentHist->GetYaxis()->GetBinLowEdge(1) >= 0 - epsilon) {
     if (yValue < 0) {
       ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") "
 		    << "Scale factor only measured in Abs(eta) changing eta from " << yValue << " to " << TMath::Abs(
@@ -602,33 +472,37 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
     }
     yValue = TMath::Abs(yValue);
   }
-
-  int globalBinNumber = m_last_hist->find("sf")->second->FindFixBin(xValue, yValue);
-  double scaleFactor = m_last_hist->find("sf")->second->GetBinContent(globalBinNumber);
-  double scaleFactorErr = m_last_hist->find("sf")->second->GetBinError(globalBinNumber);
-
+  //
+  int globalBinNumber = currentHist->FindFixBin(xValue, yValue);
+  double scaleFactor = currentHist->GetBinContent(globalBinNumber);
+  double scaleFactorErr = currentHist->GetBinError(globalBinNumber);
+  //
   // Write the retrieved values into the return object
   m_result.setResult(m_position_eff, scaleFactor);
   m_result.setResult(m_position_err, scaleFactorErr);
-
-  std::map<std::string, const TObjArray *>::iterator tempit;
+  //
+  //DONE WITH THE SF
+  //
+  //DO the stat error using the available info from above i.e index etc
   double statErr = -999;
-
-  //////////////////////////////
-
-  tempit = m_last_hists->find("stat");
-  if (tempit != m_last_hists->end()) {
-    if (tempit->second->Last() != NULL) {
-      TH1 *stat = (TH1 *) tempit->second->At(index);
-      statErr = stat->GetBinContent(globalBinNumber);
-      m_result.setResult(m_position_statErr, statErr);
-    }
+  currentVector_itr = currentmap.find(mapkey::stat); //find the vector
+  if (currentVector_itr != currentmap.end()) {
+    //itr at the location of the vector, .second get the vector, at(runnumberIndex is the TObjectArray 
+    // for the period , finaly get the hist at index (from above).
+    TH1 *stat = static_cast<TH1*>(currentVector_itr->second.at(runnumberIndex).At(index));
+    statErr = stat->GetBinContent(globalBinNumber);
+    m_result.setResult(m_position_statErr, statErr);
   }
-
-  tempit = m_last_hists->find("eig");
-  if (tempit != m_last_hists->end()) {
-    if (tempit->second->Last() != NULL) {
-      TH1 *eig = (TH1 *) tempit->second->At(index);
+  //
+  //
+  //Do the eigen
+  currentVector_itr = currentmap.find(mapkey::eig); //find the vector
+  if (currentVector_itr != currentmap.end()) {
+    //Check on the ObjArray
+    if (currentVector_itr->second.at(runnumberIndex).GetEntriesFast()> 0) {
+      //itr at the location of the vector, .second get the vector, at(runnumberIndex is the TObjectArray 
+      // for the period , finaly get the hist at index (from above).
+      TH1 *eig = static_cast<TH1*>(currentVector_itr->second.at(runnumberIndex).At(index));
       m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] = 0;
       m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] = 0;
       m_sLevel[Root::TElectronEfficiencyCorrectionTool::detailed] = 0;
@@ -648,46 +522,44 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
       m_result.setResult(m_position_nSys, nSys);
     }
   }
-
-  std::vector< std::vector< TObjArray * > > *sysList;
-  if (isFastSim) {
-    sysList = &m_fastSysList;
-  } else {
-    sysList = &m_sysList;
-  }
-  std::vector<double> corrSys;
-  if (sysList != 0) {
-    if (sysList->size() > (unsigned int) index) {
-      if (sysList->at(index).size() > (unsigned int) m_runnumberIndex) {
-        for (int sys = 0; sys < sysList->at(index).at(m_runnumberIndex)->GetEntries(); sys++) {
-          tmpHist = (TH2 *) sysList->at(index).at(m_runnumberIndex)->At(sysList->at(index).at(
-											      m_runnumberIndex)->GetEntries() - 1 - sys);
-
-          corrSys.push_back(tmpHist->GetBinContent(globalBinNumber));
-          m_result.setResult(m_position_corrSys[(sysList->at(index).at(
-								       m_runnumberIndex)->GetEntries() - 1 - sys)], corrSys[sys]);
-        }
+  //
+  //
+  //The issue now is that the previous setup is becoming cumbersome for the 10 systematic
+  //So we keep them in a vector of vector of TObjectArray
+  //The first vector index being the runnumber
+  //The second the systematic
+  //And the obj array for high low etc
+  //We need to see if we can do something better here ...
+  //
+  std::vector< std::vector< TObjArray > > &sysList = (isFastSim) ? m_fastSysList : m_sysList;
+  static std::vector<double> corrSys(10); // Avoid some re-allocations of  memory
+  corrSys.clear();
+  if (sysList.size() > (unsigned int) index) {
+    if (sysList.at(index).size() > (unsigned int) runnumberIndex) {
+      const int sys_entries = sysList.at(index).at( runnumberIndex).GetEntries();
+    
+      for (int sys = 0; sys < sys_entries; ++sys) {
+	tmpHist = (TH2 *) sysList.at(index).at(runnumberIndex).At(sys_entries - 1 - sys);
+	corrSys.push_back(tmpHist->GetBinContent(globalBinNumber));
+	m_result.setResult(m_position_corrSys[(sys_entries - 1 - sys)], corrSys[sys]);
+      }
+      if (m_position_corrSys.size() > 0 && sys_entries<=1) {
+	if (m_result.getResult(m_position_corrSys[0]) == 0) {
+	  m_result.setResult(m_position_corrSys[0], scaleFactorErr);
+	}
       }
     }
   }
-  if (m_position_corrSys.size() > 0 && sysList->at(index).at(m_runnumberIndex)->GetEntries()<=1) {
-    if (m_result.getResult(m_position_corrSys[0]) == 0) {
-      m_result.setResult(m_position_corrSys[0], scaleFactorErr);
-    }
-  }
-  statErr = -999;
-  tempit = m_last_hists->find("stat");
-  if (tempit != m_last_hists->end()) {
-    if (tempit->second->Last() != NULL) {
-      TH1 *stat = (TH1 *) tempit->second->At(index);
-      statErr = stat->GetBinContent(globalBinNumber);
-    }
-  }
+  //
+  //Do the uncorr error using the available info from above i.e index etc
+  //////////////////////////////////////////////////////////////////
+  //Get the statErr from above
   double val = statErr;
-  tempit = m_last_hists->find("uncorr");
-  if (tempit != m_last_hists->end()) {
-    if (tempit->second->Last() != 0) {
-      TH1 *uncorr = (TH1 *) tempit->second->At(index);
+  currentVector_itr = currentmap.find(mapkey::uncorr); //find the vector
+  if (currentVector_itr != currentmap.end()) {
+    //Check on the ObjArray
+    if (currentVector_itr->second.at(runnumberIndex).GetEntriesFast()>0) {
+      TH1 *uncorr = static_cast<TH1*>(currentVector_itr->second.at(runnumberIndex).At(index));
       double valAdd = uncorr->GetBinContent(globalBinNumber);
       val = sqrt(val * val + valAdd * valAdd);
       for (int i = 0; i < m_sLevel[m_detailLevel]; ++i) {
@@ -700,84 +572,230 @@ Root::TElectronEfficiencyCorrectionTool::calculate(const PATCore::ParticleDataTy
     val = 0;
   }
   m_result.setResult(m_position_uncorrSys, val);
-
+  ///
+  //Here are the toys 
+  ////////////////////////// 
   if (m_doToyMC || m_doCombToyMC) {
-    std::vector< std::vector<TObjArray *> *> *toyMCList;
-    if (isFastSim) {
-      toyMCList = m_uncorrToyMCSystFast;
-    } else {
-      toyMCList = m_uncorrToyMCSystFull;
-    }
-    if (toyMCList != 0) {
-      if (toyMCList->size() > (unsigned int) m_runnumberIndex) {
+    std::vector<std::vector<TObjArray > >& toyMCList = ((isFastSim) ? m_uncorrToyMCSystFast : m_uncorrToyMCSystFull);
+      if (toyMCList.size() > (unsigned int) runnumberIndex) {
         for (int toy = 0; toy < m_nToyMC; toy++) {
-          if (toyMCList->at(m_runnumberIndex)->at(toy)->GetLast() >= index) {
+          if (toyMCList.at(runnumberIndex).at(toy).GetLast() >= index) {
             m_result.setResult(m_position_uncorrToyMCSF.at(toy),
-                               ((TH2 *) toyMCList->at(m_runnumberIndex)->at(toy)->At(index))->GetBinContent(
-													    globalBinNumber));
+                               ((TH2 *) toyMCList.at(runnumberIndex).at(toy).At(index))->GetBinContent(globalBinNumber));
           }
         }
       }
-    }
   }
   m_result.setResult(m_position_globalBinNumber, globalBinNumber);
-
   return m_result;
 }
 
+// =============================================================================
+// Calculate the detail levels for a given eigenvector histogram
+// =============================================================================
+void
+Root::TElectronEfficiencyCorrectionTool::calcDetailLevels(TH1D *eig) {
+ 
+  m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] = 0;
+  m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] = 0;
+  m_sLevel[Root::TElectronEfficiencyCorrectionTool::detailed] = 0;
+  
+  int nSys = eig->GetNbinsX() - 1;
+  double sign = 0;
+  // Calculate detail level
+  for (int i = nSys + 1; i >= 2; i--) {
+    sign += eig->GetBinContent(i);
+    if (sign > 0.8 && m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] == 0) {
+      m_sLevel[Root::TElectronEfficiencyCorrectionTool::simple] = i - 2;
+    }
+    if (sign > 0.95 && m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] == 0) {
+      m_sLevel[Root::TElectronEfficiencyCorrectionTool::medium] = i - 2;
+    }
+  }
+  m_nSys = nSys;
+}
+
+// =============================================================================
+// Build the toyMC tables from inputs
+// =============================================================================
+std::vector<TH2D *>
+Root::TElectronEfficiencyCorrectionTool::buildSingleToyMC(TH2D *sf, TH2D *stat, TH2D *uncorr, const TObjArray& corr) {
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")! " << "entering function buildSingleToyMC");
+
+  std::vector<TH2D*> tmpHists;
+  int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
+  for (int toy = 0; toy < m_nToyMC; toy++) {
+    tmpHists.push_back((TH2D *) corr.At(0)->Clone());
+  }
+  // Loop over all bins
+  for (int bin = 0; bin < nBins; bin++) {
+    double val = stat->GetBinContent(bin);
+
+    // Add uncorrelated systematics
+    if (uncorr != 0) {
+      double valAdd = uncorr->GetBinContent(bin);
+      val = sqrt(val * val + valAdd * valAdd);
+    }
+
+    // Add smaller correlated systematics as uncorrelated
+    for (int i = 0; i < m_sLevel[m_detailLevel]; ++i) {
+      if (corr.At(i) != 0) {
+        double valAdd = ((TH2D *) corr.At(i))->GetBinContent(bin);
+        val = sqrt(val * val + valAdd * valAdd);
+      }
+    }
+    for (int toy = 0; toy < m_nToyMC; toy++) {
+      tmpHists.at(toy)->SetBinContent(bin, (val * m_Rndm.Gaus(0, 1)) + sf->GetBinContent(bin));
+      m_randomCounter++;
+      tmpHists.at(toy)->SetDirectory(0);
+    }
+  }
+  return tmpHists;
+}
+
+// =============================================================================
+// Build the combined toyMC tables from inputs
+// =============================================================================
+TH2D*
+Root::TElectronEfficiencyCorrectionTool::buildSingleCombToyMC(TH2D *sf, TH2D *stat, TH2D *uncorr, const TObjArray& corr) {
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function buildSingleCombToyMC");
+
+  TH2D *tmpHist;
+  int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
+  tmpHist = (TH2D *) corr.At(0)->Clone();
+
+  // Create random numbers for the corr. uncertainties
+  std::vector<double> rnd (m_nSys,0);
+  for (int s = 0; s < m_nSys; s++) {
+    rnd[s] = m_Rndm.Gaus(0, 1);
+    m_randomCounter++;
+  }
+
+  // Loop over all bins
+  for (int bin = 0; bin < nBins; bin++) {
+    double val = stat->GetBinContent(bin);
+
+    // Add uncorrelated systematics
+    if (uncorr != 0) {
+      double valAdd = uncorr->GetBinContent(bin);
+      val = sqrt(val * val + valAdd * valAdd);
+    }
+    // Add smaller correlated systematics as uncorrelated
+
+    for (int s = 0; s < m_sLevel[m_detailLevel]; s++) {
+      if (corr.At(s) != 0) {
+        double valAdd = ((TH2D *) corr.At(s))->GetBinContent(bin);
+        val = sqrt(val * val + valAdd * valAdd);
+      }
+    }
+
+    val = val * m_Rndm.Gaus(0, 1);
+    m_randomCounter++;
+
+    // Add larger correlated systematics
+    for (int s = m_sLevel[m_detailLevel]; s < m_nSys; s++) {
+      if (corr.At(s) != 0) {
+        val += ((TH2D *) corr.At(s))->GetBinContent(bin) * rnd[s];
+      }
+    }
+    tmpHist->SetBinContent(bin, val + sf->GetBinContent(bin));
+  }
+
+  tmpHist->SetDirectory(0);
+  return tmpHist;
+}
+
+// =============================================================================
+// Build the toyMC tables from inputs
+// =============================================================================
+std::vector<TObjArray>
+Root::TElectronEfficiencyCorrectionTool::buildToyMCTable(const TObjArray& sf, const TObjArray& eig, const TObjArray& stat,
+                                                         const TObjArray& uncorr, const std::vector<TObjArray>& corr) {
+
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function buildToyMCTable");
+  std::vector<TObjArray> tmpVec;
+  const int stat_entries = stat.GetEntries();
+
+  if (m_doCombToyMC) {
+    for (int toyMC = 0; toyMC < m_nToyMC; toyMC++) {
+      TObjArray tmpArray;
+      for (int i = 0; i < stat_entries; ++i) {
+        if (eig.GetEntriesFast()>0 && uncorr.GetEntriesFast()>0) {
+          calcDetailLevels((TH1D *) eig.At(i));
+          tmpArray.Add(buildSingleCombToyMC((TH2D *) sf.At(i), (TH2D *) stat.At(i), (TH2D *) uncorr.At(i), corr.at(i)));
+        }else {
+          tmpArray.Add(buildSingleCombToyMC((TH2D *) sf.At(i), (TH2D *) stat.At(i), 0, corr.at(i)));
+        }
+      }
+      tmpVec.push_back(tmpArray);
+    }
+  }else {
+    std::vector< std::vector<TH2D*> > tmpVec2 ;
+    for (int i = 0; i < stat_entries; ++i) {
+      calcDetailLevels((TH1D *) eig.At(i));
+      tmpVec2.push_back(buildSingleToyMC((TH2D *) sf.At(i), (TH2D *) stat.At(i), 
+					 (TH2D *) uncorr.At(i),corr.at(i)));
+    }
+    for (int toy = 0; toy < m_nToyMC; toy++) {
+      TObjArray tmpArray;
+      for (unsigned int i = 0; i < tmpVec2.size(); ++i) {
+        tmpArray.Add(tmpVec2.at(i).at(toy));
+      }
+      tmpVec.push_back(tmpArray);
+    }
+  }
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "m_Rndm->Uniform(0, 1) after throwing " << m_randomCounter
+		<< " random numbers: " << m_Rndm.Uniform(0,1));
+  return tmpVec;
+}
+
 // =============================================================================
 // Helper function to retrieve number of uncorrelated bins
 // =============================================================================
 int
-Root::TElectronEfficiencyCorrectionTool::getNbins(std::map<float, std::vector<float> > &pt_eta1) {
-  std::vector<TObjArray *> tmpVec;
-
-  tmpVec = m_histList["sf"];
+Root::TElectronEfficiencyCorrectionTool::getNbins(std::map<float, std::vector<float> > &pt_eta1) const {
+  const std::vector<TObjArray >& tmpVec = m_histList.at(mapkey::sf);
   int nbinsTotal = 0;
   pt_eta1.clear();
   std::vector<float>eta1;
   eta1.clear();
 
   for (unsigned int ikey = 0; ikey < tmpVec.size(); ++ikey) {
-    for (int entries = 0; entries < (tmpVec.at(ikey))->GetEntries(); entries++) {
+    for (int entries = 0; entries < (tmpVec.at(ikey)).GetEntries(); entries++) {
       eta1.clear();
 
-      TH2D *h_tmp = ((TH2D * ) (tmpVec.at(ikey))->At(entries));
+      TH2D *h_tmp = ((TH2D * ) (tmpVec.at(ikey)).At(entries));
       int nbinsX = h_tmp->GetNbinsX();
       int nbinsY = h_tmp->GetNbinsY();
 
       for (int biny = 1; biny <= nbinsY + 1; biny++) {
         eta1.push_back(h_tmp->GetYaxis()->GetBinLowEdge(biny));
-        if (entries == (tmpVec.at(ikey))->GetEntries() - 1) {
+        if (entries == (tmpVec.at(ikey)).GetEntries() - 1) {
           eta1.push_back(h_tmp->GetYaxis()->GetBinLowEdge(biny + 1));
         }
       }
       for (int binx = 1; binx <= nbinsX; binx++) {
         pt_eta1[h_tmp->GetXaxis()->GetBinLowEdge(binx)] = eta1;
-        if (entries == (tmpVec.at(ikey))->GetEntries() - 1) {
+        if (entries == (tmpVec.at(ikey)).GetEntries() - 1) {
           pt_eta1[h_tmp->GetXaxis()->GetBinLowEdge(binx + 1)] = eta1;
         }
       }
     }
   }
-
   for (auto &i : pt_eta1) {
     nbinsTotal += i.second.size();
   }
-
   return nbinsTotal;
 }
 
 // =============================================================================
 // Helper function to retrieve the position of the first toy MC scale factor
 // =============================================================================
-int
-Root::TElectronEfficiencyCorrectionTool::getFirstToyMCPosition() {
+int Root::TElectronEfficiencyCorrectionTool::getFirstToyMCPosition() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return -1;
   }
-
   if (m_nToyMC > 0) {
     return m_position_uncorrToyMCSF.at(0);
   }else {
@@ -787,13 +805,11 @@ Root::TElectronEfficiencyCorrectionTool::getFirstToyMCPosition() {
   }
 }
 
-int
-Root::TElectronEfficiencyCorrectionTool::getLastToyMCPosition() {
+int Root::TElectronEfficiencyCorrectionTool::getLastToyMCPosition() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return -1;
   }
-
   if (m_nToyMC > 0) {
     return m_position_uncorrToyMCSF.at(m_nToyMC - 1);
   } else {
@@ -802,14 +818,13 @@ Root::TElectronEfficiencyCorrectionTool::getLastToyMCPosition() {
     return 0;
   }
 }
-
-int
-Root::TElectronEfficiencyCorrectionTool::getFirstCorrSysPosition() {
+//================================================================================
+/// Helpers
+int Root::TElectronEfficiencyCorrectionTool::getFirstCorrSysPosition() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return -1;
   }
-
   if (m_position_corrSys.size() > 0) {
     return m_position_corrSys.at(0);
   }else {
@@ -819,8 +834,7 @@ Root::TElectronEfficiencyCorrectionTool::getFirstCorrSysPosition() {
   }
 }
 
-int
-Root::TElectronEfficiencyCorrectionTool::getLastCorrSysPosition() {
+int Root::TElectronEfficiencyCorrectionTool::getLastCorrSysPosition() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return -1;
@@ -838,9 +852,7 @@ Root::TElectronEfficiencyCorrectionTool::getLastCorrSysPosition() {
     return 0;
   }
 }
-
-int
-Root::TElectronEfficiencyCorrectionTool::getGlobalBinNumberPosition() {
+int Root::TElectronEfficiencyCorrectionTool::getGlobalBinNumberPosition() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return -1;
@@ -848,8 +860,7 @@ Root::TElectronEfficiencyCorrectionTool::getGlobalBinNumberPosition() {
   return m_position_globalBinNumber;
 }
 
-void
-Root::TElectronEfficiencyCorrectionTool::printResultMap() {
+void Root::TElectronEfficiencyCorrectionTool::printResultMap() const {
   if (!m_isInitialized) {
     ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tool not initialized.");
     return;
@@ -859,17 +870,16 @@ Root::TElectronEfficiencyCorrectionTool::printResultMap() {
     ATH_MSG_INFO(pos << " \t \t - \t " << m_result.getResultDescription(pos));
   }
 }
+//================================================================================
 
 // =============================================================================
 // Get the input histograms from the input files
 // =============================================================================
-int
-Root::TElectronEfficiencyCorrectionTool::getHistograms() {
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function getHistograms");
+int Root::TElectronEfficiencyCorrectionTool::getHistograms() {
 
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering function getHistograms");
   // Cache the current directory in the root file
   TDirectory *origDir = gDirectory;
-
   // -------------------------------------------------------
   // Get the name of the first input ROOT file and
   // interpret from that what we have:
@@ -877,10 +887,11 @@ Root::TElectronEfficiencyCorrectionTool::getHistograms() {
   // -------------------------------------------------------
   if (!m_corrFileNameList.empty()) {
     TString firstFileNameAndPath = m_corrFileNameList[0].c_str();
-    TObjArray *myStringList = firstFileNameAndPath.Tokenize("/");
+    std::unique_ptr<TObjArray> myStringList(firstFileNameAndPath.Tokenize("/"));
     int lastIdx = myStringList->GetLast();
     TString fileName = ((TObjString *) myStringList->At(lastIdx))->GetString();
-    TObjArray *myFileNameTokensList = fileName.Tokenize(".");
+    std::unique_ptr<TObjArray> myFileNameTokensList(fileName.Tokenize("."));
+  
     if (myFileNameTokensList->GetLast() < 3) {
       ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "input file name has wrong format!");
       return 0;
@@ -897,31 +908,20 @@ Root::TElectronEfficiencyCorrectionTool::getHistograms() {
     ATH_MSG_INFO("Using resultPrefix: " << m_resultPrefix
 		 << " and resultName: " << m_resultName);
 
-    delete myStringList;
-    delete myFileNameTokensList;
   }
-
   // -------------------------------------------------------
   // Get all ROOT files and histograms
   // -------------------------------------------------------
-
   for (unsigned int i = 0; i < m_corrFileNameList.size(); ++i) {
     // Load the ROOT file
-    const char *fname;
-    fname = gSystem->ExpandPathName(m_corrFileNameList[i].c_str());
-    std::unique_ptr<TFile> rootFile = CxxUtils::make_unique<TFile> (fname, "READ");
+    const std::unique_ptr<char> fname (gSystem->ExpandPathName(m_corrFileNameList[i].c_str()));
+    std::unique_ptr<TFile> rootFile = CxxUtils::make_unique<TFile> (fname.get(), "READ");
     if (!rootFile) {
       ATH_MSG_ERROR(
 		    " (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "No ROOT file found here: " <<
 		    m_corrFileNameList[i]);
-      ;
       return 0;
     }
-
-    if (m_doToyMC || m_doCombToyMC) {
-      m_uncorrToyMCSystFull = new std::vector< std::vector<TObjArray *> * >;
-      m_uncorrToyMCSystFast = new std::vector< std::vector<TObjArray *> *>;
-    }
     // Loop over all directories inside the root file (correspond to the run number ranges
     TIter nextdir(rootFile->GetListOfKeys());
     TKey *dir;
@@ -930,16 +930,17 @@ Root::TElectronEfficiencyCorrectionTool::getHistograms() {
       obj = dir->ReadObj();
       if (obj->IsA()->InheritsFrom("TDirectory")) {
         // splits string by delimiter --> e.g RunNumber1_RunNumber2
-        std::unique_ptr<TObjArray> dirNameArray(TString(obj->GetName()).Tokenize("_"));
+	//std::unique_ptr<TObjArray> dirNameArray(TString(obj->GetName()).Tokenize("_"));
+        TObjArray dirNameArray = *(TString(obj->GetName()).Tokenize("_"));
         //// returns index of last string --> if one, the directory name does not contain any run numbers
-        int lastIdx = dirNameArray->GetLast();
+        int lastIdx = dirNameArray.GetLast();
         if (lastIdx != 1) {
           ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "The folder name seems to have the wrong format! Directory name:"
 			<< obj->GetName());
           return 0;
         }
         rootFile->cd(obj->GetName());
-        if (0 == this->setupHistogramsInFolder(dirNameArray.get(), lastIdx)) {
+        if (0 == this->setupHistogramsInFolder(dirNameArray, lastIdx)) {
           ATH_MSG_ERROR(
 			" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "unable to setup the histograms in directory " << dir->GetName()
 			<< "in file " << m_corrFileNameList[i]);
@@ -955,38 +956,23 @@ Root::TElectronEfficiencyCorrectionTool::getHistograms() {
       gDirectory = origDir;
     } // End: directory loop
   } // End: file loop
-
   return 1;
 }
 
 // =============================================================================
 // Get the input histograms from a given folder/run number range
 // =============================================================================
-int
-Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder(TObjArray *dirNameArray, int lastIdx) {
-  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering funtion setupHistogramsInFolder");
-
-  std::unique_ptr<std::map<std::string, TObjArray *> > objsFull(new std::map<std::string, TObjArray *>);
-  std::unique_ptr<std::map<std::string, TObjArray *> > objsFast(new std::map<std::string, TObjArray *>);
-
-  std::unique_ptr<std::vector<TObjArray *> > sysObjsFull(new std::vector<TObjArray *>);
-  std::unique_ptr<std::vector<TObjArray *> > sysObjsFast(new std::vector<TObjArray *>);
+int Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder(const TObjArray& dirNameArray, int lastIdx) {
 
-  /// setup pairs of obj arrays and keys --> e.g. "sf", new Array to take all SF Histos
-  for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-    objsFull->insert(std::make_pair(m_keys.at(ikey), new TObjArray()));
-    objsFast->insert(std::make_pair(m_keys.at(ikey), new TObjArray()));
-  }
-  objsFull->insert(std::make_pair("sys", new TObjArray()));
-  objsFast->insert(std::make_pair("sys", new TObjArray()));
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "entering funtion setupHistogramsInFolder");
 
   m_runNumBegin = -1;
-  TString myBegRunNumString = ((TObjString *) dirNameArray->At(lastIdx - 1))->GetString();
+  TString myBegRunNumString = ((TObjString *) dirNameArray.At(lastIdx - 1))->GetString();
   if (myBegRunNumString.IsDigit()) {
     m_runNumBegin = myBegRunNumString.Atoi();
   }
   m_runNumEnd = -1;
-  TString myEndRunNumString = ((TObjString *) dirNameArray->At(lastIdx))->GetString();
+  TString myEndRunNumString = ((TObjString *) dirNameArray.At(lastIdx))->GetString();
   if (myEndRunNumString.IsDigit()) {
     m_runNumEnd = myEndRunNumString.Atoi();
   }
@@ -996,222 +982,225 @@ Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder(TObjArray *dirN
     return 0;
   }
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << m_runNumBegin << "  " << m_runNumEnd);
-
+  //
+  /// setup pairs of obj arrays and keys --> e.g. "sf", new Array to take all SF Histos
+  std::map<int, TObjArray> objsFull;
+  std::map<int, TObjArray > objsFast;
+  for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
+    TObjArray dummyFull;
+    objsFull.insert(std::make_pair(m_keys.at(ikey),dummyFull));
+    TObjArray dummyFast;
+    objsFast.insert(std::make_pair(m_keys.at(ikey),dummyFast));
+  }  
+  TObjArray dummyFull;    
+  objsFull.insert(std::make_pair(mapkey::sys, dummyFull));
+  TObjArray dummyFast;
+  objsFast.insert(std::make_pair(mapkey::sys, dummyFast));
+  //---------------------------------------------------------
+  //
+  std::vector<TObjArray > sysObjsFull;
+  std::vector<TObjArray > sysObjsFast;
+  //
   TIter nextkey(gDirectory->GetListOfKeys());
   TKey *key;
   TObject *obj(0);
   TString tmpName = "";
-  TObjArray *tmpArrayFull(NULL);
-  TObjArray *tmpArrayFast(NULL);
   int tmpCounter = 0;
-  int loop = 0;
+
+  //
+  //Loop of the keys 
   while ((key = (TKey *) nextkey())) {
     obj = key->ReadObj();
     if (obj->IsA()->InheritsFrom("TH1")) {
       // The histogram containing the scale factors need to end with _sf and need to contain either the string "FullSim"
       // or "AtlFast2"!
       if (TString(obj->GetName()).Contains("FullSim")) {
-        for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-          if (TString(obj->GetName()).EndsWith("_" + (TString) m_keys.at(ikey))) {
-            objsFull->find(m_keys.at(ikey))->second->Add(obj);
-          }
-          if (!loop && TString(obj->GetName()).EndsWith("_sys")) {
-            objsFull->find("sys")->second->Add(obj);
-            tmpCounter++;
-            loop++;
-            if (tmpArrayFull == 0 && (objsFull->find("sys")->second)) {
-              tmpArrayFull = new TObjArray();
-              tmpArrayFull->Add(obj);
-            }else if (tmpArrayFull != 0) {
-              tmpArrayFull->Add(obj);
-            }
-          }
-        }
-
-        if (!loop && TString(obj->GetName()).EndsWith("_sys")) {
-          objsFull->find("sys")->second->Add(obj);
-          tmpCounter++;
-          loop++;
-          if (tmpArrayFull == 0 && (objsFull->find("sys")->second)) {
-            tmpArrayFull = new TObjArray();
-            tmpArrayFull->Add(obj);
-          }else if (tmpArrayFull != 0) {
-            tmpArrayFull->Add(obj);
-          }
-        }
-
-        tmpName = TString(obj->GetName());
-        if (tmpName.Contains("_corr")) {
-          if (tmpName.EndsWith("corr0")) {
-            if (tmpCounter > m_nSysMax) {
-              m_nSysMax = tmpCounter;
-            }
-            tmpCounter = 0;
-            if (tmpArrayFull != 0) {
-              sysObjsFull->push_back(tmpArrayFull);
-            }
-            tmpArrayFull = new TObjArray();
-          }
-          if (tmpArrayFull != 0) {
-            tmpArrayFull->Add(obj);
-          }else {
-            ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Tried to read systematic uncertainties for full sim scale factor,"
-			  << " but could NOT find a histogram with name ending in \"corr0\". Please check input file! ");
-            return 0;
-          }
-          tmpCounter++;
-        }
-        if (tmpCounter > m_nSysMax) {
-          m_nSysMax = tmpCounter;
-        }
-      }else if (TString(obj->GetName()).Contains("AtlFast2")) {
-        for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-          if (TString(obj->GetName()).EndsWith("_" + (TString) m_keys.at(ikey))) {
-            objsFast->find(m_keys.at(ikey))->second->Add(obj);
-          }
-        }
-        tmpName = TString(obj->GetName());
-        if (tmpName.Contains("_corr")) {
-          if (tmpName.EndsWith("corr0")) {
-            if (tmpCounter > m_nSysMax) {
-              m_nSysMax = tmpCounter;
-            }
-            tmpCounter = 0;
-            if (tmpArrayFast != 0) {
-              sysObjsFast->push_back(tmpArrayFast);
-            }
-            tmpArrayFast = new TObjArray();
-          }
-          if (tmpArrayFast != 0) {
-            tmpArrayFast->Add(obj);
-          }else {
-            ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Tried to read systematic uncertainties for fast sim scale factor, "
-			  << "but could NOT find a histogram with name ending in \"corr0\". Please check input file! ");
-            return 0;
-          }
-          tmpCounter++;
-        }
-        if (tmpCounter > m_nSysMax) {
-          m_nSysMax = tmpCounter;
-        }
+	//Add all except the correlated 
+	for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
+	  if (TString(obj->GetName()).EndsWith("_" +  TString(mapkey::keytostring(m_keys.at(ikey))))) {
+	    objsFull.find(m_keys.at(ikey))->second.Add(obj);
+	  }
+	}
+	//
+	tmpName = TString(obj->GetName());
+	//Special treatment , this is only for photons 
+	if (tmpName.EndsWith("_sys")) {
+	  objsFull.find(mapkey::sys)->second.Add(obj);
+	  TObjArray tmpArrayFull;
+	  tmpArrayFull.Add(obj);
+	  sysObjsFull.push_back(tmpArrayFull);
+	  tmpCounter++;
+	}
+	//
+	//See if we are dealing with correlated
+	if (tmpName.Contains("_corr")) {
+ 	  if (tmpName.EndsWith("corr0")) {
+	    //This is the worse part ...
+	    //corr0 triggers a few thing
+	    //
+	    //1st create a TObjectArray
+	    //For high or low Pt (one for each ...)
+	    TObjArray tmpArrayFull;
+	    //Resgister it to the vector (so the vector has size 1 or 2)
+	    sysObjsFull.push_back(tmpArrayFull);
+            //Reset the counter
+	    tmpCounter=0;
+	  }
+	  //Add to the current last element of the sysObject full
+	  //This will be Low Pt once and high Pt the other time
+	  sysObjsFull.back().Add(obj);
+	  //Now increase the counter
+	  tmpCounter++;
+	}
+	if (tmpCounter > m_nSysMax) {
+	  m_nSysMax = tmpCounter;
+	}
+      }
+      else if (TString(obj->GetName()).Contains("AtlFast2")) {
+	for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
+	  if (TString(obj->GetName()).EndsWith("_" +  TString(mapkey::keytostring(m_keys.at(ikey))))) {
+	    objsFast.find(m_keys.at(ikey))->second.Add(obj);
+	  }
+	}
+	//See if we are dealing with correlated
+	tmpName = TString(obj->GetName());
+	//Special treatment , this is only for photons 
+	if (tmpName.EndsWith("_sys")) {
+	  objsFast.find(mapkey::sys)->second.Add(obj);
+	  TObjArray tmpArrayFast;
+	  tmpArrayFast.Add(obj);
+	  sysObjsFast.push_back(tmpArrayFast);
+	  tmpCounter++;
+	}
+	//
+	//See if we are dealing with correlated
+	if (tmpName.Contains("_corr")) {
+ 	  if (tmpName.EndsWith("corr0")) {
+	    //This is the worse part ...
+	    //corr0 triggers a few thing
+	    //1st create a TObjectArray
+	    TObjArray tmpArrayFast;
+	    //Resgister it
+	    sysObjsFast.push_back(tmpArrayFast);
+            //Reset the counter
+	    tmpCounter=0;
+	  }
+	  //Add to the current last element of the sysObject full
+	  //This will be Low Pt once and high Pt the other time
+	  sysObjsFast.back().Add(obj);
+	  //Now increase the counter
+	  tmpCounter++;
+	}
+	if (tmpCounter > m_nSysMax) {
+	  m_nSysMax = tmpCounter;
+	}
       } else {
-        ATH_MSG_ERROR(
+	ATH_MSG_ERROR(
 		      " (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "Could NOT interpret if the histogram: " << obj->GetName()
 		      << " is full or fast simulation!");
-        return 0;
+	return 0;
       }
     }
   }
 
-  if (tmpArrayFull != 0) {
-    sysObjsFull->push_back(tmpArrayFull);
-  }
-  if (tmpArrayFast != 0) {
-    sysObjsFast->push_back(tmpArrayFast);
-  }
-
-  ATH_MSG_DEBUG(
-		" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "setting up histograms for run ranges  " <<
+  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "setting up histograms for run ranges  " <<
 		m_runNumEnd);
-
+  //
+  //The setup here copies from the temporaties created in this function , 
+  //to the actual class member variables.
   for (unsigned int ikey = 0; ikey < m_keys.size(); ++ikey) {
-    if (objsFull->find(m_keys.at(ikey))->second->GetEntries() != 0) {
+    if (objsFull.find(m_keys.at(ikey))->second.GetEntries() != 0) {
       if (0 ==
-          this->setup(objsFull->find(m_keys.at(ikey))->second, m_histList[m_keys.at(ikey)], m_begRunNumberList,
-                      m_endRunNumberList)) {
-        ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Could NOT setup histogram " << m_keys.at(
-															      ikey)
-		      << " for full sim!");
-        return 0;
+	  setup(objsFull.find(m_keys.at(ikey))->second, m_histList[m_keys.at(ikey)], 
+		m_begRunNumberList,m_endRunNumberList)) {
+	ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Could NOT setup histogram " 
+		      << m_keys.at(ikey)<< " for full sim!");
+	return 0;
       }
     }
-    if (objsFast->find(m_keys.at(ikey))->second->GetEntries() != 0) {
+    if (objsFast.find(m_keys.at(ikey))->second.GetEntries() != 0) {
       if (0 ==
-          this->setup(objsFast->find(std::string(m_keys.at(ikey)))->second, m_fastHistList[m_keys.at(ikey)],
-                      m_begRunNumberListFastSim, m_endRunNumberListFastSim)) {
-        ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Could NOT setup histogram " << m_keys.at(
-															      ikey)
+	  setup(objsFast.find(m_keys.at(ikey))->second, m_fastHistList[m_keys.at(ikey)],
+		m_begRunNumberListFastSim, m_endRunNumberListFastSim)) {
+	ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Could NOT setup histogram " << m_keys.at(ikey)
 		      << " for fast sim");
-        return 0;
+	return 0;
       }
     }
   }
-
-  for (unsigned int sys = 0; sys < sysObjsFast->size(); sys++) {
-    m_fastSysList.resize(sysObjsFast->size());
-    if (0 ==
-        this->setup(sysObjsFast->at(sys), m_fastSysList[sys], m_begRunNumberListFastSim, m_endRunNumberListFastSim)) {
-      ATH_MSG_ERROR(
-		    " (file: " << __FILE__ << ", line: " << __LINE__ << ") " <<
+  for (unsigned int sys = 0; sys < sysObjsFast.size(); sys++) {
+    m_fastSysList.resize(sysObjsFast.size());
+    if (0 == setup(sysObjsFast.at(sys), m_fastSysList[sys], m_begRunNumberListFastSim, m_endRunNumberListFastSim)) {
+      ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " <<
 		    "! Could NOT setup systematic histograms for fast sim");
       return 0;
     }
   }
-
-  for (unsigned int sys = 0; sys < sysObjsFull->size(); sys++) {
-    m_sysList.resize(sysObjsFull->size());
-    if (0 == this->setup(sysObjsFull->at(sys), m_sysList[sys], m_begRunNumberList, m_endRunNumberList)) {
+  for (unsigned int sys = 0; sys < sysObjsFull.size(); sys++) {
+    m_sysList.resize(sysObjsFull.size());
+    if (0 == setup(sysObjsFull.at(sys), m_sysList[sys], m_begRunNumberList, m_endRunNumberList)) {
       ATH_MSG_ERROR(
 		    " (file: " << __FILE__ << ", line: " << __LINE__ << ") " <<
 		    "! Could NOT setup systematic histograms for fast sim");
       return 0;
     }
   }
-
+  //
+  //Toys
   ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ") " << this->getName()
 		<< "Checking for (m_doToyMC || m_doCombToyMC)");
 
   if (m_doToyMC || m_doCombToyMC) {
     bool fullToysBooked = kFALSE;
     bool fastToysBooked = kFALSE;
-
-    if (m_histList["sf"].size() > 0) {
-      if (objsFull->find("eig")->second->GetEntries() < 1 || objsFull->find("stat")->second->GetEntries() < 1 ||
-          objsFull->find("uncorr")->second->GetEntries() < 1) {
-        if (objsFull->find("stat")->second->GetEntries() > 1 || objsFull->find("sys")->second->GetEntries() > 1) {
-          m_uncorrToyMCSystFull->push_back(buildToyMCTable(objsFull->find("sf")->second, NULL,
-                                                           objsFull->find("stat")->second,
-                                                           NULL, sysObjsFull.get()));
-          fullToysBooked = kTRUE;
-        }else {
-          ATH_MSG_INFO(
+    TObjArray dummy;
+
+    if (m_histList[mapkey::sf].size() > 0) {
+      if (objsFull.find(mapkey::eig)->second.GetEntries() < 1 || objsFull.find(mapkey::stat)->second.GetEntries() < 1 ||
+	  objsFull.find(mapkey::uncorr)->second.GetEntries() < 1) {
+	if (objsFull.find(mapkey::stat)->second.GetEntries() > 1 || objsFull.find(mapkey::sys)->second.GetEntries() > 1) {
+	  m_uncorrToyMCSystFull.push_back(buildToyMCTable(objsFull.find(mapkey::sf)->second, dummy,
+							   objsFull.find(mapkey::stat)->second,
+							   dummy, sysObjsFull));
+	  fullToysBooked = kTRUE;
+	}else {
+	  ATH_MSG_INFO(
 		       "! Toy MC error propagation booked, but not all needed histograms found in the output (For full sim). Skipping toy creation!");
-        }
+	}
       }else {
-        m_uncorrToyMCSystFull->push_back(buildToyMCTable(objsFull->find("sf")->second, objsFull->find("eig")->second,
-                                                         objsFull->find("stat")->second,
-                                                         objsFull->find("uncorr")->second, sysObjsFull.get()));
-        fullToysBooked = kTRUE;
+	m_uncorrToyMCSystFull.push_back(buildToyMCTable(objsFull.find(mapkey::sf)->second, objsFull.find(mapkey::eig)->second,
+							 objsFull.find(mapkey::stat)->second,
+							 objsFull.find(mapkey::uncorr)->second, sysObjsFull));
+	fullToysBooked = kTRUE;
       }
     }
-
     ///// AF2
-    if (m_fastHistList["sf"].size() > 0) {
-      if (objsFast->find("eig")->second->GetEntries() < 1 || objsFast->find("stat")->second->GetEntries() < 1 ||
-          objsFast->find("uncorr")->second->GetEntries() < 1) {
-        if (objsFast->find("stat")->second->GetEntries() > 1 || objsFast->find("sys")->second->GetEntries() > 1) {
-          m_uncorrToyMCSystFast->push_back(buildToyMCTable(objsFast->find("sf")->second, NULL,
-                                                           objsFast->find("stat")->second,
-                                                           NULL, sysObjsFast.get()));
-          fastToysBooked = kTRUE;
-        }else {
-          ATH_MSG_INFO(
+    if (m_fastHistList[mapkey::sf].size() > 0) {
+      if (objsFast.find(mapkey::eig)->second.GetEntries() < 1 || objsFast.find(mapkey::stat)->second.GetEntries() < 1 ||
+	  objsFast.find(mapkey::uncorr)->second.GetEntries() < 1) {
+	if (objsFast.find(mapkey::stat)->second.GetEntries() > 1 || objsFast.find(mapkey::sys)->second.GetEntries() > 1) {
+	  m_uncorrToyMCSystFast.push_back(buildToyMCTable(objsFast.find(mapkey::sf)->second, dummy,
+							   objsFast.find(mapkey::stat)->second,
+							   dummy, sysObjsFast));
+	  fastToysBooked = kTRUE;
+	}else {
+	  ATH_MSG_INFO(
 		       "! Toy MC error propagation booked, but not all needed histograms found in the output (For fast sim). Skipping toy creation!");
-        }
+	}
       }else {
-        m_uncorrToyMCSystFast->push_back(buildToyMCTable(objsFast->find("sf")->second, objsFast->find("eig")->second,
-                                                         objsFast->find("stat")->second,
-                                                         objsFast->find("uncorr")->second, sysObjsFast.get()));
-        fastToysBooked = kTRUE;
+	m_uncorrToyMCSystFast.push_back(buildToyMCTable(objsFast.find(mapkey::sf)->second, objsFast.find(mapkey::eig)->second,
+							 objsFast.find(mapkey::stat)->second,
+							 objsFast.find(mapkey::uncorr)->second, sysObjsFast));
+	fastToysBooked = kTRUE;
       }
     }
 
     if (fullToysBooked || fastToysBooked) {
       if (m_doToyMC) {
-        ATH_MSG_INFO("Created tables for " << m_nToyMC << " ToyMC systematics ");
+	ATH_MSG_INFO("Created tables for " << m_nToyMC << " ToyMC systematics ");
       }
       if (m_doCombToyMC) {
-        ATH_MSG_INFO("Created tables for " << m_nToyMC << " combined ToyMC systematics ");
+	ATH_MSG_INFO("Created tables for " << m_nToyMC << " combined ToyMC systematics ");
       }
     }
   }
@@ -1222,18 +1211,18 @@ Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder(TObjArray *dirN
 // Fill and interpret the setup, depending on which histograms are found in the input file(s)
 // =============================================================================
 int
-Root::TElectronEfficiencyCorrectionTool::setup(TObjArray *hists,
-                                               std::vector< TObjArray * > &histList,
+Root::TElectronEfficiencyCorrectionTool::setup(const TObjArray& hists,
+                                               std::vector< TObjArray> &histList,
                                                std::vector< unsigned int > &beginRunNumberList,
                                                std::vector< unsigned int > &endRunNumberList) {
-  if (!hists) {
+  if (hists.GetEntriesFast()==0) {
     ATH_MSG_ERROR(
 		  "(file: " << __FILE__ << ", line: " << __LINE__ << ") " << "! Could NOT find histogram with name *_sf in folder");
     return 0;
   }
   TH2 *tmpHist(0);
-  for (int i = 0; i < hists->GetEntries(); ++i) {
-    tmpHist = (TH2 *) hists->At(i);
+  for (int i = 0; i < hists.GetEntries(); ++i) {
+    tmpHist = (TH2 *) hists.At(i);
     tmpHist->SetDirectory(0);
   }
   // Now, we have all the needed info. Fill the vectors accordingly
@@ -1252,15 +1241,13 @@ Root::TElectronEfficiencyCorrectionTool::setup(TObjArray *hists,
   }else {
     endRunNumberList.push_back(m_runNumEnd);
   }
-
   return 1;
 }
-
 // =============================================================================
 // print a message that the default scale factor is returned
 // =============================================================================
 void
-Root::TElectronEfficiencyCorrectionTool::printDefaultReturnMessage(TString reason, int line) {
+Root::TElectronEfficiencyCorrectionTool::printDefaultReturnMessage(const TString& reason, int line) const{
   ATH_MSG_DEBUG(
 		this->getName() << " (file: " << __FILE__ << ", line: " << line << ")  " << reason << "\n" <<
 		"Returning scale factor -999 ");
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/share/myJobOptions.py b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/share/myJobOptions.py
index 15abdc83463b780be0442c6d96464b6d12539fb2..fac4fdc92d7aa32a104a22ebedd22013c07defe0 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/share/myJobOptions.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/share/myJobOptions.py
@@ -16,6 +16,8 @@ input_files=["ElectronEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v1/o
 alg.ElectronEfficiencyCorrectionTool.CorrectionFileNameList = input_files;
 #Set DataType: for data use 0 (or don't run the tool - faster), for FULLSIM use 1, and for FASTSIM use 3, please note that the input files are also should be different
 alg.ElectronEfficiencyCorrectionTool.ForceDataType = 1
+alg.ElectronEfficiencyCorrectionTool.CorrelationModel="MCTOYS"
+alg.ElectronEfficiencyCorrectionTool.UseRandomRunNumber= False
 alg.ElectronEfficiencyCorrectionTool.OutputLevel = INFO
 alg.OutputLevel = DEBUG
 algSeq += alg
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f1143ee0b7247c38faa2fb06a02410b80452aa99
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.cxx
@@ -0,0 +1,138 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ElectronChargeCorrection includes
+#include "EleChargeAlg.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/ElectronContainer.h"
+// #include "xAODTruth/TruthEventContainer.h"
+// #include "xAODTruth/TruthVertex.h"
+// #include "xAODEgamma/EgammaTruthxAODHelpers.h"
+#include "GaudiKernel/ITHistSvc.h"
+#include "PATInterfaces/ISystematicsTool.h"
+
+// #include "../ElectronChargeEfficiencyCorrectionTool/IElectronChargeEfficiencyCorrectionTool.h"
+#include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
+
+
+
+EleChargeAlg::EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
+  AthAlgorithm( name, pSvcLocator ),
+  m_syst(),
+  m_eccTool("CP::ElectronChargeEfficiencyCorrectionTool/ElectronChargeEfficiencyCorrectionTool", this),
+  m_eleContName("Electrons")
+{
+  declareProperty("ElectronChargeEfficiencyCorrectionTool",  m_eccTool, "The private ElectronChargeEfficiencyCorrectionTool" );
+  declareProperty("ElectronContainerName",         m_eleContName, "The name of the input electron container");
+}
+
+
+EleChargeAlg::~EleChargeAlg() {}
+
+
+StatusCode EleChargeAlg::initialize() {
+
+  ATH_MSG_INFO ("Initializing " << name() << "...");
+  ATH_CHECK( m_eccTool.retrieve() );
+  m_syst = m_eccTool->affectingSystematics();
+  for( const auto& variation : m_syst ) {
+    ATH_MSG_INFO(" Affecting systematics: " << variation.name());
+  }
+  return StatusCode::SUCCESS;
+}
+
+StatusCode EleChargeAlg::finalize() {
+  ATH_MSG_INFO ("Finalizing " << name() << "...");
+  ATH_CHECK( m_eccTool.release() );
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode EleChargeAlg::execute() {
+
+  //----------------------------
+  // Event information
+  //---------------------------
+
+  const xAOD::EventInfo* eventInfo = 0; //NOTE: Everything that comes from the storegate direct from the input files is const!
+
+  // ask the event store to retrieve the xAOD EventInfo container
+
+  CHECK( evtStore()->retrieve( eventInfo) );
+  // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
+  // the key name, the default will be taken as the only key name in the xAOD
+
+  // check if data or MC
+  if(!eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION ) ){
+    ATH_MSG_DEBUG( "DATA. Will stop processing this algorithm for the current event.");
+    return StatusCode::SUCCESS; // stop this algorithms execute() for this event, here only interested in MC
+  }
+
+
+  //---------
+  // electrons
+  //---------
+
+  const xAOD::ElectronContainer* electrons = 0;
+  CHECK( evtStore()->retrieve( electrons, m_eleContName.value() ) );
+
+  ATH_MSG_VERBOSE ("Executing " << name() << "... in event with: " << electrons->size() << " electrons");
+
+  // Loop over all electrons in this container
+  for ( const auto* electron : *electrons ) {
+
+    if ( electron->pt() < 25000 ) continue;
+    if ( std::abs(electron->eta()) > 2.5 ) continue;
+
+    ATH_MSG_DEBUG("-------------------------------------------------------------------" );
+    ATH_MSG_DEBUG(" ...  electron with pt = " << electron->pt() << " , eta: " << fabs(electron->eta()) );
+
+    double sf=-999;
+    //float rate=-999;
+    CP::SystematicSet syst_set;
+
+    CP::SystematicCode tmpSysResult = m_eccTool->applySystematicVariation(syst_set);
+    ATH_MSG_DEBUG("applySystematicVariation returned CP::SystematicCode = " << tmpSysResult);
+    if ( tmpSysResult != CP::SystematicCode::Ok ) {
+      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
+      return StatusCode::FAILURE;
+    }
+
+    CP::CorrectionCode tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron,sf);
+    ATH_MSG_DEBUG("Nominal value SF = " << sf << " and CP::CorrectionCode = " << tmpResult);
+    if ( tmpResult == CP::CorrectionCode::Error ) {
+      ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
+      return StatusCode::FAILURE;
+    }
+
+    for( const auto& variation : m_syst ) {
+      double tmpSF=0;
+      ///float tmprate=0;
+      CP::SystematicSet syst_set1;
+      syst_set1.insert( variation );
+
+      tmpSysResult = m_eccTool->applySystematicVariation(syst_set1);
+      ATH_MSG_DEBUG("applySystematicVariation (second time) returned CP::SystematicCode = " << tmpSysResult);
+      if ( tmpSysResult != CP::SystematicCode::Ok ) {
+        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool did NOT report a CP::SystematicCode::Ok when calling applySystematicVariation");
+        return StatusCode::FAILURE;
+      }
+      tmpResult = m_eccTool->getEfficiencyScaleFactor(*electron, tmpSF);
+      ATH_MSG_DEBUG("getEfficiencyScaleFactor returned CP::CorrectionCode = " << tmpResult);
+      if ( tmpResult == CP::CorrectionCode::Error ) {
+        ATH_MSG_ERROR("ElectronChargeEfficiencyCorrectionTool reported a CP::CorrectionCode::Error when calling getEfficiencyScaleFactor");
+        return StatusCode::FAILURE;
+      }
+      //   //m_eccTool->getDataEfficiency(*electron, tmprate);
+      ATH_MSG_DEBUG("   Systematic "<< variation.name() << ":" << " SF-> " << tmpSF);
+      //   //ATH_MSG_DEBUG("Systematic "<< variation.name() << ":" << " data rate-> " << tmprate);
+    }
+
+
+  } // end for loop over electrons
+
+
+  return StatusCode::SUCCESS;
+
+} //-------end of execute
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..7fe1c95c3297d747189c7857ef12ab8e6c51a16b
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/EleChargeAlg.h
@@ -0,0 +1,47 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ELECTRONCHARGECORRECTION_ELECHARGEALG_H
+#define ELECTRONCHARGECORRECTION_ELECHARGEALG_H 1
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+// #include "xAODTruth/TruthParticle.h"
+
+#include "TTree.h"
+#include "TLorentzVector.h"
+
+#include <vector>
+
+// #include "MCTruthClassifier/IMCTruthClassifier.h"
+#include "PATInterfaces/SystematicSet.h"
+
+namespace CP{
+  // class IElectronChargeEfficiencyCorrectionTool;
+  class IEfficiencyScaleFactorTool;
+}
+
+class EleChargeAlg: public ::AthAlgorithm {
+ public:
+  EleChargeAlg( const std::string& name, ISvcLocator* pSvcLocator);
+
+  virtual ~EleChargeAlg();
+
+  virtual StatusCode  initialize();
+  virtual StatusCode  execute();
+  virtual StatusCode  finalize();
+
+
+ private:
+  /// The systematics set that will contain all the systematic variations
+  CP::SystematicSet m_syst;
+
+  /// The handle to the charge-misid scale-factor tool
+  ToolHandle<CP::IEfficiencyScaleFactorTool> m_eccTool;
+
+  /// The name of the input electron container
+  StringProperty m_eleContName;
+};
+
+#endif //> !ELECTRONCHARGECORRECTION_ELECHARGEALG_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
index 4bd4b34b17b08b8b649b2d258656ff7c20c4c95d..dc08ccb8bf3e49a51fef9f70a468e15373e33a70 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/components/ElectronEfficiencyCorrection_entries.cxx
@@ -1,15 +1,18 @@
 #include "GaudiKernel/DeclareFactoryEntries.h"
 
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
-
+#include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
 #include "../testAthenaElectronAlg.h"
 
 DECLARE_TOOL_FACTORY( AsgElectronEfficiencyCorrectionTool )
+DECLARE_TOOL_FACTORY( CP::ElectronChargeEfficiencyCorrectionTool )
+
 DECLARE_ALGORITHM_FACTORY( testAthenaElectronAlg )
 
 DECLARE_FACTORY_ENTRIES( ElectronEfficiencyCorrection ) 
 {
   DECLARE_ALGTOOL( AsgElectronEfficiencyCorrectionTool )
+  DECLARE_ALGTOOL( CP::ElectronChargeEfficiencyCorrectionTool )
   DECLARE_ALGTOOL( testAthenaElectronAlg )
 }
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
index 83892aa7fb80881dad84c0b4f8876744660f6899..2aac6b8a2f02b10180e193341a03e1f3e64af790 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/src/testAthenaElectronAlg.cxx
@@ -10,7 +10,7 @@
 #include "xAODEgamma/ElectronAuxContainer.h"
 #include "xAODCore/ShallowCopy.h"
 #include "PATInterfaces/SystematicsTool.h"
-#include "ElectronEfficiencyCorrection/IAsgElectronEfficiencyCorrectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
 
 testAthenaElectronAlg::testAthenaElectronAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
   AthAlgorithm( name, pSvcLocator ),  
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_mem_check.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_mem_check.cxx
index bc9604b0172af1a7e3d93cdc83a9f938ff49affe..6b80812b410fa51e89ef1c03f2c7f0073c1d6de8 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_mem_check.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/EgEfficiencyCorr_mem_check.cxx
@@ -14,24 +14,35 @@ http://valgrind.org/docs/manual/faq.html#faq.deflost
 #include <iostream>
 #include <vector>
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
+#include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
 #include "AsgTools/AsgMessaging.h"
+#include "AsgTools/AnaToolHandle.h"
 
 int main( ) {
 
+
+
   std::vector<std::string> inputFiles ={
     "ElectronEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v1/offline/efficiencySF.offline.LooseAndBLayerLLH_d0z0_v11.2015_2016.13TeV.rel20.7.25ns.v01.root"} ;
 
-  AsgElectronEfficiencyCorrectionTool myEgCorrections ("myEgCorrections");
-  myEgCorrections.msg().setLevel(MSG::INFO);
-  if (myEgCorrections.setProperty("CorrelationModel", "FULL" ) &&
-      myEgCorrections.setProperty("ForceDataType",1) &&
-      myEgCorrections.setProperty("CorrectionFileNameList",inputFiles) &&
-      myEgCorrections.initialize())
+  asg::AnaToolHandle<IAsgElectronEfficiencyCorrectionTool>  tool ("AsgElectronEfficiencyCorrectionTool/myEgCorrections");
+  if (tool.setProperty("CorrelationModel", "FULL" ) &&
+      tool.setProperty("ForceDataType",1) &&
+      tool.setProperty("CorrectionFileNameList",inputFiles) &&
+      tool.retrieve())
     {
       std::cout<<"ALL FINE" <<std::endl;
       
     }
 
+  asg::AnaToolHandle<CP::IEfficiencyScaleFactorTool> eccTool;
+  eccTool.setTypeAndName("CP::ElectronChargeEfficiencyCorrectionTool/myTool");
+  if(
+     eccTool.setProperty( "CorrectionFileName", "ElectronEfficiencyCorrection/2015_2016/rel20.7/Moriond_February2017_v1/charge_misID/ChargeCorrectionSF.Medium_FixedCutTight.root" )&&
+     eccTool.retrieve()){
+    std::cout<<"ALL FINE" <<std::endl;
+  }
   
   return 0;
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/Messaging.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/Messaging.h
index a706ffba917d0b2ee012d0c5eed4dd8ee7b77f79..90a91c47ce15094809072d958c1ba47d90c9554e 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/Messaging.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/Messaging.h
@@ -6,19 +6,24 @@
 #define __ELECTRONEFFICIENCYCORRECTIONMESSAGING__
 #include "AsgTools/AsgMessaging.h"
 
-static  asg::AsgMessaging dummymsg("");
+namespace MSGHELPERS{
+  const asg::AsgMessaging& getMsgStream();
+}
+const asg::AsgMessaging& MSGHELPERS::getMsgStream(){
+  static const asg::AsgMessaging dummymsg("");
+  return dummymsg;
+}
 
-#define DUMMY_MSG( lvl, ARG ) {dummymsg.msg(lvl)<<ARG<<"\n"<<endmsg ;}
+#define DUMMY_MSG(lvl, ARG ) {						\
+    const asg::AsgMessaging& dummymsg=MSGHELPERS::getMsgStream();	\
+    dummymsg.msg(lvl)<<ARG<<endmsg ;					\
+}
 #define MSG_DEBUG( ARG ) {DUMMY_MSG(MSG::DEBUG, ARG);}
 #define MSG_INFO( ARG ) {DUMMY_MSG(MSG::INFO, ARG);}
-#define MSG_WARNING( ARG ) {DUMMY_MSG(MSG::WARNING, ARG);}
-#define MSG_ERROR( ARG ) {DUMMY_MSG(MSG::ERROR, ARG);}
-#define MSG_FATAL( ARG ) {DUMMY_MSG(MSG::FATAL, ARG);}
-#define MSG_ABORT( ARG ) {DUMMY_MSG(MSG::FATAL, ARG); std::abort();} 
+#define MSG_WARNING( ARG ) { DUMMY_MSG(MSG::WARNING, ARG);}
+#define MSG_ERROR( ARG ) { DUMMY_MSG(MSG::ERROR, ARG);}
+#define MSG_FATAL( ARG ) { DUMMY_MSG(MSG::FATAL, ARG);}
+#define MSG_ABORT( ARG ) { DUMMY_MSG(MSG::FATAL, ARG); std::abort();} 
 
-namespace MSGHELPERS{
-  const asg::AsgMessaging& getMsgStream();
-}
-const asg::AsgMessaging& MSGHELPERS::getMsgStream(){return dummymsg;}
 
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/README b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/README
index 1a95ca3defe343d5db79acda0d23c54558036ea2..980d0bcd0524f18fbf80cdaeb3d7e8e64f478c57 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/README
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/README
@@ -1,5 +1,20 @@
-testEgEfficiencyCorrWithoutFile -f ElectronEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v1/offline/efficiencySF.offline.LooseAndBLayerLLH_d0z0_v11.2015_2016.13TeV.rel20.7.25ns.v01.root -t FullSim -r 266904 -e -0.31 -p 79001
+testEgEfficiencyCorrWithoutFile -f ElectronEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v3/offline/efficiencySF.offline.LooseAndBLayerLLH_v11.root -t FullSim -r 466904 -e -0.31 -p 79001
 
 RUN PERIODS
 266904-284484
 296939-9999999
+
+================================================
+
+Usage: testEgChargeCorr [xAOD file name] [Correction File name]
+
+================================================
+Cpu profiling :
+
+valgrind --tool=callgrind  testEgEfficiencyCorrWithoutFile -f ElectronEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v1/offline/efficiencySF.offline.LooseAndBLayerLLH_d0z0_v11.2015_2016.13TeV.rel20.7.25ns.v01.root -t FullSim -r 266904 -e -0.31 -p 79001 >callgrind.log 2>&1 &
+
+[Need a loop over many electrons , otherwise init will dominate]
+
+Memory Leak checks:
+
+valgrind --tool=memcheck --leak-check=full --suppressions=$ROOTSYS/etc/valgrind-root.supp  --error-limit=no --track-origins=yes --smc-check=all --trace-children=yes  --track-fds=yes --num-callers=30  $ROOTCOREBIN/bin/x86_64-slc6-gcc49-opt/EgEfficiencyCorr_mem_check>valgrind.log 2>&1 & 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/generateMapFile.C b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/generateMapFile.C
new file mode 100644
index 0000000000000000000000000000000000000000..b18cf0bd25a1533a4122a1e6679df079bd0554b4
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/generateMapFile.C
@@ -0,0 +1,344 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <sys/types.h>
+#include <dirent.h>
+#include <errno.h>
+#include <vector>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <iterator>
+#include <map>
+
+class Properties {
+
+public:
+    Properties() {};
+    bool Read (const std::string& strFile) {
+        std::ifstream is(strFile.c_str());
+        if (!is.is_open()) return false;
+
+        while (!is.eof()) {
+            std::string strLine;
+            getline(is,strLine);
+
+            int nPos = strLine.find('=');
+            if ((signed int)std::string::npos == nPos) continue; // no '=', invalid line;
+            std::string strKey = strLine.substr(0,nPos);
+            std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
+            m_map.insert(std::map<std::string,std::string>::value_type(strKey,strVal));
+        }
+        return true;
+    }
+
+    bool GetValue(const std::string& strKey, std::string& strValue) const {
+        std::map<std::string,std::string>::const_iterator i;
+        i = m_map.find(strKey);
+
+        if (i != m_map.end()) {
+            strValue = i->second;
+            return true;
+        }
+        return false;
+    }
+
+protected:
+    std::map<std::string,std::string> m_map;
+};
+
+class ScaleFactorMap {
+    
+public:
+    std::string mapFile;
+    std::string isolationloc;
+    std::string offlineloc;
+    std::string triggerloc;
+    std::string mapfileloc;
+    
+    /**
+     if isolation, trigger and offline are in the same location
+    */
+    ScaleFactorMap(const std::string& rootloc)
+    {
+        isolationloc = rootloc;
+        offlineloc = rootloc;
+        triggerloc = rootloc;
+        mapfileloc = "../data/";
+    }
+    
+    /**
+     if isolation, trigger and offline are in the different locations
+     and map gets created in current working directory
+    */
+    ScaleFactorMap(const std::string& isoloc, const std::string& offloc, const std::string& trigloc)
+    {
+        isolationloc = isoloc;
+        triggerloc = trigloc;
+        offlineloc = offloc;
+        mapfileloc = "./";
+    }
+    
+    /**
+     if isolation, trigger, offline and mapfile are in the different locations
+    */
+    ScaleFactorMap(const std::string& isoloc, const std::string& offloc, const std::string& trigloc, const std::string& maploc)
+    {
+        isolationloc = isoloc;
+        triggerloc = trigloc;
+        offlineloc = offloc;
+        mapfileloc = maploc;
+    }
+    
+    bool contain(const std::string& str, std::string strFind)
+    {
+        if (str.find(strFind) != std::string::npos) {
+            return true;
+        }
+        return false;
+    }
+    
+    std::string convertToKeyFromOfflineFilename(const std::string& fileName)
+    {
+        std::string key;
+        if (contain(fileName, "RecoTrk")) {
+            key = "Reconstruction";
+        }
+        if (contain(fileName, "LooseAndBLayerLLH_d0z0")) {
+            key = "LooseBLayer";
+        }
+        if (contain(fileName, "MediumLLH_d0z0")) {
+            key = "Medium";
+        }
+        if (contain(fileName, "TightLLH_d0z0")) {
+            key = "Tight";
+        }
+        if (contain(fileName, "LooseAndBLayerLLH") && !contain(fileName, "d0z0")) {
+            key = "LooseBLayer_Nod0z0";
+        }
+        if (contain(fileName, "MediumLLH") && !contain(fileName, "d0z0")) {
+            key = "Medium_Nod0z0";
+        }
+        if (contain(fileName, "TightLLH") && !contain(fileName, "d0z0")) {
+            key = "Tight_Nod0z0";
+        }
+        // These files having ID correlations only exist in ICHEP_v2 
+        // and ICHEP_v3 recommendations
+        if (contain(fileName, "_correlationID")){
+            key +="_corrID";
+        }
+        return key;
+    }
+    
+    std::string convertToKeyFromIsolationFilename(const std::string& fileName)
+    {
+        std::string key = convertToKeyFromOfflineFilename(fileName);
+        
+        //Isolation specific WPs
+        if (contain(fileName, "isolFixedCutLoose.")) {
+            key += "_FixedCutLoose";
+        }
+        if (contain(fileName, "isolFixedCutTight.")) {
+            key += "_FixedCutTight";
+        }
+        if (contain(fileName, "isolFixedCutTightTrackOnly.")) {
+            key += "_FixedCutTightTrackOnly";
+        }
+        if (contain(fileName, "isolGradient.") ) {
+            key += "_Gradient";
+        }
+        if (contain(fileName, "isolGradientLoose.")) {
+            key += "_GradientLoose";
+        }
+        if (contain(fileName, "isolLoose.") ) {
+            key += "_Loose";
+        }
+        // As one of the trigger SF file has name isolLooTrackOnly in ICHEP_v1 files
+        if (contain(fileName, "isolLooseTrackOnly.") || contain(fileName, "isolLooTrackOnly.")) {
+            key += "_LooseTrackOnly";
+        }
+        if (contain(fileName, "isolTight.")) {
+            key += "_Tight";
+        }
+        else {
+            key +="";
+        }
+        return key;
+    }
+    
+    std::string convertToKeyFromTriggerFilename(const std::string& fileName)
+    {
+        std::string key;
+        // Trigger files for th full trigger names DI_E case
+        if (contain(fileName, "DI_E_2015_e12_lhloose_L1EM10VH_2016_e15_lhvloose_nod0_L1EM13VH")) {
+            key = "DI_E_2015_e12_lhloose_L1EM10VH_2016_e15_lhvloose_nod0_L1EM13VH";
+        }
+        if (contain(fileName, "DI_E_2015_e12_lhloose_L1EM10VH_2016_e17_lhvloose_nod0")) {
+            key = "DI_E_2015_e12_lhloose_L1EM10VH_2016_e17_lhvloose_nod0";
+        }
+        if (contain(fileName, "DI_E_2015_e17_lhloose_2016_e17_lhloose")) {
+            key = "DI_E_2015_e17_lhloose_2016_e17_lhloose";
+        }
+
+        // Trigger files with full trigger names for MULTI_L case
+        if (contain(fileName, "MULTI_L_2015_e17_lhloose_2016_e17_lhloose_nod0")) {
+            key = "MULTI_L_2015_e17_lhloose_2016_e17_lhloose_nod0";
+        }
+        if (contain(fileName, "MULTI_L_2015_e7_lhmedium_2016_e7_lhmedium_nod0")) {
+            key = "MULTI_L_2015_e7_lhmedium_2016_e7_lhmedium_nod0";
+        }
+        if (contain(fileName, "MULTI_L_2015_e12_lhloose_2016_e12_lhloose_nod0")) {
+            key = "MULTI_L_2015_e12_lhloose_2016_e12_lhloose_nod0";
+        }
+        if (contain(fileName, "MULTI_L_2015_e24_lhmedium_L1EM20VHI_2016_e24_lhmedium_nod0_L1EM20VHI")) {
+            key = "MULTI_L_2015_e24_lhmedium_L1EM20VHI_2016_e24_lhmedium_nod0_L1EM20VHI";
+        }
+        if (contain(fileName, "MULTI_L_2015_e24_lhmedium_L1EM20VHI_2016_e26_lhmedium_nod0_L1EM22VHI")) {
+            key = "MULTI_L_2015_e24_lhmedium_L1EM20VHI_2016_e26_lhmedium_nod0_L1EM22VHI";
+        }
+        
+        // Trigger files for TRI_E case
+        if (contain(fileName, "TRI_E_2015_e17_lhloose_2016_e17_lhloose_nod0")){
+            key = "TRI_E_2015_e17_lhloose_2016_e17_lhloose_nod0";
+        }
+        if (contain(fileName, "TRI_E_2015_e17_lhloose_2016_e17_lhmedium_nod0")){
+            key = "TRI_E_2015_e17_lhloose_2016_e17_lhmedium_nod0";
+        }
+        if (contain(fileName, "TRI_E_2015_e9_lhloose_2016_e9_lhloose_nod0")){
+            key = "TRI_E_2015_e9_lhloose_2016_e9_lhloose_nod0";
+        }
+        if (contain(fileName, "TRI_E_2015_e9_lhloose_2016_e9_lhmedium_nod0")){
+            key = "TRI_E_2015_e9_lhloose_2016_e9_lhmedium_nod0";
+        }
+        
+        // Trigger files for SUNGLE_E case
+        if (contain(fileName, "SINGLE_E_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_e24_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0")) {
+            key = "SINGLE_E_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_e24_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0";
+        }
+        if (contain(fileName, "SINGLE_E_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0")) {
+            key = "SINGLE_E_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0";
+        }
+        
+        // Extra trigger files that contains only 2015 or 2016 trigger
+        // 2015 
+        if (!contain(fileName, "2016") && contain(fileName, "2015") && contain(fileName, "e17_lhloose_L1EM15")) {
+            key = "2015_e17_lhloose_L1EM15";
+        }
+        if (!contain(fileName, "2016") && contain(fileName, "2015") && contain(fileName, "e17_lhmedium")) {
+            key = "2015_e17_lhmedium";
+        }
+         
+        // 2016 
+        if (!contain(fileName, "2015") && contain(fileName, "2016") && contain(fileName, "e17_lhmedium_nod0")) {
+            key = "2016_e17_lhmedium_nod0";
+        }
+        if (!contain(fileName, "2015") && contain(fileName, "2016") && contain(fileName, "e17_lhmedium_nod0_L1EM15HI")) {
+            key = "2016_e17_lhmedium_nod0_L1EM15HI";
+        }
+        if (!contain(fileName, "2015") && contain(fileName, "2016") && contain(fileName, "e17_lhmedium_nod0_ivarloose_L1EM15HI")) {
+            key = "2016_e17_lhmedium_nod0_ivarloose_L1EM15HI";
+        }
+
+       if (contain(fileName, "efficiencySF.")){
+            key += ("_" + convertToKeyFromIsolationFilename(fileName));
+        } 
+        else {
+             key = ("Eff_"+ key +"_" + convertToKeyFromIsolationFilename(fileName));
+        }
+        return key;
+    }
+    
+    int getdir(std::string dir, std::vector<std::string>& files)
+    {
+        DIR* dp;
+        struct dirent* dirp;
+        if ((dp = opendir(dir.c_str())) == NULL) {
+            std::cout << "Error(" << errno << ") opening " << dir << std::endl;
+            return errno;
+        }
+        
+        while ((dirp = readdir(dp)) != NULL) {
+            std::string fileName = std::string(dirp->d_name);
+            if (contain(fileName, "root")) {
+                std::string key;
+                if (contain(dir, "offline")) {
+                    key = convertToKeyFromOfflineFilename(fileName);
+                }
+                if (contain(dir, "trigger")) {
+                    key = convertToKeyFromTriggerFilename(fileName);
+                }
+                if (contain(dir, "isolation")) {
+                    key = convertToKeyFromIsolationFilename(fileName);
+                }
+                std::string reallocation = dir + fileName;
+                std::string properties = key + "=" + reallocation;
+                files.push_back(properties);
+            }
+        }
+        closedir(dp);
+        return 0;
+    }
+    
+    void deleteExistingMapFile(std::string file)
+    {
+        remove(file.c_str());
+    }
+    
+    void writeToFile(std::vector<std::string>& map, std::string file)
+    {
+        //ofstream output_file(file);
+        //Different compiler demands
+        std::ofstream output_file(file.c_str());
+        std::ostream_iterator<std::string> output_iterator(output_file, "\n\n");
+        //std::ostream_iterator<std::string> output_iterator(output_file, "\n");
+        copy(map.begin(), map.end(), output_iterator);
+    }
+    
+    std::string getValueByKey(const std::string& key)
+    {
+        Properties props;
+        props.Read(mapFile);
+        
+        std::string strVal;
+        if (!props.GetValue(key, strVal)) {
+            std::cout << "Error(" << key << ") not found " << std::endl;
+        }
+        else {
+            return strVal;
+        }
+        return "";
+    }
+    
+    void generateMap()
+    {
+        const std::string isolationDir = std::string("isolation/");
+        const std::string offlineDir = std::string("offline/");
+        const std::string triggerDir = std::string("trigger/");
+        mapFile = std::string(mapfileloc + "map1.txt");
+        
+        std::vector<std::string> files = std::vector<std::string>();
+        
+        getdir(isolationloc + isolationDir, files);
+        getdir(offlineloc + offlineDir, files);
+        getdir(triggerloc + triggerDir, files);
+        
+        deleteExistingMapFile(mapFile);
+        writeToFile(files, mapFile);
+    }
+};
+
+//int generateMapFile(int argc, char* argv[])
+int main(int argc, char* argv[])
+{
+    ///1st way : WORKING
+    std::string str1 = std::string(argv[1]);
+    ScaleFactorMap scaleMap(str1);
+    scaleMap.generateMap();
+    std::cout << scaleMap.getValueByKey("Medium") <<std::endl;
+    ///2nd Way : WORKING
+    //string str2 = argv[2];
+    //string str3 = argv[3];
+    //ScaleFactorMap scaleMap (str1, str2, str3, str2);
+    //scaleMap.generateMap();
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgChargeCorr.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgChargeCorr.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3538c17660791fbde1eb8936a3e2a3a746e5e677
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgChargeCorr.cxx
@@ -0,0 +1,241 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// System include(s):
+#include <memory>
+#include <cstdlib>
+#include <string>
+
+// ROOT include(s):
+#include <TFile.h>
+#include <TError.h>
+#include <TString.h>
+
+// Infrastructure include(s):
+#ifdef ROOTCORE
+#   include "xAODRootAccess/Init.h"
+#   include "xAODRootAccess/TEvent.h"
+#   include "xAODRootAccess/TStore.h"
+#endif // ROOTCORE
+
+// EDM include(s):
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/Egamma.h"
+#include "ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h"
+#include "xAODCore/ShallowCopy.h"
+
+//Asg includes
+#include "AsgTools/AsgMessaging.h"
+#include "PATInterfaces/SystematicsUtil.h"
+
+#include <ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h>
+
+#define CHECK( ARG )                                  \
+do {                                                  \
+    const bool result = ARG;                          \
+  if( ! result ) {                                    \
+      ::Error( APP_NAME, "Failed to execute: \"%s\"", \
+#ARG );                                               \
+      return 1;                                       \
+  }                                                   \
+ } while( false )
+
+
+int main( int argc, char* argv[] ) {
+
+   // The application's name:
+   const char* APP_NAME = argv[ 0 ];
+
+   // Check if we received a file name:
+   if( argc < 3 ) {
+     Error( APP_NAME, "No file name received!" );
+     Error( APP_NAME, "  Usage: %s [xAOD file name] [Correction File name]", APP_NAME );
+      return 1;
+   }
+
+   double SF_chargeID=0;
+   //   double SF_chargeMisID=0;
+   int SF_nevents=0;
+
+   double n_chargeID=0;
+   double n_chargeMisID=0;
+
+   // Initialise the application:
+   CHECK( xAOD::Init( APP_NAME ) );
+
+   // Set message level
+  MSG::Level mylevel=MSG::DEBUG;
+  //this.msg().setLevel(mylevel);
+
+  // Open the input file:
+  const TString fileName = argv[ 1 ];
+  const TString corrFileName = argv[ 2 ];
+ 
+ Info( APP_NAME, "Opening file: %s", fileName.Data() );
+  std::auto_ptr< TFile > ifile( TFile::Open( fileName, "READ" ) );
+  CHECK( ifile.get() );
+
+  // Create a TEvent object:
+  //xAOD::TEvent event( xAOD::TEvent::kBranchAccess );
+  xAOD::TEvent event( xAOD::TEvent::kClassAccess );
+  CHECK( event.readFrom( ifile.get() ) );
+  Info( APP_NAME, "Number of events in the file: %i",
+       static_cast< int >( event.getEntries() ) );
+
+  std::cout << "=="<<std::endl;
+
+
+  // Decide how many events to run over:
+  Long64_t entries = event.getEntries();
+  if( argc > 2 ) {
+    const Long64_t e = atoll( argv[ 2 ] );
+    if( e < entries ) {
+      entries = e;
+    }
+  }
+
+  //Likelihood
+
+  CP::ElectronChargeEfficiencyCorrectionTool myEgCorrections ("myEgCorrections");
+  CHECK( myEgCorrections.setProperty("OutputLevel", mylevel) );
+
+  std::string inputFile = corrFileName.Data();//"data/ChMisIDSF_TightLL_FixedCutTight.root" ;
+  CHECK( myEgCorrections.setProperty("CorrectionFileName",inputFile) );
+  CHECK( myEgCorrections.setProperty("ForceDataType",1) );
+
+  CHECK( myEgCorrections.setProperty("DefaultRandomRunNumber", (unsigned int)311481 ) );
+  CHECK( myEgCorrections.setProperty("UseRandomRunNumber",false) );
+  myEgCorrections.initialize();
+
+  AsgElectronLikelihoodTool * m_LHToolTight = new AsgElectronLikelihoodTool("m_LHToolTight");
+  CHECK (m_LHToolTight->setProperty("primaryVertexContainer","PrimaryVertices") );
+  m_LHToolTight->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth.conf").ignore();
+  m_LHToolTight->initialize();
+
+
+  // Get a list of systematics
+  CP::SystematicSet recSysts = myEgCorrections.recommendedSystematics();
+  // Convert into a simple list
+ // std::vector<CP::SystematicSet> sysList = CP::make_systematics_vector(recSysts);
+  std::cout << "=="<<std::endl;
+
+  // Loop over the events:
+    entries = 600;
+
+  Long64_t entry = 0;
+  for( ; entry < entries; ++entry ) {
+
+    // Tell the object which entry to look at:
+    event.getEntry( entry );
+
+    if (entry<10)     std::cout << "=================NEXT EVENT==========================" << std::endl;
+    Info (APP_NAME,"Electron" );
+
+
+    const xAOD::EventInfo* event_info = 0;
+    CHECK( event.retrieve( event_info, "EventInfo" ) );
+
+    const xAOD::ElectronContainer* electrons = 0;
+    CHECK( event.retrieve(electrons, "Electrons") );
+
+    // Loop over systematics
+    //   for(const auto& sys : sysList){
+
+    //   if (entry<10)      Info(APP_NAME, "Processing syst: %s", sys.name().c_str());
+
+    // Configure the tool for this systematic
+    //        CHECK( myEgCorrections.applySystematicVariation(sys) );
+    //   Info(APP_NAME, "Applied syst: %s",
+    //       myEgCorrections.affectingSystematics().name().c_str());
+
+    // Create shallow copy for this systematic
+    std::pair< xAOD::ElectronContainer*, xAOD::ShallowAuxContainer* > electrons_shallowCopy =
+    xAOD::shallowCopyContainer( *electrons );
+
+    //Iterate over the shallow copy
+    xAOD::ElectronContainer* elsCorr = electrons_shallowCopy.first;
+    xAOD::ElectronContainer::iterator el_it      = elsCorr->begin();
+    xAOD::ElectronContainer::iterator el_it_last      = elsCorr->end();
+
+    //double SF_chargeID=0;
+    //double SF_chargeMisID=0;
+    //       int SF_nevents=0;
+
+    unsigned int i = 0;
+    double SF = 0;
+    for (; el_it != el_it_last; ++el_it, ++i) {
+
+      xAOD::Electron* el = *el_it;
+      if (el->pt() < 25000) continue;//skip electrons outside of recommendations
+
+bool LHacc = m_LHToolTight->accept(el);
+std::cout << "acc:  "<< LHacc << std::endl;
+      if(!m_LHToolTight->accept(el)) continue; 
+      if (fabs(el->caloCluster()->etaBE(2)) > 2.4) continue;//skip electrons outside of recommendations
+//      if(!m_LHToolTight->accept(el)) continue;
+
+      SF_nevents++;
+
+      // std::cout << "Electron " << i << std::endl;
+      std::cout << "xAOD/raw pt = " << el->pt() << ", eta: "
+                <<abs(el->eta()) <<" , "  << el->caloCluster()->etaBE(2) << std::endl;
+
+      Info (APP_NAME,"Electron #%d", i);
+
+      if(myEgCorrections.getEfficiencyScaleFactor(*el,SF) != CP::CorrectionCode::Ok){
+        Error( APP_NAME, "Problem in getEfficiencyScaleFactor");
+        return EXIT_FAILURE;
+      }
+
+      if(myEgCorrections.applyEfficiencyScaleFactor(*el) != CP::CorrectionCode::Ok){
+        Error( APP_NAME, "Problem in applyEfficiencyScaleFactor");
+        return EXIT_FAILURE;
+      }
+
+//      Info( APP_NAME, "===>>> Resulting SF (from get function) %f, (from apply function) %f",
+ //           SF, el->auxdata< float >("SF"));
+
+      SF_chargeID=SF_chargeID+SF;
+
+
+
+     for(const auto& sys : recSysts){  //recSysts){
+       double systematic = 0;
+
+    // Configure the tool for this systematic
+    CHECK( myEgCorrections.applySystematicVariation({sys}) );
+    //
+    if(myEgCorrections.getEfficiencyScaleFactor(*el,systematic) == CP::CorrectionCode::Ok){
+std::cout <<  (sys).name() <<"  sys names    " << (myEgCorrections.affectingSystematics().name()) << std::endl;    
+Info( APP_NAME,  "%f Result %f Systematic value %f ", SF,systematic,systematic-SF );
+   //                     unc.push_back(systematic);
+    //
+}
+}
+
+      int truthcharge = (-1)*el->auxdata<int>("firstEgMotherPdgId");
+      if (el->auxdata<int>("truthType")) { std::cout << el->charge() << "  " << el->auxdata<int>("firstEgMotherPdgId") << std::endl; }
+      if ( el->charge() * truthcharge < 0   )  {
+        Info( APP_NAME, "===>>> MISID %f ",SF);
+        n_chargeMisID++;
+      }
+      else n_chargeID++;
+    }
+
+    // }
+
+  }
+  Info( APP_NAME, "===>>>  done processing event #%lld ",entry);
+  Info( APP_NAME, "===>>>  processed #%d electrons",SF_nevents);
+  Info( APP_NAME, "===>>>  compared to #%f (from Charge MisId SF)",SF_chargeID);
+  Info( APP_NAME, "===>>>  compared to #%f and #%f ",n_chargeID,n_chargeMisID);
+
+
+
+  CHECK( myEgCorrections.finalize() );
+
+  // Return gracefully:
+  return 0;
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorr.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorr.cxx
index 8b4c28402854711ce5fa798c7e3f6a54825ef964..16fc1ce16c04fddbd70cd3226f13eab02d711d3e 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorr.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorr.cxx
@@ -5,6 +5,7 @@
 // System include(s):
 #include <memory>
 #include <cstdlib>
+#include "Messaging.h"
 
 // ROOT include(s):
 #include <TFile.h>
@@ -24,6 +25,7 @@
 #include "xAODEgamma/Egamma.h"
 #include "ElectronEfficiencyCorrection/AsgElectronEfficiencyCorrectionTool.h"
 #include "xAODCore/ShallowCopy.h"
+#include "AsgTools/AsgMessaging.h"
 
 
 #include <string>
@@ -46,6 +48,11 @@ int main( int argc, char* argv[] ) {
    // The application's name:
    const char* APP_NAME = argv[ 0 ];
 
+  MSG::Level mylevel=MSG::DEBUG;
+
+  MSGHELPERS::getMsgStream().msg().setLevel(mylevel);
+  MSGHELPERS::getMsgStream().msg().setName(APP_NAME);
+
    // Check if we received a file name:
    if( argc < 2 ) {
      Error( APP_NAME, "No file name received!" );
@@ -83,10 +90,15 @@ int main( int argc, char* argv[] ) {
 
    //Likelihood
    AsgElectronEfficiencyCorrectionTool myEgCorrections ("myEgCorrections");
-   std::vector<std::string> inputFiles{"ElectronEfficiencyCorrection/efficiencySF.offline.Loose.2012.8TeV.rel17p2.v07.root"} ;
+   //std::vector<std::string> inputFiles{"ElectronEfficiencyCorrection/efficiencySF.offline.Loose.2012.8TeV.rel17p2.v07.root"} ;
+   std::vector<std::string> inputFiles{"efficiencySF.offline.MediumLLH_d0z0_v11.root"} ;
    CHECK( myEgCorrections.setProperty("CorrectionFileNameList",inputFiles) );
-   CHECK( myEgCorrections.setProperty("ForceDataType",1) );
-   CHECK( myEgCorrections.setProperty("CorrelationModel", "MCTOYS100" ));
+    myEgCorrections.msg().setLevel(mylevel);
+
+   CHECK( myEgCorrections.setProperty("ForceDataType",3) );
+   CHECK( myEgCorrections.setProperty("CorrelationModel", "SIMPLIFIED" ));
+   CHECK( myEgCorrections.setProperty("UseRandomRunNumber", false ));
+   CHECK( myEgCorrections.setProperty("DefaultRandomRunNumber", 299999));
 
    CHECK( myEgCorrections.initialize() );
 
@@ -96,21 +108,23 @@ int main( int argc, char* argv[] ) {
    std::vector<CP::SystematicSet> sysList = CP::make_systematics_vector(recSysts);
   std::cout << "=="<<std::endl;
    // Loop over the events:
-   entries = 1;
-   for( Long64_t entry = 0; entry < entries; ++entry ) {
+   Long64_t entry = 10;
+   entries = entry+1;
+   for(  ; entry < entries; ++entry ) {
      
      // Tell the object which entry to look at:
      event.getEntry( entry );
      
      std::cout << "=================NEXT EVENT==========================" << std::endl;
-     Info (APP_NAME,"Electron 6" );
+   //  Info (APP_NAME,"Electron 6" );
 
  
      const xAOD::EventInfo* event_info = 0;  
      CHECK( event.retrieve( event_info, "EventInfo" ) ); 
       
      const xAOD::ElectronContainer* electrons = 0;  
-     CHECK( event.retrieve(electrons, "ElectronCollection") );
+     //CHECK( event.retrieve(electrons, "ElectronCollection") ); //For DAOD
+     CHECK( event.retrieve(electrons, "Electrons") );
 
      // Loop over systematics
      for(const auto& sys : sysList){
@@ -144,6 +158,10 @@ int main( int argc, char* argv[] ) {
 
          Info (APP_NAME,"Electron #%d", i); 
 
+int sysreg = myEgCorrections.systUncorrVariationIndex(*el);
+         Info (APP_NAME,"sysregion %d ", sysreg);
+
+
          if(myEgCorrections.getEfficiencyScaleFactor(*el,SF) != CP::CorrectionCode::Ok){
            Error( APP_NAME, "Problem in getEfficiencyScaleFactor");
            return EXIT_FAILURE;
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
index 2f956542388c60916adf7d54d32f0a2f293d2e40..2951eed6136c96995092d419dbf3ae6878f3f609 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
@@ -51,14 +51,88 @@
     }								\
   } while( false )
 
-#define printUsage(ARG) MSG_ERROR( "Usage:  [--file/-f /path/to/input/file] [--runno/-r run number] [--eta/e eta] [--pt/-p pt in Mev]" \
+#define printUsage(ARG) MSG_ERROR( "Usage:  [--file/-f /path/to/input/file] [--mapfile/-m /path/to/input/mapfile] [--runno/-r run number] [--eta/e eta] [--pt/-p pt in Mev]" \
+				   << "[--keyreco/-k RecoKey] [--keyid/-d IDKey] [--keyiso/-i IsoKey] [--keytrigger/-t TriggerKey]" \
 				   << "[--type/-t FullSim/AtlFast2] [--useDefaults/-d] [--compact/-c]" << ARG ); 
 
 
 xAOD::CaloCluster* create_cluster(float eta, float phi,float e);
 
-int main( int argc, char* argv[] ) {
+void dumbProperties(const AsgElectronEfficiencyCorrectionTool& tool){
+  ///Get the properties
+  MSG_INFO("=============" );  
+  MSG_INFO( "Properties" );  
+  auto propertyMap = tool.getPropertyMgr()->getProperties();
+  for (auto  i : propertyMap){
+    MSG_INFO("=============" );  
+    MSG_INFO("Name : " <<i.first  <<  " Type : " <<i.second->typeName() );  
+    int type= i.second->type();
+    switch(type){    
+    case Property::Type::BOOL :{
+      bool value = *(tool.getProperty<bool>(i.first));
+      MSG_INFO("Value : " <<value );        
+      break;      
+    }
+    case Property::Type::INT:{
+      int value = *(tool.getProperty<int>(i.first));
+      MSG_INFO("Value : " <<value );        
+      break;
+    }
+    case Property::Type::FLOAT :{
+      float value = *(tool.getProperty<float>(i.first));
+      MSG_INFO("Value : " <<value );        
+      break;
+    }
+    case Property::Type::DOUBLE :{
+      double value = *(tool.getProperty<double>(i.first));
+      MSG_INFO("Value : " <<value );        
+      break;
+    }
+    case Property::Type::STRING :{
+      std::string value = *(tool.getProperty<std::string>(i.first));
+      MSG_INFO("Value : " <<value );        
+      break;
+    }
+    case Property::Type::STRINGVECTOR :{
+      std::vector<std::string> value= *(tool.getProperty< std::vector<std::string> > (i.first));
+      MSG_INFO("Values : ");        
+      for (auto  j : value){
+	MSG_INFO(j);        
+      }
+      break;
+    }
+    case Property::Type::FLOATVECTOR :{
+      std::vector<float> value = *(tool.getProperty< std::vector<float> > (i.first));
+      MSG_INFO("Values : ");        
+      for (auto  j : value){
+	MSG_INFO(j);        
+      }
+      break;
+    }
+    case Property::Type::INTVECTOR :{
+      std::vector<int> value = *(tool.getProperty< std::vector<int> > (i.first));
+      MSG_INFO("Values : ");        
+      for (auto  j : value){
+	MSG_INFO(j);        
+      }
+      break;
+    }
+    default :
+      if(i.first == "DefaultRandomRunNumber" ){
+	MSG_INFO("Value : " << *(tool.getProperty<unsigned int>(i.first)));
+      }
+      if(i.first == "OutputLevel" ){
+	MSG_INFO("Value : " << static_cast<int> (tool.msg().level()));
+      }
+      break;
+    }
+  }
+}
+
+
 
+int main( int argc, char* argv[] ) {
+  xAOD::TReturnCode::enableFailure();
 
   //=========================================================
   //Parse input
@@ -66,15 +140,19 @@ int main( int argc, char* argv[] ) {
   const char* APP_NAME = argv[ 0 ];
   //Set the message level
   MSG::Level mylevel=MSG::INFO;
-  MSG::Level mylevelToy=MSG::INFO;//MSG::FATAL;
 
   MSGHELPERS::getMsgStream().msg().setLevel(mylevel); 
   MSGHELPERS::getMsgStream().msg().setName(APP_NAME); 
-//  MSGHELPERS::getMsgStream().msg().setName(TElectronEffi);
+  //  MSGHELPERS::getMsgStream().msg().setName(TElectronEffi);
 
   bool useCompactDisplay = true;
   
   std::string fileName="";
+  std::string mapfileName="";
+  std::string idkey="";
+  std::string recokey="";
+  std::string isokey="";
+  std::string triggerkey="";
   int runno=-1;
   float eta=-999;
   float pt = -1;
@@ -87,18 +165,56 @@ int main( int argc, char* argv[] ) {
   p.addOption("pt","p");
   p.addOption("type","t");
   p.addOption("compact","c",false);
-  p.Init(argc,argv);
+  p.addOption("mapfile","m");
+  p.addOption("keyreco","k");
+  p.addOption("keyid","d");
+  p.addOption("keyiso","i");
+  p.addOption("keytrigger","t");
 
-  TString tmp = p.getArg("f");
 
+  p.Init(argc,argv);
+
+  /// first check for mapfile
+  TString tmp = p.getArg("m");
   if (tmp != "")
-    fileName = tmp;
-  else
-    {
-      MSG_INFO("No file name given");
+    mapfileName = tmp;
+  else { 
+    tmp = p.getArg("f");
+    if (tmp != "")
+      fileName = tmp;
+    else {
+      MSG_INFO("Neither map file name nor file name given");
       printUsage(argv[0]);
       return 0;
     }
+  }
+
+  if (fileName!="" && fileName.find(".root") == std::string::npos ){
+    MSG_INFO("filename not a root file? "<< fileName );
+    return 0;
+  }
+
+  if (mapfileName!="" && mapfileName.find(".txt")  == std::string::npos){
+    MSG_INFO("mapfilename not a txt file? "<< mapfileName  );
+    return 0;
+  }
+
+  tmp = p.getArg("t");
+  if (tmp != "")
+    triggerkey = tmp;
+
+  tmp = p.getArg("i");
+  if (tmp != "")
+    isokey = tmp;
+
+  tmp = p.getArg("k");
+  if (tmp != "")
+    recokey = tmp;
+
+  tmp = p.getArg("d");
+  if (tmp != "")
+    idkey = tmp;
+
   tmp = p.getArg("r");
   if (tmp != "")
     runno = atoi(tmp.Data());
@@ -151,8 +267,7 @@ int main( int argc, char* argv[] ) {
   CHECK( xAOD::Init( APP_NAME ) );
   
   //==========================================================
-  //create dummy event
- 
+  // CREATE DUMMY INPUT
   // Create a TEvent object:
   //    //xAOD::TEvent event( xAOD::TEvent::kBranchAccess );
   xAOD::TEvent event( xAOD::TEvent::kClassAccess );
@@ -163,18 +278,9 @@ int main( int argc, char* argv[] ) {
 
   static SG::AuxElement::Decorator<unsigned int> randomrunnumber("RandomRunNumber") ;
   randomrunnumber(*ei)= runno;
-
   xAOD::TStore store;
-  store.record(ei, "EventInfo");
+  CHECK(store.record(ei, "EventInfo"));
 
-  if (!useCompactDisplay){
-    MSG_INFO("Creating new EECTool");
-  }
-
-  if (!useCompactDisplay){
-    MSG_INFO("Adding File: "<<fileName);
-  }
-  std::vector<std::string> inputFiles{fileName} ;
 
   //"Creating calo cluster container");
   xAOD::CaloClusterContainer *m_clusters = new xAOD::CaloClusterContainer();
@@ -199,8 +305,8 @@ int main( int argc, char* argv[] ) {
  
   xAOD::CaloCluster* cluster = create_cluster(eta, 0.0, e);
   m_clusters->push_back(cluster);
-  store.record( m_clusters, "MyClusters" );
-  store.record( m_clAux, "MyClustersAux." );
+  CHECK(store.record( m_clusters, "MyClusters" ));
+  CHECK(store.record( m_clAux, "MyClustersAux."));
 
   
   links_clusters.push_back(ElementLink< xAOD::CaloClusterContainer >( cluster, *m_clusters ));
@@ -210,35 +316,48 @@ int main( int argc, char* argv[] ) {
   track->setDefiningParameters(0., 0., 0.0, 2 * atan(exp(-eta)), 1.);
   m_tracks->push_back(track);
   std::vector< ElementLink< xAOD::TrackParticleContainer > > links_tracks;
-  store.record( m_tracks, "MyTrackParticles" );
-  store.record( m_tracksAux, "MyTrackParticlesAux." );
+  CHECK(store.record( m_tracks, "MyTrackParticles" ));
+  CHECK(store.record( m_tracksAux, "MyTrackParticlesAux." ));
 
   el->setTrackParticleLinks(links_tracks);
   el->setEta(eta);
   el->setPhi(0.0);
   el->setM(0);
   el->setPt(e / cosh(eta));
-  store.record( m_electrons, "MyElectrons" );
-  store.record( m_electronsAux, "MyElectronsAux." );
- //==========================================================
- 
+  CHECK(store.record( m_electrons, "MyElectrons" ));
+  CHECK(store.record( m_electronsAux, "MyElectronsAux." ));
+  //==========================================================
 
+  //Test some models 
+  if (!useCompactDisplay){
+    MSG_INFO("Adding File: "<<fileName);
+  }
+  std::vector<std::string> inputFiles{fileName} ;
+  MSG_INFO( "SimType  " << SimType );  
+  MSG_INFO("el pt " <<el->pt());
+  
   //==================================================================================
   //Test the SIMPLIFIED
-  AsgElectronEfficiencyCorrectionTool myEgCorrections ("myEgCorrections"); 
-  myEgCorrections.msg().setLevel(mylevel);
-  CHECK( myEgCorrections.setProperty("CorrectionFileNameList",inputFiles) );
+  AsgElectronEfficiencyCorrectionTool myEgCorrections ("myEgCorrections");  
+  MSG_INFO("using  :" << fileName);
+  if (fileName!="")  
+    CHECK( myEgCorrections.setProperty("CorrectionFileNameList",inputFiles) );
+
+  MSG_INFO("using mapfile :" << recokey);
+
+  if (mapfileName!="") CHECK( myEgCorrections.setProperty("MapFilePath", mapfileName));
+
+  // set the keys of interest for correction files
+  if ( recokey!="")  CHECK( myEgCorrections.setProperty("RecoKey", recokey));
+  MSG_INFO("using mapfile :" << recokey);
+  if ( idkey!="")   CHECK( myEgCorrections.setProperty("IdKey", idkey));
+  if ( isokey!="")   CHECK( myEgCorrections.setProperty("IsoKey", isokey));
+  if ( triggerkey!="")   CHECK( myEgCorrections.setProperty("TriggerKey", triggerkey));
   CHECK( myEgCorrections.setProperty("ForceDataType",(int)SimType) );
-  CHECK( myEgCorrections.setProperty("CorrelationModel", "SIMPLIFIED" ));
-  
-  if (!useCompactDisplay){
-    MSG_INFO("Initializing EECTools");
-  }
+  CHECK( myEgCorrections.setProperty("CorrelationModel", "TOTAL" ));
+  myEgCorrections.msg().setLevel(mylevel);
   CHECK( myEgCorrections.initialize() );  
-  if(!useCompactDisplay) {
-    MSG_INFO(el->pt());
-  }
-
+  dumbProperties(myEgCorrections);
   double SF = 0; 
   std::vector<double> unc;
   // Get a list of systematics
@@ -257,7 +376,7 @@ int main( int argc, char* argv[] ) {
     
     // Configure the tool for this systematic
     CHECK( myEgCorrections.applySystematicVariation({sys}) );
-    
+ 
     if(myEgCorrections.getEfficiencyScaleFactor(*el,systematic) == CP::CorrectionCode::Ok){
       MSG_INFO( myEgCorrections.appliedSystematics().name().c_str()<< " Result " << systematic<< " Systematic value  "<<systematic-SF );  
       unc.push_back(systematic);
@@ -278,42 +397,30 @@ int main( int argc, char* argv[] ) {
 
   MSG_INFO( "total up " << total_up  <<" total down " << total_down );
 
-  //HERE THE WEIRD USAGES
-  double systematic = 0; 
-  //Thsese should fail
-  //const std::vector<std::string>invalid1={"EL_EFF_ID_CorrUncertaintyNP8__1up","EL_EFF_ID_CorrUncertaintyNP8__1down"};
-  //CHECK( myEgCorrections.applySystematicVariation(invalid1));
-  //std::cout << myEgCorrections.appliedSystematics().name().c_str()<< " Result " << systematic<< " Systematic value  "<<SF-systematic << std::endl;  
-
-  //const std::vector<std::string>invalid2={"EL_EFF_ID_CorrUncertaintyNP8__1up","EL_EFF_ID_CorrUncertaintyNP9__1down"};
-  //CHECK( myEgCorrections.applySystematicVariation(invalid2));
-  //if(myEgCorrections.getEfficiencyScaleFactor(*el,systematic) != CP::CorrectionCode::Ok){
-  // MSG_ERROR( APP_NAME << "Problem in getEfficiencyScaleFactor");
-  //}
-  //std::cout << myEgCorrections.appliedSystematics().name().c_str()<< " Result " << systematic<< " Systematic value  "<<SF-systematic << std::endl;  
-
-  //This is OK , but the debug in ASG will tell you is not supported , but not a wrong syst either just not applicable
-  const std::vector<std::string>invalid3={"EL_EFF_Reco_CorrUncertaintyNP8__1up"};
-  CHECK( myEgCorrections.applySystematicVariation(invalid3));
-  if(myEgCorrections.getEfficiencyScaleFactor(*el,systematic) != CP::CorrectionCode::Ok){
-    MSG_ERROR( APP_NAME << "Problem in getEfficiencyScaleFactor");
-  }
-  MSG_INFO( "HERE"<< myEgCorrections.appliedSystematics().name().c_str()<< " Result " << systematic<< " Systematic value  "<<SF-systematic );  
-
+  /*
   //==================================================================================
   //Test the TOYS
   //TOYS
+  MSG::Level mylevelToy=MSG::INFO;//MSG::FATAL;
   AsgElectronEfficiencyCorrectionTool myEgCorrectionsToys ("myEgCorrectionsToys");
-  CHECK( myEgCorrectionsToys.setProperty("CorrectionFileNameList",inputFiles) );
+  if (fileName!="")   CHECK( myEgCorrectionsToys.setProperty("CorrectionFileNameList",inputFiles) );
+  if (mapfileName!="") CHECK( myEgCorrectionsToys.setProperty("MapFilePath", mapfileName));
+
+  // set the keys of interest for correction files
+  if ( recokey!="")  CHECK( myEgCorrectionsToys.setProperty("RecoKey", recokey));
+  MSG_INFO("using mapfile :" << recokey);
+  if ( idkey!="")   CHECK( myEgCorrectionsToys.setProperty("IdKey", idkey));
+  if ( isokey!="")   CHECK( myEgCorrectionsToys.setProperty("IsoKey", isokey));
+  if ( triggerkey!="")   CHECK( myEgCorrectionsToys.setProperty("TriggerKey", triggerkey));
+
   CHECK( myEgCorrectionsToys.setProperty("ForceDataType",(int)SimType) );
-   CHECK( myEgCorrectionsToys.setProperty("CorrelationModel", "MCTOYS" ));
+  CHECK( myEgCorrectionsToys.setProperty("CorrelationModel", "MCTOYS" ));
   myEgCorrectionsToys.msg().setLevel(mylevelToy);
   CHECK( myEgCorrectionsToys.initialize() );
-
-
+  dumbProperties(myEgCorrectionsToys);
   double SFToys = 0; 
-  if(myEgCorrectionsToys.getEfficiencyScaleFactor(*el,SFToys) != CP::CorrectionCode::Ok){
-  // MSG_ERROR( APP_NAME << "Problem in getEfficiencyScaleFactorToys");
+  if(myEgCorrectionsToys.getEfficiencyScaleFactor(*el,SFToys) == CP::CorrectionCode::Ok){
+  MSG_INFO("SF  Toys central "<< SF );
   }
   std::vector<double> uncToys;
   CP::SystematicSet recSystsToys = myEgCorrectionsToys.recommendedSystematics();
@@ -324,75 +431,17 @@ int main( int argc, char* argv[] ) {
   sysListToys.calc(recSystsToys);
   std::vector<CP::SystematicSet> sysListToys2=sysListToys.result("toys");
 
-  // Loop over systematics
- 
   /// DO TOY LOOP
   for(const auto& sysToys : sysListToys2){
-    double systematicToys = 0; 
-    
-    if(!useCompactDisplay)  {
-      // MSG_WARNING(APP_NAME<<" " << " Processing syst: " << sysToys.name().c_str());
-    }
-
-    // Configure the tool for this systematic
-    CHECK( myEgCorrectionsToys.applySystematicVariation(sysToys) );
-
-    if(!useCompactDisplay)     {   
-      // MSG_WARNING(APP_NAME<<" " << "Applied syst:  "<< toyIndex << "  "<< toy_scale);   
-  //       MSG_WARNING(APP_NAME<<" " << "Applied syst:  " <<myEgCorrectionsToys.appliedSystematics().name().c_str());
-    }
-    
-    if(myEgCorrectionsToys.getEfficiencyScaleFactor(*el,systematicToys) != CP::CorrectionCode::Ok){
-      //    MSG_ERROR( APP_NAME << "Problem in getEfficiencyScaleFactor");
-    }
-    
-    if(!useCompactDisplay) {
-      //    MSG_INFO(APP_NAME<<"itoys values " << systematicToys);
-    }
-    uncToys.push_back(systematicToys);
+  double systematicToys = 0; 
+  CHECK( myEgCorrectionsToys.applySystematicVariation(sysToys) );    
+  if(myEgCorrectionsToys.getEfficiencyScaleFactor(*el,systematicToys) == CP::CorrectionCode::Ok){
+  MSG_INFO("SFToys value "<< systematicToys );
   }
-
-  //==================================================================================
-
-  
-//std::cout << "allresults " << SF << "  "; 
-//for (int iu=0;iu<unc.size();iu++){
-
-//std::cout << (SF-unc.at(iu)) << "  ";
-//std::cout << unc.at(iu) << "  ";
-
-//	 }
-//std::cout << std::endl;
-  /*if (unc.size()==5) {
-    std::cout <<" "  <<  SF 
-	      <<" $\\pm$  " << unc.at(0) 
-	      <<" $\\pm$  " << unc.at(1) <<" $\\pm$  " <<  unc.at(2) 
-	      <<" $\\pm$  " <<  unc.at(3) <<" $\\pm$  " <<  unc.at(4) <<std::endl;
+  uncToys.push_back(systematicToys);
   }
 
-  if (unc.size()==3 ) {
-    std::cout <<" "  <<  unc.at(0)
-	      << " $\\pm$  " << unc.at(0)-unc.at(1)  
-	      <<" $\\pm$  " << unc.at(2)-unc.at(0) << std::endl;
-  }*/
-  //  if (useCompactDisplay)
-  //      std::cout<<sf2.getScaleFactor()<< " $\\pm$ "<<sf2.getTotalUncertainty()<<" / $\\Delta$="<<sf2.getTotalUncertainty()-sqrt(val)<<std::endl;
-  //
-  //// calculate total uncertainty from uncorr and corr
-  // double val = uncorr*uncorr;
-
-  // for (Int_t i=test2->getFirstCorrSysPosition(); i<=(test2->getLastCorrSysPosition()); i++)
-  // {
-  //   if (!useCompactDisplay)
-  //     std::cout<<"corr "<<i<<": "<<sf2.getResult(i)<<std::endl;
-  //   val+= sf2.getResult(i)*sf2.getResult(i);
-  // }
-  // for (Int_t i=test2->getFirstToyMCPosition(); i<=(test2->getLastToyMCPosition()); i++)
-  // {
-  //   if (!useCompactDisplay)
-  //     std::cout<<"toy "<<i<<": "<<sf2.getResult(i)<<std::endl;
-  // }
- // Return gracefully:
+  */
   return 0;
 }
 
@@ -405,7 +454,7 @@ xAOD::CaloCluster* create_cluster(float eta, float phi, float e){
   const std::set<CaloSampling::CaloSample> samplings {
     CaloSampling::PreSamplerB, CaloSampling::EMB1, CaloSampling::EMB2, CaloSampling::EMB3,
       CaloSampling::PreSamplerE, CaloSampling::EME1, CaloSampling::EME2, CaloSampling::EME3 };
-
+  
   unsigned sampling_pattern = 0;
   for (auto sample : samplings) { sampling_pattern |= 0x1U << sample; }
   cluster->setSamplingPattern(sampling_pattern);
@@ -438,3 +487,4 @@ xAOD::CaloCluster* create_cluster(float eta, float phi, float e){
   cluster->insertMoment(xAOD::CaloCluster::PHICALOFRAME, phi);
   return cluster;
 }
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/CMakeLists.txt
index 0a6be1ddc1393bc9ce6c90040acae26f06f43536..53d84399aecf667817d3158c5c1321ae24272e3d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/CMakeLists.txt
@@ -5,53 +5,100 @@
 # Declare the package name:
 atlas_subdir( ElectronPhotonFourMomentumCorrection )
 
+# Environment specific extra dependencies:
+set( extra_dep )
+if( XAOD_STANDALONE )
+   set( extra_dep Control/xAODRootAccess )
+else()
+   set( extra_dep Control/AthenaBaseComps
+      Control/AthAnalysisBaseComps
+      GaudiKernel )
+endif()
+
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthToolSupport/AsgTools
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODEgamma
-                          Event/xAOD/xAODEventInfo
-                          PhysicsAnalysis/AnalysisCommon/PATCore
-                          PhysicsAnalysis/AnalysisCommon/PATInterfaces
-                          PRIVATE
-                          Control/AthenaBaseComps
-			  Control/AthAnalysisBaseComps
-                          Event/xAOD/xAODBase
-                          Event/xAOD/xAODCore
-                          Event/xAOD/xAODTracking
-			  Event/xAOD/xAODMetaData
-                          GaudiKernel
-                          Reconstruction/egamma/egammaLayerRecalibTool
-                          Reconstruction/egamma/egammaMVACalib
-                          TestPolicy
-                          Tools/PathResolver )
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODCaloEvent
+   Event/xAOD/xAODEgamma
+   Event/xAOD/xAODEventInfo
+   PhysicsAnalysis/AnalysisCommon/PATCore
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces
+   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces	
+   PRIVATE
+   Event/xAOD/xAODBase
+   Event/xAOD/xAODCore
+   Event/xAOD/xAODTracking
+   Event/xAOD/xAODMetaData
+   Reconstruction/egamma/egammaLayerRecalibTool
+   Reconstruction/egamma/egammaMVACalib
+   Event/xAOD/xAODTruth
+   Tools/PathResolver
+   ${extra_dep} )
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( Boost )
 
 # Component(s) in the package:
 atlas_add_library( ElectronPhotonFourMomentumCorrectionLib
-                   src/*.cxx
-                   Root/*.cxx
-                   PUBLIC_HEADERS ElectronPhotonFourMomentumCorrection
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AsgTools xAODCaloEvent xAODEgamma xAODEventInfo PATInterfaces PATCoreLib egammaMVACalibLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps xAODBase xAODCore xAODTracking xAODMetaData GaudiKernel egammaLayerRecalibTool PathResolver)
-
-atlas_add_component( ElectronPhotonFourMomentumCorrection
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODEventInfo PATCoreLib PATInterfaces AthenaBaseComps xAODBase xAODCore xAODTracking GaudiKernel egammaLayerRecalibTool egammaMVACalibLib PathResolver ElectronPhotonFourMomentumCorrectionLib )
+   ElectronPhotonFourMomentumCorrection/*.h Root/*.cxx
+   PUBLIC_HEADERS ElectronPhotonFourMomentumCorrection
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma
+   xAODEventInfo PATInterfaces EgammaAnalysisInterfacesLib PATCoreLib egammaMVACalibLib xAODTruth
+   PRIVATE_LINK_LIBRARIES xAODTracking xAODMetaData egammaLayerRecalibTool
+   PathResolver )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( ElectronPhotonFourMomentumCorrection
+      src/*.h src/*.cxx src/components/*.cxx
+      LINK_LIBRARIES AsgTools xAODCaloEvent xAODEgamma xAODEventInfo
+      PATInterfaces AthenaBaseComps xAODBase xAODCore GaudiKernel
+      ElectronPhotonFourMomentumCorrectionLib )
+endif()
 
 atlas_add_dictionary( ElectronPhotonFourMomentumCorrectionDict
-                      ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h
-                      ElectronPhotonFourMomentumCorrection/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma xAODEventInfo PATCoreLib PATInterfaces AthenaBaseComps xAODBase xAODCore xAODTracking GaudiKernel AthAnalysisBaseCompsLib egammaLayerRecalibTool egammaMVACalibLib PathResolver ElectronPhotonFourMomentumCorrectionLib )
+   ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h
+   ElectronPhotonFourMomentumCorrection/selection.xml
+   LINK_LIBRARIES ElectronPhotonFourMomentumCorrectionLib )
+
+atlas_add_executable( ElectronPhotonFourMomentumCorrection_test_memory
+   util/ElectronPhotonFourMomentumCorrection_test_memory.cxx
+   LINK_LIBRARIES ElectronPhotonFourMomentumCorrectionLib )
+
+atlas_add_executable( ElectronPhotonFourMomemtumCorrection_testMomentumSystematics
+   util/testMomentumSystematics.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ElectronPhotonFourMomentumCorrectionLib )
+
+atlas_add_executable( ElectronPhotonFourMomemtumCorrection_testResolutionParam
+   util/testResolutionParam.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ElectronPhotonFourMomentumCorrectionLib )
+
+atlas_add_executable( ElectronPhotonFourMomentumCorrection_testUniformityCorrections
+   util/testUniformityCorrections.cxx
+   LINK_LIBRARIES ElectronPhotonFourMomentumCorrectionLib )
+
+if( XAOD_STANDALONE )
+   atlas_add_executable( ElectronPhotonFourMomentumCorrection_testEgammaCalibTool
+      util/testEgammaCalibTool.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCaloEvent xAODCore PATInterfaces
+      ElectronPhotonFourMomentumCorrectionLib )
+endif()
+
+# Test(s) in the package:
+if( XAOD_STANDALONE )
+   atlas_add_test( ut_test SCRIPT test/ut_test.py )
+   atlas_add_test( ut_test_factory SCRIPT test/ut_test_factory.py )
+   atlas_add_test( ut_test_resolution SCRIPT test/ut_test_resolution.py )
+endif()
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
 atlas_install_xmls( data/*.root )
 atlas_install_data( data/*.root )
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h
index 8c62a2d002d7f91a6d374b78d8e74d095339eb48..b7a149e12141ad469769534c33209128a2bbba46 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h
@@ -13,10 +13,10 @@
 #include <array>
 #include <memory>
 
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
 #include "AsgTools/AsgTool.h"
 #include "AsgTools/AsgMetadataTool.h"
 #include "AsgTools/AsgMessaging.h"
-#include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
 #include "PATInterfaces/ISystematicsTool.h"
 #include "PATInterfaces/SystematicSet.h"
 #include "xAODEgamma/Electron.h"
@@ -24,6 +24,7 @@
 #include "xAODEgamma/Egamma.h"
 #include "xAODCaloEvent/CaloCluster.h"
 #include "xAODEventInfo/EventInfo.h"
+#include "AsgTools/AnaToolHandle.h"
 
 #include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h"
 
@@ -33,10 +34,13 @@ class egammaLayerRecalibTool;
 namespace egGain { class GainTool; }
 
 namespace xAOD {
-	inline float get_phi_calo(const xAOD::CaloCluster& cluster, bool do_throw=false)
+  inline float get_phi_calo(const xAOD::CaloCluster& cluster, int author, bool do_throw=false)
 	{
 	  double phi_calo;
-	  if (cluster.retrieveMoment(xAOD::CaloCluster::PHICALOFRAME, phi_calo)) { }
+	  if(author== xAOD::EgammaParameters::AuthorFwdElectron){
+	    phi_calo = cluster.phi();
+	  }
+	  else if (cluster.retrieveMoment(xAOD::CaloCluster::PHICALOFRAME, phi_calo)) { }
 	  else if (cluster.isAvailable<float>("phiCalo")) {
 	    phi_calo = cluster.auxdata<float>("phiCalo");
 	  }
@@ -50,10 +54,13 @@ namespace xAOD {
 	  return phi_calo;
 	}
 
-	inline float get_eta_calo(const xAOD::CaloCluster& cluster, bool do_throw=false)
+  inline float get_eta_calo(const xAOD::CaloCluster& cluster, int author, bool do_throw=false)
 	{
 	  double eta_calo;
-	  if (cluster.retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,
+	  if(author== xAOD::EgammaParameters::AuthorFwdElectron){ 
+            eta_calo = cluster.eta();
+          }
+	  else if (cluster.retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,
 				       eta_calo)) { }
 	  else if (cluster.isAvailable<float>("etaCalo")) {
 	    eta_calo = cluster.auxdata<float>("etaCalo");
@@ -118,15 +125,16 @@ public:
 
   virtual double resolution( double energy, double cl_eta, double cl_etaCalo,
                              PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron, bool withCT=false) const override;
+
 private:
 
   bool m_metadata_retrieved = false;
   std::string m_ESModel;
   std::string m_decorrelation_model_name;
-	std::string m_decorrelation_model_scale_name;
-	std::string m_decorrelation_model_resolution_name;
-	ScaleDecorrelation m_decorrelation_model_scale;
-	ResolutionDecorrelation m_decorrelation_model_resolution;
+  std::string m_decorrelation_model_scale_name;
+  std::string m_decorrelation_model_resolution_name;
+  ScaleDecorrelation m_decorrelation_model_scale = ScaleDecorrelation::FULL;
+  ResolutionDecorrelation m_decorrelation_model_resolution = ResolutionDecorrelation::FULL;
   egEnergyCorr::ESModel m_TESModel;
   int m_doScaleCorrection;
   int m_doSmearing;
@@ -134,8 +142,9 @@ private:
   double m_varSF;
   std::string m_ResolutionType;
   egEnergyCorr::Resolution::resolutionType m_TResolutionType;
-  bool m_use_AFII;
+  int m_use_AFII;
   PATCore::ParticleDataType::DataType m_simulation = PATCore::ParticleDataType::Full;
+  int m_RandomRunNumber;
   //flags duplicated from the underlying ROOT tool
   int m_useLayerCorrection;
   int m_usePSCorrection;
@@ -150,17 +159,30 @@ private:
   int m_use_temp_correction201215;
   int m_use_uA2MeV_2015_first2weeks_correction;
   bool m_use_mapping_correction;
+  int m_user_random_run_number;
 
   void setupSystematics();
 
   StatusCode get_simflavour_from_metadata(PATCore::ParticleDataType::DataType& result) const;
 
+	// this is needed (instead of a simpler lambda since a clang bug, see https://its.cern.ch/jira/browse/ATLASG-688)
+	struct AbsEtaCaloPredicate
+  {
+		AbsEtaCaloPredicate(double eta_min, double eta_max) : m_eta_min(eta_min), m_eta_max(eta_max) {}
+    bool operator()(const xAOD::Egamma& p) {
+      const double aeta = std::abs(xAOD::get_eta_calo(*p.caloCluster(),p.author()));
+      return (aeta >= m_eta_min and aeta < m_eta_max);
+    }
+  private:
+    float m_eta_min, m_eta_max;
+  };
 
   const EgammaPredicate AbsEtaCaloPredicateFactory(double eta_min, double eta_max) const
 	{
-		return [eta_min, eta_max](const xAOD::Egamma& p) {
+		/*return [eta_min, eta_max](const xAOD::Egamma& p) {
 			const double aeta = std::abs(xAOD::get_eta_calo(*p.caloCluster()));
-			return (aeta >= eta_min and aeta < eta_max); };
+			return (aeta >= eta_min and aeta < eta_max); };*/
+		return AbsEtaCaloPredicate(eta_min, eta_max);
 	}
 
 	const EgammaPredicate AbsEtaCaloPredicateFactory(std::pair<double, double> edges) const
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h
index 2dc6735cf73653abaa00acb09082c6711cd2d7f0..ad0735fed5d7a1e763b8026d2ce2bbe465e019fb 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h
@@ -11,8 +11,8 @@
 #ifndef ELECTRONPHOTONFOURMOMENTUMCORRECTION_ELECTRONPHOTONFOURMOMENTUMCORRECTIONDICT_H
 #define ELECTRONPHOTONFOURMOMENTUMCORRECTION_ELECTRONPHOTONFOURMOMENTUMCORRECTIONDICT_H
 
+
 #include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h"
-#include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
 #include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h"
 #include "ElectronPhotonFourMomentumCorrection/eg_resolution.h"
 #include "ElectronPhotonFourMomentumCorrection/EgammaFactory.h"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/GainUncertainty.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/GainUncertainty.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae355993f4e129dbc4cbf09a8775d5b1217a7267
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/GainUncertainty.h
@@ -0,0 +1,50 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ELECTRONPHOTONFOURMOMENTUMCORRECTION_GAINUNCERTAINTYY_H
+#define ELECTRONPHOTONFOURMOMENTUMCORRECTION_GAINUNCERTAINTYY_H
+
+#include <AsgTools/AsgMessaging.h>
+#include <PATCore/PATCoreEnums.h>
+#include <memory>
+#include <string>
+
+
+class TFile;
+class TH1F;
+class TH1D;
+
+namespace egGain{
+
+class GainUncertainty : public asg::AsgMessaging {
+public:
+
+    GainUncertainty(std::string filename);
+    void Init(std::string filename);
+    ~GainUncertainty();
+
+ // return relative uncertainty on energy from gain uncertainty
+ // input etaCalo_input = eta in Calo frame
+ //       et_input = Et in MeV
+ //       ptype    = particle type
+
+  double getUncertainty(double etaCalo_input, double et_input, PATCore::ParticleType::Type ptype=PATCore::ParticleType::Electron) const;
+
+private:
+
+  static const int m_NUM_ETA_BINS=5;
+
+  std::unique_ptr<TFile> m_gainFile;
+
+  TH1F* m_alpha_specialGainRun;
+  TH1F* m_gain_impact_Zee;
+  TH1D* m_gain_Impact_elec[5];
+  TH1D* m_gain_Impact_conv[5];
+  TH1D* m_gain_Impact_unco[5];
+
+};
+
+}
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h
index 163556c13bc6b848703ed01b5dc93501eab9e086..d3867d0c305511a38ef1c211f4a8b922f1954612 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h
@@ -8,48 +8,7 @@
 #ifndef IEGAMMA_CALIB_TOOL_H_
 #define IEGAMMA_CALIB_TOOL_H_
 
-#include "AsgTools/IAsgTool.h"
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
-//xAOD
-#include "xAODEgamma/ElectronFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/EgammaFwd.h"
-
-
-#include "PATInterfaces/CorrectionCode.h"
-#include "PATInterfaces/ISystematicsTool.h"
-
-// PAT includes
-#include "PATCore/PATCoreEnums.h"
-
-// TODO: remove as soon as possibile
-#include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h"
-
-namespace CP {
-
-class IEgammaCalibrationAndSmearingTool : public CP::ISystematicsTool{
-  /// Declare the interface that the class provides
-  ASG_TOOL_INTERFACE( IEgammaCalibrationAndSmearingTool )
-public:
-
-  virtual ~IEgammaCalibrationAndSmearingTool() {};
-
-  virtual StatusCode initialize() = 0;
-
-  //Apply the correction on a modifyable egamma object (xAOD::Electron or xAOD::Photon)
-  virtual CP::CorrectionCode applyCorrection(xAOD::Egamma &) = 0;
-
-  //Create a corrected copy from a constant egamma object
-  virtual CP::CorrectionCode correctedCopy(const xAOD::Electron&, xAOD::Electron*&) = 0;
-  virtual CP::CorrectionCode correctedCopy(const xAOD::Photon&, xAOD::Photon*&) = 0;
-
-  //functions to be used per-event
-  virtual void setRandomSeed(unsigned seed) = 0;
-
-  virtual double resolution( double energy, double cl_eta, double cl_etaCalo,
-                             PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron, bool withCT=false) const = 0;
-  virtual double getResolution(const xAOD::Egamma& particle, bool withCT=true) const = 0;
-};
-
-}
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/e1hg_systematics.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/e1hg_systematics.h
index 1af38a0c74e282b7eea8e35e63c36d8f30092db3..84c60d8afcb06dcb3c7caafda59fc678d862f38d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/e1hg_systematics.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/e1hg_systematics.h
@@ -32,11 +32,11 @@ class e1hg_systematics {
  private:
 
   // histograms to store parameters
-  TH1D* helec[8];
-  TH1D* hphot[8];
-  TH1D* hphot2[8];
-  TFile* file0;
-  const TArrayD* etBins;
+  TH1D* m_helec[8];
+  TH1D* m_hphot[8];
+  TH1D* m_hphot2[8];
+  TFile* m_file0;
+  const TArrayD* m_etBins;
 
 };
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h
index 423fdf851ef2b65f8f8e1b7d8523f9f87df73b54..e5f37e9099b0bab2a8e1ff4a42d5a4c14e668644 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h
@@ -42,7 +42,9 @@
 class eg_resolution;
 class get_MaterialResolutionEffect;
 class e1hg_systematics;
-namespace egGain { class GainTool; }
+namespace egGain { class GainTool;            // run1 tool
+                   class GainUncertainty;     // run2 tool
+                 }
 
 // Create a namespace for all needed enums
 namespace egEnergyCorr {
@@ -77,6 +79,10 @@ namespace egEnergyCorr {
       // Pileup uncertainty
       PileUpDown, PileUpUp,
 
+      // IBL+PP0 for run 2
+      MaterialIBLUp, MaterialIBLDown, MaterialPP0Up, MaterialPP0Down,
+
+
       // to help with loops
       LastResolutionVariation
 
@@ -138,6 +144,9 @@ namespace egEnergyCorr {
       // ... Layer scale variations : data driven, uncorrelated vs eta
       PSUp, PSDown, S12Up, S12Down,
 
+      // extra E12 for es2017 run2
+      S12ExtraLastEtaBinRun2Up, S12ExtraLastEtaBinRun2Down,
+
       // ... Material variations : data driven, uncorrelated vs eta
       MatIDUp, MatIDDown, MatCryoUp, MatCryoDown, MatCaloUp, MatCaloDown,
 
@@ -147,6 +156,11 @@ namespace egEnergyCorr {
       // ... Pedestal
       PedestalUp, PedestalDown,
 
+      // ... wtots1
+      Wtots1Up, Wtots1Down,
+
+      // PP0
+      MatPP0Up, MatPP0Down,
 
       // The following apply to photons only
 
@@ -194,7 +208,11 @@ namespace egEnergyCorr {
     es2015cPRE_res_improved,
     es2015c_summer,         // data-driven for mc15c (to be used in summer 2016)
     es2016PRE,              // as es2015c_summer + temperature extrapolation
-
+    es2017,                 // Moriond 2017
+    es2017_summer,          // Summer 2017
+    es2017_summer_improved, // Recommendations for Higgs mass paper
+    es2017_R21_PRE,         // Pre-recommendations for release 21
+    
     UNDEFINED
 
   };
@@ -273,10 +291,10 @@ namespace AtlasRoot {
 			       PATCore::ParticleDataType::DataType dataType,
 			       PATCore::ParticleType::Type ptype,
 			       double cl_eta,
-             double cl_etaCalo,
+			       double cl_etaCalo,
 			       double energy,
 			       double energyS2,
-             double eraw,
+			       double eraw,
 			       egEnergyCorr::Scale::Variation scaleVar = egEnergyCorr::Scale::None,
 			       egEnergyCorr::Resolution::Variation resVar = egEnergyCorr::Resolution::None,
                                egEnergyCorr::Resolution::resolutionType resType = egEnergyCorr::Resolution::SigmaEff90,
@@ -304,24 +322,26 @@ namespace AtlasRoot {
     const TAxis& get_ZeeStat_eta_axis() const { return *m_zeeNom->GetXaxis(); }
 
   private:
-    mutable egGain::GainTool* m_gain_tool;
+    // TODO: remove mutable
+    mutable egGain::GainTool* m_gain_tool;                    // run 1
+    egGain::GainUncertainty* m_gain_tool_run2;        // based on special run for run2
     mutable eg_resolution* m_resolution_tool;
     mutable get_MaterialResolutionEffect* m_getMaterialDelta;
     mutable e1hg_systematics* m_e1hg_tool;
 
     double getAlphaValue(long int runnumber, double cl_eta, double cl_etaCalo,
-      double energy, double energyS2, double eraw,
-      PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron,
-      egEnergyCorr::Scale::Variation var = egEnergyCorr::Scale::Nominal,
-      double varSF = 1. ) const;
+			 double energy, double energyS2, double eraw,
+			 PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron,
+			 egEnergyCorr::Scale::Variation var = egEnergyCorr::Scale::Nominal,
+			 double varSF = 1. ) const;
 
     double getAlphaUncertainty(long int runnumber, double cl_eta, double cl_etaCalo,
-				double energy,
-				double energyS2,
-        double eraw,
-                                PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron,
-                                egEnergyCorr::Scale::Variation var = egEnergyCorr::Scale::Nominal,
-                                double varSF = 1. ) const;
+			       double energy,
+			       double energyS2,
+			       double eraw,
+			       PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron,
+			       egEnergyCorr::Scale::Variation var = egEnergyCorr::Scale::Nominal,
+			       double varSF = 1. ) const;
 
 
     /// smearing corrections
@@ -367,6 +387,8 @@ namespace AtlasRoot {
     double getE4Uncertainty(double eta) const;
     double getE4NonLinearity(double cl_eta, double meanE, PATCore::ParticleType::Type) const;
 
+    double getWtots1Uncertainty(double cl_eta, double energy, PATCore::ParticleType::Type ptype) const;
+
     double getLayerUncertainty( int iLayer, double cl_eta,
 				egEnergyCorr::Scale::Variation var = egEnergyCorr::Scale::Nominal, double varSF=1. ) const;
 
@@ -429,6 +451,8 @@ namespace AtlasRoot {
     TH1D*         m_daS12Cor;
 
     TH1D*         m_zeeNom;
+    TH1D*         m_zeeNom_data2015;
+
     TH1D*         m_zeeSyst;
     TH1D*         m_zeePhys;
     TH1*          m_uA2MeV_2015_first2weeks_correction;
@@ -478,6 +502,8 @@ namespace AtlasRoot {
     TH1D*         m_pedestalL2;
     TH1D*         m_pedestalL3;
 
+    TH1F*         m_pedestals_es2017;
+
     TH1D*         m_convRadius;
     TH1D*         m_convFakeRate;
     TH1D*         m_convRecoEfficiency;
@@ -487,6 +513,27 @@ namespace AtlasRoot {
 
     TH1D*         m_zeeES2Profile;
 
+    TH2D*         m_pp0_elec;
+    TH2D*         m_pp0_unconv;
+    TH2D*         m_pp0_conv;
+
+    TH1D*         m_wstot_slope_A_data;
+    TH1D*         m_wstot_slope_B_MC;
+    TH1D*         m_wstot_40GeV_data;
+    TH1D*         m_wstot_40GeV_MC;
+    TH1D*         m_wstot_pT_data_p0_electrons;
+    TH1D*         m_wstot_pT_data_p1_electrons;
+    TH1D*         m_wstot_pT_data_p0_unconverted_photons;
+    TH1D*         m_wstot_pT_data_p1_unconverted_photons;
+    TH1D*         m_wstot_pT_data_p0_converted_photons;
+    TH1D*         m_wstot_pT_data_p1_converted_photons;
+    TH1D*         m_wstot_pT_MC_p0_electrons;
+    TH1D*         m_wstot_pT_MC_p1_electrons;
+    TH1D*         m_wstot_pT_MC_p0_unconverted_photons;
+    TH1D*         m_wstot_pT_MC_p1_unconverted_photons;
+    TH1D*         m_wstot_pT_MC_p0_converted_photons;
+    TH1D*         m_wstot_pT_MC_p1_converted_photons;
+    
     // Geometry distortion vectors (to be ordered as in the the Geometry enum!)
 
     std::vector<TH1D*> m_matElectronScale;
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/get_MaterialResolutionEffect.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/get_MaterialResolutionEffect.h
index bff21e74e5a0ae5d82a6debee0446404cb9a64cf..e0b56da73c7fe628c619257fd15d1c83cf2827dd 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/get_MaterialResolutionEffect.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/get_MaterialResolutionEffect.h
@@ -7,7 +7,11 @@
 #include <stdlib.h>
 #include <math.h>
 #include <memory>
+
+#include "AsgTools/AsgMessaging.h"
+
 #include "TH1.h"
+#include "TH2D.h"
 #include "TFile.h"
 #include "TArrayD.h"
 
@@ -20,7 +24,7 @@
 
 */
 
-class get_MaterialResolutionEffect {
+class get_MaterialResolutionEffect : public asg::AsgMessaging {
 
  public:
   /** @brief constructor (initialization done there reading root files with resolution fit parameters */
@@ -40,11 +44,13 @@ class get_MaterialResolutionEffect {
  private:
 
   // histograms to store resolution parameters
-  TH1D* hSystPeak[4][8][3];
-  TH1D* hSystResol[4][8][3];
-  std::unique_ptr <TFile> file0;
-  const TArrayD* etaBins;
-  const TArrayD* etBins;
+  TH1D* m_hSystPeak[4][8][3];
+  TH1D* m_hSystResol[4][8][3];
+  TH2D* m_hsyst_IBL_PP0[3];
+  std::unique_ptr <TFile> m_file0;
+  //const TArrayD* m_etaBins;
+  const TArrayD* m_etBins;
+
 
 };
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/selection.xml b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/selection.xml
index a04130e6ac999927e9e6074cc24131e83dc69d02..4d2b2bfedb1f42711de9f4c2f79cec8d8138f9a8 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/selection.xml
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrection/selection.xml
@@ -1,19 +1,24 @@
  <lcgdict>
 
    <class name="CP::EgammaCalibrationAndSmearingTool" />
+
    <class name="AtlasRoot::egammaEnergyCorrectionTool" />
-   <class name="CP::IEgammaCalibrationAndSmearingTool" />
+
    <namespace name="egEnergyCorr" />
+   <enum pattern="egEnergyCorr::*"/>
    <class name="egEnergyCorr::ROOT6_OpenNamespaceWorkaround" />
+
    <namespace name="egEnergyCorr::Resolution" />
+   <enum pattern="egEnergyCorr::Resolution::*"/>
    <class name="egEnergyCorr::Resolution::ROOT6_OpenNamespaceWorkaround" />
+
    <namespace name="egEnergyCorr::Scale" />
-   <class name="egEnergyCorr::Scale::ROOT6_OpenNamespaceWorkaround" />
-   <enum pattern="egEnergyCorr::*"/>
-   <enum pattern="egEnergyCorr::Resolution::*"/>
    <enum pattern="egEnergyCorr::Scale::*"/>
+   <class name="egEnergyCorr::Scale::ROOT6_OpenNamespaceWorkaround" />
 
    <class name="eg_resolution" />
    <class name="EgammaFactory" />
    <class name="LArTemperatureCorrectionTool" />
+
+
 </lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaCalibrationAndSmearingTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaCalibrationAndSmearingTool.cxx
index 0e083e943d27c7a164568d6f4fa2374b805f8652..d2baf7a71d653bbb82897503a79e05cfdb246238 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaCalibrationAndSmearingTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaCalibrationAndSmearingTool.cxx
@@ -19,8 +19,9 @@
 #include "PathResolver/PathResolver.h"
 #include "CxxUtils/make_unique.h"
 #include "xAODMetaData/FileMetaData.h"
-#ifndef ROOTCORE
 #include <boost/algorithm/string.hpp>
+
+#ifndef ROOTCORE
 #include "AthAnalysisBaseComps/AthAnalysisHelper.h"
 #endif
 
@@ -52,16 +53,21 @@ std::unique_ptr<egGain::GainTool> gainToolFactory(egEnergyCorr::ESModel model)
     case egEnergyCorr::es2015PRE_res_improved:
     case egEnergyCorr::es2015cPRE_res_improved:
     case egEnergyCorr::es2015c_summer:
-    case egEnergyCorr::es2016PRE:
     case egEnergyCorr::es2015_day0_3percent:
+    case egEnergyCorr::es2016PRE:
     {
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       return CxxUtils::make_unique<egGain::GainTool>(gain_filename1, gain_filename2);
     }
+    case egEnergyCorr::es2017:
+    case egEnergyCorr::es2017_summer: 
+    case egEnergyCorr::es2017_summer_improved:
+    case egEnergyCorr::es2017_R21_PRE:
+      return nullptr;  
     default:
       return nullptr;
-    }
+  }
 }
 
 std::unique_ptr<egammaMVATool> egammaMVAToolFactory(egEnergyCorr::ESModel model)
@@ -89,8 +95,14 @@ std::unique_ptr<egammaMVATool> egammaMVAToolFactory(egEnergyCorr::ESModel model)
           break;
         case egEnergyCorr::es2015c_summer:
         case egEnergyCorr::es2016PRE:
+        case egEnergyCorr::es2017:
+        case egEnergyCorr::es2017_summer:
+        case egEnergyCorr::es2017_summer_improved:
           folder = "egammaMVACalib/offline/v4.0";
           break;
+        case egEnergyCorr::es2017_R21_PRE:
+	  folder = "egammaMVACalib/offline/v7";
+          break;
         default: folder = "";
     }
 
@@ -103,7 +115,6 @@ std::unique_ptr<egammaMVATool> egammaMVAToolFactory(egEnergyCorr::ESModel model)
     else { return nullptr; }
 }
 
-
 std::unique_ptr<egammaLayerRecalibTool> egammaLayerRecalibToolFactory(egEnergyCorr::ESModel model)
 {
   std::string tune = "";
@@ -123,8 +134,14 @@ std::unique_ptr<egammaLayerRecalibTool> egammaLayerRecalibToolFactory(egEnergyCo
     case egEnergyCorr::es2015_day0_3percent:
     case egEnergyCorr::es2015c_summer:
     case egEnergyCorr::es2016PRE:
+    case egEnergyCorr::es2017:
+    case egEnergyCorr::es2017_R21_PRE:  
       tune = "2012_alt_with_layer2";
       break;
+    case egEnergyCorr::es2017_summer:
+    case egEnergyCorr::es2017_summer_improved:
+      tune = "es2017_20.7_improved";
+      break;
     default:
       return nullptr;
   }
@@ -153,6 +170,10 @@ bool use_intermodule_correction(egEnergyCorr::ESModel model)
     case egEnergyCorr::es2015cPRE_res_improved:
     case egEnergyCorr::es2015c_summer:
     case egEnergyCorr::es2016PRE:
+    case egEnergyCorr::es2017:
+    case egEnergyCorr::es2017_summer:  
+    case egEnergyCorr::es2017_summer_improved:
+    case egEnergyCorr::es2017_R21_PRE:
       return true;
     case egEnergyCorr::UNDEFINED:  // TODO: find better logic
       return false;
@@ -187,6 +208,10 @@ bool is_run2(egEnergyCorr::ESModel model)
     case egEnergyCorr::es2015cPRE_res_improved:
     case egEnergyCorr::es2015c_summer:
     case egEnergyCorr::es2016PRE:
+    case egEnergyCorr::es2017:
+    case egEnergyCorr::es2017_summer:
+    case egEnergyCorr::es2017_summer_improved:    
+    case egEnergyCorr::es2017_R21_PRE:  
       return true;
     case egEnergyCorr::UNDEFINED:  // TODO: find better logic
       return false;
@@ -207,8 +232,8 @@ EgammaCalibrationAndSmearingTool::EgammaCalibrationAndSmearingTool(const std::st
     m_set_seed_function([](const EgammaCalibrationAndSmearingTool&,
                            const xAOD::Egamma& egamma,
                            const xAOD::EventInfo& ei) {
-                           // avoid 0 as result, see https://root.cern.ch/root/html/TRandom3.html#TRandom3:SetSeed
-                             return 1 + static_cast<RandomNumber>(std::abs(egamma.phi()) * 1E6 + std::abs(egamma.eta()) * 1E3 + ei.eventNumber()); })
+			  // avoid 0 as result, see https://root.cern.ch/root/html/TRandom3.html#TRandom3:SetSeed
+			  return 1 + static_cast<RandomNumber>(std::abs(egamma.phi()) * 1E6 + std::abs(egamma.eta()) * 1E3 + ei.eventNumber()); })
 {
   declareProperty("ESModel", m_ESModel = "");
   declareProperty("decorrelationModel", m_decorrelation_model_name = "");
@@ -233,7 +258,9 @@ EgammaCalibrationAndSmearingTool::EgammaCalibrationAndSmearingTool(const std::st
   declareProperty("use_full_statistical_error", m_use_full_statistical_error=false);
   declareProperty("use_temp_correction201215", m_use_temp_correction201215=AUTO);
   declareProperty("use_uA2MeV_2015_first2weeks_correction", m_use_uA2MeV_2015_first2weeks_correction=AUTO);
-  declareProperty("useAFII", m_use_AFII = false, "This will be set automatically for you if using athena");
+  declareProperty("randomRunNumber", m_user_random_run_number=0);
+  // this is the user input, it is never changed by the tool. The tool uses m_simulation.
+  declareProperty("useAFII", m_use_AFII = AUTO, "This will be set automatically for you if using athena, (int)0=full sim, (int)1=fast sim");
   m_use_mapping_correction = false;
 }
 
@@ -261,6 +288,10 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
   else if (m_ESModel == "es2015cPRE_res_improved") { m_TESModel = egEnergyCorr::es2015cPRE_res_improved; }
   else if (m_ESModel == "es2015c_summer") { m_TESModel = egEnergyCorr::es2015c_summer; }
   else if (m_ESModel == "es2016PRE") { m_TESModel = egEnergyCorr::es2016PRE; }
+  else if (m_ESModel == "es2016data_mc15c") { m_TESModel = egEnergyCorr::es2017; }
+  else if (m_ESModel == "es2016data_mc15c_summer") { m_TESModel = egEnergyCorr::es2017_summer; }
+  else if (m_ESModel == "es2016data_mc15c_summer_improved") { m_TESModel = egEnergyCorr::es2017_summer_improved; } 
+  else if (m_ESModel == "es2017_R21_PRE") { m_TESModel = egEnergyCorr::es2017_R21_PRE; }
   else if (m_ESModel.empty()) {
     ATH_MSG_ERROR("you must set ESModel property");
     return StatusCode::FAILURE;
@@ -278,8 +309,10 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
     return StatusCode::FAILURE;
   }
 
-  if (m_use_AFII) { m_simulation = PATCore::ParticleDataType::Fast; }
-  else { m_simulation = PATCore::ParticleDataType::Full; }
+  if (m_use_AFII == 1) { m_simulation = PATCore::ParticleDataType::Fast; }
+  else if (m_use_AFII == 0) { m_simulation = PATCore::ParticleDataType::Full; }
+  // this is needed for tests where only applyCorrection is called without beginInputFile or beginEvent
+  else if (m_use_AFII == AUTO) { m_simulation = PATCore::ParticleDataType::Full; }
 
   // configure decorrelation model, translate string property to internal class enum
   /*    S R SR
@@ -391,16 +424,23 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
   }
 
   // configure layer recalibration tool
-  ATH_MSG_DEBUG("initializing layer recalibration tool (if needed)");
-  if (m_layer_recalibration_tune == "") { // automatically configure layer recalibration tool
-    m_layer_recalibration_tool = egammaLayerRecalibToolFactory(m_TESModel).release();
-    if (!m_layer_recalibration_tool) { ATH_MSG_INFO("not using layer recalibration"); }
+  //For now: layer recalibration only needed before release 21
+  if (m_ESModel == "es2017_R21_PRE"){
+    ATH_MSG_INFO("Layer recalibration already applied at cell level");
+    m_useLayerCorrection = false;
   }
-  else {
-    m_layer_recalibration_tool = new egammaLayerRecalibTool(m_layer_recalibration_tune);
+  else{
+    ATH_MSG_DEBUG("initializing layer recalibration tool (if needed)");
+    if (m_layer_recalibration_tune == "") { // automatically configure layer recalibration tool
+      m_layer_recalibration_tool = egammaLayerRecalibToolFactory(m_TESModel).release();
+      if (!m_layer_recalibration_tool) { ATH_MSG_INFO("not using layer recalibration"); }
+    }
+    else {
+      m_layer_recalibration_tool = new egammaLayerRecalibTool(m_layer_recalibration_tune);
+    }
+    if (m_layer_recalibration_tool) { m_layer_recalibration_tool->msg().setLevel(this->msg().level()); }
   }
-  if (m_layer_recalibration_tool) { m_layer_recalibration_tool->msg().setLevel(this->msg().level()); }
-
+  
   if (m_use_temp_correction201215 != AUTO) m_rootTool->use_temp_correction201215(m_use_temp_correction201215);
   if (m_use_uA2MeV_2015_first2weeks_correction != AUTO) m_rootTool->use_uA2MeV_2015_first2weeks_correction(m_use_uA2MeV_2015_first2weeks_correction);
   if (not m_use_full_statistical_error and m_decorrelation_model_scale == ScaleDecorrelation::FULL) { m_rootTool->useStatErrorScaling(true); }
@@ -409,7 +449,7 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
     ATH_MSG_ERROR("ep combination not supported yet");
     throw std::runtime_error("ep combination not supported yet");
   }
-
+  
   if (m_useIntermoduleCorrection == AUTO) { m_useIntermoduleCorrection = use_intermodule_correction(m_TESModel); }
   if (m_usePhiUniformCorrection == AUTO) { m_usePhiUniformCorrection = use_phi_uniform_correction(m_TESModel); }
   m_use_mapping_correction = not is_run2(m_TESModel);
@@ -423,6 +463,11 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
     ATH_MSG_ERROR("cannot instantiate gain tool for this model (you can only disable the gain tool, but not enable it)");
   }
 
+  //No scale correction for release 21 ==> obsolete
+  /*if (m_ESModel == "es2017_R21_PRE"){
+    m_doScaleCorrection = 0;
+  }
+  */
 
   ATH_MSG_INFO("ESModel: " << m_ESModel);
   ATH_MSG_INFO("ResolutionType: " << m_ResolutionType);
@@ -441,7 +486,6 @@ StatusCode EgammaCalibrationAndSmearingTool::initialize() {
   ATH_MSG_INFO("use uA2MeV correction 2015 1/2 week = " << m_use_uA2MeV_2015_first2weeks_correction);
   //ATH_MSG_INFO("use AFII = " << m_use_AFII); ... print in beginInputFile now, since that's where we check it's value
 
-
   setupSystematics();
 
   applySystematicVariation(CP::SystematicSet()).ignore();   // this set the flags for the internal tool without systematics
@@ -463,7 +507,6 @@ StatusCode EgammaCalibrationAndSmearingTool::get_simflavour_from_metadata(PATCor
     result = PATCore::ParticleDataType::Data;
     return StatusCode::SUCCESS;
   }
-
   // Determine Fast/FullSim
   std::string simType("");
   ATH_CHECK(AthAnalysisHelper::retrieveMetadata("/Simulation/Parameters", "SimulationFlavour", simType, inputMetaStore()));
@@ -485,7 +528,8 @@ StatusCode EgammaCalibrationAndSmearingTool::get_simflavour_from_metadata(PATCor
     }
     else {
       ATH_MSG_DEBUG("sim type = " + simType);
-      result = simType == "FullSim" ? PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast;
+      boost::to_upper(simType);
+      result = (simType.find("ATLFASTII")==std::string::npos) ?  PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast;
       return StatusCode::SUCCESS;
     }
   }
@@ -498,27 +542,40 @@ StatusCode EgammaCalibrationAndSmearingTool::get_simflavour_from_metadata(PATCor
 
 StatusCode EgammaCalibrationAndSmearingTool::beginInputFile()
 {
-  PATCore::ParticleDataType::DataType result;
-  const StatusCode status = get_simflavour_from_metadata(result);
-  if (status == StatusCode::SUCCESS) {
-    m_metadata_retrieved = true;
+  // if the user has set a preference (m_use_AFII != AUTO) set it
+  if (m_use_AFII == 0) { m_simulation = PATCore::ParticleDataType::Full; }
+  else if (m_use_AFII == 1) { m_simulation = PATCore::ParticleDataType::Fast; }
 
-    if (result != PATCore::ParticleDataType::Data) {
-      m_simulation = result;
-      if (m_simulation == PATCore::ParticleDataType::Full and m_use_AFII) {
-        // inform the user only in this case (since m_use_AFII is false by default)
-        ATH_MSG_WARNING("data is full sim, but you asked for AFII -> using full sim");
+  PATCore::ParticleDataType::DataType data_flavour_metadata;
+  const StatusCode status_metadata = get_simflavour_from_metadata(data_flavour_metadata);
+  if (status_metadata == StatusCode::SUCCESS) {
+    m_metadata_retrieved = true;
+    ATH_MSG_DEBUG("metadata from new file: " << (data_flavour_metadata == PATCore::ParticleDataType::Data ? "data" : (data_flavour_metadata == PATCore::ParticleDataType::Full ? "full simulation" : "fast simulation")));
+
+    if (data_flavour_metadata != PATCore::ParticleDataType::Data) {
+      if (m_use_AFII == AUTO) { m_simulation = data_flavour_metadata; }
+      else { // user set a preference
+        // check if the preference is consistent and warning
+        if (m_use_AFII == 1 and data_flavour_metadata == PATCore::ParticleDataType::Full) {
+          ATH_MSG_WARNING("data is full sim, but you asked for AFII");
+        }
+        else if (m_use_AFII == 0 and data_flavour_metadata == PATCore::ParticleDataType::Fast) {
+          ATH_MSG_WARNING("data is fast sim, but you asked for full sim");
+        }
       }
     }
-    ATH_MSG_DEBUG("metadata from new file: " << (result == PATCore::ParticleDataType::Data ? "data" : (result == PATCore::ParticleDataType::Full ? "full simulation" : "fast simulation")));
   }
-  else {
+  else { // not able to retrieve metadata
     m_metadata_retrieved = false;
-    ATH_MSG_WARNING("not possible to retrieve simulation flavor automatically, use fastsim = " << m_use_AFII);
-    if (m_use_AFII) { m_simulation = PATCore::ParticleDataType::Fast; }
-    else { m_simulation = PATCore::ParticleDataType::Full; }
+
+    if (m_use_AFII == AUTO) {
+      ATH_MSG_WARNING("not able to retrieve metadata and use_AFII not specified -> set simulation flavour to full simulation");
+      // do not error since it can be real data, but we don't know, need to check later (beginEvent)
+    }
   }
-  return status;
+
+//  return status_metadata;  // since several times it is not possible to retrieve metadata
+  return StatusCode::SUCCESS;
 }
 
 StatusCode EgammaCalibrationAndSmearingTool::endInputFile() {
@@ -534,8 +591,12 @@ StatusCode EgammaCalibrationAndSmearingTool::beginEvent() {
   ATH_CHECK(evtStore()->retrieve(evtInfo, "EventInfo"));
   if (evtInfo->eventType(xAOD::EventInfo::IS_SIMULATION)) {
     // redundant, already done in beginInputFile
-    if (m_use_AFII) { m_simulation = PATCore::ParticleDataType::Fast; }
-    else { m_simulation = PATCore::ParticleDataType::Full; }
+    if (m_use_AFII == 1) { m_simulation = PATCore::ParticleDataType::Fast; }
+    else if (m_use_AFII == 0) { m_simulation = PATCore::ParticleDataType::Full; }
+    else { // AUTO
+      // do not warning since it is annoying for every event, the warning is in beginInputFile
+      m_simulation = PATCore::ParticleDataType::Full;
+    }
   }
   return StatusCode::SUCCESS;
 }
@@ -548,7 +609,8 @@ void EgammaCalibrationAndSmearingTool::setRandomSeed(unsigned seed) {
 PATCore::ParticleType::Type EgammaCalibrationAndSmearingTool::xAOD2ptype(const xAOD::Egamma& particle) const
 {
   auto ptype = PATCore::ParticleType::Electron;
-  if (xAOD::EgammaHelpers::isElectron(&particle)) { ptype = PATCore::ParticleType::Electron; }
+  //no ForwardElectron ptype: consider them as Electron
+  if (xAOD::EgammaHelpers::isElectron(&particle) || particle.author() == xAOD::EgammaParameters::AuthorFwdElectron) { ptype = PATCore::ParticleType::Electron; }
   else if (xAOD::EgammaHelpers::isPhoton(&particle)) {
     if (xAOD::EgammaHelpers::isConvertedPhoton(&particle)) { ptype = PATCore::ParticleType::ConvertedPhoton; }
     else { ptype = PATCore::ParticleType::UnconvertedPhoton; }
@@ -563,7 +625,7 @@ PATCore::ParticleType::Type EgammaCalibrationAndSmearingTool::xAOD2ptype(const x
 double EgammaCalibrationAndSmearingTool::getResolution(const xAOD::Egamma& particle, bool withCT) const
 {
   const auto ptype = xAOD2ptype(particle);
-  const auto cl_etaCalo = xAOD::get_eta_calo(*particle.caloCluster());
+  const auto cl_etaCalo = xAOD::get_eta_calo(*particle.caloCluster(), particle.author());
 
   return m_rootTool->resolution(particle.e(), particle.caloCluster()->eta(),
                                 cl_etaCalo, ptype,
@@ -665,7 +727,10 @@ CP::CorrectionCode EgammaCalibrationAndSmearingTool::applyCorrection(xAOD::Egamm
   double energy = 0.;
   // apply MVA calibration
   if (m_mva_tool) {
-    energy = m_mva_tool->getEnergy(input.caloCluster(), &input);
+    if (input.author() != xAOD::EgammaParameters::AuthorFwdElectron) {    // do not apply MVA calibration to fwd electrons
+      energy = m_mva_tool->getEnergy(input.caloCluster(), &input);
+    }
+    else { energy = input.e(); }
     ATH_MSG_DEBUG("energy after MVA calibration = " << boost::format("%.2f") % energy);
   }
   else { energy = input.e(); }
@@ -685,8 +750,8 @@ CP::CorrectionCode EgammaCalibrationAndSmearingTool::applyCorrection(xAOD::Egamm
   }
 
   if (dataType == PATCore::ParticleDataType::Data and m_usePhiUniformCorrection) {
-    energy *= correction_phi_unif(xAOD::get_eta_calo(*input.caloCluster(), false),
-                                  xAOD::get_phi_calo(*input.caloCluster(), false));
+    energy *= correction_phi_unif(xAOD::get_eta_calo(*input.caloCluster(), input.author(), false),
+                                  xAOD::get_phi_calo(*input.caloCluster(), input.author(), false));
     ATH_MSG_DEBUG("energy after uniformity correction = " << boost::format("%.2f") % energy);
   }
 
@@ -705,20 +770,44 @@ CP::CorrectionCode EgammaCalibrationAndSmearingTool::applyCorrection(xAOD::Egamm
                        (input.caloCluster()->isAvailable<double>("correctedcl_Es2") ? input.caloCluster()->auxdataConst<double>("correctedcl_Es2") : input.caloCluster()->energyBE(2)) +
                        (input.caloCluster()->isAvailable<double>("correctedcl_Es3") ? input.caloCluster()->auxdataConst<double>("correctedcl_Es3") : input.caloCluster()->energyBE(3)));
 
+
+  unsigned int runNumber_for_tool = 0;
+  if (dataType == PATCore::ParticleDataType::Data) runNumber_for_tool = event_info.runNumber();
+  else {
+    if (m_user_random_run_number == 0) {
+      static const SG::AuxElement::Accessor<unsigned int> randomrunnumber_getter("RandomRunNumber");
+      if (randomrunnumber_getter.isAvailable(event_info)) { runNumber_for_tool = randomrunnumber_getter(event_info); }
+      else {
+	ATH_MSG_ERROR("Pileup tool not run before using ElectronPhotonFourMomentumCorrection! Assuming it is 2016. If you "
+		      "want to force a specific period set the property randomRunNumber of the tool, e.g. in the job option: "
+		      "tool.randomRunNumber = 123456 or "
+		      "tool.randomRunNumber = EgammaCalibrationAndSmearingToolRunNumbersExample.run_2016");
+	runNumber_for_tool = EgammaCalibPeriodRunNumbersExample::run_2016;
+      }
+    }
+    else {
+      runNumber_for_tool = m_user_random_run_number;
+    }
+  }
+
+  if (dataType == PATCore::ParticleDataType::Fast) ATH_MSG_DEBUG("is fast");
+  else if (dataType == PATCore::ParticleDataType::Full) ATH_MSG_DEBUG("is full");
+  else if (dataType == PATCore::ParticleDataType::Data) ATH_MSG_DEBUG("is data");
+
   // apply scale factors or systematics
   energy = m_rootTool->getCorrectedEnergy(
-             event_info.runNumber(),
+             runNumber_for_tool,
              dataType,
              xAOD2ptype(input),
              input.caloCluster()->eta(),
-             xAOD::get_eta_calo(*input.caloCluster(), false),
+             xAOD::get_eta_calo(*input.caloCluster(), input.author(), false),
              energy,
              input.caloCluster()->isAvailable<double>("correctedcl_Es2") ? input.caloCluster()->auxdataConst<double>("correctedcl_Es2") : input.caloCluster()->energyBE(2),
              eraw,
              oldtool_scale_flag_this_event(input, event_info),
              oldtool_resolution_flag_this_event(input, event_info),
              m_TResolutionType,
-				     m_varSF);
+	           m_varSF);
 
   ATH_MSG_DEBUG("energy after scale/systematic correction = " << boost::format("%.2f") % energy);
 
@@ -759,13 +848,13 @@ double EgammaCalibrationAndSmearingTool::getElectronMomentum(const xAOD::Electro
   const xAOD::TrackParticle* eTrack = el->trackParticle();
 
   // track momentum and eta
-  const float m_el_tracketa = eTrack->eta();
-  const float m_el_trackmomentum = eTrack->pt() * cosh(el->eta());
+  const float el_tracketa = eTrack->eta();
+  const float el_trackmomentum = eTrack->pt() * cosh(el->eta());
 
   return m_rootTool->getCorrectedMomentum(dataType,
 					  PATCore::ParticleType::Electron,
-					  m_el_trackmomentum,
-					  m_el_tracketa,
+					  el_trackmomentum,
+					  el_tracketa,
 					  oldtool_scale_flag_this_event(*el, *event_info),
 					  m_varSF);
 }
@@ -793,28 +882,62 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
   }
   else if (m_decorrelation_model_scale == ScaleDecorrelation::FULL_ETA_CORRELATED) {
     // all the physical effects separately, considered as fully correlated in eta
+
+    // common systematics for all the esmodels
     #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown)                \
       m_syst_description[CP::SystematicVariation(#name, +1)] = SysInfo{always, flagup};    \
       m_syst_description[CP::SystematicVariation(#name, -1)] = SysInfo{always, flagdown};
     #include "ElectronPhotonFourMomentumCorrection/systematics.def"
     #undef SYSMACRO
+
     // Zee stat is not included in the macro list, add by hand
     m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", +1)] = SysInfo{always, egEnergyCorr::Scale::ZeeStatUp};
     m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", -1)] = SysInfo{always, egEnergyCorr::Scale::ZeeStatDown};
+
+    // additional systematics for S12 run2
     if (m_TESModel == egEnergyCorr::es2015PRE_res_improved or m_TESModel == egEnergyCorr::es2015PRE or
         m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or
-        m_TESModel == egEnergyCorr::es2016PRE) {
-      // additional systematics for 2015
+        m_TESModel == egEnergyCorr::es2016PRE or m_TESModel == egEnergyCorr::es2017 or 
+	m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE", +1)] = SysInfo{always, egEnergyCorr::Scale::LArCalibExtra2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE", -1)] = SysInfo{always, egEnergyCorr::Scale::LArCalibExtra2015PreDown};
+    }
+
+    // additional systematics for temperature run1->run2
+    if (m_TESModel == egEnergyCorr::es2015PRE_res_improved or m_TESModel == egEnergyCorr::es2015PRE or
+        m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or
+        m_TESModel == egEnergyCorr::es2016PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", +1)] = SysInfo{always, egEnergyCorr::Scale::LArTemperature2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE", -1)] = SysInfo{always, egEnergyCorr::Scale::LArTemperature2015PreDown};
     }
-    if (m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or m_TESModel == egEnergyCorr::es2016PRE) {
+
+    // additional systematic for S12 last eta bin run2
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", +1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", -1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down};
+    }
+
+    // additional systematic for PP0 region
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0", +1)] = SysInfo{always, egEnergyCorr::Scale::MatPP0Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0", -1)] = SysInfo{always, egEnergyCorr::Scale::MatPP0Down};
+    }
+
+    // systematic related to wtots1
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", +1)] = SysInfo{always, egEnergyCorr::Scale::Wtots1Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", -1)] = SysInfo{always, egEnergyCorr::Scale::Wtots1Down};
+    }
+
+    // systematic for the scintillators
+    if (m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or m_TESModel == egEnergyCorr::es2016PRE or m_TESModel == egEnergyCorr::es2017
+	or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
       // scintillator systematics
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR", +1)] = SysInfo{always, egEnergyCorr::Scale::E4ScintillatorUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR", -1)] = SysInfo{always, egEnergyCorr::Scale::E4ScintillatorDown};
     }
+
+    // additional systematic for temperature 2015->2016
     if (m_TESModel == egEnergyCorr::es2016PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", +1)] = SysInfo{always, egEnergyCorr::Scale::LArTemperature2016PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2016PRE", -1)] = SysInfo{always, egEnergyCorr::Scale::LArTemperature2016PreDown};
@@ -823,11 +946,19 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
   else if (m_decorrelation_model_scale == ScaleDecorrelation::ONENP_PLUS_UNCONR) {
       // qsum of all variations correlated 8/13 TeV + uncorrelated (additional systematics for 2015PRE or 2016)
       // all the physical effects separately, considered as fully correlated in eta
+      // TODO: fix for es2017
       #define SYSMACRO(name, fullcorrelated, decorrelation, flagup, flagdown)                \
         m_syst_description[CP::SystematicVariation(#name, +1)] = SysInfo{always, flagup};    \
         m_syst_description[CP::SystematicVariation(#name, -1)] = SysInfo{always, flagdown};
       #include "ElectronPhotonFourMomentumCorrection/systematics_1NPCOR_PLUS_UNCOR.def"
       #undef SYSMACRO
+
+    // additional systematic for S12 last eta bin run2
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", +1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", -1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down};
+    }
+
   }
   else if (m_decorrelation_model_scale == ScaleDecorrelation::FULL) {
     typedef std::vector<std::pair<double, double>> pairvector;
@@ -871,24 +1002,53 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
       m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", +1)] = SysInfo{always, egEnergyCorr::Scale::ZeeStatUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_ZEESTAT", -1)] = SysInfo{always, egEnergyCorr::Scale::ZeeStatDown};
     }
+
+    // additional systematics for S12 run2
     if (m_TESModel == egEnergyCorr::es2015PRE_res_improved or m_TESModel == egEnergyCorr::es2015PRE or
         m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or
-        m_TESModel == egEnergyCorr::es2016PRE) {
+        m_TESModel == egEnergyCorr::es2016PRE or m_TESModel == egEnergyCorr::es2017
+	or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", +1)] = SysInfo{AbsEtaCaloPredicateFactory({0, 1.45}), egEnergyCorr::Scale::LArCalibExtra2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN0", -1)] = SysInfo{AbsEtaCaloPredicateFactory({0, 1.45}), egEnergyCorr::Scale::LArCalibExtra2015PreDown};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", +1)] = SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}), egEnergyCorr::Scale::LArCalibExtra2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN1", -1)] = SysInfo{AbsEtaCaloPredicateFactory({1.45, 2.47}), egEnergyCorr::Scale::LArCalibExtra2015PreDown};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", +1)] = SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}), egEnergyCorr::Scale::LArCalibExtra2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARCALIB_EXTRA2015PRE__ETABIN2", -1)] = SysInfo{AbsEtaCaloPredicateFactory({2.47, 3.2}), egEnergyCorr::Scale::LArCalibExtra2015PreDown};
+    }
 
+    // additional systematics for temperature run1->run2
+    if (m_TESModel == egEnergyCorr::es2015PRE_res_improved or m_TESModel == egEnergyCorr::es2015PRE or
+        m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or
+        m_TESModel == egEnergyCorr::es2016PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", +1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]), egEnergyCorr::Scale::LArTemperature2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN0", -1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]), egEnergyCorr::Scale::LArTemperature2015PreDown};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", +1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]), egEnergyCorr::Scale::LArTemperature2015PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2015PRE__ETABIN1", -1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]), egEnergyCorr::Scale::LArTemperature2015PreDown};
     }
 
-    if (m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or m_TESModel == egEnergyCorr::es2016PRE) {
-      // scintillator systematics
+    // additional systematic for S12 last eta bin run2
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", +1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_S12EXTRALASTETABINRUN2", -1)] = SysInfo{always, egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down};
+    }
+
+    // additional systematic for PP0 region
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN0", +1)] = SysInfo{AbsEtaCaloPredicateFactory(0, 1.5), egEnergyCorr::Scale::MatPP0Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN1", +1)] = SysInfo{AbsEtaCaloPredicateFactory(1.5, 2.5), egEnergyCorr::Scale::MatPP0Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN0", -1)] = SysInfo{AbsEtaCaloPredicateFactory(0, 1.5), egEnergyCorr::Scale::MatPP0Down};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_MATPP0__ETABIN1", -1)] = SysInfo{AbsEtaCaloPredicateFactory(1.5, 2.5), egEnergyCorr::Scale::MatPP0Down};
+    }
+
+    // systematic related to wtots1
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", +1)] = SysInfo{always, egEnergyCorr::Scale::Wtots1Up};
+      m_syst_description[CP::SystematicVariation("EG_SCALE_WTOTS1", -1)] = SysInfo{always, egEnergyCorr::Scale::Wtots1Down};
+    }
+
+    // systematic for the scintillators
+    if (m_TESModel == egEnergyCorr::es2015cPRE or m_TESModel == egEnergyCorr::es2015c_summer or m_TESModel == egEnergyCorr::es2016PRE or m_TESModel == egEnergyCorr::es2017
+	or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR__ETABIN0", +1)] = SysInfo{AbsEtaCaloPredicateFactory(1.4, 1.46), egEnergyCorr::Scale::E4ScintillatorUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR__ETABIN1", +1)] = SysInfo{AbsEtaCaloPredicateFactory(1.46, 1.52), egEnergyCorr::Scale::E4ScintillatorUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR__ETABIN2", +1)] = SysInfo{AbsEtaCaloPredicateFactory(1.52, 1.6), egEnergyCorr::Scale::E4ScintillatorUp};
@@ -897,6 +1057,8 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
       m_syst_description[CP::SystematicVariation("EG_SCALE_E4SCINTILLATOR__ETABIN2", -1)] = SysInfo{AbsEtaCaloPredicateFactory(1.52, 1.6), egEnergyCorr::Scale::E4ScintillatorDown};
 
     }
+
+    // additional systematic for temperature 2015->2016
     if (m_TESModel == egEnergyCorr::es2016PRE) {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN0", +1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[0]), egEnergyCorr::Scale::LArTemperature2016PreUp};
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", +1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]), egEnergyCorr::Scale::LArTemperature2016PreUp};
@@ -904,7 +1066,6 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
       m_syst_description[CP::SystematicVariation("EG_SCALE_LARTEMPERATURE_EXTRA2016PRE__ETABIN1", -1)] = SysInfo{AbsEtaCaloPredicateFactory(decorrelation_bins_BE[1]), egEnergyCorr::Scale::LArTemperature2016PreDown};
     }
 
-
   }
   else {
     ATH_MSG_FATAL("scale decorrelation model invalid");
@@ -930,6 +1091,12 @@ void EgammaCalibrationAndSmearingTool::setupSystematics() {
     m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_MATERIALCRYO", -1)] = egEnergyCorr::Resolution::MaterialCryoDown;
     m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_PILEUP", +1)] = egEnergyCorr::Resolution::PileUpUp;
     m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_PILEUP", -1)] = egEnergyCorr::Resolution::PileUpDown;
+    if (m_TESModel == egEnergyCorr::es2017 or m_TESModel == egEnergyCorr::es2017_summer or m_TESModel == egEnergyCorr::es2017_summer_improved or m_TESModel == egEnergyCorr::es2017_R21_PRE) {
+      m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_MATERIALIBL", +1)] = egEnergyCorr::Resolution::MaterialIBLUp;
+      m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_MATERIALIBL", -1)] = egEnergyCorr::Resolution::MaterialIBLDown;
+      m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_MATERIALPP0", +1)] = egEnergyCorr::Resolution::MaterialPP0Up;
+      m_syst_description_resolution[CP::SystematicVariation("EG_RESOLUTION_MATERIALPP0", -1)] = egEnergyCorr::Resolution::MaterialPP0Down;
+    }
   }
   else {
     ATH_MSG_FATAL("resolution decorrelation model invalid");
@@ -989,52 +1156,110 @@ CP::SystematicCode EgammaCalibrationAndSmearingTool::applySystematicVariation(co
 
 double EgammaCalibrationAndSmearingTool::intermodule_correction(double Ecl,  double phi, double eta) const
 {
+    
+  //Intermodule Widening Correction: E_corr = E / (a' - b' * ((1 / (1 + exp((phi_mod - 2 * pi / 32) * c))) * (1 / (1 + exp((phi_mod - 2 * pi / 32) * (d))))))
+  //(phi_min, phi_max) : [a' = a / a, b' = b / a, c, d]
+  
   double Ecl_corr = 0.;
   int DivInt = 0;
   double pi = 3.1415926535897932384626433832795 ;
 
-  //  Definitions of module folding into four quarters (top, left, bottom and right)
-
-  DivInt =  (int) (phi / ((2 * pi) / 16.));
-  double phi_mod = phi - DivInt * (2 * pi / 16.);
-
-
-  //  Centring on the intermodule --> phi_mod will now be in [0,0.4]
-  if (phi_mod < 0) phi_mod += pi / 8.;
-
-  //  The correction concerns only the barrel
-  if(fabs(eta) <= 1.4){
-
-    //  Top quarter
-    if(phi < (3 * pi) / 4. && phi >= pi / 4.){
-Ecl_corr = Ecl / (1-0.131 * ((1 / (1 + exp((phi_mod-0.2) * 199.08))) * (1 / (1 + exp((phi_mod-0.2) * (-130.36))))));
+  if ( m_TESModel == egEnergyCorr::es2017_summer_improved ) {
+    
+    double phi_mod = 0;
+    if (phi < 0)
+      phi_mod = fmod(phi, 2 * pi / 16.) + pi / 8.;
+    else
+      phi_mod = fmod(phi, 2 * pi / 16.);
+    
+    //  The correction concerns only the barrel
+    if(fabs(eta) <= 1.37){
+      
+      if(phi< (-7 * pi / 8) && phi> (-1 * pi))
+	Ecl_corr = Ecl / (1-0.1086 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 175.2759))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-189.3612))))));
+      if(phi< (-6 * pi / 8) && phi> (-7 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0596 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 170.8305))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-233.3782))))));
+      if(phi< (-5 * pi / 8) && phi> (-6 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0596 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 147.1451))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-139.3386))))));
+      if(phi< (-4 * pi / 8) && phi> (-5 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0583 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 168.4644))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-246.2897))))));
+      if(phi< (-3 * pi / 8) && phi> (-4 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0530 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 177.6703))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-198.3227))))));
+      if(phi< (-2 * pi / 8) && phi> (-3 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0672 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 145.0693))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-242.1771))))));
+      if(phi< (-1 * pi / 8) && phi> (-2 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0871 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 132.3303))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-166.1833))))));
+      if(phi< (0 * pi / 8) && phi> (-1 * pi / 8))
+	Ecl_corr = Ecl / (1-0.0948 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 127.6780))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-150.0700))))));
+      if(phi< (1 * pi / 8) && phi> (0 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1166 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 172.0679))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-235.3293))))));
+      if(phi< (2 * pi / 8) && phi> (1 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1172 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 190.3524))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-198.9400))))));
+      if(phi< (3 * pi / 8) && phi> (2 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1292 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 158.0540))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-165.3893))))));
+      if(phi< (4 * pi / 8) && phi> (3 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1557 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 162.2793))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-133.5131))))));
+      if(phi< (5 * pi / 8) && phi> (4 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1659 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 180.5270))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-168.5074))))));
+      if(phi< (6 * pi / 8) && phi> (5 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1123 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 128.2277))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-154.4455))))));
+      if(phi< (7 * pi / 8) && phi> (6 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1394 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 192.1216))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-198.0727))))));
+      if(phi< (8 * pi / 8) && phi> (7 * pi / 8))
+	Ecl_corr = Ecl / (1-0.1001 * ((1 / (1 + exp((phi_mod- 2*pi/32.) * 199.1735))) * (1 / (1 + exp((phi_mod- 2*pi/32.) * (-176.4056))))));
     }
-
-    //  Right quarter
-    if(phi < pi / 4. && phi >= -pi / 4.){
-Ecl_corr = Ecl / (1-0.0879 * ((1 / (1 + exp((phi_mod-0.2) * 221.01))) * (1 / (1 + exp((phi_mod-0.2) * (-149.51))))));
+    
+    
+    //  No correction for the EC
+    else{
+      Ecl_corr = Ecl;
     }
-    //  Bottom quarter
-    if(phi < -pi / 4. && phi >= (-3 * pi) / 4.){
-Ecl_corr = Ecl / (1-0.0605 * ((1 / (1 + exp((phi_mod-0.2) * 281.37))) * (1 / (1 + exp((phi_mod-0.2) * (-170.29))))));
+    
+  }
+  
+  else {
+    
+    //  Definitions of module folding into four quarters (top, left, bottom and right)
+    
+    DivInt =  (int) (phi / ((2 * pi) / 16.));
+    double phi_mod = phi - DivInt * (2 * pi / 16.);
+    
+    
+    //  Centring on the intermodule --> phi_mod will now be in [0,0.4]
+    if (phi_mod < 0) phi_mod += pi / 8.;
+    
+    //  The correction concerns only the barrel
+    if(fabs(eta) <= 1.4){
+      
+      //  Top quarter
+      if(phi < (3 * pi) / 4. && phi >= pi / 4.){
+	Ecl_corr = Ecl / (1-0.131 * ((1 / (1 + exp((phi_mod-0.2) * 199.08))) * (1 / (1 + exp((phi_mod-0.2) * (-130.36))))));
+      }
+      
+      //  Right quarter
+      if(phi < pi / 4. && phi >= -pi / 4.){
+	Ecl_corr = Ecl / (1-0.0879 * ((1 / (1 + exp((phi_mod-0.2) * 221.01))) * (1 / (1 + exp((phi_mod-0.2) * (-149.51))))));
+      }
+      //  Bottom quarter
+      if(phi < -pi / 4. && phi >= (-3 * pi) / 4.){
+	Ecl_corr = Ecl / (1-0.0605 * ((1 / (1 + exp((phi_mod-0.2) * 281.37))) * (1 / (1 + exp((phi_mod-0.2) * (-170.29))))));
+      }
+      //  Left quarter
+      if((phi < (-3 * pi) / 4.) || (phi >= (3 * pi) / 4.)){
+	Ecl_corr = Ecl / (1-0.102 * ((1 / (1 + exp((phi_mod-0.2) * 235.37))) * (1 / (1 + exp((phi_mod-0.2) * (-219.04))))));
+      }
     }
-    //  Left quarter
-    if((phi < (-3 * pi) / 4.) || (phi >= (3 * pi) / 4.)){
-Ecl_corr = Ecl / (1-0.102 * ((1 / (1 + exp((phi_mod-0.2) * 235.37))) * (1 / (1 + exp((phi_mod-0.2) * (-219.04))))));
+    
+    //  No correction for the EC
+    else{
+      Ecl_corr = Ecl;
     }
   }
-
-  //  No correction for the EC
-  else{
-    Ecl_corr = Ecl;
-  }
-
+  
   return Ecl_corr;
-
+  
 }
 
-
-
 double EgammaCalibrationAndSmearingTool::correction_phi_unif(double eta, double phi) const
 {
   const double PI = 3.141592653589793;  // TODO: move to M_PI from cmath with #define _USE_MATH_DEFINES
@@ -1047,44 +1272,95 @@ double EgammaCalibrationAndSmearingTool::correction_phi_unif(double eta, double
       else if (phi < (13 * PI / 32.) && phi > (12 * PI / 32.)) { Fcorr -= 0.035; }
     }
   }
+  
+  if ( m_TESModel == egEnergyCorr::es2017_summer_improved ) {
+
+    if(eta < 0.2 && eta > 0.) {
+      if (phi < (-7 * 2 * PI / 32.) && phi > (-8 * 2 * PI / 32.)) { Fcorr = 1.016314; }
+    } 
+    
+    else if (eta < 0.6 && eta > 0.4) {
+      if (phi < 0 && phi > (-2 * PI / 32.)) { Fcorr = 1.041591; }
+      else if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) { Fcorr = 1.067346; }
+    }
+    
+    else if (eta < 0.8 && eta > 0.6) {
+      if (phi < (7 * 2 * PI / 32.) && phi > (6 * 2 * PI / 32.)) { Fcorr = 1.027980; }
+    }
+    
+    else if (eta < 1.4 && eta > 1.2) {
+      if (phi < (-9 * 2 * PI / 32.) && phi > (-10 * 2 * PI / 32.)) { Fcorr = 1.020299; }
+      else if (phi < (-11 * 2 * PI / 32.) && phi > (-12 * 2 * PI / 32.)) { Fcorr = 1.051426; }
+    }
+    
+    else if (eta < 2.3 && eta > 2.1) {
+      if (phi < (-12 * 2 * PI / 32.) && phi > (-13 * 2 * PI / 32.)) { Fcorr = 1.071695; }
+    }
+    
+    else if(eta < 0. && eta > -0.2) {
+      if (phi < (-12 * 2 * PI / 32.) && phi > (-13 * 2 * PI / 32.)) { Fcorr = 1.008227; }
+      else if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) { Fcorr = 1.013929; }
+    }
+    
+    else if(eta < -0.2 && eta > -0.4) {
+      if (phi < (-9 * 2 * PI / 32.) && phi > (-10 * 2 * PI / 32.)) { Fcorr = 1.015749; }
+    }
+    
+    else if(eta < -1.2 && eta > -1.4) {
+      if (phi < (-6 * 2 * PI / 32.) && phi > (-7 * 2 * PI / 32.)) { Fcorr = 1.064954; }
+    }
+    
+    else if (eta < -1.6 && eta > -1.8 ) {
+      if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.027448; }
+    }
+    
+    else if(eta < -2.3 && eta > -2.5) {
+      if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) { Fcorr = 1.025882; }
+      else if (phi < (5 * 2 * PI / 32.) && phi > (4 * 2 * PI / 32.)) { Fcorr = 1.036616; }
+      else if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.053838; }
+      else if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) { Fcorr = 1.026856; }
+      else if (phi < (11 * 2 * PI / 32.) && phi > (10 * 2 * PI / 32.)) { Fcorr = 0.994382; }
+    }
+    
+  } // es2017_summer_improved end
+  
+  else{
+    if (eta < 0.6 && eta > 0.4) {
+      if (phi < 0 && phi > (-2 * PI / 32.)) { Fcorr = 1.028; }
+      else if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) { Fcorr = 1.044; }
+    }
 
-  if (eta < 0.6 && eta > 0.4) {
-    if (phi < 0 && phi > (-2 * PI / 32.)) { Fcorr = 1.028; }
-    else if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) { Fcorr = 1.044; }
-  }
-
-  else if (eta < 0.8 && eta > 0.6) {
-    if (phi < (7 * 2 * PI / 32.) && phi > (6 * 2 * PI / 32.)) { Fcorr = 1.022; }
-  }
+    else if (eta < 0.8 && eta > 0.6) {
+      if (phi < (7 * 2 * PI / 32.) && phi > (6 * 2 * PI / 32.)) { Fcorr = 1.022; }
+    }
 
-  else if (eta < 1.4 && eta > 1.2) {
-    if (phi < (-11 * 2 * PI / 32.) && phi > (-12 * 2 * PI / 32.)) { Fcorr = 1.038; }
-  }
+    else if (eta < 1.4 && eta > 1.2) {
+      if (phi < (-11 * 2 * PI / 32.) && phi > (-12 * 2 * PI / 32.)) { Fcorr = 1.038; }
+    }
 
-  else if (eta < 2.0 && eta > 1.9 ) {
-    if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) { Fcorr = 1.029; }
-  }
+    else if (eta < 2.0 && eta > 1.9 ) {
+      if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) { Fcorr = 1.029; }
+    }
 
-  else if(eta < -1.2 && eta > -1.4) {
-    if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) { Fcorr = 1.048; }
-    else if (phi < (-6 * 2 * PI / 32.) && phi > (-7 * 2 * PI / 32.)) { Fcorr = 1.048; }
-  }
+    else if(eta < -1.2 && eta > -1.4) {
+      if (phi < (-4 * 2 * PI / 32.) && phi > (-5 * 2 * PI / 32.)) { Fcorr = 1.048; }
+      else if (phi < (-6 * 2 * PI / 32.) && phi > (-7 * 2 * PI / 32.)) { Fcorr = 1.048; }
+    }
 
-  else if (eta < -1.6 && eta > -1.8 ) {
-    if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.024; }
-  }
+    else if (eta < -1.6 && eta > -1.8 ) {
+      if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.024; }
+    }
 
-  else if(eta < -2.3 && eta > -2.5) {
-    if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) { Fcorr = 1.037; }
-    else if (phi < (5 * 2 * PI / 32.) && phi > (4 * 2 * PI / 32.)) { Fcorr = 1.031; }
-    else if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.040; }
-    else if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) { Fcorr = 1.030; }
-    else if (phi < (11 * 2 * PI / 32.) && phi > (10 * 2 * PI / 32.)) { Fcorr = 1.020; }
+    else if(eta < -2.3 && eta > -2.5) {
+      if (phi < (-8 * 2 * PI / 32.) && phi > (-9 * 2 * PI / 32.)) { Fcorr = 1.037; }
+      else if (phi < (5 * 2 * PI / 32.) && phi > (4 * 2 * PI / 32.)) { Fcorr = 1.031; }
+      else if (phi < (9 * 2 * PI / 32.) && phi > (8 * 2 * PI / 32.)) { Fcorr = 1.040; }
+      else if (phi < (10 * 2 * PI / 32.) && phi > (9 * 2 * PI / 32.)) { Fcorr = 1.030; }
+      else if (phi < (11 * 2 * PI / 32.) && phi > (10 * 2 * PI / 32.)) { Fcorr = 1.020; }
+    }
   }
-
+  
   return Fcorr;
 }
 
-
-
 } // namespace CP
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaFactory.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaFactory.cxx
index 19bb7c80a4dbee6d1b598d65f9b5b31e76776da3..35ae16b405346a6e434b967b83eb0899ae42c03d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaFactory.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/EgammaFactory.cxx
@@ -67,12 +67,10 @@ EgammaFactory::EgammaFactory()
 {
   create_structure();
 
-  ATH_MSG_DEBUG("opening average file");
-  std::string fpath = "$ROOTCOREBIN/data/ElectronPhotonFourMomentumCorrection/average_layers.root";
-  TFile *f = TFile::Open(fpath.c_str());
+  TFile *f = TFile::Open( PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/average_layers.root").c_str(), "READ" );
   if (not f)
   {
-    ATH_MSG_ERROR("cannot open file " << fpath);
+    ATH_MSG_ERROR("cannot open file " << PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/average_layers.root").c_str() );
   }
   else { m_fave.reset(f); }
   m_histos_electron = std::array<TProfile2D*, 4> {
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainTool.cxx
index 68600afdf1380764eb0d64b149e81c709699b549..0305c41717c8082df5faada78372a5e5d28e561d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainTool.cxx
@@ -144,14 +144,14 @@ namespace egGain {
     double eta_high[28] = {-2.32,-2.22,-2.12,-2.02,-1.92,-1.82,-1.72,-1.62,-1.52,-1.2,-0.8,-0.6,-0.4,0,0.4,0.6,0.8,1.2,1.37,1.62,1.72,1.82,1.92,2.02,2.12,2.22,2.32,2.4};
 
 
-    double m_diffES[28] = {-0.0763457,0.198092,-0.0288093,-0.0808452,0.0271571,-0.0975428,-0.0164521,-0.0737317,0.136447,0.0352632,-0.00197711,0.0244447,-0.0641183,0.0810265,
+    double diffES[28] = {-0.0763457,0.198092,-0.0288093,-0.0808452,0.0271571,-0.0975428,-0.0164521,-0.0737317,0.136447,0.0352632,-0.00197711,0.0244447,-0.0641183,0.0810265,
 			   0.00735352,-0.013568,-0.0169185,-0.0142155,-0.0255637,0.0586014,-0.163098,0.0237162,-0.0690589,-0.0346536,-0.0886648,-0.0914096,0.0738988,-0.0376201};
 
 
-    double m_corrHG[28] = {-0.484364,0.263687,-0.037742,-0.0553371,-0.0640682,-0.201265,-0.176052,-0.206764,0.0224639,0.00855262,-0.00583258,0.00196343,-0.108951,0.0708467,
+    double corrHG[28] = {-0.484364,0.263687,-0.037742,-0.0553371,-0.0640682,-0.201265,-0.176052,-0.206764,0.0224639,0.00855262,-0.00583258,0.00196343,-0.108951,0.0708467,
 			   -0.00438541,-0.0928867,-0.0487188,-0.0214743,-0.0619355,-0.055117,-0.297427,-0.0795861,-0.173311,-0.0905191,-0.297548,-0.147814,-0.0867268,-0.384337};
 
-    double m_corrMG[28]={-0.0160707,0.199527,-0.000845413,-0.0611091,0.0877896,0.0479742,0.141414,0.639507,0.72873,0.21984,0.0643192,0.146518,0.0279768,0.140151,0.0682126,
+    double corrMG[28]={-0.0160707,0.199527,-0.000845413,-0.0611091,0.0877896,0.0479742,0.141414,0.639507,0.72873,0.21984,0.0643192,0.146518,0.0279768,0.140151,0.0682126,
 			 0.167472,0.154887,0.122343,0.212282,0.657224,0.576652,0.135954,0.0798118,0.0167071,-0.0221686,-0.0398211,0.128146,-0.0226478};
 
     double range_energy[28]={195.,180.,175.,160.,140.,145.,155.,155.,145.,140.,120.,90.,90.,75.,75.,90.,90.,120.,140.,145.,155.,155.,145.,140.,160.,175.,180.,195.};
@@ -262,7 +262,7 @@ namespace egGain {
       valTO=0;
     }
 
-    corrE = -2 * energy_input* (((m_corrMG[id_eta]/91.2) - (m_diffES[id_eta]/91.2))*valTO*corrM_G + ((m_corrHG[id_eta]/91.2) - (m_diffES[id_eta]/91.2))*(1-valTO));
+    corrE = -2 * energy_input* (((corrMG[id_eta]/91.2) - (diffES[id_eta]/91.2))*valTO*corrM_G + ((corrHG[id_eta]/91.2) - (diffES[id_eta]/91.2))*(1-valTO));
     energy_output = (energy_input+corrE)*1000.;
     return energy_output;
   }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainUncertainty.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainUncertainty.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..e5cf54659ae047a8baef6fb266c8a4f129cc62dd
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/GainUncertainty.cxx
@@ -0,0 +1,87 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <ElectronPhotonFourMomentumCorrection/GainUncertainty.h>
+#include "CxxUtils/make_unique.h"
+#include "PathResolver/PathResolver.h"
+#include <TH1F.h>
+#include <TH1D.h>
+#include <TFile.h>
+#include <iostream>
+
+
+namespace egGain {
+
+
+//--------------------------------------
+
+  GainUncertainty::GainUncertainty(std::string filename) : asg::AsgMessaging("GainUncertainty") {
+    
+    ATH_MSG_INFO("opening file " << filename);
+    m_gainFile = CxxUtils::make_unique<TFile>(filename.c_str());
+
+    if (not (m_alpha_specialGainRun = (TH1F*)(m_gainFile->Get("alpha_specialGainRun")))) ATH_MSG_FATAL("cannot open histogram1");
+    if (not (m_gain_impact_Zee = (TH1F*)(m_gainFile->Get("gain_impact_Zee")))) ATH_MSG_FATAL("cannot open histogram2");
+    for (int i=0;i<m_NUM_ETA_BINS;i++) {
+     char name[60];
+     sprintf(name,"gain_Impact_elec_%d",i);
+     if (not (m_gain_Impact_elec[i] = (TH1D*)(m_gainFile->Get(name)))) ATH_MSG_FATAL("cannot open histogram3");
+     sprintf(name,"gain_Impact_conv_%d",i);
+     if (not (m_gain_Impact_conv[i] = (TH1D*)(m_gainFile->Get(name)))) ATH_MSG_FATAL("cannot open histogram4");
+     sprintf(name,"gain_Impact_unco_%d",i);
+     if (not (m_gain_Impact_unco[i]= (TH1D*)(m_gainFile->Get(name)))) ATH_MSG_FATAL("cannot open histogram5");
+    }
+    
+  }
+
+//----------------------------------------------
+
+  GainUncertainty::~GainUncertainty() {
+      delete m_alpha_specialGainRun;
+      delete m_gain_impact_Zee;
+      for (int i=0;i<m_NUM_ETA_BINS;i++) {
+        delete m_gain_Impact_elec[i];
+        delete m_gain_Impact_conv[i];
+        delete m_gain_Impact_unco[i];
+      }
+  }
+
+//----------------------------------------------
+
+    // returns relative uncertainty on energy
+
+  double GainUncertainty::getUncertainty(double etaCalo_input, double et_input,  PATCore::ParticleType::Type ptype) const {
+       double aeta=std::fabs(etaCalo_input);
+       int ibin=-1;
+       if (aeta<0.8) ibin=0;
+       else if (aeta<1.37) ibin=1;
+       else if (aeta<1.52) ibin=2;
+       else if (aeta<1.80) ibin=3;
+       else if (aeta<2.50) ibin=4;
+       if (ibin<0) return 0.;
+       
+       //Protection needed as the histograms stops at 1 TeV
+       if(et_input>999999.) et_input = 999999.;
+       
+//       std::cout << " --- in  GainUncertainty::getUncertainty " << etaCalo_input << " " << et_input << " " << ptype << " ibin " << ibin << std::endl;
+
+       double impact=0.;
+       if (ptype==PATCore::ParticleType::Electron) impact = m_gain_Impact_elec[ibin]->GetBinContent(m_gain_Impact_elec[ibin]->FindFixBin(0.001*et_input));
+       if (ptype==PATCore::ParticleType::ConvertedPhoton) impact = m_gain_Impact_conv[ibin]->GetBinContent(m_gain_Impact_conv[ibin]->FindFixBin(0.001*et_input));
+       if (ptype==PATCore::ParticleType::UnconvertedPhoton) impact = m_gain_Impact_unco[ibin]->GetBinContent(m_gain_Impact_unco[ibin]->FindFixBin(0.001*et_input));
+
+//       std::cout << " impact " << impact << std::endl;
+       double_t sigmaE = m_alpha_specialGainRun->GetBinContent(m_alpha_specialGainRun->FindFixBin(aeta))
+                        /m_gain_impact_Zee->GetBinContent(m_gain_impact_Zee->FindFixBin(aeta))
+                        *impact ;
+
+//       std::cout << " m_alpha_specialGainRun, m_gain_impact_Zee, impact , sigmaE " << m_alpha_specialGainRun->GetBinContent(m_alpha_specialGainRun->FindBin(aeta))
+//  << " " << m_gain_impact_Zee->GetBinContent(m_gain_impact_Zee->FindBin(aeta)) << " " << impact << " " << sigmaE << std::endl;
+
+       return sigmaE;
+
+  }
+
+
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/e1hg_systematics.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/e1hg_systematics.cxx
index afd7314d53b331ca3193f050246ab736ea64303a..6864be8740e34ae5c1d0782c885272e524609428 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/e1hg_systematics.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/e1hg_systematics.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "ElectronPhotonFourMomentumCorrection/e1hg_systematics.h"
-
+#include "PathResolver/PathResolver.h"
 #include <stdlib.h>
 #include <math.h>
 
@@ -16,33 +16,30 @@
 
 e1hg_systematics::e1hg_systematics()
 {
-  
-#ifdef ROOTCORE
-  file0 = TFile::Open("$ROOTCOREBIN/data/ElectronPhotonFourMomentumCorrection/e1hg_systematics_histos.root");
-#else
-  file0 = TFile::Open( PathResolver::find_file("ElectronPhotonFourMomentumCorrection/e1hg_systematics_histos.root", "XMLPATH").c_str() );
-#endif
+
+  m_file0 = TFile::Open( PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/e1hg_systematics_histos.root").c_str() );
+
 
   for (Int_t ieta=0;ieta<8;ieta++) {
      char name[60];
      sprintf(name,"elec_%d",ieta);
-     helec[ieta] = (TH1D*) file0->Get(name);
+     m_helec[ieta] = (TH1D*) m_file0->Get(name);
      sprintf(name,"unconv_%d",ieta);
-     hphot[ieta] = (TH1D*) file0->Get(name);
+     m_hphot[ieta] = (TH1D*) m_file0->Get(name);
      sprintf(name,"conv_%d",ieta);
-     hphot2[ieta] = (TH1D*) file0->Get(name);
+     m_hphot2[ieta] = (TH1D*) m_file0->Get(name);
 
   }
 
-  TAxis* aa=helec[0]->GetXaxis();
-  etBins = aa->GetXbins();
+  TAxis* aa=m_helec[0]->GetXaxis();
+  m_etBins = aa->GetXbins();
 
 }
 
 //=========================================================================
 e1hg_systematics::~e1hg_systematics()
 {
-  file0->Close();
+  m_file0->Close();
 }
 
 //============================================================================
@@ -52,7 +49,7 @@ e1hg_systematics::~e1hg_systematics()
 //
 // returned value is alpha = DeltaE / E
 //
-double e1hg_systematics::getAlpha(int particle_type, double energy, double eta, bool interpolate) const 
+double e1hg_systematics::getAlpha(int particle_type, double energy, double eta, bool interpolate) const
 {
 
    //cout << " in getDelta " << endl;
@@ -73,9 +70,9 @@ double e1hg_systematics::getAlpha(int particle_type, double energy, double eta,
    double energyGeV = energy*0.001;
    double et = energyGeV/cosh(eta);
 
-   int ibinEt=etBins->GetSize()-2;
-   for (int i=1;i<etBins->GetSize();i++) {
-      if (et<etBins->GetAt(i)) {
+   int ibinEt=m_etBins->GetSize()-2;
+   for (int i=1;i<m_etBins->GetSize();i++) {
+      if (et<m_etBins->GetAt(i)) {
          ibinEt=i-1;
          break;
       }
@@ -84,18 +81,25 @@ double e1hg_systematics::getAlpha(int particle_type, double energy, double eta,
 //   cout << " energy, et , ibinEt " << energyGeV << " " << et << " " << ibinEt << endl;
 
    Double_t scale=0.;
+   //HACK: some ES model dependency needs to be introduced
+   /*Default up to es2017_summer
+     if (aeta<1.80) scale=0.;
+     else if (aeta<2.3) scale = 0.050*(aeta-1.8)/0.4 /0.05;
+     else scale=0.025/0.05;
+   */
+
    if (aeta<1.80) scale=0.;
-   else if (aeta<2.3) scale = 0.050*(aeta-1.8)/0.4 /0.05;
-   else scale=0.025/0.05;
- 
+   else if (aeta<2.3) scale = (0.050*(aeta-1.8)/0.4+0.025)/0.05;
+   else scale = 0.05/0.05;
+   
    if( !interpolate ) {
-     if (particle_type==0) return scale*helec[ieta]->GetBinContent(ibinEt+1);
-     else if (particle_type==1) return scale*hphot[ieta]->GetBinContent(ibinEt+1);
-     else  return scale*hphot2[ieta]->GetBinContent(ibinEt+1); //This is 2, since if particle_type is not 0,1,2 we have returned 0 above
+     if (particle_type==0) return scale*m_helec[ieta]->GetBinContent(ibinEt+1);
+     else if (particle_type==1) return scale*m_hphot[ieta]->GetBinContent(ibinEt+1);
+     else  return scale*m_hphot2[ieta]->GetBinContent(ibinEt+1); //This is 2, since if particle_type is not 0,1,2 we have returned 0 above
    } else {
-     if (particle_type==0) return scale*helec[ieta]->Interpolate(et);
-     else if (particle_type==1) return scale*hphot[ieta]->Interpolate(et);
-     else  return scale*hphot2[ieta]->Interpolate(et); //This is 2, since if particle_type is not 0,1,2 we have returned 0
+     if (particle_type==0) return scale*m_helec[ieta]->Interpolate(et);
+     else if (particle_type==1) return scale*m_hphot[ieta]->Interpolate(et);
+     else  return scale*m_hphot2[ieta]->Interpolate(et); //This is 2, since if particle_type is not 0,1,2 we have returned 0
    }
 
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx
index 62d2c72027e2d0e98564a21d2d158043d0b14ae7..3ebfe6d17d75e0f88d74d11a93e04ddf7cac8e43 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/egammaEnergyCorrectionTool.cxx
@@ -13,12 +13,15 @@
 #include <ios>
 
 #include <boost/format.hpp>
+#include "CxxUtils/make_unique.h"
 
 #include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h"
 #include "ElectronPhotonFourMomentumCorrection/GainTool.h"
 #include "ElectronPhotonFourMomentumCorrection/eg_resolution.h"
 #include "ElectronPhotonFourMomentumCorrection/get_MaterialResolutionEffect.h"
 #include "ElectronPhotonFourMomentumCorrection/e1hg_systematics.h"
+#include "ElectronPhotonFourMomentumCorrection/GainUncertainty.h"
+
 
 #include "PathResolver/PathResolver.h"
 
@@ -33,20 +36,27 @@ T* get_object(TFile& file, const std::string& name)
 }
 
 inline double getValueHistoAt(const TH1& histo, double xvalue,
-			      bool use_lastbin_overflow=false)
+			      bool use_lastbin_overflow=false,
+                              bool use_firstbin_underflow=false)
 {
   int bin = histo.FindFixBin(xvalue);
   if (use_lastbin_overflow and histo.IsBinOverflow(bin)) { bin = histo.GetNbinsX(); }
+  if (use_firstbin_underflow and histo.IsBinUnderflow(bin)) { bin = 1; }
   return histo.GetBinContent(bin);
 }
 
 inline double getValueHistAt(const TH2& histo, double xvalue, double yvalue,
-			     bool use_lastbin_x_overflow=false, bool use_lastbin_y_overflow=false)
+			     bool use_lastbin_x_overflow=false,
+                             bool use_lastbin_y_overflow=false,
+                             bool use_fistbin_x_underflow=false,
+                             bool use_firstbin_y_underflow=false)
 {
   int xbin = histo.GetXaxis()->FindFixBin(xvalue);
   if (use_lastbin_x_overflow and xbin == histo.GetXaxis()->GetNbins() + 1) { xbin = histo.GetXaxis()->GetNbins(); }
+  if (use_fistbin_x_underflow and xbin == 0) { xbin = 1; }
   int ybin = histo.GetYaxis()->FindFixBin(yvalue);
   if (use_lastbin_y_overflow and ybin == histo.GetYaxis()->GetNbins() + 1) { ybin = histo.GetYaxis()->GetNbins(); }
+  if (use_firstbin_y_underflow and ybin == 0) { ybin = 1; }
   return histo.GetBinContent(xbin, ybin);
 }
 
@@ -60,15 +70,15 @@ namespace AtlasRoot {
     m_esmodel(egEnergyCorr::UNDEFINED)
   {
 
-    m_rootFile = 0;
-
-    m_rootFileName = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v7/egammaEnergyCorrectionData.root");
+    m_rootFile = nullptr;
 
+    m_rootFileName = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v13/egammaEnergyCorrectionData.root");
+    
     if (m_rootFileName.empty()) {
       ATH_MSG_FATAL("cannot find configuration file");
       throw std::runtime_error("cannot find file");
     }
-
+    
     m_begRunNumber = 0;
     m_endRunNumber = 0;
 
@@ -124,6 +134,8 @@ namespace AtlasRoot {
     m_pedestalL2 = nullptr;
     m_pedestalL3 = nullptr;
 
+    m_pedestals_es2017 = nullptr;
+
     m_convRadius = nullptr;
     m_convFakeRate = nullptr;
     m_convRecoEfficiency = nullptr;
@@ -142,6 +154,8 @@ namespace AtlasRoot {
     m_G4OverAFII_resolution_unconverted = nullptr;
     m_G4OverAFII_resolution_converted = nullptr;
 
+    m_pp0_elec = m_pp0_conv = m_pp0_unconv = nullptr;
+
     m_G4OverFrSh = nullptr;
 
     m_use_new_resolution_model = false;
@@ -149,6 +163,7 @@ namespace AtlasRoot {
     // tools
 
     m_gain_tool = nullptr;
+    m_gain_tool_run2 = nullptr;
     m_resolution_tool = nullptr;
     m_getMaterialDelta = nullptr;
     m_e1hg_tool = nullptr;
@@ -179,6 +194,7 @@ namespace AtlasRoot {
     if ( m_rootFile )                   delete m_rootFile;
 
     if ( m_gain_tool )                  delete m_gain_tool;
+    if ( m_gain_tool_run2 )             delete m_gain_tool_run2;
     if ( m_e1hg_tool )                  delete m_e1hg_tool;
     if ( m_resolution_tool )            delete m_resolution_tool;
     if ( m_getMaterialDelta)            delete m_getMaterialDelta;
@@ -213,7 +229,14 @@ namespace AtlasRoot {
     if ( m_G4OverAFII_resolution_unconverted )     delete m_G4OverAFII_resolution_unconverted;
     if ( m_G4OverFrSh )                 delete m_G4OverFrSh;
     if ( m_matElectronEtaBins )         delete m_matElectronEtaBins;
-
+    delete m_pp0_elec;
+    delete m_pp0_conv;
+    delete m_pp0_unconv;
+    delete m_pedestalL0;
+    delete m_pedestalL1;
+    delete m_pedestalL2;
+    delete m_pedestalL3;
+    delete m_pedestals_es2017;
   }
 
 
@@ -355,8 +378,8 @@ namespace AtlasRoot {
       m_endRunNumber = 194382;
 
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -426,8 +449,8 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -477,8 +500,8 @@ namespace AtlasRoot {
       m_endRunNumber = 219365;
 
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -528,12 +551,9 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string filename_AFII_2015_resolution = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/res_Full_AFII.root");
-      std::unique_ptr<TFile> file_AFII_2015_resolution(TFile::Open(filename_AFII_2015_resolution.c_str()));
-
-      m_G4OverAFII_resolution_electron = (TH2F*)file_AFII_2015_resolution->Get("el_full_fast_resolution");
-      m_G4OverAFII_resolution_unconverted = (TH2F*)file_AFII_2015_resolution->Get("ph_unconv_full_fast_resolution");
-      m_G4OverAFII_resolution_converted = (TH2F*)file_AFII_2015_resolution->Get("ph_conv_full_fast_resolution");
+      m_G4OverAFII_resolution_electron = (TH2F*)m_rootFile->Get("FastSim/es2015/el_full_fast_resolution");
+      m_G4OverAFII_resolution_unconverted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution");
+      m_G4OverAFII_resolution_converted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution");
 
       assert(m_G4OverAFII_resolution_electron);
       assert(m_G4OverAFII_resolution_unconverted);
@@ -543,8 +563,8 @@ namespace AtlasRoot {
       m_G4OverAFII_resolution_unconverted->SetDirectory(0);
       m_G4OverAFII_resolution_converted->SetDirectory(0);
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -595,12 +615,9 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string filename_AFII_2015_resolution = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/res_Full_AFII.root");
-      std::unique_ptr<TFile> file_AFII_2015_resolution(TFile::Open(filename_AFII_2015_resolution.c_str()));
-
-      m_G4OverAFII_resolution_electron = (TH2F*)file_AFII_2015_resolution->Get("el_full_fast_resolution");
-      m_G4OverAFII_resolution_unconverted = (TH2F*)file_AFII_2015_resolution->Get("ph_unconv_full_fast_resolution");
-      m_G4OverAFII_resolution_converted = (TH2F*)file_AFII_2015_resolution->Get("ph_conv_full_fast_resolution");
+      m_G4OverAFII_resolution_electron = (TH2F*)m_rootFile->Get("FastSim/es2015/el_full_fast_resolution");
+      m_G4OverAFII_resolution_unconverted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution");
+      m_G4OverAFII_resolution_converted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution");
 
       assert(m_G4OverAFII_resolution_electron);
       assert(m_G4OverAFII_resolution_unconverted);
@@ -610,8 +627,8 @@ namespace AtlasRoot {
       m_G4OverAFII_resolution_unconverted->SetDirectory(0);
       m_G4OverAFII_resolution_converted->SetDirectory(0);
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -662,12 +679,9 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string filename_AFII_2015_resolution = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/res_Full_AFII.root");
-      std::unique_ptr<TFile> file_AFII_2015_resolution(TFile::Open(filename_AFII_2015_resolution.c_str()));
-
-      m_G4OverAFII_resolution_electron = (TH2F*)file_AFII_2015_resolution->Get("el_full_fast_resolution");
-      m_G4OverAFII_resolution_unconverted = (TH2F*)file_AFII_2015_resolution->Get("ph_unconv_full_fast_resolution");
-      m_G4OverAFII_resolution_converted = (TH2F*)file_AFII_2015_resolution->Get("ph_conv_full_fast_resolution");
+      m_G4OverAFII_resolution_electron = (TH2F*)m_rootFile->Get("FastSim/es2015/el_full_fast_resolution");
+      m_G4OverAFII_resolution_unconverted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution");
+      m_G4OverAFII_resolution_converted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution");
 
       assert(m_G4OverAFII_resolution_electron);
       assert(m_G4OverAFII_resolution_unconverted);
@@ -677,8 +691,8 @@ namespace AtlasRoot {
       m_G4OverAFII_resolution_unconverted->SetDirectory(0);
       m_G4OverAFII_resolution_converted->SetDirectory(0);
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -731,12 +745,9 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string filename_AFII_2015_resolution = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/res_Full_AFII.root");
-      std::unique_ptr<TFile> file_AFII_2015_resolution(TFile::Open(filename_AFII_2015_resolution.c_str()));
-
-      m_G4OverAFII_resolution_electron = (TH2F*)file_AFII_2015_resolution->Get("el_full_fast_resolution");
-      m_G4OverAFII_resolution_unconverted = (TH2F*)file_AFII_2015_resolution->Get("ph_unconv_full_fast_resolution");
-      m_G4OverAFII_resolution_converted = (TH2F*)file_AFII_2015_resolution->Get("ph_conv_full_fast_resolution");
+      m_G4OverAFII_resolution_electron = (TH2F*)m_rootFile->Get("FastSim/es2015/el_full_fast_resolution");
+      m_G4OverAFII_resolution_unconverted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_unconv_full_fast_resolution");
+      m_G4OverAFII_resolution_converted = (TH2F*)m_rootFile->Get("FastSim/es2015/ph_conv_full_fast_resolution");
 
       assert(m_G4OverAFII_resolution_electron);
       assert(m_G4OverAFII_resolution_unconverted);
@@ -746,8 +757,8 @@ namespace AtlasRoot {
       m_G4OverAFII_resolution_unconverted->SetDirectory(0);
       m_G4OverAFII_resolution_converted->SetDirectory(0);
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -755,10 +766,155 @@ namespace AtlasRoot {
       m_use_temp_correction201516 = true;
     }
 
+    else if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) {//add release 21 here for now
+      m_use_etaCalo_scales = true;
+      m_use_new_resolution_model = true;
+      m_resolution_tool = new eg_resolution("run2_pre");
 
+      m_aPSNom       = (TH1D*) m_rootFile->Get("Scales/es2012c/alphaPS_uncor");                 m_aPSNom->SetDirectory(0);
+      m_daPSCor      = (TH1D*) m_rootFile->Get("Scales/es2012c/dalphaPS_cor");                  m_daPSCor->SetDirectory(0);
+      m_aS12Nom      = (TH1D*) m_rootFile->Get("Scales/es2012c/alphaS12_uncor");                m_aS12Nom->SetDirectory(0);
+      m_daS12Cor     = (TH1D*) m_rootFile->Get("Scales/es2012c/dalphaS12_cor");                 m_daS12Cor->SetDirectory(0);
 
+      m_trkSyst      = (TH1D*) m_rootFile->Get("Scales/es2012c/momentum_errSyst");              m_trkSyst->SetDirectory(0);
+      
+      if(m_esmodel == egEnergyCorr::es2017){
+      m_zeeNom       = (TH1D*) m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2016");         m_zeeNom->SetDirectory(0);
+      m_zeeNom_data2015 = (TH1D*) m_rootFile->Get("Scales/es2017/alphaZee_errStat_period_2015");      m_zeeNom_data2015->SetDirectory(0);
+      }
+      else if(m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved){
+	m_zeeNom       = (TH1D*) m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2016");         m_zeeNom->SetDirectory(0); 
+	m_zeeNom_data2015 = (TH1D*) m_rootFile->Get("Scales/es2017_summer/alphaZee_errStat_period_2015");      m_zeeNom_data2015->SetDirectory(0);
+      }
+      else{
+	m_zeeNom       = (TH1D*) m_rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016");         m_zeeNom->SetDirectory(0);  
+        //SAME HISTO FOR 2015 FOR NOW
+	m_zeeNom_data2015 = (TH1D*) m_rootFile->Get("Scales/es2017_R21_PRE/alphaZee_errStat_period_2016");      m_zeeNom_data2015->SetDirectory(0);
+      }
+      if(m_esmodel == egEnergyCorr::es2017){
+	m_zeeSyst      = (TH1D*) m_rootFile->Get("Scales/es2017/alphaZee_errSyst");         m_zeeSyst->SetDirectory(0);
+      }
+      //else if(m_esmodel == egEnergyCorr::es2017_summer_improved){
+      //m_zeeSyst      = (TH1D*) m_rootFile->Get("Scales/es2017_summer_improved/alphaZee_errSyst");         m_zeeSyst->SetDirectory(0);
+      //}
+      else{
+	m_zeeSyst      = (TH1D*) m_rootFile->Get("Scales/es2017_summer/alphaZee_errSyst");         m_zeeSyst->SetDirectory(0);
+      }
+      
+      m_uA2MeV_2015_first2weeks_correction = nullptr;
+      if(m_esmodel == egEnergyCorr::es2017){
+	m_resNom       = (TH1D*) m_rootFile->Get("Resolution/es2017/ctZee_errStat");        m_resNom->SetDirectory(0);
+      }
+      else if(m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved){
+	m_resNom       = (TH1D*) m_rootFile->Get("Resolution/es2017_summer/ctZee_errStat");        m_resNom->SetDirectory(0);
+      }
+      else{
+	m_resNom       = (TH1D*) m_rootFile->Get("Resolution/es2017_R21_PRE/ctZee_errStat");        m_resNom->SetDirectory(0); 
+      }
+      if(m_esmodel == egEnergyCorr::es2017){
+	m_resSyst      = (TH1D*) m_rootFile->Get("Resolution/es2017/ctZee_errSyst");        m_resSyst->SetDirectory(0);
+      }
+      else{ 
+	m_resSyst      = (TH1D*) m_rootFile->Get("Resolution/es2017_summer/ctZee_errSyst");        m_resSyst->SetDirectory(0);
+      }
+      //else{
+      //m_resSyst      = (TH1D*) m_rootFile->Get("Resolution/es2017_summer_improved/ctZee_errSyst");        m_resSyst->SetDirectory(0);
+      //}
+      
+      m_pedestals_es2017 = get_object<TH1F>(*m_rootFile, "Pedestals/es2017/pedestals");          m_pedestals_es2017->SetDirectory(0);
+
+      m_dX_ID_Nom    = (TH1D*) m_rootFile->Get("Material/DX0_ConfigA");                         m_dX_ID_Nom->SetDirectory(0);
 
+      m_dX_IPPS_Nom  = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errUncor");   m_dX_IPPS_Nom->SetDirectory(0);
+      m_dX_IPPS_LAr  = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPPS_NewG_errLAr");     m_dX_IPPS_LAr->SetDirectory(0);
+
+      m_dX_IPAcc_Nom = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errUncor");  m_dX_IPAcc_Nom->SetDirectory(0);
+      m_dX_IPAcc_LAr = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errLAr");    m_dX_IPAcc_LAr->SetDirectory(0);
+      m_dX_IPAcc_G4  = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errG4");     m_dX_IPAcc_G4->SetDirectory(0);
+      m_dX_IPAcc_GL1  = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_IPAcc_NewG_errGL1");    m_dX_IPAcc_GL1->SetDirectory(0);
 
+      m_dX_PSAcc_Nom = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errUncor");  m_dX_PSAcc_Nom->SetDirectory(0);
+      m_dX_PSAcc_LAr = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errLAr");    m_dX_PSAcc_LAr->SetDirectory(0);
+      m_dX_PSAcc_G4  = (TH1D*) m_rootFile->Get("Material/Measured/DXerr_PSAcc_NewG_errG4");     m_dX_PSAcc_G4->SetDirectory(0);
+
+      m_convRadius            = (TH1D*) m_rootFile->Get("Conversions/es2012c/convRadiusMigrations");  m_convRadius->SetDirectory(0);
+      if(m_esmodel == egEnergyCorr::es2017){
+	m_convFakeRate          = (TH1D*) m_rootFile->Get("Conversions/es2012c/convFakeRate");          m_convFakeRate->SetDirectory(0);
+	m_convRecoEfficiency    = (TH1D*) m_rootFile->Get("Conversions/es2012c/convRecoEfficiency");    m_convRecoEfficiency->SetDirectory(0);
+      }
+      else{
+	m_convFakeRate          = (TH1D*) m_rootFile->Get("Conversions/es2017_summer/convFakeRate");          m_convFakeRate->SetDirectory(0); 
+        m_convRecoEfficiency    = (TH1D*) m_rootFile->Get("Conversions/es2017_summer/convRecoEfficiency");    m_convRecoEfficiency->SetDirectory(0);
+      }
+      
+      // TODO: change path when moving to calibarea
+      // TODO: better package this somewhere
+
+      const std::string filename_pp0 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/PP0sys.root");
+      
+      TFile file_pp0(filename_pp0.c_str());
+      m_pp0_elec = get_object<TH2D>(file_pp0, "elec");
+      m_pp0_conv = get_object<TH2D>(file_pp0, "conv");
+      m_pp0_unconv = get_object<TH2D>(file_pp0, "unco");
+
+      m_pp0_elec->SetDirectory(0);
+      m_pp0_unconv->SetDirectory(0);
+      m_pp0_conv->SetDirectory(0);
+
+      //similar case for wtots1
+      const std::string filename_wstot = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/wstot_related_syst.root");
+      
+
+      TFile file_wstot(filename_wstot.c_str());
+      m_wstot_slope_A_data = (TH1D*) file_wstot.Get("A_data"); m_wstot_slope_A_data->SetDirectory(0);
+      m_wstot_slope_B_MC = (TH1D*) file_wstot.Get("B_mc"); m_wstot_slope_B_MC->SetDirectory(0);
+      m_wstot_40GeV_data = (TH1D*) file_wstot.Get("wstot40_data"); m_wstot_40GeV_data->SetDirectory(0);
+      m_wstot_40GeV_MC = (TH1D*) file_wstot.Get("wstot40_mc"); m_wstot_40GeV_MC->SetDirectory(0);
+      m_wstot_pT_data_p0_electrons = (TH1D*) file_wstot.Get("wstot_pT_el_data_p0"); m_wstot_pT_data_p0_electrons->SetDirectory(0);
+      m_wstot_pT_data_p1_electrons = (TH1D*) file_wstot.Get("wstot_pT_el_data_p1"); m_wstot_pT_data_p1_electrons->SetDirectory(0);
+      m_wstot_pT_data_p0_unconverted_photons = (TH1D*) file_wstot.Get("wstot_pT_uc_data_p0"); m_wstot_pT_data_p0_unconverted_photons->SetDirectory(0);
+      m_wstot_pT_data_p1_unconverted_photons = (TH1D*) file_wstot.Get("wstot_pT_uc_data_p1"); m_wstot_pT_data_p1_unconverted_photons->SetDirectory(0);
+      m_wstot_pT_data_p0_converted_photons = (TH1D*) file_wstot.Get("wstot_pT_c_data_p0"); m_wstot_pT_data_p0_converted_photons->SetDirectory(0);
+      m_wstot_pT_data_p1_converted_photons = (TH1D*) file_wstot.Get("wstot_pT_c_data_p1"); m_wstot_pT_data_p1_converted_photons->SetDirectory(0);
+      m_wstot_pT_MC_p0_electrons = (TH1D*) file_wstot.Get("wstot_pT_el_mc_p0"); m_wstot_pT_MC_p0_electrons->SetDirectory(0);
+      m_wstot_pT_MC_p1_electrons = (TH1D*) file_wstot.Get("wstot_pT_el_mc_p1"); m_wstot_pT_MC_p1_electrons->SetDirectory(0);
+      m_wstot_pT_MC_p0_unconverted_photons = (TH1D*) file_wstot.Get("wstot_pT_ph_uc_mc_p0"); m_wstot_pT_MC_p0_unconverted_photons->SetDirectory(0);
+      m_wstot_pT_MC_p1_unconverted_photons = (TH1D*) file_wstot.Get("wstot_pT_ph_uc_mc_p1"); m_wstot_pT_MC_p1_unconverted_photons->SetDirectory(0);
+      m_wstot_pT_MC_p0_converted_photons = (TH1D*) file_wstot.Get("wstot_pT_ph_c_mc_p0"); m_wstot_pT_MC_p0_converted_photons->SetDirectory(0);
+      m_wstot_pT_MC_p1_converted_photons = (TH1D*) file_wstot.Get("wstot_pT_ph_c_mc_p1"); m_wstot_pT_MC_p1_converted_photons->SetDirectory(0);
+
+      m_begRunNumber = 252604;
+      m_endRunNumber = 314199;
+
+      m_G4OverAFII_resolution_electron = (TH2F*)m_rootFile->Get("FastSim/es2017/el_full_fast_resolution");
+      m_G4OverAFII_resolution_unconverted = (TH2F*)m_rootFile->Get("FastSim/es2017/ph_unconv_full_fast_resolution");
+      m_G4OverAFII_resolution_converted = (TH2F*)m_rootFile->Get("FastSim/es2017/ph_conv_full_fast_resolution");
+
+      assert(m_G4OverAFII_resolution_electron);
+      assert(m_G4OverAFII_resolution_unconverted);
+      assert(m_G4OverAFII_resolution_converted);
+
+      m_G4OverAFII_resolution_electron->SetDirectory(0);
+      m_G4OverAFII_resolution_unconverted->SetDirectory(0);
+      m_G4OverAFII_resolution_converted->SetDirectory(0);
+
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
+      m_gain_tool = nullptr;
+
+      std::string gain_tool_run_2_filename;
+      if(m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_R21_PRE){
+	gain_tool_run_2_filename = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v11/gain_uncertainty_specialRun.root"); 
+      }
+      else{
+	gain_tool_run_2_filename = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v12/gain_uncertainty_specialRun.root");
+      }
+      m_gain_tool_run2 = new egGain::GainUncertainty(gain_tool_run_2_filename);
+      
+      m_e1hg_tool = new e1hg_systematics();
+      m_use_temp_correction201215 = false;
+      m_use_temp_correction201516 = false;
+    }
 
     else if ( m_esmodel==egEnergyCorr::es2015_day0_3percent ) {
       m_use_new_resolution_model = true;
@@ -803,8 +959,8 @@ namespace AtlasRoot {
       m_begRunNumber = 195847;
       m_endRunNumber = 219365;
 
-      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsTO.root");
-      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/FunctionsG_all.root");
+      const std::string gain_filename1 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsTO.root");
+      const std::string gain_filename2 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/FunctionsG_all.root");
       m_gain_tool = new egGain::GainTool(gain_filename1, gain_filename2);
 
       m_e1hg_tool = new e1hg_systematics();
@@ -822,7 +978,8 @@ namespace AtlasRoot {
     }
 
     if (m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
-        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE)
+        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017
+	or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE)
     {
       // E4 systematics
       m_E4ElectronEtaBins = get_object<TAxis>(*m_rootFile, "E4Recalibration/v4/electron_eta_axis");
@@ -837,7 +994,8 @@ namespace AtlasRoot {
     // ... PS and S12 recalibration curves
     if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
         m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
-        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) {
+        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017
+	or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) {
 
       m_psElectronEtaBins =          get_object<TAxis>(*m_rootFile, "PSRecalibration/es2015PRE/ElectronAxis");
       m_psElectronGraphs =           get_object<TList>(*m_rootFile, "PSRecalibration/es2015PRE/ElectronBiasPS");
@@ -853,7 +1011,7 @@ namespace AtlasRoot {
       m_s12ConvertedEtaBins =        get_object<TAxis>(*m_rootFile, "S1Recalibration/es2015PRE/ConvertedAxis");
       m_s12ConvertedGraphs =         get_object<TList>(*m_rootFile, "S1Recalibration/es2015PRE/ConvertedBiasS1");
     }
-    else
+    else // run1
     {
       m_psElectronEtaBins =          (TAxis*) m_rootFile->Get("PSRecalibration/ElectronAxis");
       m_psElectronGraphs =           (TList*) m_rootFile->Get("PSRecalibration/ElectronBiasPS");
@@ -910,11 +1068,15 @@ namespace AtlasRoot {
     if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
         m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
         m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) {
-      const std::string filename_AFII_2015 = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/scale_Full_AFII.root");
-      TFile file_AFII_2015(filename_AFII_2015.c_str());
-      m_G4OverAFII_electron = (TH1D*) file_AFII_2015.Get("el_scale_full_fast_peak_gaussian"); m_G4OverAFII_electron->SetDirectory(0);
-      m_G4OverAFII_unconverted = (TH1D*) file_AFII_2015.Get("ph_uncconv_scale_full_fast_peak_gaussian"); m_G4OverAFII_unconverted->SetDirectory(0);
-      m_G4OverAFII_converted = (TH1D*) file_AFII_2015.Get("ph_conv_scale_full_fast_peak_gaussian"); m_G4OverAFII_converted->SetDirectory(0);
+
+      m_G4OverAFII_electron = (TH1D*) m_rootFile->Get("FastSim/es2015/el_scale_full_fast_peak_gaussian"); m_G4OverAFII_electron->SetDirectory(0);
+      m_G4OverAFII_unconverted = (TH1D*) m_rootFile->Get("FastSim/es2015/ph_unconv_scale_full_fast_peak_gaussian"); m_G4OverAFII_unconverted->SetDirectory(0);
+      m_G4OverAFII_converted = (TH1D*) m_rootFile->Get("FastSim/es2015/ph_conv_scale_full_fast_peak_gaussian"); m_G4OverAFII_converted->SetDirectory(0);
+    }
+    else if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) {
+      m_G4OverAFII_electron = (TH1D*) m_rootFile->Get("FastSim/es2017/el_scale_full_fast_peak_gaussian"); m_G4OverAFII_electron->SetDirectory(0);
+      m_G4OverAFII_unconverted = (TH1D*) m_rootFile->Get("FastSim/es2017/ph_unconv_scale_full_fast_peak_gaussian"); m_G4OverAFII_unconverted->SetDirectory(0);
+      m_G4OverAFII_converted = (TH1D*) m_rootFile->Get("FastSim/es2017/ph_conv_scale_full_fast_peak_gaussian"); m_G4OverAFII_converted->SetDirectory(0);
     }
     else { // run 1
       m_G4OverAFII_electron = (TH1D*) m_rootFile->Get("FastSim/hG4OverAF");                 m_G4OverAFII_electron->SetDirectory(0);
@@ -922,10 +1084,16 @@ namespace AtlasRoot {
     m_G4OverFrSh            = (TH1D*) m_rootFile->Get("FastSim/hG4OverFS");                 m_G4OverFrSh->SetDirectory(0);
 
     // ... Leakage systematics
-
-    m_leakageConverted      = (TH1D*) m_rootFile->Get("Leakage/LeakageDiffConverted");      m_leakageConverted->SetDirectory(0);
-    m_leakageUnconverted    = (TH1D*) m_rootFile->Get("Leakage/LeakageDiffUnconverted");    m_leakageUnconverted->SetDirectory(0);
-
+    
+    if(m_esmodel != egEnergyCorr::es2017_summer and m_esmodel != egEnergyCorr::es2017_summer_improved and m_esmodel != egEnergyCorr::es2017_R21_PRE){
+      m_leakageConverted      = (TH1D*) m_rootFile->Get("Leakage/LeakageDiffConverted");      m_leakageConverted->SetDirectory(0);
+      m_leakageUnconverted    = (TH1D*) m_rootFile->Get("Leakage/LeakageDiffUnconverted");    m_leakageUnconverted->SetDirectory(0);
+    }
+    else{
+      m_leakageConverted      = (TH1D*) m_rootFile->Get("Leakage/es2017_summer/LeakageDiffConverted");      m_leakageConverted->SetDirectory(0);
+      m_leakageUnconverted    = (TH1D*) m_rootFile->Get("Leakage/es2017_summer/LeakageDiffUnconverted");    m_leakageUnconverted->SetDirectory(0);
+    }
+      
     // ... Zee S2 profile (needed for gain switch syst).
 
     m_zeeES2Profile         = (TH1D*) m_rootFile->Get("ZeeEnergyProfiles/p2MC");    m_zeeES2Profile->SetDirectory(0);
@@ -966,11 +1134,6 @@ namespace AtlasRoot {
 
   // This method handles the main switches between data and the various MC flavours.
   // Called internally by getCorrectedEnergy(...)
-
-  // TODO :
-  // -> change name?
-  // -> move to private?
-
   double egammaEnergyCorrectionTool::getCorrectedEnergy( unsigned int runnumber,
                                                          PATCore::ParticleDataType::DataType dataType,
                                                          PATCore::ParticleType::Type ptype,
@@ -979,7 +1142,7 @@ namespace AtlasRoot {
                                                          double energy,
                                                          double energyS2,
                                                          double eraw,
-                                                         egEnergyCorr::Scale::Variation scaleVar,
+							 egEnergyCorr::Scale::Variation scaleVar,
                                                          egEnergyCorr::Resolution::Variation resVar,
                                                          egEnergyCorr::Resolution::resolutionType resType,
                                                          double varSF ) const {
@@ -1065,13 +1228,22 @@ namespace AtlasRoot {
 
     double daE4 = 0., linE4 = 0.;
     // E4 contribution
-    if ((m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) and
+    if ((m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) and
         (var == egEnergyCorr::Scale::E4ScintillatorUp or var == egEnergyCorr::Scale::E4ScintillatorDown))
     {
       daE4 = getE4Uncertainty(cl_eta);
+      if (var == egEnergyCorr::Scale::E4ScintillatorDown) daE4 *= -1;
       linE4 = getE4NonLinearity(cl_eta, energy, ptype) - getE4NonLinearity(cl_eta, meanE, PATCore::ParticleType::Electron);
     }
 
+    //wtots1 contribution
+    double daWtots1 = 0.;
+    if ((m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) and (var == egEnergyCorr::Scale::Wtots1Up or var == egEnergyCorr::Scale::Wtots1Down)){
+      daWtots1 = getWtots1Uncertainty(cl_eta, energy, ptype);
+      if(var == egEnergyCorr::Scale::Wtots1Down)
+	daWtots1 = -daWtots1;
+    }
+
     // ... Presampler contribution
 
     if( var==egEnergyCorr::Scale::PSUp || var==egEnergyCorr::Scale::PSDown ||
@@ -1087,16 +1259,13 @@ namespace AtlasRoot {
 
     if (var == egEnergyCorr::Scale::S12Up or var==egEnergyCorr::Scale::S12Down or
         var == egEnergyCorr::Scale::LArCalibUp or var==egEnergyCorr::Scale::LArCalibDown or
-        var == egEnergyCorr::Scale::LArCalibExtra2015PreUp or var == egEnergyCorr::Scale::LArCalibExtra2015PreDown)
+        var == egEnergyCorr::Scale::LArCalibExtra2015PreUp or var == egEnergyCorr::Scale::LArCalibExtra2015PreDown or
+        var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up or var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down)
       {
-
-	daS12  = getLayerUncertainty(1, cl_eta, var, varSF);
-
-	linS12 = getLayerNonLinearity( 1, cl_eta, energy, ptype )
-	  - getLayerNonLinearity( 1, cl_eta, meanE,  PATCore::ParticleType::Electron );
+        daS12  = getLayerUncertainty(1, cl_eta, var, varSF);
+	linS12 = getLayerNonLinearity( 1, cl_eta, energy, ptype ) - getLayerNonLinearity( 1, cl_eta, meanE,  PATCore::ParticleType::Electron );
       }
 
-
     // Material contribution
 
     double daMatID, daMatCryo, daMatCalo;
@@ -1161,20 +1330,46 @@ namespace AtlasRoot {
 
     double daL2GainSwitch = 0.;
 
-    if ( var==egEnergyCorr::Scale::L2GainUp || var==egEnergyCorr::Scale::L2GainDown )
-      if (!(fabs(cl_eta) < 1.52 and fabs(cl_eta) > 1.37) and fabs(cl_eta) < 2.4) {
-
-	double evar = m_gain_tool->CorrectionGainTool(cl_eta, energy/GeV, energyS2/GeV, ptype);
+    if ( var==egEnergyCorr::Scale::L2GainUp || var==egEnergyCorr::Scale::L2GainDown ) {
+      if (m_gain_tool) { // recipe for run1
+        if (!(fabs(cl_eta) < 1.52 and fabs(cl_eta) > 1.37) and fabs(cl_eta) < 2.4) {
+  	      double evar = m_gain_tool->CorrectionGainTool(cl_eta, energy/GeV, energyS2/GeV, ptype);
+  	      double meanES2 = m_zeeES2Profile->GetBinContent(m_zeeES2Profile->FindBin(cl_eta)); // in GeV already
+  	      double eref = m_gain_tool->CorrectionGainTool(cl_eta, meanE/GeV, meanES2, PATCore::ParticleType::Electron );
+  	      daL2GainSwitch = evar/energy - eref/meanE;
+  	      if( var==egEnergyCorr::Scale::L2GainDown )
+  	        daL2GainSwitch = -daL2GainSwitch;
+        }
+      }
+      else if (m_gain_tool_run2) { // recipe for run 2, see ATLASEG-44
+        daL2GainSwitch = m_gain_tool_run2->getUncertainty(cl_etaCalo, energy / cosh(cl_eta), ptype);
+        if (var == egEnergyCorr::Scale::L2GainDown) daL2GainSwitch *= -1;
+      }
+      else {
+        ATH_MSG_ERROR("trying to compute gain systematic, but no tool for doing it has been instantiated, setting sys to 0");
+        daL2GainSwitch = 0.;
+      }
+    }
 
-	double meanES2 = m_zeeES2Profile->GetBinContent(m_zeeES2Profile->FindBin(cl_eta)); // in GeV already
-	double eref = m_gain_tool->CorrectionGainTool(cl_eta, meanE/GeV, meanES2, PATCore::ParticleType::Electron );
+    // pp0 (and IBL)
+    double dapp0 = 0.;
+    // values from the histogram already are 0 for the Z->ee electrons
+    if (var == egEnergyCorr::Scale::MatPP0Up or var == egEnergyCorr::Scale::MatPP0Down) {
+      decltype(m_pp0_conv) histo = nullptr;
+      if (ptype == PATCore::ParticleType::Electron) histo = m_pp0_elec;
+      else if (ptype == PATCore::ParticleType::ConvertedPhoton) histo = m_pp0_conv;
+      else if (ptype == PATCore::ParticleType::UnconvertedPhoton) histo = m_pp0_unconv;
 
-	daL2GainSwitch = evar/energy - eref/meanE;
-	if( var==egEnergyCorr::Scale::L2GainDown )
-	  daL2GainSwitch = -daL2GainSwitch;
+      if (histo) {
+        const double aeta = std::abs(cl_eta);
+        dapp0 = getValueHistAt(*histo, aeta, energy / GeV / cosh(cl_eta), false, true, false, true);
+        if (var == egEnergyCorr::Scale::MatPP0Down) { dapp0 = -dapp0; }
 
+        // normalize to pp0 systematics
+        if (aeta > 1.5 and aeta < 2.0) { dapp0 *= 2.6; }
+        else if (aeta >= 2.0 and aeta <= 2.5) { dapp0 *= 2.3; }
       }
-
+    }
 
     // Conversion systematics
 
@@ -1192,6 +1387,8 @@ namespace AtlasRoot {
     alphaTot += daL2GainSwitch;
     alphaTot += daConvSyst;
     alphaTot += daPedestal;
+    alphaTot += daWtots1;
+    alphaTot += dapp0;
 
     ATH_MSG_DEBUG("alpha value for " << variationName(var) << " = " << alphaTot);
 
@@ -1485,12 +1682,19 @@ namespace AtlasRoot {
       isys=0x40;
     }
 
+    if (value==egEnergyCorr::Resolution::MaterialIBLUp || value==egEnergyCorr::Resolution::MaterialIBLDown) {
+      isys=0x80;
+    }
+    if (value==egEnergyCorr::Resolution::MaterialPP0Up || value==egEnergyCorr::Resolution::MaterialPP0Down) {
+      isys=0x100;
+    }
+
     double sign = 1.;
     if (value==egEnergyCorr::Resolution::AllDown ||  value==egEnergyCorr::Resolution::ZSmearingDown ||
         value==egEnergyCorr::Resolution::SamplingTermDown ||  value==egEnergyCorr::Resolution::MaterialIDDown ||
         value==egEnergyCorr::Resolution::MaterialGapDown || value==egEnergyCorr::Resolution::MaterialCaloDown ||
-        value==egEnergyCorr::Resolution::MaterialCryoDown ||
-        value==egEnergyCorr::Resolution::PileUpDown)  sign=-1.;
+        value==egEnergyCorr::Resolution::MaterialCryoDown || value==egEnergyCorr::Resolution::PileUpDown ||
+	value==egEnergyCorr::Resolution::MaterialIBLDown || value==egEnergyCorr::Resolution::MaterialPP0Down) sign=-1.;
 
     double resolution;
     double resolution_error;
@@ -1584,13 +1788,17 @@ namespace AtlasRoot {
     }
 
     if (fast and std::abs(cl_eta) < 2.5) {
-      double ratio_IQR_full_fast = 1.;
-      const double ptGeV = energy / cosh(cl_eta) / 1E3;
-      if (ptype == PATCore::ParticleType::Electron) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_electron, ptGeV, cl_eta, true, false); }
-      else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_unconverted, ptGeV, cl_eta, true, false); }
-      else if (ptype == PATCore::ParticleType::ConvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_converted, ptGeV, cl_eta, true, false); }
+      if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE or m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) {
+
+        double ratio_IQR_full_fast = 1.;
+        const double ptGeV = energy / cosh(cl_eta) / 1E3;
 
-      sig2 /= ratio_IQR_full_fast * ratio_IQR_full_fast;
+        if (ptype == PATCore::ParticleType::Electron) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_electron, ptGeV, cl_eta, true, false); }
+        else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_unconverted, ptGeV, cl_eta, true, false); }
+        else if (ptype == PATCore::ParticleType::ConvertedPhoton) {  ratio_IQR_full_fast = getValueHistAt(*m_G4OverAFII_resolution_converted, ptGeV, cl_eta, true, false); }
+
+        sig2 /= ratio_IQR_full_fast * ratio_IQR_full_fast;
+      }
     }
 
     // add the additional constant term from the Zee data/MC measurement
@@ -1635,6 +1843,8 @@ namespace AtlasRoot {
     double resData = resolution(energy, cl_eta, cl_etaCalo, ptype, true,  // with additional CT
 		                            false, resType);  // on top of Full simulation
 
+    ATH_MSG_DEBUG("resolution in data: " << resData << " in MC: " << resMC);
+
     if (m_use_new_resolution_model) {
       resData *= 1 + getResolutionError(energy, cl_eta, cl_etaCalo, ptype, value, resType);
     } else { // OLD model
@@ -1648,6 +1858,8 @@ namespace AtlasRoot {
       }
     }
 
+    ATH_MSG_DEBUG("resolution in data after systematics: " << resData);
+
     const double sigma2 = std::pow(resData * energyGeV, 2 ) - std::pow(resMC * energyGeV, 2);
     // TODO: for nominal case it can be simplified to:
     // const double sigma = dataConstantTerm(m_use_etaCalo_scales ? cl_etaCalo : cl_eta) * energyGeV;
@@ -1712,7 +1924,8 @@ namespace AtlasRoot {
 
     if (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
         m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
-        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) {
+        m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017
+	or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) {
       if (ptype == PATCore::ParticleType::Electron) { return getValueHistoAt(*m_G4OverAFII_electron, eta); }
       else if (ptype == PATCore::ParticleType::ConvertedPhoton) { return getValueHistoAt(*m_G4OverAFII_converted, eta); }
       else if (ptype == PATCore::ParticleType::UnconvertedPhoton) { return getValueHistoAt(*m_G4OverAFII_unconverted, eta); }
@@ -1722,7 +1935,6 @@ namespace AtlasRoot {
       // run 1
       return m_G4OverAFII_electron->GetBinContent( m_G4OverAFII_electron->GetXaxis()->FindBin(eta) );
     }
-
   }
 
 
@@ -1750,6 +1962,13 @@ namespace AtlasRoot {
     int ieta = m_zeeNom->GetXaxis()->FindBin(eta);
     double value = m_zeeNom->GetBinContent(ieta);
 
+    if ((m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved) && runnumber < 297000) {
+      // 2 sets of scales for this configuration
+      // change histogram if 2015 data
+      int ieta = m_zeeNom_data2015->GetXaxis()->FindBin(eta);
+      value = m_zeeNom_data2015->GetBinContent(ieta);
+    }
+
     if (m_esmodel==egEnergyCorr::es2015PRE or m_esmodel==egEnergyCorr::es2015PRE_res_improved or
         m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved) {
       // special case for es2015PRE
@@ -1784,7 +2003,7 @@ namespace AtlasRoot {
       }
     }  // end special case for es2015PRE*
 
-    if (m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) {
+    if ((m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE) and m_use_temp_correction201215) {
       // keep the correction 2012->2015 for |eta| > 2.5
       // if (eta > 2.5 and eta < 3.2) value += 0.;
       if (eta < -2.5 and eta > -3.2) value += -0.45E-2;
@@ -1803,14 +2022,17 @@ namespace AtlasRoot {
       }
     }
 
-
     if (var == egEnergyCorr::Scale::ZeeStatUp or var == egEnergyCorr::Scale::ZeeStatDown) {
-      double stat_error = m_zeeNom->GetBinError(ieta);
-      if (m_use_stat_error_scaling) {
-        stat_error = m_zeeNom->GetBinError(ieta) / sqrt(m_zeeNom->GetNbinsX());
-      }
       const double sign = (var == egEnergyCorr::Scale::ZeeStatUp) ? 1 : -1;
-      value += sign * stat_error * varSF;
+
+      const TH1* h = m_zeeNom;
+      if ((m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved) && runnumber < 297000) h = m_zeeNom_data2015; // special for 2015 with es2017
+      double stat_error = h->GetBinError(h->FindFixBin(eta));
+	    if (m_use_stat_error_scaling) {
+        stat_error = stat_error / sqrt(h->GetNbinsX());
+	    }
+	    value += sign * stat_error * varSF;
+
     }
     else if( var==egEnergyCorr::Scale::ZeeSystUp && m_zeeSyst ) {
       value += get_ZeeSyst(eta) * varSF;
@@ -1907,18 +2129,82 @@ namespace AtlasRoot {
                      laser * laser);
   }
 
+  double egammaEnergyCorrectionTool::getWtots1Uncertainty(double cl_eta, double energy, PATCore::ParticleType::Type ptype) const {
+    double value = 0;
+
+    //Get slopes and wstot values
+    //deltaE/E (Et, particle type ) =  2*A/mZ * ( wstot(Et,particle type)_data  - <wstot(40 GeV Et electrons)_data)> ) - 2*B/mZ* (wstot(Et,particle type)_MC - <w wstot(40 GeV Et electrons)_MC>)
+    //factor 2 to go from slopes in dM/M to dE/E
+
+    //|eta|>2.4 => use last eta bin
+    if(cl_eta<-2.4) cl_eta = -2.35;
+    if(cl_eta>2.4) cl_eta = 2.35;
+
+    int bin = m_wstot_slope_A_data->FindFixBin(cl_eta);
+    double A = m_wstot_slope_A_data->GetBinContent(bin);
+    double B = m_wstot_slope_B_MC->GetBinContent(bin);
+    double wstot_40_data = m_wstot_40GeV_data->GetBinContent(bin);
+    double wstot_40_MC = m_wstot_40GeV_MC->GetBinContent(bin);
+
+    //the wstot=f(pT) depends on the particle type
+    double ETGeV = energy / cosh(cl_eta) / 1E3;
+    double wstot_pT_data_p0 = 0.;
+    double wstot_pT_data_p1 = 0.;
+    double wstot_pT_MC_p0 = 0.;
+    double wstot_pT_MC_p1 = 0.;
+
+    if (ptype == PATCore::ParticleType::Electron ) {
+      wstot_pT_data_p0 = m_wstot_pT_data_p0_electrons->GetBinContent(bin);
+      wstot_pT_data_p1 = m_wstot_pT_data_p1_electrons->GetBinContent(bin);
+      wstot_pT_MC_p0 = m_wstot_pT_MC_p0_electrons->GetBinContent(bin);
+      wstot_pT_MC_p1 = m_wstot_pT_MC_p1_electrons->GetBinContent(bin);
+    }
+    else if (ptype == PATCore::ParticleType::UnconvertedPhoton) {
+      wstot_pT_data_p0 = m_wstot_pT_data_p0_unconverted_photons->GetBinContent(bin);
+      wstot_pT_data_p1 = m_wstot_pT_data_p1_unconverted_photons->GetBinContent(bin);
+      wstot_pT_MC_p0 = m_wstot_pT_MC_p0_unconverted_photons->GetBinContent(bin);
+      wstot_pT_MC_p1 = m_wstot_pT_MC_p1_unconverted_photons->GetBinContent(bin);
+    }
+    else if (ptype == PATCore::ParticleType::ConvertedPhoton) {
+      wstot_pT_data_p0 = m_wstot_pT_data_p0_converted_photons->GetBinContent(bin);
+      wstot_pT_data_p1 = m_wstot_pT_data_p1_converted_photons->GetBinContent(bin);
+      wstot_pT_MC_p0 = m_wstot_pT_MC_p0_converted_photons->GetBinContent(bin);
+      wstot_pT_MC_p1 = m_wstot_pT_MC_p1_converted_photons->GetBinContent(bin);
+    }
+
+    double wstot_pT_data = 0.;
+    double wstot_pT_MC = 0.;
+
+    //Initial parametrization: [0]+1*pT
+    //wstot_pT_data = wstot_pT_data_p0+wstot_pT_data_p1*ETGeV;
+    //prevent wstot_pT_data from being negative
+    //if(wstot_pT_data<0) wstot_pT_data = 0.;
+
+    //New parametrization: p0+p1/sqrt(pT)
+    //flat uncertainty below 25 GeV
+    if(ETGeV<25.) ETGeV = 25.;
+
+    wstot_pT_data = wstot_pT_data_p0+wstot_pT_data_p1/sqrt(ETGeV);
+    wstot_pT_MC = wstot_pT_MC_p0+wstot_pT_MC_p1/sqrt(ETGeV);
+
+    value = 2*A/91.2*(wstot_pT_data-wstot_40_data) - 2*B/91.2*(wstot_pT_MC-wstot_40_MC);
+
+    return value;
+  }
+
+
+
   // Layer scale uncertainties and induced non-linearity
   //////////////////////////////////////////////////////
 
   double egammaEnergyCorrectionTool::getLayerUncertainty( int iLayer,
 							  double cl_eta,
 							  egEnergyCorr::Scale::Variation var,
-                                                          double varSF) const {
+                double varSF) const {
 
     double value = 0.;
 
-    if( var==egEnergyCorr::Scale::Nominal )
-      return value;
+    if (var == egEnergyCorr::Scale::Nominal) return value;
 
     // nearest eta outside of crack (for PS scale values and uncertainties)
     double nearestEta = nearestEtaBEC(cl_eta);
@@ -1945,22 +2231,55 @@ namespace AtlasRoot {
       else if (var == egEnergyCorr::Scale::S12Down && m_aS12Nom) { value = -m_aS12Nom->GetBinError(m_aS12Nom->FindBin(cl_eta)); }
       else if (var == egEnergyCorr::Scale::LArCalibUp && m_daS12Cor) { value = m_daS12Cor->GetBinContent(m_daS12Cor->FindBin(cl_eta)); }
       else if (var == egEnergyCorr::Scale::LArCalibDown && m_daS12Cor) { value = -m_daS12Cor->GetBinContent( m_daS12Cor->FindBin(cl_eta)); }
-      else if (var == egEnergyCorr::Scale::LArCalibExtra2015PreUp and
-               (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
-                m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
-                m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE)) {
-	// special case for es2015PRE and also for es2015c_summer
+      else if (var == egEnergyCorr::Scale::LArCalibExtra2015PreUp and 
+	       (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
+		m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
+		m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017
+		or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE)) { 
+	// special case for es2015PRE and also for es2015c_summer and also for es2017
 	// numbers from Lydia and Christophe,
 	// https://indico.cern.ch/event/395345/contribution/2/material/slides/0.pdf
 	// assuming constant uncertainty
-	value = 1.5E-2;
+	// es2017_summer: increased to 5% in the endcap
+	const double aeta = std::abs(cl_eta); 
+	//endcap
+	if ( aeta >= 1.37 and aeta < 2.5){
+	  if ( m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) value = 5.0E-2;
+	  else value = 1.5E-2;
+	}
+	else{//barrel
+	  if (m_esmodel == egEnergyCorr::es2017_summer_improved) value = 2.5E-2;
+	  else value = 1.5E-2;
+	}
       }
       else if (var == egEnergyCorr::Scale::LArCalibExtra2015PreDown and
                (m_esmodel == egEnergyCorr::es2015PRE or m_esmodel == egEnergyCorr::es2015PRE_res_improved or
                 m_esmodel == egEnergyCorr::es2015cPRE or m_esmodel == egEnergyCorr::es2015cPRE_res_improved or
-                m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE)) {
-	value = -1.5E-2;
+                m_esmodel == egEnergyCorr::es2015c_summer or m_esmodel == egEnergyCorr::es2016PRE or m_esmodel == egEnergyCorr::es2017
+		or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE)) {
+	const double aeta = std::abs(cl_eta);  
+        //endcap 
+        if ( aeta >= 1.37 and aeta < 2.5){ 
+          if ( m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) value = -5.0E-2; 
+          else value = -1.5E-2; 
+        } 
+        else{//barrel 
+          if (m_esmodel == egEnergyCorr::es2017_summer_improved) value = -2.5E-2; 
+          else value = -1.5E-2; 
+        } 
+      }
+      
+      else if (var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up or var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down) {
+        // special large sys for run2 in the last eta-bin in es2017, see ATLASEG-42
+        if (m_esmodel == egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE) {
+	  const double aeta = std::abs(cl_eta);
+	  if (aeta >= 2.4 and aeta < 2.5) {
+	    if (var == egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up) value = 25E-2;
+	    else value = -25E-2;
+	  }
+	}
       }
+
     }
 
 
@@ -2407,29 +2726,39 @@ namespace AtlasRoot {
 
   double egammaEnergyCorrectionTool::getAlphaPedestal(double cl_eta, double energy, double eraw, PATCore::ParticleType::Type ptype, bool isRef,
 						      egEnergyCorr::Scale::Variation var, double varSF) const {
-
-    // observed pedestal corrected as a systematic on MC for now.
-    // TODO : correct for it in the data
-
     double alpha = 0.;
+    if (var == egEnergyCorr::Scale::PedestalUp || var == egEnergyCorr::Scale::PedestalDown) {
+      if (m_esmodel == egEnergyCorr::es2017) {
+	const double delta = getValueHistoAt(*m_pedestals_es2017, std::abs(cl_eta));
+	alpha = delta / (energy / cosh(cl_eta));
+	if (var == egEnergyCorr::Scale::PedestalDown) alpha *= -1;
+      }
+      else if(m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved or m_esmodel == egEnergyCorr::es2017_R21_PRE){
+	//Et uncertainty band: 10 MeV for the corrected cluster
+	alpha = 10. / (energy / cosh(cl_eta));
+	if (var == egEnergyCorr::Scale::PedestalDown) alpha *= -1;
+      }
+      else {
+	// observed pedestal corrected as a systematic on MC for now.
+	// TODO : correct for it in the data
 
-    if( var==egEnergyCorr::Scale::PedestalUp || var==egEnergyCorr::Scale::PedestalDown ) {
 
-      double pedestal = getLayerPedestal(cl_eta, ptype, 0, var, varSF) +
-	getLayerPedestal(cl_eta, ptype, 1, var, varSF) +
-	getLayerPedestal(cl_eta, ptype, 2, var, varSF) +
-	getLayerPedestal(cl_eta, ptype, 3, var, varSF);
 
+	double pedestal = getLayerPedestal(cl_eta, ptype, 0, var, varSF) +
+	  getLayerPedestal(cl_eta, ptype, 1, var, varSF) +
+	  getLayerPedestal(cl_eta, ptype, 2, var, varSF) +
+	  getLayerPedestal(cl_eta, ptype, 3, var, varSF);
 
-      if( isRef )
-	alpha = pedestal/energy*1.06; // approximate average ratio between calibrated and raw
-      else
-	alpha = pedestal/eraw;
 
-    }
+	if( isRef )
+	  alpha = pedestal/energy*1.06; // approximate average ratio between calibrated and raw
+	else
+	  alpha = pedestal/eraw;
 
-    return alpha*varSF;
+      }
+    }
 
+    return alpha * varSF;
   }
 
 
@@ -2535,7 +2864,7 @@ namespace AtlasRoot {
     double sum_deltaUp=0.;
 
 
-    for (int isys=0;isys<7;isys++) {
+    for (int isys=0;isys<9;isys++) {
 
       if (syst_mask & (1<<isys) ) {
 
@@ -2568,7 +2897,7 @@ namespace AtlasRoot {
 
 	// systematics from configA ID material
 	if (isys==2) {
-	  double sigmaA= m_getMaterialDelta->getDelta(particle_type,energy,eta,1,resol_type);
+    double sigmaA= m_getMaterialDelta->getDelta(particle_type,energy,eta,1,0);
 	  sigma2 = sigmaA*sigmaA;
 	  sigma2up = sigma2;
 	  sigma2down = -1.*sigma2;
@@ -2610,9 +2939,9 @@ namespace AtlasRoot {
 	if (isys==6) {
 	  double et = energy/cosh(eta);
 	  double deltaPileupNoise=100.; // MeV
-	  if (abs(eta)>=1.4 && abs(eta)<1.8) deltaPileupNoise=200.; // larger systematic in this eta bin
+	  if (std::abs(eta)>=1.4 && std::abs(eta)<1.8) deltaPileupNoise=200.; // larger systematic in this eta bin
 	  double scaleNcells=1;
-	  if (particle_type==1 && abs(eta)<1.4) scaleNcells = sqrt(3./5.);   // cluster=3X5 instead of 3x7, rms scales with cluster area
+	  if (particle_type==1 && std::abs(eta)<1.4) scaleNcells = sqrt(3./5.);   // cluster=3X5 instead of 3x7, rms scales with cluster area
 	  double sigmaPileUp = deltaPileupNoise*scaleNcells/et;
 	  double sigmaZ = deltaPileupNoise/(40000.); // effect for Z->ee at Et=40 GeV
 	  sigma2=sigmaPileUp*sigmaPileUp-sigmaZ*sigmaZ;
@@ -2621,6 +2950,29 @@ namespace AtlasRoot {
     ATH_MSG_DEBUG(boost::format("sys resolution pileup noise: %.7f %.7f %.7f") % sigma2 % sigma2up % sigma2down);
 	}
 
+	// systematics from material in IBL+PP0 for barrel
+	if (isys==7 && fabs(eta)<1.5  && (m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved)) {
+	  double  sigmaE = m_getMaterialDelta->getDelta(particle_type,energy,eta,1,5);
+	  sigma2 = sigmaE*sigmaE;
+	  sigma2up = sigma2;
+	  sigma2down = -1.*sigma2;
+	  ATH_MSG_DEBUG(boost::format("sys resolution ibl material: %.7f %.7f %.7f") % sigma2 % sigma2up % sigma2down);
+	}
+
+	// systematics from material in IBL+PP0 for end-cap
+	if (isys==8 && fabs(eta)>1.5 && (m_esmodel==egEnergyCorr::es2017 or m_esmodel == egEnergyCorr::es2017_summer or m_esmodel == egEnergyCorr::es2017_summer_improved)) {
+	  double sigmaE =  m_getMaterialDelta->getDelta(particle_type,energy,eta,1,5);
+	  // scale factor 2.3 in X0 => sqrt(2) in resolution or 2 in resolution**2
+	  sigma2 = 2.3*sigmaE*sigmaE;
+	  sigma2up = sigma2;
+	  sigma2down = -1.*sigma2;
+	  ATH_MSG_DEBUG(boost::format("sys resolution pp0 material: %.7f %.7f %.7f") % sigma2 % sigma2up % sigma2down);
+
+	}
+
+
+//  old method to use max of up and down for All
+/*
 	double rr1 = sqrt(resolution2+sigma2);   // nominal (data) + average error
 	double rr2=0.;
 	if((resolution2-sigma2) > 0.) rr2 = sqrt(resolution2-sigma2);  // max(0, nominal (data) - average error)
@@ -2628,6 +2980,17 @@ namespace AtlasRoot {
 	if ((rr1-resolution) > (resolution-rr2) ) deltaSigma_sys = rr1-resolution;
 	else deltaSigma_sys = resolution-rr2;
 	deltaSigma_sys = deltaSigma_sys / resolution;
+*/
+
+// use average of up and down for symmetric uncertainty for All
+
+	double rr1=0.;
+	if((resolution2+sigma2up)>0.) rr1 = sqrt(resolution2+sigma2up);   // nominal (data) + up error
+	double rr2=0.;
+        if((resolution2+sigma2down) > 0.) rr2 = sqrt(resolution2+sigma2down);  // max(0, nominal (data) + down error
+        double deltaSigma_sys;
+        deltaSigma_sys = 0.5*(rr1-rr2);        // average of up and down uncertainties
+        deltaSigma_sys = deltaSigma_sys / resolution;   // relative resolution uncertainty
 
 	sum_sigma_resolution2 += deltaSigma_sys*deltaSigma_sys;
 
@@ -2639,8 +3002,8 @@ namespace AtlasRoot {
 	if ((resolution2+sigma2down)>0.) rr2=sqrt(resolution2+sigma2down);
 	else rr2=0.;
 	double deltaSigmaDown = (rr2-resolution)/resolution;
-
 	//std::cout << " relative resolution change Down " << deltaSigmaDown << std::endl;
+	
 	sum_deltaUp += deltaSigmaUp;
 	sum_deltaDown += deltaSigmaDown;
 
@@ -2654,9 +3017,9 @@ namespace AtlasRoot {
     resolution_error_up = sum_deltaUp*resolution;
     resolution_error_down = sum_deltaDown*resolution;
 
-
+    
     //std::cout << " Resolution (MeV): " << resolution << "   Resolution Error (MeV): " << resolution_error
-    //  << " Z smearing " << smearingZ << " +- " << esmearingZ << std::endl;
+    //	      << " Z smearing " << smearingZ << " +- " << esmearingZ << std::endl;
 
   }
 
@@ -2690,6 +3053,8 @@ namespace AtlasRoot {
     case egEnergyCorr::Scale::PSDown: return "PSDown";
     case egEnergyCorr::Scale::S12Up: return "S12Up";
     case egEnergyCorr::Scale::S12Down: return "S12Down";
+    case egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up: return "S12ExtraLastEtaBinRun2Up";
+    case egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down: return "S12ExtraLastEtaBinRun2Down";
     case egEnergyCorr::Scale::MatIDUp: return "MatIDUp";
     case egEnergyCorr::Scale::MatIDDown: return "MatIDDown";
     case egEnergyCorr::Scale::MatCryoUp: return "MatCryoUp";
@@ -2722,83 +3087,45 @@ namespace AtlasRoot {
     case egEnergyCorr::Scale::LArTemperature2016PreDown: return "LArTemperature2016PreDown";
     case egEnergyCorr::Scale::E4ScintillatorUp: return "E4ScintillatorUp";
     case egEnergyCorr::Scale::E4ScintillatorDown: return "E4ScintillatorDown";
+    case egEnergyCorr::Scale::MatPP0Up: return "MatPP0Up";
+    case egEnergyCorr::Scale::MatPP0Down: return "MatPP0Down";
+    case egEnergyCorr::Scale::Wtots1Up: return "Wtots1Up";
+    case egEnergyCorr::Scale::Wtots1Down: return "Wtots1Down";
     case egEnergyCorr::Scale::LastScaleVariation: return "LastScaleVariation";
     default: return "Unknown";
     }
   }
 
   string egammaEnergyCorrectionTool::variationName(egEnergyCorr::Resolution::Variation& var) const {
-
-    std::string name = "Resolution::Unknown";
-
     switch(var) {
-    case egEnergyCorr::Resolution::None:
-      name = "Resolution::None";
-      break;
-    case egEnergyCorr::Resolution::Nominal:
-      name = "Resolution::Nominal";
-      break;
-    case egEnergyCorr::Resolution::AllDown:
-      name = "Resolution::AllDown";
-      break;
-    case egEnergyCorr::Resolution::AllUp:
-      name = "Resolution::AllUp";
-      break;
-    case egEnergyCorr::Resolution::ZSmearingUp:
-      name = "Resolution::ZSmearingUp";
-      break;
-    case egEnergyCorr::Resolution::ZSmearingDown:
-      name = "Resolution::ZSmearingDown";
-      break;
-    case  egEnergyCorr::Resolution::SamplingTermUp:
-      name = "Resolution::SamplingTermUp";
-      break;
-    case  egEnergyCorr::Resolution::SamplingTermDown:
-      name = "Resolution::SamplingTermDown";
-      break;
-    case  egEnergyCorr::Resolution::MaterialIDUp:
-      name = "Resolution::MaterialUp";
-      break;
-    case  egEnergyCorr::Resolution::MaterialIDDown:
-      name = "Resolution::MaterialDown";
-      break;
-    case  egEnergyCorr::Resolution::MaterialCaloUp:
-      name = "Resolution::MaterialUp";
-      break;
-    case  egEnergyCorr::Resolution::MaterialCaloDown:
-      name = "Resolution::MaterialDown";
-      break;
-    case  egEnergyCorr::Resolution::MaterialCryoUp:
-      name = "Resolution::MaterialUp";
-      break;
-    case  egEnergyCorr::Resolution::MaterialCryoDown:
-      name = "Resolution::MaterialDown";
-      break;
-    case  egEnergyCorr::Resolution::MaterialGapUp:
-      name = "Resolution::MaterialUp";
-      break;
-    case  egEnergyCorr::Resolution::MaterialGapDown:
-      name = "Resolution::MaterialDown";
-      break;
-    case egEnergyCorr::Resolution::PileUpUp:
-      name = "Resolution::PileUpUp";
-      break;
-    case egEnergyCorr::Resolution::PileUpDown:
-      name = "Resolution::PileUpDown";
-      break;
-    case egEnergyCorr::Resolution::LastResolutionVariation:
-      name = "LastResolutionVariation";
-      break;
-    }
-
-    return name;
-
+      case egEnergyCorr::Resolution::None: return "Resolution::None";
+      case egEnergyCorr::Resolution::Nominal: return "Resolution::Nominal";
+      case egEnergyCorr::Resolution::AllDown: return "Resolution::AllDown";
+      case egEnergyCorr::Resolution::AllUp: return "Resolution::AllUp";
+      case egEnergyCorr::Resolution::ZSmearingUp: return "Resolution::ZSmearingUp";
+      case egEnergyCorr::Resolution::ZSmearingDown: return "Resolution::ZSmearingDown";
+      case egEnergyCorr::Resolution::SamplingTermUp: return "Resolution::SamplingTermUp";
+      case egEnergyCorr::Resolution::SamplingTermDown: return "Resolution::SamplingTermDown";
+      case egEnergyCorr::Resolution::MaterialIDUp: return "Resolution::MaterialUp";
+      case egEnergyCorr::Resolution::MaterialIDDown: return "Resolution::MaterialDown";
+      case egEnergyCorr::Resolution::MaterialCaloUp: return "Resolution::MaterialUp";
+      case egEnergyCorr::Resolution::MaterialCaloDown: return "Resolution::MaterialDown";
+      case egEnergyCorr::Resolution::MaterialCryoUp: return "Resolution::MaterialUp";
+      case egEnergyCorr::Resolution::MaterialCryoDown: return "Resolution::MaterialDown";
+      case egEnergyCorr::Resolution::MaterialGapUp: return "Resolution::MaterialUp";
+      case egEnergyCorr::Resolution::MaterialGapDown: return "Resolution::MaterialDown";
+      case egEnergyCorr::Resolution::PileUpUp: return "Resolution::PileUpUp";
+      case egEnergyCorr::Resolution::PileUpDown: return "Resolution::PileUpDown";
+      case egEnergyCorr::Resolution::MaterialPP0Up: return "Resolution::MaterialPP0Up";
+      case egEnergyCorr::Resolution::MaterialPP0Down: return "Resolution::MaterialPP0Down";
+      case egEnergyCorr::Resolution::MaterialIBLUp: return "Resolution::MaterialIBLUp";
+      case egEnergyCorr::Resolution::MaterialIBLDown: return "Resolution::MaterialIBLDown";
+      case egEnergyCorr::Resolution::LastResolutionVariation: return "LastResolutionVariation";
+      default: return "Resolution::Unknown";
+    }
   }
 
 
-
-
-
   egEnergyCorr::Scale::Variation egammaEnergyCorrectionTool::ScaleVariationFromString(string& var) {
 
     egEnergyCorr::Scale::Variation TheVar = egEnergyCorr::Scale::None;
@@ -2829,6 +3156,10 @@ namespace AtlasRoot {
     else if( var == "PSDown" )                 TheVar = egEnergyCorr::Scale::PSDown;
     else if( var == "S12Up" )                  TheVar = egEnergyCorr::Scale::S12Up;
     else if( var == "S12Down" )                TheVar = egEnergyCorr::Scale::S12Down;
+    else if( var == "S12ExtraLastEtaBinRun2Up") TheVar = egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Up;
+    else if( var == "S12ExtraLastEtaBinRun2Down") TheVar = egEnergyCorr::Scale::S12ExtraLastEtaBinRun2Down;
+    else if( var == "MatPP0Up")                TheVar = egEnergyCorr::Scale::MatPP0Up;
+    else if( var == "MatPP0Down")                TheVar = egEnergyCorr::Scale::MatPP0Down;
     else if( var == "MatIDUp" )                TheVar = egEnergyCorr::Scale::MatIDUp;
     else if( var == "MatIDDown" )              TheVar = egEnergyCorr::Scale::MatIDDown;
     else if( var == "MatCryoUp" )              TheVar = egEnergyCorr::Scale::MatCryoUp;
@@ -2880,6 +3211,10 @@ namespace AtlasRoot {
     else if ( var == "MaterialCryoDown")          TheVar = egEnergyCorr::Resolution::MaterialCryoDown;
     else if ( var == "MaterialGapUp")             TheVar = egEnergyCorr::Resolution::MaterialGapUp;
     else if ( var == "MaterialGapDown")           TheVar = egEnergyCorr::Resolution::MaterialGapDown;
+    else if ( var == "MaterialIBLUp")             TheVar = egEnergyCorr::Resolution::MaterialIBLUp;
+    else if ( var == "MaterialIBLDown")           TheVar = egEnergyCorr::Resolution::MaterialIBLDown;
+    else if ( var == "MaterialPP0Up")             TheVar = egEnergyCorr::Resolution::MaterialPP0Up;
+    else if ( var == "MaterialPP0Down")           TheVar = egEnergyCorr::Resolution::MaterialPP0Down;
     else if ( var == "PileUpUp")                  TheVar = egEnergyCorr::Resolution::PileUpUp;
     else if ( var == "PileUpDown")                TheVar = egEnergyCorr::Resolution::PileUpDown;
     else if ( var == "LastResolutionVariation")   TheVar = egEnergyCorr::Resolution::LastResolutionVariation;
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx
index 580252cf4a5281b53082bd628318bce616e2e519..da088ead3f761db418f3a22303ca6d44f5ff0ac4 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/Root/get_MaterialResolutionEffect.cxx
@@ -12,9 +12,14 @@
 #include "Riostream.h"
 
 get_MaterialResolutionEffect::get_MaterialResolutionEffect()
+  : asg::AsgMessaging("get_MaterialResolutionEffect")
 {
   //std::cout << " Initialize get_MaterialResolutionEffect " << std::endl;
-  file0 = CxxUtils::make_unique<TFile> ( PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/histos-systematics-material.root").c_str() );
+
+  const std::string filename = PathResolverFindCalibFile("ElectronPhotonFourMomentumCorrection/v8/histos-systematics-material.root");
+  
+  
+  m_file0 = CxxUtils::make_unique<TFile>(filename.c_str());
 
   for (Int_t isys=0;isys<4;isys++) {
     for (Int_t ieta=0;ieta<8;ieta++) {
@@ -34,7 +39,8 @@ get_MaterialResolutionEffect::get_MaterialResolutionEffect()
          if (isys==2 && iconv==2) sprintf(name,"systConv_EL_etaBin_%d",ieta);
          if (isys==3 && iconv==2) sprintf(name,"systConv_FMX_etaBin_%d",ieta);
          
-         hSystPeak[isys][ieta][iconv]=(TH1D*) file0->Get(name);
+         if (!(m_hSystPeak[isys][ieta][iconv]=(TH1D*) m_file0->Get(name))) ATH_MSG_FATAL("cannot find histogram " << name << " in file '" << filename << "'");
+	 
 
          if (isys==0 && iconv==0) sprintf(name,"systElec_sigmaG_A_etaBin_%d",ieta);
          if (isys==1 && iconv==0) sprintf(name,"systElec_sigmaG_CD_etaBin_%d",ieta);
@@ -50,19 +56,24 @@ get_MaterialResolutionEffect::get_MaterialResolutionEffect()
          if (isys==2 && iconv==2) sprintf(name,"systConv_sigmaG_EL_etaBin_%d",ieta);
          if (isys==3 && iconv==2) sprintf(name,"systConv_sigmaG_FMX_etaBin_%d",ieta);
 
-         hSystResol[isys][ieta][iconv]=(TH1D*) file0->Get(name);
-         //cout << " get histos " << isys << " " << ieta << " " << iconv << " " << hSystResol[isys][ieta][iconv] << endl;
+         if (!(m_hSystResol[isys][ieta][iconv]=(TH1D*) m_file0->Get(name))) ATH_MSG_FATAL("cannot find histogram " << name << " in file '" << filename << "'");
       }      
     }
   }
 
-  TAxis* aa=hSystResol[0][0][1]->GetXaxis();
-  etBins = aa->GetXbins();
+   // IBL+PP0 material systematics stored in 2D file
+  if (!(m_hsyst_IBL_PP0[0]=(TH2D*) m_file0->Get("systElec_IBLPP0"))) ATH_MSG_FATAL("cannot find histogram systElec_IBLPP0 in file '" << filename << "'");
+  if (!(m_hsyst_IBL_PP0[1]=(TH2D*) m_file0->Get("systUnconv_IBLPP0"))) ATH_MSG_FATAL("cannot find histogram systUnconv_IBLPP0 in file '" << filename << "'");
+  if (!(m_hsyst_IBL_PP0[2]=(TH2D*) m_file0->Get("systConv_IBLPP0"))) ATH_MSG_FATAL("cannot find histogram systConv_IBLPP0 in file '" << filename << "'");
+   
+
+  TAxis* aa=m_hSystResol[0][0][1]->GetXaxis();
+  m_etBins = aa->GetXbins();
 }
 
 //=========================================================================
 get_MaterialResolutionEffect::~get_MaterialResolutionEffect(){
-  file0->Close();
+  m_file0->Close();
 }
 
 //============================================================================
@@ -81,6 +92,19 @@ double get_MaterialResolutionEffect::getDelta(int particle_type, double energy,
    if (response_type<0 || response_type>1) return -999;
 
    float aeta=fabs(eta);
+   double energyGeV = energy*0.001;
+   double et = energyGeV/cosh(eta);
+
+// IBL+PP0
+   if (isyst==5) {
+      double et2=et;
+      if (et<5.) et2=5.1;
+      if (et>2000) et2=1999.;
+      if (particle_type==3) particle_type=2;
+      return 0.01*m_hsyst_IBL_PP0[particle_type]->GetBinContent(m_hsyst_IBL_PP0[particle_type]->GetXaxis()->FindBin(aeta),m_hsyst_IBL_PP0[particle_type]->GetYaxis()->FindBin(et2));
+   }
+
+
    int ieta=0;
    if (aeta<0.4) ieta=0;
    else if (aeta<0.8) ieta=1;
@@ -92,25 +116,22 @@ double get_MaterialResolutionEffect::getDelta(int particle_type, double energy,
    else ieta=7;
 
 
-   double energyGeV = energy*0.001;
-   double et = energyGeV/cosh(eta);
-
-   int ibinEt=etBins->GetSize()-2;
-   for (int i=1;i<etBins->GetSize();i++) {
-      if (et<etBins->GetAt(i)) {
+   int ibinEt=m_etBins->GetSize()-2;
+   for (int i=1;i<m_etBins->GetSize();i++) {
+      if (et<m_etBins->GetAt(i)) {
          ibinEt=i-1;
          break;
       }
    }
 
    //cout << " in getDelta  isyst: " << isyst << " ieta " << ieta << " " << " particle_type " << particle_type << endl;
-   //cout << " hSystResol " << hSystResol[isyst][ieta][particle_type] << endl;
+   //cout << " m_hSystResol " << m_hSystResol[isyst][ieta][particle_type] << endl;
 
    if (response_type==0) {
-      return 0.01*hSystPeak[isyst][ieta][particle_type]->GetBinContent(ibinEt+1);
+      return 0.01*m_hSystPeak[isyst][ieta][particle_type]->GetBinContent(ibinEt+1);
    }
    else {
-      return 0.01*hSystResol[isyst][ieta][particle_type]->GetBinContent(ibinEt+1);
+      return 0.01*m_hSystResol[isyst][ieta][particle_type]->GetBinContent(ibinEt+1);
    }
 
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/cmt/requirements b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/cmt/requirements
index f91a28adc99a4c497ccf7d1b443e4ecdfdb6fc4b..79b17e423b12edf07b1bae8112338535304142b9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/cmt/requirements
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/cmt/requirements
@@ -27,6 +27,7 @@ use  CxxUtils                   CxxUtils-*                      Control
 use  AtlasBoost                 AtlasBoost-*                    External
 use  xAODMetaData               xAODMetaData-*                  Event/xAOD
 use  AthAnalysisBaseComps	AthAnalysisBaseComps-*		Control
+use  xAODTruth                  xAODTruth-*                     Event/xAOD
 
 
 end_private
@@ -44,7 +45,6 @@ apply_pattern declare_xmls extras="-s=../data *.root"
 
 # https://twiki.cern.ch/twiki/bin/view/AtlasComputing/PathResolver#What_if_I_really_have_to_keep_a
 apply_pattern declare_calib files="../data/*.root"
-
 private
 
 ## For reflex dictionary generation
@@ -52,6 +52,7 @@ use AtlasReflex   AtlasReflex-*   External -no_auto_imports
 apply_pattern lcgdict dict=ElectronPhotonFourMomentumCorrection selectionfile=selection.xml headerfiles="..\/ElectronPhotonFourMomentumCorrection/ElectronPhotonFourMomentumCorrectionDict.h"
 
 use TestPolicy     TestPolicy-*
+use AthenaBaseComps AthenaBaseComps-* Control
 #runtime tests:
 apply_pattern athenarun_test \
    name="EgammaCalibrationAndSmearing_test" \
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins.root
deleted file mode 100644
index ab685d3d815346a4448311c99c946348bcce99ef..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_2011.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_2011.root
deleted file mode 100644
index aa8952f7837190ce02110ef40efccef292aacb51..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_2011.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_4etaBins.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_4etaBins.root
deleted file mode 100644
index 436f37bfd74f744dcf474e4f58b73447479a9f0e..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_4etaBins.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_More.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_More.root
deleted file mode 100644
index 0db0a07fabdfec249190afd81694e45776892fd5..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/Combine_MatandSum_AllEtaBins_More.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsG_all.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsG_all.root
deleted file mode 100644
index 34de799570143b5001576746903f7e35e6e9e41b..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsG_all.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsTO.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsTO.root
deleted file mode 100644
index 729b7f4713929d05d3ad64ae243ecec3e6db9baf..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/FunctionsTO.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/e1hg_systematics_histos.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/e1hg_systematics_histos.root
deleted file mode 100644
index 62aa4c06a67ee859f3c1bb10e546aa0b2815dada..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/e1hg_systematics_histos.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/res_Full_AFII.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/res_Full_AFII.root
deleted file mode 100644
index 2f092d6d213beda585cfaed2feeac6ba4b165f4d..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/res_Full_AFII.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scale_Full_AFII.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scale_Full_AFII.root
deleted file mode 100644
index a3e1f79e8f2063950e4b493082845704898586c7..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scale_Full_AFII.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_4etaBins.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_4etaBins.root
deleted file mode 100644
index f1c2a848b9d5aefa95b9e1faea95c95f68f59dc4..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_4etaBins.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_fP20.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_fP20.root
deleted file mode 100644
index 8516a69546117a438625bf5a05ce0aa8c80bd375..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/scales_delta_Jpsi_Z_syst_fP20.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/test_resolution_nonregression_run1_data.root b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/test_resolution_nonregression_run1_data.root
deleted file mode 100644
index 643218c57ccf799b471083fa7c294b55ca715c3f..0000000000000000000000000000000000000000
Binary files a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/data/test_resolution_nonregression_run1_data.root and /dev/null differ
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/merge_scale_histograms.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/merge_scale_histograms.py
index 319100724e967ed08c5ef945a5ba54dc80833572..7e3e3e26973ea2563874ab7bfbdacbf7519e10c7 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/merge_scale_histograms.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/merge_scale_histograms.py
@@ -16,6 +16,9 @@ logging.basicConfig(level=logging.INFO)
 from array import array
 
 def merge_histograms(old, new, merge_error=True):
+    print "old binning: " + ", ".join(("%.3f" % old.GetBinLowEdge(ibin)) for ibin in xrange(1, old.GetNbinsX() + 2))
+    print "new binning: " + ", ".join(("%.3f" % new.GetBinLowEdge(ibin)) for ibin in xrange(1, new.GetNbinsX() + 2))
+    
     new_binning = []
     new_values = []
     new_errors = []
@@ -31,11 +34,12 @@ def merge_histograms(old, new, merge_error=True):
         remainer = None
 
         if il_new == UNDERFLOW and ir_new == UNDERFLOW:
+            print "1. adding %.3f - %.3f from old" % (l, r)
             new_binning.append((l, r))
             new_values.append(old.GetBinContent(iold))
             new_errors.append(old.GetBinError(iold))
 
-        elif il_new == UNDERFLOW and ir_new > UNDERFLOW and ir_new < OVERFLOW:
+        elif il_new == UNDERFLOW and ir_new > UNDERFLOW:
             if abs(new.GetBinLowEdge(1) - l) < 1E-100:
                 continue
             new_binning.append((l, new.GetBinLowEdge(1)))
@@ -43,21 +47,24 @@ def merge_histograms(old, new, merge_error=True):
             new_errors.append(old.GetBinError(iold))
             if ir_new == OVERFLOW:
                 remainer = iold
+            print "breaking"
             break
     last_old = iold
 
     for inew in xrange(1, new.GetNbinsX() + 1):
         l = new.GetBinLowEdge(inew)
         r = l + new.GetBinWidth(inew)
+        print "2. adding %.3f - %.3f from new" % (l, r)
         new_binning.append((l, r))
         new_values.append(new.GetBinContent(inew))
         new_errors.append(new.GetBinError(inew))
-
+    """
     if remainer is not None:
+        print "3. adding %.3f - %.3f from old" % (new.GetBinLowEdge(new.GetNbinsX()), old.GetBinLowEdge(remainer) + old.GetBinWidth(remainer))
         new_binning.append((new.GetBinLowEdge(new.GetNbinsX()), old.GetBinLowEdge(remainer) + old.GetBinWidth(remainer)))
         new_values.append(old.GetBinContent(remainer))
         new_errors.append(old.GetBinError(remainer))
-
+    """
     for iold in xrange(last_old, old.GetNbinsX() + 1):
         l = old.GetBinLowEdge(iold)
         r = l + old.GetBinWidth(iold)
@@ -66,6 +73,7 @@ def merge_histograms(old, new, merge_error=True):
         ir_new = new.FindFixBin(r)
 
         if il_new == OVERFLOW and ir_new == OVERFLOW:
+            print "4. adding %.3f - %.3f from old" % (l, r)
             new_binning.append((l, r))
             new_values.append(old.GetBinContent(iold))
             new_errors.append(old.GetBinError(iold))
@@ -76,6 +84,7 @@ def merge_histograms(old, new, merge_error=True):
             new_values.append(old.GetBinContent(iold))
             new_errors.append(old.GetBinError(iold))
 
+    print new_binning
     new_edges = array('f', [x[0] for x in new_binning] + [new_binning[-1][1]])
     histo_type = type(new)
     result = histo_type(new.GetName(), new.GetTitle(), len(new_edges) - 1, new_edges)
@@ -83,6 +92,10 @@ def merge_histograms(old, new, merge_error=True):
         result.SetBinContent(i, v)
         if merge_error:
             result.SetBinError(i, e)
+
+    print "merged binning: " + ", ".join(("%.3f" % result.GetBinLowEdge(ibin)) for ibin in xrange(1, result.GetNbinsX() + 1))
+
+            
     return result
 
 
@@ -133,6 +146,9 @@ example (merge ct sys 2015PRE + 2015 summer): ./merge_scale_histograms.py ../../
     histo_merged.SetFillColor(ROOT.kBlue)
     histo_old.SetMarkerColor(ROOT.kRed)
     histo_new.SetMarkerColor(ROOT.kGreen)
+    for histo in histo_old, histo_new:
+        histo.SetMarkerStyle(20)
+        histo.SetMarkerSize(1)
     histo_merged.Draw("histo")
     histo_old.Draw("Psame")
     histo_new.Draw("Psame")
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/plot.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/plot.py
index 0a2da118aac0051e0d38bf822eee407127bee507..db5a6ca3ba10b806450e7ab839eb483469deac84 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/plot.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/python/plot.py
@@ -871,6 +871,8 @@ def plot_resolution_error_bin(eta_min, eta_max, particle, esmodel, basedir, tool
                           "material gap up": ROOT.egEnergyCorr.Resolution.MaterialGapUp,
                           "material cryo up": ROOT.egEnergyCorr.Resolution.MaterialCryoUp,
                           "pileup up": ROOT.egEnergyCorr.Resolution.PileUpUp,
+                          "material ibl up": ROOT.egEnergyCorr.Resolution.MaterialIBLUp,
+                          "material pp0 up": ROOT.egEnergyCorr.Resolution.MaterialPP0Up,
                           "all up": ROOT.egEnergyCorr.Resolution.AllUp}
     variations_name_down = {"Zsmearing down": ROOT.egEnergyCorr.Resolution.ZSmearingDown,
                             "sampling down": ROOT.egEnergyCorr.Resolution.SamplingTermDown,
@@ -879,6 +881,9 @@ def plot_resolution_error_bin(eta_min, eta_max, particle, esmodel, basedir, tool
                             "material gap down": ROOT.egEnergyCorr.Resolution.MaterialGapDown,
                             "material cryo down": ROOT.egEnergyCorr.Resolution.MaterialCryoDown,
                             "pileup down": ROOT.egEnergyCorr.Resolution.PileUpDown,
+                            "material ibl down": ROOT.egEnergyCorr.Resolution.MaterialIBLDown,
+                            "material pp0 down": ROOT.egEnergyCorr.Resolution.MaterialPP0Down,
+
                             "all down": ROOT.egEnergyCorr.Resolution.AllDown}
 #                 ^    ^
     all_errors = [{}, {}]  # up and down
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/share/dumpAllSystematics.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/share/dumpAllSystematics.py
new file mode 100644
index 0000000000000000000000000000000000000000..ad156e32a95760c9c1e23a8209a72dd8a2667a54
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/share/dumpAllSystematics.py
@@ -0,0 +1,51 @@
+import AthenaPoolCnvSvc.ReadAthenaPool  # TODO: best option?
+from AthenaCommon.AppMgr import ServiceMgr
+from AthenaCommon.AppMgr import ToolSvc
+from AthenaCommon import CfgMgr
+
+import cppyy
+try :
+    cppyy.loadDictionary("EgammaAnalysisInterfacesDict")
+except :
+    pass
+
+from ROOT import EgammaCalibPeriodRunNumbersExample
+
+### configure here (or configure calibration tool by yourself)
+from glob import glob
+ServiceMgr.EventSelector.InputCollections = glob("/afs/cern.ch/work/t/turra/mc15_13TeV_electrons/*")
+#ServiceMgr.EventSelector.InputCollections = glob("/afs/cern.ch/work/t/turra/mc15_13TeV.423000.ParticleGun_single_electron_egammaET.merge.AOD.e3566_a766_a820_r7676_tid10416099_00/*")  # fast sim
+#particle = "electron"  # electron or photon
+#container_name = "Electrons"
+
+ServiceMgr.EventSelector.InputCollections = glob("/afs/cern.ch/work/t/turra/mc15_13TeV.423001.ParticleGun_single_photon_egammaET.merge.AOD.e3566_s2726_r7772_r7676/*")
+particle = "photon"
+container_name = "Photons"
+
+tools = [CfgMgr.CP__EgammaCalibrationAndSmearingTool("calib_es2016PRE",
+                                                     ESModel="es2016PRE",
+                                                     decorrelationModel="FULL_ETACORRELATED_v1", doSmearing=0, randomRunNumber=EgammaCalibPeriodRunNumbersExample.run_2016),
+         CfgMgr.CP__EgammaCalibrationAndSmearingTool("calib_es2012c",
+                                                     ESModel="es2012c",
+                                                     decorrelationModel="FULL_ETACORRELATED_v1", doSmearing=0, randomRunNumber=EgammaCalibPeriodRunNumbersExample.run_2016),
+         CfgMgr.CP__EgammaCalibrationAndSmearingTool("calib_es2017",
+                                                     ESModel="es2016data_mc15c",
+                                                     decorrelationModel="FULL_ETACORRELATED_v1", doSmearing=0, randomRunNumber=EgammaCalibPeriodRunNumbersExample.run_2016)]
+#################
+
+for tool in tools:
+    ToolSvc += tool
+
+dumper_alg = CfgMgr.DumpAllSystematics("DumpAllSystematics")
+dumper_alg.particle = particle
+dumper_alg.EgammaCalibrationAndSmearingTools = tools
+dumper_alg.recoContainer = container_name
+
+algSeq = CfgMgr.AthSequencer("AthAlgSeq")
+algSeq += dumper_alg
+
+from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+svcMgr += CfgMgr.THistSvc()
+svcMgr.THistSvc.Output += ["DATASTREAM DATAFILE='output_sys.root' OPT='RECREATE'"]
+
+theApp.EvtMax = 100
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/CalibratedEgammaProvider.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/CalibratedEgammaProvider.h
index 16490c5aca9ca17af4c2cb9207f84887f058ba6c..8876bad77329f13f27c3d375d1e2272f457b2058 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/CalibratedEgammaProvider.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/CalibratedEgammaProvider.h
@@ -15,8 +15,7 @@
 #include "AsgTools/ToolHandle.h"
 
 // Local include(s):
-#include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
-
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
 #include "xAODCore/ShallowCopy.h"
 
 #include "xAODEgamma/ElectronContainer.h" 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/components/ElectronPhotonFourMomentumCorrection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/components/ElectronPhotonFourMomentumCorrection_entries.cxx
index ca610e625c481e6473700e968fb06c07b901aaf6..c3ee5303556ca2028386d6218a43d001eb6c6d50 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/components/ElectronPhotonFourMomentumCorrection_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/components/ElectronPhotonFourMomentumCorrection_entries.cxx
@@ -8,7 +8,12 @@ DECLARE_ALGORITHM_FACTORY( testAthenaEgammaCalibTool )
 DECLARE_NAMESPACE_ALGORITHM_FACTORY(CP,CalibratedEgammaProvider)
 
 
+
+#include "../dumpAllSystematics.h"
+DECLARE_ALGORITHM_FACTORY( DumpAllSystematics )
+
 DECLARE_FACTORY_ENTRIES( ElectronPhotonFourMomentumCorrection ){
+  DECLARE_ALGORITHM( DumpAllSystematics );
   DECLARE_NAMESPACE_TOOL( CP, EgammaCalibrationAndSmearingTool )
   DECLARE_ALGORITHM( testAthenaEgammaCalibTool )
   DECLARE_NAMESPACE_ALGORITHM(CP, CalibratedEgammaProvider)
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..192370760b3d29a208ad60ffc06d3b4a284fba88
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.cxx
@@ -0,0 +1,368 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <boost/algorithm/string/join.hpp>
+#include <boost/format.hpp>
+
+#include <set>
+// EDM include(s):
+
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/Egamma.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODCore/ShallowCopy.h"
+#include "xAODEventInfo/EventInfo.h"
+
+#include <xAODTruth/TruthParticle.h>  // TODO: this introduces an additional dependecy which is not needed by the tool...
+#include <xAODTruth/xAODTruthHelpers.h>
+#include <xAODTruth/TruthVertex.h>
+#include <xAODEgamma/PhotonxAODHelpers.h>
+#include <xAODEgamma/EgammaTruthxAODHelpers.h>
+
+#include "PATInterfaces/SystematicVariation.h"
+#include "PATInterfaces/SystematicRegistry.h"
+#include "PATInterfaces/SystematicCode.h"
+#include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h"
+
+#include "GaudiKernel/ITHistSvc.h"
+
+
+// local include
+#include "dumpAllSystematics.h"
+
+DumpAllSystematics::DumpAllSystematics(const std::string& name, ISvcLocator* svcLoc)
+  : AthAlgorithm(name, svcLoc)
+{
+  declareProperty("EgammaCalibrationAndSmearingTools", m_EgammaCalibrationAndSmearingTools);
+  declareProperty("particle", m_particle_name="", "electron/photon");
+  declareProperty("recoContainer", m_reco_container_name="", "reco container name");
+  declareProperty("keepOnlyOne", m_keep_one=false, "keep only the most energetic particle");
+}
+
+
+StatusCode DumpAllSystematics::initialize()
+{
+  // Greet the user:
+  ATH_MSG_INFO ("Initializing " << name() << "...");
+
+  if (m_particle_name.empty()) {
+    ATH_MSG_WARNING("particle property is empty, choose between \"photon\" or \"electron\". Assuming electron.");
+    m_particle_name = "electron";
+  }
+  if (m_particle_name != "electron" and m_particle_name != "photon")
+  {
+    ATH_MSG_FATAL("cannot understand particle property: must be \"electron\" or \"photon\"");
+  }
+
+  m_particle_type = m_particle_name == "electron" ? ParticleType::ELECTRON : ParticleType::PHOTON;
+
+  // Retrieve the tools:
+  ATH_MSG_INFO("retrieving tools");
+  if (!m_EgammaCalibrationAndSmearingTools.retrieve().isSuccess())
+   { ATH_MSG_ERROR("Cannot retrieve calibration tools"); }
+  ATH_MSG_INFO("retrieving tools, done");
+
+  if (m_EgammaCalibrationAndSmearingTools.empty()) {
+    ATH_MSG_FATAL("no tool specified in the job options");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_INFO("number of tools: " << m_EgammaCalibrationAndSmearingTools.size());
+  if (m_reco_container_name.empty()) {
+    if (m_particle_type == ParticleType::ELECTRON) m_reco_container_name = "Electrons";
+    else m_reco_container_name = "Photons";
+  }
+
+  ATH_MSG_INFO("================================================================================");
+  ATH_MSG_INFO("particle: " << m_particle_name);
+  ATH_MSG_INFO("keep only one: " << m_keep_one);
+  ATH_MSG_INFO("reco container: " << m_reco_container_name);
+  ATH_MSG_INFO("================================================================================");
+
+
+
+  ATH_MSG_DEBUG("creating tree");
+
+  const std::string prefix = m_particle_type == ParticleType::ELECTRON ? "el_" : "ph_";
+  m_tree = new TTree("all_sys", "all_sys");
+  m_tree->Branch("index", &m_instance_index, "index/I")->SetTitle("index of the particle as in the original dataset");
+  m_tree->Branch("actualIntPerXing", &m_actualIntPerXing, "actualIntPerXing/F");
+  m_tree->Branch("eventNumber", &m_EventNumber, "eventNumber/I");
+  m_tree->Branch("runNumber", &m_RunNumber, "runNumber/I");
+  m_tree->Branch((prefix + "truth_E").c_str(), &m_truth_E, (prefix + "truth_E/F").c_str());
+  m_tree->Branch((prefix + "truth_eta").c_str(), &m_truth_eta, (prefix + "truth_eta/F").c_str());
+  m_tree->Branch((prefix + "truth_pt").c_str(), &m_truth_pt, (prefix + "truth_pt/F").c_str());
+  m_tree->Branch((prefix + "truth_phi").c_str(), &m_truth_phi, (prefix + "truth_phi/F").c_str());
+  m_tree->Branch((prefix + "truth_pdgId").c_str(), &m_truth_pdgId, (prefix + "truth_pdgId/I").c_str());
+  m_tree->Branch((prefix + "truth_parent_pdgId").c_str(), &m_truth_parent_pdgId, (prefix + "truth_parent_pdgId/I").c_str());
+  m_tree->Branch((prefix + "truth_matched").c_str(), &m_truth_matched, (prefix + "truth_matched/O").c_str());
+  m_tree->Branch((prefix + "cl_eta").c_str(), &m_cl_eta, (prefix + "cl_eta/F").c_str());
+  m_tree->Branch((prefix + "cl_etaCalo").c_str(), &m_cl_etaCalo, (prefix + "cl_etaCalo/F").c_str());
+  m_tree->Branch((prefix + "cl_phi").c_str(), &m_cl_phi, (prefix + "cl_phi/F").c_str());
+  m_tree->Branch((prefix + "cl_rawcl_Es0").c_str(), &m_cl_rawcl_Es0, (prefix + "cl_rawcl_Es0/F").c_str());
+  m_tree->Branch((prefix + "cl_rawcl_Es1").c_str(), &m_cl_rawcl_Es1, (prefix + "cl_rawcl_Es1/F").c_str());
+  m_tree->Branch((prefix + "cl_rawcl_Es2").c_str(), &m_cl_rawcl_Es2, (prefix + "cl_rawcl_Es2/F").c_str());
+  m_tree->Branch((prefix + "cl_rawcl_Es3").c_str(), &m_cl_rawcl_Es3, (prefix + "cl_rawcl_Es3/F").c_str());
+  m_tree->Branch((prefix + "cl_E").c_str(), &m_cl_E, (prefix + "cl_E/F").c_str())->SetTitle("original xAOD caloCluster energy");
+  m_tree->Branch((prefix + "wstot").c_str(), &m_wstot, (prefix + "wstot/F").c_str());
+  if (m_particle_type == ParticleType::PHOTON) {
+    m_tree->Branch("ph_truth_isConv", &m_truth_isConv, "ph_truth_isConv/O");
+    m_tree->Branch("ph_truth_Rconv", &m_truth_Rconv, "ph_truth_Rconv/F");
+    m_tree->Branch("ph_Rconv", &m_ph_Rconv, "ph_Rconv/F");
+    m_tree->Branch("ph_convFlag", &m_ph_convFlag, "ph_convFlag/I");
+  }
+  m_tree->Branch("npv", &m_npv, "npv/I");
+
+  m_nominal_E.resize(m_EgammaCalibrationAndSmearingTools.size());
+  m_energy_variations.resize(m_EgammaCalibrationAndSmearingTools.size());
+  m_energy_variations_sum_up.resize(m_EgammaCalibrationAndSmearingTools.size());
+  m_energy_variations_sum_down.resize(m_EgammaCalibrationAndSmearingTools.size());
+
+  std::vector<std::vector<std::string> > all_sys_names_per_tool;
+  std::set<std::string> all_sys_names;
+
+  for (unsigned int itool = 0; itool != m_EgammaCalibrationAndSmearingTools.size(); ++itool) {
+    const std::string tool_name = m_EgammaCalibrationAndSmearingTools[itool].name();
+    {
+      const std::string branch_name = prefix + tool_name + "_nominal_E";
+      m_tree->Branch(branch_name.c_str(), &m_nominal_E[itool], (branch_name + "/F").c_str());
+    }
+
+    const CP::SystematicSet& sys_set = m_EgammaCalibrationAndSmearingTools[itool]->recommendedSystematics();
+    ATH_MSG_INFO("size of the systematics set for tool [" << itool << "] " + m_EgammaCalibrationAndSmearingTools[itool].name() << ": " << sys_set.size());
+    std::vector<std::string> sys_names; sys_names.reserve(sys_set.size());
+    for (const auto sys : sys_set) { if (sys.parameter() == 1) { sys_names.push_back(sys.name()); all_sys_names.insert(sys.name()); } }
+    std::sort(sys_names.begin(), sys_names.end());
+    all_sys_names_per_tool.push_back(sys_names);
+
+
+    m_energy_variations[itool].resize(sys_set.size());
+
+    int isys = 0;
+    for (const auto sys : sys_set) {
+      const std::string branch_name = prefix + tool_name + "_ratio_" + sys.name();
+      m_tree->Branch(branch_name.c_str(), &m_energy_variations[itool][isys],
+                     (branch_name + "/F").c_str());
+      ++isys;
+    }
+
+    m_tree->Branch((prefix + tool_name + "_ratio_SCALE_sum__1up").c_str(), &m_energy_variations_sum_up[itool], (prefix + tool_name +  "_ratio_SCALE_sum__1up/F").c_str());
+    m_tree->Branch((prefix + tool_name + "_ratio_SCALE_sum__1down").c_str(), &m_energy_variations_sum_down[itool], (prefix + tool_name +  "_ratio_SCALE_sum__1down/F").c_str());
+  }
+
+  {
+    std::string header = std::string(45, ' ');
+    for (unsigned int i = 0; i != m_EgammaCalibrationAndSmearingTools.size(); ++i)  {
+      header += (boost::format(" [%d] ") % i).str();
+    }
+    ATH_MSG_INFO(header);
+  }
+  for (auto sysname : all_sys_names) {
+    std::string line = (boost::format("%45s") % sysname).str();
+    for (const auto& sys_per_tool : all_sys_names_per_tool) {
+      if (std::find(sys_per_tool.begin(), sys_per_tool.end(), sysname) != sys_per_tool.end()) line += "  X  ";
+      else line += "     ";
+    }
+    ATH_MSG_INFO(line);
+  }
+
+  if (m_particle_type == ParticleType::ELECTRON) ATH_MSG_INFO("dumping electrons");
+  else if (m_particle_type == ParticleType::PHOTON) ATH_MSG_INFO("dumping photons");
+  
+  // output configuration
+  ServiceHandle<ITHistSvc> histSvc("THistSvc", name());
+  CHECK(histSvc.retrieve());
+  const std::string tree_stream = "/DATASTREAM";
+  CHECK(histSvc->regTree(tree_stream + "/myTree", m_tree));
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode DumpAllSystematics::finalize() {
+  ATH_MSG_INFO("Particle saved: " << m_tree->GetEntries());
+  if (m_tree->GetEntries() == 0) ATH_MSG_WARNING("no particle saved");
+  ATH_MSG_INFO("Finalizing " << name() << "...");
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DumpAllSystematics::execute()
+{
+  const xAOD::EventInfo* eventInfo = 0;
+  ATH_CHECK(evtStore()->retrieve(eventInfo));
+
+  m_actualIntPerXing = eventInfo->actualInteractionsPerCrossing();
+  m_averageIntPerXing = eventInfo->averageInteractionsPerCrossing();
+  m_EventNumber = eventInfo->eventNumber();
+  m_RunNumber = eventInfo->runNumber();
+
+  // vertex information
+  const xAOD::VertexContainer* vtx_container = nullptr;
+  if (!evtStore()->retrieve(vtx_container, "PrimaryVertices")) { m_npv = -999; }
+  else {
+    m_npv = 0;
+    for (const auto* vtx : *vtx_container) { if (vtx->vertexType() == xAOD::VxType::PriVtx or vtx->vertexType() ==  xAOD::VxType::PileUp) ++m_npv; }
+  }
+
+
+  if (m_particle_type == ParticleType::ELECTRON) {  // TODO: find a better way to generalize to electron / photons
+
+    const xAOD::ElectronContainer* electrons = nullptr;
+    CHECK(evtStore()->retrieve(electrons, m_reco_container_name));
+
+    std::pair<xAOD::ElectronContainer*, xAOD::ShallowAuxContainer*> electrons_shallowCopy = xAOD::shallowCopyContainer(*electrons);
+    for (const auto& el : *electrons_shallowCopy.first) {
+      ATH_MSG_DEBUG("new electron eta: " << el->eta());
+
+
+      CHECK(do_truth(*el));
+      CHECK(do_egamma(*el));
+      for (unsigned int itool = 0; itool != m_EgammaCalibrationAndSmearingTools.size(); ++itool) {
+        CHECK(do_energy(*el, itool));
+      }
+
+      m_tree->Fill();
+
+      if (m_keep_one) break;
+    }
+  }
+  else if (m_particle_type == ParticleType::PHOTON) {
+
+    const xAOD::PhotonContainer* photons = nullptr;
+    CHECK(evtStore()->retrieve(photons, m_reco_container_name));
+
+    std::pair<xAOD::PhotonContainer*, xAOD::ShallowAuxContainer*> photons_shallowCopy = xAOD::shallowCopyContainer(*photons);
+    for (const auto& ph : *photons_shallowCopy.first) {
+      ATH_MSG_DEBUG("new photon eta: " << ph->eta());
+
+      CHECK(do_truth(*ph));
+      CHECK(do_egamma(*ph));
+
+      if (const auto* vertex = ph->vertex()) {
+	  m_ph_Rconv = hypot(vertex->position().x(), vertex->position().y());
+      }
+      else { m_ph_Rconv = 0; }
+
+      const auto original = xAOD::EgammaHelpers::conversionType(ph);
+      if (original == 3) m_ph_convFlag = 2;
+      else if (original != 0) m_ph_convFlag = 1;
+      else m_ph_convFlag = original;
+
+      for (unsigned int itool = 0; itool != m_EgammaCalibrationAndSmearingTools.size(); ++itool) {
+        CHECK(do_energy(*ph, itool));
+      }
+
+      m_tree->Fill();
+
+      if (m_keep_one) break;
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DumpAllSystematics::do_truth(const xAOD::Egamma& particle)
+{
+  // truth
+  const xAOD::TruthParticle* true_particle = nullptr;
+  true_particle = xAOD::TruthHelpers::getTruthParticle(particle);
+
+  if (true_particle) {
+    m_truth_matched = true;
+    m_truth_pt = true_particle->pt();
+    m_truth_phi = true_particle->phi();
+    m_truth_eta = true_particle->eta();
+    m_truth_E = true_particle->e();
+    m_truth_pdgId = true_particle->pdgId();
+
+    const xAOD::TruthParticle* true_parent = true_particle->parent();
+    if (true_parent) { m_truth_parent_pdgId= true_parent->pdgId(); }
+    else { m_truth_parent_pdgId = -999; }
+
+    if (m_particle_type == ParticleType::PHOTON) {
+      m_truth_isConv = xAOD::EgammaHelpers::isTrueConvertedPhoton(true_particle);
+      m_truth_Rconv = (true_particle->pdgId() == 22) ? (true_particle->hasDecayVtx() ? true_particle->decayVtx()->perp() : 0) : -999;
+    }
+
+  }
+  else {
+    m_truth_pt = m_truth_phi = m_truth_eta = m_truth_E = m_truth_pdgId = m_truth_parent_pdgId = m_truth_Rconv = -999;
+    m_truth_matched = false;
+    m_truth_isConv = false;  // careful here (always check truth_matched before)
+  }
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DumpAllSystematics::do_egamma(const xAOD::Egamma& particle)
+{
+  m_cl_phi = particle.phi();
+  m_cl_eta = particle.caloCluster()->eta();
+  m_cl_etaCalo = xAOD::get_eta_calo(*particle.caloCluster(),particle.author());
+  m_cl_rawcl_Es0 = particle.caloCluster()->energyBE(0);
+  m_cl_rawcl_Es1 = particle.caloCluster()->energyBE(1);
+  m_cl_rawcl_Es2 = particle.caloCluster()->energyBE(2);
+  m_cl_rawcl_Es3 = particle.caloCluster()->energyBE(3);
+  static const SG::AuxElement::Accessor<float> wstot_accessor("wtots1");
+  m_wstot = wstot_accessor.isAvailable(particle) ? wstot_accessor(particle) : -999;
+  m_cl_E = particle.caloCluster()->e();
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DumpAllSystematics::do_energy(xAOD::Egamma& particle, int itool)
+{
+  m_nominal_E[itool] = m_energy_variations_sum_up[itool] = m_energy_variations_sum_down[itool] = -999.;
+  std::fill(m_energy_variations[itool].begin(), m_energy_variations[itool].end(), -999.);
+
+  if (m_EgammaCalibrationAndSmearingTools[itool]->applySystematicVariation(CP::SystematicSet()) != CP::SystematicCode::Ok) {
+    ATH_MSG_ERROR("cannot apply nominal energy");
+    return StatusCode::FAILURE;
+  }
+  if (m_EgammaCalibrationAndSmearingTools[itool]->applyCorrection(particle) == CP::CorrectionCode::Ok) {
+    m_nominal_E[itool] = particle.e();
+    ATH_MSG_DEBUG("nominal energy: " << particle.e());
+  }
+  else {
+    ATH_MSG_WARNING("Cannot calibrate electron, eta: "  << particle.eta() << " phi: " << particle.phi());
+    return StatusCode::FAILURE;
+  }
+
+  // systematics
+  m_energy_variations_sum_up[itool] = 0.;
+  m_energy_variations_sum_down[itool] = 0.;
+
+  const CP::SystematicSet& sys_set = m_EgammaCalibrationAndSmearingTools[itool]->recommendedSystematics();
+  int isys = -1;  // ugly
+  for (const auto sys : sys_set) {
+    ++isys;
+    CP::SystematicSet ss;
+    ss.insert(sys);
+
+    if (m_EgammaCalibrationAndSmearingTools[itool]->applySystematicVariation(ss) != CP::SystematicCode::Ok)  {
+      ATH_MSG_ERROR("Cannot configure calibration tool for systematic");
+      continue;
+    }
+
+    if (m_EgammaCalibrationAndSmearingTools[itool]->applyCorrection(particle) == CP::CorrectionCode::Ok) {
+      m_energy_variations[itool][isys] = particle.e() / m_nominal_E[itool] - 1;
+
+      if (sys.basename().find("SCALE") != std::string::npos) { // sum only the scale variations
+        if (sys.parameter() == 1) m_energy_variations_sum_up[itool] += m_energy_variations[itool][isys] * m_energy_variations[itool][isys];
+        else if (sys.parameter() == -1) m_energy_variations_sum_down[itool] += m_energy_variations[itool][isys] * m_energy_variations[itool][isys];
+      }
+      ATH_MSG_DEBUG("calibrated with systematic " << sys.name() << ": " << particle.e());
+    }
+    else {
+      ATH_MSG_WARNING("Cannot calibrate electron with systematic");
+    }
+  }
+
+  m_energy_variations_sum_up[itool] = sqrt(m_energy_variations_sum_up[itool]);
+  m_energy_variations_sum_down[itool] = sqrt(m_energy_variations_sum_down[itool]);
+
+  return StatusCode::SUCCESS;
+}
+ 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.h
new file mode 100644
index 0000000000000000000000000000000000000000..c99ef08367ad8b6f22dea9213a03443250d24455
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/dumpAllSystematics.h
@@ -0,0 +1,84 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef DUMPALLSYSTEMATICS_H
+#define DUMPALLSYSTEMATICS_H
+
+#include <vector>
+#include <string>
+
+// Gaudi/Athena include(s):
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AsgTools/ToolHandle.h"
+
+#include "TTree.h"
+
+// Local include(s):
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
+
+class DumpAllSystematics : public AthAlgorithm {
+
+public:
+  /// Regular Algorithm constructor
+  DumpAllSystematics( const std::string& name, ISvcLocator* svcLoc );
+
+  virtual StatusCode initialize();
+  virtual StatusCode execute();
+  virtual StatusCode  finalize();
+
+  std::string m_particle_name;
+  std::string m_reco_container_name;
+  bool m_keep_one;
+
+private:
+  enum class ParticleType {ELECTRON, PHOTON};
+  ParticleType m_particle_type;
+
+  TTree* m_tree;
+
+  StatusCode do_truth(const xAOD::Egamma& particle);
+  StatusCode do_egamma(const xAOD::Egamma& particle);
+  StatusCode do_energy(xAOD::Egamma& particle, int itool);
+
+  unsigned long long m_EventNumber;
+  uint32_t m_RunNumber;
+  int m_instance_index;
+  float m_actualIntPerXing;
+  float m_averageIntPerXing;
+  float m_truth_pt;
+  float m_truth_phi;
+  float m_truth_eta;
+  float m_truth_E;
+  int m_truth_pdgId;
+  int m_truth_parent_pdgId;
+  bool m_truth_matched;
+  bool m_truth_isConv;
+  float m_truth_Rconv;
+  int m_npv;
+
+  float m_cl_phi;
+  float m_cl_eta;
+  float m_cl_etaCalo;
+  float m_cl_rawcl_Es0;
+  float m_cl_rawcl_Es1;
+  float m_cl_rawcl_Es2;
+  float m_cl_rawcl_Es3;
+  float m_cl_E;
+  float m_ph_Rconv;
+  int m_ph_convFlag;
+  float m_wstot;
+
+  std::vector<float> m_nominal_E;
+  std::vector<float> m_energy_variations_sum_up;
+  std::vector<float> m_energy_variations_sum_down;
+  std::vector<std::vector<float> > m_energy_variations;
+
+
+  ToolHandleArray<CP::IEgammaCalibrationAndSmearingTool> m_EgammaCalibrationAndSmearingTools;
+
+}; // class testAthenaEgammaCalibTool
+
+#endif // DUMPALLSYSTEMATICS_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/testAthenaEgammaCalibTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/testAthenaEgammaCalibTool.h
index 221d3c9d254a63ccb5253cf07bcb6b8650ae9fc4..a4b217e79fb17098a50066d6e1d0d6a3982b897f 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/testAthenaEgammaCalibTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/src/testAthenaEgammaCalibTool.h
@@ -12,7 +12,7 @@
 #include "AsgTools/ToolHandle.h"
 
 // Local include(s):
-#include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
 
 class testAthenaEgammaCalibTool : public AthAlgorithm {
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
index 89dac2a8766d719213915b9986d29d9e67ac4e8e..f4308e660534b53f6186ffe8effc6ccb8fcd7fcd 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
@@ -7,6 +7,8 @@ import ROOT
 import math
 import random
 
+RUN2016 = 297730l
+RUN2015 = 252604l
 
 def arange(xmin, xmax, delta):
     # just to don't inject dep from numpy
@@ -94,6 +96,7 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
         """
         tool = ROOT.CP.EgammaCalibrationAndSmearingTool("tool")
         self.assertTrue(tool.setProperty("ESModel", "es2012c").isSuccess())
+        self.assertTrue(tool.setProperty("int")("randomRunNumber", RUN2015).isSuccess())
         self.assertTrue(tool.setProperty("int")("doSmearing", 0).isSuccess())
         tool.msg().setLevel(ROOT.MSG.WARNING)
 
@@ -294,14 +297,14 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
 
                 spamwriter.writerow(args + [calibrated_energy])
 
-    @unittest.expectedFailure  # FIXME: the problem is in the factory
+    @unittest.skip("ATLASG-694")  # FIXME: the problem is in the factory
     def test_MVA_all_simulation(self):
         for particle in 'electron', 'photon':
             self._test_MVA('es2015PRE', particle, False)
             self._test_MVA('es2015cPRE', particle, False)
             self._test_MVA('es2012c', particle, False)
 
-    @unittest.expectedFailure  # FIXME: the problem is in the factory
+    @unittest.skip("ATLASG-694")  # FIXME: the problem is in the factory
     def test_MVA_all_data(self):
         for particle in 'electron', 'photon':
             self._test_MVA('es2015PRE', particle, True)
@@ -339,6 +342,9 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
             return [ss.name() for ss in s]
 
         def _test_list_syst(model, decorrelation, decorrelation_scale, decorrelation_resolution, allsyst, success=True):
+            """
+            test that the systematic variations are the expected ones
+            """
             tool = ROOT.CP.EgammaCalibrationAndSmearingTool("tool")
             tool.msg().setLevel(ROOT.MSG.WARNING)
             self.assertTrue(tool.setProperty("int")("useMVACalibration", 0).isSuccess())
@@ -358,7 +364,7 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
                 return
             sys_list = get_names_sys(tool)
             if type(allsyst) is int:
-                self.assertEqual(len(sys_list), allsyst)
+                self.assertEqual(len(sys_list), allsyst, msg='actual (expected) number of sys %d(%d): %s' % (len(sys_list), allsyst, sys_list))
             else:
                 self.assertItemsEqual(sys_list, allsyst)
             return sys_list
@@ -390,6 +396,7 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
         _test_list_syst("es2012c", "FULL_ETACORRELATED_v1", None, None, 54)
         _test_list_syst("es2016PRE", "FULL_ETACORRELATED_v1", None, None, 62)
         _test_list_syst("es2015c_summer", "FULL_ETACORRELATED_v1", None, None, 60)
+        _test_list_syst("es2016data_mc15c",  "FULL_ETACORRELATED_v1", None, None, 68)
         _test_list_syst("es2012c", "FULL_v1", None, None, 148)
         _test_list_syst("es2012c", None, "FULL_v1", "FULL_v1", 148)
         _test_list_syst("es2015PRE", "FULL_v1", None, None, 158)
@@ -507,17 +514,20 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
                 self.assertAlmostEqual(pt1, pt2)
                 self.assertAlmostEqual(eta1, eta2)
 
-    def test_1NP_vs_FULL_es2015PRE(self):
+    def test_1NP_vs_FULL_es2017(self):
         """ check that the 1NP model is the squared sum of the single systematics """
-        tool_1NP = ROOT.CP.EgammaCalibrationAndSmearingTool("tool_es2015PRE_1NP")
-        tool_1NP.setProperty("ESModel", "es2015PRE").ignore()
+        tool_1NP = ROOT.CP.EgammaCalibrationAndSmearingTool("tool_es2016data_mc15c_1NP")
+        tool_1NP.setProperty("ESModel", "es2016data_mc15c").ignore()
         tool_1NP.setProperty("decorrelationModel", "1NP_v1").ignore()
+        tool_1NP.setProperty("int")("randomRunNumber", RUN2015).ignore()
         #tool_1NP.setProperty("int")("doSmearing", 0).ignore()   # remove
         #tool_1NP.msg().setLevel(ROOT.MSG.DEBUG)
+        
         tool_1NP.initialize().ignore()
 
-        tool_FULL = ROOT.CP.EgammaCalibrationAndSmearingTool("tool_es2015PRE_FULL")
-        tool_FULL.setProperty("ESModel", "es2015PRE").ignore()
+        tool_FULL = ROOT.CP.EgammaCalibrationAndSmearingTool("tool_es2016data_mc15c_FULL")
+        tool_FULL.setProperty("ESModel", "es2016data_mc15c").ignore()
+        tool_FULL.setProperty("int")("randomRunNumber", RUN2015).ignore()
         # use ETACORRELATED to compare. FULL_v1 will differ (very small difference) since by default
         # FULL_v1 divide the ZEESTAT by the sqrt(#bins)
         tool_FULL.setProperty("decorrelationModel", "FULL_ETACORRELATED_v1").ignore()
@@ -716,5 +726,7 @@ class TestEgammaCalibrationAndSmearingTool(unittest.TestCase):
 if __name__ == '__main__':
     ROOT.PyConfig.IgnoreCommandLineOptions = True
     ROOT.gROOT.ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C")
+#    from ROOT import EgammaCalibPeriodRunNumbersExample
+
     #ROOT.xAOD.TReturnCode.enableFailure()
     unittest.main()
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test_resolution.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test_resolution.py
index e3145c8705dd5b9bc596a5e8812668a3eaa801c4..453bc56dd33c2d84b88c14db5cf61e323515f6ce 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test_resolution.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test_resolution.py
@@ -92,7 +92,9 @@ class TestEgammaResolution(unittest.TestCase):
                                                   msg="resolution should be different for particle=%d, eta=%f, e=%d, rtype=%d" % (ptype, eta, e, t))
 
     def test_nonregression_run1(self):
-        f = ROOT.TFile("$ROOTCOREBIN/data/ElectronPhotonFourMomentumCorrection/test_resolution_nonregression_run1_data.root")
+        from PathResolver import PathResolver
+        rootfile = PathResolver.FindCalibFile("ElectronPhotonFourMomentumCorrection/v8/test_resolution_nonregression_run1_data.root")
+        f = ROOT.TFile(rootfile)
         tree = f.Get("test_resolution_nonregression_data_run1")
 
         for ievent in xrange(tree.GetEntries()):
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/ElectronPhotonFourMomentumCorrection_test_memory.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/ElectronPhotonFourMomentumCorrection_test_memory.cxx
index 9101231b613d5d6e6e57d87e534e7afe2b8f6d5e..28ac4b93e25ed79a1ad7e86d8aa8943f27d819b9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/ElectronPhotonFourMomentumCorrection_test_memory.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/ElectronPhotonFourMomentumCorrection_test_memory.cxx
@@ -6,7 +6,9 @@
 
 int main()
 {
+#ifdef XAOD_STANDALONE
   StatusCode::enableFailure();
+#endif // XAOD_STANDALONE
   CP::EgammaCalibrationAndSmearingTool tool("EgammaCalibrationAndSmearingTool");
   tool.msg().setLevel(MSG::DEBUG);
   tool.setProperty("ESModel", "es2015cPRE").ignore();
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/testEgammaCalibTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/testEgammaCalibTool.cxx
index 117da9fc4de38bc56601491037aee8ad0075b746..95f7e6ea9cb64ab96e62837616cd72f58321387e 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/testEgammaCalibTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/util/testEgammaCalibTool.cxx
@@ -18,6 +18,7 @@
 #   include "xAODRootAccess/Init.h"
 #   include "xAODRootAccess/TEvent.h"
 #   include "xAODRootAccess/TStore.h"
+#   include "xAODRootAccess/tools/ReturnCheck.h"
 #endif // ROOTCORE
 
 // EDM include(s):
@@ -69,10 +70,14 @@ int main( int argc, char* argv[] ) {
    CHECK( xAOD::Init( APP_NAME ) );
 
    // Open the input file:
-   const TString fileName = argv[ 1 ];
+   const TString fileName = argv[1];
    Info( APP_NAME, "Opening file: %s", fileName.Data() );
-   std::auto_ptr< TFile > ifile( TFile::Open( fileName, "READ" ) );
+   std::unique_ptr<TFile> ifile(TFile::Open( fileName, "READ"));
    CHECK( ifile.get() );
+   if ((!ifile.get() ) || ifile->IsZombie()) {
+     Error(APP_NAME, "Couldn't open file: %s", argv[1]);
+     return 1;
+   }
 
    // Create a TEvent object:
    xAOD::TEvent event( xAOD::TEvent::kClassAccess );
@@ -91,8 +96,9 @@ int main( int argc, char* argv[] ) {
 
    // Create the tool
    std::unique_ptr<CP::IEgammaCalibrationAndSmearingTool> tool(new CP::EgammaCalibrationAndSmearingTool("EgammaCalibrationAndSmearingTool"));
-   asg::setProperty(tool.get(), "ESModel", "es2015PRE");
-   tool->initialize();
+   asg::setProperty(tool.get(), "ESModel", "es2017_R21_PRE");
+   asg::setProperty(tool.get(), "randomRunNumber", 123456);
+   RETURN_CHECK(APP_NAME, tool->initialize());
 
 
    //===========SYSTEMATICS
@@ -104,6 +110,7 @@ int main( int argc, char* argv[] ) {
 
    for (auto sys : recommendedSystematics) { sysList.push_back(CP::SystematicSet({sys})); }
 
+
    // Loop over the events:
    for (Long64_t entry = 0; entry < entries; ++entry) {
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/CMakeLists.txt
index 634a3bb5cfeec9565164c7d6bdd7a84c56c86548..e9ade5a0cee2731aebe9754bdea14c22f732d051 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 776825 2016-10-06 11:22:55Z krasznaa $
 ################################################################################
 # Package: ElectronPhotonSelectorTools
 ################################################################################
@@ -20,13 +19,16 @@ atlas_depends_on_subdirs(
   Control/AthToolSupport/AsgTools
   Event/xAOD/xAODEgamma
   Event/xAOD/xAODTracking
-  Event/xAOD/xAODHIEvent
+  Reconstruction/MVAUtils
   PhysicsAnalysis/AnalysisCommon/PATCore
+  PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
   PRIVATE
   Control/CxxUtils
   Event/FourMomUtils
+  Event/xAOD/xAODHIEvent
   Event/xAOD/xAODCaloEvent
   Event/xAOD/xAODCore
+  Event/xAOD/xAODEventInfo
   Tools/PathResolver
   ${extra_dep} )
 
@@ -38,9 +40,9 @@ atlas_add_library( ElectronPhotonSelectorToolsLib
   ElectronPhotonSelectorTools/*.h Root/*.cxx
   PUBLIC_HEADERS ElectronPhotonSelectorTools
   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-  LINK_LIBRARIES AsgTools xAODEgamma xAODTracking xAODHIEvent PATCoreLib
+  LINK_LIBRARIES EgammaAnalysisInterfacesLib AsgTools xAODEgamma  xAODTracking xAODHIEvent PATCoreLib
   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CxxUtils FourMomUtils
-  xAODCaloEvent xAODCore PathResolver )
+  xAODCaloEvent xAODCore xAODEventInfo PathResolver MVAUtils )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( ElectronPhotonSelectorTools
@@ -70,10 +72,10 @@ if( XAOD_STANDALONE )
       LINK_LIBRARIES ${ROOT_LIBRARIES} xAODCore xAODEgamma CxxUtils AsgTools
       xAODRootAccess ElectronPhotonSelectorToolsLib )
 
-   atlas_add_executable( EGIdentification_testEMAmbiguityResolver
-      util/testEMAmbiguityResolver.cxx
+   atlas_add_executable( EGIdentification_testEGChargeIDSelector
+      util/testEGChargeIDSelector.cxx
       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEgamma AsgTools xAODRootAccess
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEgamma AsgTools xAODRootAccess 
       ElectronPhotonSelectorToolsLib )
 
 endif()
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..95f0c1460be995a851546ab514369b8f14024c83
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h
@@ -0,0 +1,43 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+#ifndef __ASGDEADHVCELLREMOVALTOOL__
+#define __ASGDEADHVCELLREMOVALTOOL__
+
+#include "EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h"
+#include "AsgTools/AsgTool.h"
+#include "xAODEgamma/EgammaFwd.h"
+
+class AsgDeadHVCellRemovalTool : public asg::AsgTool,
+				 virtual public IAsgDeadHVCellRemovalTool
+{
+  ASG_TOOL_CLASS2(AsgDeadHVCellRemovalTool, 
+		  IAsgDeadHVCellRemovalTool,
+		  asg::IAsgTool)
+
+public: 
+  /** Standard constructor */
+  AsgDeadHVCellRemovalTool(std::string myname);
+
+  /** Standard destructor */
+  virtual ~AsgDeadHVCellRemovalTool();
+
+  /** Gaudi Service Interface method implementations */
+  virtual StatusCode initialize();
+
+  /** Gaudi Service Interface method implementations */
+  virtual StatusCode finalize();
+
+  virtual bool accept( const xAOD::Egamma* eg ) const final;
+
+  /** Accept using reference **/
+  virtual bool accept( const xAOD::Egamma& part ) const final ;
+
+private:
+
+}; // End: class definition
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..01923da93d62c034b66a0eb8319705bc67642cf0
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h
@@ -0,0 +1,178 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef ELECTRONPHOTONSELECTORTOOLS_ASGELECTRONCHARGEIDSELECTORTOOL_H
+#define ELECTRONPHOTONSELECTORTOOLS_ASGELECTRONCHARGEIDSELECTORTOOL_H
+// Atlas includes
+#include "AsgTools/AsgTool.h"
+#include "MVAUtils/BDT.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
+#include <unordered_map>
+
+class AsgElectronChargeIDSelectorTool : public asg::AsgTool, 
+					virtual public IAsgElectronLikelihoodTool
+{
+  ASG_TOOL_CLASS2(AsgElectronChargeIDSelectorTool, IAsgElectronLikelihoodTool, IAsgSelectionTool)
+
+public:
+  /** Standard constructor */
+  AsgElectronChargeIDSelectorTool( const std::string myname);
+
+
+  /** Standard destructor */
+  virtual ~AsgElectronChargeIDSelectorTool();
+public:
+  /** Gaudi Service Interface method implementations */
+  virtual StatusCode initialize();
+
+  /** Gaudi Service Interface method implementations */
+  virtual StatusCode finalize();
+
+  // Main methods for IAsgSelectorTool interface
+  /** The main accept method: using the generic interface */
+  const Root::TAccept& accept( const xAOD::IParticle* part ) const;
+
+  /** The main accept method: the actual cuts are applied here */
+  const Root::TAccept& accept( const xAOD::Electron* eg ) const {
+    return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** The main accept method: the actual cuts are applied here */
+  const Root::TAccept& accept( const xAOD::Egamma* eg ) const {
+    return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** The main accept method: in case mu not in EventInfo online */
+  const Root::TAccept& accept( const xAOD::Electron* eg, double mu ) const;
+
+  /** The main accept method: in case mu not in EventInfo online */
+  const Root::TAccept& accept( const xAOD::Egamma* eg, double mu ) const;
+  
+  /** Accept using reference **/
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const {
+    return accept (&part);
+  }
+
+  /** Accept using reference **/
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const {
+    return accept (&part, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** Accept using reference **/
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part ) const {
+    return accept (&part, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** Accept using reference; in case mu not in EventInfo online **/
+  virtual const Root::TAccept& accept( const xAOD::Electron& part, double mu ) const {
+    return accept (&part, mu);
+  }
+
+  /** Accept using reference; in case mu not in EventInfo online **/
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part, double mu ) const {
+    return accept (&part, mu);
+  }
+
+  // Main methods for IAsgCalculatorTool interface
+
+  /** The main result method: the actual likelihood is calculated here */
+  const Root::TResult& calculate( const xAOD::IParticle* part ) const;
+
+  /** The main result method: the actual likelihood is calculated here */
+  const Root::TResult& calculate( const xAOD::Electron* eg ) const {
+    return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** The main result method: the actual likelihood is calculated here */
+  const Root::TResult& calculate( const xAOD::Egamma* eg ) const {
+    return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
+  }
+
+  /** The main result method: the actual likelihood is calculated here */
+  const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const;
+
+  /** The main result method: the actual likelihood is calculated here */
+  const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const; 
+
+  /** Method to get the plain TAccept */
+  inline virtual const Root::TAccept& getTAccept( ) const
+  {
+    // return m_rootTool->getTAccept();
+    return m_acceptDummy;
+  }
+
+
+  /** Method to get the plain TResult */
+  inline virtual const Root::TResult& getTResult( ) const
+  {
+    // return m_rootTool->getTResult();
+    return m_resultDummy;
+  }
+
+  /// Get the name of the current operating point
+  inline virtual std::string getOperatingPointName( ) const
+  // std::string AsgElectronChargeIDSelectorTool::getOperatingPointName() const
+  {    return m_WorkingPoint;  };
+  
+  // Private methods
+private:
+  /// Get the number of primary vertices
+  unsigned int getNPrimVertices() const;
+
+  //BDT instances for different ID operating points (Tight, Medium, Loose) and the vector corresponds to n-fold
+  const unsigned m_nfold  =1;
+  const unsigned m_bdt_index=0;
+  std::vector<MVAUtils::BDT*> m_v_bdts;
+
+  TString m_pid_name;
+  float m_cutOnBDT;
+
+  int m_cutPosition_bdt;
+  int m_resultPosition_bdt;
+
+  /** Working Point */
+  std::string m_WorkingPoint;
+
+  /** A dummy return TAccept object */
+  Root::TAccept m_acceptDummy;
+
+  /** A dummy return TResult object */
+  Root::TResult m_resultDummy;
+
+  /** A BDT to return TResult/TAccept object */
+  mutable Root::TAccept m_acceptBDT;
+  mutable Root::TResult m_resultBDT;
+
+  /// Whether to use the PV (not available for trigger)
+  bool m_usePVCont;
+
+  /// defualt nPV (when not using PVCont)
+  unsigned int m_nPVdefault;
+
+  /// The primary vertex container name
+  std::string m_primVtxContName;
+
+  /// The input ROOT file name that holds the PDFs
+  std::string m_trainingFile;
+
+  /// Flag for calo only LH
+  //bool m_caloOnly;
+
+  // BDT input variables
+  mutable std::unordered_map<std::string,float> m_map_inputs;
+  mutable std::vector<std::string> m_inputVars;
+
+  bool SetVariableRefs(std::vector<std::string> inputs, std::vector<float*> &inputPointers);
+
+}; // End: class definition
+
+
+
+
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
index 447751b6083bb6110ce0ab17a7ade05c72c8abc2..e019cf137afcb192e7b1bc222fc01803d8cdac59 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h
@@ -24,9 +24,10 @@
 #include "AsgTools/AsgTool.h"
 
 // Include the interfaces
-#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
-// Include the return object and the underlying ROOT tool
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+
 #include "PATCore/TAccept.h"
+
 #include <string>
 
 namespace Root{
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
index 4ed3639f6c3fb80850d57e76412f5aba8d48f79c..eacf301db76aef1ff666b9dd2c4bf6f056021933 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h
@@ -10,7 +10,7 @@
 
 // Atlas includes
 #include "AsgTools/AsgTool.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
 #include "xAODEgamma/ElectronFwd.h"
 #include "PATCore/TAccept.h"            // for TAccept
 #include "PATCore/TResult.h"            // for TResult
@@ -125,6 +125,8 @@ private:
 
   /// Get the name of the current operating point
 
+  /// check for FwdElectron
+  bool isForwardElectron( const xAOD::Egamma* eg, const float eta ) const;
 
 
   // Private member variables
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h
index 145c74a3188a942a0bb84525e0df173707efc84c..f7aa2b9b2944418ef0545abff8c14f132dd06ad9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h
@@ -20,7 +20,7 @@
 
 // Atlas includes
 #include "AsgTools/AsgTool.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronMultiLeptonSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h"
 
 // Include the return object and ROOT tool
 #include "PATCore/TAccept.h"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
index 026f90b670c4607cea884bd8797327957ec397fa..8bde35a92c0ba336c28fc14b29fccd1543fb7573 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h
@@ -24,9 +24,10 @@
 #include "AsgTools/AsgTool.h"
 
 // Include the interfaces
-#include "ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h"
-// Include the return object and the underlying ROOT tool
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
+
 #include "PATCore/TAccept.h"
+
 #include <string>
 
 namespace Root{
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
index 1274a539a9d85f528d2263a452318f7d040bb605..9f7db442eff7626c51a548620e1e2e96ae239a06 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h
@@ -23,7 +23,7 @@
 #include "AsgTools/AsgTool.h"
 
 // Include the interfaces
-#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
 #include "xAODEgamma/PhotonFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
 #include "xAODEgamma/ElectronFwd.h"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/EGammaAmbiguityTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/EGammaAmbiguityTool.h
index f19ab7cc2d1b10a1022dd411d8b3c21492d108cf..f0ae8f136d19360df58f3b23632dd7acc989e669 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/EGammaAmbiguityTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/EGammaAmbiguityTool.h
@@ -17,7 +17,7 @@
 
 // Atlas includes
 #include "AsgTools/AsgTool.h"
-#include "ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h"
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
 #include "xAODEgamma/EgammaContainerFwd.h"
 
 class EGammaAmbiguityTool : public asg::AsgTool,
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsCoreDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsCoreDict.h
index 346c538d8ef6a1513942783f29d25c7eb0d6bd4c..43757494d432d5af4058cbbbff56f28396b56d56 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsCoreDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsCoreDict.h
@@ -8,6 +8,6 @@
 #define __ELECTRONPHOTONSELECTORTOOLSCOREDICT__
 
 #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" 
-#include "ElectronPhotonSelectorTools/LikelihoodEnums.h" //For the LikelihoodEnums
+#include "ElectronPhotonSelectorTools/LikelihoodEnums.h" 
 
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsDict.h
deleted file mode 100644
index c0fb3d8eddd2330d120c776cb35cab9cd51ae7ff..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsDict.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Dear emacs, this is -*-c++-*-
-
-#ifndef __ELECTRONPHOTONSELECTORTOOLSDICT__
-#define __ELECTRONPHOTONSELECTORTOOLSDICT__
-
-/**
-   @brief For dictionary generation.
-
-   @author Tulay Cuhadar Donszelmann, Jovan Mitrevski
-   @date   September 2011
-
-*/
-
-#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
-#include "ElectronPhotonSelectorTools/LikelihoodEnums.h" //For the LikelihoodEnums
-// for python
-#include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h"
-#include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
-#include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
-
-#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
index 705ebd32518ccbc1edb46d21dd31ebdae1cf8afd..809b4c30819790de7964f8083b12140996000177 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
@@ -2,8 +2,8 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef __ELECTRONPHOTONSELECTORTOOLSPYTHONDICT__
-#define __ELECTRONPHOTONSELECTORTOOLSPYTHONDICT__
+#ifndef ELECTRONPHOTONSELECTORTOOLS_ELECTRONPHOTONSELECTORTOOLPYTHONDICT_H
+#define ELECTRONPHOTONSELECTORTOOLS_ELECTRONPHOTONSELECTORTOOLPYTHONDICT_H
 
 // for python
 #include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
@@ -12,4 +12,6 @@
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 #include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
+#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
+#include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronSelectorHelpers.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronSelectorHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..868f695bb935483ed347c51efb2ce4961620bb8f
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronSelectorHelpers.h
@@ -0,0 +1,38 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef __ELECTRONSELECTORHELPERS__
+#define __ELECTRONSELECTORHELPERS__
+
+// Atlas includes
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include <cstddef>
+
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
+
+namespace ElectronSelectorHelpers{
+  ///@brief return the number of Pixel hits plus dead sensors in the track particle
+  std::size_t numberOfPixelHitsAndDeadSensors(const xAOD::TrackParticle *tp);
+
+  ///@brief return the number of SCT hits plus dead sensors in the track particle
+  std::size_t numberOfSCTHitsAndDeadSensors(const xAOD::TrackParticle *tp);
+
+  ///@brief return the number of Silicon hits plus dead sensors in the track particle
+  std::size_t numberOfSiliconHitsAndDeadSensors(const xAOD::TrackParticle *tp);
+
+  ///@brief return true if effective number of BL hits + outliers is at least one
+  //        (that is, if innermost layer is masked off, look at the next
+  //        to innermost layer. If both are off, then return true)
+  bool passBLayerRequirement(const xAOD::TrackParticle *tp);
+
+  ///@brief return true if the ambiguity type is one of several that are stored in a bitmask
+  bool passAmbiguity(xAOD::AmbiguityTool::AmbiguityType type, const uint8_t criterion);
+
+  struct ROOT6_NamespaceAutoloadHook{};
+}
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgDeadHVCellRemovalTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgDeadHVCellRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..636692d2dcfe6e94fab0f4e7f37ea7c36706a26a
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgDeadHVCellRemovalTool.h
@@ -0,0 +1,13 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+#ifndef __IASGDEADHVCELLREMOVALTOOL__
+#define __IASGDEADHVCELLREMOVALTOOL__
+
+#include "EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h
index 22f289f95041341e98633b360eb1144cd4d0a384..757e3e627b504086b4459568ff6b8179a25439e2 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h
@@ -7,59 +7,8 @@
 #ifndef __IASGEGAMMAISEMSELECTOR__
 #define __IASGEGAMMAISEMSELECTOR__
 
-/**
-   @class IAsgEGammaIsEMSelector
-   @brief Interface to tool to select photons
-
-   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
-   @date   Dec 2011 - Fab 2012
-
-   11-MAR-2014, convert to ASGTool
-*/
-
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
-
-// Forward declarations
-namespace Root{
-  class TAccept;
-}
-#include "xAODEgamma/EgammaFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/ElectronFwd.h"
-
-class IAsgEGammaIsEMSelector : virtual public IAsgSelectionTool
-{
-
-  ASG_TOOL_INTERFACE(IAsgEGammaIsEMSelector)
-
-public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgEGammaIsEMSelector() {};
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
-
-  /////Egammma IsEM specific methods
-
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
-
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
-
-  virtual unsigned int IsemValue() const =0;
-
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const =0;
- 
-}; // End: class definition
-
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h
index 4681916939452e9d5b397461653cab17fb06e1f4..79d4556e8453cee72672a61cf02f83f9868cc1b4 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h
@@ -7,79 +7,8 @@
 #ifndef __IASGELECTRONISEMSELECTOR__
 #define __IASGELECTRONISEMSELECTOR__
 
-/**
-   @class IAsgElectronIsEMSelector
-   @brief Interface to tool to select electrons
-
-   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
-   @date   Dec 2011 - Fab 2012
-
-   11-MAR-2014, convert to ASGTool
-*/
-
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-#include "ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
-// Forward declarations
-namespace Root{
-  class TAccept;
-}
-#include "xAODEgamma/ElectronFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/EgammaFwd.h"
-
-class IAsgElectronIsEMSelector : virtual public IAsgEGammaIsEMSelector
-{
-
-  ASG_TOOL_INTERFACE(IAsgElectronIsEMSelector)
-  
-  public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgElectronIsEMSelector() {};
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
-  
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
-
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
-
-  /** Accept with Photon objects */
-  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
-
-  /** Accept with Photon objects */
-  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
-
-  /** Accept with Electron objects */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
-
-  /** Accept with Electron objects */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
-
-
-  ///////////////Expert methods //////////////////////////////////////
-
-  
-  //The main execute method
-  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
-
-  //////////////////////////////////////////////////////////////
-  virtual unsigned int IsemValue() const = 0;
-  
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const =0;
-
-
-
-}; // End: class definition
-
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h
index 261caf3a2d76c4488b813a0bbc92c9eb8e846e14..5955935ff6a68772297b795ff9123129445ae4ae 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h
@@ -2,101 +2,11 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-// Dear emacs, this is -*-c++-*-
-
 #ifndef __IASGELECTRONLIKELIHOODSELECTOR__
 #define __IASGELECTRONLIKELIHOODSELECTOR__
 
-/**
-   @class IAsgElectronLikelihoodTool
-   @brief Interface to tool to select electrons
-
-   12-MAR-2014, convert to ASG tool
-
-*/
-
-// CONSIDER MERGING THIS WITH IASGELECTRONMULTILEPTONSELECTOR, SINCE THE INTERFACE
-// IS EXACTLY THE SAME. LEAVING THEM SEPERATE FOR NOW IN CASE THEY DIVERGE
-
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-// Forward declarations
-namespace Root{
-  class TAccept;
-  class TResult;
-}
-#include "xAODEgamma/ElectronFwd.h"
-#include "xAODEgamma/EgammaFwd.h"
-
-class IAsgElectronLikelihoodTool : virtual public IAsgSelectionTool
-{
-
-  ASG_TOOL_INTERFACE(IAsgElectronLikelihoodTool)
-
-  public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgElectronLikelihoodTool() {};
-
-
-  /** The main accept method: using the generic interface , with pointers*/
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part ) const = 0;
-
-  /** The main accept method: in case mu not in EventInfo online */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part, double mu ) const = 0;
-
-  /** The main accept method: in case mu not in EventInfo online */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part, double mu ) const = 0;
-
-
-  /** The main accept method: using the generic interface, with reference */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part ) const = 0;
-
-  /** The main accept method: in case mu not in EventInfo online */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part, double mu ) const = 0;
-
-  /** The main accept method: in case mu not in EventInfo online */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part, double mu ) const = 0;
-
-
-  /** The main result method: the actual likelihood is calculated here */
-  virtual const Root::TResult& calculate( const xAOD::IParticle* part ) const = 0;
-
-  /** The main result method: the actual likelihood is calculated here */
-  virtual const Root::TResult& calculate( const xAOD::Electron* eg ) const = 0;
-
-  /** The main result method: the actual likelihood is calculated here */
-  virtual const Root::TResult& calculate( const xAOD::Egamma* eg ) const = 0;
-
-  /** The main result method: in case mu not in EventInfo online */
-  virtual const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const = 0;
-
-  /** The main result method: in case mu not in EventInfo online */
-  virtual const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const = 0;
-
-
-  /** Method to get the plain TResult */
-  virtual const Root::TResult& getTResult( ) const=0;
-
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const =0;
-
-  //virtual const Root::TAccept& getTAccept( ) const =0; // in base
-
-}; // End: class definition
-
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronMultiLeptonSelector.h
index 88ec591fecbdd5428c2e52470f89bb4e4329770e..8d0b4c4495e23ac4703bb95212cc2c982ead8300 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronMultiLeptonSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgElectronMultiLeptonSelector.h
@@ -7,46 +7,8 @@
 #ifndef __IASGELECTRONMULTILEPTONSELECTOR__
 #define __IASGELECTRONMULTILEPTONSELECTOR__
 
-/**
-   @class IAsgElectronMultiLeptonSelector
-   @brief Interface to tool to select electrons
-
-   12-MAR-2014, convert to ASG tool
-
-*/
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-// Forward declarations
-namespace Root{
-  class TAccept;
-}
-#include "xAODEgamma/ElectronFwd.h"
-
-class IAsgElectronMultiLeptonSelector : virtual public IAsgSelectionTool
-{
-
-  ASG_TOOL_INTERFACE(IAsgElectronMultiLeptonSelector)
-
-public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgElectronMultiLeptonSelector() {};
-
-  /** The main accept method: using the generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
-  /** The main accept method: using the generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
-
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const=0;
-
-}; // End: class definition
+#include "EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h
index 9529b301f1b40452789a1fe954a965b3f1231ccd..f07a46f8a3c3492241bd4e592706822a7a5399f1 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h
@@ -7,81 +7,8 @@
 #ifndef __IASGFORWARDELECTRONISEMSELECTOR__
 #define __IASGFORWARDELECTRONISEMSELECTOR__
 
-/**
-   @class IAsgForwardElectronIsEMSelector
-   @brief Interface to tool to select electrons
-
-   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
-   @date   Dec 2011 - Fab 2012
-
-   11-MAR-2014, convert to ASGTool
-*/
-
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-#include "ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h"
-// Include the return object and the underlying ROOT tool
-#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
-
-// Forward declarations
-namespace Root{
-  class TAccept;
-}
-#include "xAODEgamma/ElectronFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/EgammaFwd.h"
-
-class IAsgForwardElectronIsEMSelector : virtual public IAsgEGammaIsEMSelector
-{
-
-  ASG_TOOL_INTERFACE(IAsgForwardElectronIsEMSelector)
-  
-  public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgForwardElectronIsEMSelector() {};
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
-  
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
-
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
-
-  /** Accept with Photon objects */
-  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
-
-  /** Accept with Photon objects */
-  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
-
-  /** Accept with Electron objects */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
-
-  /** Accept with Electron objects */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
-
-
-  ///////////////Expert methods //////////////////////////////////////
-
-  
-  //The main execute method
-  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
-
-  //////////////////////////////////////////////////////////////
-  virtual unsigned int IsemValue() const = 0;
-  
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const =0;
-
-
-
-}; // End: class definition
-
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h
index 016a29d67250290db7ba47aee23abe3e12fe0edc..b46ec975a4d22221611784a4c9256e6b72ca81a4 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h
@@ -7,74 +7,8 @@
 #ifndef __IASGPHOTONISEMSELECTOR__
 #define __IASGPHOTONISEMSELECTOR__
 
-/**
-   @class IAsgPhotonIsEMSelector
-   @brief Interface to tool to select photons
-
-   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
-   @date   Dec 2011 - Fab 2012
-
-   11-MAR-2014, convert to ASGTool
-*/
-
-// Include the interfaces
-#include "PATCore/IAsgSelectionTool.h"
-#include "ElectronPhotonSelectorTools/IAsgEGammaIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
-
-// Forward declarations
-namespace Root{
-  class TAccept;
-}
-#include "xAODEgamma/EgammaFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/ElectronFwd.h"
-
-class IAsgPhotonIsEMSelector : virtual public IAsgEGammaIsEMSelector
-{
-
-  ASG_TOOL_INTERFACE(IAsgPhotonIsEMSelector)
-
-public:
-
-  /**Virtual Destructor*/
-  virtual ~IAsgPhotonIsEMSelector() {};
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
-
-  /** Accept with generic interface */
-  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
-  
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
-
-  /** Accept with Egamma objects */
-  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
-
-  /** The main accept method: the actual cuts are applied here */
-  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
-
-
-  ////Expert methods /////////////////////////////////////
-  /** The isem potentially for the trigger */
-  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
-
-  virtual unsigned int IsemValue() const =0;
-
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const =0;
- 
-}; // End: class definition
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h
index ed7a2044ddc4dd9d7244952c33393b75acfd2cb1..8008a8dbb843854456ba9f6fc763ea9516bbdf8e 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h
@@ -2,86 +2,11 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-// Dear emacs, this is -*-c++-*-
-
 #ifndef __IEGammaAmbiguityTool__
 #define __IEGammaAmbiguityTool__
 
-/**
-   @class EGammaAmbiguityTool
-   @brief Electron / photon ambiguity resolution. Dual-use version, interface
-
-   @author Bruno Lenzi
-   @date   May 2015
-*/
-
-// Include the interfaces
-#include "AsgTools/IAsgTool.h"
-
-// Include the return object
-// #include "PATCore/TAccept.h"
-
-// Forward declarations
-#include "xAODCaloEvent/CaloClusterFwd.h"
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/TrackParticleFwd.h"
-#include "xAODEgamma/EgammaFwd.h"
-#include "xAODEgamma/EgammaContainerFwd.h"
-
-//This will need to be copied over to EgammaEnums.h
-//under xAODEgamma
-//Plus Set/Get true Accessor methods when we have 
-//finalise the design.
-namespace xAOD {
-  namespace AmbiguityTool {
-    /// @name Ambiguity types
-    enum AmbiguityType {
-      electron = 0,
-      ambiguousTrackEoverPBetterThanVertexEoverP=1,
-      ambiguousTrackLowPt=2,
-      ambiguousTrackLowEoverP=3,
-      ambiguousTrackNoPixel =4,
-      ambiguousVertexEoverPBetterThanTrackEoverP=5,
-      photon=6,
-      unknown=7
-    };
-  }
-}
-
-
-
-class IEGammaAmbiguityTool : virtual public asg::IAsgTool
-{
-  ASG_TOOL_INTERFACE(IEGammaAmbiguityTool)
-
-public:
-
-  /**Virtual Destructor*/
-  virtual ~IEGammaAmbiguityTool() {};
-
-  /** Return value: AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown */
-  virtual unsigned int ambiguityResolve(const xAOD::CaloCluster* cluster,
-                                        const xAOD::Vertex* vx,
-                                        const xAOD::TrackParticle* tp, xAOD::AmbiguityTool::AmbiguityType& type) const = 0;
-
-  /** Return value: AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown 
-      Needed because of cliets
-      implementation calls method above
-   */
-  virtual unsigned int ambiguityResolve(const xAOD::CaloCluster* cluster,
-                                        const xAOD::Vertex* vx,
-                                        const xAOD::TrackParticle* tp) const = 0;
-
-  /** Redo the ambiguity resolution of central electrons and photons and return
-    * AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown 
-    * or the author of the object if no overlapping object is found **/
-  virtual unsigned int ambiguityResolve(const xAOD::Egamma& egamma) const = 0;
-
-  /** Accept or reject egamma object based on ambiguity resolution */
-  virtual bool accept( const xAOD::Egamma& egamma, bool acceptAmbiguous = true) const = 0;
-  
-}; // End: class definition
-
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/LikelihoodEnums.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/LikelihoodEnums.h
index f78b682c931da2d46884d513780326e04f318e4a..6efd7309f243a156283942a8d7ce46acd28f1f63 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/LikelihoodEnums.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/LikelihoodEnums.h
@@ -2,8 +2,8 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef ELECTRON_LIKELIHOODENUMS_H
-#define ELECTRON_LIKELIHOODENUMS_H
+#ifndef _LIKELIHOODENUMS_H
+#define _LIKELIHOODENUMS_H
 
 
 namespace LikeEnum {
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/egammaPIDdefs.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/egammaPIDdefs.h
index 946e42877158a2db213a53a554decdeeb7de8a78..90358faf132ce06e62427a55f1df89d52cfb453b 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/egammaPIDdefs.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/egammaPIDdefs.h
@@ -2,8 +2,8 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef ELECTRONPHOTONSELECTORTOOLS_EGAMMAPIDDEFS_H
-#define ELECTRONPHOTONSELECTORTOOLS_EGAMMAPIDDEFS_H
+#ifndef _EGAMMAPIDDEFS_H
+#define _EGAMMAPIDDEFS_H
 /**
   @class egammaPIDdefs
      This file defines the bit-occupation of the PID and OQ flags of egamma 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selection.xml b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selection.xml
deleted file mode 100644
index 6b443e8620dd52795a01deea551971edcfceae22..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selection.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<lcgdict>
-  <enum pattern="egammaPID::*"/>
-  <variable pattern="egammaPID::*"/>
-  <class name="egammaPID::ROOT6_NamespaceAutoloadHook" /> 
-  <enum name="LikeEnum::Menu" />
-  <class name="LikeEnum::ROOT6_NamespaceAutoloadHook" /> 
-  <class name="IAsgElectronIsEMSelector" /> 
-  <class name="IAsgForwardElectronIsEMSelector" /> 
-  <class name="IAsgPhotonIsEMSelector" />
-  <class name="IAsgElectronMultiLeptonSelector" /> 
-  <class name="IAsgElectronLikelihoodTool" /> 
-  <class name="IEGammaAmbiguityTool" />
-  <class name="AsgElectronIsEMSelector" /> 
-  <class name="AsgForwardElectronIsEMSelector" /> 
-  <class name="AsgPhotonIsEMSelector" />
-  <class name="AsgElectronMultiLeptonSelector" /> 
-  <class name="AsgElectronLikelihoodTool" /> 
-  <class name="EGammaAmbiguityTool" /> 
-</lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
index 73344b6702662d3ca20e98af7dae9b2550c4b35e..3f816ee712fd6461e97da31d2c8004106a49e2c2 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
@@ -1,14 +1,10 @@
 <lcgdict>
-  <class name="IAsgElectronIsEMSelector" /> 
-  <class name="IAsgForwardElectronIsEMSelector" /> 
-  <class name="IAsgPhotonIsEMSelector" />
-  <class name="IAsgElectronMultiLeptonSelector" /> 
-  <class name="IAsgElectronLikelihoodTool" /> 
-  <class name="IEGammaAmbiguityTool" />
   <class name="AsgElectronIsEMSelector" /> 
   <class name="AsgForwardElectronIsEMSelector" /> 
   <class name="AsgPhotonIsEMSelector" />
   <class name="AsgElectronMultiLeptonSelector" /> 
   <class name="AsgElectronLikelihoodTool" /> 
   <class name="EGammaAmbiguityTool" /> 
+  <class name="AsgDeadHVCellRemovalTool" /> 
+  <class name="AsgElectronChargeIDSelectorTool"/>
 </lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgDeadHVCellRemovalTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgDeadHVCellRemovalTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..e9089d33605d9a443b723064945189284d4bfc16
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgDeadHVCellRemovalTool.cxx
@@ -0,0 +1,99 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
+#include "xAODEgamma/Egamma.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "xAODEventInfo/EventInfo.h"
+
+AsgDeadHVCellRemovalTool::AsgDeadHVCellRemovalTool(std::string myname) :
+  asg::AsgTool(myname){
+}
+
+AsgDeadHVCellRemovalTool::~AsgDeadHVCellRemovalTool(){
+}
+
+StatusCode AsgDeadHVCellRemovalTool::initialize(){
+  return StatusCode::SUCCESS ;
+}
+
+StatusCode AsgDeadHVCellRemovalTool::finalize(){
+  return StatusCode::SUCCESS;
+}
+
+bool AsgDeadHVCellRemovalTool::accept( const xAOD::Egamma* eg ) const{
+  
+  if ( !eg ){
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return false;
+  }
+  
+  const xAOD::CaloCluster* cluster = eg->caloCluster();  
+  if ( !cluster ){
+    ATH_MSG_ERROR ("Failed, cluster.");
+    return false;
+  }  
+
+  const xAOD::EventInfo *eventInfo = evtStore()->retrieve< const xAOD::EventInfo> ("EventInfo");
+  bool isSimul= eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION);
+  
+  unsigned int runnumber (0);
+  static const SG::AuxElement::ConstAccessor<unsigned int> randomrunnumber("RandomRunNumber");
+  static const SG::AuxElement::ConstAccessor<unsigned int> datarunnumber("runNumber");
+  
+  if(!isSimul&& datarunnumber.isAvailable(*eventInfo) ){
+    runnumber = datarunnumber(*eventInfo);
+  }
+  else if(isSimul && randomrunnumber.isAvailable(*eventInfo) ){
+    runnumber = randomrunnumber(*eventInfo);
+  }
+  else {
+    ATH_MSG_ERROR ("Failed, to retrieve the proper run number from event info");
+    return false;
+  }
+  
+  double eta_calo;
+  double phi_calo;
+  if (! cluster->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,eta_calo) || 
+      ! cluster->retrieveMoment(xAOD::CaloCluster::PHICALOFRAME,phi_calo)){
+    ATH_MSG_ERROR ("Could not get Eta/Phi in calo frame");
+    return false;
+  }
+  
+  if ((runnumber>=296939 && runnumber<298967) || 
+      (runnumber>=299144 && runnumber<300279)){
+    
+    if (   eta_calo > - 1.825 
+	   && eta_calo < -1.5  
+	   && phi_calo > -1.104921 
+	   && phi_calo < -0.956748){
+      return false;
+    }
+  } 
+  
+  if ((runnumber>=298967 && runnumber<299144 ) || 
+      (runnumber>=300279 && runnumber< 305291)){
+    
+    if (eta_calo > - 1.825 
+	&& eta_calo < -1.5  
+	&& phi_calo > -1.104921 
+	&& phi_calo < -0.956748){
+      return false;
+    }
+    
+    if (eta_calo> - 1.825 
+	&& eta_calo < -1.5  
+	&& phi_calo > 1.054922 
+	&& phi_calo < 1.203097){
+      return false;
+    }
+  }
+  
+  return true ;
+}
+
+bool AsgDeadHVCellRemovalTool::accept( const xAOD::Egamma& part ) const{
+  return accept (&part);
+}
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..12e689e5f81f5858eb9a1151acadc0fc8c07370c
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx
@@ -0,0 +1,543 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+   @class AsgElectronChargeIDSelectorTool
+   @brief Electron selector tool to select objects in Asgena using an underlying pure ROOT tool.
+
+   @author Karsten Koeneke
+   @date   October 2012
+
+   09-APR-2014, convert to ASGTool (Jovan Mitrevski)
+   22-AUG-2016, copied from AsgElectronLikelihoodTool (Kazuya Mochizuki)
+
+*/
+
+// Include this class's header
+#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
+//#include "AsgElectronPhotonIsEMSelectorConfigHelper.h"
+//#include "EGSelectorConfigurationMapping.h"
+
+// STL includes
+#include <string>
+#include <cstdint>
+#include <cmath>
+
+//EDM includes
+#include "xAODEgamma/Electron.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODCaloEvent/CaloCluster.h"
+#include "TEnv.h"
+#include "TFile.h"
+#include "TObjString.h"
+#include "TObjArray.h"
+
+
+#include "PathResolver/PathResolver.h"
+
+
+//=============================================================================
+// Standard constructor
+//=============================================================================
+AsgElectronChargeIDSelectorTool::AsgElectronChargeIDSelectorTool(std::string myname) :
+  AsgTool(myname) //,m_cutOnBDT(0)//,m_configFile("")//,m_rootTool(0)
+{
+  // Declare the needed properties
+  declareProperty("WorkingPoint",m_WorkingPoint="","The Working Point");
+  //declareProperty("ConfigFile",m_configFile="","The config file to use");
+  declareProperty("usePVContainer", m_usePVCont=true, "Whether to use the PV container");
+  declareProperty("nPVdefault", m_nPVdefault = 0, "The default number of PVs if not counted");
+  declareProperty("primaryVertexContainer", m_primVtxContName="PrimaryVertices", "The primary vertex container name" );
+
+  declareProperty("TrainingFile",  m_trainingFile="", "The input ROOT file name holding training" );
+  declareProperty("CutOnBDT",m_cutOnBDT=0,"Cut on BDT discriminant");
+  m_pid_name=myname.data();
+}
+
+
+//=============================================================================
+// Standard destructor
+//=============================================================================
+AsgElectronChargeIDSelectorTool::~AsgElectronChargeIDSelectorTool()
+{
+  if(finalize().isFailure()){
+    ATH_MSG_ERROR ( "Failure in AsgElectronChargeIDSelectorTool finalize()");
+  }
+  //delete m_rootTool;
+  for (auto bdt: m_v_bdts) if (bdt) delete bdt;
+}
+
+
+//=============================================================================
+// Asgena initialize method
+//=============================================================================
+StatusCode AsgElectronChargeIDSelectorTool::initialize()
+{
+  m_pid_name.ToLower();
+  if      (m_pid_name.Contains("recon") ) m_pid_name="recon" ;
+  else if (m_pid_name.Contains("loose") ) m_pid_name="loose" ;
+  else if (m_pid_name.Contains("medium")) m_pid_name="medium";
+  else if (m_pid_name.Contains("tight") ) m_pid_name="tight" ;
+  else {
+    m_pid_name="tight";
+    ATH_MSG_WARNING("PID menu was not recognized, using default PID menu: " << m_pid_name );
+  }
+  ATH_MSG_INFO("PID menu to use: " << m_pid_name );
+
+  std::string TrainingFile;
+  if (!m_trainingFile.empty()) {  //If the property was set by the user, take that.
+
+    //KM: below should be uncommented after the file is in the official place!!
+    TrainingFile= PathResolverFindCalibFile( m_trainingFile );
+    if(TrainingFile==""){//Error if it cant find the conf
+      ATH_MSG_ERROR("Could not locate " << m_trainingFile );
+      return StatusCode::FAILURE;
+    }
+    else ATH_MSG_INFO("trainingfile to use  " << TrainingFile );
+   
+  }
+  else {
+    ATH_MSG_ERROR("Could not find configuration file: \""<< m_trainingFile<<"\"");
+    return StatusCode::FAILURE;
+  }
+  
+  TFile* bdtfile = TFile::Open(TrainingFile.data());
+  if (!bdtfile) {
+    ATH_MSG_ERROR("Input file found to be empty!! "<< TrainingFile);
+    return StatusCode::FAILURE;
+  }
+
+  TObjArray* toa= (TObjArray*) bdtfile->Get("/ECIDS_"+m_pid_name+"/variables");
+  std::string commaSepVars="";
+  if (toa) {
+    TObjString *tos= 0;
+    if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0);
+    commaSepVars=tos->GetString().Data();
+    ATH_MSG_INFO("Variables for ECIDS= "<<commaSepVars);
+  }
+  else ATH_MSG_FATAL("Training file does not contain a list of input variables");
+
+  //prepare m_inputVars
+  m_inputVars.clear();
+  while (commaSepVars.find(",")!=std::string::npos) {
+    m_inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(",")));
+    commaSepVars.erase(0,commaSepVars.find(",")+1);
+  }
+  m_inputVars.push_back(commaSepVars.substr(0,-1));//push back the last element
+
+  std::vector<float*> inputPointers;  //KM: set pointers
+  for (unsigned i_fold=0; i_fold<m_nfold; i_fold++) {
+    TString treename="/ECIDS_"+m_pid_name+"/BDT";//=TString::Format("/CFK_tight/BDT_%do%d",i_fold,m_nfold);
+    //std::cout<<"Trying to access a ttree with name: "<<treename<<std::endl;
+    TTree* tree = (TTree*)bdtfile->Get(treename);
+    m_v_bdts.push_back(new MVAUtils::BDT(tree));
+    bool noBadVariableFound = true;
+    if (i_fold==0) noBadVariableFound = SetVariableRefs(m_inputVars,inputPointers);
+    if (!noBadVariableFound) {
+      std::cerr<<"\tUnknown input variable given, disabling the algorithm...."<<std::endl;
+      exit(1);
+      //KM: disabling feature to be implemented.
+    }
+    m_v_bdts.back()->SetPointers(inputPointers);
+  }
+  
+  ///-----------End of text config----------------------------
+
+  // Get the name of the current operating point, and massage the other strings accordingly
+  //ATH_MSG_VERBOSE( "Going to massage the labels based on the provided operating point..." );
+
+  m_cutPosition_bdt = m_acceptBDT.addCut( "bdt", "pass bdt" );
+  m_resultPosition_bdt = m_resultBDT.addResult( "bdt", "ECIDS bdt" );
+
+  return StatusCode::SUCCESS ;
+}
+
+
+//=============================================================================
+// Asgena finalize method (now called by destructor)
+//=============================================================================
+StatusCode AsgElectronChargeIDSelectorTool::finalize()
+{
+  return StatusCode::SUCCESS;
+}
+
+
+//=============================================================================
+// The main accept method: the actual cuts are applied here 
+//=============================================================================
+const Root::TAccept& AsgElectronChargeIDSelectorTool::accept( const xAOD::Electron* eg, double mu ) const
+{
+
+  double bdt=calculate(eg,mu);
+  
+  ATH_MSG_VERBOSE("\t accept( const xAOD::Electron* eg, double mu ), bdt="<<bdt);
+  
+  m_acceptBDT.clear();
+  
+  m_acceptBDT.setCutResult(m_cutPosition_bdt,bdt>m_cutOnBDT);
+
+  return m_acceptBDT;
+}
+
+//=============================================================================
+// Accept method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly
+//=============================================================================
+const Root::TAccept& AsgElectronChargeIDSelectorTool::accept( const xAOD::Egamma* eg, double mu) const
+{
+  double bdt=calculate(eg,mu);
+  
+  ATH_MSG_VERBOSE("\t accept( const xAOD::Egamma* eg, double mu ), bdt="<<bdt);
+  
+  m_acceptBDT.clear();
+  
+  m_acceptBDT.setCutResult(m_cutPosition_bdt,bdt>m_cutOnBDT);
+
+  return m_acceptBDT;
+}
+
+//=============================================================================
+// The main result method: the actual likelihood is calculated here
+//=============================================================================
+const Root::TResult& AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu ) const
+{
+
+  ATH_MSG_VERBOSE("\t AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu= "<<mu<<" )");
+
+  if ( !eg ) {
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return m_resultDummy;
+  }
+  
+  const xAOD::CaloCluster* cluster = eg->caloCluster();
+  if ( !cluster ) {
+    ATH_MSG_ERROR ("Failed, no cluster.");
+    return m_resultDummy;
+  }  
+
+  const double energy =  cluster->e();
+  const float eta = cluster->etaBE(2); 
+  if ( fabs(eta) > 300.0 ) {
+    ATH_MSG_ERROR ("Failed, eta range.");
+    return m_resultDummy;
+  }
+  
+  double et = 0.;// transverse energy of the electron (using the track eta) 
+  if (eg->trackParticle() )
+    et     = ( cosh(eg->trackParticle()->eta()) != 0.) ? energy/cosh(eg->trackParticle()->eta()) : 0.;
+  else et  = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.;
+  
+  
+  // number of track hits and other track quantities
+  uint8_t nSCT(0); 
+  // uint8_t nTRThigh(0); 
+  // uint8_t nTRThighOutliers(0); 
+  // uint8_t nTRT(0); 
+  // uint8_t nTRTOutliers(0);
+  // uint8_t nTRTXenon(0); 
+  float trackqoverp(0.0);
+  float trackqoverpsig(0.0);
+  int   charge(0.0);
+  int   lifeSign(0.0);
+  float trackchi2(0.0);
+  float d0(0.0);
+  float z0(0.0);
+  float phi0(0.0);
+  float theta(0.0);
+  float EoverP(0.0);
+  float d0sigma(0.0);
+  double dpOverp(0.0);
+  float TRT_PID(0.0);
+  //double trans_TRT_PID(0.0);
+  float deltaPhi1=0, deltaPhi2=0;
+  float deltaPhiFromLM=0;
+  float deltaPhiRescaled2=0;//deltaEta=0, 
+  //double rTRT(0.0);
+
+  TVector2 el_cluster; el_cluster.SetMagPhi(cluster->energyBE(2)/cosh(eta),cluster->phiBE(2));
+
+  bool allFound = true;
+  // retrieve associated TrackParticle
+  const xAOD::TrackParticle* t = eg->trackParticle();    
+  if (t) {
+    trackqoverp = t->qOverP();
+    charge= t->charge();
+    d0 = t->d0();
+    if(m_map_inputs.find("z0sinTheta"             )!= m_map_inputs.end()) {
+      z0 = t->z0();
+      theta = t->theta();
+    }
+    if(m_map_inputs.find("chi2oftrackfit"         )!= m_map_inputs.end())
+      trackchi2 = t->chiSquared();
+
+    phi0 = t->phi() + (d0>=0? M_PI/2 : -M_PI/2);
+    TVector2 d0_direction;	d0_direction.SetMagPhi(fabs(d0),phi0);
+    float inner_product = el_cluster.X()*d0_direction.X() + el_cluster.Y()*d0_direction.Y();
+    lifeSign = inner_product>=0? 1 : -1;
+	
+    EoverP   = energy * fabs(t->qOverP());
+    if(m_map_inputs.find("d0Err"                  )!= m_map_inputs.end() or
+       m_map_inputs.find("d0Sig"                  )!= m_map_inputs.end() ) {
+      float vard0 = t->definingParametersCovMatrix()(0,0);
+      if (vard0 > 0) {
+	d0sigma=sqrtf(vard0);
+      }
+    }
+    
+    const std::vector<float>&cov= t->definingParametersCovMatrixVec();
+    trackqoverpsig= cov[14];
+
+    if(m_map_inputs.find("nSctHits"               )!= m_map_inputs.end())
+      allFound = allFound && t->summaryValue(nSCT, xAOD::numberOfSCTHits);
+    // allFound = allFound && t->summaryValue(nTRThigh, xAOD::numberOfTRTHighThresholdHits);
+    // allFound = allFound && t->summaryValue(nTRThighOutliers, xAOD::numberOfTRTHighThresholdOutliers);
+    // allFound = allFound && t->summaryValue(nTRT, xAOD::numberOfTRTHits);
+    // allFound = allFound && t->summaryValue(nTRTOutliers, xAOD::numberOfTRTOutliers);
+    // allFound = allFound && t->summaryValue(nTRTXenon, xAOD::numberOfTRTXenonHits);
+    // allFound = allFound && t->summaryValue(TRT_PID, xAOD::eProbabilityHT);
+
+    //Transform the TRT PID output for use in the LH tool.
+    double fEpsilon = 1.0e-30;  // to avoid zero division
+    double pid_tmp = TRT_PID;
+    if (pid_tmp >= 1.0) pid_tmp = 1.0 - 1.0e-15;  //this number comes from TMVA
+    else if (pid_tmp <= fEpsilon) pid_tmp = fEpsilon;
+    // double tau = 15.0;
+    //trans_TRT_PID = - log(1.0/pid_tmp - 1.0)*(1./double(tau));
+
+    if(m_map_inputs.find("deltaPoverP"            )!= m_map_inputs.end()) {
+      unsigned int index;
+      if( t->indexOfParameterAtPosition(index, xAOD::LastMeasurement) ) {
+	
+	double refittedTrack_LMqoverp  = 
+	  t->charge() / sqrt(std::pow(t->parameterPX(index), 2) +
+			     std::pow(t->parameterPY(index), 2) +
+			     std::pow(t->parameterPZ(index), 2));
+	
+	dpOverp = 1 - trackqoverp/(refittedTrack_LMqoverp);
+      }
+    }
+	
+  }
+  else {
+    allFound=false;
+    ATH_MSG_WARNING ( "Failed, no track particle: et= " << et << "eta= " << eta );
+  }
+
+  float Rphi(0);//float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), ws3(0), w2(0), f1(0), Eratio(0), f3(0);
+  allFound = allFound && eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi);// rphi e233/e237
+  // allFound = allFound && eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1);
+
+  // difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last measurement point.
+  allFound = allFound && eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2);
+
+  if(m_map_inputs.find("deltaphi1"              )!= m_map_inputs.end())
+    allFound = allFound && eg->trackCaloMatchValue(deltaPhi1, xAOD::EgammaParameters::deltaPhi1);
+  if(m_map_inputs.find("deltaphi2"              )!= m_map_inputs.end() or 
+     m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end())
+    allFound = allFound && eg->trackCaloMatchValue(deltaPhi2, xAOD::EgammaParameters::deltaPhi2);
+  if(m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end())
+    allFound = allFound && eg->trackCaloMatchValue(deltaPhiFromLM, xAOD::EgammaParameters::deltaPhiFromLastMeasurement);
+
+  // TRT high-to-low threshold hits ratio
+  // if ( nTRTXenon > 0 )
+  //     rTRT = ((double)(nTRThigh+nTRThighOutliers)) / ((double)(nTRTXenon)) ;
+  // else if ( nTRTXenon < 0 && (nTRT+nTRTOutliers) > 0 ) // this is always false as given
+  //     rTRT = ((double)(nTRThigh+nTRThighOutliers)) / ((double)(nTRT+nTRTOutliers)) ;
+
+  // Get the number of primary vertices in this event
+  // double ip = static_cast<double>(m_nPVdefault);
+  // if(mu < 0) // use npv if mu is negative (not given)
+  //   ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault);
+  // else ip = mu;
+
+
+  // ATH_MSG_VERBOSE("xAOD variables: pt                      = "<< et                       );
+  // ATH_MSG_VERBOSE("xAOD variables: eta                     = "<< eta                      );
+  // ATH_MSG_VERBOSE("xAOD variables: abs_eta                 = "<< fabs(eta)                );
+  // ATH_MSG_VERBOSE("xAOD variables: d0                      = "<< d0                       );
+  // ATH_MSG_VERBOSE("xAOD variables: ld0                     = "<< lifeSign*d0              );
+  // ATH_MSG_VERBOSE("xAOD variables: cd0                     = "<< charge*d0                );
+  // ATH_MSG_VERBOSE("xAOD variables: EoverP                  = "<< EoverP                   );
+  // ATH_MSG_VERBOSE("xAOD variables: deltaphi1               = "<< deltaPhi1                );
+  // ATH_MSG_VERBOSE("xAOD variables: deltaphiRes             = "<< deltaPhiRescaled2        );
+  // ATH_MSG_VERBOSE("xAOD variables: Rphi                    = "<< Rphi                     );
+  // ATH_MSG_VERBOSE("xAOD variables: qoverpSig               = "<< trackqoverpsig           );
+  // ATH_MSG_VERBOSE("xAOD variables: nSctHits                = "<< nSCT                     );
+  // ATH_MSG_VERBOSE("xAOD variables: z0sinTheta              = "<< z0*sin(theta)            );
+  // ATH_MSG_VERBOSE("xAOD variables: d0Err                   = "<< d0sigma                  );
+  // ATH_MSG_VERBOSE("xAOD variables: d0Sig                   = "<< d0/d0sigma               );
+  // ATH_MSG_VERBOSE("xAOD variables: deltaphi2               = "<< deltaPhi2                );
+  // ATH_MSG_VERBOSE("xAOD variables: chi2oftrackfit          = "<< trackchi2                );
+  // ATH_MSG_VERBOSE("xAOD variables: deltaPoverP             = "<< dpOverp                  );
+  // ATH_MSG_VERBOSE("xAOD variables: deltaDeltaPhiFirstandLM = "<< deltaPhi2-deltaPhiFromLM );
+  ATH_MSG_VERBOSE("xAOD variables: pt                      = "<< et                       <<std::endl<<
+		  "xAOD variables: eta                     = "<< eta                      <<std::endl<<
+		  "xAOD variables: abs_eta                 = "<< fabs(eta)                <<std::endl<<
+		  "xAOD variables: d0                      = "<< d0                       <<std::endl<<
+		  "xAOD variables: ld0                     = "<< lifeSign*d0              <<std::endl<<
+		  "xAOD variables: cd0                     = "<< charge*d0                <<std::endl<<
+		  "xAOD variables: EoverP                  = "<< EoverP                   <<std::endl<<
+		  "xAOD variables: deltaphi1               = "<< deltaPhi1                <<std::endl<<
+		  "xAOD variables: deltaphiRes             = "<< deltaPhiRescaled2        <<std::endl<<
+		  "xAOD variables: Rphi                    = "<< Rphi                     <<std::endl<<
+		  "xAOD variables: qoverpSig               = "<< trackqoverpsig           <<std::endl<<
+		  "xAOD variables: nSctHits                = "<< nSCT                     <<std::endl<<
+		  "xAOD variables: z0sinTheta              = "<< z0*sin(theta)            <<std::endl<<
+		  "xAOD variables: d0Err                   = "<< d0sigma                  <<std::endl<<
+		  "xAOD variables: d0Sig                   = "<< d0/d0sigma               <<std::endl<<
+		  "xAOD variables: deltaphi2               = "<< deltaPhi2                <<std::endl<<
+		  "xAOD variables: chi2oftrackfit          = "<< trackchi2                <<std::endl<<
+		  "xAOD variables: deltaPoverP             = "<< dpOverp                  <<std::endl<<
+		  "xAOD variables: deltaDeltaPhiFirstandLM = "<< deltaPhi2-deltaPhiFromLM );
+
+  if(m_map_inputs.find("pt"                     )!= m_map_inputs.end()) m_map_inputs["pt"                     ] = et               ;
+  if(m_map_inputs.find("eta"                    )!= m_map_inputs.end()) m_map_inputs["eta"                    ] = eta              ;
+  if(m_map_inputs.find("abs_eta"                )!= m_map_inputs.end()) m_map_inputs["abs_eta"                ] = fabs(eta)        ;
+  if(m_map_inputs.find("d0"                     )!= m_map_inputs.end()) m_map_inputs["d0"                     ] = d0               ;
+  if(m_map_inputs.find("ld0"                    )!= m_map_inputs.end()) m_map_inputs["ld0"                    ] = lifeSign*d0      ;
+  if(m_map_inputs.find("cd0"                    )!= m_map_inputs.end()) m_map_inputs["cd0"                    ] = charge*d0        ;
+  if(m_map_inputs.find("EoverP"                 )!= m_map_inputs.end()) m_map_inputs["EoverP"                 ] = EoverP           ;
+  if(m_map_inputs.find("deltaphi1"              )!= m_map_inputs.end()) m_map_inputs["deltaphi1"              ] = deltaPhi1        ;
+  if(m_map_inputs.find("deltaphiRes"            )!= m_map_inputs.end()) m_map_inputs["deltaphiRes"            ] = deltaPhiRescaled2;
+  if(m_map_inputs.find("Rphi"                   )!= m_map_inputs.end()) m_map_inputs["Rphi"                   ] = Rphi             ;
+  if(m_map_inputs.find("qoverpSig"              )!= m_map_inputs.end()) m_map_inputs["qoverpSig"              ] = trackqoverpsig   ;
+  if(m_map_inputs.find("nSctHits"               )!= m_map_inputs.end()) m_map_inputs["nSctHits"               ] = nSCT             ;
+  if(m_map_inputs.find("z0sinTheta"             )!= m_map_inputs.end()) m_map_inputs["z0sinTheta"             ] = z0*sin(theta)    ;
+  if(m_map_inputs.find("d0Err"                  )!= m_map_inputs.end()) m_map_inputs["d0Err"                  ] = d0sigma          ;
+  if(m_map_inputs.find("d0Sig"                  )!= m_map_inputs.end()) m_map_inputs["d0Sig"                  ] = d0/d0sigma       ;
+  if(m_map_inputs.find("deltaphi2"              )!= m_map_inputs.end()) m_map_inputs["deltaphi2"              ] = deltaPhi2        ;
+  if(m_map_inputs.find("chi2oftrackfit"         )!= m_map_inputs.end()) m_map_inputs["chi2oftrackfit"         ] = trackchi2        ;
+  if(m_map_inputs.find("deltaPoverP"            )!= m_map_inputs.end()) m_map_inputs["deltaPoverP"            ] = dpOverp          ;
+  if(m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end()) m_map_inputs["deltaDeltaPhiFirstAndLM"] = deltaPhi2-deltaPhiFromLM;
+  //m_map_inputs["PtErr"                  ] = ;//to be implemented
+
+  if (!allFound) ATH_MSG_FATAL("Missing input variable for ECIDS BDT calculation");
+
+  //long unsigned event_number=0;
+  //unsigned bdt_index=event_number%2;
+
+  ////KM: dumping variables
+  for (auto input: m_map_inputs)
+    ATH_MSG_DEBUG("\t input: "<<input.first<<"\t= "<<input.second);
+
+  ////KM: dumping variables, only variables used by BDT
+  // unsigned i=0;
+  // for (auto pointer: m_v_bdts.at(bdt_index)->GetPointers()) {
+  //   std::cout<<"\t kmdebug: "<<m_inputVars.at(i)<<"\t("<<pointer<<")\t = "<<*pointer<<std::endl; i++;
+  // }
+
+  double bdt_output = m_v_bdts.at(m_bdt_index)->GetGradBoostMVA(m_v_bdts.at(m_bdt_index)->GetPointers());
+  ATH_MSG_DEBUG("ECIDS-BDT= "<<bdt_output);
+
+  m_resultBDT.setResult(m_resultPosition_bdt,bdt_output);
+  return m_resultBDT;
+}
+
+//=============================================================================
+// Calculate method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly
+//=============================================================================
+const Root::TResult& AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* eg, double mu ) const
+{
+  ATH_MSG_VERBOSE("AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* "<<eg<<", double mu= "<<mu<< " ) const");
+  ATH_MSG_WARNING("Method not implemented for egamma object! Reurning -1!!");
+  
+  m_resultBDT.setResult(m_resultPosition_bdt,-1);
+  return m_resultBDT;
+}
+
+//=============================================================================
+const Root::TAccept& AsgElectronChargeIDSelectorTool::accept(const xAOD::IParticle* part) const
+{
+  ATH_MSG_VERBOSE("Entering accept( const IParticle* part )");
+  const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part);
+  if(eg)
+    {
+      return accept(eg);
+    }
+  else{
+    ATH_MSG_ERROR("AsgElectronChargeIDSelectorTool::could not cast to const Electron");
+    return m_acceptDummy;
+  }
+}
+
+const Root::TResult& AsgElectronChargeIDSelectorTool::calculate(const xAOD::IParticle* part) const
+{
+  const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part);
+  if (eg)
+    {
+      return calculate(eg);
+    }
+  else
+    {
+      ATH_MSG_ERROR ( " Could not cast to const Electron " );
+      return m_resultDummy;
+    }
+}
+
+
+
+
+//=============================================================================
+// Helper method to get the number of primary vertices
+// ( This is horrible! We don't want to iterate over all vertices in the event for each electron!!! 
+//   This is slow!)
+//=============================================================================
+unsigned int AsgElectronChargeIDSelectorTool::getNPrimVertices() const
+{
+  static bool PVExists = true; 
+  unsigned int nVtx(0);
+  const xAOD::VertexContainer* vxContainer(0);
+  if(PVExists)
+  {
+    if ( StatusCode::SUCCESS != evtStore()->retrieve( vxContainer, m_primVtxContName ) )
+    {
+      ATH_MSG_WARNING ( "Vertex container not found with name: " << m_primVtxContName );
+      PVExists = false; // if retrieve failed, don't try to retrieve again
+      return nVtx;
+    }
+    for ( unsigned int i=0; i<vxContainer->size(); i++ )
+    {
+      const xAOD::Vertex* vxcand = vxContainer->at(i);
+      if ( vxcand->nTrackParticles() >= 2 ) nVtx++;
+    }
+  }
+  return nVtx;
+}
+
+
+bool AsgElectronChargeIDSelectorTool::SetVariableRefs(std::vector<std::string> inputs, std::vector<float*> &inputPointers) {
+  
+  bool unknownVarFound = false;
+  unsigned nVars = 0;
+  
+  for (auto inputName: inputs) {
+    //KM:                                           create elements by assigning default values.
+    if      (inputName=="pt"                     ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="eta"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="abs_eta"                ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="d0"                     ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="ld0"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="cd0"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="EoverP"                 ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="deltaphi1"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="deltaphiRes"            ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="Rphi"                   ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="qoverpSig"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="nSctHits"               ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="z0sinTheta"             ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="d0Err"                  ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="d0Sig"                  ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="deltaphi2"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="chi2oftrackfit"         ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else if (inputName=="deltaPoverP"            ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}         
+    else if (inputName=="deltaDeltaPhiFirstAndLM") {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
+    else {
+      ATH_MSG_WARNING("Unknown variables found with name: "<<inputName);
+      unknownVarFound = true;
+    }
+  }
+  
+  return inputs.size()==nVars and !unknownVarFound;
+  
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx
index ee4abec6908f786d2e546859d81fd0335f6f3e27..d3bff1a0585faab7cd6aea87246a263c9a6ca230 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx
@@ -16,6 +16,7 @@
 */
 
 #include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
+#include "ElectronPhotonSelectorTools/ElectronSelectorHelpers.h"
 #include "AsgElectronPhotonIsEMSelectorConfigHelper.h"
 #include "TElectronIsEMSelector.h"
 #include "EGSelectorConfigurationMapping.h"
@@ -47,35 +48,10 @@ AsgElectronIsEMSelector::AsgElectronIsEMSelector(std::string myname) :
 		  m_rootTool->isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified
 		  "The mask to use");
 
-  // Boolean to use b-layer prediction
-  declareProperty("useBLayerHitPrediction", 
-		  m_rootTool->useBLayerHitPrediction = true,
-		  "Boolean to use b-layer prediction");
-
   // Boolean to use TRT outliers
   declareProperty("useTRTOutliers",m_rootTool->useTRTOutliers=false,
 		  "Boolean to use TRT outliers");
 
-  // Boolean to use BL outliers
-  declareProperty("useBLOutliers",
-		  m_rootTool->useBLOutliers = true,
-		  "Boolean to use b-layer outliers");
-
-  // Boolean to use PIX outliers
-  declareProperty("usePIXOutliers",
-		  m_rootTool->usePIXOutliers = true,
-		  "Boolean to use PIX outliers");
-    
-  // Boolean to use PIX dead sensor
-  declareProperty("usePIXDeadSensors",
-		  m_rootTool->usePIXDeadSensors = true,
-		  "Boolean to use PIX dead sensors");
-
-  // Boolean to use SCT outliers
-  declareProperty("useSCTOutliers",
-		  m_rootTool->useSCTOutliers = true,
-		  "Boolean to use SCT outliers");
-
   // Boolean to use TRT Xenon Hits 
   declareProperty("useTRTXenonHits",
 		  m_rootTool->useTRTXenonHits = false, 
@@ -208,7 +184,7 @@ StatusCode AsgElectronIsEMSelector::initialize()
   StatusCode sc = StatusCode::SUCCESS ;
 
   if(!m_WorkingPoint.empty()){
-    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::m_ElectronCutPointToConfFile);
+    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::ElectronCutPointToConfFile);
   }
 
   if(!m_configFile.empty()) {    
@@ -238,18 +214,8 @@ StatusCode AsgElectronIsEMSelector::initialize()
     //From here on the conf ovverides all other properties
     bool useTRTOutliers(env.GetValue("useTRTOutliers", true));
     m_rootTool->useTRTOutliers =useTRTOutliers;
-    bool useBLOutliers(env.GetValue("useBLOutliers", true));
-    m_rootTool->useBLOutliers =useBLOutliers;
-    bool usePIXOutliers(env.GetValue("usePIXOutliers", true));
-    m_rootTool->usePIXOutliers =usePIXOutliers;
-    bool usePIXDeadSensors(env.GetValue("usePIXDeadSensors", true));
-    m_rootTool->usePIXDeadSensors =usePIXDeadSensors;
-    bool useSCTOutliers(env.GetValue("useSCTOutliers", true));
-    m_rootTool->useSCTOutliers =useSCTOutliers;
     bool  useTRTXenonHits(env.GetValue(" useTRTXenonHits", false));
     m_rootTool->useTRTXenonHits =useTRTXenonHits;
-    bool useBLayerHitPrediction (env.GetValue("useBLayerHitPrediction", true));
-    m_rootTool->useBLayerHitPrediction =useBLayerHitPrediction;
     
     ///------- Use helpers to read in the cut arrays ------///
     m_rootTool->CutBinEta  =AsgConfigHelper::HelperFloat("CutBinEta",env);
@@ -554,51 +520,27 @@ unsigned int AsgElectronIsEMSelector::TrackCut(const xAOD::Electron* eg,
     return StatusCode::SUCCESS; 
   }
  
-  // Track quality cut
-  // number of B-layer hits
-  uint8_t nBL = 0;
-  uint8_t nBLOutliers = 0;
-  // number of next to inner most B-layer hits
-  uint8_t nNextToInnerMostLayer = 0;
-  uint8_t nNextToInnerMostLayerOutliers = 0;
-  // number of Pixel hits
-  uint8_t nPi = 0;
-  uint8_t nPiOutliers = 0;
-  uint8_t nPiDeadSensors = 0;
-  // number of SCT hits
-  uint8_t nSCT = 0;
-  uint8_t nSCTOutliers = 0;
-  uint8_t nSCTDeadSensors = 0;
+  // Track quality cuts
+  uint8_t nSiHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfSiliconHitsAndDeadSensors(t);
+  uint8_t nPixHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfPixelHitsAndDeadSensors(t);
+  bool passBLayerRequirement = ElectronSelectorHelpers::passBLayerRequirement(t);
+
+  // TRT information
   uint8_t nTRThigh          = 0;
   uint8_t nTRThighOutliers  = 0;
-  uint8_t nTRT         = 0;
-  uint8_t nTRTOutliers = 0;
-  uint8_t nTRTXenonHits = 0;
-  uint8_t expectHitInBLayer = true;
-  uint8_t expectHitNextInBLayer = true;
-  float   TRT_PID = 0.0; 
+  uint8_t nTRT              = 0;
+  uint8_t nTRTOutliers      = 0;
+  uint8_t nTRTXenonHits     = 0;
+  float   TRT_PID           = 0.0; 
 
   bool allFound = true;
 
-  allFound = allFound && t->summaryValue(nBL, xAOD::numberOfBLayerHits);
-  allFound = allFound && t->summaryValue(nNextToInnerMostLayer, xAOD::numberOfNextToInnermostPixelLayerHits);
-  allFound = allFound && t->summaryValue(nPi, xAOD::numberOfPixelHits);
-  allFound = allFound && t->summaryValue(nSCT, xAOD::numberOfSCTHits);
-  allFound = allFound && t->summaryValue(nBLOutliers, xAOD::numberOfBLayerOutliers);
-  allFound = allFound && t->summaryValue(nNextToInnerMostLayerOutliers, xAOD::numberOfNextToInnermostPixelLayerOutliers);
-  allFound = allFound && t->summaryValue(nPiOutliers, xAOD::numberOfPixelOutliers);
-  allFound = allFound && t->summaryValue(nPiDeadSensors, xAOD::numberOfPixelDeadSensors);
-  allFound = allFound && t->summaryValue(nSCTOutliers, xAOD::numberOfSCTOutliers); 
-  allFound = allFound && t->summaryValue(nSCTDeadSensors, xAOD::numberOfSCTDeadSensors);
   allFound = allFound && t->summaryValue(nTRThigh, xAOD::numberOfTRTHighThresholdHits);
   allFound = allFound && t->summaryValue(nTRThighOutliers, xAOD::numberOfTRTHighThresholdOutliers);
   allFound = allFound && t->summaryValue(nTRT, xAOD::numberOfTRTHits);
   allFound = allFound && t->summaryValue(nTRTOutliers, xAOD::numberOfTRTOutliers);
   allFound = allFound && t->summaryValue(nTRTXenonHits, xAOD::numberOfTRTXenonHits);
   allFound = allFound && t->summaryValue(TRT_PID, xAOD::eProbabilityHT);
-  allFound = allFound && t->summaryValue(expectHitInBLayer, xAOD::expectBLayerHit);
-  allFound = allFound && t->summaryValue(expectHitNextInBLayer, xAOD::expectNextToInnermostPixelLayerHit);
-  
 
   const float trackd0 = fabsf(t->d0());
   
@@ -620,16 +562,9 @@ unsigned int AsgElectronIsEMSelector::TrackCut(const xAOD::Electron* eg,
 
   return m_rootTool->TrackCut(eta2,
 			      et,
-			      nBL,
-			      nBLOutliers,
-			      nNextToInnerMostLayer,
-			      nNextToInnerMostLayerOutliers,
-			      nPi,
-			      nPiOutliers,
-			      nPiDeadSensors,
-			      nSCT,
-			      nSCTOutliers,
-			      nSCTDeadSensors,
+                              passBLayerRequirement,
+                              nPixHitsPlusDeadSensors,
+                              nSiHitsPlusDeadSensors,
 			      nTRThigh,
 			      nTRThighOutliers,
 			      nTRT,
@@ -640,8 +575,6 @@ unsigned int AsgElectronIsEMSelector::TrackCut(const xAOD::Electron* eg,
 			      deltaeta,
 			      deltaphi,
 			      ep,
-			      expectHitInBLayer,
-			      expectHitNextInBLayer,
 			      iflag);
 }
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx
index 07629bd671c2af5c0b9bf78c284e7b7f099916ce..4899f34c6011bc3eea8af7912d048caf3fd23bcd 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx
@@ -15,6 +15,7 @@
 
 // Include this class's header
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
+#include "ElectronPhotonSelectorTools/ElectronSelectorHelpers.h"
 #include "AsgElectronPhotonIsEMSelectorConfigHelper.h"
 #include "TElectronLikelihoodTool.h"
 #include "EGSelectorConfigurationMapping.h"
@@ -76,6 +77,8 @@ AsgElectronLikelihoodTool::AsgElectronLikelihoodTool(std::string myname) :
   declareProperty("CutLikelihoodPileupCorrection4GeV",m_rootTool->CutLikelihoodPileupCorrection4GeV,"Pileup correction for LH discriminant, 4 GeV special bin");
   // do the conversion cut
   declareProperty("doCutConversion",m_rootTool->doCutConversion,"Apply the conversion bit cut");
+  // do the ambiguity cut
+  declareProperty("CutAmbiguity" ,m_rootTool->CutAmbiguity ,"Apply a cut on the ambiguity bit");
   // cut on b-layer
   declareProperty("CutBL",m_rootTool->CutBL,"Cut on b-layer");
   // cut on pixel hits
@@ -154,7 +157,7 @@ StatusCode AsgElectronLikelihoodTool::initialize()
   std::string PDFfilename(""); //Default
 
   if(!m_WorkingPoint.empty()){
-    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::m_LHPointToConfFile);
+    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::LHPointToConfFile);
     ATH_MSG_INFO("operating point : " << this->getOperatingPointName());
   }
   
@@ -201,6 +204,8 @@ StatusCode AsgElectronLikelihoodTool::initialize()
     m_rootTool->CutLikelihoodPileupCorrection4GeV = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection4GeV", env);
     // do the conversion cut
     m_rootTool->doCutConversion = env.GetValue("doCutConversion", false);
+    // do the ambiguity cut
+    m_rootTool->CutAmbiguity  = AsgConfigHelper::HelperInt("CutAmbiguity", env);
     // cut on b-layer
     m_rootTool->CutBL = AsgConfigHelper::HelperInt("CutBL",env);
     // cut on pixel hits
@@ -291,26 +296,28 @@ StatusCode AsgElectronLikelihoodTool::finalize()
 //=============================================================================
 const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg, double mu ) const
 {
-  if ( !eg )
-    {
-      ATH_MSG_ERROR ("Failed, no egamma object.");
-      return m_acceptDummy;
-    }
-  
+  if ( !eg ){
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return m_acceptDummy;
+  }
+
   const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster )
-    {
-      ATH_MSG_ERROR("exiting because cluster is NULL " << cluster);
-      return m_acceptDummy;
-    }  
+  if ( !cluster ){
+    ATH_MSG_ERROR("exiting because cluster is NULL " << cluster);
+    return m_acceptDummy;
+  }  
+
+  if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){
+    ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2");
+    return m_acceptDummy;
+  }
 
   const double energy =  cluster->e();
   const float eta = (cluster->etaBE(2)); 
-  if ( fabs(eta) > 2.5 )
-    {
-      ATH_MSG_INFO("Failed, cluster->etaBE(2) range." << eta );
-      return m_acceptDummy;
-    }
+
+  if( isForwardElectron(eg,eta) ){
+    return m_acceptDummy;
+  }
   
   // transverse energy of the electron (using the track eta) 
   //  const double et = eg->pt(); 
@@ -321,57 +328,59 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg
     et  = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.;
   
   // number of track hits
-  uint8_t nSi(0);
-  uint8_t nSiDeadSensors(0);
-  uint8_t nPix(0);
-  uint8_t nSCT(0);
-  uint8_t nPixDeadSensors(0); 
-  uint8_t nSCTDeadSensors(0); 
-  uint8_t expectBlayer(true);
-  uint8_t nBlayerHits(0); 
-  uint8_t nBlayerOutliers(0); 
-  uint8_t expectNextToInnerMostLayer(true);
-  uint8_t nNextToInnerMostLayerHits(0); 
-  uint8_t nNextToInnerMostLayerOutliers(0); 
+  uint8_t nSiHitsPlusDeadSensors(0);
+  uint8_t nPixHitsPlusDeadSensors(0);
+  bool passBLayerRequirement(false); 
   float d0(0.0);
   float deltaEta=0, deltaPhiRescaled2=0;
   float wstot=0, EoverP=0;
   int convBit(0); // this no longer works
+  uint8_t ambiguityBit(0); 
   double ip(0);
 
   bool allFound = true;
+  std::string notFoundList = "";
 
   // Wstot for use when CutWstotAtHighET vector is filled
-  allFound = allFound && eg->showerShapeValue(wstot, xAOD::EgammaParameters::wtots1);
+  if( !eg->showerShapeValue(wstot, xAOD::EgammaParameters::wtots1) ){
+    allFound = false;
+    notFoundList += "wtots1 ";
+  }
 
+  // get the ambiguity type from the decoration
+  if ( m_rootTool->CutAmbiguity.size() ) {
+    if ( eg->isAvailable<uint8_t>("ambiguityType") ) {
+      static const SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");    
+      ambiguityBit = acc(*eg);
+    } else {
+      allFound = false;
+      notFoundList += "ambiguityType ";
+    }
+  }
+  
   if(!m_caloOnly) {
       // retrieve associated track
       const xAOD::TrackParticle* t  = eg->trackParticle();    
-      if (t)
-        {
-           d0 = t->d0();
-           allFound = allFound && t->summaryValue(nPix, xAOD::numberOfPixelHits);
-           allFound = allFound && t->summaryValue(nSCT, xAOD::numberOfSCTHits);
-           nSi = nPix + nSCT;
-           allFound = allFound && t->summaryValue(nPixDeadSensors, xAOD::numberOfPixelDeadSensors);
-           allFound = allFound && t->summaryValue(nSCTDeadSensors, xAOD::numberOfSCTDeadSensors);
-           nSiDeadSensors = nPixDeadSensors + nSCTDeadSensors;
-
-           allFound = allFound && t->summaryValue(expectBlayer, xAOD::expectBLayerHit);
-           allFound = allFound && t->summaryValue(nBlayerHits, xAOD::numberOfBLayerHits);
-           allFound = allFound && t->summaryValue(nBlayerOutliers, xAOD::numberOfBLayerOutliers);
-	   allFound = allFound && t->summaryValue(expectNextToInnerMostLayer,  xAOD::expectNextToInnermostPixelLayerHit);
-           allFound = allFound && t->summaryValue(nNextToInnerMostLayerHits, xAOD::numberOfNextToInnermostPixelLayerHits);
-           allFound = allFound && t->summaryValue(nNextToInnerMostLayerOutliers,  xAOD::numberOfNextToInnermostPixelLayerOutliers);
-           EoverP = fabs(t->qOverP()) * energy;
-        }
-      else
-        {
-          ATH_MSG_WARNING ( "Failed, no track particle: et= " << et << "eta= " << eta );
-        }
+      if (t) {
+        nSiHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfSiliconHitsAndDeadSensors(t);
+        nPixHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfPixelHitsAndDeadSensors(t);
+        passBLayerRequirement = ElectronSelectorHelpers::passBLayerRequirement(t);
+        d0 = t->d0();
+        EoverP = fabs(t->qOverP()) * energy;
+      }
+      else {
+        ATH_MSG_ERROR( "Failed, no track particle. et= " << et << "eta= " << eta );
+        return m_acceptDummy;
+      }
 
-      allFound = allFound && eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1);
-      allFound = allFound && eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2);
+      if( !eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1) ){
+        allFound = false;
+        notFoundList += "deltaEta1 ";
+      }
+      if( !eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2) ){
+        allFound = false;
+        notFoundList += "deltaPhiRescaled2 ";
+      }
 
   } //if not calo ONly
 
@@ -388,34 +397,27 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg
   // for now don't cache. 
   double likelihood = calculate(eg, ip); 
 
-  ATH_MSG_VERBOSE ( Form("PassVars: LH=%8.5f, eta=%8.5f, et=%8.5f, nSi=%i, nSiDeadSensors=%i, nPix=%i, nPixDeadSensors=%i, nBlayerHits=%i, nBlayerOutliers=%i, expectBlayer=%i, nNextToInnerMostLayerHits=%i, nNextToInnerMostLayerOutliers=%i, expectNextToInnerMostLayer=%i, convBit=%i, d0=%8.5f, deltaEta=%8.5f, deltaphires=%5.8f, wstot=%8.5f, EoverP=%8.5f, ip=%8.5f",
-                         likelihood, eta, et,
-                         nSi, nSiDeadSensors, nPix, nPixDeadSensors,
-                         nBlayerHits, nBlayerOutliers, expectBlayer,
-			 nNextToInnerMostLayerHits, nNextToInnerMostLayerOutliers, expectNextToInnerMostLayer,
-                         convBit, d0, deltaEta, deltaPhiRescaled2, 
-                         wstot, EoverP, ip ) );
-
-
+  ATH_MSG_VERBOSE( Form("PassVars: LH=%8.5f, eta=%8.5f, et=%8.5f, nSiHitsPlusDeadSensors=%i, nHitsPlusPixDeadSensors=%i, passBLayerRequirement=%i, convBit=%i, ambiguityBit=%i, d0=%8.5f, deltaEta=%8.5f, deltaphires=%5.8f, wstot=%8.5f, EoverP=%8.5f, ip=%8.5f",
+			likelihood, eta, et,
+			nSiHitsPlusDeadSensors, nPixHitsPlusDeadSensors,
+			passBLayerRequirement,
+			convBit, ambiguityBit, d0, deltaEta, deltaPhiRescaled2,
+			wstot, EoverP, ip ));
+  
   if (!allFound) {
-    ATH_MSG_WARNING("Have some variables missing.");
+    ATH_MSG_ERROR("Skipping LH rectangular cuts! The following variables are missing: " << notFoundList);
+    return m_acceptDummy;
   }
-
+  
   // Get the answer from the underlying ROOT tool
   return m_rootTool->accept( likelihood,
                              eta,
                              et,
-                             nSi,
-                             nSiDeadSensors,
-                             nPix,
-                             nPixDeadSensors,
-                             nBlayerHits,
-                             nBlayerOutliers,
-                             expectBlayer,
-			     nNextToInnerMostLayerHits,
-                             nNextToInnerMostLayerOutliers,
-                             expectNextToInnerMostLayer,
+                             nSiHitsPlusDeadSensors,
+                             nPixHitsPlusDeadSensors,
+                             passBLayerRequirement,
                              convBit,
+                             ambiguityBit,
                              d0,
                              deltaEta,
                              deltaPhiRescaled2,
@@ -430,47 +432,43 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg
 //=============================================================================
 const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, double mu) const
 {
+  if ( !eg ){
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return m_acceptDummy;
+  }
+
   // Call the main accept if this is not a calo-only LH
-  if( !m_caloOnly )
-    {
-      const xAOD::Electron* el = dynamic_cast<const xAOD::Electron*>(eg);
-      return accept(el, mu); 
-    }
-  if ( !eg )
-    {
-      ATH_MSG_ERROR ("Failed, no egamma object.");
-      return m_acceptDummy;
-    }
-  
+  if( !m_caloOnly ){
+    const xAOD::Electron* el = dynamic_cast<const xAOD::Electron*>(eg);
+    return accept(el, mu); 
+  }
+
   const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster )
-    {
-      ATH_MSG_ERROR ("Failed, no cluster.");
-      return m_acceptDummy;
-    }  
+  if ( !cluster ){
+    ATH_MSG_ERROR ("Failed, no cluster.");
+    return m_acceptDummy;
+  }  
+
+  if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){
+    ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2");
+    return m_acceptDummy;
+  }
   
   const double energy =  cluster->e();
   const float eta = (cluster->etaBE(2)); 
-  if ( fabs(eta) > 300.0 )
-    {
-      ATH_MSG_ERROR ("Failed, eta range.");
-      return m_acceptDummy;
-    }
+
+  if( isForwardElectron(eg,eta) ){
+    return m_acceptDummy;
+  }
   
   const double et  = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.;
   
   // Variables the EFCaloLH ignores
-  uint8_t nSi(0);
-  uint8_t nSiDeadSensors(0);
-  uint8_t nPix(0);
-  uint8_t nPixDeadSensors(0); 
-  uint8_t expectBlayer(true);
-  uint8_t nBlayerHits(0); 
-  uint8_t nBlayerOutliers(0);
-  uint8_t expectNextToInnerMostLayer(true);
-  uint8_t nNextToInnerMostLayerHits(0); 
-  uint8_t nNextToInnerMostLayerOutliers(0); 
+  uint8_t nSiHitsPlusDeadSensors(0);
+  uint8_t nPixHitsPlusDeadSensors(0);
+  bool passBLayerRequirement(false); 
   int convBit(0); // this no longer works
+  uint8_t ambiguityBit(0);
 
   // Get the pileup or centrality information
   double ip(0);
@@ -487,40 +485,39 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg,
   // for now don't cache. 
   double likelihood = calculate(eg, ip); 
 
-  ATH_MSG_VERBOSE ( Form("PassVars: LH=%8.5f, eta=%8.5f, et=%8.5f, nSi=%i, nSiDeadSensors=%i, nPix=%i, nPixDeadSensors=%i, nBlayerHits=%i, nBlayerOutliers=%i, expectBlayer=%i,  nNextToInnerMostLayerHits=%i, nNextToInnerMostLayerOutliers=%i, expectNextToInnerMostLayer=%i, convBit=%i, ip=%8.5f",
-                         likelihood, eta, et,
-                         nSi, nSiDeadSensors, nPix, nPixDeadSensors,
-                         nBlayerHits, nBlayerOutliers, expectBlayer,
-			 nNextToInnerMostLayerHits, nNextToInnerMostLayerOutliers, expectNextToInnerMostLayer,
-                         convBit, ip ) );
-
   double deltaEta=0,deltaPhiRescaled2=0,d0=0;
   float wstot=0, EoverP=0;
 
   bool allFound = true;
+  std::string notFoundList = "";
 
   // Wstot for use when CutWstotAtHighET vector is filled
-  allFound = allFound && eg->showerShapeValue(wstot, xAOD::EgammaParameters::wtots1);
+  if( !eg->showerShapeValue(wstot, xAOD::EgammaParameters::wtots1) ){
+    allFound = false; 
+    notFoundList += "wtots1 ";
+  }
+
+  ATH_MSG_VERBOSE( Form("PassVars: LH=%8.5f, eta=%8.5f, et=%8.5f, nSiHitsPlusDeadSensors=%i, nPixHitsPlusDeadSensors=%i, passBLayerRequirement=%i, convBit=%i, ambiguityBit=%i, ip=%8.5f, wstot=%8.5f",
+			likelihood, eta, et,
+			nSiHitsPlusDeadSensors, nPixHitsPlusDeadSensors, 
+			passBLayerRequirement,
+			convBit, ambiguityBit, ip, wstot));
+  
 
   if (!allFound) {
-    ATH_MSG_WARNING("Have some variables missing.");
+    ATH_MSG_ERROR("Skipping LH rectangular cuts! The following variables are missing: " << notFoundList);
+    return m_acceptDummy;
   }
 
   // Get the answer from the underlying ROOT tool
   return m_rootTool->accept( likelihood,
                              eta,
                              et,
-                             nSi,
-                             nSiDeadSensors,
-                             nPix,
-                             nPixDeadSensors,
-                             nBlayerHits,
-                             nBlayerOutliers,
-                             expectBlayer,
-			     nNextToInnerMostLayerHits,
-                             nNextToInnerMostLayerOutliers,
-                             expectNextToInnerMostLayer,
+                             nSiHitsPlusDeadSensors,
+                             nPixHitsPlusDeadSensors,
+                             passBLayerRequirement,
                              convBit,
+                             ambiguityBit,
                              d0,
                              deltaEta,
                              deltaPhiRescaled2,
@@ -539,27 +536,29 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg,
 //=============================================================================
 const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* eg, double mu ) const
 {
-  if ( !eg )
-    {
-      ATH_MSG_ERROR ("Failed, no egamma object.");
-      return m_resultDummy;
-    }
-  
+  if ( !eg ){
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return m_resultDummy;
+  }
+
   const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster )
-    {
-      ATH_MSG_ERROR ("Failed, no cluster.");
-      return m_resultDummy;
-    }  
+  if ( !cluster ){
+    ATH_MSG_ERROR ("Failed, no cluster.");
+    return m_resultDummy;
+  }  
+
+  if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){
+    ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2");
+    return m_resultDummy;
+  }
 
   const double energy =  cluster->e();
   const float eta = cluster->etaBE(2); 
-  if ( fabs(eta) > 300.0 )
-    {
-      ATH_MSG_ERROR ("Failed, eta range.");
-      return m_resultDummy;
-    }
-  
+
+  if( isForwardElectron(eg,eta) ){
+    return m_resultDummy;
+  }
+
   //double et = cluster->e()/cosh(eta); 
   // transverse energy of the electron (using the track eta) 
   //const double et = eg->pt(); 
@@ -580,6 +579,8 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron*
   float deltaEta=0, deltaPhiRescaled2=0;
 
   bool allFound = true;
+  std::string notFoundList = "";
+
   if (!m_caloOnly){
   // retrieve associated TrackParticle
     const xAOD::TrackParticle* t = eg->trackParticle();    
@@ -592,7 +593,10 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron*
 	  d0sigma=sqrtf(vard0);
         }
 
-        allFound = allFound && t->summaryValue(TRT_PID, xAOD::eProbabilityHT);
+        if( !t->summaryValue(TRT_PID, xAOD::eProbabilityHT) ){
+          allFound = false; 
+          notFoundList += "eProbabilityHT ";
+        }
 
         //Transform the TRT PID output for use in the LH tool.
         double tau = 15.0; 
@@ -612,40 +616,73 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron*
 	
 	  dpOverp = 1 - trackqoverp/(refittedTrack_LMqoverp);
         }
+        else{
+          allFound = false; 
+          notFoundList += "deltaPoverP ";
+        }
       
       }
     else
       {
-        ATH_MSG_WARNING ( "Failed, no track particle: et= " << et << "eta= " << eta );
+        ATH_MSG_ERROR( "Failed, no track particle. et= " << et << "eta= " << eta );
+        return m_resultDummy;
       }
   }  // if not calo Only
 
-  float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), ws3(0), w2(0), f1(0), Eratio(0), f3(0);
+  float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), w2(0), f1(0), Eratio(0), f3(0);
 
   // reta = e237/e277
-  allFound = allFound && eg->showerShapeValue(Reta, xAOD::EgammaParameters::Reta);
+  if( !eg->showerShapeValue(Reta, xAOD::EgammaParameters::Reta) ){
+    allFound = false; 
+    notFoundList += "Reta ";
+  }
   // rphi e233/e237
-  allFound = allFound && eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi);
+  if( !eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi) ){
+    allFound = false;
+    notFoundList += "Rphi ";
+  }
   // rhad1 = ethad1/et
-  allFound = allFound && eg->showerShapeValue(Rhad1, xAOD::EgammaParameters::Rhad1);
+  if( !eg->showerShapeValue(Rhad1, xAOD::EgammaParameters::Rhad1) ){
+    allFound = false;
+    notFoundList += "Rhad1 ";
+  }
   // rhad = ethad/et
-  allFound = allFound && eg->showerShapeValue(Rhad, xAOD::EgammaParameters::Rhad);
-  // shower width in 3 strips in 1st sampling
-  allFound = allFound && eg->showerShapeValue(ws3, xAOD::EgammaParameters::weta1);
+  if( !eg->showerShapeValue(Rhad, xAOD::EgammaParameters::Rhad) ){
+    allFound = false;
+    notFoundList += "Rhad ";
+  }
   // shower width in 2nd sampling
-  allFound = allFound && eg->showerShapeValue(w2, xAOD::EgammaParameters::weta2);
+  if( !eg->showerShapeValue(w2, xAOD::EgammaParameters::weta2) ){
+    allFound = false;
+    notFoundList += "weta2 ";
+  }
   // fraction of energy reconstructed in the 1st sampling
-  allFound = allFound && eg->showerShapeValue(f1, xAOD::EgammaParameters::f1);
+  if( !eg->showerShapeValue(f1, xAOD::EgammaParameters::f1) ){
+    allFound = false;
+    notFoundList += "f1 ";
+  }
   // E of 2nd max between max and min in strips
-  allFound = allFound && eg->showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio);
+  if( !eg->showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio) ){
+    allFound = false;
+    notFoundList += "Eratio ";
+  }
   // fraction of energy reconstructed in the 3rd sampling
-  allFound = allFound && eg->showerShapeValue(f3, xAOD::EgammaParameters::f3);
+  if( !eg->showerShapeValue(f3, xAOD::EgammaParameters::f3) ){
+    allFound = false;
+    notFoundList += "f3 ";
+  }
 
   if( !m_caloOnly){
-    allFound = allFound && eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1);
-
+    // deltaEta1
+    if( !eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1) ){
+      allFound = false;
+      notFoundList += "deltaEta1 ";
+    }
     // difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last measurement point.
-    allFound = allFound && eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2);
+    if( !eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2) ){
+      allFound = false;
+      notFoundList += "deltaPhiRescaled2 ";
+    }
 
   }
 
@@ -661,18 +698,18 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron*
     ip = mu;
   }
 
-  ATH_MSG_VERBOSE ( Form("Vars: eta=5%8.5f, et=%8.5f, f3=%8.5f, rHad==%8.5f, rHad1=%8.5f, Reta=%8.5f, w2=%8.5f, f1=%8.5f, Emaxs1=%8.5f, deltaEta=%8.5f, d0=%8.5f, d0sigma=%8.5f, Rphi=%8.5f, ws3=%8.5f, dpOverp=%8.5f, deltaPhiRescaled2=%8.5f, TRT_PID=%8.5f, trans_TRT_PID=%8.5f, ip=%8.5f",
-                         eta, et, f3, Rhad, Rhad1, Reta,
-                         w2, f1, Eratio,
-                         deltaEta, d0,
-                         d0sigma, 
-                         Rphi, ws3, dpOverp, deltaPhiRescaled2,
-                         TRT_PID, trans_TRT_PID,
-                         ip ) );
-
+  ATH_MSG_VERBOSE( Form("Vars: eta=5%8.5f, et=%8.5f, f3=%8.5f, rHad==%8.5f, rHad1=%8.5f, Reta=%8.5f, w2=%8.5f, f1=%8.5f, Emaxs1=%8.5f, deltaEta=%8.5f, d0=%8.5f, d0sigma=%8.5f, Rphi=%8.5f, dpOverp=%8.5f, deltaPhiRescaled2=%8.5f, TRT_PID=%8.5f, trans_TRT_PID=%8.5f, ip=%8.5f",
+      eta, et, f3, Rhad, Rhad1, Reta,
+      w2, f1, Eratio,
+      deltaEta, d0,
+      d0sigma, 
+      Rphi, dpOverp, deltaPhiRescaled2,
+      TRT_PID, trans_TRT_PID,
+      ip ) );
 
   if (!allFound) {
-    ATH_MSG_WARNING("Have some variables missing.");
+    ATH_MSG_ERROR("Skipping LH calculation! The following variables are missing: " << notFoundList);
+    return m_resultDummy;
   }
 
   // Get the answer from the underlying ROOT tool
@@ -701,31 +738,33 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron*
 //=============================================================================
 const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* eg, double mu ) const
 {
-  if( !m_caloOnly )
-    {
-      const xAOD::Electron* el = dynamic_cast<const xAOD::Electron*>(eg);
-      return calculate(el, mu);
-    }
-  if ( !eg )
-    {
-      ATH_MSG_ERROR ("Failed, no egamma object.");
-      return m_resultDummy;
-    }
-  
+  if ( !eg ){
+    ATH_MSG_ERROR ("Failed, no egamma object.");
+    return m_resultDummy;
+  }
+
+  if( !m_caloOnly ){
+    const xAOD::Electron* el = dynamic_cast<const xAOD::Electron*>(eg);
+    return calculate(el, mu);
+  }
+
   const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster )
-    {
-      ATH_MSG_ERROR ("Failed, no cluster.");
-      return m_resultDummy;
-    }  
+  if ( !cluster ){
+    ATH_MSG_ERROR ("Failed, no cluster.");
+    return m_resultDummy;
+  }  
+
+  if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){
+    ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2");
+    return m_resultDummy;
+  }
   
   const double energy =  cluster->e();
   const float eta = cluster->etaBE(2); 
-  if ( fabs(eta) > 300.0 )
-    {
-      ATH_MSG_ERROR ("Failed, eta range.");
-      return m_resultDummy;
-    }
+
+  if( isForwardElectron(eg,eta) ){
+    return m_resultDummy;
+  }
   
   const double et  = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.;
 
@@ -738,28 +777,51 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e
   float TRT_PID(0.0);
 
   // Calo Variables
-  float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), ws3(0), w2(0), f1(0), Eratio(0), f3(0);
+  float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), w2(0), f1(0), Eratio(0), f3(0);
 
   bool allFound = true;
+  std::string notFoundList = "";
 
   // reta = e237/e277
-  allFound = allFound && eg->showerShapeValue(Reta, xAOD::EgammaParameters::Reta);
+  if( !eg->showerShapeValue(Reta, xAOD::EgammaParameters::Reta) ){
+    allFound = false; 
+    notFoundList += "Reta ";
+  }
   // rphi e233/e237
-  allFound = allFound && eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi);
+  if( !eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi) ){
+    allFound = false; 
+    notFoundList += "Rphi ";
+  }
   // rhad1 = ethad1/et
-  allFound = allFound && eg->showerShapeValue(Rhad1, xAOD::EgammaParameters::Rhad1);
+  if( !eg->showerShapeValue(Rhad1, xAOD::EgammaParameters::Rhad1) ){
+    allFound = false; 
+    notFoundList += "Rhad1 ";
+  }
   // rhad = ethad/et
-  allFound = allFound && eg->showerShapeValue(Rhad, xAOD::EgammaParameters::Rhad);
-  // shower width in 3 strips in 1st sampling
-  allFound = allFound && eg->showerShapeValue(ws3, xAOD::EgammaParameters::weta1);
+  if( !eg->showerShapeValue(Rhad, xAOD::EgammaParameters::Rhad) ){
+    allFound = false; 
+    notFoundList += "Rhad ";
+  }
   // shower width in 2nd sampling
-  allFound = allFound && eg->showerShapeValue(w2, xAOD::EgammaParameters::weta2);
+  if( !eg->showerShapeValue(w2, xAOD::EgammaParameters::weta2) ){
+    allFound = false; 
+    notFoundList += "weta2 ";
+  }
   // fraction of energy reconstructed in the 1st sampling
-  allFound = allFound && eg->showerShapeValue(f1, xAOD::EgammaParameters::f1);
+  if( !eg->showerShapeValue(f1, xAOD::EgammaParameters::f1) ){
+    allFound = false; 
+    notFoundList += "f1 ";
+  }
   // E of 2nd max between max and min in strips
-  allFound = allFound && eg->showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio);
+  if( !eg->showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio) ){
+    allFound = false; 
+    notFoundList += "Eratio ";
+  }
   // fraction of energy reconstructed in the 3rd sampling
-  allFound = allFound && eg->showerShapeValue(f3, xAOD::EgammaParameters::f3);
+  if( !eg->showerShapeValue(f3, xAOD::EgammaParameters::f3) ){
+    allFound = false; 
+    notFoundList += "f3 ";
+  }
 
   // Get the pileup or centrality information
   double ip(0);
@@ -772,18 +834,19 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e
   else {
     ip = mu;
   }
-  ATH_MSG_VERBOSE ( Form("Vars: eta=%8.5f, et=%8.5f, f3=%8.5f, rHad==%8.5f, rHad1=%8.5f, Reta=%8.5f, w2=%8.5f, f1=%8.5f, Emaxs1=%8.5f, deltaEta=%8.5f, d0=%8.5f, d0sigma=%8.5f, Rphi=%8.5f, ws3=%8.5f, dpOverp=%8.5f, deltaPhiRescaled2=%8.5f, TRT_PID=%8.5f, ip=%8.5f",
-                         eta, et, f3, Rhad, Rhad1, Reta,
-                         w2, f1, Eratio,
-                         deltaEta, d0,
-                         d0sigma, 
-                         Rphi, ws3, dpOverp, deltaPhiRescaled2,
-			 TRT_PID,
-                         ip ) );
 
+  ATH_MSG_VERBOSE(Form("Vars: eta=%8.5f, et=%8.5f, f3=%8.5f, rHad==%8.5f, rHad1=%8.5f, Reta=%8.5f, w2=%8.5f, f1=%8.5f, Emaxs1=%8.5f, deltaEta=%8.5f, d0=%8.5f, d0sigma=%8.5f, Rphi=%8.5f, dpOverp=%8.5f, deltaPhiRescaled2=%8.5f, TRT_PID=%8.5f, ip=%8.5f",
+				 eta, et, f3, Rhad, Rhad1, Reta,
+				 w2, f1, Eratio,
+				 deltaEta, d0,
+				 d0sigma, 
+				 Rphi, dpOverp, deltaPhiRescaled2,
+				 TRT_PID,
+                                 ip ));
 
   if (!allFound) {
-    ATH_MSG_WARNING("Have some variables missing.");
+    ATH_MSG_ERROR("Skipping LH calculation! The following variables are missing: " << notFoundList);
+    return m_resultDummy;
   }
 
   // Get the answer from the underlying ROOT tool
@@ -910,3 +973,26 @@ double AsgElectronLikelihoodTool::getFcalEt() const
   return fcalEt;
 }
 
+bool AsgElectronLikelihoodTool::isForwardElectron( const xAOD::Egamma* eg, const float eta ) const{
+
+  static const SG::AuxElement::ConstAccessor< uint16_t > accAuthor( "author" );
+
+  if( accAuthor.isAvailable(*eg) ){
+    
+    // cannot just do eg->author() because it isn't always filled
+    // at trigger level
+    if( accAuthor(*eg) == xAOD::EgammaParameters::AuthorFwdElectron ){
+      ATH_MSG_WARNING("Failed, this is a forward electron! The AsgElectronLikelihoodTool is only suitable for central electrons!");
+      return true;
+    }
+  }
+  else{
+    //Check for fwd via eta range the old logic 
+    if ( fabs(eta) > 2.5 ) {
+      ATH_MSG_WARNING("Failed, cluster->etaBE(2) range due to " << eta << " seems like a fwd electron" );
+      return true;
+    }
+  }
+
+  return false;
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronPhotonIsEMSelectorConfigHelper.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronPhotonIsEMSelectorConfigHelper.cxx
index 0bf9a4302f3ebc7c9a0dc8a2faa1826eb3e9cfff..5791a0ff7f9ae8f098ea8c6843a72a32479d0f3a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronPhotonIsEMSelectorConfigHelper.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronPhotonIsEMSelectorConfigHelper.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "AsgElectronPhotonIsEMSelectorConfigHelper.h"
+#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
 #include "AsgTools/AsgMessaging.h"
 #include "TEnv.h"
 #include <iostream>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx
index d67481cd307705753df5cb64b64c235dd430a594..96516c7027c79a79ce396e2ab1d6c8a18ae2958b 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx
@@ -90,7 +90,7 @@ StatusCode AsgForwardElectronIsEMSelector::initialize()
   StatusCode sc = StatusCode::SUCCESS ;
 
   if(!m_WorkingPoint.empty()){
-    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::m_ForwardElectronCutPointToConfFile);
+    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::ForwardElectronCutPointToConfFile);
   }
   
   if(!m_configFile.empty()) {
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx
index eec29c9298768ca2fead61add9b18168bfee5f31..d85b91c791101ebbc312b417e08f952ca3f9daa8 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx
@@ -233,8 +233,8 @@ StatusCode AsgPhotonIsEMSelector::initialize()
   StatusCode sc = StatusCode::SUCCESS ;
 
   if(!m_WorkingPoint.empty()){
-    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::m_PhotonCutPointToConfFile);
-    m_rootTool->isEMMask=AsgConfigHelper::findMask(m_WorkingPoint,EgammaSelectors::m_PhotonCutPointToMask);
+    m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::PhotonCutPointToConfFile);
+    m_rootTool->isEMMask=AsgConfigHelper::findMask(m_WorkingPoint,EgammaSelectors::PhotonCutPointToMask);
   }
 
   if(!m_configFile.empty()){
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/EGSelectorConfigurationMapping.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/EGSelectorConfigurationMapping.h
index 2abfdb45a842f02fe63262b3dacfc01672f2ae28..c946dac796b86f8e6d72ea77b5083c23442f4409 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/EGSelectorConfigurationMapping.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/EGSelectorConfigurationMapping.h
@@ -12,33 +12,44 @@
 namespace EgammaSelectors {
   //----------------------------------------------------------
   //This is the internal part , We need to  map string to latest reccomendations
-  const std::map<std::string,std::string> m_LHPointToConfFile={
-    {"VeryLooseLHElectron","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodVeryLooseOfflineConfig2016_Smooth.conf"},
-    {"LooseLHElectron","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_Smooth.conf"},
-    {"LooseBLLHElectron","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth.conf"},
-    {"MediumLHElectron","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth.conf"},
-    {"TightLHElectron","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf"}
+  const std::map<std::string,std::string> LHPointToConfFile={
+    // default tunes, recommended for rel 21
+    {"VeryLooseLHElectron","ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf"},
+    {"LooseLHElectron"    ,"ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_Smooth.conf"},
+    {"LooseBLLHElectron"  ,"ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_CutBL_Smooth.conf"},
+    {"MediumLHElectron"   ,"ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf"},
+    {"TightLHElectron"    ,"ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf"},
+    // legacy rel 20p7 tunes, to allow usage in rel 20p7 derivations
+    {"VeryLooseLHElectron_Rel20p7","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodVeryLooseOfflineConfig2016_Smooth.conf"},
+    {"VeryLooseLHNod0Electron_Rel20p7", "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodVeryLooseOfflineConfig2016_Smooth_NoD0.conf"},
+    {"LooseLHElectron_Rel20p7","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_Smooth.conf"},
+    {"LooseLHNod0Electron_Rel20p7", "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_Smooth_NoD0.conf"},
+    {"LooseBLLHElectron_Rel20p7","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth.conf"},
+    {"LooseBLLHNod0Electron_Rel20p7", "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth_NoD0.conf"},
+    {"MediumLHElectron_Rel20p7","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth.conf"},
+    {"MediumLHNod0Electron_Rel20p7", "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth_NoD0.conf"},
+    {"TightLHElectron_Rel20p7","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf"},
   };
-  const std::map<std::string,std::string> m_PhotonCutPointToConfFile={
+  const std::map<std::string,std::string> PhotonCutPointToConfFile={
     {"LoosePhoton","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMLooseSelectorCutDefs.conf"},
     {"MediumPhoton","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMMediumSelectorCutDefs.conf"},
     {"TightPhoton","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMTightSelectorCutDefs.conf"},
   };
-  const std::map<std::string,std::string> m_ForwardElectronCutPointToConfFile={
+  const std::map<std::string,std::string> ForwardElectronCutPointToConfFile={
     {"LooseForwardElectron","ElectronPhotonSelectorTools/offline/mc15_20150812/ForwardElectronIsEMLooseSelectorCutDefs.conf"},
     {"MediumForwardElectron","ElectronPhotonSelectorTools/offline/mc15_20150812/ForwardElectronIsEMMediumSelectorCutDefs.conf"},
     {"TightForwardElectron","ElectronPhotonSelectorTools/offline/mc15_20150812/ForwardElectronIsEMTightSelectorCutDefs.conf"},
   };
-  const std::map<std::string,std::string> m_ElectronCutPointToConfFile={
+  const std::map<std::string,std::string> ElectronCutPointToConfFile={
     {"LooseElectron","ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf"},
     {"MediumElectron","ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMMediumSelectorCutDefs.conf"},
     {"TightElectron","ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMTightSelectorCutDefs.conf"}
   };
   //----------------------------------------------------------
   //Map enums to masks , needed for photons
-  const std::map<std::string,unsigned int> m_PhotonCutPointToMask={{"LoosePhoton",egammaPID::PhotonLoose},
-								   {"MediumPhoton",egammaPID::PhotonMedium},
-								   {"TightPhoton",egammaPID::PhotonTight},
+  const std::map<std::string,unsigned int> PhotonCutPointToMask={{"LoosePhoton",egammaPID::PhotonLoose},
+                                                                 {"MediumPhoton",egammaPID::PhotonMedium},
+                                                                 {"TightPhoton",egammaPID::PhotonTight},
   };
 }
 ////////////////////////////////////////////
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/ElectronSelectorHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/ElectronSelectorHelpers.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..7133e8c2267c71017f5b7dd3f497382d7ee0ae9c
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/ElectronSelectorHelpers.cxx
@@ -0,0 +1,109 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "ElectronPhotonSelectorTools/ElectronSelectorHelpers.h"
+#include "xAODEgamma/Electron.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "AsgTools/AsgMessaging.h"
+
+// ==================================================================
+std::size_t ElectronSelectorHelpers::numberOfPixelHitsAndDeadSensors(const xAOD::TrackParticle *tp){
+
+  // Define an AsgMessaging instance
+  asg::AsgMessaging msg("ElectronSelectorHelpers");
+
+  if(!tp){
+    msg.msg(MSG::WARNING) << "No track particle found!" << endmsg;
+    return 0;
+  }
+
+  uint8_t nPixHits(0), nPixDead(0);
+
+  bool allFound = true;
+  allFound = allFound && tp->summaryValue(nPixHits, xAOD::numberOfPixelHits);
+  allFound = allFound && tp->summaryValue(nPixDead, xAOD::numberOfPixelDeadSensors);
+  if(!allFound){
+    msg.msg(MSG::WARNING) << "Failed to load all pixel variables" << endmsg;
+  }
+
+  return nPixHits + nPixDead;
+}
+// ==================================================================
+std::size_t ElectronSelectorHelpers::numberOfSCTHitsAndDeadSensors(const xAOD::TrackParticle *tp){
+
+  // Define an AsgMessaging instance
+  asg::AsgMessaging msg("ElectronSelectorHelpers");
+
+  if(!tp){
+    msg.msg(MSG::WARNING) << "No track particle found!" << endmsg;
+    return 0;
+  }
+
+  uint8_t nSCTHits(0), nSCTDead(0);
+
+  bool allFound = true;
+  allFound = allFound && tp->summaryValue(nSCTHits, xAOD::numberOfSCTHits);
+  allFound = allFound && tp->summaryValue(nSCTDead, xAOD::numberOfSCTDeadSensors);
+  if(!allFound){
+    msg.msg(MSG::WARNING) << "Failed to load all SCT variables" << endmsg;
+  }
+
+  return nSCTHits + nSCTDead;
+}
+// ==================================================================
+std::size_t ElectronSelectorHelpers::numberOfSiliconHitsAndDeadSensors(const xAOD::TrackParticle *tp){
+  return numberOfPixelHitsAndDeadSensors(tp) + numberOfSCTHitsAndDeadSensors(tp);
+}
+// ==================================================================
+bool ElectronSelectorHelpers::passBLayerRequirement(const xAOD::TrackParticle *tp){
+
+  // Define an AsgMessaging instance
+  asg::AsgMessaging msg("ElectronSelectorHelpers");
+
+  if(!tp){
+    msg.msg(MSG::WARNING) << "No track particle found!" << endmsg;
+    return 0;
+  }
+
+  uint8_t expectInnermostLayer(0);
+  uint8_t nInnermostLayerHits(0);
+  uint8_t nInnermostLayerOutliers(0);
+  uint8_t expectNextToInnermostLayer(0);
+  uint8_t nNextToInnermostLayerHits(0);
+  uint8_t nNextToInnermostLayerOutliers(0);
+
+  bool allFound = true;
+  allFound = allFound && tp->summaryValue(expectInnermostLayer, xAOD::expectBLayerHit);
+  allFound = allFound && tp->summaryValue(nInnermostLayerHits, xAOD::numberOfBLayerHits);
+  allFound = allFound && tp->summaryValue(nInnermostLayerOutliers, xAOD::numberOfBLayerOutliers);
+  allFound = allFound && tp->summaryValue(expectNextToInnermostLayer, xAOD::expectNextToInnermostPixelLayerHit);
+  allFound = allFound && tp->summaryValue(nNextToInnermostLayerHits, xAOD::numberOfNextToInnermostPixelLayerHits);
+  allFound = allFound && tp->summaryValue(nNextToInnermostLayerOutliers, xAOD::numberOfNextToInnermostPixelLayerOutliers);
+  if(!allFound){
+    msg.msg(MSG::WARNING) << "Failed to load all BLayer variables" << endmsg;
+  }
+
+  // If innermost and next to innermost layer are both masked off, then the
+  // selectors should PASS the BL cut, so the default here is true
+  bool passBLReq = true;
+
+  if(expectInnermostLayer){
+    passBLReq = ( nInnermostLayerHits + nInnermostLayerOutliers > 0 );
+  }
+  else if(expectNextToInnermostLayer){
+    passBLReq = ( nNextToInnermostLayerHits + nNextToInnermostLayerOutliers > 0 );
+  }
+
+  return passBLReq;
+}
+
+
+// ==================================================================
+bool ElectronSelectorHelpers::passAmbiguity(xAOD::AmbiguityTool::AmbiguityType type, const uint8_t criterion){
+
+  // helper to check if ambiguity type is one of several that are stored in a bitmask
+  return criterion & 0x1<<type;
+
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx
index 50516050a111a3a0a5afbcb7853bd2d7ce6de81e..53751c4dcd9f0a6768f27832310196555e08dc7a 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx
@@ -21,12 +21,7 @@ Root::TElectronIsEMSelector::TElectronIsEMSelector(const char* name) :
   asg::AsgMessaging(std::string(name)), 
   isEMMask(0), //All will pass if not specified
   useTRTOutliers(true),
-  useBLOutliers(true),
-  usePIXOutliers(true),
-  usePIXDeadSensors(true),
-  useSCTOutliers(true),
   useTRTXenonHits(false),
-  useBLayerHitPrediction(true),
   m_isEM(~0),
   /** @brief cluster eta range */
   m_cutPositionClusterEtaRange_Electron(0),    
@@ -420,20 +415,12 @@ const Root::TAccept& Root::TElectronIsEMSelector::accept(
 							 // fraction of energy reconstructed in the 3rd sampling
 							 float f3,
 							 //////////////// - tracking
-							 // number of B-layer hits
-							 int nBL,
-							 int nBLOutliers,
-							 // number of next to inner-most B-layer hits
-							 int nNextToInnerMostLayer,
-							 int nNextToInnerMostLayerOutliers,
-							 // number of Pixel hits
-							 int nPi,
-							 int nPiOutliers,
-							 int nPiDeadSensors,
-							 // number of SCT hits
-							 int nSCT,
-							 int nSCTOutliers,
-							 int nSCTDeadSensors,
+							 // is effective number of BL hits+outliers at least 1?
+                                                         bool passBLayerRequirement,
+							 // number of pixel hits + dead sensors
+                                                         int nPixHitsPlusDeadSensors,
+							 // number of silicon hits + dead sensors
+							 int nSiHitsPlusDeadSensors,
 							 // TRT hits
 							 int nTRThigh,
 							 int nTRThighOutliers,
@@ -447,9 +434,7 @@ const Root::TAccept& Root::TElectronIsEMSelector::accept(
 							 float deltaeta,
 							 float deltaphi,
 							 // E/p
-							 double ep,
-							 bool expectHitInBLayer,
-							 bool expectHitNextInBLayer) const 
+							 double ep) const 
 {
   // Reset the cut result bits to zero (= fail cut)
   m_accept.clear();
@@ -472,16 +457,9 @@ const Root::TAccept& Root::TElectronIsEMSelector::accept(
 		    wtot,
 		    fracm,
 		    f3,
-		    nBL,
-		    nBLOutliers,
-		    nNextToInnerMostLayer,
-		    nNextToInnerMostLayerOutliers,
-		    nPi,
-		    nPiOutliers,
-		    nPiDeadSensors,
-		    nSCT,
-		    nSCTOutliers,
-		    nSCTDeadSensors,
+                    passBLayerRequirement,
+                    nPixHitsPlusDeadSensors,
+                    nSiHitsPlusDeadSensors,
 		    nTRThigh,
 		    nTRThighOutliers,
 		    nTRT,
@@ -491,9 +469,7 @@ const Root::TAccept& Root::TElectronIsEMSelector::accept(
 		    trackd0,
 		    deltaeta,
 		    deltaphi,
-		    ep,
-		    expectHitInBLayer,
-		    expectHitNextInBLayer);
+		    ep);
 
   return fillAccept();
 
@@ -534,21 +510,13 @@ unsigned int Root::TElectronIsEMSelector::calcIsEm(
 						   float fracm,
 						   // fraction of energy reconstructed in the 3rd sampling
 						   float f3,
-						   //////////////// - tracking
-						   // number of B-layer hits
-						   int nBL,
-						   int nBLOutliers,
-						   // number of next to inner-most B-layer hits
-						   int nNextToInnerMostLayer,
-						   int nNextToInnerMostLayerOutliers,
-						   // number of Pixel hits
-						   int nPi,
-						   int nPiOutliers,
-						   int nPiDeadSensors,
-						   // number of SCT hits
-						   int nSCT,
-						   int nSCTOutliers,
-						   int nSCTDeadSensors,
+                                                   //////////////// - tracking
+                                                   // is effective number of BL hits+outliers at least 1?
+                                                   bool passBLayerRequirement,
+                                                   // number of pixel hits + dead sensors
+                                                   int nPixHitsPlusDeadSensors,
+                                                   // number of silicon hits + dead sensors
+                                                   int nSiHitsPlusDeadSensors,
 						   // TRT hits
 						   int nTRThigh,
 						   int nTRThighOutliers,
@@ -562,9 +530,7 @@ unsigned int Root::TElectronIsEMSelector::calcIsEm(
 						   float deltaeta,
 						   float deltaphi,
 						   // E/p
-						   double ep,
-						   bool expectHitInBLayer,
-						   bool expectHitNextInBLayer) const
+						   double ep) const
 { 
   unsigned int iflag = calocuts_electrons(eta2,
 					  et,
@@ -586,16 +552,9 @@ unsigned int Root::TElectronIsEMSelector::calcIsEm(
 
   iflag = TrackCut(eta2,
 		   et,
-		   nBL,
-		   nBLOutliers,
-		   nNextToInnerMostLayer,
-		   nNextToInnerMostLayerOutliers,
-		   nPi,
-		   nPiOutliers,
-		   nPiDeadSensors,
-		   nSCT,
-		   nSCTOutliers,
-		   nSCTDeadSensors,
+                   passBLayerRequirement,
+                   nPixHitsPlusDeadSensors,
+                   nSiHitsPlusDeadSensors,
 		   nTRThigh,
 		   nTRThighOutliers,
 		   nTRT,
@@ -606,8 +565,6 @@ unsigned int Root::TElectronIsEMSelector::calcIsEm(
 		   deltaeta,
 		   deltaphi,
 		   ep,
-		   expectHitInBLayer,
-		   expectHitNextInBLayer,
 		   iflag);
 
   return iflag;
@@ -766,21 +723,14 @@ unsigned int Root::TElectronIsEMSelector::TrackCut(
 						   // eta of the cluster in the 2nd sampling
 						   float eta2,
 						   // transverse energy in calorimeter (using eta position in second sampling)
-						   double et,
-						   // number of B-layer hits
-						   int nBL,
-						   int nBLOutliers,
-						   // number of next to the innerm most B-layer hits
-						   int nNextToInnerMostLayer,
-						   int nNextToInnerMostLayerOutliers,
-						   // number of Pixel hits
-						   int nPi,
-						   int nPiOutliers,
-						   int nPiDeadSensors,
-						   // number of SCT hits
-						   int nSCT,
-						   int nSCTOutliers,
-						   int nSCTDeadSensors,
+                                                   double et,
+                                                   // is effective number of BL hits+outliers at least 1?
+                                                   bool passBLayerRequirement,
+                                                   // number of pixel hits + dead sensors
+                                                   int nPixHitsPlusDeadSensors,
+                                                   // number of silicon hits + dead sensors
+                                                   int nSiHitsPlusDeadSensors,
+
 						   // TRT hits
 						   int nTRThigh,
 						   int nTRThighOutliers,
@@ -795,8 +745,6 @@ unsigned int Root::TElectronIsEMSelector::TrackCut(
 						   float deltaphi,
 						   // E/p
 						   double ep,
-						   bool expectHitInBLayer,
-						   bool expectHitNextInBLayer,
 						   unsigned int iflag) const
 {
   // check the bin number
@@ -804,51 +752,22 @@ unsigned int Root::TElectronIsEMSelector::TrackCut(
   int ibin_eta= bins.at(1);
   int ibin_combined= bins.at(2);
 
-  int nSi = nPi + nSCT;
-  int nSiDeadSensors = nPiDeadSensors + nSCTDeadSensors;
-  
-  if (useBLOutliers) {
-    nBL += nBLOutliers;
-    nNextToInnerMostLayer += nNextToInnerMostLayerOutliers;
-  }
-  if (usePIXOutliers) {
-    nPi += nPiOutliers;
-    nSi += nPiOutliers;
-  }
-  if (usePIXDeadSensors) {
-    nPi += nPiDeadSensors;
-    nSi += nSiDeadSensors;
-  }
-  if (useSCTOutliers) {
-    nSi += nSCTOutliers;
-  }
-  
   if (ibin_eta>=0) {
-    // Track quality cuts
-    // cuts on number of b-layer hits - check if module was alive
-    if ((useBLayerHitPrediction &&
-	 (nPi == 0 || expectHitInBLayer)) || 
-	!useBLayerHitPrediction) {
-      if (CheckVar(CutBL,1)) {
-	if (nBL<CutBL[ibin_eta])
-	  iflag |= ( 0x1 << egammaPID::TrackBlayer_Electron) ; 
-      }
-    } else if  ((useBLayerHitPrediction && (nPi == 0 || expectHitNextInBLayer)) || !useBLayerHitPrediction) {
-      if (CheckVar(CutBL,1)) {
-	if (nNextToInnerMostLayer<CutBL[ibin_eta])
-	  iflag |= ( 0x1 << egammaPID::TrackBlayer_Electron) ; 
-      }
-    }
 
+    // Track quality cuts
 
+    // cuts on number of b-layer hits
+    if(CheckVar(CutBL,1) && CutBL[ibin_eta] == 1 && !passBLayerRequirement){
+      iflag |= ( 0x1 << egammaPID::TrackBlayer_Electron); 
+    }
     // cuts on number of pixel hits
     if (CheckVar(CutPi,1)) {
-      if (nPi<CutPi[ibin_eta]) 
+      if (nPixHitsPlusDeadSensors<CutPi[ibin_eta]) 
 	iflag |= ( 0x1 << egammaPID::TrackPixel_Electron) ; 
     }
     // cuts on number of precision hits
     if (CheckVar(CutSi,1)) {
-      if (nSi<CutSi[ibin_eta]) 
+      if (nSiHitsPlusDeadSensors<CutSi[ibin_eta]) 
 	iflag |= ( 0x1 << egammaPID::TrackSi_Electron) ; 
     }
     // cuts on transverse impact parameter
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h
index 88f469e08df1ad5df4f1e1908642d97eaab308a7..061f1f2401fa5365dd6e925a9f8f9db46c683b6a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h
@@ -85,20 +85,12 @@ namespace Root {
 				// fraction of energy reconstructed in the 3rd sampling
 				float f3,
 				//////////////// - tracking
-				// number of B-layer hits
-				int nBL,
-				int nBLOutliers,
-				// number of next to inner most B-layer hits
-				int nNextToInnerMostLayer,
-				int nNextToInnerMostLayerOutliers,
-				// number of Pixel hits
-				int nPi,
-				int nPiOutliers,
-				int nPiDeadSensors,
-				// number of SCT hits
-				int nSCT,
-				int nSCTOutliers,
-				int nSCTDeadSensors,
+                                // is effective number of BL hits+outliers at least 1?
+                                bool passBLayerRequirement,
+                                // number of pixel hits + dead sensors
+                                int nPixHitsPlusDeadSensors,
+                                // number of silicon hits + dead sensors
+                                int nSiHitsPlusDeadSensors,
 				// TRT hits
 				int nTRThigh,
 				int nTRThighOutliers,
@@ -112,9 +104,7 @@ namespace Root {
 				float deltaeta,
 				float deltaphi,
 				// E/p
-				double ep,
-				bool expectHitInBLayer,
-				bool expectHitNextInBLayer) const;
+				double ep) const;
 
     // calculate the isEM. (Used internally by accept)
     unsigned int calcIsEm(
@@ -152,20 +142,12 @@ namespace Root {
 			  // fraction of energy reconstructed in the 3rd sampling
 			  float f3,
 			  //////////////// - tracking
-			  // number of B-layer hits
-			  int nBL,
-			  int nBLOutliers,
-			  // number of next to inner most B-layer hits
-			  int nNextToInnerMostLayer,
-			  int nNextToInnerMostLayerOutliers,
-			  // number of Pixel hits
-			  int nPi,
-			  int nPiOutliers,
-			  int nPiDeadSensors,
-			  // number of SCT hits
-			  int nSCT,
-			  int nSCTOutliers,
-			  int nSCTDeadSensors,
+                          // is effective number of BL hits+outliers at least 1?
+                          bool passBLayerRequirement,
+                          // number of pixel hits + dead sensors
+                          int nPixHitsPlusDeadSensors,
+                          // number of silicon hits + dead sensors
+                          int nSiHitsPlusDeadSensors,
 			  // TRT hits
 			  int nTRThigh,
 			  int nTRThighOutliers,
@@ -179,9 +161,7 @@ namespace Root {
 			  float deltaeta,
 			  float deltaphi,
 			  // E/p
-			  double ep,
-			  bool expectHitInBLayer,
-			  bool expectHitNextInBLayer) const;
+			  double ep) const;
 
     // used internally by calcIsEm, but left public because it can be useful for users. Note that
     // it doesn't necessarily zero all the values that pass, so make sure that the input iflag
@@ -233,20 +213,12 @@ namespace Root {
 			  float eta2,
 			  // transverse energy in calorimeter (using eta position in second sampling)
 			  double et,
-			  // number of B-layer hits
-			  int nBL,
-			  int nBLOutliers,
-			  // number of next to inner most B-layer hits
-			  int nNextToInnerMostLayer,
-			  int nNextToInnerMostLayerOutliers,
-			  // number of Pixel hits
-			  int nPi,
-			  int nPiOutliers,
-			  int nPiDeadSensors,
-			  // number of SCT hits
-			  int nSCT,
-			  int nSCTOutliers,
-			  int nSCTDeadSensors,
+                          // is effective number of BL hits+outliers at least 1?
+                          bool passBLayerRequirement,
+                          // number of pixel hits + dead sensors
+                          int nPixHitsPlusDeadSensors,
+                          // number of silicon hits + dead sensors
+                          int nSiHitsPlusDeadSensors,
 			  // TRT hits
 			  int nTRThigh,
 			  int nTRThighOutliers,
@@ -261,8 +233,6 @@ namespace Root {
 			  float deltaphi,
 			  // E/p
 			  double ep,
-			  bool expectHitInBLayer,
-			  bool expectHitNextInBLayer,
 			  unsigned int iflag) const;
 
 
@@ -278,19 +248,8 @@ namespace Root {
 
     /** @brief use of TRT outliers*/
     bool useTRTOutliers;
-    /** @brief use of b-layer outliers*/
-    bool useBLOutliers;
-    /** @brief use of PIX outliers*/
-    bool usePIXOutliers;
-    /** @brief use of PIX adn SCT outliers and dead sensor*/
-    bool usePIXDeadSensors;
-    /** @brief use of SCT outliers*/
-    bool useSCTOutliers;
     /** @brief use of TRT Xenon Hits*/ 
     bool useTRTXenonHits; 
-    /** @brief use b-layer prediction tied to conddb */
-    bool useBLayerHitPrediction; 
-
 
     /** @brief range of eta bins for e-ID*/
     std::vector<float> CutBinEta;
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
index f566822a6daf43f916ae042b7243dfb47dc6abee..7992fccac4857a7b502cef5257cabc5edb537242 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
@@ -14,6 +14,9 @@
 #include "TFile.h"                      // for TFile
 #include "TH1.h"                        // for TH1F
 #include "TString.h"                    // for TString
+
+#include "ElectronPhotonSelectorTools/ElectronSelectorHelpers.h"
+
 /** 
     Author : Kurt Brendlinger <kurb@sas.upenn.edu>
     Please see TElectronLikelihoodTool.h for usage.
@@ -51,6 +54,7 @@ Root::TElectronLikelihoodTool::TElectronLikelihoodTool(const char* name) :
   m_cutPosition_NPixel(-9),
   m_cutPosition_NBlayer(-9),
   m_cutPosition_conversion(-9),
+  m_cutPosition_ambiguity(-9),
   m_cutPosition_LH(-9),
   m_cutPositionTrackA0(-9),
   m_cutPositionTrackMatchEta(-9),
@@ -202,6 +206,11 @@ int Root::TElectronLikelihoodTool::initialize()
   m_cutPosition_conversion = m_accept.addCut( "conversion", "pass conversion" );
   if ( m_cutPosition_conversion < 0 ) {sc = 0;}
 
+ // Ambiguity
+  m_cutPosition_ambiguity = m_accept.addCut( "ambiguity", "pass ambiguity" );
+  if ( m_cutPosition_ambiguity < 0 ) {sc = 0;}
+
+
   // Cut position for the likelihood selection - DO NOT CHANGE ORDER!
   m_cutPosition_LH = m_accept.addCut( "passLH", "pass Likelihood" );
   if ( m_cutPosition_LH < 0 ) {sc = 0;}
@@ -285,6 +294,7 @@ int Root::TElectronLikelihoodTool::initialize()
 		<< "\n - (bool)CutPi (yes/no)                         : " << (CutPi.size() ? "yes" : "no")
 		<< "\n - (bool)CutSi (yes/no)                         : " << (CutSi.size() ? "yes" : "no")
 		<< "\n - (bool)doCutConversion (yes/no)               : " << (doCutConversion ? "yes" : "no")
+		<< "\n - (bool)CutAmbiguity (yes/no)                  : " << (CutAmbiguity.size() ? "yes" : "no")
 		<< "\n - (bool)doRemoveF3AtHighEt (yes/no)            : " << (doRemoveF3AtHighEt ? "yes" : "no")
 		<< "\n - (bool)doRemoveTRTPIDAtHighEt (yes/no)        : " << (doRemoveTRTPIDAtHighEt ? "yes" : "no")
 		<< "\n - (bool)doSmoothBinInterpolation (yes/no)      : " << (doSmoothBinInterpolation ? "yes" : "no")
@@ -378,36 +388,29 @@ int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned i
 }
 
 const Root::TAccept& Root::TElectronLikelihoodTool::accept( double likelihood,
-							    double eta, double eT,
-							    int nSi,int nSiDeadSensors, int nPix, int nPixDeadSensors,
-							    int nBlayer, int nBlayerOutliers, bool expectBlayer,
-							    int nNextToInnerMostLayer, int nNextToInnerMostLayerOutliers, bool expectNextToInnerMostLayer,
-							    int convBit, double d0, double deltaEta, double deltaphires, 
-							    double wstot, double EoverP, double ip
-							    ) const
+                                                            double eta, double eT,
+                                                            int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors,
+                                                            bool passBLayerRequirement,
+                                                            int convBit, uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, 
+                                                            double wstot, double EoverP, double ip
+                                                            ) const
 {
   LikeEnum::LHAcceptVars_t vars;
   
-  vars.likelihood      = likelihood     ;
-  vars.eta             = eta            ;
-  vars.eT              = eT             ;
-  vars.nSi             = nSi            ;
-  vars.nSiDeadSensors  = nSiDeadSensors ;
-  vars.nPix            = nPix           ;
-  vars.nPixDeadSensors = nPixDeadSensors;
-  vars.nBlayer         = nBlayer        ;
-  vars.nBlayerOutliers = nBlayerOutliers;
-  vars.expectBlayer    = expectBlayer   ;
-  vars.nNextToInnerMostLayer        = nNextToInnerMostLayer        ;
-  vars.nNextToInnerMostLayerOutliers = nNextToInnerMostLayerOutliers;
-  vars.expectNextToInnerMostLayer = expectNextToInnerMostLayer   ;
-  vars.convBit         = convBit        ;
-  vars.d0              = d0             ;
-  vars.deltaEta        = deltaEta       ;
-  vars.deltaphires     = deltaphires    ;
-  vars.wstot           = wstot          ;
-  vars.EoverP          = EoverP         ;
-  vars.ip              = ip             ;
+  vars.likelihood              = likelihood;
+  vars.eta                     = eta;
+  vars.eT                      = eT;
+  vars.nSiHitsPlusDeadSensors  = nSiHitsPlusDeadSensors;
+  vars.nPixHitsPlusDeadSensors = nPixHitsPlusDeadSensors;
+  vars.passBLayerRequirement   = passBLayerRequirement;
+  vars.convBit                 = convBit;
+  vars.ambiguityBit            = ambiguityBit;
+  vars.d0                      = d0;
+  vars.deltaEta                = deltaEta;
+  vars.deltaphires             = deltaphires;
+  vars.wstot                   = wstot;
+  vars.EoverP                  = EoverP;
+  vars.ip                      = ip;
   
   return accept(vars);
 }
@@ -424,6 +427,7 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa
   bool passNPixel(true);
   bool passNBlayer(true);
   bool passConversion(true);
+  bool passAmbiguity(true);
   bool passLH(true);
   bool passTrackA0(true);
   bool passDeltaEta(true);
@@ -462,32 +466,34 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa
     ATH_MSG_DEBUG("Likelihood macro: Conversion Bit Failed." );
     passConversion = false;
   }
-
+  
+  // ambiguity bit
+  if (CutAmbiguity.size()) {
+    if ( !ElectronSelectorHelpers::passAmbiguity((xAOD::AmbiguityTool::AmbiguityType)vars_struct.ambiguityBit,
+						CutAmbiguity[etabin])
+	 ) {
+      ATH_MSG_DEBUG("Likelihood macro: ambiguity Bit Failed." );
+      passAmbiguity = false;
+    }
+  }
+  
   // blayer cut
   if (CutBL.size() ) {
-    if(vars_struct.expectBlayer) {
-      if(vars_struct.nBlayer + vars_struct.nBlayerOutliers < CutBL[etabin]) {
-	ATH_MSG_DEBUG("Likelihood macro: Inner most Blayer Failed." );
-	passNBlayer = false;
-      }
-    }  
-    else if(vars_struct.expectNextToInnerMostLayer) { // When we do not expect IBL but next to inner 
-      if(vars_struct.nNextToInnerMostLayer + vars_struct.nNextToInnerMostLayerOutliers < CutBL[etabin]) {
-	ATH_MSG_DEBUG("Likelihood macro: Next Inner Failed when not expecting." );
-	passNBlayer = false;
-      } 
+    if(CutBL[etabin] == 1 && !vars_struct.passBLayerRequirement) {
+      ATH_MSG_DEBUG("Likelihood macro: Blayer cut failed.");
+      passNBlayer = false;
     }
   }
   // pixel cut
   if (CutPi.size()){
-    if (vars_struct.nPix+vars_struct.nPixDeadSensors < CutPi[etabin]){
+    if (vars_struct.nPixHitsPlusDeadSensors < CutPi[etabin]){
       ATH_MSG_DEBUG("Likelihood macro: Pixels Failed.");
       passNPixel = false;
     }
   }
   // silicon cut
   if (CutSi.size()){
-    if (vars_struct.nSi + vars_struct.nSiDeadSensors < CutSi[etabin]){
+    if (vars_struct.nSiHitsPlusDeadSensors < CutSi[etabin]){
       ATH_MSG_DEBUG( "Likelihood macro: Silicon Failed.");
       passNSilicon = false;
     }
@@ -580,6 +586,7 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa
   m_accept.setCutResult( m_cutPosition_NPixel, passNPixel );
   m_accept.setCutResult( m_cutPosition_NBlayer, passNBlayer );
   m_accept.setCutResult( m_cutPosition_conversion, passConversion );
+  m_accept.setCutResult( m_cutPosition_ambiguity, passAmbiguity );
   m_accept.setCutResult( m_cutPosition_LH, passLH );  
   m_accept.setCutResult( m_cutPositionTrackA0, passTrackA0 );  
   m_accept.setCutResult( m_cutPositionTrackMatchEta, passDeltaEta );  
@@ -1027,6 +1034,8 @@ double Root::TElectronLikelihoodTool::InterpolatePdfs(unsigned int s_or_b,unsign
   int etabin = getLikelihoodEtaBin(eta);
   double integral = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->Integral());
   double prob = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->GetBinContent(bin)) / integral;
+
+  int Nbins      = fPDFbins[s_or_b][ipbin][etbin][etabin][var]->GetNbinsX();
   if (et > 42500.) return prob; // interpolation stops here.
   if (et < 6000.) return prob; // interpolation stops here.
   if (22500. < et && et < 27500.) return prob; // region of non-interpolation for pdfs
@@ -1042,16 +1051,35 @@ double Root::TElectronLikelihoodTool::InterpolatePdfs(unsigned int s_or_b,unsign
   if (et > bin_center){
     double prob_next = prob;
     if (etbin+1<=6) {
+      // account for potential histogram bin inequalities
+      int NbinsPlus  = fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->GetNbinsX();
+      int binplus = bin;
+      if (Nbins < NbinsPlus){
+	binplus = int(round(bin*(Nbins/NbinsPlus)));
+      }
+      else if (Nbins > NbinsPlus){
+	binplus = int(round(bin*(NbinsPlus/Nbins)));
+      }
+      // do interpolation
       double integral_next = double(fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->Integral());
-      prob_next = double(fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->GetBinContent(bin)) / integral_next;
+      prob_next = double(fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->GetBinContent(binplus)) / integral_next;
       return prob+(prob_next-prob)*(et-bin_center)/(bin_width);
     }
   }
   // or else if et < bin_center :
   double prob_before = prob;
   if (etbin-1>=0) {
+    // account for potential histogram bin inequalities
+    int NbinsMinus = fPDFbins[s_or_b][ipbin][etbin-1][etabin][var]->GetNbinsX();
+    int binminus = bin;
+    if (Nbins < NbinsMinus){
+      binminus = int(round(bin*(Nbins/NbinsMinus)));
+    }
+    else if (Nbins > NbinsMinus){
+      binminus = int(round(bin*(NbinsMinus/Nbins)));
+    }
     double integral_before = double(fPDFbins[s_or_b][ipbin][etbin-1][etabin][var]->Integral());
-    prob_before = double(fPDFbins[s_or_b][ipbin][etbin-1][etabin][var]->GetBinContent(bin)) / integral_before;
+    prob_before = double(fPDFbins[s_or_b][ipbin][etbin-1][etabin][var]->GetBinContent(binminus)) / integral_before;
   }
   return prob-(prob-prob_before)*(bin_center-et)/(bin_width);
 }
@@ -1122,7 +1150,11 @@ int Root::TElectronLikelihoodTool::SafeTH1::FindBin(double value){
 }
 
 double Root::TElectronLikelihoodTool::SafeTH1::GetBinContent(int bin){
-  return m_binContent[bin];
+  int nbins = this->GetNbinsX();
+  // since we store the bin content in a vector we need a protection 
+  // for cases where we try to access a non-existing bin. In these 
+  // cases just go to the last bin
+  return (bin>nbins) ? m_binContent[nbins-1] : m_binContent[bin];
 }
 
 double Root::TElectronLikelihoodTool::SafeTH1::GetBinLowEdge(int bin){
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
index 262f86d380a510924e6815fd144b085539fb8689..af678b0a4eec99e40a482ca4cbe480fa33cb8dbd 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
@@ -73,6 +73,7 @@
    nNextToInnerMostLayerOutliers 	: next to the inner most 
    expectNextToInnerMostLayer 	: next to the inner most 
    convBit 		: el_isEM & (0x1 << egammaPID::ConversionMatch_Electron)
+   ambiguityBit 	: cut on the ambiguity type
    ip 		: Count number of vertices in vxp_n with >= 2 tracks in vxp_trk_n
 
    Created:
@@ -107,17 +108,11 @@ namespace LikeEnum {
     double likelihood;
     double eta;
     double eT;
-    int nSi;
-    int nSiDeadSensors;
-    int nPix;
-    int nPixDeadSensors;
-    int nBlayer;
-    int nBlayerOutliers;
-    bool expectBlayer;
-    int nNextToInnerMostLayer;
-    int nNextToInnerMostLayerOutliers;
-    bool expectNextToInnerMostLayer;
+    int nSiHitsPlusDeadSensors;
+    int nPixHitsPlusDeadSensors;
+    bool passBLayerRequirement;
     int convBit;
+    uint8_t ambiguityBit;
     double d0;
     double deltaEta;
     double deltaphires;
@@ -190,10 +185,9 @@ namespace Root {
     const Root::TAccept& accept(LikeEnum::LHAcceptVars_t& vars_struct) const;
     const Root::TAccept& accept( double likelihood,
                                  double eta, double eT,
-                                 int nSi,int nSiDeadSensors, int nPix, int nPixDeadSensors,
-                                 int nBlayer, int nBlayerOutliers, bool expectBlayer,
-				 int nNextToInnerMostLayer, int nNextToInnerMostLayerOutliers, bool expectNextToInnerMostLayer,
-                                 int convBit, double d0, double deltaEta, double deltaphires, 
+                                 int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors,
+                                 bool passBLayerRequirement,
+                                 int convBit, uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, 
                                  double wstot, double EoverP, double ip ) const;
     const Root::TResult& calculate(LikeEnum::LHCalcVars_t& vars_struct) const ;
     const Root::TResult& calculate( double eta, double eT,double f3, double rHad, double rHad1,
@@ -264,6 +258,8 @@ namespace Root {
     std::vector<double> CutDeltaPhiRes;
     /** @brief do cut on conversion bit*/
     bool doCutConversion;
+    /** @brief do cut on ambiguity bit*/
+    std::vector<int> CutAmbiguity;
     /** @brief do remove f3 variable from likelihood at high Et (>80 GeV)*/
     bool doRemoveF3AtHighEt;
     /** @brief do remove TRTPID variable from likelihood at high Et (>80 GeV)*/
@@ -330,7 +326,7 @@ namespace Root {
     unsigned int getLikelihoodEtHistBin(double eT) const ;
     
     /// Fine Et binning. Used for the likelihood discriminant cuts.
-    unsigned int getLikelihoodEtDiscBin(double eT, const bool isLHbinning) const;
+    unsigned int getLikelihoodEtDiscBin(double eT , const bool isLHbinning) const;
 
 
     // Private member variables
@@ -366,6 +362,9 @@ namespace Root {
     /// The position of the conversion cut bit in the TAccept return object
     int m_cutPosition_conversion;
 
+    /// The position of the ambiguity cut bit in the TAccept return object
+    int m_cutPosition_ambiguity;
+
     /// The position of the likelihood cut bit in the TAccept return object
     int m_cutPosition_LH;
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/Makefile.RootCore b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/Makefile.RootCore
deleted file mode 100644
index 3f8f44dc8a0d671baf57808138de87a3b91805c1..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/Makefile.RootCore
+++ /dev/null
@@ -1,11 +0,0 @@
-PACKAGE          = ElectronPhotonSelectorTools
-PACKAGE_PRELOAD  = 
-PACKAGE_CXXFLAGS = 
-PACKAGE_LDFLAGS  = 
-PACKAGE_BINFLAGS = 
-PACKAGE_DEP      = AsgTools  xAODEgamma PATCore PathResolver xAODCaloEvent xAODTracking xAODHIEvent FourMomUtils
-PACKAGE_NOOPT    = 0
-PACKAGE_NOCC     = 0
-PACKAGE_PEDANTIC = 1
-PACKAGE_REFLEX   = 1
-include $(ROOTCOREDIR)/Makefile-common
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/requirements b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/requirements
deleted file mode 100644
index b36d4a41147645da86fa31c1e0e2813d3eef0570..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/cmt/requirements
+++ /dev/null
@@ -1,54 +0,0 @@
-package ElectronPhotonSelectorTools
-
-author Tulay Cuhadar Donszelmann <tcuhadar@cern.ch>
-author Jovan Mitrevski  <jovan.mitrevski@cern.ch>
-
-## For Athena policies: it has to be the first use statement
-
-use AtlasPolicy                 AtlasPolicy-*
-use AtlasPyROOT                 AtlasPyROOT-*           External
-use AtlasROOT                   AtlasROOT-*             External
-use PATCore                     PATCore-*               PhysicsAnalysis/AnalysisCommon
-
-use xAODCaloEvent               xAODCaloEvent-*         Event/xAOD
-use xAODTracking                xAODTracking-*          Event/xAOD
-use xAODEgamma                  xAODEgamma-*            Event/xAOD
-use AsgTools                    AsgTools-*              Control/AthToolSupport
-use xAODTracking                xAODTracking-*          Event/xAOD
-use xAODHIEvent                 xAODHIEvent-*           Event/xAOD
-
-private
-use CxxUtils                    CxxUtils-*              Control
-use xAODCore			xAODCore-*		Event/xAOD
-use  GaudiInterface             GaudiInterface-*        External
-use  xAODCaloEvent              xAODCaloEvent-*         Event/xAOD
-use  PathResolver               PathResolver-*          Tools
-use  FourMomUtils               FourMomUtils-*          Event 
-use CxxUtils                    CxxUtils-*              Control
-
-# in AtlasEvent, even if in PhysicsAnalysis directory   
-end_private
-
-## macros   
-apply_tag       ROOTBasicLibs
-apply_tag       ROOTMathLibs
-
-## declare the directories CMT should know about
-branches ElectronPhotonSelectorTools python src Root share data
-
-# Create a dual-use library
-apply_pattern dual_use_library files="*.cxx ../Root/*.cxx"
-
-## install our python modules
-apply_pattern declare_python_modules files="*.py"
-
-## install our job options files
-apply_pattern declare_joboptions files="*.py"
-
-## install the ROOT files (in the data/ directory)
-apply_pattern declare_calib files="../data/*.root ../data/*.conf"
-
-## For reflex dictionary generation
-use AtlasReflex   AtlasReflex-*   External -no_auto_imports
-apply_pattern lcgdict dict=ElectronPhotonSelectorTools selectionfile=selectionCore.xml headerfiles="..\/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsCoreDict.h"
-apply_pattern lcgdict dict=ElectronPhotonSelectorToolsPython selectionfile=selectionPython.xml headerfiles="..\/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ConfiguredAsgElectronLikelihoodTools.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ConfiguredAsgElectronLikelihoodTools.py
index f3eb1b25712020d87b8d25214c21653812b2e16f..480d090c3aedb012d9dae4b91cc2baed6a30cca0 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ConfiguredAsgElectronLikelihoodTools.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ConfiguredAsgElectronLikelihoodTools.py
@@ -20,7 +20,7 @@ import sys
 from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronLikelihoodTool
 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import ElectronLikelihoodMap, electronLHmenu
 
-def ConfiguredAsgElectronLikelihoodTool( name, quality, menu=electronLHmenu.offline2015, **kw ):
+def ConfiguredAsgElectronLikelihoodTool( name, quality, menu=electronLHmenu.offlineMC16, **kw ):
     """
     Configure the AsgElectronIsEMSelector with the quality cuts
     and allow for (re-)setting of all provided cuts.
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodMenuDefs.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodMenuDefs.py
index 6a933e66a72cff2dc5a6dc9ea300eb6d696fc8df..00900caa12fa28e62a2b17bb3ff0b2981c99132b 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodMenuDefs.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodMenuDefs.py
@@ -201,3 +201,43 @@ def ElectronLikelihoodTightOfflineConfig2015(theTool) :
     '''
     theTool = GetTool(theTool)
     theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf"
+
+
+
+def ElectronLikelihoodVeryLooseOfflineConfig2016(theTool) :
+    '''
+    This is for the custom implementation of the VeryLoose offline likelihood for MC16 / Run 2 / Release 21.
+    This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
+    '''
+    theTool = GetTool(theTool)
+    theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf"
+    
+    
+def ElectronLikelihoodLooseOfflineConfig2016(theTool) :
+    '''
+    This is for the custom implementation of the Loose offline likelihood for MC16 / Run 2 / Release 21.
+    This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
+    (NOTE: same signal eff as offline Loosepp + 1%)
+    '''
+    theTool = GetTool(theTool)
+    theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_Smooth.conf"
+
+    
+def ElectronLikelihoodMediumOfflineConfig2016(theTool) :
+    '''
+    This is for the custom implementation of the Medium offline likelihood for MC16 / Run 2 / Release 21.
+    This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
+    (NOTE: same signal eff as offline Mediumpp + 1%)
+    '''    
+    theTool = GetTool(theTool)
+    theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf"
+
+    
+def ElectronLikelihoodTightOfflineConfig2016(theTool) :
+    '''
+    This is for the custom implementation of the Tight offline likelihood for MC16 / Run 2 / Release 21.
+    This uses Offline PDFs, but does not yet have the pileup dependent discriminant cut.
+    (NOTE: same signal eff as offline Tightpp + 1%)
+    '''
+    theTool = GetTool(theTool)
+    theTool.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodToolMapping.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodToolMapping.py
index e2567154a6bfe3d9c4f359d4aefec79286822fd8..f436a1038ed12b3b3cd4dbf9ec38b95bfcea9c8d 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodToolMapping.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ElectronLikelihoodToolMapping.py
@@ -22,6 +22,7 @@ class electronLHmenu:
     trigger2012 = 1
     trigger2015 = 2
     offline2015 = 3
+    offlineMC16 = 4
 
 import ElectronPhotonSelectorTools.ElectronLikelihoodMenuDefs as ElectronLikelihoodMenuDefs
 
@@ -47,6 +48,13 @@ ElectronLHMapOffline2015 = {
     LikeEnum.Tight: ( LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfig2015 ),
     }
 
+ElectronLHMapOffline2016 = {
+    LikeEnum.VeryLoose: ( LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfig2016 ),
+    LikeEnum.Loose: ( LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfig2016 ),
+    LikeEnum.Medium: ( LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfig2016 ),
+    LikeEnum.Tight: ( LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfig2016 ),
+    }
+
 def ElectronLikelihoodMap(quality, menu):
     if menu == electronLHmenu.customMenu:
         return ElectronLHMapCustom[quality]
@@ -56,5 +64,7 @@ def ElectronLikelihoodMap(quality, menu):
         return ElectronLHMapTrigger2015[quality]
     elif menu == electronLHmenu.offline2015:
         return ElectronLHMapOffline2015[quality]
+    elif menu == electronLHmenu.offlineMC16:
+        return ElectronLHMapOffline2016[quality]
     else:
         raise ValueError("Requested menu is undefined: %d" % menu)
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
index 449cc50272a19570db5df3a8ff637ca0be3a6fdf..fe410ad6dec03d5f34af814e06a8f064f961fad2 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
@@ -1,11 +1,12 @@
 #include "GaudiKernel/DeclareFactoryEntries.h"
-
 #include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
+#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
+#include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
 
 DECLARE_TOOL_FACTORY( AsgElectronIsEMSelector )
 DECLARE_TOOL_FACTORY( AsgElectronMultiLeptonSelector )
@@ -13,7 +14,8 @@ DECLARE_TOOL_FACTORY( AsgElectronLikelihoodTool )
 DECLARE_TOOL_FACTORY( AsgPhotonIsEMSelector )
 DECLARE_TOOL_FACTORY( AsgForwardElectronIsEMSelector )
 DECLARE_TOOL_FACTORY( EGammaAmbiguityTool )
-
+DECLARE_TOOL_FACTORY( AsgElectronChargeIDSelectorTool )
+DECLARE_TOOL_FACTORY( AsgDeadHVCellRemovalTool )
 DECLARE_FACTORY_ENTRIES( ElectronPhotonSelectorTools ) 
 {
   DECLARE_ALGTOOL( AsgElectronIsEMSelector )
@@ -22,6 +24,7 @@ DECLARE_FACTORY_ENTRIES( ElectronPhotonSelectorTools )
   DECLARE_ALGTOOL( AsgPhotonIsEMSelector )
   DECLARE_ALGTOOL( AsgForwardElectronIsEMSelector )
   DECLARE_ALGTOOL( EGammaAmbiguityTool )
+  DECLARE_ALGTOOL( AsgDeadHVCellRemovalTool )
 }
 
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/EGIdentification_mem_check.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/EGIdentification_mem_check.cxx
index 577f2f4d55e72f5eca478df3191324d41a664dc7..44cd4cd017577e52bdfb48f10c049dcacb7d52c6 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/EGIdentification_mem_check.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/EGIdentification_mem_check.cxx
@@ -11,28 +11,20 @@ http://valgrind.org/docs/manual/faq.html#faq.deflost
 
 */
 
-#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h"
-
-#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
-#include "CxxUtils/make_unique.h"
-
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "AsgTools/AnaToolHandle.h"
+#include "AsgTools/MessageCheck.h"
 
 int main(){
+  using namespace asg::msgUserCode;
+  ANA_CHECK_SET_TYPE (int);
 
-  /*std::unique_ptr<AsgElectronIsEMSelector> electronMediumIsEMSelector = CxxUtils::make_unique<AsgElectronIsEMSelector> ("electronMediumIsEMSelector");
-    electronMediumIsEMSelector->setProperty("WorkingPoint", "MediumElectron");
-    electronMediumIsEMSelector->initialize();
-  */
-
-  std::unique_ptr<AsgElectronLikelihoodTool> MediumLH = CxxUtils::make_unique<AsgElectronLikelihoodTool> ("MediumLH");
-  MediumLH->setProperty("WorkingPoint", "MediumLHElectron");
-  MediumLH->initialize();
+  asg::AnaToolHandle<IAsgElectronLikelihoodTool> MediumLH("AsgElectronLikelihoodTool/MediumLH");
+  ANA_CHECK(MediumLH.setProperty("WorkingPoint", "MediumLHElectron"));
+  ANA_CHECK(MediumLH.initialize());
 
   return 0;
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEMAmbiguityResolver.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGChargeIDSelector.cxx
similarity index 50%
rename from PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEMAmbiguityResolver.cxx
rename to PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGChargeIDSelector.cxx
index 256cde57f9158ad5f27d3057bb2c8bdeb85dbd5c..e68f06dbc52d2da0fc688dbc095eb89f0de2b494 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEMAmbiguityResolver.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGChargeIDSelector.cxx
@@ -16,11 +16,21 @@
 #include "xAODEgamma/PhotonContainer.h" 
 #include "xAODEgamma/Electron.h" 
 #include "xAODEgamma/Photon.h" 
-#include "xAODEgamma/Egamma.h"
-#include "xAODEgamma/EgammaTruthxAODHelpers.h"
-#include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
+
+#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
+#include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
+#include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
+#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
+#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
+#include "CxxUtils/make_unique.h"
 #include "AsgTools/AsgMessaging.h"
 
+// Derivation include
+#include "xAODCore/tools/IOStats.h"
+#include "xAODCore/tools/ReadStats.h"
+
+
+
 // Infrastructure include(s):
 #ifdef ROOTCORE
 #   include "xAODRootAccess/Init.h"
@@ -48,8 +58,6 @@ namespace{
       return EXIT_FAILURE;                                              \
     }                                                                   \
   } while( false )
-
-
 //---------------------------------------------------
 
 //main test code
@@ -77,8 +85,23 @@ int main( int argc, char* argv[] ) {
    std::unique_ptr< TFile > ifile( TFile::Open( fileName, "READ" ) );
    CHECK( ifile.get() );
  
+  // Check if we want to process Electron or Photon
+   bool isElectron = true;   
+   if( argc < 4 ) {
+     Info (APP_NAME, "By default looking to Electron" );
+   } else {  
+    int  argv1 = atoi(argv[ 3 ]);
+    if(argv1 == 0)   isElectron = false; 
+    if(isElectron)  Info( APP_NAME, "We are lookign to Electron-ID: %i", isElectron );
+    else  Info( APP_NAME, "We are looking to Photon-ID" );
+   }
    // Create a TEvent object (persistent store)
-   xAOD::TEvent pers( xAOD::TEvent::kClassAccess );
+
+   //For 2.4.5 testing
+   xAOD::TEvent pers( xAOD::TEvent::kAthenaAccess );
+   //For 2.3
+   //xAOD::TEvent pers( xAOD::TEvent::kBranchAccess );
+
    // Create a TStore object (transient store)
    xAOD::TStore trans;
    CHECK( pers.readFrom( ifile.get() ) );
@@ -94,11 +117,22 @@ int main( int argc, char* argv[] ) {
       }
    }
 
-   //Initialise Ambiguity Tool
-   EGammaAmbiguityTool myAmbiguity("myEGammaAmbiguityTool");
-   myAmbiguity.msg().setLevel(mylevel);
-   CHECK(myAmbiguity.initialize());
 
+   if (isElectron) {
+   //tight ECIDS
+   std::unique_ptr<AsgElectronChargeIDSelectorTool> m_electronECIDS = CxxUtils::make_unique<AsgElectronChargeIDSelectorTool> ("tightECIDS");
+   std::string trainingfile    = std::string(std::getenv("ROOTCOREBIN")) + "/data/ElectronPhotonSelectorTools/ECIDS_20161125for2017Moriond.root";
+   CHECK(m_electronECIDS->setProperty("TrainingFile", trainingfile));
+   CHECK(m_electronECIDS->setProperty("CutOnBDT", 0));
+   m_electronECIDS->msg().setLevel(mylevel);
+   CHECK(m_electronECIDS->initialize());
+   
+   //Tight Likelihood electron
+   std::unique_ptr<AsgElectronLikelihoodTool> m_TightLH = CxxUtils::make_unique<AsgElectronLikelihoodTool> ("TightLH");
+   CHECK(m_TightLH->setProperty("WorkingPoint", "TightLHElectron"));
+   m_TightLH->msg().setLevel(mylevel);
+   CHECK(m_TightLH->initialize());
+   
    // Loop over the events:
    for( Long64_t entry = 0; entry < entries; ++entry ) {
      
@@ -110,46 +144,52 @@ int main( int argc, char* argv[] ) {
      const xAOD::ElectronContainer* electrons;
      CHECK(pers.retrieve(electrons, "Electrons"));
 
-     const xAOD::PhotonContainer* photons;
-     CHECK(pers.retrieve(photons, "Photons"));
-
      unsigned int counter=0;
      for (const xAOD::Electron* el : *electrons) {
        MSG_INFO("---------------------------");
        MSG_INFO("Electron: " << counter);
-       MSG_INFO("Initial Author: " << el->author());
-       MSG_INFO("Ambiguity accept result: " << myAmbiguity.accept(*el));
-       static const  SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");    
-       MSG_INFO("Ambiguity Type: " << static_cast<int> (acc(*el)));
-
-       static const SG::AuxElement::Accessor<ElementLink<xAOD::EgammaContainer> > ELink ("ambiguityLink");
-       if(ELink(*el).isValid()){
-	 const xAOD::Photon* overlapPhoton = static_cast<const xAOD::Photon*> (*ELink(*el));
-	 MSG_INFO("Overlap photon pt: " << overlapPhoton->pt());
-       }
+       MSG_INFO("Electron LH Tight accept result: " <<m_TightLH->accept(*el));
+       //       MSG_INFO("Electron stored LH Tight: "  << el->passSelection("LHTight") );
+       MSG_INFO("Electron Cut ECIDS accept result: " <<m_electronECIDS->accept(*el));
+       MSG_INFO("Electron stored Tight: "  << el->passSelection("Tight") );
        ++counter;
      }
-
-     counter=0;
-     for (const xAOD::Photon* ph : *photons) {
-       if(ph->author() != xAOD::EgammaParameters::AuthorCaloTopo35){
-	 MSG_INFO("---------------------------");
-	 MSG_INFO("Photon: " << counter);
-	 MSG_INFO("Initial Author: " << ph->author());
-	 MSG_INFO("Ambiguity accept result: " << myAmbiguity.accept(*ph));
-	 static const  SG::AuxElement::Accessor<uint8_t> acc("ambiguityType");    
-	 MSG_INFO("Ambiguity Type: " << static_cast<int> (acc(*ph)));
-	 
-	 static const SG::AuxElement::Accessor<ElementLink<xAOD::EgammaContainer> > ELink ("ambiguityLink");
-	 if(ELink(*ph).isValid()){
-	   const xAOD::Electron* overlapElectron = static_cast< const xAOD::Electron*> (*ELink(*ph));
-	   MSG_INFO("Overlap Electron pt: " << overlapElectron->pt());
-	 }
+   } // loop entries
+   
+   } // is electron
+   else {
+     //Tight cut based photon
+     std::unique_ptr<AsgPhotonIsEMSelector> m_photonTightIsEMSelector = CxxUtils::make_unique<AsgPhotonIsEMSelector> ("photonTightIsEMSelector");
+     CHECK(m_photonTightIsEMSelector->setProperty("WorkingPoint", "TightPhoton"));
+     m_photonTightIsEMSelector->msg().setLevel(mylevel);
+     CHECK(m_photonTightIsEMSelector->initialize());
      
-	 ++counter;       
+     // Loop over the events:
+     for( Long64_t entry = 0; entry < entries; ++entry ) {
+       
+       // Tell the object which entry to look at:
+       pers.getEntry( entry );
+       MSG_INFO("============================");
+       MSG_INFO("Event: " <<entry);
+       
+       const xAOD::PhotonContainer* photons;
+       CHECK(pers.retrieve(photons, "Photons"));
+       unsigned int counter=0;
+       for (const xAOD::Photon* ph : *photons) {
+	 if(ph->author() != xAOD::EgammaParameters::AuthorCaloTopo35){
+	   MSG_INFO("---------------------------");
+	   MSG_INFO("Photon: " << counter);
+	   MSG_INFO("Photon Tight accept result: " <<m_photonTightIsEMSelector->accept(*ph));
+	   ++counter;       
+	 }
        }
-     }
+     }// loop entries
    }
-   CHECK(myAmbiguity.finalize());
+
+
+   xAOD::IOStats::instance().stats().printSmartSlimmingBranchList();
    return 0;
 }
+
+
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGIdentificationPoints.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGIdentificationPoints.cxx
index 7dac45252bac8e8901f7fbb106e32de9e7035119..e6d1981496f8971aada21a4610507bc3c92d6827 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGIdentificationPoints.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/testEGIdentificationPoints.cxx
@@ -16,20 +16,20 @@
 #include "xAODEgamma/PhotonContainer.h" 
 #include "xAODEgamma/Electron.h" 
 #include "xAODEgamma/Photon.h" 
-
-#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
-#include "CxxUtils/make_unique.h"
-#include "AsgTools/AsgMessaging.h"
-
+#include "AsgTools/AnaToolHandle.h"
+
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
+//
+#include "AsgTools/MessageCheck.h"
+#include "AsgTools/MsgStream.h"
 // Derivation include
 #include "xAODCore/tools/IOStats.h"
 #include "xAODCore/tools/ReadStats.h"
 
-
-
 // Infrastructure include(s):
 #ifdef ROOTCORE
 #   include "xAODRootAccess/Init.h"
@@ -37,75 +37,59 @@
 #   include "xAODRootAccess/TStore.h"
 #endif // ROOTCORE
 
-//Define msg functionality using AsgMessaging
-//---------------------------------------------------
-namespace{  
-  asg::AsgMessaging dummymsg("");
+namespace asg{
+  ANA_MSG_HEADER (msgSelectorCheck)
+  ANA_MSG_SOURCE (msgSelectorCheck, "EgammaSelectorCheck") 
 }
-#define DUMMY_MSG( lvl, ARG ) {dummymsg.msg(lvl)<<ARG<<endmsg ;}
-#define MSG_DEBUG( ARG ) {DUMMY_MSG(MSG::DEBUG, ARG);}
-#define MSG_INFO( ARG ) {DUMMY_MSG(MSG::INFO, ARG);}
-#define MSG_WARNING( ARG ) {DUMMY_MSG(MSG::WARNING, ARG);}
-#define MSG_ERROR( ARG ) {DUMMY_MSG(MSG::ERROR, ARG);}
-#define MSG_FATAL( ARG ) {DUMMY_MSG(MSG::FATAL, ARG);}
-#define MSG_ABORT( ARG ) {DUMMY_MSG(MSG::FATAL, ARG); std::abort();} 
-#define CHECK( ARG )                                                    \
-  do {                                                                  \
-    const bool result = ARG;                                            \
-    if( ! result ) {                                                    \
-      MSG_ERROR("FAILED  to execute" <<#ARG);                           \
-      return EXIT_FAILURE;                                              \
-    }                                                                   \
-  } while( false )
-//---------------------------------------------------
 
 //main test code
 int main( int argc, char* argv[] ) {
 
-   // The application's name:
-   const char* APP_NAME = argv[ 0 ];
+  //
+  using namespace asg::msgSelectorCheck;
+  ANA_CHECK_SET_TYPE (int);
+  MSG::Level mylevel=MSG::INFO;
+  setMsgLevel(mylevel);
+  //
+
+  // The application's name:
+  const char* APP_NAME = argv[ 0 ];
 
-   MSG::Level mylevel=MSG::DEBUG;
-   dummymsg.msg().setLevel(mylevel);
-   dummymsg.msg().setName(APP_NAME);
    // Check if we received a file name:
    if( argc < 2 ) {
-     MSG_ERROR("No file name received!" );
-     MSG_ERROR( "  Usage: %s [xAOD file name]");
+     ANA_MSG_ERROR("No file name received!" );
+     ANA_MSG_ERROR( "  Usage: %s [xAOD file name]");
      return EXIT_FAILURE;
    }
    
    // Initialise the application:
-   CHECK( xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Open the input file:
    const TString fileName = argv[ 1 ];
    Info( APP_NAME, "Opening file: %s", fileName.Data() );
    std::unique_ptr< TFile > ifile( TFile::Open( fileName, "READ" ) );
-   CHECK( ifile.get() );
+   ANA_CHECK( ifile.get() );
  
   // Check if we want to process Electron or Photon
    bool isElectron = true;   
    if( argc < 4 ) {
-     Info (APP_NAME, "By default lookign to Electron" );
+     Info (APP_NAME, "By default looking to Electron" );
    } else {  
     int  argv1 = atoi(argv[ 3 ]);
     if(argv1 == 0)   isElectron = false; 
-    if(isElectron)  Info( APP_NAME, "We are lookign to Electron-ID: %i", isElectron );
-    else  Info( APP_NAME, "We are lookign to Photon-ID" );
+    if(isElectron)  Info( APP_NAME, "We are looking to Electron-ID: %i", isElectron );
+    else  Info( APP_NAME, "We are looking to Photon-ID" );
    }
    // Create a TEvent object (persistent store)
 
-   //For 2.4.5 testing
-   xAOD::TEvent pers( xAOD::TEvent::kAthenaAccess );
-   //For 2.3
-   //xAOD::TEvent pers( xAOD::TEvent::kBranchAccess );
+   xAOD::TEvent pers( xAOD::TEvent::kClassAccess );
 
    // Create a TStore object (transient store)
    xAOD::TStore trans;
-   CHECK( pers.readFrom( ifile.get() ) );
+   ANA_CHECK( pers.readFrom( ifile.get() ) );
    //
-   MSG_INFO("Number of events in the file: "<< pers.getEntries());
+   ANA_MSG_INFO("Number of events in the file: "<< pers.getEntries());
 
    // Decide how many events to run over:
    Long64_t entries = pers.getEntries();
@@ -119,71 +103,100 @@ int main( int argc, char* argv[] ) {
 
    if (isElectron) {
    //Medium cut based Electrons
-   std::unique_ptr<AsgElectronIsEMSelector> m_electronMediumIsEMSelector = CxxUtils::make_unique<AsgElectronIsEMSelector> ("electronMediumIsEMSelector");
-   CHECK(m_electronMediumIsEMSelector->setProperty("WorkingPoint", "MediumElectron"));
-   m_electronMediumIsEMSelector->msg().setLevel(mylevel);
-   CHECK(m_electronMediumIsEMSelector->initialize());
-   
-   //Medium Likelihood electron
-   std::unique_ptr<AsgElectronLikelihoodTool> m_MediumLH = CxxUtils::make_unique<AsgElectronLikelihoodTool> ("MediumLH");
-   CHECK(m_MediumLH->setProperty("WorkingPoint", "MediumLHElectron"));
-   m_MediumLH->msg().setLevel(mylevel);
-   CHECK(m_MediumLH->initialize());
-   
-   // Loop over the events:
-   for( Long64_t entry = 0; entry < entries; ++entry ) {
+
+     asg::AnaToolHandle<IAsgElectronIsEMSelector> electronMediumIsEMSelector ("AsgElectronIsEMSelector/electronMediumIsEMSelector");
+     ANA_CHECK(electronMediumIsEMSelector.setProperty("WorkingPoint", "MediumElectron"));
+     ANA_CHECK(electronMediumIsEMSelector.setProperty("OutputLevel", mylevel));
+     ANA_CHECK(electronMediumIsEMSelector.initialize());
+
+     asg::AnaToolHandle<IAsgElectronLikelihoodTool> electronMediumLHSelector ("AsgElectronLikelihoodTool/electronMediumLHSelector");
+     ANA_CHECK(electronMediumLHSelector.setProperty("WorkingPoint", "MediumLHElectron"));
+     ANA_CHECK(electronMediumLHSelector.setProperty("OutputLevel", mylevel));
+     ANA_CHECK(electronMediumLHSelector.initialize());
      
+     
+   // Loop over the events:
+     for( Long64_t entry = 0; entry < entries; ++entry ) {
+       
      // Tell the object which entry to look at:
-     pers.getEntry( entry );
-     MSG_INFO("============================");
-     MSG_INFO("Event: " <<entry);
-
-     const xAOD::ElectronContainer* electrons;
-     CHECK(pers.retrieve(electrons, "Electrons"));
-
-     unsigned int counter=0;
-     for (const xAOD::Electron* el : *electrons) {
-       MSG_INFO("---------------------------");
-       MSG_INFO("Electron: " << counter);
-       MSG_INFO("Electron LH Medium accept result: " <<m_MediumLH->accept(*el));
-       MSG_INFO("Electron stored LH Medium: "  << el->passSelection("LHMedium") );
-       MSG_INFO("Electron Cut Medium accept result: " <<m_electronMediumIsEMSelector->accept(*el));
-       MSG_INFO("Electron stored Medium: "  << el->passSelection("Medium") );
-       ++counter;
-     }
-   } // loop entries
+       pers.getEntry( entry );
+       ANA_MSG_INFO("============================");
+       ANA_MSG_INFO("Event: " <<entry);
+
+       const xAOD::ElectronContainer* electrons;
+       ANA_CHECK(pers.retrieve(electrons, "Electrons"));
+       
+       unsigned int counter=0;
+       for (const xAOD::Electron* el : *electrons) {
+       ANA_MSG_INFO("---------------------------");
+       ANA_MSG_INFO("Electron: " << counter);
+       ANA_MSG_INFO("Electron LH Medium accept result: " <<electronMediumLHSelector->accept(*el));
+       ANA_MSG_INFO("Electron Cut based");
+       ANA_MSG_INFO("Electron Cut Medium accept result: " <<electronMediumIsEMSelector->accept(*el));
    
-   } // is electron
+       //Bitset manipulation 
+       ANA_MSG_INFO("Decision as a bitset: ");
+       std::bitset<32> decision = electronMediumIsEMSelector->accept(*el).getCutResultBitSet();
+       ANA_MSG_INFO("Result bitset: " <<decision);
+       std::bitset<32> isEMdecision = electronMediumIsEMSelector->accept(*el).getCutResultInvertedBitSet() ;
+       ANA_MSG_INFO("isEM Result bitset: " << isEMdecision);
+       //
+       ANA_MSG_INFO("Masks: " );
+       std::bitset<32> MediumMask(egammaPID::ElectronMediumPP);
+       ANA_MSG_INFO("Medium mask: " << MediumMask);
+
+       std::bitset<32> HadLeakageOnlyMask( 0x1 << egammaPID::ClusterHadronicLeakage_Electron);
+       ANA_MSG_INFO("HadLeakageOnly mask: " << HadLeakageOnlyMask);
+       //
+       std::bitset<32> MediumWithouHadLeakageMask( egammaPID::ElectronMediumPP ^ (0x1 << egammaPID::ClusterHadronicLeakage_Electron));
+       ANA_MSG_INFO("Medium Without Had Leakage  mask: " << MediumWithouHadLeakageMask);
+       //
+
+       bool passALLDecisionisem= (isEMdecision&MediumMask)==0;
+       std::bitset<32> passALLDecisionisemBitSet(isEMdecision&MediumMask);
+       ANA_MSG_INFO("Electron check all cuts via  isem: "<< passALLDecisionisem << " ,bitset " << passALLDecisionisemBitSet);
+
+       bool checkOnlyHadLeakageisem= (isEMdecision&HadLeakageOnlyMask)==0;
+       std::bitset<32> checkOnlyHadLeakageisemBitSet(isEMdecision&HadLeakageOnlyMask);
+       ANA_MSG_INFO("Electron check Only Had Leakage via isem:: "<< checkOnlyHadLeakageisem << " ,bitset " << checkOnlyHadLeakageisemBitSet);
+
+       bool ignoreHadLeakageisem= (isEMdecision&MediumWithouHadLeakageMask)==0;
+       std::bitset<32> ignoreHadLeakageisemBitSet(isEMdecision&MediumWithouHadLeakageMask);
+       ANA_MSG_INFO("Electron ignore Had Leakage check all else via isem:: "<< ignoreHadLeakageisem << " ,bitset " << ignoreHadLeakageisemBitSet);
+
+       ++counter;
+
+
+       }
+     } // loop entries
+   }// is electron
    else {
      //Tight cut based photon
-     std::unique_ptr<AsgPhotonIsEMSelector> m_photonTightIsEMSelector = CxxUtils::make_unique<AsgPhotonIsEMSelector> ("photonTightIsEMSelector");
-     CHECK(m_photonTightIsEMSelector->setProperty("WorkingPoint", "TightPhoton"));
-     m_photonTightIsEMSelector->msg().setLevel(mylevel);
-     CHECK(m_photonTightIsEMSelector->initialize());
      
+     asg::AnaToolHandle<IAsgPhotonIsEMSelector> photonTightIsEMSelector ("AsgPhotonIsEMSelector/photonTightIsEMSelector");
+     ANA_CHECK(photonTightIsEMSelector.setProperty("WorkingPoint", "TightPhoton"));
+     ANA_CHECK(photonTightIsEMSelector.setProperty("OutputLevel", mylevel));
+     ANA_CHECK(photonTightIsEMSelector.initialize());
      // Loop over the events:
      for( Long64_t entry = 0; entry < entries; ++entry ) {
        
        // Tell the object which entry to look at:
        pers.getEntry( entry );
-       MSG_INFO("============================");
-       MSG_INFO("Event: " <<entry);
+       ANA_MSG_INFO("============================");
+       ANA_MSG_INFO("Event: " <<entry);
        
        const xAOD::PhotonContainer* photons;
-       CHECK(pers.retrieve(photons, "Photons"));
+       ANA_CHECK(pers.retrieve(photons, "Photons"));
        unsigned int counter=0;
        for (const xAOD::Photon* ph : *photons) {
-	 if(ph->author() != xAOD::EgammaParameters::AuthorCaloTopo35){
-	   MSG_INFO("---------------------------");
-	   MSG_INFO("Photon: " << counter);
-	   MSG_INFO("Photon Tight accept result: " <<m_photonTightIsEMSelector->accept(*ph));
-	   ++counter;       
-	 }
+	 ANA_MSG_INFO("---------------------------");
+	 ANA_MSG_INFO("Photon: " << counter);
+	 ANA_MSG_INFO("Photon Tight accept result: " <<photonTightIsEMSelector->accept(*ph));
+	 ++counter;       
        }
      }// loop entries
    }
-
-
+    
    xAOD::IOStats::instance().stats().printSmartSlimmingBranchList();
    return 0;
 }
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/CMakeLists.txt
index dcc8e70868f62e795029a26eac8ca5435b6f26a6..ee351766c54982aa992b95e109e51a3add70862d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/CMakeLists.txt
@@ -5,36 +5,45 @@
 # Declare the package name:
 atlas_subdir( ElectronPhotonShowerShapeFudgeTool )
 
+# Extra dependencies based on the environment:
+set( extra_dep )
+if( NOT XAOD_STANDALONE )
+   set( extra_dep GaudiKernel )
+endif()
+
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthToolSupport/AsgTools
-                          Event/xAOD/xAODEgamma
-                          PhysicsAnalysis/AnalysisCommon/PATInterfaces
-                          PRIVATE
-                          GaudiKernel
-                          Tools/PathResolver )
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces
+   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces	
+   PRIVATE
+   Tools/PathResolver
+   ${extra_dep} )
 
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint PyROOT )
-
-# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake
+find_package( ROOT COMPONENTS Core MathCore Hist RIO Gui Gpad )
 
 # Component(s) in the package:
 atlas_add_library( ElectronPhotonShowerShapeFudgeToolLib
-                   Root/*.cxx
-                   PUBLIC_HEADERS ElectronPhotonShowerShapeFudgeTool
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces
-                   PRIVATE_LINK_LIBRARIES GaudiKernel PathResolver )
-
-atlas_add_component( ElectronPhotonShowerShapeFudgeTool
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces GaudiKernel PathResolver ElectronPhotonShowerShapeFudgeToolLib )
+   ElectronPhotonShowerShapeFudgeTool/*.h
+   ElectronPhotonShowerShapeFudgeTool/*.icc Root/*.cxx
+   PUBLIC_HEADERS ElectronPhotonShowerShapeFudgeTool
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces EgammaAnalysisInterfacesLib
+   PRIVATE_LINK_LIBRARIES PathResolver )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( ElectronPhotonShowerShapeFudgeTool
+      src/components/*.cxx
+      LINK_LIBRARIES GaudiKernel ElectronPhotonShowerShapeFudgeToolLib )
+endif()
 
 atlas_add_dictionary( ElectronPhotonShowerShapeFudgeToolDict
-                      ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeToolDict.h
-                      ElectronPhotonShowerShapeFudgeTool/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces GaudiKernel PathResolver ElectronPhotonShowerShapeFudgeToolLib )
+   ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeToolDict.h
+   ElectronPhotonShowerShapeFudgeTool/selection.xml
+   LINK_LIBRARIES ElectronPhotonShowerShapeFudgeToolLib )
 
+# Install files from the package:
+atlas_install_data( data/*.conf data/*.root )
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
index 8d035e9a0f39bb58bbe2b9e8982beb9330594dfe..dff0f49aaa8cf0dd80742b5d378c9780e6381546 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h
@@ -18,7 +18,7 @@
 #include "AsgTools/AsgTool.h"
 #include "ElectronPhotonShowerShapeFudgeTool/FudgeMCTool.h"
 #include "ElectronPhotonShowerShapeFudgeTool/TElectronMCShifterTool.h"
-#include "ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h"
+#include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h"
 #include "TEnv.h"
 
 class ElectronPhotonShowerShapeFudgeTool : public asg::AsgTool, virtual public  IElectronPhotonShowerShapeFudgeTool
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h
index 19c4b8508d8aa6cd89f6f7c2aeed05c5ee0c0f9a..cd1f465e1757f9c1ba077b6d0d2e3e30be8100e1 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h
@@ -5,45 +5,7 @@
 #ifndef _IELECTRONPHOTONSHOWERSHAPEFUDGETOOL_H
 #define _IELECTRONPHOTONSHOWERSHAPEFUDGETOOL_H
 
-/**
-   @class AsgFudgeMCTool
-   @brief Tool to fudge photon MC shower shapes.
-
-   @author Rob Roy Fletcher (University of Pennsylvania) rob.fletcher@cern.ch
-   @date   August 2014
-
-
-*/
-
-// Framework include(s):
-#include "AsgTools/IAsgTool.h"
-
-// EDM include(s):
-#include "xAODEgamma/EgammaFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
-#include "xAODEgamma/ElectronFwd.h"
-
-// Local include(s):
-#include "PATInterfaces/CorrectionCode.h"
-
-
-class IElectronPhotonShowerShapeFudgeTool : public virtual asg::IAsgTool {
-
-   /// Declare the interface that the class provides
-   ASG_TOOL_INTERFACE(IElectronPhotonShowerShapeFudgeTool)
-
-public:
-   /// Apply the correction on a modifyable object
-   virtual const CP::CorrectionCode applyCorrection(xAOD::Photon& ph ) const = 0;
-
-   virtual const CP::CorrectionCode applyCorrection(xAOD::Electron& el ) const = 0;
-
-   virtual const CP::CorrectionCode correctedCopy( const xAOD::Photon& ph, xAOD::Photon*& output ) const = 0;
-
-   virtual const CP::CorrectionCode correctedCopy( const xAOD::Electron& el, xAOD::Electron*& output ) const = 0;
-
-
-
-}; // class IElectronPhotonShowerShapeFudgeTool
+#include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
 
 #endif // _IASGFUDGEMCTOOL_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/CMakeLists.txt
index a1c506829fb5dfad60136abc3f693c6e54d074a3..45de2117c98ee5f0b39ea67e0e76b4e7a7d86022 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/CMakeLists.txt
@@ -1,7 +1,7 @@
 ################################################################################
 # Package: ElectronPhotonTagTools
 ################################################################################
- 
+
 # Declare the package name:
 atlas_subdir( ElectronPhotonTagTools )
 
@@ -15,10 +15,11 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODMissingET
                           GaudiKernel
+			  PhysicsAnalysis/ElectronPhotonID/IsolationCorrections
                           PhysicsAnalysis/AnalysisCommon/IsolationSelection
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection
                           PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
                           PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool
+			  PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection
                           PhysicsAnalysis/EventTag/TagEvent
                           PRIVATE
                           Event/xAOD/xAODCore
@@ -34,7 +35,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_library( ElectronPhotonTagToolsLib
                    src/*.cxx
                    PUBLIC_HEADERS ElectronPhotonTagTools
-                   LINK_LIBRARIES AthenaBaseComps AthenaPoolUtilities EventInfo xAODEgamma xAODEventInfo xAODMissingET GaudiKernel TagEvent StoreGateLib SGtests IsolationSelectionLib ElectronPhotonFourMomentumCorrectionLib ElectronPhotonSelectorToolsLib ElectronPhotonShowerShapeFudgeToolLib AnalysisUtilsLib
+                   LINK_LIBRARIES AthenaBaseComps AthenaPoolUtilities EventInfo xAODEgamma xAODEventInfo xAODMissingET GaudiKernel TagEvent StoreGateLib SGtests IsolationSelectionLib ElectronPhotonSelectorToolsLib ElectronPhotonShowerShapeFudgeToolLib AnalysisUtilsLib
                    PRIVATE_LINK_LIBRARIES xAODCore xAODParticleEvent xAODTracking )
 
 atlas_add_component( ElectronPhotonTagTools
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/ElectronTagTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/ElectronTagTool.h
index 0ccdf127b97f5f40a9d9e9fce1b85454c0a3375d..b526ff8099e7cf0041b6af48d9ed7df385ba1d1f 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/ElectronTagTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/ElectronTagTool.h
@@ -2,7 +2,6 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #ifndef ELECTRONTAGTOOL_H 
 #define ELECTRONTAGTOOL_H 
 
@@ -23,6 +22,7 @@ Purpose : build the Electron Tag objects - ElectronTagCollection.h.
 #include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
 #include "ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h"
 #include "IsolationSelection/IIsolationSelectionTool.h"
+#include "IsolationCorrections/IIsolationCorrectionTool.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
 
@@ -30,10 +30,6 @@ Purpose : build the Electron Tag objects - ElectronTagCollection.h.
 
 class ElectronTagCollection;
 
-namespace CP {
-  class IIsolationSelectionTool;
-}
-
 /** Interface ID for ElectronTagTool*/  
 static const InterfaceID IID_ElectronTagTool("ElectronTagTool", 1, 0);
 
@@ -56,16 +52,20 @@ public:
 
 protected:
 
-   /** Standard destructor */
-   virtual ~ElectronTagTool( );
+  /** Standard destructor */
+  virtual ~ElectronTagTool( );
 
 private:
 
+  /** private function to get impact parameter */
+  void getElectronImpactParameter (const xAOD::Electron*,double& d0_significance, double& z0_sintheta);
+
   /** Properties */
   std::vector<std::string> m_containerNames;
-  double m_cut_Et;
-  std::vector<float> m_etconeisocutvalues;
-  std::vector<float> m_ptconeisocutvalues;
+  double                   m_cut_Et;
+  std::string              m_electron_met_container_name;
+  std::vector<float>       m_etconeisocutvalues;
+  std::vector<float>       m_ptconeisocutvalues;
 
   /** the attribute names */
   std::vector<std::string> m_ptStr;
@@ -86,15 +86,24 @@ private:
   ToolHandle<IAsgElectronLikelihoodTool> m_medium_likelihood;
   ToolHandle<IAsgElectronLikelihoodTool> m_tight_likelihood;
 
+  /** isolation correction tool */
+  ToolHandle<CP::IIsolationCorrectionTool> m_isolation_correction_tool; 
+
   /** electron isolation tool */
   ToolHandle<CP::IIsolationSelectionTool> m_loose_trackonly_isolation;
   ToolHandle<CP::IIsolationSelectionTool> m_loose_isolation;
   ToolHandle<CP::IIsolationSelectionTool> m_tight_isolation;
   ToolHandle<CP::IIsolationSelectionTool> m_gradient_loose_isolation;
   ToolHandle<CP::IIsolationSelectionTool> m_gradient_isolation;
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_tight_trackonly_isolation;
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_loose_isolation;
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_tight_isolation;
+
+  /** PV StoreGate key */
+  std::string m_vxCandidate;
 
   /** calib tool */
-  ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_EgammaCalibrationAndSmearingTool;
+  // ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_EgammaCalibrationAndSmearingTool;
   
 };
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/PhotonTagTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/PhotonTagTool.h
index 56686569e2d7867a3295f7530a89d55673ac310c..12e7a541840ed810432b47449122d047c88bb025 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/PhotonTagTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/ElectronPhotonTagTools/PhotonTagTool.h
@@ -18,18 +18,15 @@ Purpose : build the Photon Tag objects - PhotonTagCollection.h.
 #include "TagEvent/TagFragmentCollection.h"
 #include "AthenaPoolUtilities/AthenaAttributeSpecification.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
+#include "ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h"
 #include "IsolationSelection/IIsolationSelectionTool.h"
 #include "IsolationSelection/IsolationSelectionTool.h"
+#include "IsolationCorrections/IIsolationCorrectionTool.h"
 #include "ElectronPhotonShowerShapeFudgeTool/IElectronPhotonShowerShapeFudgeTool.h"
 #include "ElectronPhotonFourMomentumCorrection/IEgammaCalibrationAndSmearingTool.h"
 #include <map>
 
 class PhotonTagCollection;
-
-// forward declarations
-namespace CP {
-  class IIsolationSelectionTool;
-}
 class IAsgPhotonIsEMSelector;
 
 
@@ -62,6 +59,7 @@ private:
   /** Properties */
   std::string m_containerName;
   double m_cut_Et;
+  std::string m_photon_met_container_name;
   std::vector<float> m_etconeisocutvalues;
   std::vector<float> m_ptconeisocutvalues;
 
@@ -79,12 +77,20 @@ private:
   ToolHandle<IAsgPhotonIsEMSelector>      m_loose_cut_based; 
   ToolHandle<IAsgPhotonIsEMSelector>      m_tight_cut_based; 
 
+  ToolHandle<IEGammaAmbiguityTool>        m_egamma_ambi_tool; 
+  
+  /** isolation correction tool */
+  ToolHandle<CP::IIsolationCorrectionTool> m_isolation_correction_tool; 
+  
   ToolHandle<CP::IIsolationSelectionTool> m_cone40_calo_isolation;//!
   ToolHandle<CP::IIsolationSelectionTool> m_cone40_isolation;//!
   ToolHandle<CP::IIsolationSelectionTool> m_cone20_isolation;//!
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_tightcaloonly_isolation;//!
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_loose_isolation;//!
+  ToolHandle<CP::IIsolationSelectionTool> m_fixedcut_tight_isolation;//!
 
   /** calib tool */
-  ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_EgammaCalibrationAndSmearingTool;
+  // ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_EgammaCalibrationAndSmearingTool;
 
  };
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/cmt/requirements b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/cmt/requirements
index e23c40c586936fbaf9995f0eae30ae06aa194eb0..c1e5bb596bbc3c2f8062c56100a509c0bb5d3364 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/cmt/requirements
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/cmt/requirements
@@ -13,10 +13,11 @@ use EventInfo              EventInfo-*             Event
 use TagEvent               TagEvent-*              PhysicsAnalysis/EventTag
 use xAODEgamma		   xAODEgamma-*	 	   Event/xAOD 
 use xAODMissingET	   xAODMissingET-*	   Event/xAOD 
-use ElectronPhotonSelectorTools ElectronPhotonSelectorTools-*  PhysicsAnalysis/ElectronPhotonID
-use ElectronPhotonShowerShapeFudgeTool ElectronPhotonShowerShapeFudgeTool-*  PhysicsAnalysis/ElectronPhotonID
+use ElectronPhotonSelectorTools          ElectronPhotonSelectorTools-*          PhysicsAnalysis/ElectronPhotonID
+use ElectronPhotonShowerShapeFudgeTool   ElectronPhotonShowerShapeFudgeTool-*   PhysicsAnalysis/ElectronPhotonID
 use ElectronPhotonFourMomentumCorrection ElectronPhotonFourMomentumCorrection-* PhysicsAnalysis/ElectronPhotonID
 use IsolationSelection     IsolationSelection-*    PhysicsAnalysis/AnalysisCommon
+use IsolationCorrections   IsolationCorrections-*  PhysicsAnalysis/ElectronPhotonID/
 use xAODEventInfo          xAODEventInfo-*         Event/xAOD
 
 private
@@ -24,13 +25,13 @@ use AnalysisUtils          AnalysisUtils-*         PhysicsAnalysis/AnalysisCommo
 use xAODTracking           xAODTracking-*          Event/xAOD
 use xAODCore               xAODCore-*              Event/xAOD
 use xAODParticleEvent      xAODParticleEvent-*     Event/xAOD   
+use AthContainers          AthContainers-*         Control
+
 end_private
 
 private
 apply_tag ROOTGraphicsLibs
 apply_tag ROOTMathLibs
-end_private
 
-public
 apply_pattern dual_use_library files=*.cxx
-apply_pattern declare_joboptions files="*.py"
\ No newline at end of file
+apply_pattern declare_joboptions files="*.py"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/ElectronTagTool_jobOptions.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/ElectronTagTool_jobOptions.py
index 426faa24ef16980283e0d55bf0aec2e4ae793e61..1cf52e1ea2babccc7115dbc9e53d7cef38f1a3e5 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/ElectronTagTool_jobOptions.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/ElectronTagTool_jobOptions.py
@@ -4,20 +4,20 @@ include.block ("ElectronPhotonTagTools/ElectronTagTool_jobOptions.py")
 from ElectronPhotonSelectorTools.ConfiguredAsgElectronLikelihoodTools import ConfiguredAsgElectronLikelihoodTool
 from ROOT import LikeEnum
 VeryLooseLHSelector = ConfiguredAsgElectronLikelihoodTool("VeryLooseLHSelector", LikeEnum.VeryLoose)
-ToolSvc+=VeryLooseLHSelector
-LooseLHSelector = ConfiguredAsgElectronLikelihoodTool("LooseLHSelector", LikeEnum.Loose)
-ToolSvc+=LooseLHSelector
-MediumLHSelector = ConfiguredAsgElectronLikelihoodTool("MediumLHSelector", LikeEnum.Medium)
-ToolSvc+=MediumLHSelector
-TightLHSelector = ConfiguredAsgElectronLikelihoodTool("TightLHSelector", LikeEnum.Tight)
-ToolSvc+=TightLHSelector
+ToolSvc += VeryLooseLHSelector
+LooseLHSelector     = ConfiguredAsgElectronLikelihoodTool("LooseLHSelector",     LikeEnum.Loose)
+ToolSvc += LooseLHSelector
+MediumLHSelector    = ConfiguredAsgElectronLikelihoodTool("MediumLHSelector",    LikeEnum.Medium)
+ToolSvc += MediumLHSelector
+TightLHSelector     = ConfiguredAsgElectronLikelihoodTool("TightLHSelector",     LikeEnum.Tight)
+ToolSvc += TightLHSelector
 
 ########### Electron cut based selection options ################
 from ElectronPhotonSelectorTools.ConfiguredAsgElectronIsEMSelectors import ConfiguredAsgElectronIsEMSelector
 from ROOT import egammaPID
 
 #Loose
-ElectronIsEMSelectorLoose = ConfiguredAsgElectronIsEMSelector("ElectronIsEMSelectorLoose", egammaPID.ElectronIDLoosePP)
+ElectronIsEMSelectorLoose = ConfiguredAsgElectronIsEMSelector("ElectronIsEMSelectorLoose",   egammaPID.ElectronIDLoosePP)
 ToolSvc += ElectronIsEMSelectorLoose
 
 #Medium
@@ -25,50 +25,77 @@ ElectronIsEMSelectorMedium = ConfiguredAsgElectronIsEMSelector("ElectronIsEMSele
 ToolSvc += ElectronIsEMSelectorMedium
 
 #Tight
-ElectronIsEMSelectorTight = ConfiguredAsgElectronIsEMSelector("ElectronIsEMSelectorTight", egammaPID.ElectronIDTightPP)
+ElectronIsEMSelectorTight = ConfiguredAsgElectronIsEMSelector("ElectronIsEMSelectorTight",   egammaPID.ElectronIDTightPP)
 ToolSvc += ElectronIsEMSelectorTight
 
 ########### Electron Isolation options ################
 
-from IsolationSelection.IsolationSelectionConf import CP__IsolationSelectionTool
-LooseTrackOnlyIsoTool = CfgMgr.CP__IsolationSelectionTool( "ElectronLooseTrackOnlyIsolationSelectionTool" )
+isSimulation = False
+if inputFileSummary.has_key("evt_type"):
+	eventTypeList = inputFileSummary.get("evt_type")
+	if eventTypeList.__contains__("IS_SIMULATION") :
+		print "ElectronTagTool: Detected that the input file is a simulated dataset"
+		isSimulation = True
+	else:
+		print "ElectronTagTool: Detected that the input file is real data"
+		pass
+
+IsolationCorrectionTool          = CfgMgr.CP__IsolationCorrectionTool( "ElectronIsolationCorrectionTool" )
+IsolationCorrectionTool.IsMC     = isSimulation
+ToolSvc += IsolationCorrectionTool
+
+LooseTrackOnlyIsoTool            = CfgMgr.CP__IsolationSelectionTool( "ElectronLooseTrackOnlyIsolationSelectionTool" )
 LooseTrackOnlyIsoTool.ElectronWP = "LooseTrackOnly"
 ToolSvc += LooseTrackOnlyIsoTool
-LooseIsoTool = CfgMgr.CP__IsolationSelectionTool( "ElectronLooseIsolationSelectionTool" )
-LooseIsoTool.ElectronWP = "Loose"
+LooseIsoTool                     = CfgMgr.CP__IsolationSelectionTool( "ElectronLooseIsolationSelectionTool" )
+LooseIsoTool.ElectronWP          = "Loose"
 ToolSvc += LooseIsoTool
-TightIsoTool = CfgMgr.CP__IsolationSelectionTool( "ElectronTightIsolationSelectionTool" )
-TightIsoTool.ElectronWP = "Tight"
+TightIsoTool                     = CfgMgr.CP__IsolationSelectionTool( "ElectronTightIsolationSelectionTool" )
+TightIsoTool.ElectronWP          = "Tight"
 ToolSvc += TightIsoTool
-GradientIsoTool = CfgMgr.CP__IsolationSelectionTool( "ElectronGradientIsolationSelectionTool" )
-GradientIsoTool.ElectronWP = "Gradient"
+GradientIsoTool                  = CfgMgr.CP__IsolationSelectionTool( "ElectronGradientIsolationSelectionTool" )
+GradientIsoTool.ElectronWP       = "Gradient"
 ToolSvc += GradientIsoTool
-GradientLooseIsoTool = CfgMgr.CP__IsolationSelectionTool( "ElectronGradientLooseIsolationSelectionTool" )
-GradientLooseIsoTool.ElectronWP = "GradientLoose"
+GradientLooseIsoTool             = CfgMgr.CP__IsolationSelectionTool( "ElectronGradientLooseIsolationSelectionTool" )
+GradientLooseIsoTool.ElectronWP  = "GradientLoose"
 ToolSvc += GradientLooseIsoTool
-
+FixedCutTightTrackOnlyIsoTool            = CfgMgr.CP__IsolationSelectionTool( "ElectronFixedCutTightTrackOnlyIsolationSelectionTool" )
+FixedCutTightTrackOnlyIsoTool.ElectronWP = "FixedCutTightTrackOnly"
+ToolSvc += FixedCutTightTrackOnlyIsoTool
+FixedCutLooseIsoTool                     = CfgMgr.CP__IsolationSelectionTool( "ElectronFixedCutLooseIsolationSelectionTool" )
+FixedCutLooseIsoTool.ElectronWP          = "FixedCutLoose"
+ToolSvc += FixedCutLooseIsoTool
+FixedCutTightIsoTool                     = CfgMgr.CP__IsolationSelectionTool( "ElectronFixedCutTightIsolationSelectionTool" )
+FixedCutTightIsoTool.ElectronWP          = "FixedCutTight"
+ToolSvc += FixedCutTightIsoTool
 
 from ElectronPhotonTagTools.ElectronPhotonTagToolsConf import \
      ElectronTagTool as ConfiguredElectronTagTool
 ElectronTagTool = ConfiguredElectronTagTool(
-     Container         = ["Electrons"],
-     EtCut             = 7.0*GeV,
-     EtconeIsoCutValues = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV], 
-     PtconeIsoCutValues = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV], 
-     TightLHSelector     = TightLHSelector,
-     MediumLHSelector    = MediumLHSelector,
-     LooseLHSelector     = LooseLHSelector,
-     VeryLooseLHSelector = VeryLooseLHSelector,
-     ElectronIsEMSelectorLoose  = ElectronIsEMSelectorLoose,
-     ElectronIsEMSelectorMedium = ElectronIsEMSelectorMedium,
-     ElectronIsEMSelectorTight  = ElectronIsEMSelectorTight,
-     LooseTrackOnlyIsolation= LooseTrackOnlyIsoTool  ,
-     LooseIsolation         = LooseIsoTool      ,
-     TightIsolation         = TightIsoTool      ,
-     GradientIsolation      = GradientIsoTool   ,
-     GradientLooseIsolation = GradientLooseIsoTool  
+     Container                       = ["Electrons"],
+     ElectronMETContainerName        = "Electrons_TAG_skim",
+     EtCut                           = 7.0*GeV,
+     EtconeIsoCutValues              = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV], 
+     PtconeIsoCutValues              = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV], 
+     TightLHSelector                 = TightLHSelector,
+     MediumLHSelector                = MediumLHSelector,
+     LooseLHSelector                 = LooseLHSelector,
+     VeryLooseLHSelector             = VeryLooseLHSelector,
+     ElectronIsEMSelectorLoose       = ElectronIsEMSelectorLoose,
+     ElectronIsEMSelectorMedium      = ElectronIsEMSelectorMedium,
+     ElectronIsEMSelectorTight       = ElectronIsEMSelectorTight,
+     IsolationCorrectionTool         = IsolationCorrectionTool,
+     LooseTrackOnlyIsolation         = LooseTrackOnlyIsoTool,
+     LooseIsolation                  = LooseIsoTool,
+     TightIsolation                  = TightIsoTool,
+     GradientIsolation               = GradientIsoTool,
+     GradientLooseIsolation          = GradientLooseIsoTool,
+     FixedCutTightTrackOnlyIsolation = FixedCutTightTrackOnlyIsoTool,
+     FixedCutLooseIsolation          = FixedCutLooseIsoTool,
+     FixedCutTightIsolation          = FixedCutTightIsoTool      
      )
 
-ElectronTagTool.EgammaCalibrationAndSmearingTool.ESModel =  "es2015PRE"
+# ElectronTagTool.EgammaCalibrationAndSmearingTool.randomRunNumber = 308047
+# ElectronTagTool.EgammaCalibrationAndSmearingTool.ESModel =  "es2016data_mc15c"
 
 ToolSvc += ElectronTagTool
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/PhotonTagTool_jobOptions.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/PhotonTagTool_jobOptions.py
index e4978ddf06b8e336646a8c1c881eb1d7b36346ca..42013da27afa30cd589c30a20ed5841959978119 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/PhotonTagTool_jobOptions.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/share/PhotonTagTool_jobOptions.py
@@ -9,8 +9,10 @@ af = AthFile.fopen(svcMgr.EventSelector.InputCollections[0]) # opens the first f
 af.fileinfos # this is a dict of dicts, take a look at what's available! Below are some examples:
 
 isMC = 'IS_SIMULATION' in af.fileinfos['evt_type']
+
 beam_energy    = af.fileinfos['beam_energy']
 conditions_tag = af.fileinfos['conditions_tag'] #useful for figuring out which mc production this is
+
 isFullsim = False
 if isMC: 
     simulationFlavour = af.fileinfos['metadata']['/Simulation/Parameters']['SimulationFlavour']
@@ -31,16 +33,30 @@ if isFullsim:
     print DF_ElectronPhotonShowerShapeFudgeTool
 
 ############ Photon selecton options #################
-from IsolationSelection.IsolationSelectionConf import CP__IsolationSelectionTool
+
+IsolationCorrectionTool          = CfgMgr.CP__IsolationCorrectionTool( "ElectronIsolationCorrectionTool" )
+IsolationCorrectionTool.IsMC     = isMC
+ToolSvc += IsolationCorrectionTool
+
 cone20IsoTool = CfgMgr.CP__IsolationSelectionTool( "PhotonCone20IsolationSelectionTool" )
-cone20IsoTool.PhotonWP = "Cone20"
-ToolSvc += cone20IsoTool
-cone40IsoTool = CfgMgr.CP__IsolationSelectionTool( "PhotonCone40IsolationSelectionTool" )
-cone40IsoTool.PhotonWP = "Cone40"
-ToolSvc += cone40IsoTool
-cone40CaloOnlyIsoTool = CfgMgr.CP__IsolationSelectionTool( "PhotonCone40CaloOnlyIsolationSelectionTool" )
+cone20IsoTool.PhotonWP         = "Cone20"
+ToolSvc                       += cone20IsoTool
+cone40IsoTool                  = CfgMgr.CP__IsolationSelectionTool( "PhotonCone40IsolationSelectionTool" )
+cone40IsoTool.PhotonWP         = "Cone40"
+ToolSvc                       += cone40IsoTool
+cone40CaloOnlyIsoTool          = CfgMgr.CP__IsolationSelectionTool( "PhotonCone40CaloOnlyIsolationSelectionTool" )
 cone40CaloOnlyIsoTool.PhotonWP = "Cone40CaloOnly"
-ToolSvc += cone40CaloOnlyIsoTool
+ToolSvc                       += cone40CaloOnlyIsoTool
+
+FixedCutTightCaloOnlyIsoTool          = CfgMgr.CP__IsolationSelectionTool( "PhotonFixedCutTightCaloOnlyIsolationSelectionTool" )
+FixedCutTightCaloOnlyIsoTool.PhotonWP = "FixedCutTightCaloOnly"
+ToolSvc                              += FixedCutTightCaloOnlyIsoTool
+FixedCutLooseIsoTool                  = CfgMgr.CP__IsolationSelectionTool( "PhotonFixedCutLooseIsolationSelectionTool" )
+FixedCutLooseIsoTool.PhotonWP         = "FixedCutLoose"
+ToolSvc                              += FixedCutLooseIsoTool
+FixedCutTightIsoTool                  = CfgMgr.CP__IsolationSelectionTool( "PhotonFixedCutTightIsolationSelectionTool" )
+FixedCutTightIsoTool.PhotonWP         = "FixedCutTight"
+ToolSvc                              += FixedCutTightIsoTool
 
 ########### Photon cut based selection options ################
 from ROOT import egammaPID
@@ -54,22 +70,34 @@ ToolSvc += PhotonIsEMSelectorLoose
 PhotonIsEMSelectorTight = ConfiguredAsgPhotonIsEMSelector("PhotonIsEMSelectorTight", egammaPID.PhotonIDTight)
 ToolSvc += PhotonIsEMSelectorTight
 
+# EGammaAmbiTool
+from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import EGammaAmbiguityTool
+EGammaAmbiTool = EGammaAmbiguityTool("EGammaAmbiguityTool")
+ToolSvc += EGammaAmbiTool
+
 
 from ElectronPhotonTagTools.ElectronPhotonTagToolsConf import PhotonTagTool as ConfiguredPhotonTagTool
 PhotonTagTool = ConfiguredPhotonTagTool(
-    Container            = "Photons",
-    EtCut                = 10.0*GeV,
-    EtconeIsoCutValues   = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV ],
-    PtconeIsoCutValues   = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV ],
-    isFullsim            = isFullsim,
-    PhotonShowerFudgeTool= DF_ElectronPhotonShowerShapeFudgeTool,
-    LooseSelector        = PhotonIsEMSelectorLoose,
-    TightSelector        = PhotonIsEMSelectorTight,
-    cone20IsoTool        = cone20IsoTool,
-    cone40IsoTool        = cone40IsoTool,
-    cone40CaloOnlyIsoTool= cone40CaloOnlyIsoTool
+    Container                    = "Photons",
+    PhotonMETContainerName       = "Photons_TAG_skim", 
+    EtCut                        = 10.0*GeV,
+    EtconeIsoCutValues           = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV ],
+    PtconeIsoCutValues           = [ 0.15, 0.30, 3.0*GeV, 5.0*GeV ],
+    isFullsim                    = isFullsim,
+    PhotonShowerFudgeTool        = DF_ElectronPhotonShowerShapeFudgeTool,
+    LooseSelector                = PhotonIsEMSelectorLoose,
+    TightSelector                = PhotonIsEMSelectorTight,
+    EGammaAmbiTool               = EGammaAmbiTool,
+    IsolationCorrectionTool      = IsolationCorrectionTool,
+    cone20IsoTool                = cone20IsoTool,
+    cone40IsoTool                = cone40IsoTool,
+    cone40CaloOnlyIsoTool        = cone40CaloOnlyIsoTool,
+    FixedCutTightCaloOnlyIsoTool = FixedCutTightCaloOnlyIsoTool,
+    FixedCutLooseIsoTool         = FixedCutLooseIsoTool,
+    FixedCutTightIsoTool         = FixedCutTightIsoTool
     )
 
-PhotonTagTool.EgammaCalibrationAndSmearingTool.ESModel =  "es2015PRE"
+# PhotonTagTool.EgammaCalibrationAndSmearingTool.randomRunNumber = 308047
+# PhotonTagTool.EgammaCalibrationAndSmearingTool.ESModel =  "es2016data_mc15c"
 
 ToolSvc += PhotonTagTool
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/EgammaTagTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/EgammaTagTool.cxx
index 13f48bb5291e769599a1c008b9a1020a510383f4..8f69bc6d7be5e56e12801af6d3332d692e84dad3 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/EgammaTagTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/EgammaTagTool.cxx
@@ -165,14 +165,14 @@ bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl,
       }
       
       if ( value_loose_pos == 1 || value_loose_neg == 1 ) {
-	double m_invMass = -999.;
+	double invMass = -999.;
 	
 	/** Calculate invariant mass of ee */
-	m_invMass = ( electrons_positive[ i ]->p4() + electrons_negative[ i ]->p4() ).M();
+	invMass = ( electrons_positive[ i ]->p4() + electrons_negative[ i ]->p4() ).M();
 
 	
 	/** Make decision for a good Zee */
-	if ( (m_massZLow < m_invMass) && (m_invMass < m_massZHigh) ) m_flagZeeEvent = true;
+	if ( (m_massZLow < invMass) && (invMass < m_massZHigh) ) m_flagZeeEvent = true;
 	
 	/** Print the details of Zee Candidate if outputLevel=DEBUG */      
 	if (m_flagZeeEvent) { 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx
index 4b578549ecba050ed686de96ab17a464a35e8ead..7242a1d807b53bbd56f4b8ca1fba47029e0b4fc2 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx
@@ -24,13 +24,12 @@ Purpose : create a collection of ElectronTag
 #include "ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h"
 #include "TagEvent/ElectronAttributeNames.h"
 #include "AnalysisUtils/AnalysisMisc.h"
-
+#include "AthContainers/ConstDataVector.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "xAODTracking/VertexContainer.h"
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/TrackParticleContainer.h"
 #include "xAODTracking/TrackParticlexAODHelpers.h"
-
 #include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h"
 
 #include <sstream>
@@ -51,65 +50,90 @@ ElectronTagTool::ElectronTagTool (const std::string& type, const std::string& na
   m_tight_isolation(""),
   m_gradient_loose_isolation(""),
   m_gradient_isolation(""),
-  m_EgammaCalibrationAndSmearingTool("CP::EgammaCalibrationAndSmearingTool/EgammaCalibrationAndSmearingTool", this) {
+  m_fixedcut_tight_trackonly_isolation(""),
+  m_fixedcut_loose_isolation(""),
+  m_fixedcut_tight_isolation("") {
+  // m_EgammaCalibrationAndSmearingTool("CP::EgammaCalibrationAndSmearingTool/EgammaCalibrationAndSmearingTool", this) {
   
   /** Electron AOD Container Name */
-  declareProperty("Container",     m_containerNames);
-  
+  declareProperty("Container",                 m_containerNames);
+
+  /**Electron MET input container Name */
+  declareProperty("ElectronMETContainerName",  m_electron_met_container_name);
+
   /** selection cut of Pt */
-  declareProperty("EtCut",         m_cut_Et = 7.0*CLHEP::GeV);
+  declareProperty("EtCut",                     m_cut_Et = 7.0*CLHEP::GeV);
 
   /** Etcone Isolation cut values */
-  declareProperty("EtconeIsoCutValues",m_etconeisocutvalues, "Cut values for etcone isolation");
+  declareProperty("EtconeIsoCutValues",        m_etconeisocutvalues, "Cut values for etcone isolation");
  
   /** Ptcone Isolation cut values */
-  declareProperty("PtconeIsoCutValues",m_ptconeisocutvalues, "Cut values for ptcone isolation");
+  declareProperty("PtconeIsoCutValues",        m_ptconeisocutvalues, "Cut values for ptcone isolation");
 
   /** Electron Likelihood ID Tool name */
-  declareProperty("VeryLooseLHSelector",    m_veryloose_likelihood);
-  declareProperty("LooseLHSelector",    m_loose_likelihood);
-  declareProperty("MediumLHSelector",    m_medium_likelihood);
-  declareProperty("TightLHSelector",    m_tight_likelihood);
+  declareProperty("VeryLooseLHSelector",       m_veryloose_likelihood);
+  declareProperty("LooseLHSelector",           m_loose_likelihood);
+  declareProperty("MediumLHSelector",          m_medium_likelihood);
+  declareProperty("TightLHSelector",           m_tight_likelihood);
 
   /** Electron Cut based ID Tool name */
-  declareProperty("ElectronIsEMSelectorLoose",    m_loose_cut_based);
-  declareProperty("ElectronIsEMSelectorMedium",    m_medium_cut_based);
-  declareProperty("ElectronIsEMSelectorTight",    m_tight_cut_based);
+  declareProperty("ElectronIsEMSelectorLoose", m_loose_cut_based);
+  declareProperty("ElectronIsEMSelectorMedium",m_medium_cut_based);
+  declareProperty("ElectronIsEMSelectorTight", m_tight_cut_based);
+
+  /**Photon Ambiguity Tools */
+  declareProperty("IsolationCorrectionTool", m_isolation_correction_tool);
 
   /** Electron Isolation Tool names */
-  declareProperty("LooseTrackOnlyIsolation",m_loose_trackonly_isolation);
-  declareProperty("LooseIsolation",         m_loose_isolation);
-  declareProperty("TightIsolation",         m_tight_isolation);
-  declareProperty("GradientLooseIsolation", m_gradient_loose_isolation);
-  declareProperty("GradientIsolation",      m_gradient_isolation);
+  declareProperty("LooseTrackOnlyIsolation",        m_loose_trackonly_isolation);
+  declareProperty("LooseIsolation",                 m_loose_isolation);
+  declareProperty("TightIsolation",                 m_tight_isolation);
+  declareProperty("GradientLooseIsolation",         m_gradient_loose_isolation);
+  declareProperty("GradientIsolation",              m_gradient_isolation);
+  declareProperty("FixedCutTightTrackOnlyIsolation",m_fixedcut_tight_trackonly_isolation);
+  declareProperty("FixedCutLooseIsolation",         m_fixedcut_loose_isolation);
+  declareProperty("FixedCutTightIsolation",         m_fixedcut_tight_isolation);
+
+  /** key for primary vertex container */
+  declareProperty ("PrimaryVertexKey", m_vxCandidate = "PrimaryVertices");
 
   /** CP tool to calib objects */
-  declareProperty( "EgammaCalibrationAndSmearingTool", m_EgammaCalibrationAndSmearingTool);
+  // declareProperty( "EgammaCalibrationAndSmearingTool", m_EgammaCalibrationAndSmearingTool);
 
   declareInterface<ElectronTagTool>( this );
 }
 
 /** initialization - called once at the beginning */
 StatusCode  ElectronTagTool::initialize() {
+
   ATH_MSG_DEBUG( "in initialize()" );
+
   /** retrieve and check the electron likelihood ID tool*/
   CHECK(m_veryloose_likelihood.retrieve());
   CHECK(m_loose_likelihood.retrieve());
   CHECK(m_medium_likelihood.retrieve());
   CHECK(m_tight_likelihood.retrieve());
+
  /** retrieve and check the electron cut based ID tool*/
   CHECK(m_loose_cut_based.retrieve());
   CHECK(m_medium_cut_based.retrieve());
   CHECK(m_tight_cut_based.retrieve()); 
+
+  /** retrieve and check the gamma ambi tool*/
+  CHECK(m_isolation_correction_tool.retrieve());
+
  /** retrieve and check the electron isolation tool*/
   CHECK(m_loose_trackonly_isolation.retrieve());
   CHECK(m_loose_isolation.retrieve());
   CHECK(m_tight_isolation.retrieve());
   CHECK(m_gradient_loose_isolation.retrieve());
   CHECK(m_gradient_isolation.retrieve());
+  CHECK(m_fixedcut_tight_trackonly_isolation.retrieve());
+  CHECK(m_fixedcut_loose_isolation.retrieve());
+  CHECK(m_fixedcut_tight_isolation.retrieve());
 
   /** retreive and check the calibration tool */
-  CHECK(m_EgammaCalibrationAndSmearingTool.retrieve());
+  // CHECK(m_EgammaCalibrationAndSmearingTool.retrieve());
 
   if (m_etconeisocutvalues.size() > 4) {
     ATH_MSG_FATAL ("More than four etcone values are not permitted");
@@ -173,17 +197,8 @@ StatusCode ElectronTagTool::attributeSpecification(std::map<std::string,AthenaAt
 /** execute - called on every event */
 StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int& max) {
 
-
   ATH_MSG_DEBUG( "in execute()" );
-  /** retrieve the  EventInfo container */
-  const xAOD::EventInfo* eventInfo = 0;
-  StatusCode sc = evtStore()->retrieve( eventInfo, "EventInfo");
-  if (sc.isFailure()) {
-     ATH_MSG_WARNING( "No AOD EventInfo container found in SG" );
-     return StatusCode::SUCCESS;
-  }
-  ATH_MSG_DEBUG( "AOD EventInfo container successfully retrieved");
-  
+
   /** initialize a vector of electrons */
   std::vector<const xAOD::Electron*> unique_electrons;
 
@@ -211,11 +226,16 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
     for ( xAOD::Electron *shallowCopyElectron : * electronContainerShallowCopy ) {
 
       /** fix calibration using tool */
-      ATH_MSG_DEBUG("Un-Calibrated pt = " << shallowCopyElectron->pt());
-      if(m_EgammaCalibrationAndSmearingTool->applyCorrection(*shallowCopyElectron) != CP::CorrectionCode::Ok){
-          ATH_MSG_WARNING("Cannot calibrate electron");
+      // ATH_MSG_DEBUG("Un-Calibrated pt = " << shallowCopyElectron->pt());
+      // if(m_EgammaCalibrationAndSmearingTool->applyCorrection(*shallowCopyElectron) != CP::CorrectionCode::Ok){
+      //    ATH_MSG_WARNING("Cannot calibrate electron");
+      // }
+      // ATH_MSG_DEBUG("Calibrated pt = " << shallowCopyElectron->pt()); 
+
+      /** apply isolation fix */
+      if (m_isolation_correction_tool->applyCorrection(*shallowCopyElectron) != CP::CorrectionCode::Ok) {
+	ATH_MSG_WARNING("Cannot correct isolation of electron");
       }
-      ATH_MSG_DEBUG("Calibrated pt = " << shallowCopyElectron->pt()); 
 
       const xAOD::IParticleLink originLink( *electronContainer, shallowCopyElectron->index() );
       accSetOriginLink(*shallowCopyElectron) = originLink;
@@ -223,43 +243,39 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
     CHECK(evtStore()->setConst(electronContainerShallowCopy ));
     CHECK(evtStore()->setConst(electronAuxContainerShallowCopy ));
 
-    xAOD::ElectronContainer userContainer( SG::VIEW_ELEMENTS );
-    userContainer = *electronContainerShallowCopy;
-    AnalysisUtils::Sort::pT( &userContainer );
-    
-    /** Loop over the container*/
-    
-    xAOD::ElectronContainer::const_iterator elecItr  = userContainer.begin();
-    xAOD::ElectronContainer::const_iterator elecItrE = userContainer.end();
-   
+    /** create an electron container for MET calculation */
+    ConstDataVector< xAOD::ElectronContainer >* selectedElectrons = new ConstDataVector< xAOD::ElectronContainer >( SG::VIEW_ELEMENTS );
+    ATH_CHECK( evtStore()->record( selectedElectrons, m_electron_met_container_name ) );
+
+    /** Loop over the container */
+    xAOD::ElectronContainer::const_iterator elecItr  = electronContainerShallowCopy->begin();
+    xAOD::ElectronContainer::const_iterator elecItrE = electronContainerShallowCopy->end();
     int k=0;
-    
-    for (; elecItr != elecItrE; ++elecItr) { 
+    for (; elecItr != elecItrE; ++elecItr, ++k) { 
       
       ATH_MSG_DEBUG( "Electron " << k << ", pt = " << (*elecItr)->pt() );
-      k++;  
 
       /**Apply loose preselection using the likelihood tool and pT cut*/
-      if (  ! m_loose_likelihood->accept(*elecItr) )continue;      
-      bool select = (*elecItr)->pt()>m_cut_Et;
-      
-      if ( !select )continue; 
+      if ( ! m_loose_likelihood->accept(*elecItr) ) continue;
+      bool select = (*elecItr)->pt()>m_cut_Et;      
+      if ( ! select ) continue; 
       
       /** Fill a vector with selected electrons */
       unique_electrons.push_back(*elecItr);
-      
+      /** Fill the MET input Container with selected electrons*/
+      selectedElectrons->push_back(*elecItr);
     }
   }
   
   /**Sorted electron vector by pT*/ 
   if ( unique_electrons.size() > 1) {
-    ATH_MSG_DEBUG( "sorting electron file" );
+    ATH_MSG_DEBUG( "sorting electrons" );
     AnalysisUtils::Sort::pT( &unique_electrons );
   }      
   
   /**Filling TAG variables*/
-  int i=0;
   std::vector<const xAOD::Electron*>::const_iterator EleItr  = unique_electrons.begin();
+  int i=0;
   for (; EleItr != unique_electrons.end() && i < max; ++EleItr, ++i) {
     
     ATH_MSG_DEBUG( "Electron " << i << ", pt = " << (*EleItr)->pt() );
@@ -285,39 +301,59 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
     if ( m_tight_likelihood->accept(*EleItr))       tightness |= (1 << 5);//Likelihood Tight
     if ( m_veryloose_likelihood->accept(*EleItr) )  tightness |= (1 << 8);//Likelihood VeryLoose
 
+    /** get impact parameters of electron */
+    double d0_significance = 0.;
+    double z0_sintheta     = 0.;
+    getElectronImpactParameter (*EleItr, d0_significance, z0_sintheta);
+    /** cut on d0 */
+    if ( fabs(d0_significance)<5.0 ) tightness |= (1 << 6);
+    /** cut on z0 */
+    if ( fabs(z0_sintheta)<0.5 )     tightness |= (1 << 9);
     
-    /** We try to find the link to the primary track and after we retrieve it*/
+    /** Object Quality */
+    bool isGoodOQ = (*EleItr)->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON);
+    if( isGoodOQ )                   tightness |= (1 << 7);
+    
+    /** b-layer cut */
     const ElementLink<xAOD::TrackParticleContainer> &  tp_prime = (*EleItr)->trackParticleLink();
     if(!tp_prime){
       ATH_MSG_DEBUG("found no link to primary track particle");
     } else {
-
       if( tp_prime.isValid() ) {
-	const xAOD::TrackParticle* trk = *tp_prime;
-      
-	/** d0 Significance */
-      
-	Double_t d0_significance = xAOD::TrackingHelpers::d0significance(trk, eventInfo->beamPosSigmaX(), eventInfo->beamPosSigmaY(), eventInfo->beamPosSigmaXY() );
-	if ( fabs(d0_significance)<5.0 )           tightness |= (1 << 6);
+        ATH_MSG_DEBUG("elementLink<TrackParticle> is valid");
+	const xAOD::TrackParticle* tp = *tp_prime;
+
+        // check blayer, if expected                                                                                                                                                            
+        uint8_t nblh   = 0x0;
+        uint8_t eblh   = 0x0;
+        uint8_t nblo   = 0x0;
+        if( !tp->summaryValue(nblh,xAOD::numberOfBLayerHits)){
+          ATH_MSG_WARNING("No nBLayerHits");
+        }
+        if( !tp->summaryValue(nblo,xAOD::numberOfBLayerOutliers)){
+          ATH_MSG_WARNING("No nofBLayerOutliers");
+        }
+        if( !tp->summaryValue(eblh,xAOD::expectBLayerHit) ||
+            (nblh + nblo > 0) )        tightness |= (1 << 10);
       }
     }
-    
-    /** Object Quality */
-    bool isGoodOQ = (*EleItr)->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON);
-    if( isGoodOQ )                             tightness |= (1 << 7);
-    
+
     /**  Using Isolation Tool to fill bit from 4 to 7 with loosetrackonly,loose,gradientloose,gradient*/    
     if(m_loose_trackonly_isolation->accept(**EleItr))tightness |= (1 << 24);
     if(m_loose_isolation->accept(**EleItr))          tightness |= (1 << 25);
     if(m_tight_isolation->accept(**EleItr))          tightness |= (1 << 26);
     if(m_gradient_isolation->accept(**EleItr))       tightness |= (1 << 27);
     if(m_gradient_loose_isolation->accept(**EleItr)) tightness |= (1 << 28);
+    if(m_fixedcut_tight_trackonly_isolation->accept(**EleItr))tightness |= (1 << 29);
+    if(m_fixedcut_loose_isolation->accept(**EleItr))          tightness |= (1 << 30);
+    if(m_fixedcut_tight_isolation->accept(**EleItr))          tightness |= (1 << 31);
 
     eTagColl.insert( m_tightStr[i], tightness ); 
     
 
     unsigned int iso = 0x0;
-    float elEt = (*EleItr)->pt();
+    const float elEt = (*EleItr)->pt();
+    const float inv_elEt = elEt != 0 ? 1. / elEt : 1;
     float etcone=0;
 
     /** now start filling the isolation information */
@@ -331,7 +367,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	/** apply etcone20/pt cuts first */
 	if(m_etconeisocutvalues[j]<1.0) {
 	  float relIso = etcone;
-	  if ( elEt != 0.0 ) relIso = relIso/elEt;
+	  relIso *= inv_elEt;
 	  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << j;
 	  
 	  /**apply absolute etcone20 cut*/
@@ -349,7 +385,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	/** apply topoetcone20/pt cuts first */
 	if(m_etconeisocutvalues[j]<1.0) {
 	  float relIso = etcone;
-	  if ( elEt != 0.0 ) relIso = relIso/elEt;
+	  relIso *= inv_elEt;
 	  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (8+j);
 	  
 	  /**apply absolute topoetcone20 cut*/
@@ -371,7 +407,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	  if ( m_etconeisocutvalues[j] < 1.0 ) 
 	    {
 	      float relIso = etcone;
-	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      relIso *= inv_elEt;
 	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (16+j);
 	    }
 	  /**apply absolute topoetcone40 cut*/
@@ -394,7 +430,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	  if ( m_ptconeisocutvalues[j] < 1.0 )
 	    {
 	      float relIso = ptcone;
-	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      relIso *= inv_elEt;
 	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (24+j);
 	    }
 	  /**apply absolute ptcone20 cut*/
@@ -414,7 +450,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	  if ( m_ptconeisocutvalues[j] < 1.0 )
 	    {
 	      float relIso = ptcone;
-	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      relIso *= inv_elEt;
 	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (20+j);
 	    }
 	  /**apply absolute ptcone30 cut*/
@@ -434,8 +470,8 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	  if ( m_ptconeisocutvalues[j] < 1.0 ) 
 	    {
 	      float relIso = ptcone;
-	      if ( elEt != 0.0 ) relIso = relIso/elEt;
-	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (28+j);
+	      relIso *= inv_elEt;
+	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (28+j);
 	    }
 	   /**apply absolute ptcone40 cut*/
 	  /* ptcone40 are bits 30 and 31 */
@@ -454,7 +490,7 @@ StatusCode ElectronTagTool::execute(TagFragmentCollection& eTagColl, const int&
 	  if ( m_etconeisocutvalues[j] < 1.0 )
 	    {
 	      float relIso = etcone;
-	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+              relIso *= inv_elEt;
 	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (12+j);
 	    }
 	  /**apply absolute topoetcone30 cut*/
@@ -482,4 +518,58 @@ StatusCode  ElectronTagTool::finalize() {
 /** destructor */
 ElectronTagTool::~ElectronTagTool() {}
 
+/** private function to get impact parameter */
+void ElectronTagTool::getElectronImpactParameter (const xAOD::Electron* elec, double& d0_significance, double& z0_sintheta) {
+
+  /** let's initialize to 0 the impact parameters*/
+  d0_significance = 0.;
+  z0_sintheta     = 0.;
+
+  StatusCode sc;
 
+  /** retrieve the  EventInfo container for Beam Spot */
+  const xAOD::EventInfo* eventInfo = 0;
+  sc = evtStore()->retrieve( eventInfo, "EventInfo");
+  if (sc.isFailure()) {
+     ATH_MSG_WARNING( "No AOD EventInfo container found in SG, return 0 impact paramters." );
+     return;
+  }
+  
+  /** get vertex container, we assume the first vertex is the primary by convention */
+  const xAOD::VertexContainer* vxContainer=0;
+  sc = evtStore()->retrieve(vxContainer, m_vxCandidate);
+  if (sc.isFailure() || !vxContainer) {
+    ATH_MSG_DEBUG ("Could not retrieve primary vertex info: " << m_vxCandidate <<", return 0 impact parameter.");
+    return;
+  }
+  if (vxContainer->size()<1) {
+    ATH_MSG_DEBUG ("No primary vertices reconstructed, return 0 impact parameters.");
+    return;
+  }
+  xAOD::VertexContainer::const_iterator vxI = vxContainer->begin();
+  if ((*vxI)->vertexType() != xAOD::VxType::PriVtx) {
+    ATH_MSG_DEBUG ("---> no primary vertex reconstructed, return 0 impact parameters.");
+    return;
+  }
+  ATH_MSG_DEBUG ("---> vertex at (x/y/z) = " << (*vxI)->x() << " / " << (*vxI)->y() << " / " << (*vxI)->z() );
+  
+  /** We try to find the link to the primary track and after we retrieve it*/
+  const ElementLink<xAOD::TrackParticleContainer> &  tp_prime = elec->trackParticleLink();
+  if(!tp_prime){
+    ATH_MSG_DEBUG("found no link to primary track particle");
+  } else {
+    if( tp_prime.isValid() ) {
+      const xAOD::TrackParticle* trk = *tp_prime;
+      
+      /** d0 Significance w.r.t. Beam Spot covariance as recommended (even if it makes little sense) */
+      d0_significance = xAOD::TrackingHelpers::d0significance(trk,
+							      eventInfo->beamPosSigmaX(),
+							      eventInfo->beamPosSigmaY(),
+							      eventInfo->beamPosSigmaXY()); 
+      /** z0_sintheta is an approximation, just do the diff */
+      double delta_z0 = fabs(trk->z0() + trk->vz() - (*vxI)->z());
+      z0_sintheta = delta_z0/sin(sin(trk->theta()));
+    }
+  }
+}
+    
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx
index 3d87c654fb6affb5267ea5faaa0f2453b61d74ab..c1428174463fff84805b16a0926591d1ff725428 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx
@@ -12,20 +12,20 @@ Purpose : create a collection of PhotonTag
 #include "GaudiKernel/Property.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "xAODCore/ShallowCopy.h"
+#include "xAODParticleEvent/IParticleLink.h"
 #include "xAODEgamma/EgammaContainer.h"
 #include "xAODEgamma/PhotonContainer.h"
 #include "xAODEgamma/PhotonAuxContainer.h"
-#include "xAODParticleEvent/IParticleLink.h"
-#include "xAODEgamma/Photon.h"
 #include "xAODEgamma/Egamma.h"
+#include "xAODEgamma/Photon.h"
+#include "AthenaPoolUtilities/AthenaAttributeSpecification.h"
 #include "xAODEgamma/EgammaEnums.h"
 #include "ElectronPhotonTagTools/PhotonTagTool.h"
+#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
 #include "TagEvent/PhotonAttributeNames.h"
 #include "AnalysisUtils/AnalysisMisc.h"
-#include "AthenaPoolUtilities/AthenaAttributeSpecification.h"
-#include "IsolationSelection/IIsolationSelectionTool.h"
-#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
-#include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h"
+#include "AthContainers/ConstDataVector.h"
+// #include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h"
 
 #include <sstream>
 
@@ -38,39 +38,53 @@ PhotonTagTool::PhotonTagTool (const std::string& type, const std::string& name,
   m_shower_shape_fudge(""),
   m_loose_cut_based(),
   m_tight_cut_based(),
+  m_egamma_ambi_tool(),
   /**Initializing private member for the isolation tool*/
   m_cone40_calo_isolation(""),
   m_cone40_isolation(""),
-  m_cone20_isolation(""),
-  m_EgammaCalibrationAndSmearingTool("CP::EgammaCalibrationAndSmearingTool/EgammaCalibrationAndSmearingTool", this) {
+  m_cone20_isolation("") {
+  // m_EgammaCalibrationAndSmearingTool("CP::EgammaCalibrationAndSmearingTool/EgammaCalibrationAndSmearingTool", this) {
 
   /** Photon AOD Container Name */
-  declareProperty("Container",     m_containerName = "PhotonCollection");
+  declareProperty("Container",             m_containerName = "PhotonCollection");
+
+  /** Photon AOD Container Name */
+  declareProperty("PhotonMETContainerName",m_photon_met_container_name);
 
   /** selection cut of Pt */
-  declareProperty("EtCut",         m_cut_Et = 7.0*CLHEP::GeV);
+  declareProperty("EtCut",                 m_cut_Et = 7.0*CLHEP::GeV);
 
   /** Etcone Isolation cut values */
-  declareProperty("EtconeIsoCutValues",m_etconeisocutvalues, "Cut values for etcone isolation");
+  declareProperty("EtconeIsoCutValues",    m_etconeisocutvalues, "Cut values for etcone isolation");
 
   /** Ptcone Isolation cut values */
-  declareProperty("PtconeIsoCutValues",m_ptconeisocutvalues, "Cut values for ptcone isolation");
+  declareProperty("PtconeIsoCutValues",    m_ptconeisocutvalues, "Cut values for ptcone isolation");
 
   /**Shower shape fudge*/
-  declareProperty("isFullsim"            ,m_isFullsim = false);
-  declareProperty("PhotonShowerFudgeTool",m_shower_shape_fudge);
+  declareProperty("isFullsim"            , m_isFullsim = false);
+  declareProperty("PhotonShowerFudgeTool", m_shower_shape_fudge);
 
   /**Photon Selector Tools */
   declareProperty("LooseSelector",         m_loose_cut_based);
   declareProperty("TightSelector",         m_tight_cut_based);
 
+  /**Photon Ambiguity Tools */
+  declareProperty("EGammaAmbiTool",        m_egamma_ambi_tool);
+
+  /**Photon Ambiguity Tools */
+  declareProperty("IsolationCorrectionTool", m_isolation_correction_tool);
+
   /**Photon Isolation Tool names*/
   declareProperty("cone40CaloOnlyIsoTool", m_cone40_calo_isolation);
   declareProperty("cone40IsoTool",         m_cone40_isolation);
   declareProperty("cone20IsoTool",         m_cone20_isolation);
 
+  declareProperty("FixedCutTightCaloOnlyIsoTool", m_fixedcut_tightcaloonly_isolation);
+  declareProperty("FixedCutLooseIsoTool",         m_fixedcut_loose_isolation);
+  declareProperty("FixedCutTightIsoTool",         m_fixedcut_tight_isolation);
+
   /** CP tool to calib objects */
-  declareProperty( "EgammaCalibrationAndSmearingTool", m_EgammaCalibrationAndSmearingTool);
+  // declareProperty( "EgammaCalibrationAndSmearingTool", m_EgammaCalibrationAndSmearingTool);
 
   declareInterface<PhotonTagTool>( this );
 }
@@ -87,13 +101,23 @@ StatusCode  PhotonTagTool::initialize() {
   CHECK(m_loose_cut_based.retrieve());
   CHECK(m_tight_cut_based.retrieve());
 
+  /** retrieve and check the gamma ambi tool*/
+  CHECK(m_egamma_ambi_tool.retrieve());
+
+  /** retrieve and check the gamma ambi tool*/
+  CHECK(m_isolation_correction_tool.retrieve());
+
   /** retrieve and check the photon isolation tool*/
   CHECK(m_cone20_isolation.retrieve());
   CHECK(m_cone40_isolation.retrieve());
   CHECK(m_cone40_calo_isolation.retrieve());
   
+  CHECK(m_fixedcut_tightcaloonly_isolation.retrieve());
+  CHECK(m_fixedcut_loose_isolation.retrieve());
+  CHECK(m_fixedcut_tight_isolation.retrieve());
+  
   /** retrieve and check the calibration tool */
-  CHECK(m_EgammaCalibrationAndSmearingTool.retrieve());
+  // CHECK(m_EgammaCalibrationAndSmearingTool.retrieve());
 
   if (m_etconeisocutvalues.size() > 4) {
     ATH_MSG_FATAL ("More than four Etcone values are not permitted");
@@ -163,6 +187,9 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma
 
   ATH_MSG_DEBUG( "in execute()" );
 
+  /** initialize a vector of photons */
+  std::vector<const xAOD::Photon*> unique_photons;
+
   /** retrieve the AOD photon container */
   const xAOD::PhotonContainer *photonContainer;
   StatusCode sc = evtStore()->retrieve( photonContainer, m_containerName);
@@ -187,6 +214,7 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma
     if (m_isFullsim) CP::CorrectionCode correctionCode = m_shower_shape_fudge->applyCorrection(*shallowCopyPhoton);
 
     /** fix calibration using tool */
+    /**
     if ((shallowCopyPhoton->author() & xAOD::EgammaParameters::AuthorCaloTopo35) > 0) {
       ATH_MSG_DEBUG("Author " <<xAOD::EgammaParameters::AuthorCaloTopo35<< " photon pt = " << shallowCopyPhoton->pt() << " do not calibrate, not supported "); 
     } else {
@@ -196,6 +224,12 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma
       }
       ATH_MSG_DEBUG("Calibrated pt = " << shallowCopyPhoton->pt()); 
     }
+    */
+
+    /** apply isolation fix */
+    if (m_isolation_correction_tool->applyCorrection(*shallowCopyPhoton) != CP::CorrectionCode::Ok) {
+      ATH_MSG_WARNING("Cannot correct isolation of photon");
+    }
 
     const xAOD::IParticleLink originLink( *photonContainer, shallowCopyPhoton->index() );
     accSetOriginLink(*shallowCopyPhoton) = originLink;
@@ -203,216 +237,239 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma
   CHECK(evtStore()->setConst(photonContainerShallowCopy ));
   CHECK(evtStore()->setConst(photonAuxContainerShallowCopy ));
   
-  xAOD::PhotonContainer userContainer( SG::VIEW_ELEMENTS );
-  userContainer = *photonContainerShallowCopy;
-  AnalysisUtils::Sort::pT( &userContainer );
+  /** create an photon container for MET calculation */
+  ConstDataVector< xAOD::PhotonContainer >* selectedPhotons = new ConstDataVector< xAOD::PhotonContainer >( SG::VIEW_ELEMENTS );
+  ATH_CHECK( evtStore()->record( selectedPhotons, m_photon_met_container_name ) );
+
+  /** Loop over the container */
+  xAOD::PhotonContainer::const_iterator photItr  = photonContainerShallowCopy->begin();
+  xAOD::PhotonContainer::const_iterator photItrE = photonContainerShallowCopy->end();
+  int k=0;
+  for (; photItr != photItrE; ++photItr, ++k) { 
+    
+    ATH_MSG_DEBUG( "Photon " << k << ", pt = " << (*photItr)->pt() );
+    
+    /** apply Et cut*/
+    bool passPtCut  = (*photItr)->pt() > m_cut_Et;
+    /** apply loose PID cut*/
+    bool isLoose    = m_loose_cut_based->accept(*photItr);
+    /** apply author cut*/
+    bool goodAuthor = ( (*photItr)->author() & xAOD::EgammaParameters::AuthorPhoton ) > 0 ||
+                      ( (*photItr)->author() & xAOD::EgammaParameters::AuthorAmbiguous ) > 0;
+
+    bool select    = passPtCut && isLoose && goodAuthor;
+    if ( ! select ) continue; 
+    
+    /** Fill a vector with selected electrons */
+    unique_photons.push_back(*photItr);
+    /** Fill the MET input Container with selected electrons*/
+    selectedPhotons->push_back(*photItr);
+  }
   
+  /**Sorted photon vector by pT*/ 
+  if ( unique_photons.size() > 1) {
+    ATH_MSG_DEBUG( "sorting photons" );
+    AnalysisUtils::Sort::pT( &unique_photons );
+  }      
   
   /** make the selection */
-  int i=0;
-  int nConverted = 0;
-  xAOD::PhotonContainer::const_iterator photonItr  = userContainer.begin();
-  xAOD::PhotonContainer::const_iterator photonItrE = userContainer.end();
-  for (; photonItr != photonItrE; ++photonItr) { 
-
-    bool passPtCut = (*photonItr)->pt() > m_cut_Et;
-    bool isLoose   = m_loose_cut_based->accept(*photonItr);
+  std::vector<const xAOD::Photon*>::const_iterator photonItr  = unique_photons.begin();
+  std::vector<const xAOD::Photon*>::const_iterator photonItrE = unique_photons.end();
+  int i=0; int nConverted = 0;
+  for (; photonItr != photonItrE && i < max; ++photonItr, ++i) { 
+
+    /**Filling TAG variables*/
     
-    bool select    = passPtCut && isLoose;
-
-    /**Apply loose preselection using the xAOD info and pT cut*/
-    if ( select) { 
-      
-      if ( i<max ) {
-
-        /**Filling TAG variables*/
-
-        /** pt */
-        pTagColl.insert( m_ptStr[i], (*photonItr)->pt() );
-        
-        /** eta */
-        pTagColl.insert( m_etaStr[i], (*photonItr)->eta() );
-        
-        /** phi */
-        pTagColl.insert( m_phiStr[i], (*photonItr)->phi() );
-         
-        /** Retrieving tighness info from xAOD */
-        unsigned int tightness = 0x0;
-        if (isLoose) tightness |= (1<<0);//loose
-
-        bool isTight = m_tight_cut_based->accept(*photonItr);
-        if (isTight) tightness |= (1<<1);//tight
-        
-        /** Photon Object Quality*/
-        bool isGoodOQ = (*photonItr)->isGoodOQ(xAOD::EgammaParameters::BADCLUSPHOTON);
-        if (isGoodOQ) tightness |= (1<<2);
-        
-        /**  Using Isolation Tool to fill bit from 4 to 6 with cone20,cone40,cone40caloonly*/
-        if(m_cone20_isolation->accept(**photonItr))      tightness |= (1 << 4);
-        if(m_cone40_isolation->accept(**photonItr))      tightness |= (1 << 5);
-        if(m_cone40_calo_isolation->accept(**photonItr)) tightness |= (1 << 6);
-
-        pTagColl.insert( m_tightStr[i], tightness );
-        
-        /** test for converted photon - and set the conversion flag */
-        if ((*photonItr)->nVertices() != 0) nConverted++;
-        
-        /** Isolation of Photons */
-        
-        unsigned int iso = 0x0;
-        float elEt = (*photonItr)->pt();
-        float etcone = 0;
-        /** now start filling the isolation information */
-        
-        /** let's compute the etcone20 isolation of the photon */
-        if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::etcone20))){
-          ATH_MSG_DEBUG( "No etcone20 defined" );
-        }
-        else{
-          /* Etcone20/pt are bits 0 and 1 */
-          for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
-            {
-              /** apply etcone20/pt cuts first */
-              if ( m_etconeisocutvalues[j] < 1.0 )
-                {
-                  float relIso = etcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << j;
-                }
-              /**apply absolute etconse20 cut*/
-              /* Etcone20 are bits 2 and 3 */
-              else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << j; 
-            }
-        }
-        /** let's compute the topoetcone20 isolation of the photon */
-        if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone20))){
-          ATH_MSG_DEBUG( "No topoetcone20 defined" );
-        }
-        else{
-          /* TopoEtcone20/pt are bits 8 and 9 */
-          for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
-            {
-              /** apply topoetcone20/pt cuts first */
-              if ( m_etconeisocutvalues[j] < 1.0 )
-                {
-                  float relIso = etcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (8+j);
-                }
-              /**apply absolute topoetcone20 cut*/
-              /* TopoEtcone20 are bits 10 and 11 */
-              else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (8+j);
-            }
-        }
-         /** let's compute the topoetcone40 isolation of the photon */
-        if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone40))){
-          ATH_MSG_DEBUG( "No isolation topoetcone40 defined" );
-        }
-        else{
-          /* TopoEtcone40/pt are bits 16 and 17 */
-          for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
-            {
-              /** apply topoetcone40/pt cuts first */
-              if ( m_etconeisocutvalues[j] < 1.0 )
-                {
-                  float relIso = etcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (16+j);
-                }
-              /**apply absolute topoetcone40 cut*/
-              /* TopoEtcone40 are bits 17 and 18 */
-              else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (16+j); 
-            }
-        }
-        /** let's compute the ptcone20 isolation of the photon */
-        float ptcone =0;
-        if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone20))){
-          ATH_MSG_DEBUG( "No isolation ptcone20 defined" );
-        }
-        else{
-          /* ptcone20/pt are bits 24 and 25 */
-          for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
-            {
-              /** apply ptcone20/pt cuts first */
-              if ( m_ptconeisocutvalues[j] < 1.0 ) 
-                {
-                  float relIso = ptcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (24+j);
-                }
-              /**apply absolute ptcone20 cut*/
-              /* ptcone20 are bits 26 and 27 */
-              else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (24+j);
-            }
-        }
-         /** let's compute the topoetcone30 isolation of the photon */
-        if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone30))){ 
-          ATH_MSG_DEBUG( "No isolation topoetcone30 defined" );
-        }
-        else{
-          /* topoEtcone30/pt are bits 12 and 13 */
-          for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
-            {
-              /** apply topoEtcone30/pt cuts first */
-              if ( m_etconeisocutvalues[j] < 1.0 )
-                {
-                  float relIso = etcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (12+j);
-                }
-              /**apply absolute topoetcone30 cut*/
-              /* topoetcone30 are bits 14 and 15 */
-              else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (12+j); 
-            }
-        }
-        /** let's compute the ptcone30 isolation of the photon */
-        if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone30))){
-          ATH_MSG_DEBUG( "No isolation ptcone30 defined" );
-        }
-        else{
-          /* ptcone30/pt are bits 20 and 21 */
-          for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
-            { 
-              /** apply ptcone30/pt cuts first */
-              if ( m_ptconeisocutvalues[j] < 1.0 ) 
-                {
-                  float relIso = ptcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (20+j);
-                }
-              /**apply absolute ptcone30 cut*/
-              /* ptcone30 are bits 22 and 23 */
-              else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (20+j);
-            }
-        }
-        /** let's compute the ptcone40 isolation of the photon */
-        if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone40))){
-          ATH_MSG_DEBUG( "No isolation ptcone40 defined" );
-        }
-        else{
-          /* ptcone30/pt are bits 28 and 29 */
-          for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
-            { 
-              /** apply ptcone40/pt cuts first */
-              if ( m_ptconeisocutvalues[j] < 1.0 ) 
-                {
-                  float relIso = ptcone;
-                  if ( elEt != 0.0 ) relIso = relIso/elEt;
-                  if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (28+j);
-                }
-              /**apply absolute ptcone40 cut*/
-              /* ptcone40 are bits 30 and 31 */
-              else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (28+j);
-            }
-        }
-
-        pTagColl.insert( m_isoStr[i], iso );
-        
-      }
-      
-      /** counter total number of accepted loose photons */
-      i++;
+    /** pt */
+    pTagColl.insert( m_ptStr[i], (*photonItr)->pt() );
+    
+    /** eta */
+    pTagColl.insert( m_etaStr[i], (*photonItr)->eta() );
+    
+    /** phi */
+    pTagColl.insert( m_phiStr[i], (*photonItr)->phi() );
+    
+    /** Retrieving tightness info from xAOD */
+    unsigned int tightness = 0x0;
+
+    bool isLoose = m_loose_cut_based->accept(*photonItr);
+    if (isLoose) tightness |= (1<<0);//loose
+    
+    bool isTight = m_tight_cut_based->accept(*photonItr);
+    if (isTight) tightness |= (1<<1);//tight
+    
+    /** Photon Object Quality*/
+    bool isGoodOQ = (*photonItr)->isGoodOQ(xAOD::EgammaParameters::BADCLUSPHOTON);
+    if (isGoodOQ) tightness |= (1<<2);
+    
+    bool passesEGammaAmbiTool = m_egamma_ambi_tool->accept( **photonItr );
+    if (passesEGammaAmbiTool) tightness |= (1<<3);
+
+    /**  Using Isolation Tool to fill bit from 4 to 6 with cone20,cone40,cone40caloonly*/
+    if(m_cone20_isolation->accept(**photonItr))      tightness |= (1 << 4);
+    if(m_cone40_isolation->accept(**photonItr))      tightness |= (1 << 5);
+    if(m_cone40_calo_isolation->accept(**photonItr)) tightness |= (1 << 6);
+    
+    if(m_fixedcut_tightcaloonly_isolation->accept(**photonItr))  tightness |= (1 << 7);
+    if(m_fixedcut_loose_isolation->accept(**photonItr))          tightness |= (1 << 8);
+    if(m_fixedcut_tight_isolation->accept(**photonItr))          tightness |= (1 << 9);
+    
+    pTagColl.insert( m_tightStr[i], tightness );
+    
+    /** test for converted photon - and set the conversion flag */
+    if ((*photonItr)->nVertices() != 0) nConverted++;
+    
+    /** Isolation of Photons */
+    
+    unsigned int iso = 0x0;
+    float elEt = (*photonItr)->pt();
+    float etcone = 0;
+    /** now start filling the isolation information */
+    
+    /** let's compute the etcone20 isolation of the photon */
+    if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::etcone20))){
+      ATH_MSG_DEBUG( "No etcone20 defined" );
+    }
+    else{
+      /* Etcone20/pt are bits 0 and 1 */
+      for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
+	{
+	  /** apply etcone20/pt cuts first */
+	  if ( m_etconeisocutvalues[j] < 1.0 )
+	    {
+	      float relIso = etcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << j;
+	    }
+	  /**apply absolute etconse20 cut*/
+	  /* Etcone20 are bits 2 and 3 */
+	  else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << j; 
+	}
     }
+    /** let's compute the topoetcone20 isolation of the photon */
+    if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone20))){
+      ATH_MSG_DEBUG( "No topoetcone20 defined" );
+    }
+    else{
+      /* TopoEtcone20/pt are bits 8 and 9 */
+      for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
+	{
+	  /** apply topoetcone20/pt cuts first */
+	  if ( m_etconeisocutvalues[j] < 1.0 )
+	    {
+	      float relIso = etcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (8+j);
+	    }
+	  /**apply absolute topoetcone20 cut*/
+	  /* TopoEtcone20 are bits 10 and 11 */
+	  else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (8+j);
+	}
+    }
+    /** let's compute the topoetcone40 isolation of the photon */
+    if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone40))){
+      ATH_MSG_DEBUG( "No isolation topoetcone40 defined" );
+    }
+    else{
+      /* TopoEtcone40/pt are bits 16 and 17 */
+      for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
+	{
+	  /** apply topoetcone40/pt cuts first */
+	  if ( m_etconeisocutvalues[j] < 1.0 )
+	    {
+	      float relIso = etcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (16+j);
+	    }
+	  /**apply absolute topoetcone40 cut*/
+	  /* TopoEtcone40 are bits 17 and 18 */
+	  else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (16+j); 
+	}
+    }
+    /** let's compute the ptcone20 isolation of the photon */
+    float ptcone =0;
+    if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone20))){
+      ATH_MSG_DEBUG( "No isolation ptcone20 defined" );
+    }
+    else{
+      /* ptcone20/pt are bits 24 and 25 */
+      for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
+	{
+	  /** apply ptcone20/pt cuts first */
+	  if ( m_ptconeisocutvalues[j] < 1.0 ) 
+	    {
+	      float relIso = ptcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (24+j);
+	    }
+	  /**apply absolute ptcone20 cut*/
+	  /* ptcone20 are bits 26 and 27 */
+	  else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (24+j);
+	}
+    }
+    /** let's compute the topoetcone30 isolation of the photon */
+    if(!((*photonItr)->isolationValue(etcone,xAOD::Iso::IsolationType::topoetcone30))){ 
+      ATH_MSG_DEBUG( "No isolation topoetcone30 defined" );
+    }
+    else{
+      /* topoEtcone30/pt are bits 12 and 13 */
+      for (unsigned int j=0; j<m_etconeisocutvalues.size(); j++)
+	{
+	  /** apply topoEtcone30/pt cuts first */
+	  if ( m_etconeisocutvalues[j] < 1.0 )
+	    {
+	      float relIso = etcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_etconeisocutvalues[j] ) iso |= 1 << (12+j);
+	    }
+	  /**apply absolute topoetcone30 cut*/
+	  /* topoetcone30 are bits 14 and 15 */
+	  else if ( etcone < m_etconeisocutvalues[j] ) iso |= 1 << (12+j); 
+	}
+    }
+    /** let's compute the ptcone30 isolation of the photon */
+    if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone30))){
+      ATH_MSG_DEBUG( "No isolation ptcone30 defined" );
+    }
+    else{
+      /* ptcone30/pt are bits 20 and 21 */
+      for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
+	{ 
+	  /** apply ptcone30/pt cuts first */
+	  if ( m_ptconeisocutvalues[j] < 1.0 ) 
+	    {
+	      float relIso = ptcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (20+j);
+	    }
+	  /**apply absolute ptcone30 cut*/
+	  /* ptcone30 are bits 22 and 23 */
+	  else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (20+j);
+	}
+    }
+    /** let's compute the ptcone40 isolation of the photon */
+    if(!((*photonItr)->isolationValue(ptcone,xAOD::Iso::IsolationType::ptcone40))){
+      ATH_MSG_DEBUG( "No isolation ptcone40 defined" );
+    }
+    else{
+      /* ptcone30/pt are bits 28 and 29 */
+      for (unsigned int j=0; j<m_ptconeisocutvalues.size(); j++)
+	{ 
+	  /** apply ptcone40/pt cuts first */
+	  if ( m_ptconeisocutvalues[j] < 1.0 ) 
+	    {
+	      float relIso = ptcone;
+	      if ( elEt != 0.0 ) relIso = relIso/elEt;
+	      if ( relIso < m_ptconeisocutvalues[j] ) iso |= 1 << (28+j);
+	    }
+	  /**apply absolute ptcone40 cut*/
+	  /* ptcone40 are bits 30 and 31 */
+	  else if ( ptcone < m_ptconeisocutvalues[j] ) iso |= 1 << (28+j);
+	}
+    }
+    
+    pTagColl.insert( m_isoStr[i], iso );
+    
   }
   
   /** insert the number of loose photons */
diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/CMakeLists.txt
index 325787bd1272f4783425fcb7ef7b0e92184f1549..caf9e4bf21891f1dc5f4011025085a800acb18cb 100644
--- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/CMakeLists.txt
+++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 788319 2016-12-07 01:04:30Z christos $
 ################################################################################
 # Package: IsolationCorrections
 ################################################################################
@@ -31,8 +30,8 @@ atlas_depends_on_subdirs(
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Hist RIO )
+find_package( Boost )
 
-# Component(s) in the package:
 atlas_add_library( IsolationCorrectionsLib
    IsolationCorrections/*.h Root/*.cxx
    PUBLIC_HEADERS IsolationCorrections
diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx
index e4d9f02a30203f930e1c7e63a2a0b7e5768d5ac7..225f4810d9678214fddb2f7c5b3d02849123e503 100644
--- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrectionTool.cxx
@@ -10,11 +10,11 @@
 #include "xAODMetaData/FileMetaData.h"
 #include "PATInterfaces/SystematicRegistry.h"
 #include "PathResolver/PathResolver.h"
+#include <boost/algorithm/string.hpp>
 
 #ifndef ROOTCORE
 #include "AthAnalysisBaseComps/AthAnalysisHelper.h"
 #include "AthAnalysisBaseComps/AthAnalysisAlgorithm.h"
-#include <boost/algorithm/string.hpp>
 #endif //ROOTCORE
 
 namespace CP {
@@ -43,23 +43,23 @@ namespace CP {
 
     //
     // Resolve the paths to the input files
-    std::vector < std::string > m_corrFileNameList;
-    m_corrFileNameList.push_back(m_corr_file);
-    m_corrFileNameList.push_back(m_corr_ddshift_2015_file);
-    m_corrFileNameList.push_back(m_corr_ddshift_file);
-    m_corrFileNameList.push_back(m_corr_ddsmearing_file);
+    std::vector < std::string > corrFileNameList;
+    corrFileNameList.push_back(m_corr_file);
+    corrFileNameList.push_back(m_corr_ddshift_2015_file);
+    corrFileNameList.push_back(m_corr_ddshift_file);
+    corrFileNameList.push_back(m_corr_ddsmearing_file);
 
-    for ( unsigned int i=0; i<m_corrFileNameList.size(); ++i ){
+    for ( unsigned int i=0; i<corrFileNameList.size(); ++i ){
       
       //First try the PathResolver
-      std::string filename = PathResolverFindCalibFile( m_corrFileNameList.at(i) );
+      std::string filename = PathResolverFindCalibFile( corrFileNameList.at(i) );
       if (filename.empty()){
-	ATH_MSG_ERROR ( "Could NOT resolve file name " << m_corrFileNameList.at(i) );
+	ATH_MSG_ERROR ( "Could NOT resolve file name " << corrFileNameList.at(i) );
 	return StatusCode::FAILURE ;
       } else{
 	ATH_MSG_INFO(" Path found = "<<filename);
       }
-      m_corrFileNameList.at(i) = filename;	
+      corrFileNameList.at(i) = filename;	
     }
     //
 
@@ -75,12 +75,12 @@ namespace CP {
       return StatusCode::FAILURE;
     }
 
-    if(TString(m_corrFileNameList[0]).Contains("isolation_ptcorrections_rel17_2.root") && m_tool_ver_str != "REL17_2"){
+    if(TString(corrFileNameList[0]).Contains("isolation_ptcorrections_rel17_2.root") && m_tool_ver_str != "REL17_2"){
       ATH_MSG_WARNING("The specified correction file is not for "<<m_tool_ver_str<<" please use proper correction file");
       return StatusCode::FAILURE;
     }
 
-    if(TString(m_corrFileNameList[0]).Contains("isolation_ptcorrections_rel20_2.root") && m_tool_ver_str != "REL20_2"){
+    if(TString(corrFileNameList[0]).Contains("isolation_ptcorrections_rel20_2.root") && m_tool_ver_str != "REL20_2"){
       ATH_MSG_WARNING("The specified correction file is not for "<<m_tool_ver_str<<" please use proper correction file");
       return StatusCode::FAILURE;
     }
@@ -120,6 +120,8 @@ namespace CP {
 
     //default result
     result = PATCore::ParticleDataType::Data;
+    //
+    std::string simType("");
     
 #ifndef ROOTCORE
     //Athena environent
@@ -137,7 +139,6 @@ namespace CP {
     //
     //if not data  determine Fast/FullSim
     ATH_MSG_DEBUG("IS_SIMULATION");
-    std::string simType("");
     if( AthAnalysisHelper::retrieveMetadata("/Simulation/Parameters", "SimulationFlavour", simType, inputMetaStore()).isFailure() ) {
       return StatusCode::FAILURE;    
     }
@@ -147,6 +148,7 @@ namespace CP {
       return StatusCode::SUCCESS;
     }
 #endif    
+
     //Here is the RootCore or to be dual use , assumes we have not returned before for Athena
     std::string simulationType("");
     if (!inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
@@ -157,11 +159,12 @@ namespace CP {
     //
     const bool s = fmd->value(xAOD::FileMetaData::simFlavour, simulationType);
     if (!s) { 
-      //no simFlavour metadata failure
+      ATH_MSG_DEBUG("no sim flavour from metadata: must be data");
       return StatusCode::FAILURE;    
     }
     else {
-      result = (simulationType == "FullSim" ? PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast);
+      boost::to_upper(simType);
+      result = (simType.find("ATLFASTII")==std::string::npos) ?  PATCore::ParticleDataType::Full : PATCore::ParticleDataType::Fast;
       return StatusCode::SUCCESS;    
     }
     //
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a1c24c78b8269e50fef166abf7fbd3254a5bf33f
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/CMakeLists.txt
@@ -0,0 +1,71 @@
+
+# The name of the package:
+atlas_subdir( PhotonEfficiencyCorrection )
+
+# Extra dependencies based on the build environment:
+set( extra_deps )
+if( XAOD_STANDALONE )
+   set( extra_deps Control/xAODRootAccess )
+else()
+   set( extra_deps Control/AthenaBaseComps GaudiKernel )
+endif()
+
+# Dependencies of the package:
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   PhysicsAnalysis/AnalysisCommon/PATCore
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces
+   PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces	
+   PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection
+   PRIVATE
+   Event/xAOD/xAODCore
+   Event/xAOD/xAODEventInfo
+   Tools/PathResolver
+   ${extra_deps} )
+
+# External(s) for the package:
+find_package( Boost COMPONENTS filesystem )
+find_package( ROOT COMPONENTS Core Hist RIO MathCore )
+
+# Libraries in the package:
+atlas_add_library( PhotonEfficiencyCorrectionLib
+   PhotonEfficiencyCorrection/*.h Root/*.cxx
+   PUBLIC_HEADERS PhotonEfficiencyCorrection
+   INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES} EgammaAnalysisInterfacesLib AsgTools xAODEgamma
+   PATCoreLib PATInterfaces ElectronEfficiencyCorrectionLib
+   PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( PhotonEfficiencyCorrection
+      src/*.h src/*.cxx src/components/*.cxx
+      LINK_LIBRARIES AthenaBaseComps GaudiKernel xAODEventInfo xAODEgamma
+      xAODCore PhotonEfficiencyCorrectionLib )
+endif()
+
+atlas_add_dictionary( PhotonEfficiencyCorrectionDict
+   PhotonEfficiencyCorrection/PhotonEfficiencyCorrectionDict.h
+   PhotonEfficiencyCorrection/selection.xml
+   LINK_LIBRARIES PhotonEfficiencyCorrectionLib )
+
+# Executable(s) in the package:
+atlas_add_executable( PrintPhotonSF
+   util/PrintPhotonSF.cxx
+   INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES}
+   PhotonEfficiencyCorrectionLib )
+
+if( XAOD_STANDALONE )
+   atlas_add_executable( TestxAODPhotonAlg
+      util/TestxAODPhotonAlg.cxx
+      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+      LINK_LIBRARIES ${ROOT_LIBRARIES} xAODRootAccess xAODEventInfo xAODEgamma
+      xAODCore PathResolver PATInterfaces PhotonEfficiencyCorrectionLib )
+endif()
+
+# Install files from the package:
+atlas_install_joboptions( share/*.py )
+#atlas_install_data( data/*.root )
+atlas_install_data( data/*.root data/*.txt )
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..df0d569eafd298770cb230c1a21b85e56c12c6f2
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h
@@ -0,0 +1,158 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef __ASGPHOTONEFFICIENCYCORRECTIONTOOL__
+#define __ASGPHOTONEFFICIENCYCORRECTIONTOOL__
+
+/**
+   @class AthPhotonEfficiencyCorrectionTool
+   @brief Calculate the egamma scale factors in Athena
+
+   @author Rob Roy Fletcher, Karsten Koeneke, Michael Pitt, Giovanni Marchiori
+   @date   August 2014
+*/
+
+// STL includes
+#include <vector>
+#include <string>
+#include <fstream>      // std::ifstream
+
+// Utility includes
+#include "boost/unordered_map.hpp"
+#include "boost/algorithm/string.hpp" // this one to replace std::string names
+
+// Include the return object and the underlying ROOT tool
+#include "PATCore/TResult.h"
+
+//xAOD includes
+#include "AsgTools/AsgTool.h"
+#include "PATInterfaces/ISystematicsTool.h"
+#include "PATInterfaces/SystematicRegistry.h"
+#include "PATInterfaces/CorrectionCode.h"
+#include "PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h"
+
+#include "xAODEgamma/Egamma.h"
+
+
+
+
+class AsgPhotonEfficiencyCorrectionTool
+  : virtual public IAsgPhotonEfficiencyCorrectionTool,
+    virtual public CP::ISystematicsTool,
+            public asg::AsgTool
+{
+  ASG_TOOL_CLASS2(AsgPhotonEfficiencyCorrectionTool, IAsgPhotonEfficiencyCorrectionTool, CP::ISystematicsTool )
+
+public:
+  /// Standard constructor
+  AsgPhotonEfficiencyCorrectionTool ( const std::string myname );
+
+  /// Standard destructor
+  virtual ~AsgPhotonEfficiencyCorrectionTool();
+
+
+public:
+  /// Gaudi Service Interface method implementations
+  virtual StatusCode initialize();
+
+  /// Gaudi Service Interface method implementations
+  virtual StatusCode finalize();
+
+
+  // Main methods from IUserDataCalcTool
+public:
+  /// The main calculate method: the actual correction factors are determined here
+  const Root::TResult& calculate( const xAOD::IParticle* part ) const;
+  const Root::TResult& calculate( const xAOD::Egamma* egam ) const;
+  const Root::TResult& calculate( const xAOD::Egamma& egam ) const{  
+ 		    return calculate(&egam);} // pass the Egamma obj by reference
+
+  ///Add some method for now as a first step to move the tool to then new interface 
+  virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Egamma& inputObject, double& efficiencyScaleFactor) const;
+  virtual CP::CorrectionCode getEfficiencyScaleFactorError(const xAOD::Egamma& inputObject, double& efficiencyScaleFactorError) const;
+  virtual CP::CorrectionCode applyEfficiencyScaleFactor(xAOD::Egamma& inputObject) const;
+
+  ///The methods below should notify the user of what is actually in the list , without him having to go in the wiki
+
+  /// returns: whether this tool is affected by the given systematic
+  virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const;
+  
+  /// returns: the list of all systematics this tool can be affected by
+  virtual CP::SystematicSet affectingSystematics() const ;
+  
+  /// returns: the list of all systematics this tool recommends to use
+  virtual CP::SystematicSet recommendedSystematics() const ;
+  
+  /// returns: the currently applied systematics
+  const CP::SystematicSet& appliedSystematics() const {
+    assert (m_appliedSystematics != nullptr);
+    return *m_appliedSystematics;
+  }
+  
+  /// Configure this tool for the given systematics
+  virtual CP::SystematicCode applySystematicVariation ( const CP::SystematicSet& systConfig );
+
+  CP::SystematicCode registerSystematics();
+
+  // Private member variables
+private:
+  /// Pointer to the underlying ROOT based tool
+  Root::TPhotonEfficiencyCorrectionTool* m_rootTool_unc;
+  Root::TPhotonEfficiencyCorrectionTool* m_rootTool_con;
+  /// additional pointers for ISO SF using RadZ decays
+  Root::TPhotonEfficiencyCorrectionTool* m_rootTool_uncRadZ;
+  Root::TPhotonEfficiencyCorrectionTool* m_rootTool_conRadZ;
+  
+  /// A dummy return TResult object
+  Root::TResult m_resultDummy;
+
+  /// Systematics filter map
+  boost::unordered_map<CP::SystematicSet, CP::SystematicSet> m_systFilter;
+  
+  /// Currently applied systematics
+  CP::SystematicSet* m_appliedSystematics = nullptr;
+  
+  // The prefix for the systematic name
+  std::string m_sysSubstring;
+  std::string m_sysSubstringRadZ;
+  
+  // Get the correction filename from the map
+  std::string getFileName(std::string isoWP, bool isConv, std::string sufix);
+  
+  // Properties
+  
+  /// The list of input file names
+  std::string m_corrFileNameConv;
+  std::string m_corrFileNameUnconv;
+ 
+  /// The prefix string for the result
+  std::string m_resultPrefix;
+
+  /// The string for the result
+  std::string m_resultName;
+
+  /// Force the data type to a given value
+  int m_dataTypeOverwrite;
+  
+  /// Isolation working point
+  std::string m_isoWP;
+  
+  /// map filename
+  std::string m_mapFile;  
+  
+  /// photonPT threshold for different isolation menus
+  float m_Threshold_lowPT;
+  float m_Threshold_highPT;
+  bool  m_UseRadZ_mediumPT;
+
+
+
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/IAsgPhotonEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/IAsgPhotonEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..dcf194cde6ce4e444e7b97e817234f889a32a846
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/IAsgPhotonEfficiencyCorrectionTool.h
@@ -0,0 +1,13 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+//IAsgPhotonEfficiencyCorrection.h to be used in the tool.
+#ifndef __IASGPHOTONEFFICIENCYCORRECTION__
+#define __IASGPHOTONEFFICIENCYCORRECTION__
+
+#include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h"
+#pragma message "In the process of moving the Interface part under PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces"
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/PhotonEfficiencyCorrectionDict.h b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/PhotonEfficiencyCorrectionDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..5dce4590a645117a504e011dc7ae6cfe29436f80
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/PhotonEfficiencyCorrectionDict.h
@@ -0,0 +1,20 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef __PHOTONEFFICIENCYCORRECTIONDICT__
+#define __PHOTONEFFICIENCYCORRECTIONDICT__
+
+/**
+   @brief For dictionary generation.
+
+   @author Karsten Koeneke (CERN)
+   @date   July 2011
+
+*/
+
+#include "PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h"
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..17153a98157cab033b2bace8f5ceb1a1997d609e
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h
@@ -0,0 +1,54 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef __TPHOTONEFFICIENCYCORRECTIONTOOL__
+#define __TPHOTONEFFICIENCYCORRECTIONTOOL__
+
+/**
+   @class TPhotonEfficiencyCorrectionTool
+   @brief Calculate the egamma scale factors in pure ROOT, inherit the structure from TElectronEfficiencyCorrection tool
+   For each photon type declare a tool and use addFileName to add root files containing scale factors for this specific type. 
+   After adding root files call initialize()
+   In the event loop use calculate(const PATCore::ParticleDataType::DataType dataType, const unsigned int runnumber, const double cluster_eta, const double et)
+   This returns a TResult. The scale factor and its uncertainty are obtained by calling getScaleFactor() or getTotalUncertainty (See header file of TResult in package PATCore)
+   For a short documentation see the included README file
+
+   @author Karsten Koeneke, Felix Buehrer,  Michael Pitt
+   @date   January 2014
+*/
+
+
+#include <sstream>
+
+// STL includes
+#include <vector>
+#include <string>
+
+// ROOT includes
+#include <TString.h>
+#include "TKey.h"
+#include "TObjArray.h"
+#include "TH1.h"
+#include "TH2.h"
+#include "TRandom3.h"
+
+// Include the return object and the base class
+#include "PATCore/TResult.h"
+#include "PATCore/TCalculatorToolBase.h"
+#include "PATCore/PATCoreEnums.h"
+#include "ElectronEfficiencyCorrection/TElectronEfficiencyCorrectionTool.h"
+
+namespace Root {
+    class TPhotonEfficiencyCorrectionTool : public Root::TElectronEfficiencyCorrectionTool{
+  
+    // Public methods
+    public:
+	  double GetIsoSyst(bool isConv, double eta, int isolationcut);  
+
+    };
+   
+} // End: namespace Root
+
+#endif
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/selection.xml b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6b6f10e07b36494e5ae97085dfcd5901c10b748b
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/PhotonEfficiencyCorrection/selection.xml
@@ -0,0 +1,3 @@
+<lcgdict>
+    <class name="AsgPhotonEfficiencyCorrectionTool" />
+</lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/README b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/README
new file mode 100644
index 0000000000000000000000000000000000000000..424e376f43bfb3474c093729d7b7f176610d4c54
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/README
@@ -0,0 +1,25 @@
+This is a short README of the TPhotonEfficiencyCorrection class, this class inherit structure from TElectronEfficiencyCorrection tool.
+
+@author Felix Buehrer felix.buehrer@cern.ch (TElectronEfficiencyCorrection)
+@author Giovanni Marchiori Giovanni.Marchiori@cern.ch (TPhotonEfficiencyCorrection)
+@author Michael Pitt Michael.Pitt@cern.ch (TPhotonEfficiencyCorrection)
+@date July 2015
+========================
+
+TPhotonEfficiencyCorrection - class to retrieve the photon scale factors
+
+Up-to-date information about the tool. can be found on its dedicated twiki page:
+runI:
+https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PhotonEfficiencyCorrection
+runII:
+https://twiki.cern.ch/twiki/bin/view/AtlasProtected/PhotonEfficiencyRun2
+https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/IsolationSF2016DS1
+
+In case you feel that some piece of information is missing, please feel free to contact the authors (Giovanni.Marchiori@cern.ch,Michael.Pitt@cern.ch).
+
+#example in ROOT:
+rcSetup -f Base,2.4.27; rc compile
+to test on a AOD file run
+TestxAODPhotonTool [filename]
+to test the output of the input files (stored in the CalibArea) run
+PrintPhotonSF [input]
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/AsgPhotonEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/AsgPhotonEfficiencyCorrectionTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..fbbd9b01f83061dd972516f2e829e090c1363117
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/AsgPhotonEfficiencyCorrectionTool.cxx
@@ -0,0 +1,512 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+   @class AthPhotonEfficiencyCorrectionTool
+   @brief Calculate the photon scale factors in Athena
+
+   @author Rob Roy Fletcher <rob.fletcher@cern.ch>, Karsten Koeneke, Michael Pitt
+   @date   August 2014
+*/
+
+// Include this class's header
+#include "PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h"
+
+// STL includes
+#include <string>
+#include <cfloat>
+//#include <climits>
+#include <iostream>
+#include <limits.h>
+
+// Include the return object
+#include "PATCore/TResult.h"
+#include "PATCore/PATCoreEnums.h"
+
+// xAOD includes
+#include "xAODEgamma/Egamma.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "PathResolver/PathResolver.h"
+
+
+// ROOT includes
+#include "TSystem.h"
+
+#define MAXETA 2.47
+#define MIN_ET 10000.0
+#define MIN_ET_OF_SF 10000.0
+#define MIN_ET_Iso_SF 10000.0
+#define MAX_ET_OF_SF 2999999.9
+
+// =============================================================================
+// Standard constructor
+// =============================================================================
+AsgPhotonEfficiencyCorrectionTool::AsgPhotonEfficiencyCorrectionTool( std::string myname ) : 
+  AsgTool(myname),
+  m_rootTool_unc(0),
+  m_rootTool_con(0),
+  m_rootTool_uncRadZ(0),
+  m_rootTool_conRadZ(0),  
+  m_appliedSystematics(0),
+  m_sysSubstring(""),
+  m_sysSubstringRadZ("")
+{
+
+  // Create an instances of the underlying ROOT tools
+  m_rootTool_unc = new Root::TPhotonEfficiencyCorrectionTool();
+  m_rootTool_con = new Root::TPhotonEfficiencyCorrectionTool();
+  m_rootTool_uncRadZ = new Root::TPhotonEfficiencyCorrectionTool();
+  m_rootTool_conRadZ = new Root::TPhotonEfficiencyCorrectionTool();
+
+  // Declare the needed properties
+  declareProperty( "CorrectionFileNameConv", m_corrFileNameConv="",
+                   "File that stores the correction factors for simulation for converted photons");
+
+  declareProperty( "CorrectionFileNameUnconv", m_corrFileNameUnconv="",
+                   "File that stores the correction factors for simulation for unconverted photons");
+				   
+  declareProperty("MapFilePath", m_mapFile = "" ,
+                  "Full path to the map file");  
+				  
+  declareProperty( "ForceDataType", m_dataTypeOverwrite=-1,
+                   "Force the DataType of the Photon to specified value");
+
+  declareProperty( "ResultPrefix",       m_resultPrefix="", "The prefix string for the result");
+  declareProperty( "ResultName",         m_resultName="",   "The string for the result");
+  
+  // Properties needed for isolation corrections
+  declareProperty( "IsoWP",         m_isoWP="",   "Set isolation WP, if this string is empty the tool will return ID SF");
+  declareProperty( "Threshold_lowPT",         m_Threshold_lowPT=25.0,    "low pT threshold for ISO SF(default=25)");
+  declareProperty( "Threshold_highPT",        m_Threshold_highPT=100.0,   "high pT threshold for ISO SF (default=100)");
+  declareProperty( "UseRadiativeZSF_mediumPT",m_UseRadZ_mediumPT=false,   "use RadZ derived SF (default=true)");
+
+}
+
+// =============================================================================
+// Standard destructor
+// =============================================================================
+AsgPhotonEfficiencyCorrectionTool::~AsgPhotonEfficiencyCorrectionTool()
+{
+  if(finalize().isFailure()){
+    ATH_MSG_ERROR ( "Failure in AsgPhotonEfficiencyCorrectionTool finalize()");
+  }
+
+  if ( m_rootTool_unc ) delete m_rootTool_unc;
+  if ( m_rootTool_con ) delete m_rootTool_con;
+  if ( m_rootTool_uncRadZ ) delete m_rootTool_uncRadZ;
+  if ( m_rootTool_conRadZ ) delete m_rootTool_conRadZ;  
+}
+
+// =============================================================================
+// Athena initialize method
+// =============================================================================
+StatusCode AsgPhotonEfficiencyCorrectionTool::initialize()
+{
+  // Resolve the paths to the input files
+  std::vector < std::string > m_corrFileNameList;
+
+  // First check if the tool is initialized using the input files or map
+  if(m_mapFile.size()){ // using map file
+     m_corrFileNameList.push_back(getFileName(m_isoWP,true,""));	// converted photons input
+	 m_corrFileNameList.push_back(getFileName(m_isoWP,false,""));  // unconverted photons input
+	// if isolation SF are initialized, then read RadZ inputs:
+	if(m_isoWP.size()){
+     m_corrFileNameList.push_back(getFileName(m_isoWP,true,"_RadZ"));	// converted photons input
+	 m_corrFileNameList.push_back(getFileName(m_isoWP,false,"_RadZ"));  // unconverted photons input	
+	}
+  }
+  else if(m_corrFileNameConv.size() && m_corrFileNameUnconv.size()){ // initialize the tool using input files (old scheme)
+  	m_corrFileNameList.push_back(m_corrFileNameConv);
+	m_corrFileNameList.push_back(m_corrFileNameUnconv);
+  }
+  else{
+      ATH_MSG_ERROR ( "Fail to resolve input file name, check if you set MapFilePath or CorrectionFileName properly" );
+      return StatusCode::FAILURE ; 
+  }
+
+  // once the input files are retrieved, update the path using PathResolver or TOOL/data folder
+  for ( unsigned int i=0; i<m_corrFileNameList.size(); ++i ){
+
+    //First try the PathResolver
+    std::string filename = PathResolverFindCalibFile( m_corrFileNameList.at(i) );
+
+    // ROOTCore: Data folder
+    char *rootCoreArea = getenv("ROOTCOREBIN");
+    if(filename.empty() && rootCoreArea != NULL){
+      filename = std::string(rootCoreArea) + "/data/"+ m_corrFileNameList.at(i);
+    }  
+
+    if (filename.empty()){
+      ATH_MSG_ERROR ( "Could NOT resolve file name " << m_corrFileNameList.at(i) );
+      return StatusCode::FAILURE ;
+    } else{
+      ATH_MSG_INFO(" Path found = "<<filename);
+    }
+
+    m_corrFileNameList.at(i) = filename;
+
+  }
+   
+  // Set prefix for sustematics if this is ISO or ID SF
+  if( m_corrFileNameList[0].find("offline.Tight") != std::string::npos) m_sysSubstring="ID_";
+  if( m_corrFileNameList[0].find("Isolation.isolFixedCut") != std::string::npos) {m_sysSubstring="TRKISO_"; m_sysSubstringRadZ="LOWPTISO_";}
+  if(m_sysSubstring == "") {ATH_MSG_ERROR ( "Invalid input file" ); return StatusCode::FAILURE;}
+
+  // Configure the underlying Root tool
+  m_rootTool_con->addFileName( m_corrFileNameList[0] );
+  m_rootTool_unc->addFileName( m_corrFileNameList[1] );
+
+  m_rootTool_con->setResultPrefix( m_resultPrefix );
+  m_rootTool_con->setResultName( m_resultName );
+  m_rootTool_unc->setResultPrefix( m_resultPrefix );
+  m_rootTool_unc->setResultName( m_resultName );  
+  
+  // Forward the message level
+  m_rootTool_con->msg().setLevel(this->msg().level());
+  m_rootTool_unc->msg().setLevel(this->msg().level());
+
+  
+  // Check if ForceDataType is set up properly (should be 3 for AtlFast2)
+  if(TString(m_corrFileNameList[0]).Contains("AFII") && m_dataTypeOverwrite!=3)
+  {
+      ATH_MSG_ERROR("Property ForceDataType is set to "<< m_dataTypeOverwrite << ", while it should be 3 for FastSim");
+      return StatusCode::FAILURE;
+  }
+  if(!TString(m_corrFileNameList[0]).Contains("AFII") && m_dataTypeOverwrite!=1)
+  {
+      ATH_MSG_ERROR("Property ForceDataType is set to "<< m_dataTypeOverwrite << ", while it should be 1 for FullSim");
+      return StatusCode::FAILURE;
+  }  
+  
+  // We need to initialize the underlying ROOT TSelectorTool
+  if ( (0 == m_rootTool_con->initialize()) || (0 == m_rootTool_unc->initialize()) )
+    {
+      ATH_MSG_ERROR("Could not initialize the TPhotonEfficiencyCorrectionTool!");
+      return StatusCode::FAILURE;
+    }
+  
+  // For isolation SF initialize additional instances for lowPT photons
+  if(m_isoWP.size()){
+    m_rootTool_conRadZ->addFileName( m_corrFileNameList[2] );
+    m_rootTool_uncRadZ->addFileName( m_corrFileNameList[3] ); 
+    m_rootTool_conRadZ->setResultPrefix( m_resultPrefix );
+    m_rootTool_conRadZ->setResultName( m_resultName );
+    m_rootTool_uncRadZ->setResultPrefix( m_resultPrefix );
+    m_rootTool_uncRadZ->setResultName( m_resultName );  
+    m_rootTool_conRadZ->msg().setLevel(this->msg().level());
+    m_rootTool_uncRadZ->msg().setLevel(this->msg().level());
+    if ( (0 == m_rootTool_conRadZ->initialize()) || (0 == m_rootTool_uncRadZ->initialize()) )
+    {
+      ATH_MSG_ERROR("Could not initialize the TPhotonEfficiencyCorrectionTool!");
+      return StatusCode::FAILURE;
+    }
+  }
+
+  // Copy the now filled TResult to the dummy
+  m_resultDummy = m_rootTool_con->getTResult();  // do only for converted photons instance
+
+  // Add the recommended systematics to the registry
+  if ( registerSystematics() != CP::SystematicCode::Ok) {
+    return StatusCode::FAILURE;
+  }
+  
+  return StatusCode::SUCCESS ;
+}
+
+
+// =============================================================================
+// Athena finalize method
+// =============================================================================
+StatusCode AsgPhotonEfficiencyCorrectionTool::finalize()
+{
+  if ( !(m_rootTool_con->finalize()) || !(m_rootTool_unc->finalize()) )
+    {
+      ATH_MSG_ERROR("Something went wrong at finalize!");
+      return StatusCode::FAILURE;
+    }
+  // finilize instances in case of IsolationSF	
+  if(m_isoWP.size()){
+    if ( !(m_rootTool_conRadZ->finalize()) || !(m_rootTool_uncRadZ->finalize()) )
+    {
+      ATH_MSG_ERROR("Something went wrong at finalize!");
+      return StatusCode::FAILURE;
+    }
+  }  
+
+  return StatusCode::SUCCESS ;
+}
+
+
+// =============================================================================
+// The main accept method: the actual cuts are applied here 
+// =============================================================================
+const Root::TResult& AsgPhotonEfficiencyCorrectionTool::calculate( const xAOD::Egamma* egam ) const
+{
+  if ( !egam )
+    {
+      ATH_MSG_ERROR ( "Did NOT get a valid egamma pointer!" );
+      return m_resultDummy;
+    }
+  
+  // Get the run number 
+  const xAOD::EventInfo* eventInfo = evtStore()->retrieve< const xAOD::EventInfo> ("EventInfo");
+  if(!eventInfo){
+    ATH_MSG_ERROR ( "Could not retrieve EventInfo object!" );
+    return m_resultDummy;
+  }
+  const unsigned int runnumber = eventInfo->runNumber();
+
+  // Get the needed values (et, etas2, conv. flag) from the egamma object
+  
+  // check if converted
+  bool isConv=xAOD::EgammaHelpers::isConvertedPhoton(egam);
+
+  // retrieve transvrse energy from e/cosh(etaS2)
+  const xAOD::CaloCluster* cluster  = egam->caloCluster(); 
+  double eta2   = fabsf(cluster->etaBE(2));
+  double et = egam->pt();
+  	
+  // Check if photon in the range to get the SF
+  if(eta2>MAXETA) {
+	ATH_MSG_WARNING( "No correction factor provided for eta "<<cluster->etaBE(2)<<" Returning SF = 1 + / - 1");
+	return m_resultDummy;
+  }
+  if(et<MIN_ET_OF_SF && m_sysSubstring=="ID_") {
+	ATH_MSG_WARNING( "No ID scale factor uncertainty provided for et "<<et/1e3<<"GeV Returning SF = 1 + / - 1");
+	return m_resultDummy;
+  } 
+  if(m_sysSubstring=="TRKISO_" && et<MIN_ET_Iso_SF) {
+	ATH_MSG_WARNING( "No isolation scale factor uncertainty provided for et "<<et/1e3<<"GeV Returning SF = 1 + / - 1");
+	return m_resultDummy;
+  }   
+  if(et>MAX_ET_OF_SF) {
+	ATH_MSG_WARNING( "No scale factor provided for et "<<et/1e3<<"GeV Returning SF for "<<MAX_ET_OF_SF/1e3<<"GeV");
+	et=MAX_ET_OF_SF;
+  }   
+  
+  // Get the DataType of the current egamma object
+//!  PATCore::ParticleDataType::DataType dataType = (PATCore::ParticleDataType::DataType) (egam->dataType());
+//!  ATH_MSG_VERBOSE( "The egamma object with author=" << egam->author()
+//!                   << " has PATCore::ParticleDataType::DataType=" << dataType
+//!                   << " and EventKernel::ParticleDataType::DataType=" << egam->dataType() );
+  /* For now the dataType must be set by the user. May be added to the IParticle class later.  */
+  // probably event info should be able to tell us if it's data, fullsim, AF,..
+  PATCore::ParticleDataType::DataType dataType = PATCore::ParticleDataType::DataType::Data;
+  if ( m_dataTypeOverwrite >= 0 ) dataType = (PATCore::ParticleDataType::DataType)m_dataTypeOverwrite;
+
+  // Call the ROOT tool to get an answer, check if the SF is for isolation or ID
+  if(m_isoWP.size()){
+    double RadZ_ptcut = m_UseRadZ_mediumPT ? m_Threshold_highPT : m_Threshold_lowPT;
+    if(et<RadZ_ptcut*1e3)
+	  return isConv ? m_rootTool_conRadZ->calculate( dataType,runnumber,eta2,et /* in MeV */) : m_rootTool_uncRadZ->calculate( dataType,runnumber,eta2,et /* in MeV */);
+	else
+	  return isConv ? m_rootTool_con->calculate( dataType,runnumber,eta2,et /* in MeV */) : m_rootTool_unc->calculate( dataType,runnumber,eta2,et /* in MeV */);
+  }
+  return isConv ? m_rootTool_con->calculate( dataType,runnumber,eta2,et /* in MeV */) : m_rootTool_unc->calculate( dataType,runnumber,eta2,et /* in MeV */);
+  
+}
+
+const Root::TResult& AsgPhotonEfficiencyCorrectionTool::calculate( const xAOD::IParticle *part ) const
+{
+  const xAOD::Egamma* egam = dynamic_cast<const xAOD::Egamma*>(part);
+  if ( egam )
+    {
+      return calculate(egam);
+    } 
+  else
+    {
+      ATH_MSG_ERROR ( " Could not cast to const egamma pointer!" );
+      return m_resultDummy;
+    }
+}
+
+CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Egamma& inputObject, double& efficiencyScaleFactor) const{
+   
+  // if not in the range: return OutOfVelidityRange with SF = 1 +/- 1
+  if(fabs((inputObject.caloCluster())->etaBE(2))>MAXETA || inputObject.pt()<MIN_ET){
+    efficiencyScaleFactor=1;
+    if(m_appliedSystematics!=nullptr) efficiencyScaleFactor+=appliedSystematics().getParameterByBaseName("PH_EFF_"+m_sysSubstring+"Uncertainty");
+	return CP::CorrectionCode::OutOfValidityRange;
+  }
+  
+  if(m_appliedSystematics==nullptr){
+    efficiencyScaleFactor=calculate(&inputObject).getScaleFactor();
+    return  CP::CorrectionCode::Ok;
+  }
+  
+  //Get the result + the uncertainty
+  float m_sigma(0);
+  // will check if it isolation SF and if it correspong to low or high PT
+  if(m_isoWP.size() && (inputObject.pt()<((m_UseRadZ_mediumPT ? m_Threshold_highPT : m_Threshold_lowPT)*1e3)))
+    m_sigma=appliedSystematics().getParameterByBaseName("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty");
+  else
+    m_sigma=appliedSystematics().getParameterByBaseName("PH_EFF_"+m_sysSubstring+"Uncertainty");
+  efficiencyScaleFactor=calculate(&inputObject).getScaleFactor()+m_sigma*calculate(&inputObject).getTotalUncertainty();
+  return  CP::CorrectionCode::Ok;
+}
+
+CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactorError(const xAOD::Egamma& inputObject, double& efficiencyScaleFactorError) const{   
+
+  // if not in the range: return OutOfVelidityRange with SF = 1 +/- 1
+  if(fabs((inputObject.caloCluster())->etaBE(2))>MAXETA || inputObject.pt()<MIN_ET){
+    efficiencyScaleFactorError=1;
+	return CP::CorrectionCode::OutOfValidityRange;
+  }
+  
+  efficiencyScaleFactorError=calculate(&inputObject).getTotalUncertainty();
+  return  CP::CorrectionCode::Ok;
+}
+
+CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::applyEfficiencyScaleFactor(xAOD::Egamma& inputObject) const {
+   
+  // if not in the range: return OutOfVelidityRange with SF = 1 +/- 1
+  if(fabs((inputObject.caloCluster())->etaBE(2))>MAXETA || inputObject.pt()<MIN_ET){
+    ATH_MSG_INFO("decorate object");
+	inputObject.auxdata< float >( m_resultPrefix+m_resultName+"SF" ) = 1.0;
+	if(m_appliedSystematics != nullptr) inputObject.auxdata< float >( m_resultPrefix+m_resultName+"SF" ) =1.0 + appliedSystematics().getParameterByBaseName("PH_EFF_"+m_sysSubstring+"Uncertainty");
+	return CP::CorrectionCode::OutOfValidityRange;
+  }
+  
+  float eff;
+  if(m_appliedSystematics==nullptr) eff  = calculate(&inputObject).getScaleFactor();
+  else{ // if SF is up or down varies by m_sigma
+    float m_sigma(0);
+	m_sigma=appliedSystematics().getParameterByBaseName("PH_EFF_"+m_sysSubstring+"Uncertainty");
+	eff=calculate(&inputObject).getScaleFactor()+m_sigma*calculate(&inputObject).getTotalUncertainty();
+  }
+  // decorate photon
+  ATH_MSG_INFO("decorate object");
+  inputObject.auxdata< float >( m_resultPrefix+m_resultName+"SF" ) = eff;
+  return  CP::CorrectionCode::Ok;
+}
+
+//=======================================================================
+//   Systematics Interface
+//=======================================================================
+bool AsgPhotonEfficiencyCorrectionTool::isAffectedBySystematic( const CP::SystematicVariation& systematic ) const {
+	if(!systematic.empty()){
+		CP::SystematicSet sys = affectingSystematics();
+		return sys.find(systematic) != sys.end();
+	}
+	return true;
+}
+
+
+/// returns: the list of all systematics this tool can be affected by (for now keep +-1 sigma variation, but ignore it later in applySystematicVariation() )
+CP::SystematicSet AsgPhotonEfficiencyCorrectionTool::affectingSystematics() const {
+  CP::SystematicSet mySysSet;
+ 
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", CP::SystematicVariation::CONTINUOUS));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
+  
+  // Add systematics for lowPT isolation
+  if(m_isoWP.size()){
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty", CP::SystematicVariation::CONTINUOUS));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty", 1));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty", -1));
+  }
+  
+  return mySysSet;
+}
+
+/// Register the systematics with the registry and add them to the recommended list
+CP::SystematicCode AsgPhotonEfficiencyCorrectionTool::registerSystematics() {
+  CP::SystematicRegistry& registry = CP::SystematicRegistry::getInstance();
+  if (registry.registerSystematics(*this) != CP::SystematicCode::Ok) {
+    ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
+	return CP::SystematicCode::Unsupported;
+  }
+  return CP::SystematicCode::Ok;
+}
+
+/// returns: the list of all systematics this tool recommends to use
+CP::SystematicSet AsgPhotonEfficiencyCorrectionTool::recommendedSystematics() const {
+  CP::SystematicSet mySysSet;
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
+  
+  // Add systematics for lowPT isolation
+  if(m_isoWP.size()){
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty", 1));
+  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstringRadZ+"Uncertainty", -1));
+  }
+  
+  return mySysSet;
+}
+
+
+CP::SystematicCode AsgPhotonEfficiencyCorrectionTool::
+applySystematicVariation ( const CP::SystematicSet& systConfig )
+{
+  // First, check if we already know this systematic configuration
+  auto itr = m_systFilter.find(systConfig);
+
+  // If it's a new input set, we need to filter it
+  if( itr == m_systFilter.end() ){
+
+  // New systematic. We need to parse it. MP 26.11.15 remove the static from <<< static CP::SystematicSet affectingSys = affectingSystematics(); >>>
+    CP::SystematicSet affectingSys = affectingSystematics();
+    CP::SystematicSet filteredSys;   
+	if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)){
+      ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
+      return CP::SystematicCode::Unsupported;
+    }
+	
+    // Insert filtered set into the map
+    itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
+  }
+
+  CP::SystematicSet& mySysConf = itr->second;
+  m_appliedSystematics = &mySysConf;
+  return CP::SystematicCode::Ok;
+}
+
+//===============================================================================
+// Map Key Feature
+//===============================================================================
+// Gets the correction filename from map
+std::string AsgPhotonEfficiencyCorrectionTool::getFileName(std::string isoWP, bool isConv, std::string sufix) {
+  
+  // Check if isoWP is TightCaloOnly, then will read the inputs from RadZ files
+  if(0==isoWP.compare("TightCaloOnly")) sufix="_RadZ";
+  
+  // First locate the map file:
+  std::string mapFileName = PathResolverFindCalibFile( m_mapFile );
+  if(mapFileName.empty()){
+	ATH_MSG_ERROR ( "Somthing wrong with reading the map file, check you input: " << m_mapFile );
+	return mapFileName;	// return an empty string
+  }
+  
+  std::string correction_type = isoWP.empty() ? "ID_Tight" : "ISO_"+isoWP+sufix;
+  correction_type += isConv ? "_Converted" : "_Unconverted";
+  std::string value;
+  
+  // Read the map file to find the proper correction filename
+  std::ifstream is(mapFileName);
+  if (!is.is_open()){
+    ATH_MSG_ERROR("Couldn't read Map File" + mapFileName);
+	return  "";
+  }
+  while (!is.eof()) {
+    std::string strLine;
+	getline(is,strLine);
+	
+	int nPos = strLine.find('=');
+	
+	if ((signed int)std::string::npos == nPos) continue; // no '=', invalid line;
+	std::string strKey = strLine.substr(0,nPos);
+	std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
+	
+	// check if this is the right key, if the right one stop the search
+	if(0==correction_type.compare(strKey)) {value=strVal; break;}
+  }
+  
+  return value;
+
+}
+
+
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/TPhotonEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/TPhotonEfficiencyCorrectionTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..2a7e04a8a1caa76699c436700b7e5fdd74d39dfe
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/Root/TPhotonEfficiencyCorrectionTool.cxx
@@ -0,0 +1,119 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+   @class TPhotonEfficiencyCorrectionTool
+   @brief Calculate the photon scale factors and assosiated errors in pure ROOT
+
+   @author Michael Pitt
+   @date   April 2014
+*/
+
+
+// This class header
+#include "PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h"
+
+// STL includes
+#include <iostream>
+#include <cfloat>
+#include <math.h>
+#include <limits.h>
+
+// ROOT includes
+#include "TString.h"
+#include "TSystem.h"
+#include "TObjString.h"
+#include "TROOT.h"
+#include "TFile.h"
+#include "TClass.h"
+#include "TMD5.h"
+
+
+//===================================================================================
+// Calculate the assosiated uncertainties with various photon isolation prescriptions
+//===================================================================================
+double Root::TPhotonEfficiencyCorrectionTool::GetIsoSyst(bool isConv,double eta, int isolationcut)
+{
+switch (isolationcut){
+  case 3:
+	if(isConv){
+		if(fabs(eta)<0.6) return 0.0038;
+		else if(fabs(eta)<1.37) return 0.0045;
+		else if(fabs(eta)<1.52) return 0;
+		else if(fabs(eta)<1.81) return 2.7e-05;
+		else if(fabs(eta)<2.37) return 0.0046;
+	}
+	else{
+	  if(fabs(eta)<0.6) return 0.00043;
+	  else if(fabs(eta)<1.37) return 0.00069;
+	  else if(fabs(eta)<1.52) return 0;
+	  else if(fabs(eta)<1.81) return 0.00095;
+	  else if(fabs(eta)<2.37) return 0.0023;
+	}
+  case 4: return 0;	
+  case 5:
+	if(isConv){
+		if(fabs(eta)<0.6) return 0.0036;
+		else if(fabs(eta)<1.37) return 0.0007;
+		else if(fabs(eta)<1.52) return 0;
+		else if(fabs(eta)<1.81) return 0.0009;
+		else if(fabs(eta)<2.37) return 0.0016;
+	}
+	else{
+	  if(fabs(eta)<0.6) return 0.001;
+	  else if(fabs(eta)<1.37) return 0.0019;
+	  else if(fabs(eta)<1.52) return 0;
+	  else if(fabs(eta)<1.81) return 0.002;
+	  else if(fabs(eta)<2.37) return 0.0023;
+	}
+  case 6:
+	if(isConv){
+		if(fabs(eta)<0.6) return 0.0045;
+		else if(fabs(eta)<1.37) return 0.0034;
+		else if(fabs(eta)<1.52) return 0;
+		else if(fabs(eta)<1.81) return 0.0057;
+		else if(fabs(eta)<2.37) return 0.0016;
+	}
+	else{
+	  if(fabs(eta)<0.6) return 0.0028;
+	  else if(fabs(eta)<1.37) return 0.0035;
+	  else if(fabs(eta)<1.52) return 0;
+	  else if(fabs(eta)<1.81) return 0.0012;
+	  else if(fabs(eta)<2.37) return 0.0048;
+	}
+	case 7:
+	if(isConv){
+		if(fabs(eta)<0.6) return 0.011;
+		else if(fabs(eta)<1.37) return 0.0074;
+		else if(fabs(eta)<1.52) return 0;
+		else if(fabs(eta)<1.81) return 0.0089;
+		else if(fabs(eta)<2.37) return 0.0071;
+	}
+	else{
+	  if(fabs(eta)<0.6) return 0.0033;
+	  else if(fabs(eta)<1.37) return 0.0042;
+	  else if(fabs(eta)<1.52) return 0;
+	  else if(fabs(eta)<1.81) return 0.00041;
+	  else if(fabs(eta)<2.37) return 0.0037;
+	}
+	case 8:
+	if(isConv){
+		if(fabs(eta)<0.6) return 0.0033;
+		else if(fabs(eta)<1.37) return 0.00051;
+		else if(fabs(eta)<1.52) return 0;
+		else if(fabs(eta)<1.81) return 0.0012;
+		else if(fabs(eta)<2.37) return 0.00057;
+	}
+	else{
+	  if(fabs(eta)<0.6) return 0.0044;
+	  else if(fabs(eta)<1.37) return 0.0037;
+	  else if(fabs(eta)<1.52) return 0;
+	  else if(fabs(eta)<1.81) return 0.0012;
+	  else if(fabs(eta)<2.37) return 0.0032;
+	}
+	default: std::cout<<"Wrong isolation input!!!!!"<<std::endl; return 0.;
+}	
+return 0.;
+
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/data/map0.txt b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/data/map0.txt
new file mode 100644
index 0000000000000000000000000000000000000000..dfe74fa5266674a60c456e6910cb3586e0822c71
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/data/map0.txt
@@ -0,0 +1,24 @@
+ID_Tight_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/PIDSF/efficiencySF.offline.Tight.2016.13TeV.rel20.7.25ns.con.v00.root
+
+ID_Tight_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/PIDSF/efficiencySF.offline.Tight.2016.13TeV.rel20.7.25ns.unc.v00.root
+
+ISO_Loose_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v2/isolation/efficiencySF.Isolation.isolFixedCutLoose.2016.13TeV.rel20.7.25ns.con.v02.root
+
+ISO_Loose_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v2/isolation/efficiencySF.Isolation.isolFixedCutLoose.2016.13TeV.rel20.7.25ns.unc.v02.root
+
+ISO_Tight_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v2/isolation/efficiencySF.Isolation.isolFixedCutTight.2016.13TeV.rel20.7.25ns.con.v02.root
+
+ISO_Tight_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/ICHEP_June2016_v2/isolation/efficiencySF.Isolation.isolFixedCutTight.2016.13TeV.rel20.7.25ns.unc.v02.root
+
+ISO_Loose_RadZ_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutLoose.2015_2016.13TeV.rel20.7.25ns.con.RadZ.v01.root
+
+ISO_Loose_RadZ_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutLoose.2015_2016.13TeV.rel20.7.25ns.unc.RadZ.v01.root
+
+ISO_Tight_RadZ_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutTight.2015_2016.13TeV.rel20.7.25ns.con.RadZ.v01.root
+
+ISO_Tight_RadZ_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutTight.2015_2016.13TeV.rel20.7.25ns.unc.RadZ.v01.root
+
+ISO_TightCaloOnly_RadZ_Converted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutTightCaloOnly.2015_2016.13TeV.rel20.7.25ns.con.RadZ.v01.root
+
+ISO_TightCaloOnly_RadZ_Unconverted=PhotonEfficiencyCorrection/2015_2016/rel20.7/Moriond2017_v1/isolation/efficiencySF.Isolation.isolFixedCutTightCaloOnly.2015_2016.13TeV.rel20.7.25ns.unc.RadZ.v01.root
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/share/myJobOptions.py b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/share/myJobOptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..11a99ba15243e6e48efc81bc615237fb4a1766d6
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/share/myJobOptions.py
@@ -0,0 +1,36 @@
+#specify how many events it should process. Set it equal to -1 to process all events
+theApp.EvtMax = 100
+
+#set input files - svcMgr has a property that lets you specify the input files, as a list:
+import AthenaPoolCnvSvc.ReadAthenaPool
+svcMgr.EventSelector.InputCollections = [ " /afs/cern.ch/atlas/project/PAT/xAODs/r6630/mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.AOD.e3601_s2576_s2132_r6630_tid05358812_00/AOD.05358812._000010.pool.root.1" ]
+
+#One of the existing master sequences where one should attach all algorithms
+algSeq = CfgMgr.AthSequencer("AthAlgSeq")
+
+# Add the test algorithm. the alg is a part of the tool, so it should be imported:
+from PhotonEfficiencyCorrection.PhotonEfficiencyCorrectionConf import testAthenaPhotonAlg
+alg = testAthenaPhotonAlg()
+
+#define input files, for now it uses my own directory where the tool is, since it not a working part of the athena, please note that the current recomendation of PhotonID WG can be found here: https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PhotonEfficiencyCorrection
+
+#Set inputs for ID efficiency
+alg.PhotonEfficiencyCorrectionTool.CorrectionFileNameConv = "PhotonEfficiencyCorrection/v1/efficiencySF.offline.Tight.2015.13TeV.rel20.con.v01.root";
+alg.PhotonEfficiencyCorrectionTool.CorrectionFileNameUnconv = "PhotonEfficiencyCorrection/v1/efficiencySF.offline.Tight.2015.13TeV.rel20.unc.v01.root";
+
+#Or set inputs for track isolation efficiency (comment previous)
+#alg.PhotonEfficiencyCorrectionTool.CorrectionFileNameConv = "PhotonEfficiencyCorrection/efficiencySF.offline.isolFixedCutLoose.2015.13TeV.rel20.con.v01.root";
+#alg.PhotonEfficiencyCorrectionTool.CorrectionFileNameUnconv = "PhotonEfficiencyCorrection/efficiencySF.offline.isolFixedCutLoose.2015.13TeV.rel20.unc.v01.root";
+
+#Set DataType: for data use 0 (or don't run the tool - faster), for FULLSIM use 1, and for FASTSIM use 3, please note that the input files are also should be different
+alg.PhotonEfficiencyCorrectionTool.ForceDataType = 1
+
+
+#comment this line
+alg.OutputLevel = DEBUG
+algSeq += alg
+
+from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
+outStream = MSMgr.NewPoolRootStream( "MyXAODStream", "myXAOD.pool.root" )
+outStream.AddItem(['xAOD::PhotonContainer_v1#MyPhotons'])
+outStream.AddItem(['xAOD::PhotonAuxContainer_v1#MyPhotonsAux'])
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..965a745e060426cd94ceaa6c4b73ffa9dcc7e6fa
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_entries.cxx
@@ -0,0 +1,18 @@
+// Gaudi/Athena include(s):
+#include "GaudiKernel/DeclareFactoryEntries.h"
+
+// Local include(s):
+#include "PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h"
+
+#include "../testAthenaPhotonAlg.h"
+
+DECLARE_TOOL_FACTORY( AsgPhotonEfficiencyCorrectionTool )
+
+DECLARE_ALGORITHM_FACTORY( testAthenaPhotonAlg )
+
+DECLARE_FACTORY_ENTRIES( PhotonEfficiencyCorrection ) 
+{
+  DECLARE_TOOL( AsgPhotonEfficiencyCorrectionTool )
+  DECLARE_ALGORITHM( testAthenaPhotonAlg )  
+
+}
\ No newline at end of file
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_load.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_load.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..7a66e563646b86a194c48f39b4bc4ce7341cea65
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/components/PhotonEfficiencyCorrection_load.cxx
@@ -0,0 +1,2 @@
+#include "GaudiKernel/LoadFactoryEntries.h"
+LOAD_FACTORY_ENTRIES(PhotonEfficiencyCorrection)
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3c8f8ed6051ae928c55106aa1a6f02cd1847949e
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.cxx
@@ -0,0 +1,110 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// PhotonEfficiencyCorrection includes
+#include "testAthenaPhotonAlg.h"
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/PhotonAuxContainer.h"
+#include "xAODCore/ShallowCopy.h"
+
+#include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h"
+
+testAthenaPhotonAlg::testAthenaPhotonAlg( const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm( name, pSvcLocator ),  m_photonSF("AsgPhotonEfficiencyCorrectionTool/AsgPhotonEfficiencyCorrectionTool",this){
+
+  //declareProperty( "Property", m_nProperty ); //example property declaration
+  declareProperty( "PhotonEfficiencyCorrectionTool", m_photonSF );
+}
+//
+testAthenaPhotonAlg::~testAthenaPhotonAlg() {}
+
+
+StatusCode testAthenaPhotonAlg::initialize() {
+  ATH_MSG_INFO ("Initializing " << name() << "...");
+  // Retrieve the tool
+  ATH_CHECK( m_photonSF.retrieve() );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode testAthenaPhotonAlg::finalize() {
+  ATH_MSG_INFO ("Finalizing " << name() << "...");
+  // Clean up
+  ATH_CHECK( m_photonSF.release() );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode testAthenaPhotonAlg::execute() {  
+  ATH_MSG_DEBUG ("Executing " << name() << "...");
+
+//----------------------------
+ // Event information
+ //--------------------------- 
+ const xAOD::EventInfo* eventInfo = 0; //NOTE: Everything that comes from the storegate direct from the input files is const!
+
+ // ask the event store to retrieve the xAOD EventInfo container
+ //ATH_CHECK( evtStore()->retrieve( eventInfo, "EventInfo") );  // the second argument ("EventInfo") is the key name
+ ATH_CHECK( evtStore()->retrieve( eventInfo) );
+ // if there is only one container of that type in the xAOD (as with the EventInfo container), you do not need to pass
+ // the key name, the default will be taken as the only key name in the xAOD 
+ 
+ // check if data or MC
+ bool isMC = true;
+ if(!eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION ) ){
+   isMC = false;
+ }
+ if(!isMC) ATH_MSG_ERROR("This is data, no scale factors should be used on the data!");
+ 
+ //---------
+ // photons
+ //---------
+ const xAOD::PhotonContainer* photons = 0;
+ ATH_CHECK( evtStore()->retrieve( photons, "Photons") );
+ ATH_MSG_DEBUG("Found "<<photons->size() <<" photons in event, itterate....");
+ 
+// Let's create a shallow copy of the const photon container, and decorate it with the obtained SF
+auto inContShallowCopy = xAOD::shallowCopyContainer( *photons );
+
+//creates a new photon container to hold the subset as well as the needed auxiliary container
+  xAOD::PhotonContainer* myphotons = new xAOD::PhotonContainer;
+  xAOD::PhotonAuxContainer* myphotonsAux = new xAOD::PhotonAuxContainer;
+  // You need to tell the photon container in which auxiliary container it should write its member variables
+  myphotons->setStore( myphotonsAux ); //gives it a new associated aux container
+
+  // Also record to storegate: you must record both the container and the auxcontainer.
+  // Note that storegate takes ownership of these objects, i.e., you must not try to delete them yourself.
+  ATH_CHECK( evtStore()->record(myphotons,  "MyPhotons" ) );
+  ATH_CHECK( evtStore()->record(myphotonsAux, "MyPhotonsAux" ) );
+
+// Loop over all Photons in the shallow-copy container, decorate it with SF, and store in new xAOD file, in addition print out all SF (with get* function)
+for ( xAOD::Photon* ph : *(inContShallowCopy.first) ) {
+
+  //if ( std::abs(ph->eta()) > 2.37 || ph->pt()<15000. ) continue;
+  //if (std::abs(ph->eta())>=1.37 && std::abs(ph->eta())<=1.52) continue;
+  ATH_MSG_DEBUG( "  photon pt = " << ph->pt() <<", photon eta = " << ph->eta() );
+
+  double SF, SFerr; // for photon SF and the apropriate error
+  if(!m_photonSF->getEfficiencyScaleFactor(*ph,SF)){
+    ATH_MSG_WARNING( "Couldn't get photon scale factor!" );
+	continue;
+  }
+  if(!m_photonSF->getEfficiencyScaleFactorError(*ph,SFerr)){
+    ATH_MSG_WARNING( "Couldn't get photon scale factor uncertainty!" );
+	continue;
+  }
+  ATH_MSG_DEBUG( "  photon SF = " << SF <<", photon SF sys error = " << SFerr );
+  
+  // applyEfficiencyScaleFactor - decorate the object (*photon)
+  if ( m_photonSF->applyEfficiencyScaleFactor(*ph) == CP::CorrectionCode::Error ) {
+    ATH_MSG_ERROR("PhotonEfficiencyCorrectionTool reported a CP::CorrectionCode::Error");
+    return StatusCode::FAILURE;
+  }
+
+  myphotons->push_back(ph); // add it to a new photon container which will be writed to a new file
+} // and loop on photons
+
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.h b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4e9cf9883eac2f377048f011f7005d0a71d1280
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/src/testAthenaPhotonAlg.h
@@ -0,0 +1,28 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PHOTONEFFICIENCYCORRECTION_TESTATHENAPHOTONALG_H
+#define PHOTONEFFICIENCYCORRECTION_TESTATHENAPHOTONALG_H 1
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+
+// forward declarations
+class IAsgPhotonEfficiencyCorrectionTool;
+
+class testAthenaPhotonAlg: public ::AthAlgorithm { 
+ public: 
+  testAthenaPhotonAlg( const std::string& name, ISvcLocator* pSvcLocator );
+  virtual ~testAthenaPhotonAlg(); 
+
+  virtual StatusCode  initialize();
+  virtual StatusCode  execute();
+  virtual StatusCode  finalize();
+
+ private: 
+ /// The tool handle to our photon efficiency correction
+ ToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_photonSF;
+}; 
+
+#endif //> !PHOTONEFFICIENCYCORRECTION_TESTATHENAPHOTONALG_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/PrintPhotonSF.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/PrintPhotonSF.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f4c8eee03b8724ae44c16bc5a4d080c5a2b8fbbb
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/PrintPhotonSF.cxx
@@ -0,0 +1,94 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+//PrintPhotonSF.cxx  - print SF for a given input
+
+// System include(s):
+#include <stdio.h>
+#include <cstdlib>
+#include <iostream>
+#include <boost/filesystem.hpp>
+
+// ROOT include(s):
+#include "TFile.h"
+#include "TString.h"
+
+// Local include(s):
+#include "PhotonEfficiencyCorrection/TPhotonEfficiencyCorrectionTool.h"
+#define GEV 1000.0
+#define TEV 1000000.0
+
+using namespace std;
+using namespace TMath;
+
+int main (int argc, const char * argv[]) {
+
+	if(argc!=2){
+		printf("input parameters:\n./PrintPhotonSF [file] \n");
+		printf("example:\n PrintPhotonSF $ROOTCOREBIN/data/PhotonEfficiencyCorrection/INPUTFILE.root\n");
+		return 0;
+	}	
+	
+	// Check the input file:
+	if(!boost::filesystem::exists(argv[1])){
+	  printf("Error: file %s not exists\n",argv[1]);
+	  return 0;
+	}
+
+	TString file(argv[1]);	
+	if(!TFile::Open(file)->GetListOfKeys()->Contains("0_99999999999")){
+	  printf("Error: no TDirectory 0_99999999999, check your input file\n");
+	  return 0;
+	}
+	
+	if(getenv("ROOTCOREDIR")==NULL){
+        cout << "Please setup RootCore before running the PrintPhotonSF [file]"<<endl;
+        return 0.;
+        }
+
+	// Create and initialize an instance for both types of photons
+	Root::TPhotonEfficiencyCorrectionTool tool_SF;
+	tool_SF.addFileName(file.Data());
+
+if(!tool_SF.initialize()){
+  printf("Tool not initialized properly, check the error massages\n");
+  return 0;
+}
+
+PATCore::ParticleDataType::DataType datatype=PATCore::ParticleDataType::Full;
+if(file.Contains("AFII")) datatype=PATCore::ParticleDataType::Fast;
+
+// Access the file to get the histogram binning:
+TH2F * h = file.Contains("AFII") ? (TH2F*)TFile::Open(file)->Get("0_99999999999/AltFast2_sf") : (TH2F*)TFile::Open(file)->Get("0_99999999999/FullSim_sf");
+
+
+const Double_t * pTbounds = h->GetXaxis()->GetXbins()->GetArray();
+const Double_t * Etabounds = h->GetYaxis()->GetXbins()->GetArray();
+
+const int npTbins  = h->GetXaxis()->GetNbins();
+const int nEtabins = h->GetYaxis()->GetNbins();
+
+double pt, eta;
+
+// loop over bins, in different pt/eta region, and print the SF
+cout << "-----------------------------------------------------------------------------------"<<endl;
+cout << "Table of photon ScaleFactors obtained by data-driven measurements for input file:"<<endl; cout << file <<endl;
+cout << "-----------------------------------------------------------------------------------"<<endl;
+TString dash_line="---------------"; for(int i=1;i<=nEtabins;i++) dash_line+="------------------";
+cout << "|  pt[GeV]\t\t|"; for(int i=1;i<=nEtabins;i++) printf("%2.2f<eta<%2.2f\t|",Etabounds[i-1],Etabounds[i]); cout<<endl;
+cout << dash_line.Data() <<endl;
+for (int i=1;i<=npTbins;i++){
+pt=0.5*(pTbounds[i-1]+pTbounds[i]);
+if(pt/GEV<100) printf("|%2.1f-%2.1f\t\t|",pTbounds[i-1]/GEV,pTbounds[i]/GEV);
+else if(pt<TEV) printf("|%2.0f - %2.0f\t\t|",pTbounds[i-1]/GEV,pTbounds[i]/GEV);
+else printf("|%2.0f-%2.0f\t\t|",pTbounds[i-1]/GEV,pTbounds[i]/GEV);
+for(int j=1;j<=nEtabins;j++){
+eta=0.5*(Etabounds[j-1]+Etabounds[j]);
+printf("%2.2f+/-%2.4f\t|",tool_SF.calculate(datatype,1,eta,pt).getScaleFactor(),tool_SF.calculate(datatype,1,eta,pt).getTotalUncertainty());
+} cout << endl;
+}
+cout << dash_line.Data() <<endl;
+
+} // END PROGRAM
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/TestxAODPhotonAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/TestxAODPhotonAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..9cbc1addcf6b48ce638ebadd7733aec1ff112fd8
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection/util/TestxAODPhotonAlg.cxx
@@ -0,0 +1,234 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// System include(s):
+#include <memory>
+#include <cstdlib>
+
+// ROOT include(s):
+#include <TFile.h>
+#include <TError.h>
+#include <TString.h>
+
+// Infrastructure include(s):
+#ifdef ROOTCORE
+#   include "xAODRootAccess/Init.h"
+#   include "xAODRootAccess/TEvent.h"
+#   include "xAODRootAccess/TStore.h"
+#endif // ROOTCORE
+
+// EDM include(s):
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/Egamma.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "PhotonEfficiencyCorrection/AsgPhotonEfficiencyCorrectionTool.h"
+#include "xAODCore/ShallowCopy.h"
+#include "PathResolver/PathResolver.h"
+#include <PATInterfaces/SystematicsUtil.h>
+
+#include <iostream>
+#include <string>
+
+#define CHECK( ARG )                                  \
+do {                                                  \
+    const bool result = ARG;                          \
+  if( ! result ) {                                    \
+      ::Error( APP_NAME, "Failed to execute: \"%s\"", \
+#ARG );                                               \
+      return 1;                                       \
+  }                                                   \
+ } while( false )
+
+
+int main( int argc, char* argv[] ) {
+
+   // The application's name:
+   const char* APP_NAME = argv[ 0 ];
+
+   // Check if we received a file name:
+   if( argc < 2 ) {
+     Error( APP_NAME, "No file name received!" );
+     Error( APP_NAME, "  Usage: %s [xAOD file name]", APP_NAME );
+      return 1;
+   }
+   
+   // Initialise the application:
+   CHECK( xAOD::Init( APP_NAME ) );
+
+   // Open the input file:
+   const TString fileName = argv[ 1 ];
+   Info( APP_NAME, "Opening file: %s", fileName.Data() );
+   std::auto_ptr< TFile > ifile( TFile::Open( fileName, "READ" ) );
+   CHECK( ifile.get() );
+
+   // Create a TEvent object:
+//   xAOD::TEvent event( xAOD::TEvent::kBranchAccess ); //will work for a sample produced in devval
+ 	xAOD::TEvent event( xAOD::TEvent::kClassAccess );   
+   CHECK( event.readFrom( ifile.get() ) );
+   Info( APP_NAME, "Number of events in the file: %i",
+         static_cast< int >( event.getEntries() ) );
+		 
+		 
+   // Decide how many events to run over:
+   Long64_t entries = event.getEntries();
+   if( argc > 2 ) {
+      const Long64_t e = atoll( argv[ 2 ] );
+      if( e < entries ) {
+         entries = e;
+      }
+   }
+
+	// Initialize photonFS tool
+   AsgPhotonEfficiencyCorrectionTool photonSF_ID("AsgPhotonEfficiencyCorrectionTool_idSF");
+   AsgPhotonEfficiencyCorrectionTool photonSF_Iso("AsgPhotonEfficiencyCorrectionTool_isoSF");
+  
+   //  photonSF_ID.msg().setLevel( MSG::DEBUG ); 
+
+
+   //Set Properties for photonID_SF tool
+   CHECK(photonSF_ID.setProperty("MapFilePath","PhotonEfficiencyCorrection/map0.txt"));
+   CHECK(photonSF_ID.setProperty("ForceDataType",1)); 
+   
+   //Set Properties for photonISO_SF tool
+   CHECK(photonSF_Iso.setProperty("MapFilePath","PhotonEfficiencyCorrection/map0.txt"));
+   CHECK(photonSF_Iso.setProperty("IsoWP","Loose"));	// Set isolation WP: Loose,Tight,TightCaloOnly
+   CHECK(photonSF_Iso.setProperty("Threshold_lowPT",25.0));	// this is a default value, no need to set if using it
+   CHECK(photonSF_Iso.setProperty("Threshold_highPT",100.0));	// this is a default value, no need to set if using it
+   CHECK(photonSF_Iso.setProperty("UseRadiativeZSF_mediumPT",false));	// default=false, set to true to use RadZSF up to Threshold_highPT
+   CHECK(photonSF_Iso.setProperty("ForceDataType",1)); //set data type: 1 for FULLSIM, 3 for AF2
+   
+   
+   
+   if(!photonSF_ID.initialize()){
+     std::cout <<"Failed to initialize the tool, check for errors"<<std::endl;
+     return 0;
+   }
+   if(!photonSF_Iso.initialize()){
+     std::cout <<"Failed to initialize the tool, check for errors"<<std::endl;
+     return 0;
+   }
+   
+   // Test that recommended systematics properly bieng registered:
+   std::vector<CP::SystematicSet> sysList;
+   const CP::SystematicRegistry& registry = CP::SystematicRegistry::getInstance();
+   const CP::SystematicSet& recommendedSystematics = registry.recommendedSystematics();
+   sysList = CP::make_systematics_vector(recommendedSystematics); // replaces continuous systematics with the +/-1 sigma variation
+   std::cout << "List of recommended systematics from the registry:"<<std::endl;
+   for (auto sysListItr = recommendedSystematics.begin(); sysListItr != recommendedSystematics.end(); ++sysListItr){
+     std::cout <<(*sysListItr).name()<<std::endl;
+   }
+   
+   // restructure all recommended systematic variations for the SF tool
+   // for +/- nsigma variation see https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PhotonEfficiencyCorrection#Systematic_variations
+   std::cout << "restructure all recommended systematic variations for the SF tool"<<std::endl;
+   std::vector<CP::SystematicSet> syst_PhotonID, syst_PhotonIso;
+   for (auto SystematicsVariation : CP::make_systematics_vector(photonSF_ID.recommendedSystematics()))
+   {
+     syst_PhotonID.push_back(CP::SystematicSet());
+   	 syst_PhotonID.back().insert(SystematicsVariation);
+   }
+   for (auto SystematicsVariation : CP::make_systematics_vector(photonSF_Iso.recommendedSystematics()))
+   {
+     syst_PhotonIso.push_back(CP::SystematicSet());
+   	 syst_PhotonIso.back().insert(SystematicsVariation);
+   }
+
+   //Print all recomended systemtaics
+   for (auto sSystematicSet: syst_PhotonID){
+	  Info(APP_NAME,"PhotonEfficiencyCorrectionTool ID instance has next systematic variation  %s ",sSystematicSet.name().c_str());
+   }
+   for (auto sSystematicSet: syst_PhotonIso){
+	  Info(APP_NAME,"PhotonEfficiencyCorrectionTool Iso instance has next systematic variation  %s ",sSystematicSet.name().c_str());
+   }   
+
+   double efficiencyScaleFactor=0, efficiencyScaleFactorError=0;
+   // Loop over the events:
+   std::cout << "loop on " << entries << " entries"<<std::endl;
+   for( int entry = 0; entry < entries; ++entry ) {
+
+     // Tell the object which entry to look at:
+     event.getEntry( entry );   
+	
+	// Get the EventInfo (run number...):
+	const xAOD::EventInfo* ei = 0;
+	CHECK( event.retrieve( ei, "EventInfo" ) );
+	//std::cout << "Event number = " << ei->eventNumber() << std::endl;
+	
+	// Get the Photon container from the event:
+    const xAOD::PhotonContainer *photons = 0;
+	CHECK( event.retrieve( photons, "Photons" ) );
+	
+	//Clone 
+	std::pair< xAOD::PhotonContainer*, xAOD::ShallowAuxContainer* > photons_shallowCopy = xAOD::shallowCopyContainer( *photons );
+
+	//Iterate over the shallow copy
+    xAOD::PhotonContainer* phsCorr = photons_shallowCopy.first;
+    xAOD::PhotonContainer::iterator ph_itr      = phsCorr->begin();
+    xAOD::PhotonContainer::iterator ph_end      = phsCorr->end();
+	
+    unsigned int i = 0;
+	for( ; ph_itr != ph_end; ++ph_itr, ++i ) {
+	  xAOD::Photon* ph = *ph_itr;
+	  
+	  // skip photons with pt outsize the acceptance
+	  if(ph->pt()<10000.0) continue;
+	  if( fabs(ph->eta())>2.47) continue;
+	   Info (APP_NAME,"Event #%d, Photon #%d", entry, i); 
+	   Info (APP_NAME,"xAOD/raw pt = %f, eta = %f ", ph->pt(), ph->eta() ); 
+	   
+	   // will set the systematic variation to nominal - no need to do it if applySystematicVariation("UP/DOWN") is not called
+	   CHECK(photonSF_ID.applySystematicVariation(syst_PhotonID.at(0)));
+	   CHECK(photonSF_Iso.applySystematicVariation(syst_PhotonIso.at(0)));
+   
+	   // Get photon ID SF and the uncertainty
+	   CHECK(photonSF_ID.getEfficiencyScaleFactor(*ph,efficiencyScaleFactor));
+	   CHECK(photonSF_ID.getEfficiencyScaleFactorError(*ph,efficiencyScaleFactorError));
+	   
+       Info( APP_NAME,"===>>> Result ID: ScaleFactor %f, TotalUncertainty %f ",efficiencyScaleFactor,efficiencyScaleFactorError);
+
+	   // Get photon SF and the uncertainty
+	   CHECK(photonSF_Iso.getEfficiencyScaleFactor(*ph,efficiencyScaleFactor));
+	   CHECK(photonSF_Iso.getEfficiencyScaleFactorError(*ph,efficiencyScaleFactorError));
+	   
+       Info( APP_NAME,"===>>> Result Iso: ScaleFactor %f, TotalUncertainty %f ",efficiencyScaleFactor,efficiencyScaleFactorError);
+
+	   
+	   // decorate photon (for different name use photonSF_ID.setProperty("ResultName","ID_"); or photonSF_Iso.setProperty("ResultName","Iso_");)
+	   CHECK(photonSF_ID.applyEfficiencyScaleFactor(*ph));
+       Info( "applyEfficiencyScaleFactor()","===>>> new decoration: (xAOD::Photon*)ph->auxdata<float>(\"SF\")=%f",ph->auxdata<float>("SF"));
+	   CHECK(photonSF_Iso.applyEfficiencyScaleFactor(*ph));
+       Info( "applyEfficiencyScaleFactor()","===>>> new decoration: (xAOD::Photon*)ph->auxdata<float>(\"SF\")=%f",ph->auxdata<float>("SF"));
+
+	   
+	   // get SF for all recommended systematic variations (nominal is also included):
+	   for (const auto sSystematicSet: syst_PhotonID){
+		CHECK(photonSF_ID.applySystematicVariation(sSystematicSet));
+	    CHECK(photonSF_ID.getEfficiencyScaleFactor(*ph,efficiencyScaleFactor));
+		Info( APP_NAME,"===>>> apply %s: ScaleFactor = %f",photonSF_ID.appliedSystematics().name().c_str(),efficiencyScaleFactor);
+       }
+	   for (const auto sSystematicSet: syst_PhotonIso){
+		CHECK(photonSF_Iso.applySystematicVariation(sSystematicSet));
+	    CHECK(photonSF_Iso.getEfficiencyScaleFactor(*ph,efficiencyScaleFactor));
+		Info( APP_NAME,"===>>> apply %s: ScaleFactor = %f",photonSF_Iso.appliedSystematics().name().c_str(),efficiencyScaleFactor);
+       }	   
+
+	}  // END LOOP ON PHOTONS
+     
+   } // END LOOP ON EVENTS
+   CHECK(photonSF_ID.finalize());
+   CHECK(photonSF_Iso.finalize());
+   
+   // Return gracefully:
+   return 1;
+   
+} // END PROGRAM
+
+/*
+	if(argc!=2){
+		printf("input parameters:\nTestxAODPhotonTool [path]\n");
+		printf("example: TestxAODPhotonTool /afs/cern.ch/work/k/krasznaa/public/xAOD/19.0.X_rel_4/mc12_8TeV.105200.McAtNloJimmy_CT10_ttbar_LeptonFilter.AOD.19.0.X_rel_4.pool.root\n");
+		return 0;
+	}	
+*/
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1088ceea41eba1e4e327ae354e8467af8c84a70d
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/CMakeLists.txt
@@ -0,0 +1,55 @@
+################################################################################
+# Package: PhotonVertexSelection
+################################################################################
+
+# Declare the package name:
+atlas_subdir( PhotonVertexSelection )
+
+# Extra dependencies, based on the build environment:
+set( extra_deps )
+if( NOT XAOD_STANDALONE )
+   set( extra_deps Control/AthenaBaseComps GaudiKernel )
+endif()
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   Event/xAOD/xAODEventInfo
+   Event/xAOD/xAODTracking
+   PRIVATE
+   Control/AthContainers
+   PhysicsAnalysis/ElectronPhotonID/IsolationCorrections
+   Tools/PathResolver
+   ${extra_deps} )
+
+# External dependencies:
+find_package( ROOT COMPONENTS Core Hist RIO Physics TMVA )
+
+# Libraries in the package:
+atlas_add_library( PhotonVertexSelectionLib
+   PhotonVertexSelection/*.h Root/*.cxx
+   PUBLIC_HEADERS PhotonVertexSelection
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma xAODEventInfo
+   xAODTracking
+   PRIVATE_LINK_LIBRARIES IsolationCorrectionsLib PathResolver )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( PhotonVertexSelection
+      src/*.h src/*.cxx src/components/*.cxx
+      LINK_LIBRARIES xAODEgamma xAODTracking AthContainers AthenaBaseComps
+      GaudiKernel PhotonVertexSelectionLib )
+endif()
+
+atlas_add_dictionary( PhotonVertexSelectionDict
+   PhotonVertexSelection/PhotonVertexSelectionDict.h
+   PhotonVertexSelection/selection.xml
+   LINK_LIBRARIES PhotonVertexSelectionLib )
+
+# Test(s) in the package:
+if( XAOD_STANDALONE )
+   atlas_add_test( PhotonVertexSelection_test
+      SCRIPT test/testPhotonVertexSelection.py )
+endif()
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/ElectronRemovalTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/ElectronRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3b9e605e6dfbf80094831e32e388e3533351067
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/ElectronRemovalTool.h
@@ -0,0 +1,65 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_ElectronRemovalTool_h
+#define PhotonVertexSelection_ElectronRemovalTool_h
+
+// Framework includes
+#include "AsgTools/AsgTool.h"
+
+// Local includes
+#include "PhotonVertexSelection/IElectronRemovalTool.h"
+
+// Forward declarations
+
+namespace CP {
+
+  /// Implementation for the photon pointing tool
+  ///
+  /// Takes photon shower shape and/or conversion vertex
+  /// and extrapolates back to beamline
+  ///
+  /// @author Christopher Meyer <chris.meyer@cern.ch>
+  ///
+  class ElectronRemovalTool : public virtual IElectronRemovalTool,
+                             public asg::AsgTool {
+
+    /// Create a proper constructor for Athena
+    ASG_TOOL_CLASS(ElectronRemovalTool, CP::IElectronRemovalTool)
+
+  private:
+
+    std::vector<const xAOD::TrackParticle *> getElectronTPs( xAOD::ElectronContainer & electrons) const;
+
+  public:
+    ElectronRemovalTool(const std::string &name);
+    virtual ~ElectronRemovalTool();
+
+    /// @name Function(s) implementing the asg::IAsgTool interface
+    /// @{
+    
+    /// Function initialising the tool
+    virtual StatusCode initialize();
+      
+    /// @}
+
+    /// @name Function(s) implementing the IElectronRemovalTool interface
+    /// @{
+    /// Will remove from output vertices all TrackParticles associated to the input electrons from the toRemove container
+    StatusCode removeElectronsFromVertex(xAOD::VertexContainer & output, const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const;
+    
+    //if you already have a non-const vertex container to modify
+    StatusCode removeElectronsFromVertex(xAOD::VertexContainer & vertices, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const;
+  
+    //version returning a pointer to a vertex container - caller takes ownership
+    xAOD::VertexContainer * removeElectronsFromVertex(const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const;
+
+    /// @}
+
+  }; // class ElectronRemovalTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_ElectronRemovalTool_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IElectronRemovalTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IElectronRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ea20452be9ad2283d5fdbe1b30f2587dd880869
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IElectronRemovalTool.h
@@ -0,0 +1,40 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_IElectronRemovalTool_h
+#define PhotonVertexSelection_IElectronRemovalTool_h
+
+// Framework includes
+#include "AsgTools/IAsgTool.h"
+
+// EDM includes
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODEventInfo/EventInfo.h"
+
+namespace CP {
+
+  class IElectronRemovalTool : public virtual asg::IAsgTool {
+
+    /// Declare the interface that the class provides
+    ASG_TOOL_INTERFACE(CP::IElectronRemovalTool)
+
+  public:
+    /// Will remove from output vertices all TrackParticles associated to the input electrons from the toRemove container
+    virtual StatusCode removeElectronsFromVertex(xAOD::VertexContainer & output, const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const = 0;
+    
+    //if you already have a non-const vertex container to modify
+    virtual StatusCode removeElectronsFromVertex(xAOD::VertexContainer & vertices, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const = 0;
+
+    //version returning a pointer to a vertex container - caller takes ownership
+    virtual xAOD::VertexContainer * removeElectronsFromVertex(const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo = true) const = 0;
+
+    
+
+  }; // class IElectronRemovalTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_IPhotonPointingTool_h
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonPointingTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonPointingTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..5db1809b6cdc1d7ba97919de8ed12f469da07c14
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonPointingTool.h
@@ -0,0 +1,51 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_IPhotonPointingTool_h
+#define PhotonVertexSelection_IPhotonPointingTool_h
+
+// Framework includes
+#include "AsgTools/IAsgTool.h"
+
+// EDM includes
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include "xAODEventInfo/EventInfo.h"
+
+namespace CP {
+
+  class IPhotonPointingTool : public virtual asg::IAsgTool {
+
+    /// Declare the interface that the class provides
+    ASG_TOOL_INTERFACE(CP::IPhotonPointingTool)
+
+  public:
+    /// Add calo and conversion (HPV) pointing variables
+    virtual StatusCode updatePointingAuxdata(const xAOD::EgammaContainer &egammas) const = 0;
+
+    /// Return calo pointing variables
+    virtual std::pair<float, float> getCaloPointing(const xAOD::Egamma *egamma) const = 0;
+    
+    /// Return conversion (HPV) pointing variables
+    virtual std::pair<float, float> getConvPointing(const xAOD::Photon *photon) const = 0;
+
+    /// Return the corrected eta for primary vertex z-position
+    virtual float getCorrectedEta(const xAOD::CaloCluster &cluster, float PVz) const = 0;
+
+    /// Correct Egamma vector for primary vertex z-position
+    virtual StatusCode correctPrimaryVertex(xAOD::Egamma &egamma, float PVz) const = 0;
+
+    /// Get Egamma TLorentzVector corrected for primary vertex z-position
+    virtual TLorentzVector getCorrectedLV(const xAOD::Egamma &egamma, float PVz) const = 0;
+    
+    /// Return the invariant mass, using corrected Pt/Eta of each object for the
+    /// given vertex z-position
+    virtual float getCorrectedMass(const xAOD::EgammaContainer &egammas, float PVz) const = 0;
+
+  }; // class IPhotonPointingTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_IPhotonPointingTool_h
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonVertexSelectionTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonVertexSelectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..9d6aa3296844b8a7d0c270a814d2d7d1adbd256d
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/IPhotonVertexSelectionTool.h
@@ -0,0 +1,56 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_IPhotonVertexSelectionTool_h
+#define PhotonVertexSelection_IPhotonVertexSelectionTool_h
+
+// Framework includes
+#include "AsgTools/IAsgTool.h"
+
+// EDM includes
+#include "xAODTracking/VertexFwd.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include "xAODEgamma/PhotonContainer.h"
+
+// std includes
+#include <vector>
+
+// Forward declarations
+namespace CP {
+  class IPhotonPointingTool;
+}
+
+namespace CP {
+
+  class IPhotonVertexSelectionTool : public virtual asg::IAsgTool {
+
+    /// Declare the interface that the class provides
+    ASG_TOOL_INTERFACE(CP::IPhotonVertexSelectionTool)
+
+  public:
+    /// Given a list of photons, return the most likely vertex based on MVA likelihood
+    virtual StatusCode getVertex(const xAOD::EgammaContainer &egammas, const xAOD::Vertex* &vertex, bool ignoreConv = false) = 0;
+
+    /// Given a list of photons, return the MLPs of all vertices in the event 
+    /// sorted in descending order
+    virtual std::vector<std::pair<const xAOD::Vertex*, float> >& getVertex(const xAOD::EgammaContainer &egammas, bool ignoreConv = false) = 0;
+
+    /// Return the last case treated:
+    /// 0=conv track associated to vertex,
+    /// 1=at least one conv track with Si hits, 
+    /// 2=no tracks with Si hits or conversions ignored
+    virtual int getCase() const = 0;
+
+    /// Get possible vertex directly associated with photon conversions
+    virtual const xAOD::Vertex* getPrimaryVertexFromConv(const xAOD::PhotonContainer *photons) const = 0;
+
+    /// Get access to the photon pointing tool
+    virtual const CP::IPhotonPointingTool* photonPointingTool() const = 0;
+
+  }; // class IPhotonVertexSelectionTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_IPhotonVertexSelectionTool_h
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonPointingTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonPointingTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..af44d89d60efc5b34657a42d95b9ef3dc054c9e3
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonPointingTool.h
@@ -0,0 +1,96 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_PhotonPointingTool_h
+#define PhotonVertexSelection_PhotonPointingTool_h
+
+// Framework includes
+#include "AsgTools/AsgTool.h"
+
+// Local includes
+#include "PhotonVertexSelection/IPhotonPointingTool.h"
+
+// Forward declarations
+class TH1F;
+namespace CP { class ShowerDepthTool; }
+
+namespace CP {
+
+  /// Implementation for the photon pointing tool
+  ///
+  /// Takes photon shower shape and/or conversion vertex
+  /// and extrapolates back to beamline
+  ///
+  /// @author Christopher Meyer <chris.meyer@cern.ch>
+  ///
+  class PhotonPointingTool : public virtual IPhotonPointingTool,
+                             public asg::AsgTool {
+
+    /// Create a proper constructor for Athena
+    ASG_TOOL_CLASS(PhotonPointingTool, CP::IPhotonPointingTool)
+
+  private:
+    /// Tools
+    CP::ShowerDepthTool *m_showerTool;
+
+    /// Correction histogram
+    TH1F *m_zCorrection;
+
+    /// Static Decorators
+    static SG::AuxElement::Decorator<float> zvertex;
+    static SG::AuxElement::Decorator<float> errz;
+    static SG::AuxElement::Decorator<float> HPV_zvertex;
+    static SG::AuxElement::Decorator<float> HPV_errz;
+
+  private:
+    ///
+    float getCorrectedZ(float zPointing, float etas2) const;
+    bool m_isMC;
+    std::string m_zOscFileMC, m_zOscFileData;
+
+  public:
+    PhotonPointingTool(const std::string &name);
+    virtual ~PhotonPointingTool();
+
+    /// @name Function(s) implementing the asg::IAsgTool interface
+    /// @{
+    
+    /// Function initialising the tool
+    virtual StatusCode initialize();
+      
+    /// @}
+
+    /// @name Function(s) implementing the IPhotonPointingTool interface
+    /// @{
+    
+    /// Add calo and conversion (HPV) pointing variables
+    StatusCode updatePointingAuxdata(const xAOD::EgammaContainer &egammas) const ;
+
+    /// Return calo pointing variables
+    std::pair<float, float> getCaloPointing(const xAOD::Egamma *egamma) const ;
+    
+    /// Return conversion (HPV) pointing variables
+    std::pair<float, float> getConvPointing(const xAOD::Photon *photon) const ;
+    
+    /// Return the corrected eta for primary vertex z-position
+    float getCorrectedEta(const xAOD::CaloCluster &cluster, float PVz) const ;
+
+    /// Correct Egamma vector for primary vertex z-position
+    StatusCode correctPrimaryVertex(xAOD::Egamma &egamma, float PVz) const ;
+
+    /// Get Egamma TLorentzVector corrected for primary vertex z-position
+    TLorentzVector getCorrectedLV(const xAOD::Egamma &egamma, float PVz) const ;
+    
+    /// Return the invariant mass, using corrected Pt/Eta of each object for the
+    /// given vertex z-position
+    float getCorrectedMass(const xAOD::EgammaContainer &egammas, float PVz) const;
+
+    /// @}
+
+  }; // class PhotonPointingTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_PhotonPointingTool_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexHelpers.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..c70a1147f749ef0add71b53b83833ae586df73e2
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexHelpers.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_PhotonVertexHelpers_H
+#define PhotonVertexSelection_PhotonVertexHelpers_H
+
+// EDM includes
+#include "xAODTracking/VertexContainerFwd.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include "xAODEventInfo/EventInfo.h"
+
+// ROOT includes
+#include "TLorentzVector.h"
+
+class ShowerDepthTool;
+
+namespace xAOD {
+  namespace PVHelpers {
+
+    ///@brief Return zCommon and zCommonError
+    std::pair<float, float> getZCommonAndError(const xAOD::EventInfo *eventInfo,
+                                               const xAOD::EgammaContainer *egammas,
+                                               float convPtCut = 2e3);
+
+    ///@brief Loop over track particles associated with vertex and return scalar sum of pT^power in GeV (from auxdata if available and useAux = true)
+    float getVertexSumPt(const xAOD::Vertex *vertex, int power = 1, bool useAux = true);
+
+    ///@brief Return vector sum of tracks associated with vertex (from auxdata if available and useAux = true)
+    TLorentzVector getVertexMomentum(const xAOD::Vertex *vertex, bool useAux = true, std::string derivationPrefix = "");
+
+    ///@brief Return vertex with highest sum pT^2
+    const xAOD::Vertex* getHardestVertex(const xAOD::VertexContainer *vertices);
+
+    ///@brief Return track at first measurment, useful as proxy to conversion vertex pT
+    TLorentzVector getTrackAtFirstMeasurement(const xAOD::TrackParticle *tp);
+
+    ///@brief Check if photon is converted, and tracks have Si hits and pass selection
+    bool passConvSelection(const xAOD::Photon *photon,
+                           float convPtCut = 2e3);
+
+    ///@brief Check if track i of conversion vertex pass selection (Si hits and pt)
+    bool passConvSelection(const xAOD::Vertex& conversionVertex,
+                           size_t i,
+                           float convPtCut);
+
+  }
+}
+
+
+#endif // PhotonVertexSelection_PhotonVertexHelpers_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionDict.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..bdbafa4d4a8d21fbdf164de08310b4c5fe1b5eb7
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionDict.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_PhotonVertexSelectionDict_H
+#define PhotonVertexSelection_PhotonVertexSelectionDict_H
+
+#include "PhotonVertexSelection/IPhotonVertexSelectionTool.h"
+#include "PhotonVertexSelection/PhotonVertexSelectionTool.h"
+
+#include "PhotonVertexSelection/IPhotonPointingTool.h"
+#include "PhotonVertexSelection/PhotonPointingTool.h"
+
+#include "PhotonVertexSelection/IElectronRemovalTool.h"
+#include "PhotonVertexSelection/ElectronRemovalTool.h"
+
+#include "PhotonVertexSelection/PhotonVertexHelpers.h"
+
+namespace {
+  struct GCCXML_DUMMY_INSTANTIATION_PhotonVertexSelection {
+    std::pair<const xAOD::Vertex*, float> pair1;
+    std::vector<std::pair<const xAOD::Vertex*, float> > vector1;
+  };
+}
+
+#ifdef ASGTOOL_STANDALONE
+
+// Helper macro for declaring the setProperty functions to the dictionary:
+#define SETPROPERTY_INSTAN( TYPE )                                            \
+   template StatusCode asg::AsgTool::setProperty< TYPE >( const std::string&, \
+                                                          const TYPE& )
+
+// Declare all possible setProperty template instantiations to Reflex:
+SETPROPERTY_INSTAN( ToolHandle<CP::IPhotonPointingTool > );
+
+// Make the compiler forget about this macro now...
+#undef SETPROPERTY_INSTAN
+
+#endif // ASGTOOL_STANDALONE
+
+
+#endif // PhotonVertexSelection_PhotonVertexSelectionDict_H
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionTool.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..53b2d0605d5d518a6a4a439adf89033a90b3718d
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/PhotonVertexSelectionTool.h
@@ -0,0 +1,114 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef PhotonVertexSelection_PhotonVertexSelectionTool_h
+#define PhotonVertexSelection_PhotonVertexSelectionTool_h
+
+// Framework includes
+#include "AsgTools/AsgTool.h"
+#include "AsgTools/AnaToolHandle.h"
+
+// EDM includes
+#include "xAODEgamma/PhotonContainer.h"
+
+// Local includes
+#include "PhotonVertexSelection/IPhotonVertexSelectionTool.h"
+
+// Forward declarations
+namespace TMVA { class Reader; }
+namespace CP { class IPhotonPointingTool; }
+
+namespace CP {
+
+  /// Implementation for the photon vertex selection tool
+  ///
+  /// Takes a list of photons (for example, to two leading photons) and
+  /// the most likely primary vertex, based on an MVA.
+  ///
+  /// @author Christopher Meyer <chris.meyer@cern.ch>
+  /// @author Bruno Lenzi <bruno.lenzi@cern.ch>
+  ///
+  class PhotonVertexSelectionTool : public virtual IPhotonVertexSelectionTool,
+                                    public asg::AsgTool {
+
+    /// Create a proper constructor for Athena
+    ASG_TOOL_CLASS(PhotonVertexSelectionTool, CP::IPhotonVertexSelectionTool)
+
+  private:
+    /// Configuration variables
+    std::string m_configFileCase1; 
+    std::string m_configFileCase2; 
+    float       m_convPtCut;
+    bool        m_updatePointing;
+    std::string m_vertexContainerName;
+    std::string m_derivationPrefix;
+
+    /// PhotonPointingTool
+    asg::AnaToolHandle<CP::IPhotonPointingTool> m_pointingTool;
+
+    /// MVA readers
+    TMVA::Reader *m_mva1;
+    TMVA::Reader *m_mva2;
+
+    /// MVA attached discriminating variables
+    float m_sumPt2;
+    float m_sumPt;
+    float m_deltaPhi;
+    float m_deltaZ;
+    
+    /// Last case treated (see below)
+    int m_case;
+
+    /// Store results of MVA output
+    std::vector<std::pair<const xAOD::Vertex*, float> > m_vertexMLP;
+
+  private:
+    /// Get combined 4-vector of photon container
+    TLorentzVector getEgammaVector(const xAOD::EgammaContainer *egammas) const;
+
+    /// Sort MLP results
+    static bool sortMLP(const std::pair<const xAOD::Vertex*, float> &a, const std::pair<const xAOD::Vertex*, float> &b);
+    
+
+  public:
+    PhotonVertexSelectionTool(const std::string &name);
+    virtual ~PhotonVertexSelectionTool();
+
+    /// @name Function(s) implementing the asg::IAsgTool interface
+    /// @{
+    
+    /// Function initialising the tool
+    virtual StatusCode initialize();
+      
+    /// @}
+
+    /// @name Function(s) implementing the IPhotonVertexSelectionTool interface
+    /// @{
+    
+    /// Given a list of photons, return the most likely vertex based on MVA likelihood
+    StatusCode getVertex(const xAOD::EgammaContainer &egammas, const xAOD::Vertex* &vertex, bool ignoreConv = false);
+
+    /// Given a list of photons, return the MLPs of all vertices in the event
+    std::vector<std::pair<const xAOD::Vertex*, float> >& getVertex(const xAOD::EgammaContainer &egammas, bool ignoreConv = false);
+    
+    /// Return the last case treated:
+    /// 0=conv track associated to vertex,
+    /// 1=at least one conv track with Si hits, 
+    /// 2=no tracks with Si hits or conversions ignored
+    int getCase() const { return m_case; }
+    
+    /// Get possible vertex directly associated with photon conversions
+    const xAOD::Vertex* getPrimaryVertexFromConv(const xAOD::PhotonContainer *photons) const;
+
+    /// Get access to the photon pointing tool
+    const CP::IPhotonPointingTool* photonPointingTool() const;
+
+    /// @}
+
+  }; // class PhotonVertexSelectionTool
+
+} // namespace CP
+
+
+#endif // PhotonVertexSelection_PhotonVertexSelectionTool_h
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/selection.xml b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d985284758ef47a7302e782f67515e0665f3d072
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/PhotonVertexSelection/selection.xml
@@ -0,0 +1,21 @@
+<lcgdict>
+
+  <class name="CP::IPhotonVertexSelectionTool" />
+  <class name="CP::PhotonVertexSelectionTool" />
+
+  <class name="CP::IPhotonPointingTool" />
+  <class name="CP::PhotonPointingTool" />
+  
+  <class name="CP::IElectronRemovalTool" />
+  <class name="CP::ElectronRemovalTool" />
+
+  <class name="asg::AnaToolHandle<CP::IPhotonVertexSelectionTool>" />
+  <class name="asg::AnaToolHandle<CP::IPhotonPointingTool>" />
+  <class name="asg::AnaToolHandle<CP::IElectronRemovalTool>" />
+  
+  <function pattern="xAOD::PVHelpers::*" />
+  
+  <class name="std::pair<const xAOD::Vertex*, float>" />
+  <class name="std::vector<std::pair<const xAOD::Vertex*, float> >" />
+
+</lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/ElectronRemovalTool.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/ElectronRemovalTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..be9f7bb144a42f0c517c08cfd7fa0624ce5f20bf
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/ElectronRemovalTool.cxx
@@ -0,0 +1,206 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Local includes
+#include "PhotonVertexSelection/ElectronRemovalTool.h"
+#include "PhotonVertexSelection/PhotonVertexHelpers.h"
+
+// EDM includes
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "xAODEgamma/EgammaDefs.h"
+
+// Framework includes
+#include "PathResolver/PathResolver.h"
+
+// ROOT includes
+
+// std includes
+#include <algorithm>
+
+namespace CP {
+
+  //____________________________________________________________________________
+
+
+  //____________________________________________________________________________
+  ElectronRemovalTool::ElectronRemovalTool(const std::string &name)
+  : asg::AsgTool(name)
+  { 
+  
+  }
+
+  //____________________________________________________________________________
+  ElectronRemovalTool::~ElectronRemovalTool()
+  {
+  
+  }
+
+  //____________________________________________________________________________
+  StatusCode ElectronRemovalTool::initialize()
+  {
+    ATH_MSG_INFO("Initializing ElectronRemovalTool...");
+    
+    return StatusCode::SUCCESS;
+  }
+
+  //____________________________________________________________________________
+  StatusCode ElectronRemovalTool::removeElectronsFromVertex(xAOD::VertexContainer & output, const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo) const{
+ 
+
+    std::vector<const xAOD::TrackParticle *> electronsInDetTrackParticles = getElectronTPs(toRemove);
+
+    int element_counter=0;
+    //loop over input vertices
+    for (const xAOD::Vertex* v : input) {
+      bool containsElectrons = false;
+      xAOD::Vertex * nv = new xAOD::Vertex;
+      //set output aux info to be same as input (for time being)
+      nv->makePrivateStore(v);
+      
+      std::vector< ElementLink< xAOD::TrackParticleContainer > >::iterator InDetTrackParticleLinksIter;
+      std::vector< ElementLink< xAOD::TrackParticleContainer > > InDetTrackParticleLinksToKeep =  v->trackParticleLinks(); //for modifying
+      
+      //loop over TrackPArticles associated to vertex
+      for(InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.begin();InDetTrackParticleLinksIter != InDetTrackParticleLinksToKeep.end();){
+	const xAOD::TrackParticle * TPtoTest = (*(InDetTrackParticleLinksIter->cptr()));
+	//checking if any of the Vertex TrackParticles are the same as the electron TrackParticles
+	if(find(electronsInDetTrackParticles.begin(),electronsInDetTrackParticles.end(),TPtoTest)!=electronsInDetTrackParticles.end()){
+	  //remove the common ones
+	  InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.erase(InDetTrackParticleLinksIter);//iterator should be moved to next valid one after removal
+	  containsElectrons = true;	
+	}
+	
+	else ++InDetTrackParticleLinksIter; //move iterator forward 'by hand' if we don't remove link
+      }   
+      
+      if(containsElectrons){
+	//if the vertex contains an electron TP, clear its tracks, and replace with the element links from above (excluding electron)
+	nv->clearTracks();
+	nv->setTrackParticleLinks(InDetTrackParticleLinksToKeep);
+      }
+      
+      if(updateAuxInfo){
+	nv->auxdecor<float>("sumPt")= xAOD::PVHelpers::getVertexSumPt(nv, 1,false);
+	nv->auxdecor<float>("sumPt2")= xAOD::PVHelpers::getVertexSumPt(nv, 2,false);
+      }
+      
+      output.push_back(nv);
+      element_counter++;
+    }
+    
+    return StatusCode::SUCCESS;
+  }
+
+  StatusCode ElectronRemovalTool::removeElectronsFromVertex(xAOD::VertexContainer & vertices, xAOD::ElectronContainer & toRemove, bool updateAuxInfo) const{
+
+    
+    std::vector<const xAOD::TrackParticle *> electronsInDetTrackParticles = getElectronTPs(toRemove);
+
+    int element_counter=0;
+    //loop over input vertices
+    for (xAOD::Vertex* v : vertices) {
+      bool containsElectrons = false;
+      
+      std::vector< ElementLink< xAOD::TrackParticleContainer > >::iterator InDetTrackParticleLinksIter;
+      std::vector< ElementLink< xAOD::TrackParticleContainer > > InDetTrackParticleLinksToKeep =  v->trackParticleLinks(); //for modifying
+      
+      //loop over TrackPArticles associated to vertex
+      for(InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.begin();InDetTrackParticleLinksIter != InDetTrackParticleLinksToKeep.end();){
+	const xAOD::TrackParticle * TPtoTest = (*(InDetTrackParticleLinksIter->cptr()));
+	//checking if any of the Vertex TrackParticles are the same as the electron TrackParticles
+	if(find(electronsInDetTrackParticles.begin(),electronsInDetTrackParticles.end(),TPtoTest)!=electronsInDetTrackParticles.end()){
+	  //remove the common ones
+	  InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.erase(InDetTrackParticleLinksIter);//iterator should be moved to next valid one after removal
+	  containsElectrons = true;	
+	}
+	
+	else ++InDetTrackParticleLinksIter; //move iterator forward 'by hand' if we don't remove link
+      }   
+      
+      if(containsElectrons){
+	//if the vertex contains an electron TP, clear its tracks, and replace with the element links from above (excluding electron)
+	v->clearTracks();
+	v->setTrackParticleLinks(InDetTrackParticleLinksToKeep);
+      }
+      
+      if(updateAuxInfo){
+	v->auxdecor<float>("sumPt")= xAOD::PVHelpers::getVertexSumPt(v, 1,false);
+	v->auxdecor<float>("sumPt2")= xAOD::PVHelpers::getVertexSumPt(v, 2,false);
+      }
+      
+      element_counter++;
+    }
+
+    return StatusCode::SUCCESS;
+
+  }
+
+  xAOD::VertexContainer * ElectronRemovalTool::removeElectronsFromVertex(const xAOD::VertexContainer & input, xAOD::ElectronContainer & toRemove, bool updateAuxInfo) const{
+
+    xAOD::VertexContainer * output = new xAOD::VertexContainer;
+    
+    std::vector<const xAOD::TrackParticle *> electronsInDetTrackParticles = getElectronTPs(toRemove);
+    
+    int element_counter=0;
+    //loop over input vertices
+    for (const xAOD::Vertex* v : input) {
+      bool containsElectrons = false;
+      xAOD::Vertex * nv = new xAOD::Vertex;
+      //set output aux info to be same as input (for time being)
+      nv->makePrivateStore(v);
+      
+      std::vector< ElementLink< xAOD::TrackParticleContainer > >::iterator InDetTrackParticleLinksIter;
+      std::vector< ElementLink< xAOD::TrackParticleContainer > > InDetTrackParticleLinksToKeep =  v->trackParticleLinks(); //for modifying
+      
+      //loop over TrackPArticles associated to vertex
+      for(InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.begin();InDetTrackParticleLinksIter != InDetTrackParticleLinksToKeep.end();){
+	const xAOD::TrackParticle * TPtoTest = (*(InDetTrackParticleLinksIter->cptr()));
+	//checking if any of the Vertex TrackParticles are the same as the electron TrackParticles
+	if(find(electronsInDetTrackParticles.begin(),electronsInDetTrackParticles.end(),TPtoTest)!=electronsInDetTrackParticles.end()){
+	  //remove the common ones
+	  InDetTrackParticleLinksIter = InDetTrackParticleLinksToKeep.erase(InDetTrackParticleLinksIter);//iterator should be moved to next valid one after removal
+	  containsElectrons = true;	
+	}
+	
+	else ++InDetTrackParticleLinksIter; //move iterator forward 'by hand' if we don't remove link
+      }   
+      
+      if(containsElectrons){
+	//if the vertex contains an electron TP, clear its tracks, and replace with the element links from above (excluding electron)
+	nv->clearTracks();
+	nv->setTrackParticleLinks(InDetTrackParticleLinksToKeep);
+      }
+      
+      if(updateAuxInfo){
+	nv->auxdecor<float>("sumPt")= xAOD::PVHelpers::getVertexSumPt(nv, 1,false);
+	nv->auxdecor<float>("sumPt2")= xAOD::PVHelpers::getVertexSumPt(nv, 2,false);
+      }
+      
+      output->push_back(nv);
+      element_counter++;
+    }
+
+    return output;
+
+  }
+
+
+  std::vector<const xAOD::TrackParticle *> ElectronRemovalTool::getElectronTPs( xAOD::ElectronContainer & electrons) const {
+    
+    //get TrackParticles for electrons
+    std::vector<const xAOD::TrackParticle *> electronsInDetTrackParticles;
+
+    for (const xAOD::Electron* e : electrons) {
+      std::set<const xAOD::TrackParticle *> singleElectronInDetTrackParticles =  xAOD::EgammaHelpers::getTrackParticles(e);	 
+      //track particles from both electrons in single vector, since we want to remove them all anyway
+      electronsInDetTrackParticles.insert(electronsInDetTrackParticles.begin(), singleElectronInDetTrackParticles.begin(),singleElectronInDetTrackParticles.end());
+    } 
+  
+    return electronsInDetTrackParticles;
+  }
+
+} // namespace CP
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonPointingTool.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonPointingTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b6bd9953db633f970c92b5ae8d793db667a899e3
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonPointingTool.cxx
@@ -0,0 +1,332 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Local includes
+#include "PhotonVertexSelection/PhotonPointingTool.h"
+#include "PhotonVertexSelection/PhotonVertexHelpers.h"
+
+// EDM includes
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODEgamma/EgammaDefs.h"
+
+// Framework includes
+#include "IsolationCorrections/ShowerDepthTool.h"
+#include "PathResolver/PathResolver.h"
+
+// ROOT includes
+#include "TFile.h"
+#include "TH1F.h"
+
+// std includes
+#include <algorithm>
+
+namespace CP {
+
+  //____________________________________________________________________________
+  SG::AuxElement::Decorator<float> PhotonPointingTool::zvertex("zvertex");
+  SG::AuxElement::Decorator<float> PhotonPointingTool::errz("errz");
+  SG::AuxElement::Decorator<float> PhotonPointingTool::HPV_zvertex("HPV_zvertex");
+  SG::AuxElement::Decorator<float> PhotonPointingTool::HPV_errz("HPV_errz");
+
+  //____________________________________________________________________________
+  PhotonPointingTool::PhotonPointingTool(const std::string &name)
+  : asg::AsgTool(name)
+  , m_showerTool(nullptr)
+  , m_zCorrection(nullptr)
+  { 
+    declareProperty("isSimulation", m_isMC);
+    declareProperty("zOscillationFileMC", m_zOscFileMC ="PhotonVertexSelection/v1/pointing_correction_mc.root");
+    declareProperty("zOscillationFileData", m_zOscFileData ="PhotonVertexSelection/v1/pointing_correction_data.root");
+  }
+
+  //____________________________________________________________________________
+  PhotonPointingTool::~PhotonPointingTool()
+  {
+    SafeDelete(m_showerTool);
+    SafeDelete(m_zCorrection);
+  }
+
+  //____________________________________________________________________________
+  StatusCode PhotonPointingTool::initialize()
+  {
+    ATH_MSG_INFO("Initializing PhotonPointingTool...");
+
+    // Shower depth tool
+    m_showerTool = new CP::ShowerDepthTool();
+    if (!m_showerTool->initialize()) {
+      ATH_MSG_ERROR("Couldn't initialize ShowerDepthTool, failed to initialize.");
+      return StatusCode::FAILURE;
+    }
+    
+
+    // Get the z-oscillation correction histogram
+    // FIXME: The files need to go to calib area
+    #if ( defined(XAOD_STANDALONE) )
+    {
+        // AnalysisRelease: determine if this is data or MC
+        // Cannot load the eventInfo before the first event in athena    
+      const xAOD::EventInfo *eventInfo = nullptr;
+      if (evtStore()->retrieve(eventInfo, "EventInfo").isFailure()) {
+        ATH_MSG_WARNING("Couldn't retrieve EventInfo from TEvent, failed to initialize.");
+        return StatusCode::FAILURE;
+      }    
+      m_isMC = eventInfo->eventType(xAOD::EventInfo::IS_SIMULATION);
+    }
+    #endif
+    std::string filepath = PathResolverFindCalibFile(m_isMC ? m_zOscFileMC :
+                                                              m_zOscFileData);
+    TFile *file = TFile::Open(filepath.c_str(), "READ");
+
+    if (file == nullptr) {
+      ATH_MSG_WARNING("Couldn't find file for z-correction: " << filepath.c_str());
+      ATH_MSG_WARNING("Failed to initialize.");
+      return StatusCode::FAILURE;
+    }
+
+    TH1F *temp = nullptr;
+    file->GetObject("dz_trk_pointing_vs_etas2", temp);
+
+    if (temp == nullptr) {
+      ATH_MSG_WARNING("Couldn't find 'dz_trk_pointing_vs_etas2' histogram in file: " << filepath.c_str());
+      ATH_MSG_WARNING("Failed to initialize.");
+      return StatusCode::FAILURE;
+    }
+
+    bool status = TH1::AddDirectoryStatus();
+    TH1::AddDirectory(false);
+    m_zCorrection = dynamic_cast<TH1F*>(temp->Clone("zCorrection"));
+    SafeDelete(file);
+    TH1::AddDirectory(status);
+    
+    return StatusCode::SUCCESS;
+  }
+
+  //____________________________________________________________________________
+  StatusCode PhotonPointingTool::updatePointingAuxdata(const xAOD::EgammaContainer &egammas) const
+  {
+    // Loop over photons and add calo pointing auxdata
+    std::pair<float, float> result;
+    for (auto egamma: egammas) {
+      // Get calo pointing variables
+      result = getCaloPointing(egamma);
+
+      // Set photon auxdata with new value
+      zvertex(*egamma) = result.first;
+      errz(*egamma)    = result.second;
+
+      // Get conv pointing variables
+      if (egamma->type() == xAOD::Type::Photon) {
+        const xAOD::Egamma *eg     = static_cast<const xAOD::Egamma*>(egamma);
+        const xAOD::Photon *photon = dynamic_cast<const xAOD::Photon*>(eg);
+
+        if (photon && xAOD::EgammaHelpers::numberOfSiTracks(photon))
+          result = getConvPointing(photon);
+      }
+
+      // Set photon auxdata with new value
+      HPV_zvertex(*egamma) = result.first;
+      HPV_errz(*egamma)    = result.second;
+
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  //____________________________________________________________________________
+  float PhotonPointingTool::getCorrectedZ(float zPointing, float etas2) const
+  {
+    if (fabs(etas2) < 1.37) return zPointing;
+    return zPointing - m_zCorrection->Interpolate(etas2);
+  }
+
+  //____________________________________________________________________________
+  std::pair<float, float> PhotonPointingTool::getCaloPointing(const xAOD::Egamma *egamma) const
+  {
+    if (egamma == nullptr) {
+      ATH_MSG_WARNING("Passed Egamma was a nullptr, returning (0,0).");
+      return std::make_pair(0,0);
+    }
+
+    // Get the EventInfo
+    const xAOD::EventInfo *eventInfo = nullptr;
+    if (evtStore()->retrieve(eventInfo, "EventInfo").isFailure()) {
+      ATH_MSG_WARNING("Couldn't retrieve EventInfo from TEvent, egamma won't be decorated.");
+      return std::make_pair(0, 0);
+    }
+
+    // Beam parameters
+    double d_beamSpot   = hypot(eventInfo->beamPosY(), eventInfo->beamPosX());
+    double phi_beamSpot = atan2(eventInfo->beamPosY(), eventInfo->beamPosX());
+
+    // Photon variables
+    const xAOD::CaloCluster *cluster = egamma->caloCluster();
+    if (cluster == nullptr) {
+      ATH_MSG_WARNING("Couldn't retrieve CaloCluster from Photon, egammas won't be decorated.");
+      return std::make_pair(0, 0);
+    }
+
+    float cl_e     = cluster->e();
+    float etas1    = cluster->etaBE(1);
+    float etas2    = cluster->etaBE(2);
+    float phis2    = cluster->phiBE(2);
+    float cl_theta = 2.0*atan(exp(-1.0*cluster->eta()));
+
+    // Shower depths
+    std::pair<float, float> RZ1 = m_showerTool->getRZ(etas1, 1);
+    std::pair<float, float> RZ2 = m_showerTool->getRZ(etas2, 2);
+
+    // Calo cluster pointing calculation
+    double r0_with_beamSpot = d_beamSpot*cos(phis2 - phi_beamSpot);
+
+    float zvertex = 0, errz = 0;
+    if (true) { // FIXME Was only for non AuthorFwd egamma? Can only find AuthorFwdElectron now...
+      zvertex = (RZ1.second*(RZ2.first - r0_with_beamSpot) - RZ2.second*(RZ1.first-r0_with_beamSpot)) / (RZ2.first - RZ1.first);
+      zvertex = getCorrectedZ(zvertex, etas2);
+
+      errz    = 0.5*(RZ2.first + RZ1.first)*(0.060/sqrt(cl_e*0.001)) / (sin(cl_theta)*sin(cl_theta));
+    }
+
+    return std::make_pair(zvertex, errz);
+  }
+
+  //____________________________________________________________________________
+  std::pair<float, float> PhotonPointingTool::getConvPointing(const xAOD::Photon *photon) const
+  {
+    if (photon == nullptr) {
+      ATH_MSG_WARNING("Passed Egamma was a nullptr, returning (0,0).");
+      return std::make_pair(0,0);
+    }
+
+    // Get the EventInfo
+    const xAOD::EventInfo *eventInfo = nullptr;
+    if (evtStore()->retrieve(eventInfo, "EventInfo").isFailure()) {
+      ATH_MSG_WARNING("Couldn't retrieve EventInfo from TEvent, photons won't be decorated.");
+      return std::make_pair(0, 0);
+    }
+
+    // Beam parameters
+    double d_beamSpot   = hypot(eventInfo->beamPosY(), eventInfo->beamPosX());
+    double phi_beamSpot = atan2(eventInfo->beamPosY(), eventInfo->beamPosX());
+
+    // Photon variables
+    const xAOD::CaloCluster *cluster = photon->caloCluster();
+    if (cluster == nullptr) {
+      ATH_MSG_WARNING("Couldn't retrieve CaloCluster from Photon, photons won't be decorated.");
+      return std::make_pair(0, 0);
+    }
+
+    float etas1    = cluster->etaBE(1);
+    float phis2    = cluster->phiBE(2);
+
+    const xAOD::Vertex *conv = photon->vertex();
+    if (cluster == nullptr) {
+      ATH_MSG_WARNING("Couldn't retrieve conversion Vertex from Photon, photons won't be decorated.");
+      return std::make_pair(0, 0);
+    }
+
+    float conv_x = conv->x();
+    float conv_y = conv->y();
+    float conv_z = conv->z();
+
+    // Shower depths
+    std::pair<float, float> RZ1 = m_showerTool->getRZ(etas1, 1);
+
+    // Photon conversion
+    double conv_r = hypot(conv_x, conv_y);
+
+    // HPV pointing calculation
+    double phi_Calo         = atan2(sin(phis2), cos(phis2));
+    double r0_with_beamSpot = d_beamSpot*cos(phi_Calo - phi_beamSpot);
+    
+    float zvertex = (RZ1.second*(conv_r - r0_with_beamSpot) - conv_z*(RZ1.first - r0_with_beamSpot)) / (conv_r - RZ1.first);
+
+    float dist_vtx_to_conv = hypot(conv_r - r0_with_beamSpot, conv_z - zvertex);
+    float dist_conv_to_s1 = hypot(RZ1.first - conv_r, RZ1.second - conv_z);
+
+    float error_etaS1 = 0.001; // FIXME is there a tool which provides a better value?
+    float errz = 0.0;
+
+    if ((cluster->inBarrel() && !cluster->inEndcap()) ||
+        (cluster->inBarrel() &&  cluster->inEndcap() && cluster->eSample(CaloSampling::EMB1) > cluster->eSample(CaloSampling::EME1))) {
+      // Barrel case
+      float error_Z_Calo_1st_Sampling_barrel = error_etaS1*RZ1.first*fabs(cosh(etas1));
+      errz = error_Z_Calo_1st_Sampling_barrel*dist_vtx_to_conv/dist_conv_to_s1;
+    } else { 
+      // Endcap case
+      float error_R_Calo_1st_Sampling_endcap = error_etaS1*cosh(etas1)*RZ1.first*RZ1.first/fabs(RZ1.second);
+      errz = error_R_Calo_1st_Sampling_endcap*fabs(sinh(etas1))*dist_vtx_to_conv/dist_conv_to_s1;
+    }
+
+    return std::make_pair(zvertex, errz);
+  }
+
+  //____________________________________________________________________________
+  float PhotonPointingTool::getCorrectedEta(const xAOD::CaloCluster &cluster, float PVz) const
+  {
+    // Get R/Z positions from sampling layer one eta
+    std::pair<float, float> RZ1 = m_showerTool->getRZ(cluster.etaBE(1), 1);
+
+    // Return corrected eta from new vertex
+    return asinh((RZ1.second - PVz)/RZ1.first);
+  }
+
+  //____________________________________________________________________________
+  StatusCode PhotonPointingTool::correctPrimaryVertex(xAOD::Egamma &egamma, float PVz) const
+  {
+    const xAOD::CaloCluster *cluster = egamma.caloCluster();
+    if (cluster == nullptr) {
+      ATH_MSG_WARNING("Couldn't retrieve cluster from Egamma, not correcting object.");
+      return StatusCode::FAILURE;
+    }
+
+    float eta_corr = getCorrectedEta(*cluster, PVz);
+    
+    // Set corrected 4-vector
+    egamma.setP4(egamma.e()/cosh(eta_corr),
+                 eta_corr,
+                 egamma.phi(),
+                 egamma.m());
+
+    return StatusCode::SUCCESS;
+  }
+  
+  //____________________________________________________________________________
+  TLorentzVector PhotonPointingTool::getCorrectedLV(const xAOD::Egamma &egamma, float PVz) const
+  {
+    TLorentzVector vec = egamma.p4();
+
+    const xAOD::CaloCluster *cluster = egamma.caloCluster();
+    if (cluster == nullptr) {
+      ATH_MSG_WARNING("Couldn't retrieve cluster from Egamma, returning uncorrected object");
+      return vec;
+    }
+
+    float eta_corr = getCorrectedEta(*cluster, PVz);
+    
+    // Set corrected 4-vector
+    vec.SetPtEtaPhiM(egamma.e()/cosh(eta_corr),
+                     eta_corr,
+                     egamma.phi(),
+                     egamma.m());
+
+    return vec;
+  }
+  
+  //____________________________________________________________________________
+  float PhotonPointingTool::getCorrectedMass(const xAOD::EgammaContainer &egammas, float PVz) const
+  {
+    TLorentzVector v;
+    for (auto eg : egammas) {
+      if (!eg) {
+        ATH_MSG_WARNING("Null pointer to egamma object, skipping it in mass calculation");
+        continue;
+      }
+      v += getCorrectedLV(*eg, PVz);
+    }
+    return v.M();  
+  }
+
+} // namespace CP
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..06793909d295915ffa5a1f7cba955c489b888da3
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx
@@ -0,0 +1,243 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Local includes
+#include "PhotonVertexSelection/PhotonVertexHelpers.h"
+
+// EDM includes
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+
+// Asg tools
+#include "IsolationCorrections/ShowerDepthTool.h"
+
+// Messaging
+#define ATH_MSG_WARNING( MSG ) \
+  std::cout << "PhotonVertexHelpers" << std::string( 21, ' ' ) \
+            << "WARNING " << MSG << std::endl;
+
+
+#define CHECK_AND_RETURN( METHODNAME, EXP, RETURNVALUE ) {         \
+  if ( EXP )                                                       \
+  {                                                                \
+    ATH_MSG_WARNING(METHODNAME << ": (" << #EXP                    \
+                    << "), returning " << #RETURNVALUE);           \
+    return RETURNVALUE;                                            \
+  }                                                                \
+}
+
+namespace xAOD {
+  namespace PVHelpers {
+
+    //__________________________________________________________________________
+    const xAOD::Vertex* getHardestVertex(const xAOD::VertexContainer *vertices)
+    {
+      // Check PV collection
+      CHECK_AND_RETURN("getHardestVertex", vertices == nullptr, nullptr);
+
+      // Check for primary vertex in collection
+      for (auto vertex: *vertices) {
+        if (vertex->vertexType() == xAOD::VxType::VertexType::PriVtx)
+          return vertex;
+      }
+      
+      // Couldn't find one
+      ATH_MSG_WARNING( "getHardestVertex(): "
+                       << "Couldn't find a primary vertex, returning nullptr." );
+      return nullptr;
+    }
+
+    //__________________________________________________________________________
+    std::pair<float, float> getZCommonAndError(const xAOD::EventInfo *eventInfo,
+                                               const xAOD::EgammaContainer *egammas,
+                                               float convPtCut)
+    {
+      // Static accessors
+      static SG::AuxElement::Accessor<float> zvertex("zvertex");
+      static SG::AuxElement::Accessor<float> errz("errz");
+      static SG::AuxElement::Accessor<float> HPV_zvertex("HPV_zvertex");
+      static SG::AuxElement::Accessor<float> HPV_errz("HPV_errz");
+
+      // Clear values
+      float zCommon = 0.0, zCommonError = 0.0;
+
+      // Check eventInfo
+      CHECK_AND_RETURN("getZCommonAndError", eventInfo == nullptr, std::make_pair(0.0, 0.0));
+
+      // Beam position is the base for zCommon weighted average
+      double beamPosZ      = eventInfo->beamPosZ();
+      double beamPosSigmaZ = eventInfo->beamPosSigmaZ();
+
+      zCommon       = beamPosZ/beamPosSigmaZ/beamPosSigmaZ;
+      zCommonError  = 1.0     /beamPosSigmaZ/beamPosSigmaZ;
+
+      // Include z-position pointed at by egammas
+      for (const xAOD::Egamma* egamma: *egammas) {
+        if (egamma == nullptr) {
+          ATH_MSG_WARNING("Null pointer to egamma object, excluding from ZCommon calculation");
+          continue;
+        }
+
+        const xAOD::Photon *photon = nullptr;
+        if (egamma->type() == xAOD::Type::Photon)
+          photon = dynamic_cast<const xAOD::Photon*>(egamma);
+
+        if (photon && passConvSelection(photon, convPtCut)) {
+          if (!HPV_zvertex.isAvailable(*photon) || !HPV_errz.isAvailable(*photon)) {
+            ATH_MSG_WARNING( "setZCommon: Skipping photon not decorated with " <<
+                             "HPV_zvertex/HPV_errz information, FIX THIS!" );
+            continue;
+          }
+          if (HPV_errz(*photon) == 0.0) {
+            ATH_MSG_WARNING( "setZCommon: HPV_errz == 0, skipping this photon!" );
+            continue;
+          }
+          zCommon      += HPV_zvertex(*photon)/HPV_errz(*photon)/HPV_errz(*photon);
+          zCommonError += 1.0                 /HPV_errz(*photon)/HPV_errz(*photon);
+        } else {
+          if (!zvertex.isAvailable(*egamma) || !errz.isAvailable(*egamma)) {
+            ATH_MSG_WARNING( "setZCommon: Skipping photon not decorated with " <<
+                             "zvertex/errz information, FIX THIS!" );
+            continue;
+          }
+          if (errz(*egamma) == 0.0) {
+            ATH_MSG_WARNING( "setZCommon: errz == 0, skipping this photon!" );
+            continue;
+          }
+          zCommon      += zvertex(*egamma)/errz(*egamma)/errz(*egamma);
+          zCommonError += 1.0             /errz(*egamma)/errz(*egamma);
+        }
+      }
+
+      // Normalize by error (weighted average)
+      zCommon     /= zCommonError;
+      zCommonError = 1.0/sqrt(zCommonError);
+
+      return std::make_pair(zCommon, zCommonError);
+    }
+    
+    //____________________________________________________________________________
+    bool passConvSelection(const xAOD::Vertex& conversionVertex,
+                           size_t i,
+                           float convPtCut)
+    {
+        const xAOD::TrackParticle *tp = conversionVertex.trackParticle(i);
+        CHECK_AND_RETURN("passConvSelection", tp == nullptr, false);
+        
+        if (!xAOD::EgammaHelpers::numberOfSiHits(tp)) return false;
+        // pt1,pt2 is only set for 2-track vertices
+        if (conversionVertex.nTrackParticles() == 1)
+          return xAOD::EgammaHelpers::momentumAtVertex(conversionVertex).perp() > convPtCut;
+        
+        std::string s = Form("pt%lu", i+1);
+        return (conversionVertex.isAvailable<float>(s) &&
+                conversionVertex.auxdata<float>(s) > convPtCut);
+    }
+
+    //____________________________________________________________________________
+    bool passConvSelection(const xAOD::Photon *photon,
+                           float convPtCut)
+    {
+      CHECK_AND_RETURN("passConvSelection", photon == nullptr, false);
+      const xAOD::Vertex *conversionVertex = photon->vertex();
+      if (conversionVertex == nullptr) return false;
+
+      size_t NumberOfTracks = conversionVertex->nTrackParticles();
+      for (size_t i = 0; i < NumberOfTracks; ++i) {
+        if (passConvSelection(*conversionVertex, i, convPtCut)) return true;
+      }
+
+      return false;
+    }
+
+    //__________________________________________________________________________
+    TLorentzVector getTrackAtFirstMeasurement(const xAOD::TrackParticle *tp)
+    {
+      CHECK_AND_RETURN("getTrackAtFirstMeasurement", tp == nullptr, TLorentzVector());
+
+      static SG::AuxElement::ConstAccessor<std::vector<float> > accParameterPX("parameterPX");
+      static SG::AuxElement::ConstAccessor<std::vector<float> > accParameterPY("parameterPY");
+      
+      TLorentzVector v;
+      v.SetPtEtaPhiM(tp->pt(), tp->eta(), tp->phi(), 0.);
+      if (!accParameterPX.isAvailable(*tp) || !accParameterPY.isAvailable(*tp)) {
+        ATH_MSG_WARNING("getTrackAtFirstMeasurement(): "
+                        << "Could not find first parameter, returning default pt." );
+        return v;
+      }
+
+      for (unsigned int i = 0; i < accParameterPX(*tp).size(); ++i) {
+        if (tp->parameterPosition(i) == xAOD::FirstMeasurement) {
+          v.SetPxPyPzE(accParameterPX(*tp)[i], accParameterPY(*tp)[i], 0, 0);
+          return v;
+        }
+      }
+
+      ATH_MSG_WARNING("getTrackAtFirstMeasurement(): "
+                      << "Could not find first parameter, returning default pt." );
+      return v;
+    }
+
+    //__________________________________________________________________________
+    TLorentzVector getVertexMomentum(const xAOD::Vertex *vertex, bool useAux /* true */, std::string derivationPrefix /* "" */)
+    {
+      TLorentzVector v;
+      CHECK_AND_RETURN("getVertexMomentum", vertex == nullptr, v);
+
+      SG::AuxElement::ConstAccessor<float> pt (derivationPrefix + "pt" );
+      SG::AuxElement::ConstAccessor<float> eta(derivationPrefix + "eta");
+      SG::AuxElement::ConstAccessor<float> phi(derivationPrefix + "phi");
+      
+      if (useAux                   and
+          pt .isAvailable(*vertex) and
+          eta.isAvailable(*vertex) and
+          phi.isAvailable(*vertex) )
+      {
+        v.SetPtEtaPhiM(pt (*vertex),
+                       eta(*vertex),
+                       phi(*vertex), 0.0);
+        return v;
+      }
+
+      // Sum the 4-momenta of all track particles at the vertex
+      const xAOD::TrackParticle *tp = nullptr;
+      for (size_t i = 0; i < vertex->nTrackParticles(); ++i) {
+        tp = vertex->trackParticle(i);
+        if (tp == nullptr)
+        {
+          ATH_MSG_WARNING("getVertexMomentum: null pointer to trackParticle." <<
+                          " Are you running on a thinned sample?" );
+          continue; // protect against thinned tracks
+        }
+        v += tp->p4();
+      }
+      return v;
+    }
+
+    //__________________________________________________________________________
+    float getVertexSumPt(const xAOD::Vertex *vertex, int power, bool useAux /* = true */)
+    {
+      CHECK_AND_RETURN("getVertexSumPt", vertex == nullptr, 0.0);
+      
+      std::string pw = (power == 1) ? "sumPt" : Form("sumPt%d", power);
+      if (useAux and vertex->isAvailable<float>(pw))
+        return vertex->auxdata<float>(pw);
+    
+      // Loop over all track particles, sum up their pt
+      float pt = 0.0;
+      const xAOD::TrackParticle *tp = nullptr;
+      for (size_t i = 0; i < vertex->nTrackParticles(); ++i) {
+        tp = vertex->trackParticle(i);
+        if (tp == nullptr) continue; // protect against slimmed tracks
+
+        pt += pow(tp->pt()/1e3, power);
+      }
+      return pt;
+    }
+
+  } // namespace PVHelpers
+} // namespace xAOD
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexSelectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexSelectionTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..ee9e67ddbbfafd746741686d8ee428670a32975b
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexSelectionTool.cxx
@@ -0,0 +1,315 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Local includes
+#include "PhotonVertexSelection/PhotonVertexSelectionTool.h"
+#include "PhotonVertexSelection/PhotonPointingTool.h"
+#include "PhotonVertexSelection/PhotonVertexHelpers.h"
+
+// EDM includes
+#include "xAODTracking/VertexContainer.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEgamma/EgammaDefs.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+
+// Framework includes
+#include "PathResolver/PathResolver.h"
+#include "IsolationCorrections/ShowerDepthTool.h"
+
+// ROOT includes
+#include "TMVA/Reader.h"
+
+// std includes
+#include <algorithm>
+
+namespace CP {
+
+  //____________________________________________________________________________
+  PhotonVertexSelectionTool::PhotonVertexSelectionTool(const std::string &name)
+  : asg::AsgTool(name)
+  , m_pointingTool("CP::PhotonPointingTool/PhotonVertexSelection", this)
+  , m_mva1(nullptr)
+  , m_mva2(nullptr)
+  , m_case(-1)
+  {
+    declareProperty("ConfigFileCase1",
+        m_configFileCase1 = "PhotonVertexSelection/v1/DiphotonVertex_case1.weights.xml");
+    declareProperty("ConfigFileCase2",
+        m_configFileCase2 = "PhotonVertexSelection/v1/DiphotonVertex_case2.weights.xml");
+    declareProperty("conversionPtCut"      , m_convPtCut       = 2e3 );    
+    declareProperty("updatePointing", m_updatePointing=true, "Update pointing data?");
+    declareProperty("vertexContainer", m_vertexContainerName = "PrimaryVertices");
+    declareProperty("derivationPrefix", m_derivationPrefix = "");
+  }
+
+  //____________________________________________________________________________
+  PhotonVertexSelectionTool::~PhotonVertexSelectionTool()
+  {
+    SafeDelete(m_mva1);
+    SafeDelete(m_mva2);
+  }
+
+  //____________________________________________________________________________
+  StatusCode PhotonVertexSelectionTool::initialize()
+  {
+    ATH_MSG_INFO("Initializing PhotonVertexSelectionTool...");
+
+    // Retrieve PhotonPointingTool
+    if (m_pointingTool.retrieve().isFailure()) {
+      ATH_MSG_ERROR("Couldn't retrieve PhotonPointingTool.");
+      return StatusCode::FAILURE;
+    }
+
+    // Get full path of configuration files for MVA
+    m_configFileCase1  = PathResolverFindCalibFile(m_configFileCase1 );
+    m_configFileCase2  = PathResolverFindCalibFile(m_configFileCase2);
+
+    // Setup MVAs
+    SafeDelete(m_mva1);
+    m_mva1 = new TMVA::Reader("!Color:Silent");
+    m_mva1->AddVariable("deltaZ := TMath::Min(abs(PrimaryVerticesAuxDyn.z-zCommon)/zCommonError,20)", &m_deltaZ         );
+    m_mva1->AddVariable("deltaPhi := abs(deltaPhi(PrimaryVerticesAuxDyn.phi,egamma_phi))"           , &m_deltaPhi       );
+    m_mva1->AddVariable("logSumpt := log10(PrimaryVerticesAuxDyn.sumPt)"                            , &m_sumPt          );
+    m_mva1->AddVariable("logSumpt2 := log10(PrimaryVerticesAuxDyn.sumPt2)"                          , &m_sumPt2         );
+    m_mva1->BookMVA    ("MLP method"                                                                , m_configFileCase1 );
+
+    SafeDelete(m_mva2);
+    m_mva2 = new TMVA::Reader("!Color:Silent");
+    m_mva2->AddVariable("deltaZ := TMath::Min(abs(PrimaryVerticesAuxDyn.z-zCommon)/zCommonError,20)", &m_deltaZ        );
+    m_mva2->AddVariable("deltaPhi := abs(deltaPhi(PrimaryVerticesAuxDyn.phi,egamma_phi))"           , &m_deltaPhi      );
+    m_mva2->AddVariable("logSumpt := log10(PrimaryVerticesAuxDyn.sumPt)"                            , &m_sumPt         );
+    m_mva2->AddVariable("logSumpt2 := log10(PrimaryVerticesAuxDyn.sumPt2)"                          , &m_sumPt2        );
+    m_mva2->BookMVA    ("MLP method"                                                                , m_configFileCase2);
+
+    return StatusCode::SUCCESS;
+  }
+
+  //____________________________________________________________________________
+  std::vector<std::pair<const xAOD::Vertex*, float> >&
+  PhotonVertexSelectionTool::getVertex(const xAOD::EgammaContainer &egammas, bool ignoreConv)
+  {
+    const xAOD::Vertex *vertex = nullptr;
+    if (getVertex(egammas, vertex, ignoreConv).isSuccess()) {
+      std::sort(m_vertexMLP.begin(), m_vertexMLP.end(), sortMLP);
+    }
+
+    return m_vertexMLP;
+  }
+
+  //____________________________________________________________________________
+  StatusCode PhotonVertexSelectionTool::getVertex(const xAOD::EgammaContainer &egammas,
+                                                  const xAOD::Vertex* &prime_vertex,
+                                                  bool ignoreConv)
+  {
+    m_vertexMLP.clear();
+    m_case = -1;
+    const xAOD::PhotonContainer *photons = dynamic_cast<const xAOD::PhotonContainer*>(&egammas);
+
+    // Retrieve PV collection from TEvent
+    const xAOD::VertexContainer* vertices = 0;
+    if (evtStore()->retrieve(vertices, m_vertexContainerName).isFailure()) {
+      ATH_MSG_WARNING("Couldn't retrieve " << m_vertexContainerName << " from TEvent, returning nullptr.");
+      prime_vertex = nullptr;
+      return StatusCode::FAILURE;
+    }
+
+    // Check if a conversion photon has a track attached to a primary/pileup vertex
+    if (!ignoreConv) { 
+      prime_vertex = getPrimaryVertexFromConv(photons);
+      if (prime_vertex != nullptr) {
+        m_case = 0;
+        m_vertexMLP.push_back(std::make_pair(prime_vertex, 0.));
+        return StatusCode::SUCCESS;
+      }
+    }
+
+    // Update calo pointing auxdata for photons
+    // FIXME: Remove once variables properly included in derivations
+    if (m_updatePointing and m_pointingTool->updatePointingAuxdata(egammas).isFailure()) {
+      ATH_MSG_WARNING("Couldn't update photon calo pointing auxdata, returning hardest vertex.");
+      prime_vertex = xAOD::PVHelpers::getHardestVertex(vertices);
+      return StatusCode::FAILURE;
+    }
+  
+    // Get the EventInfo
+    const xAOD::EventInfo *eventInfo = nullptr;
+    if (evtStore()->retrieve(eventInfo, "EventInfo").isFailure()) {
+      ATH_MSG_WARNING("Couldn't retrieve EventInfo from TEvent, returning hardest vertex.");
+      prime_vertex = xAOD::PVHelpers::getHardestVertex(vertices);
+      return StatusCode::FAILURE;
+    }
+
+    // Find the common z-position from beam / photon pointing information
+    std::pair<float, float> zCommon = xAOD::PVHelpers::getZCommonAndError(eventInfo, &egammas, m_convPtCut);
+
+    // If there are any silicon conversions passing selection, use MVA1
+    TMVA::Reader *reader = m_mva2;
+    m_case = 2;
+    if (!ignoreConv && photons) {
+      for (auto photon: *photons) {
+        if (!photon)
+        {
+          ATH_MSG_WARNING("Null pointer to photon");
+          return StatusCode::FAILURE;
+        }
+        if (xAOD::PVHelpers::passConvSelection(photon,
+                                               m_convPtCut))
+        {
+          reader = m_mva1;
+          m_case = 1;
+        }
+      }
+    }
+    ATH_MSG_DEBUG("Case: " << m_case);
+
+    // Vector sum of photons
+    TLorentzVector vegamma = getEgammaVector(&egammas);
+
+    // Loop over vertices and find best candidate
+    float mlp = 0.0, mlp_max = -99999.0;
+    for (auto vertex: *vertices) {
+
+      // Skip dummy vertices
+      if (vertex->vertexType() != xAOD::VxType::VertexType::PriVtx and
+          vertex->vertexType() != xAOD::VxType::VertexType::PileUp) continue;
+
+      // Get momentum vector of vertex
+      TLorentzVector vmom = xAOD::PVHelpers::getVertexMomentum(vertex, true, m_derivationPrefix);
+
+      // Set input variables for MVA
+      static SG::AuxElement::ConstAccessor<float> sumPt(m_derivationPrefix + "sumPt");
+      if (sumPt.isAvailable(*vertex)) {
+        m_sumPt = log10(sumPt(*vertex));
+      } else {
+        m_sumPt  = log10(xAOD::PVHelpers::getVertexSumPt(vertex));
+      }
+
+      static SG::AuxElement::ConstAccessor<float> sumPt2(m_derivationPrefix + "sumPt2");
+      if (sumPt2.isAvailable(*vertex))
+        m_sumPt2 = log10(sumPt2(*vertex));
+      else
+        m_sumPt2 = log10(xAOD::PVHelpers::getVertexSumPt(vertex, 2));
+
+      m_deltaPhi     = fabs(vmom.DeltaPhi(vegamma));
+      m_deltaZ       = fabs((zCommon.first - vertex->z())/zCommon.second);
+      ATH_MSG_VERBOSE("log(sumPt): " << m_sumPt <<
+                      " log(sumPt2): " << m_sumPt2 <<
+                      " deltaPhi: " << m_deltaPhi <<
+                      " deltaZ: " << m_deltaZ);
+
+      // Skip vertices above 10 sigma from pointing or 15 sigma from conversion (HPV)
+      if ((reader == m_mva2 && m_deltaZ > 10) ||
+          (reader == m_mva1 && m_deltaZ > 15)) {
+        mlp = -9999.0;
+      } else {
+        // Get likelihood probability from MVA
+        mlp = reader->EvaluateMVA("MLP method");
+      }
+      ATH_MSG_VERBOSE("MVA output: " << mlp);
+
+      m_vertexMLP.push_back(std::make_pair(vertex, mlp));
+
+      // Keep track of maximal likelihood vertex
+      if (mlp > mlp_max) {
+        mlp_max = mlp;
+        prime_vertex = vertex;
+      }
+
+    } // loop over vertices
+
+    if (mlp_max <= -9999.0) {
+      ATH_MSG_DEBUG("No good vertex candidates from pointing, returning hardest vertex.");
+      prime_vertex = xAOD::PVHelpers::getHardestVertex(vertices);
+      return StatusCode::FAILURE;
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  //____________________________________________________________________________
+  bool PhotonVertexSelectionTool::sortMLP(const std::pair<const xAOD::Vertex*, float> &a,
+                                          const std::pair<const xAOD::Vertex*, float> &b)
+  { return a.second > b.second; }
+
+  //____________________________________________________________________________
+  const xAOD::Vertex* PhotonVertexSelectionTool::getPrimaryVertexFromConv(const xAOD::PhotonContainer *photons) const
+  {
+    if (photons == nullptr) {
+      ATH_MSG_WARNING("Passed nullptr photon container, returning nullptr vertex from getPrimaryVertexFromConv");
+      return nullptr;
+    }
+
+    std::vector<const xAOD::Vertex*> vertices;
+    const xAOD::Vertex *conversionVertex = nullptr, *primary = nullptr;
+    const xAOD::TrackParticle *tp = nullptr;
+    size_t NumberOfTracks = 0;
+
+    for (auto photon: *photons) {
+      conversionVertex = photon->vertex();
+      if (conversionVertex == nullptr) continue;
+
+      NumberOfTracks = conversionVertex->nTrackParticles();
+      for (size_t i = 0; i < NumberOfTracks; ++i) {
+        // Get trackParticle in GSF collection
+        const auto *gsfTp = conversionVertex->trackParticle(i);
+        if (gsfTp == nullptr) continue;
+        if (!xAOD::PVHelpers::passConvSelection(*conversionVertex, i, m_convPtCut)) continue;
+        
+        // Get trackParticle in InDet collection
+        tp = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(gsfTp);
+        if (tp == nullptr) continue;
+
+
+        primary = tp->vertex();
+        if (primary == nullptr) continue;
+
+        if (primary->vertexType() == xAOD::VxType::VertexType::PriVtx ||
+            primary->vertexType() == xAOD::VxType::VertexType::PileUp) {
+          if (std::find(vertices.begin(), vertices.end(), primary) == vertices.end()) {
+            vertices.push_back(primary);
+            continue;
+          }
+        }
+
+      }
+    }
+
+    if (vertices.size() > 0) {
+      if (vertices.size() > 1)
+        ATH_MSG_WARNING("Photons associated to different vertices! Returning lead photon association.");
+      return vertices[0];
+    }
+
+    return nullptr;
+  }
+
+  //____________________________________________________________________________
+  const CP::IPhotonPointingTool* PhotonVertexSelectionTool::photonPointingTool() const
+  {
+    return &*m_pointingTool;
+  }
+
+  //____________________________________________________________________________
+  TLorentzVector PhotonVertexSelectionTool::getEgammaVector(const xAOD::EgammaContainer *egammas) const
+  {
+    TLorentzVector v, v1;
+    const xAOD::CaloCluster *cluster = nullptr;
+    for (auto egamma: *egammas) {
+      cluster = egamma->caloCluster();
+      if (cluster == nullptr) {
+        ATH_MSG_WARNING("No cluster associated to egamma, not adding to 4-vector.");
+        continue;
+      }
+
+      v1.SetPtEtaPhiM(egamma->e()/cosh(cluster->etaBE(2)),
+                      cluster->etaBE(2),
+                      cluster->phiBE(2),
+                      0.0);
+      v += v1;
+    }
+    return v;
+  }
+
+} // namespace CP
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..50330af382fd47d1b4681bc257be96c3e92eb03b
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.cxx
@@ -0,0 +1,97 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// PhotonVertexSelectionAlg.cxx
+
+#include "PhotonVertexSelectionAlg.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "AthContainers/ConstDataVector.h"
+#include "PhotonVertexSelection/IPhotonVertexSelectionTool.h"
+
+namespace CP {
+
+  using std::string;
+  using namespace xAOD;
+
+  //**********************************************************************
+
+  PhotonVertexSelectionAlg::PhotonVertexSelectionAlg(const string& name,
+			 ISvcLocator* pSvcLocator )
+    : ::AthAlgorithm( name, pSvcLocator ),
+      m_vxSelTool("CP::PhotonVertexSelectionTool/PhotonVtxSel")
+  {
+    declareProperty( "InputVertices",  m_inVxColl ="PrimaryVertices"    );
+    declareProperty( "InputPhotons",   m_inGamColl="Photons"            );
+    declareProperty( "OutputVertices", m_outVxColl="HggPrimaryVertices" );
+    declareProperty( "VxSelTool",      m_vxSelTool                      );
+
+  }
+
+  //**********************************************************************
+
+  PhotonVertexSelectionAlg::~PhotonVertexSelectionAlg() { }
+
+  //**********************************************************************
+
+  StatusCode PhotonVertexSelectionAlg::initialize() {
+    ATH_MSG_INFO("Initializing " << name() << "...");
+
+    return StatusCode::SUCCESS;
+  }
+
+  //**********************************************************************
+
+  StatusCode PhotonVertexSelectionAlg::finalize() {
+    ATH_MSG_INFO ("Finalizing " << name() << "...");
+
+    return StatusCode::SUCCESS;
+  }
+
+  //**********************************************************************
+
+  StatusCode PhotonVertexSelectionAlg::execute() { 
+    ATH_MSG_VERBOSE("Executing " << name() << "...");
+
+    VertexContainer* vxOut(new VertexContainer);
+    VertexAuxContainer* vxOutAux(new VertexAuxContainer);
+    vxOut->setStore(vxOutAux);
+    vxOut->push_back(new Vertex);
+    // Immediately add one vertex, because we will always want one in the container.
+    // Strictly speaking, if the event has no vertex, this could wind up being a dummy.
+    ATH_CHECK( evtStore()->record(vxOut, m_outVxColl) );
+    ATH_CHECK( evtStore()->record(vxOutAux, m_outVxColl+"Aux.") );
+
+    const PhotonContainer* photons(0);
+    ATH_CHECK( evtStore()->retrieve(photons, m_inGamColl) );
+
+    ConstDataVector<PhotonContainer> photons_presel(SG::VIEW_ELEMENTS);
+    for(const auto& ph : *photons) {
+      if(acceptPhoton(*ph)) photons_presel.push_back( ph );
+    }
+
+    const Vertex* photonVx(0);
+    if( m_vxSelTool->getVertex(*photons_presel.asDataVector(), photonVx).isSuccess() && photonVx) {
+      *vxOut->front() = *photonVx; // deep copy of photon vertex, to record
+      vxOut->front()->setVertexType(VxType::PriVtx);
+    } else {
+      const VertexContainer* vxIn(0);
+      ATH_CHECK( evtStore()->retrieve(vxIn, m_inVxColl) );
+      for(const auto& vx : *vxIn) {
+	if(vx->vertexType()==VxType::PriVtx) *vxOut->front() = *vx;
+      }
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  //**********************************************************************
+
+  // add some reasonable preselection here a la
+  // https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/HiggsPhys/Run2/HGamma/xAOD/HGamAnalysisFramework/trunk/Root/PhotonHandler.cxx#L511
+  bool PhotonVertexSelectionAlg::acceptPhoton(const xAOD::Photon& /*gam*/) {return true;}
+
+}
+
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.h b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac432211d4d0c38cf3b5fb5d5f3ea4da44e2f80d
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/PhotonVertexSelectionAlg.h
@@ -0,0 +1,51 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// PhotonVertexSelectionAlg.h
+
+#ifndef PhotonVertexSelectionAlg_H
+#define PhotonVertexSelectionAlg_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "xAODEgamma/Photon.h"
+
+namespace CP {
+  class IPhotonVertexSelectionTool;
+
+  class PhotonVertexSelectionAlg : public AthAlgorithm { 
+
+  public: 
+
+    /// Constructor with parameters:
+    PhotonVertexSelectionAlg(const std::string& name, ISvcLocator* pSvcLocator);
+
+    /// Destructor:
+    ~PhotonVertexSelectionAlg(); 
+
+    /// Athena algorithm's Hooks
+    StatusCode  initialize();
+    StatusCode  execute();
+    StatusCode  finalize();
+
+  private: 
+
+    /// Default constructor:
+    PhotonVertexSelectionAlg();
+
+    bool acceptPhoton(const xAOD::Photon& gam);
+
+  private:
+
+    std::string m_inVxColl;
+    std::string m_inGamColl;
+    std::string m_outVxColl;
+
+    ToolHandle<CP::IPhotonVertexSelectionTool> m_vxSelTool;
+
+  }; 
+
+}
+
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a0f1052c8aeffe8310f64c7a1807664b7206223e
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_entries.cxx
@@ -0,0 +1,22 @@
+// Gaudi/Athena include(s):
+#include "GaudiKernel/DeclareFactoryEntries.h"
+
+// Local include(s):
+#include "PhotonVertexSelection/PhotonVertexSelectionTool.h"
+#include "PhotonVertexSelection/ElectronRemovalTool.h"
+#include "PhotonVertexSelection/PhotonPointingTool.h"
+#include "../PhotonVertexSelectionAlg.h"
+
+DECLARE_NAMESPACE_TOOL_FACTORY(CP, PhotonVertexSelectionTool)
+DECLARE_NAMESPACE_TOOL_FACTORY(CP, ElectronRemovalTool)
+DECLARE_NAMESPACE_TOOL_FACTORY(CP, PhotonPointingTool)
+DECLARE_NAMESPACE_ALGORITHM_FACTORY( CP, PhotonVertexSelectionAlg )
+
+DECLARE_FACTORY_ENTRIES(PhotonVertexSelection) {
+
+   DECLARE_NAMESPACE_TOOL(CP, PhotonVertexSelectionTool)
+   DECLARE_NAMESPACE_TOOL(CP, ElectronRemovalTool)
+   DECLARE_NAMESPACE_TOOL(CP, PhotonPointingTool)
+   DECLARE_NAMESPACE_ALGORITHM( CP, PhotonVertexSelectionAlg )
+
+}
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_load.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_load.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..50a7acfbe9e2321f0d343f57b9422a64230a3d72
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/src/components/PhotonVertexSelection_load.cxx
@@ -0,0 +1,5 @@
+// Gaudi/Athena include(s):
+#include "GaudiKernel/LoadFactoryEntries.h"
+
+// Declare the library to the infrastructure:
+LOAD_FACTORY_ENTRIES(PhotonVertexSelection)
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py
new file mode 100755
index 0000000000000000000000000000000000000000..8d3dbe7dbb315062c7d226d1c518e315e1596684
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/test/testPhotonVertexSelection.py
@@ -0,0 +1,150 @@
+#!/usr/bin/env python
+
+__doc__ = """Script / jobOptions to test PhotonVertexSelectionTool using an AOD from
+mc15_13TeV:mc15_13TeV.341000.PowhegPythia8EvtGen_CT10_AZNLOCTEQ6L1_ggH125_gamgam.merge.AOD.e3806_s2608_r7772_r7676"""
+__author__ = "Bruno Lenzi"
+
+defaultFile = "$ASG_TEST_FILE_MC"
+defaultNevents = 10
+
+def printMethod(x):
+  print x
+
+def getViewContainer(container):
+  """getViewContainer(container) --> return a view container with at most 2 egamma
+  objects from the given container, ignoring topo-seeded photons and fwd electrons"""
+  import ROOT
+  def filterAuthor(x):
+    return x.author() not in [ROOT.xAOD.EgammaParameters.AuthorCaloTopo35, ROOT.xAOD.EgammaParameters.AuthorFwdElectron]
+
+  egammas = container.__class__(ROOT.SG.VIEW_ELEMENTS)
+  for eg in filter(filterAuthor, container)[:2]:
+    egammas.push_back( eg )
+  return egammas
+
+def printOutput(container, tool, printMethod = printMethod):
+  "printOutput(egammas, tool) -> print case and MVA output"
+  # TODO: pointing, HPV, zcommon
+  if len(container) < 2: return
+  # ignore conversions if running on electrons
+  result = tool.getVertex(container, 'Electron' in container.__class__.__name__ )
+  printMethod('Case: %s' % tool.getCase() )
+  for vertex, mva in result:
+    printMethod('  Vertex %s: %s' % (vertex.index(), mva) )
+
+
+def setupAthenaJob(algoClass, inputfile = defaultFile, EvtMax = None):
+  "Setup athena job"
+  import AthenaPoolCnvSvc.ReadAthenaPool # EventSelector
+  from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+
+  svcMgr.EventSelector.InputCollections = [inputfile] 
+
+  # Redefine the function InputFileNames to make autoconfiguration work 
+  # outside RecExCommon
+  from RecExConfig import RecoFunctions
+  RecoFunctions.InputFileNames = lambda : svcMgr.EventSelector.InputCollections
+  from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys
+  ConfigureFromListOfKeys(['everything'])
+
+  ###################
+
+  from egammaRec.Factories import ToolFactory, AlgFactory
+  from RecExConfig.RecFlags  import rec
+  import PhotonVertexSelection.PhotonVertexSelectionConf as PVS 
+
+  # Configure and PhotonVertexSelectionTool
+  PhotonVertexSelectionTool = ToolFactory(PVS.CP__PhotonVertexSelectionTool)
+
+  # Configure the test algorithm and add it to topSequence
+  testAlg = AlgFactory(algoClass,
+    PhotonVertexSelectionTool = PhotonVertexSelectionTool)()
+
+  # Maximum events
+  if EvtMax:
+    from Configurables import StopperAlg
+    AlgFactory( StopperAlg,  StopCount=EvtMax )()
+
+# --------------------------------
+# Athena algorithm and setup
+# --------------------------------
+import os
+if not 'ROOTCOREBIN' in os.environ:
+  from AthenaPython import PyAthena
+  from AthenaPython.PyAthena import StatusCode
+
+  class TestPhotonVertexSelection( PyAthena.Alg ):
+    def __init__(self, name = 'TestPhotonVertexSelection',
+                       containerName = 'Photons', **kw):
+      super(TestPhotonVertexSelection,self).__init__(name = name, containerName = containerName, **kw)
+
+    def initialize(self):
+      self.msg.info("initializing [%s]", self.name())
+      self.vertexTool = PyAthena.py_tool(self.PhotonVertexSelectionTool.getFullName(),
+        iface='CP::IPhotonVertexSelectionTool')
+      if not self.vertexTool:
+          self.msg.error("Problem retrieving PhotonVertexSelectionTool !!")
+          return PyAthena.StatusCode.Failure
+
+      return StatusCode.Success
+
+    def execute(self):
+      viewContainer = getViewContainer( self.evtStore[self.containerName] )
+      printOutput(viewContainer, self.vertexTool, self.msg.info)
+      return StatusCode.Success
+
+    def finalize(self):
+      return StatusCode.Success
+
+  setupAthenaJob( TestPhotonVertexSelection,
+                  locals().get('inputfile', defaultFile),
+                  locals().get('EvtMax', defaultNevents ) )
+
+
+# --------------------------------
+# AnalysisRelease script
+# --------------------------------
+else:
+  from optparse import OptionParser
+  parser = OptionParser("%prog [options]")
+  parser.description = __doc__
+  parser.add_option("-N", "--nEvents", help="Events to run (default: %default)",
+    default=defaultNevents, type=int)
+  parser.add_option("-i", "--inputfile", help="Inputfile",
+    default=defaultFile)
+  parser.add_option("-c", "--container", help="Container to use (default: %default)",
+    default='Photons')
+  parser.epilog = "\n"
+
+  (options, _ ) = parser.parse_args()
+  if len( _ ):
+    raise ValueError('Only named options are allowed, got %s' % _ )
+  print 'Analysing %s from %s' % (options.container, options.inputfile)
+
+  import ROOT
+  ROOT.gROOT.Macro( '$ROOTCOREDIR/scripts/load_packages.C' )
+
+  # Initialize the xAOD infrastructure: 
+  ROOT.xAOD.Init().ignore()
+
+  # Setup the tools
+  vertexTool = ROOT.CP.PhotonVertexSelectionTool("PhotonVertexSelectionTool")
+
+  # Create transient tree: has to be done before initialising the pointing tool
+  f = ROOT.TFile.Open( options.inputfile, "READ" )
+  t = ROOT.xAOD.MakeTransientTree( f, "CollectionTree", ROOT.xAOD.TEvent.kAthenaAccess )
+  import xAODRootAccess.GenerateDVIterators
+
+  # Initialise tools
+  if not vertexTool.initialize().isSuccess():
+    print( "Couldn't initialise the vertex tool" )
+    sys.exit( 1 )
+    pass
+
+  for entry in xrange(options.nEvents):
+    print '*** Analysing entry %s ***' % entry
+    _ = t.GetEntry(entry)
+    container = getattr(t, options.container)
+    viewContainer = getViewContainer( container )
+    printOutput(viewContainer, vertexTool)
+    print ''
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..77e4e5c8bd64861c20a85ed26aaf0895a743ce2a
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
@@ -0,0 +1,17 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id: AsgAnalysisInterfacesDict.h 790193 2016-12-16 16:36:15Z krasznaa $
+#ifndef ASGANALYSISINTERFACES_ASGANALYSISINTERFACESDICT_H
+#define ASGANALYSISINTERFACES_ASGANALYSISINTERFACESDICT_H
+
+// Local include(s):
+#include "AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h"
+#include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
+#include "AsgAnalysisInterfaces/IObservableTool.h"
+#include "AsgAnalysisInterfaces/IPileupReweightingTool.h"
+
+#endif // ASGANALYSISINTERFACES_ASGANALYSISINTERFACESDICT_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6a88651a3591da8d12ec790e07cb3125dc10a53
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IEfficiencyScaleFactorTool.h
@@ -0,0 +1,96 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id: IEfficiencyScaleFactorTool.h 790193 2016-12-16 16:36:15Z krasznaa $
+#ifndef ASGANALYSISINTERFACES_IEFFICIENCYSCALEFACTORTOOL_H
+#define ASGANALYSISINTERFACES_IEFFICIENCYSCALEFACTORTOOL_H
+
+// ASG include(s):
+#include "PATInterfaces/ISystematicsTool.h"
+#include "PATInterfaces/CorrectionCode.h"
+
+// Forward declaration(s):
+namespace xAOD {
+   class IParticle;
+}
+
+/// Namespace for generic Combined Performance code
+namespace CP {
+
+   /// General interface for tools providing analysis efficiency scale factors
+   ///
+   /// This is a generic interface that should be implemented by all analysis
+   /// tools that provide efficiency scale factors for @c xAOD::IParticle
+   /// type objects.
+   ///
+   /// @note If your tool needs type specific variables that the
+   /// @c xAOD::IParticle interface doesn't provide, please rely on the
+   /// @c xAOD::IParticle::type() function to identify whether you received
+   /// an appropriate object. And then use @c static_cast to cast the reference
+   /// to the right type. Like:
+   ///
+   /// @code{.cpp}
+   /// if( p.type() != xAOD::Type::Electron ) {
+   ///    ATH_MSG_ERROR( "Object of wrong type (" << p.type() << ") received" );
+   ///    return CP::CorrectionCode::Error;
+   /// }
+   /// const xAOD::Electron& el = static_cast< const xAOD::Electron& >( p );
+   /// @endcode
+   ///
+   /// Just be @b very careful about writing the code correctly, as a wrong
+   /// @c static_cast could lead to memory corruption. But since its much
+   /// faster than @c dynamic_cast, it's still recommended to use this sort of
+   /// code.
+   ///
+   /// $Revision: 790193 $
+   /// $Date: 2016-12-16 17:36:15 +0100 (Fri, 16 Dec 2016) $
+   ///
+   class IEfficiencyScaleFactorTool : virtual public ISystematicsTool {
+
+      // Declare the interface of the tool
+      ASG_TOOL_INTERFACE( CP::IEfficiencyScaleFactorTool )
+
+   public:
+      /// Default destructor
+      virtual ~IEfficiencyScaleFactorTool() = default;
+
+      /// Retrieve an efficiency scale factor for a particle type object
+      ///
+      /// This function is used to retrieve the efficiency scale factor for a
+      /// specific particle object.
+      ///
+      /// @param p The particle for which a scale factor is to be calculated
+      /// @param sf A reference to the scale factor variable to be set
+      /// @return @c CP::CorrectionCode::Error in case of a serious problem,
+      ///         @c CP::CorrectionCode::OutOfValidityRange if no scale factor
+      ///         is available for the received object, or
+      ///         @c CP::CorrectionCode::Ok if the scale factor could be
+      ///         correctly provided
+      ///
+      virtual CorrectionCode getEfficiencyScaleFactor( const xAOD::IParticle& p,
+                                                       double& sf ) const = 0;
+
+      /// Decorate a particle with its efficiency scale factor
+      ///
+      /// This function can be used to decorate a particle type object with
+      /// an efficiency scale factor. The name and type of the scale factor
+      /// variable is up to the specific tool implementation.
+      ///
+      /// @param p The particle for which a scale factor is to be calculated
+      /// @return @c CP::CorrectionCode::Error in case of a serious problem,
+      ///         @c CP::CorrectionCode::OutOfValidityRange if no scale factor
+      ///         is available for the received object, or
+      ///         @c CP::CorrectionCode::Ok if the scale factor could be
+      ///         correctly provided
+      ///
+      virtual CorrectionCode
+      applyEfficiencyScaleFactor( const xAOD::IParticle& p ) const = 0;
+
+   }; // class IEfficiencyScaleFactorTool
+
+} // namespace CP
+
+#endif // ASGANALYSISINTERFACES_IEFFICIENCYSCALEFACTORTOOL_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec39cc4f9db1d9e4d10bea5c3b4953c7c7e4d8e0
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h
@@ -0,0 +1,59 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef GoodRunsLists_IGoodRunsListSelectionTool_H
+#define GoodRunsLists_IGoodRunsListSelectionTool_H
+
+// System include(s):
+#include <vector>
+#include <string>
+
+// Framework include(s):
+#include "AsgTools/IAsgTool.h"
+
+// EDM include(s):
+#include "xAODEventInfo/EventInfo.h"
+
+// Forward declaration(s):
+namespace Root {
+   class TGRLCollection;
+}
+
+///Main tools implementing this interface:
+///  GoodRunsListSelectionTool   (source code: DataQuality/GoodRunsLists)
+
+class IGoodRunsListSelectionTool : virtual public asg::IAsgTool {
+
+   ASG_TOOL_INTERFACE( IGoodRunsListSelectionTool )
+
+public:
+   /// Check if the current event passes the selection
+   virtual bool passRunLB( const std::vector< std::string >& grlnameVec =
+                              std::vector< std::string >(),
+                           const std::vector< std::string >& brlnameVec =
+                              std::vector< std::string >() ) const = 0;
+
+   /// Check if the event specified passes the selection
+   virtual bool passRunLB( const xAOD::EventInfo& event,
+                           const std::vector< std::string >& grlnameVec =
+                              std::vector< std::string >(),
+                           const std::vector< std::string >& brlnameVec =
+                              std::vector< std::string >() ) const = 0;
+
+   /// Check if the event specified passes the selection
+   virtual bool passRunLB( int runNumber, int lumiBlockNr,
+                           const std::vector< std::string >& grlnameVec =
+                              std::vector< std::string >(),
+                           const std::vector< std::string >& brlnameVec =
+                              std::vector< std::string >() ) const = 0;
+
+   /// Get the good runs list used by the tool
+   virtual const Root::TGRLCollection& getGRLCollection() const = 0;
+
+   /// Get the bad runs list used by the tool
+   virtual const Root::TGRLCollection& getBRLCollection() const = 0;
+
+}; // class IGoodRunsListSelectionTool
+
+#endif // GoodRunsLists_IGoodRunsListSelectionTool_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IObservableTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IObservableTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..413f7711f170aa45462b2c2ef02c3ab95192c28f
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IObservableTool.h
@@ -0,0 +1,49 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id: IObservableTool.h 782989 2016-11-08 14:27:55Z will $
+#ifndef ASGANALYSISINTERFACES_IOBSERVABLETOOL_H
+#define ASGANALYSISINTERFACES_IOBSERVABLETOOL_H
+
+// System include(s):
+
+// Framework include(s):
+#include "AsgTools/IAsgTool.h"
+
+// Forward declaration
+namespace xAOD{
+  class IParticle;
+}
+
+
+/// Interface for tools that want to calculate a quantity
+/// from an xAOD::IParticle
+/// @author Karsten Koeneke <karsten.koeneke@cern.ch>
+///
+
+
+///Main tools implementing this interface:
+///  GenericParticleScaleFactorTool   (source code: PhysicsAnalysis/AnalysisCommon/ReweightUtils)
+///  McEventWeight                    (source code: PhysicsAnalysis/AnalysisCommon/ReweightUtils)
+
+class IObservableTool : public virtual asg::IAsgTool {
+
+  /// Declare the interface that this class provides
+  ASG_TOOL_INTERFACE( IObservableTool )
+
+ public:
+
+  /// Virtual destructor
+  virtual ~IObservableTool(){};
+
+  /// returns: the value that was calculated from the xAOD::IParticle
+  virtual double
+  evaluate( const xAOD::IParticle* ) const = 0;
+
+ }; // class IObservableTool
+
+
+#endif // PATINTERFACES_IOBSERVABLETOOL_H
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IPileupReweightingTool.h b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IPileupReweightingTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..fefb6d3510ddde997200a37fa12ea4505b5dd3da
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/IPileupReweightingTool.h
@@ -0,0 +1,125 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+///ASG PileupReweightingTool interface
+///author: will@cern.ch
+#ifndef PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
+#define PILEUPREWEIGHTING_IPILEUPREWEIGHTINGTOOL_H
+
+#include "AsgTools/IAsgTool.h"
+#include "TString.h"
+#include "xAODEventInfo/EventInfo.h"
+
+#include "PATInterfaces/ISystematicsTool.h"
+#include "AsgAnalysisInterfaces/IGoodRunsListSelectionTool.h"
+
+///Main tools implementing this interface:
+///  CP::PileupReweightingTool   (source code: PhysicsAnalysis/AnalysisCommon/PileupReweighting)
+
+
+
+class TH1;
+
+namespace CP {
+class TPileupReweighting;
+
+   class IPileupReweightingTool : virtual public CP::ISystematicsTool
+{
+
+      ASG_TOOL_INTERFACE( CP::IPileupReweightingTool )
+
+      public:
+
+
+         /// Return combined pileup weight
+         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo ) = 0;
+
+         /// Same as above, but for a 'custom weight' variable
+         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo,Double_t x, Double_t y=0. ) = 0;
+
+         /// get combined weight (i.e. pileup weight) but with a 1./dataWeight factor applied, this if used for 'prescaling' MC
+         virtual float getCombinedWeight( const xAOD::EventInfo& eventInfo , const TString& trigger, bool mu_dependent=true ) = 0;
+
+         /// When using UnrepresentedDataAction=2, you may want to apply this additional weight to ensure sum of weights are preserved
+         virtual float getUnrepresentedDataWeight( const xAOD::EventInfo& eventInfo ) = 0;
+
+         /// Get the dataWeight used to 'unprescale' data collected from a given trigger combination. mu_dependency is recommended to be true
+         virtual float getDataWeight( const xAOD::EventInfo& eventInfo, const TString& trigger, bool mu_dependent=true ) = 0;
+
+         /// Get a random run number for this MC event, mu_dependency is recommended ... jetetmiss seem to like it muchly
+         virtual int getRandomRunNumber( const xAOD::EventInfo& eventInfo , bool mu_dependent=true) = 0;
+
+         /// Get the corrected average mu of a lumiblock ... (averaging is over all filled BCID in the fill)
+         /// The additional flag indicates if the returned value should include the data scale factor or not.
+         /// Note: if the lumiblock is not present in the input lumicalc file, then -1.0 will be returned
+         /// This method will soon be deprecated in favour of the new naming: getCorrectedAverageInteractionsPerCrossing
+         virtual float getCorrectedMu( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) {
+            return getCorrectedAverageInteractionsPerCrossing( eventInfo, includedDataScaleFactor );
+         }
+         virtual float getCorrectedAverageInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
+         
+         /// Get the actual mu of a lumiblock ... (BCID-specific mu)
+         /// The additional flag indicates if the returned value should include the data scale factor or not.
+         /// Note: if the lumiblock is not present in the input lumicalc file, then -1.0 will be returned
+         virtual float getCorrectedActualInteractionsPerCrossing( const xAOD::EventInfo& eventInfo, bool includedDataScaleFactor=false ) = 0;
+         
+         /// Get the integrated lumi of a lumiblock (in pb-1)
+         virtual double getLumiBlockIntegratedLumi( const xAOD::EventInfo& eventInfo ) = 0;
+
+         /// Decorates with: 
+         /// MC: PileupWeight (CombinedWeight[*UnrepresentedDataWeight if action=2]), RandomRunNumber, RandomLumiBlockNumber, PRWHash
+         /// Data: corrected_averageInteractionsPerCrossing
+         /// mu_dependent says if the mu_dependency should be used for random run numbers or the data weights. You will get random run numbers of 0 for events with zero pileup weight
+         virtual StatusCode apply ( const xAOD::EventInfo& eventInfo, bool mu_dependent=true ) = 0;
+
+
+         /// return the prw hash used for fast updates of weights at the post-processing level ... see the share/makeWeightTree.C script for usage
+         virtual ULong64_t getPRWHash( const xAOD::EventInfo& eventInfo ) = 0;
+
+         // methods that go straight to the underlying pileup tool 
+
+         /// Get a random lumiblock number for the given run number 
+         virtual UInt_t GetRandomLumiBlockNumber(UInt_t runNumber) = 0;
+
+         /// possible alternative to using the EventBookkeepers info ... assuming you made your PRW Config file!!
+         virtual Double_t GetSumOfEventWeights(Int_t channel) = 0;
+         virtual Double_t GetNumberOfEvents(Int_t channel) = 0;
+
+         /// Get the integrated luminosity (in pb-1) between start and end run (inclusive)
+         virtual Double_t GetIntegratedLumi(UInt_t start, UInt_t end) = 0;
+         /// Total lumi (in pb-1) for a given trigger combination .. leave blank for the unprescaled
+         virtual Double_t GetIntegratedLumi(const TString& trigger="") = 0;
+         /** similar to above, but for only the given mcRunNumber/periodNumber */
+         virtual Double_t GetIntegratedLumi(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
+         /** return fraction of lumi assigned to periodNumber (or mcRunNumber) that is between start and end data run numbers*/
+         virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
+         /** return fraction of lumi assigned to periodNumber (or mcRunNumber) with given mu, that is between start and end data run numbers*/
+         virtual Double_t GetIntegratedLumiFraction(Int_t periodNumber, Double_t mu, UInt_t start, UInt_t end) = 0;
+
+
+         /// use these methods when generating config files 
+         virtual Int_t AddPeriod(Int_t periodNumber, UInt_t start, UInt_t end) = 0;
+         virtual Int_t SetBinning(Int_t nbinsx, Double_t* xbins, Int_t nbinsy=0, Double_t* ybins=0) = 0;
+         virtual Int_t SetUniformBinning(Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy=0, Double_t ylow=0, Double_t yup=0) = 0;
+         virtual Int_t SetBinning(TH1* hist) = 0;
+
+         /// Call this method once per event when in config file generating mode and you want standard mu reweighting
+         virtual int fill( const xAOD::EventInfo& eventInfo ) = 0;
+
+         /// Use this method if you want to do a generic reweighting instead
+         virtual int fill( const xAOD::EventInfo& eventInfo, Double_t x, Double_t y=0.) = 0;
+
+
+         /// Get pointer to the underlying tool - expert use only:  Will require #include "PileupReweighting/TPileupReweighting.h"
+         virtual CP::TPileupReweighting* expert() = 0;
+
+
+   };
+
+}
+
+
+
+#endif
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d411ae8b0ff1ed0febf1177046186b97e325bd16
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/AsgAnalysisInterfaces/selection.xml
@@ -0,0 +1,8 @@
+<!-- $Id: selection.xml 790193 2016-12-16 16:36:15Z krasznaa $ -->
+<lcgdict>
+  <namespace name="CP"/>
+  <class name="CP::IEfficiencyScaleFactorTool" />
+  <class name="CP::IPileupReweightingTool" />
+  <class name="IGoodRunsListSelectionTool" />
+  <class name="IObservableTool" />
+</lcgdict>
diff --git a/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cdc460813d27684755b7136de56032fa58604fe7
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces/CMakeLists.txt
@@ -0,0 +1,27 @@
+
+# The name of the package:
+atlas_subdir( AsgAnalysisInterfaces )
+
+# The dependencies of the package:
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEventInfo
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces )
+
+# External(s):
+find_package( ROOT COMPONENTS Core )
+
+# Component(s) in the package:
+atlas_add_library( AsgAnalysisInterfaces
+   AsgAnalysisInterfaces/*.h
+   INTERFACE
+   PUBLIC_HEADERS AsgAnalysisInterfaces
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo PATInterfaces )
+
+atlas_add_dictionary( AsgAnalysisInterfacesDict
+   AsgAnalysisInterfaces/AsgAnalysisInterfacesDict.h
+   AsgAnalysisInterfaces/selection.xml
+   LINK_LIBRARIES AsgAnalysisInterfaces )
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d584bbc81cf9f9ada8be0bcde4bd1340614572fc
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
@@ -0,0 +1,29 @@
+# The name of the package:
+atlas_subdir( EgammaAnalysisInterfaces )
+
+# The dependencies of the package:
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces 
+   PhysicsAnalysis/AnalysisCommon/PATCore
+)
+
+# External(s):
+find_package( ROOT COMPONENTS Core )
+
+# Component(s) in the package:
+atlas_add_library( EgammaAnalysisInterfacesLib
+   EgammaAnalysisInterfaces/*.h
+   INTERFACE
+   PUBLIC_HEADERS EgammaAnalysisInterfaces
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces PATCoreLib)
+
+atlas_add_dictionary( EgammaAnalysisInterfacesDict
+   EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
+   EgammaAnalysisInterfaces/selection.xml
+   LINK_LIBRARIES EgammaAnalysisInterfacesLib )
+
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b91c9c6b9b1486306199e53b680f680d2f22bb0
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
@@ -0,0 +1,25 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef __EGAMMAANALYSISINTERRFACESDICT__
+#define __EGAMMAANALYSISINTERRFACESDICT__
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
+#include "EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h"
+
+#include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h"
+
+#include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h"
+
+#include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h"
+
+#include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h"
+
+
+#endif
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed86179af7a0f01bbc50269b163f45db9557e6ab
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h
@@ -0,0 +1,28 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+#ifndef EGAMMAANALYSISINTERFACES__IASGDEADHVCELLREMOVALTOOL__
+#define EGAMMAANALYSISINTERFACES__IASGDEADHVCELLREMOVALTOOL__
+
+#include "AsgTools/IAsgTool.h"
+#include "xAODEgamma/EgammaFwd.h"
+
+class IAsgDeadHVCellRemovalTool : virtual public asg::IAsgTool
+{
+  ASG_TOOL_INTERFACE(IAsgDeadHVCellRemovalTool)
+public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgDeadHVCellRemovalTool() {};
+
+  virtual bool accept( const xAOD::Egamma* part ) const = 0;
+
+  virtual bool accept( const xAOD::Egamma& part ) const = 0;
+
+}; 
+// End: class definition
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
new file mode 100644
index 0000000000000000000000000000000000000000..b32941041c4fc26de49abfaf1c4ac1f6d04465b8
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h
@@ -0,0 +1,64 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGEGAMMAISEMSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGEGAMMAISEMSELECTOR__
+
+/**
+   @class IAsgEGammaIsEMSelector
+   @brief Interface to tool to select photons
+
+   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
+   @date   Dec 2011 - Fab 2012
+
+   11-MAR-2014, convert to ASGTool
+*/
+
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+
+// Forward declarations
+namespace Root{
+  class TAccept;
+}
+#include "xAODEgamma/EgammaFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/ElectronFwd.h"
+
+class IAsgEGammaIsEMSelector : virtual public IAsgSelectionTool
+{
+
+  ASG_TOOL_INTERFACE(IAsgEGammaIsEMSelector)
+
+public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgEGammaIsEMSelector() {};
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
+
+  /////Egammma IsEM specific methods
+
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
+
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
+
+  virtual unsigned int IsemValue() const =0;
+
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const =0;
+ 
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a76f71b96ecfe8a788b380d6516be334cf1778b
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h
@@ -0,0 +1,32 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+//IAsgElectronEfficiencyCorrection.h to be used in the tool.
+#ifndef EGAMMAANALYSISINTERFACES__IASGELECTRONEFFICIENCYCORRECTION__
+#define EGAMMAANALYSISINTERFACES__IASGELECTRONEFFICIENCYCORRECTION__
+
+#include "AsgTools/IAsgTool.h"
+#include "xAODEgamma/ElectronFwd.h"
+#include "PATInterfaces/CorrectionCode.h"
+#include "PATInterfaces/ISystematicsTool.h"
+namespace xAOD{
+  class IParticle;
+}
+
+
+class IAsgElectronEfficiencyCorrectionTool : virtual public CP::ISystematicsTool
+{
+  ASG_TOOL_INTERFACE(IAsgElectronEfficiencyCorrectionTool)
+
+  public:
+  ///The interface for Scale Factors
+  virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Electron& inputObject, double& efficiencyScaleFactor) const = 0;
+  virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::Electron& inputObject) const = 0;
+  virtual int systUncorrVariationIndex( const xAOD::Electron &inputObject) const =0;
+  virtual ~IAsgElectronEfficiencyCorrectionTool() {}
+
+};
+
+
+#endif
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae224757983925b87d112c28b3de284fd3fb4b2f
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h
@@ -0,0 +1,84 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGELECTRONISEMSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGELECTRONISEMSELECTOR__
+
+/**
+   @class IAsgElectronIsEMSelector
+   @brief Interface to tool to select electrons
+
+   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
+   @date   Dec 2011 - Fab 2012
+
+   11-MAR-2014, convert to ASGTool
+*/
+
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+// Forward declarations
+namespace Root{
+  class TAccept;
+}
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+
+class IAsgElectronIsEMSelector : virtual public IAsgEGammaIsEMSelector
+{
+
+  ASG_TOOL_INTERFACE(IAsgElectronIsEMSelector)
+  
+  public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgElectronIsEMSelector() {};
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
+  
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
+
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
+
+  /** Accept with Photon objects */
+  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
+
+  /** Accept with Photon objects */
+  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
+
+  /** Accept with Electron objects */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
+
+  /** Accept with Electron objects */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
+
+
+  ///////////////Expert methods //////////////////////////////////////
+
+  
+  //The main execute method
+  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
+
+  //////////////////////////////////////////////////////////////
+  virtual unsigned int IsemValue() const = 0;
+  
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const =0;
+
+
+
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..47011688eb52e89b71e538e646950a6e322a76d4
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h
@@ -0,0 +1,101 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGELECTRONLIKELIHOODSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGELECTRONLIKELIHOODSELECTOR__
+
+/**
+   @class IAsgElectronLikelihoodTool
+   @brief Interface to tool to select electrons
+
+   12-MAR-2014, convert to ASG tool
+
+*/
+
+// CONSIDER MERGING THIS WITH IASGELECTRONMULTILEPTONSELECTOR, SINCE THE INTERFACE
+// IS EXACTLY THE SAME. LEAVING THEM SEPERATE FOR NOW IN CASE THEY DIVERGE
+
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+// Forward declarations
+namespace Root{
+  class TAccept;
+  class TResult;
+}
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+
+class IAsgElectronLikelihoodTool : virtual public IAsgSelectionTool
+{
+
+  ASG_TOOL_INTERFACE(IAsgElectronLikelihoodTool)
+
+  public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgElectronLikelihoodTool() {};
+
+
+  /** The main accept method: using the generic interface , with pointers*/
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part ) const = 0;
+
+  /** The main accept method: in case mu not in EventInfo online */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part, double mu ) const = 0;
+
+  /** The main accept method: in case mu not in EventInfo online */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part, double mu ) const = 0;
+
+
+  /** The main accept method: using the generic interface, with reference */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part ) const = 0;
+
+  /** The main accept method: in case mu not in EventInfo online */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part, double mu ) const = 0;
+
+  /** The main accept method: in case mu not in EventInfo online */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part, double mu ) const = 0;
+
+
+  /** The main result method: the actual likelihood is calculated here */
+  virtual const Root::TResult& calculate( const xAOD::IParticle* part ) const = 0;
+
+  /** The main result method: the actual likelihood is calculated here */
+  virtual const Root::TResult& calculate( const xAOD::Electron* eg ) const = 0;
+
+  /** The main result method: the actual likelihood is calculated here */
+  virtual const Root::TResult& calculate( const xAOD::Egamma* eg ) const = 0;
+
+  /** The main result method: in case mu not in EventInfo online */
+  virtual const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const = 0;
+
+  /** The main result method: in case mu not in EventInfo online */
+  virtual const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const = 0;
+
+
+  /** Method to get the plain TResult */
+  virtual const Root::TResult& getTResult( ) const=0;
+
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const =0;
+
+  //virtual const Root::TAccept& getTAccept( ) const =0; // in base
+
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
new file mode 100644
index 0000000000000000000000000000000000000000..386c61cd1771886c48aba381ddc051e4f6f93a8b
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h
@@ -0,0 +1,50 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGELECTRONMULTILEPTONSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGELECTRONMULTILEPTONSELECTOR__
+
+/**
+   @class IAsgElectronMultiLeptonSelector
+   @brief Interface to tool to select electrons
+
+   12-MAR-2014, convert to ASG tool
+
+*/
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+// Forward declarations
+namespace Root{
+  class TAccept;
+}
+#include "xAODEgamma/ElectronFwd.h"
+
+class IAsgElectronMultiLeptonSelector : virtual public IAsgSelectionTool
+{
+
+  ASG_TOOL_INTERFACE(IAsgElectronMultiLeptonSelector)
+
+public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgElectronMultiLeptonSelector() {};
+
+  /** The main accept method: using the generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
+  /** The main accept method: using the generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
+
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const=0;
+
+}; // End: class definition
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h
new file mode 100644
index 0000000000000000000000000000000000000000..5bb78ebb245e9818ee1c700666fc484775bb3ea1
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h
@@ -0,0 +1,83 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGFORWARDELECTRONISEMSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGFORWARDELECTRONISEMSELECTOR__
+
+/**
+   @class IAsgForwardElectronIsEMSelector
+   @brief Interface to tool to select electrons
+
+   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
+   @date   Dec 2011 - Fab 2012
+
+   11-MAR-2014, convert to ASGTool
+*/
+
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+
+// Forward declarations
+namespace Root{
+  class TAccept;
+}
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+
+class IAsgForwardElectronIsEMSelector : virtual public IAsgEGammaIsEMSelector
+{
+
+  ASG_TOOL_INTERFACE(IAsgForwardElectronIsEMSelector)
+  
+  public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgForwardElectronIsEMSelector() {};
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
+  
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
+
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
+
+  /** Accept with Photon objects */
+  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
+
+  /** Accept with Photon objects */
+  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
+
+  /** Accept with Electron objects */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
+
+  /** Accept with Electron objects */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
+
+
+  ///////////////Expert methods //////////////////////////////////////
+
+  
+  //The main execute method
+  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
+
+  //////////////////////////////////////////////////////////////
+  virtual unsigned int IsemValue() const = 0;
+  
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const =0;
+
+
+
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa3a1000b38776eb7aafb0a9f187259775cc6fb9
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+//IAsgPhotonEfficiencyCorrection.h to be used in the tool.
+#ifndef EGAMMAANALYSISINTERFACES__IASGPHOTONEFFICIENCYCORRECTION__
+#define EGAMMAANALYSISINTERFACES__IASGPHOTONEFFICIENCYCORRECTION__
+
+// Framework include(s):
+#include "AsgTools/IAsgTool.h"
+// EDM include(s):
+#include "xAODEgamma/Egamma.h"
+
+// Local include(s):
+#include "PATInterfaces/CorrectionCode.h"
+#include "PATInterfaces/ISystematicsTool.h"
+
+namespace xAOD{
+  class IParticle;
+}
+
+class IAsgPhotonEfficiencyCorrectionTool : virtual public asg::IAsgTool, virtual public CP::ISystematicsTool
+{
+  ASG_TOOL_INTERFACE(IAsgPhotonEfficiencyCorrectionTool)
+
+  public:  
+  //virtual StatusCode initialize() = 0;
+  
+  /// Get the "photon scale factor" as a return value
+  virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Egamma&, double&) const = 0;
+  
+  /// Get the "photon scale factor error" as a return value
+  virtual CP::CorrectionCode getEfficiencyScaleFactorError(const xAOD::Egamma&, double&) const = 0;
+  
+  /// Decorate the photon with its scale factor
+  virtual CP::CorrectionCode applyEfficiencyScaleFactor(xAOD::Egamma&) const = 0;
+  
+  virtual ~IAsgPhotonEfficiencyCorrectionTool() {}  
+}; // class IAsgPhotonEfficiencyCorrectionTool
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7a754db19972c026fd5f2abd1470394152a8fd0
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h
@@ -0,0 +1,78 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAANALYSISINTERFACES__IASGPHOTONISEMSELECTOR__
+#define EGAMMAANALYSISINTERFACES__IASGPHOTONISEMSELECTOR__
+
+/**
+   @class IAsgPhotonIsEMSelector
+   @brief Interface to tool to select photons
+
+   @author Jovan Mitrevski (UCSC) Karsten Koeneke (CERN)
+   @date   Dec 2011 - Fab 2012
+
+   11-MAR-2014, convert to ASGTool
+*/
+
+// Include the interfaces
+#include "PATCore/IAsgSelectionTool.h"
+#include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h"
+
+// Forward declarations
+namespace Root{
+  class TAccept;
+}
+#include "xAODEgamma/EgammaFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/ElectronFwd.h"
+
+class IAsgPhotonIsEMSelector : virtual public IAsgEGammaIsEMSelector
+{
+
+  ASG_TOOL_INTERFACE(IAsgPhotonIsEMSelector)
+
+public:
+
+  /**Virtual Destructor*/
+  virtual ~IAsgPhotonIsEMSelector() {};
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0;
+
+  /** Accept with generic interface */
+  virtual const Root::TAccept& accept( const xAOD::IParticle& part ) const = 0;
+  
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0;
+
+  /** Accept with Egamma objects */
+  virtual const Root::TAccept& accept( const xAOD::Egamma& part) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Photon& part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0;
+
+  /** The main accept method: the actual cuts are applied here */
+  virtual const Root::TAccept& accept( const xAOD::Electron& part ) const = 0;
+
+
+  ////Expert methods /////////////////////////////////////
+  /** The isem potentially for the trigger */
+  virtual StatusCode execute(const xAOD::Egamma* eg) const =0;
+
+  virtual unsigned int IsemValue() const =0;
+
+  /** Method to get the operating point */
+  virtual std::string getOperatingPointName( ) const =0;
+ 
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..5cbbd4734f56b262d063188415eaea51363254c3
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h
@@ -0,0 +1,82 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAANALYSISINTERFACES__IEGammaAmbiguityTool__
+#define EGAMMAANALYSISINTERFACES__IEGammaAmbiguityTool__
+
+/**
+   @class EGammaAmbiguityTool
+   @brief Electron / photon ambiguity resolution. Dual-use version, interface
+
+   @author Bruno Lenzi
+   @date   May 2015
+*/
+
+// Include the interfaces
+#include "AsgTools/IAsgTool.h"
+
+// Forward declarations
+#include "xAODCaloEvent/CaloClusterFwd.h"
+#include "xAODTracking/VertexFwd.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+#include "xAODEgamma/EgammaContainerFwd.h"
+
+//This will need to be copied over to EgammaEnums.h
+//under xAODEgamma
+//Plus Set/Get true Accessor methods when we have 
+//finalise the design.
+namespace xAOD {
+  namespace AmbiguityTool {
+    /// @name Ambiguity types
+    enum AmbiguityType {
+      electron = 0,
+      ambiguousTrackEoverPBetterThanVertexEoverP=1,
+      ambiguousTrackLowPt=2,
+      ambiguousTrackLowEoverP=3,
+      ambiguousTrackNoPixel =4,
+      ambiguousVertexEoverPBetterThanTrackEoverP=5,
+      photon=6,
+      unknown=7
+    };
+  }
+}
+
+
+
+class IEGammaAmbiguityTool : virtual public asg::IAsgTool
+{
+  ASG_TOOL_INTERFACE(IEGammaAmbiguityTool)
+
+public:
+
+  /**Virtual Destructor*/
+  virtual ~IEGammaAmbiguityTool() {};
+
+  /** Return value: AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown */
+  virtual unsigned int ambiguityResolve(const xAOD::CaloCluster* cluster,
+                                        const xAOD::Vertex* vx,
+                                        const xAOD::TrackParticle* tp, xAOD::AmbiguityTool::AmbiguityType& type) const = 0;
+
+  /** Return value: AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown 
+      Needed because of cliets
+      implementation calls method above
+   */
+  virtual unsigned int ambiguityResolve(const xAOD::CaloCluster* cluster,
+                                        const xAOD::Vertex* vx,
+                                        const xAOD::TrackParticle* tp) const = 0;
+
+  /** Redo the ambiguity resolution of central electrons and photons and return
+    * AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown 
+    * or the author of the object if no overlapping object is found **/
+  virtual unsigned int ambiguityResolve(const xAOD::Egamma& egamma) const = 0;
+
+  /** Accept or reject egamma object based on ambiguity resolution */
+  virtual bool accept( const xAOD::Egamma& egamma, bool acceptAmbiguous = true) const = 0;
+  
+}; // End: class definition
+
+
+#endif
+
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8fc1fd928543e38b084df9ece2eaed16a9e27b5
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h
@@ -0,0 +1,54 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#ifndef EGAMMAANALYSISINTERFACES__IEGAMMA_CALIB_TOOL_H_
+#define EGAMMAANALYSISINTERFACES__IEGAMMA_CALIB_TOOL_H_
+
+#include "AsgTools/IAsgTool.h"
+//xAOD
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+#include "PATInterfaces/CorrectionCode.h"
+#include "PATInterfaces/ISystematicsTool.h"
+// PAT includes
+#include "PATCore/PATCoreEnums.h"
+
+
+namespace EgammaCalibPeriodRunNumbersExample {
+  const int run_2016 = 297730;
+  const int run_2015 = 252604;
+  struct ROOT6_NamespaceAutoloadHook{};
+}
+
+
+namespace CP {
+
+  class IEgammaCalibrationAndSmearingTool : public CP::ISystematicsTool{
+    /// Declare the interface that the class provides
+    ASG_TOOL_INTERFACE( IEgammaCalibrationAndSmearingTool )
+    public:
+    
+    virtual ~IEgammaCalibrationAndSmearingTool() {};
+    
+    virtual StatusCode initialize() = 0;
+    
+    //Apply the correction on a modifyable egamma object (xAOD::Electron or xAOD::Photon)
+    virtual CP::CorrectionCode applyCorrection(xAOD::Egamma &) = 0;
+    
+    //Create a corrected copy from a constant egamma object
+    virtual CP::CorrectionCode correctedCopy(const xAOD::Electron&, xAOD::Electron*&) = 0;
+    virtual CP::CorrectionCode correctedCopy(const xAOD::Photon&, xAOD::Photon*&) = 0;
+    
+    //functions to be used per-event
+    virtual void setRandomSeed(unsigned seed) = 0;
+    
+    virtual double resolution( double energy, double cl_eta, double cl_etaCalo,
+			       PATCore::ParticleType::Type ptype = PATCore::ParticleType::Electron, bool withCT=false) const = 0;
+    virtual double getResolution(const xAOD::Egamma& particle, bool withCT=true) const = 0;
+  };
+  
+}
+#endif
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..25fde02ba2c96b3dbc6fbc6c74a39d0db8b3a588
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h
@@ -0,0 +1,49 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAANALYSISINTERFACES_IELECTRONPHOTONSHOWERSHAPEFUDGETOOL_H
+#define EGAMMAANALYSISINTERFACES_IELECTRONPHOTONSHOWERSHAPEFUDGETOOL_H
+
+/**
+   @class AsgFudgeMCTool
+   @brief Tool to fudge photon MC shower shapes.
+
+   @author Rob Roy Fletcher (University of Pennsylvania) rob.fletcher@cern.ch
+   @date   August 2014
+
+
+*/
+
+// Framework include(s):
+#include "AsgTools/IAsgTool.h"
+
+// EDM include(s):
+#include "xAODEgamma/EgammaFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
+#include "xAODEgamma/ElectronFwd.h"
+
+// Local include(s):
+#include "PATInterfaces/CorrectionCode.h"
+
+
+class IElectronPhotonShowerShapeFudgeTool : public virtual asg::IAsgTool {
+
+   /// Declare the interface that the class provides
+   ASG_TOOL_INTERFACE(IElectronPhotonShowerShapeFudgeTool)
+
+public:
+   /// Apply the correction on a modifyable object
+   virtual const CP::CorrectionCode applyCorrection(xAOD::Photon& ph ) const = 0;
+
+   virtual const CP::CorrectionCode applyCorrection(xAOD::Electron& el ) const = 0;
+
+   virtual const CP::CorrectionCode correctedCopy( const xAOD::Photon& ph, xAOD::Photon*& output ) const = 0;
+
+   virtual const CP::CorrectionCode correctedCopy( const xAOD::Electron& el, xAOD::Electron*& output ) const = 0;
+
+
+
+}; // class IElectronPhotonShowerShapeFudgeTool
+
+#endif // _IASGFUDGEMCTOOL_H
diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..042c1d9ed007d15fb82972e70be0fa8b860c2bfb
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml
@@ -0,0 +1,21 @@
+<lcgdict>
+  <class name="IAsgEGammaIsEMSelector" /> 
+  <class name="IAsgElectronIsEMSelector" /> 
+  <class name="IAsgForwardElectronIsEMSelector" /> 
+  <class name="IAsgPhotonIsEMSelector" />
+  <class name="IAsgElectronMultiLeptonSelector" /> 
+  <class name="IAsgElectronLikelihoodTool" /> 
+  <class name="IEGammaAmbiguityTool" />
+  <class name="IAsgDeadHVCellRemovalTool" /> 
+
+  <class name="IAsgElectronEfficiencyCorrectionTool" /> 
+
+  <class name="IEgammaCalibrationAndSmearingTool" />   
+  <variable pattern="EgammaCalibPeriodRunNumbersExample::*"/>
+  <class name="EgammaCalibPeriodRunNumbersExample::ROOT6_NamespaceAutoloadHook" /> 
+
+  <class name="IAsgPhotonEfficiencyCorrectionTool" /> 
+
+  <class name="IElectronPhotonShowerShapeFudgeTool" /> 
+
+<lcgdict>
diff --git a/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a928229b407fffe55667d297406cf0f49ae2ba98
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/CMakeLists.txt
@@ -0,0 +1,23 @@
+
+# The name of the package:
+atlas_subdir( TriggerAnalysisInterfaces )
+
+# The dependencies of the package:
+atlas_depends_on_subdirs(
+   PUBLIC
+   Control/AthToolSupport/AsgTools
+   Event/xAOD/xAODEgamma
+   Event/xAOD/xAODMuon
+   PhysicsAnalysis/AnalysisCommon/PATInterfaces )
+
+# Component(s) in the package:
+atlas_add_library( TriggerAnalysisInterfaces
+   TriggerAnalysisInterfaces/*.h
+   INTERFACE
+   PUBLIC_HEADERS TriggerAnalysisInterfaces
+   LINK_LIBRARIES AsgTools xAODEgamma xAODMuon PATInterfaces )
+
+atlas_add_dictionary( TriggerAnalysisInterfacesDict
+   TriggerAnalysisInterfaces/TriggerAnalysisInterfacesDict.h
+   TriggerAnalysisInterfaces/selection.xml
+   LINK_LIBRARIES TriggerAnalysisInterfaces )
diff --git a/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/ITrigGlobalEfficiencyCorrectionTool.h b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/ITrigGlobalEfficiencyCorrectionTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..f5c60d37c5d5fba65abf12cde5ae952dedb393a0
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/ITrigGlobalEfficiencyCorrectionTool.h
@@ -0,0 +1,64 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// contact: jmaurer@cern.ch
+#ifndef TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H
+#define TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H 1
+
+// EDM include(s):
+#include "xAODEgamma/ElectronFwd.h"
+#include "xAODMuon/Muon.h"
+
+// Tool include(s):
+#include "AsgTools/IAsgTool.h"
+#include "PATInterfaces/CorrectionCode.h"
+
+class ITrigGlobalEfficiencyCorrectionTool : public virtual asg::IAsgTool {
+
+public:
+	ASG_TOOL_INTERFACE( ITrigGlobalEfficiencyCorrectionTool )
+
+   /// Helper type definition
+   typedef std::vector< const xAOD::IParticle* > IParticleConstVector;
+   /// Helper type definition
+   typedef std::vector< const xAOD::Electron* > ElectronConstVector;
+   /// Helper type definition
+   typedef std::vector< const xAOD::Muon* > MuonConstVector;
+
+   virtual CP::CorrectionCode
+   getEfficiencyScaleFactor( const IParticleConstVector& particles,
+                             double& efficiencyScaleFactor ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiencyScaleFactor( unsigned runNumber,
+                             const IParticleConstVector& particles,
+                             double& efficiencyScaleFactor ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiency( const IParticleConstVector& particles, double& efficiencyData,
+                  double& efficiencyMc ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiency( unsigned runNumber, const IParticleConstVector& particles,
+                  double& efficiencyData, double& efficiencyMc ) = 0;
+	
+	virtual CP::CorrectionCode
+   getEfficiencyScaleFactor( const ElectronConstVector& electrons,
+                             const MuonConstVector& muons,
+                             double& efficiencyScaleFactor ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiencyScaleFactor( unsigned runNumber,
+                             const ElectronConstVector& electrons,
+                             const MuonConstVector& muons,
+                             double& efficiencyScaleFactor ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiency( const ElectronConstVector& electrons,
+                  const MuonConstVector& muons,
+                  double& efficiencyData, double& efficiencyMc ) = 0;
+	virtual CP::CorrectionCode
+   getEfficiency( unsigned runNumber,
+                  const ElectronConstVector& electrons,
+                  const MuonConstVector& muons,
+                  double& efficiencyData, double& efficiencyMc ) = 0;
+
+}; // class ITrigGlobalEfficiencyCorrectionTool
+
+#endif //> !TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H
diff --git a/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfacesDict.h
new file mode 100644
index 0000000000000000000000000000000000000000..0eb8881d3a4fc70d12405396ec32bd639eb91443
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfacesDict.h
@@ -0,0 +1,11 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGGERANALYSISINTERFACES_TRIGGERANALYSISINTERFACESDICT_H
+#define TRIGGERANALYSISINTERFACES_TRIGGERANALYSISINTERFACESDICT_H
+	
+// Local include(s):
+#include "TriggerAnalysisInterfaces/ITrigGlobalEfficiencyCorrectionTool.h"
+
+#endif // TRIGGERANALYSISINTERFACES_TRIGGERANALYSISINTERFACESDICT_H
diff --git a/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/selection.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c8eb10be7d9fde13a4afd3fc7c50e503b637cc52
--- /dev/null
+++ b/PhysicsAnalysis/Interfaces/TriggerAnalysisInterfaces/TriggerAnalysisInterfaces/selection.xml
@@ -0,0 +1,3 @@
+<lcgdict>
+<class name="ITrigGlobalEfficiencyCorrectionTool" />
+</lcgdict>
diff --git a/PhysicsAnalysis/RingerSelectorTools/CMakeLists.txt b/PhysicsAnalysis/RingerSelectorTools/CMakeLists.txt
index fa033d66128487c4a1f5ee0a814b27882cda6801..01ff7ed01a90ba6d9c9df6f439202df4a9ec24ea 100644
--- a/PhysicsAnalysis/RingerSelectorTools/CMakeLists.txt
+++ b/PhysicsAnalysis/RingerSelectorTools/CMakeLists.txt
@@ -14,7 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODEgamma
                           Event/xAOD/xAODTracking
                           PhysicsAnalysis/AnalysisCommon/PATCore
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
+                          PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
                           PRIVATE
                           Control/AthContainers
                           Event/xAOD/xAODBase
@@ -35,19 +35,19 @@ atlas_add_library( RingerSelectorToolsLib
                    Root/tools/*.cxx
                    PUBLIC_HEADERS RingerSelectorTools
                    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib ElectronPhotonSelectorToolsLib
+                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib EgammaAnalysisInterfacesLib
                    PRIVATE_LINK_LIBRARIES AthContainers xAODBase GaudiKernel PathResolver TrkTrackSummary )
 
 atlas_add_component( RingerSelectorTools
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib ElectronPhotonSelectorToolsLib AthContainers xAODBase GaudiKernel PathResolver TrkTrackSummary RingerSelectorToolsLib )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib EgammaAnalysisInterfacesLib AthContainers xAODBase GaudiKernel PathResolver TrkTrackSummary RingerSelectorToolsLib )
 
 atlas_add_dictionary( RingerSelectorToolsDict
                       RingerSelectorTools/RingerSelectorToolsDict.h
                       RingerSelectorTools/selection.xml
                       INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib ElectronPhotonSelectorToolsLib AthContainers xAODBase GaudiKernel PathResolver TrkTrackSummary RingerSelectorToolsLib )
+                      LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthenaKernel CxxUtils xAODCaloRings xAODEgamma xAODTracking PATCoreLib EgammaAnalysisInterfacesLib AthContainers xAODBase GaudiKernel PathResolver TrkTrackSummary RingerSelectorToolsLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h
index 3fe36544a830abcbd8b833075039b0913897eb90..331072068a28f875b73abc93db59039d2d8bc96e 100644
--- a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h
+++ b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/AsgElectronRingerSelector.h
@@ -18,7 +18,7 @@
 #include "PATCore/TResult.h"
 #include "AsgTools/AsgMetadataTool.h"
 #include "AsgTools/ToolHandle.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
 
 // xAOD includes:
 #include "xAODCaloRings/CaloRingsContainer.h" // needed for caloRingsReader_t
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx
index 83f0023100c9e4decdd762b0a3cbc8b773f2d780..03d0ceb3f535d4bd80302ed5b53c72d8146d90a5 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx
@@ -252,8 +252,7 @@ bool DerivationFramework::KinkTrkSingleJetMetFilterTool::eventPassesFilter() con
 	continue;
       }
       
-      if(passIsolatedTracklet)
-	break;
+      if(passIsolatedTracklet)	break;
     }// for Tracklet
     
     if(passIsolatedTracklet==false){
diff --git a/Projects/AthDerivation/build_externals.sh b/Projects/AthDerivation/build_externals.sh
index 87227cbe335ecc4963bef7fc58e56165afca9df9..be5a56cba96b27bb3eebc8e5a0bded466ee524b8 100755
--- a/Projects/AthDerivation/build_externals.sh
+++ b/Projects/AthDerivation/build_externals.sh
@@ -122,7 +122,7 @@ AthDerivationExternalsVersion=$(awk '/^AthDerivationExternalsVersion/{print $3}'
 # Check out AthDerivationExternals from the right branch/tag:
 ${scriptsdir}/checkout_atlasexternals.sh \
     -t ${AthDerivationExternalsVersion} \
-    -s ${BUILDDIR}/src/AthDerivationExternals 2>&1 | tee ${BUILDDIR}/src/checkout.AthDerivationExternals.log 
+    -s ${BUILDDIR}/src/AthDerivationExternals 2>&1 | tee ${BUILDDIR}/src/checkout.AthDerivationExternals.log
 
 # Build AthDerivationExternals:
 export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AthDerivationExternals
diff --git a/Projects/AthDerivation/package_filters.txt b/Projects/AthDerivation/package_filters.txt
index 00036ca486c79bf4cc9301f174eb33cfcd4fa0dd..b2035df8a6309c2a2f478fd189b84ad9f3601873 100644
--- a/Projects/AthDerivation/package_filters.txt
+++ b/Projects/AthDerivation/package_filters.txt
@@ -214,6 +214,10 @@
 
 # Reconstruction package(s):
 + Reconstruction/AODFix
++ Reconstruction/RecoFix
++ Reconstruction/DiTauRec
++ Reconstruction/eflowRec
++ Reconstruction/egamma/egammaCaloTools
 + Reconstruction/egamma/egammaConditions
 + Reconstruction/egamma/egammaEvent
 + Reconstruction/egamma/egammaInterfaces
diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh
index ff6dccc11a0a6b0468170b5fcbe44cb7a5668fc0..1fd3768ce8b7c1141164be1524d91d7fdb8e4287 100755
--- a/Projects/AthSimulation/build_externals.sh
+++ b/Projects/AthSimulation/build_externals.sh
@@ -122,7 +122,7 @@ AthSimulationExternalsVersion=$(awk '/^AthSimulationExternalsVersion/{print $3}'
 # Check out AthSimulationExternals from the right branch/tag:
 ${scriptsdir}/checkout_atlasexternals.sh \
     -t ${AthSimulationExternalsVersion} \
-    -s ${BUILDDIR}/src/AthSimulationExternals 2>&1 | tee ${BUILDDIR}/src/checkout.AthSimulationExternals.log 
+    -s ${BUILDDIR}/src/AthSimulationExternals 2>&1 | tee ${BUILDDIR}/src/checkout.AthSimulationExternals.log
 
 # Build AthSimulationExternals:
 export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AthSimulationExternals
diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh
index 46392165be7a557e6cd6e99093534563fa1bc639..1d693182c814ecf9cdf4b21e8165693e2fbb3e82 100755
--- a/Projects/Athena/build_externals.sh
+++ b/Projects/Athena/build_externals.sh
@@ -72,6 +72,7 @@ fi
 
 # Stop on errors from here on out:
 set -e
+set -o pipefail
 
 # We are in BASH, get the path of this script in a simple way:
 thisdir=$(dirname ${BASH_SOURCE[0]})
diff --git a/Projects/AthenaP1/CMakeLists.txt b/Projects/AthenaP1/CMakeLists.txt
index 54e7002f0549a2cd561e862044c8b2c160a79a64..c9116eedc0b8b04a4f3d8770145067b21d3fa849 100644
--- a/Projects/AthenaP1/CMakeLists.txt
+++ b/Projects/AthenaP1/CMakeLists.txt
@@ -1,3 +1,4 @@
+
 # The minimum required CMake version:
 cmake_minimum_required( VERSION 3.2 FATAL_ERROR )
 
@@ -29,6 +30,19 @@ find_package( AtlasCMake QUIET )
 find_package( AthenaExternals REQUIRED )
 find_package( Gaudi REQUIRED )
 
+# Load all the files from the externals/ subdirectory:
+file( GLOB _externals "${CMAKE_CURRENT_SOURCE_DIR}/externals/*.cmake" )
+foreach( _external ${_externals} )
+   include( ${_external} )
+   get_filename_component( _extName ${_external} NAME_WE )
+   string( TOUPPER ${_extName} _extNameUpper )
+   message( STATUS "Taking ${_extName} from: ${${_extNameUpper}_ROOT}" )
+   unset( _extName )
+   unset( _extNameUpper )
+endforeach()
+unset( _external )
+unset( _externals )
+
 # Disable the usage of the --no-undefined linker flag:
 atlas_disable_no_undefined()
 
@@ -41,6 +55,10 @@ atlas_project( AthenaP1 ${ATHENAP1_PROJECT_VERSION}
    PROJECT_ROOT ${CMAKE_SOURCE_DIR}/../../
    FORTRAN )
 
+# Install the external configurations:
+install( DIRECTORY ${CMAKE_SOURCE_DIR}/externals
+   DESTINATION ${CMAKE_INSTALL_CMAKEDIR} USE_SOURCE_PERMISSIONS )
+
 # Generate the environment setup for the externals, to be used during the build:
 lcg_generate_env( SH_FILE ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh )
 
diff --git a/Projects/AthenaP1/PostConfig.cmake.in b/Projects/AthenaP1/PostConfig.cmake.in
index ff1c1f2ed7e657e132708ae44e2bbce687965cdd..741f09cdd3c8b6a4537963b7db4e7c55e411ea10 100644
--- a/Projects/AthenaP1/PostConfig.cmake.in
+++ b/Projects/AthenaP1/PostConfig.cmake.in
@@ -12,4 +12,22 @@ set( TDAQ-COMMON_ROOT "@TDAQ-COMMON_ROOT@" )
 set( DQM-COMMON_VERSION "@DQM-COMMON_VERSION@" )
 set( DQM-COMMON_ROOT "@DQM-COMMON_ROOT@" )
 
-find_package( Gaudi )
+# Find Gaudi:
+find_package( Gaudi REQUIRED )
+
+# Load all the files from the externals/ subdirectory:
+get_filename_component( _thisdir ${CMAKE_CURRENT_LIST_FILE} PATH )
+file( GLOB _externals "${_thisdir}/externals/*.cmake" )
+unset( _thisdir )
+foreach( _external ${_externals} )
+   include( ${_external} )
+   get_filename_component( _extName ${_external} NAME_WE )
+   string( TOUPPER ${_extName} _extNameUpper )
+   if( NOT AtlasExternals_FIND_QUIETLY )
+      message( STATUS "Taking ${_extName} from: ${${_extNameUpper}_ROOT}" )
+   endif()
+   unset( _extName )
+   unset( _extNameUpper )
+endforeach()
+unset( _external )
+unset( _externals )
diff --git a/Projects/AthenaP1/build_externals.sh b/Projects/AthenaP1/build_externals.sh
index fed0bea75124542b7c2f7a3bb12875e235a2f2d5..3e092ddddb31a0f9e432a01c7f9ffdf91e1948a7 100755
--- a/Projects/AthenaP1/build_externals.sh
+++ b/Projects/AthenaP1/build_externals.sh
@@ -143,7 +143,7 @@ GaudiVersion=$(awk '/^GaudiVersion/{print $3}' ${thisdir}/externals.txt)
 # Check out Gaudi from the right branch/tag:
 ${scriptsdir}/checkout_Gaudi.sh \
     -t ${GaudiVersion} \
-    -s ${BUILDDIR}/src/GAUDI 2>&1 | tee ${BUILDDIR}/checkout.GAUDI.log
+    -s ${BUILDDIR}/src/GAUDI 2>&1 | tee ${BUILDDIR}/src/checkout.GAUDI.log
 
 # Build Gaudi:
 export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/GAUDI
diff --git a/Projects/AthenaP1/externals/HEPUtils.cmake b/Projects/AthenaP1/externals/HEPUtils.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..f16c2e48e92c56530f74d9e87b43b7109d860a3e
--- /dev/null
+++ b/Projects/AthenaP1/externals/HEPUtils.cmake
@@ -0,0 +1,7 @@
+#
+# File specifying the location of HEPUtils to use.
+#
+
+set( HEPUTILS_VERSION 1.1.0 )
+set( HEPUTILS_ROOT
+   ${LCG_RELEASE_DIR}/MCGenerators/heputils/${HEPUTILS_VERSION}/${LCG_PLATFORM} )
diff --git a/Projects/AthenaP1/externals/MCUtils.cmake b/Projects/AthenaP1/externals/MCUtils.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..5fd191cfe6159b5c67aef98b53b8d38960e2d47a
--- /dev/null
+++ b/Projects/AthenaP1/externals/MCUtils.cmake
@@ -0,0 +1,7 @@
+#
+# File specifying the location of MCUtils to use.
+#
+
+set( MCUTILS_VERSION 1.2.1 )
+set( MCUTILS_ROOT
+   ${LCG_RELEASE_DIR}/MCGenerators/mcutils/${MCUTILS_VERSION}/${LCG_PLATFORM} )
diff --git a/Projects/AthenaP1/externals/README.md b/Projects/AthenaP1/externals/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..421329e58e0e415fa7a3283af3eacbb18f85177a
--- /dev/null
+++ b/Projects/AthenaP1/externals/README.md
@@ -0,0 +1,20 @@
+Directory collecting external package declarations
+==================================================
+
+This directory is used to collect simple CMake files that get included by
+the CMake configuration to set up the locations of all the externals used
+for the offline release build.
+
+Each external should be defined by its own CMake file. The files should
+have a name <Bla> corresponding to the Find<Bla> module name used to find
+the external in question.
+
+The files should define all the variables expected by the Find<Bla> modules,
+which normally boil down to variables:
+
+`EXTNAME_ROOT`
+`EXTNAME_VERSION`
+
+But some modules may require other variables. In which case the `_ROOT`
+variable should still be set, to get a nice printout from the AtlasExternals
+code during the build about the location of the used external.
diff --git a/Projects/AthenaP1/package_filters.txt b/Projects/AthenaP1/package_filters.txt
index 3548bc1dc0755cb6c37b52a7c49e77795689ea1d..4922adcd4ca4569fd479c20c5e54cff2c4e18ef6 100644
--- a/Projects/AthenaP1/package_filters.txt
+++ b/Projects/AthenaP1/package_filters.txt
@@ -2,23 +2,46 @@
 # Package filtering rules for the AthenaP1 project build.
 #
 
+# Don't pick up anything from the Projects directory:
+- Projects/.*
+
 # Only pick up a few packages from the External directory:
 + External/AtlasDataArea
 + External/pyAMI
 + External/AtlasPyFwdBwdPorts
 - External/.*
 
-# Only pick up the RunTime packages from Projects:
-+ Projects/.*RunTime
-- Projects/.*
-
 # Offload service has build problems
-- External/APEGlue
 - Offloading/.*
 
 # Temporary VP1 compilation issues 
 - graphics/VP1/.*
 
+# Some analysis packages that are not part of Athena
+- AsgExternal/Asg_Test
+- PhysicsAnalysis/D3PDTools/EventLoop
+- PhysicsAnalysis/AnalysisCommon/CPAnalysisExamples
+- PhysicsAnalysis/AnalysisCommon/PMGTools
+- PhysicsAnalysis/D3PDTools/EventLoop
+- PhysicsAnalysis/D3PDTools/EventLoopAlgs
+- PhysicsAnalysis/D3PDTools/EventLoopGrid
+- PhysicsAnalysis/D3PDTools/MultiDraw
+- PhysicsAnalysis/D3PDTools/SampleHandler
+- PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection
+- PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection
+- PhysicsAnalysis/HiggsPhys/Run2/HZZ/Tools/ZMassConstraint
+- PhysicsAnalysis/JetPhys/SemileptonicCorr
+- PhysicsAnalysis/SUSYPhys/SUSYTools
+- PhysicsAnalysis/TauID/DiTauMassTools
+- PhysicsAnalysis/TauID/TauCorrUncert
+- PhysicsAnalysis/TopPhys/QuickAna
+- PhysicsAnalysis/TrackingID/InDetTrackSystematicsTools
+- Reconstruction/Jet/JetAnalysisTools/JetTileCorrection
+- Reconstruction/Jet/JetJvtEfficiency
+- Reconstruction/Jet/JetReclustering
+- Trigger/TrigAnalysis/TrigMuonEfficiency
+- Trigger/TrigAnalysis/TrigTauAnalysis/TrigTauMatching
+
 # Remove simulation packages except those required for EDM, etc.
 - Calorimeter/CaloG4Sim
 - ForwardDetectors/AFP/AFP_G4_SD
@@ -97,19 +120,24 @@
 - TileCalorimeter/TileFastCaloSim
 - Tracking/TrkG4Components/.*
 
-#Remove analysis-related and D3PD code
-#- Trigger/TrigAnalysis/TriggerMenuAnalysis
-#+ PhysicsAnalysis/D3PDMaker/D3PDMakerUtils
-#+ PhysicsAnalysis/D3PDMaker/D3PDMakerCoreComps
-#+ PhysicsAnalysis/D3PDMaker/D3PDMakerRoot
-#+ PhysicsAnalysis/D3PDMaker/D3PDMakerConfig
-#+ PhysicsAnalysis/D3PDMaker/D3PDMakerInterfaces
-#+ PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker
-#+ PhysicsAnalysis/HeavyIonPhys/.*
-#- PhysicsAnalysis/D3PDMaker/.*
-#- PhysicsAnalysis/.*Phys/.*
+# Remove analysis-related and D3PD code
+- Trigger/TrigAnalysis/TriggerMenuAnalysis
++ PhysicsAnalysis/D3PDMaker/D3PDMakerUtils
++ PhysicsAnalysis/D3PDMaker/D3PDMakerCoreComps
++ PhysicsAnalysis/D3PDMaker/D3PDMakerRoot
++ PhysicsAnalysis/D3PDMaker/D3PDMakerConfig
++ PhysicsAnalysis/D3PDMaker/D3PDMakerInterfaces
++ PhysicsAnalysis/D3PDMaker/TrigCostD3PDMaker
++ PhysicsAnalysis/HeavyIonPhys/.*
+- PhysicsAnalysis/.*Phys/.*
+- PhysicsAnalysis/D3PDMaker/.*
+- PhysicsAnalysis/D23PDMakerUtils/.*
+- PhysicsAnalysis/NTUPtoNTUP/.*
+- PhysicsAnalysis/MonteCarloReact/.*
 - PhysicsAnalysis/AnalysisCommon/ReweightUtils
-- PhysicsAnalysis/D3PDMaker/TruthD3PDMaker
++ PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
+- PhysicsAnalysis/DerivationFramework/.*
 
 # Temporarily disabled
 - HLT/HLToks
+
diff --git a/Projects/AthenaP1/version.txt b/Projects/AthenaP1/version.txt
index 9fcf356b68f0d6239b3b3479f200b041f2c46885..a270d10af0ef323ab5e035010266a79f349c66b6 100644
--- a/Projects/AthenaP1/version.txt
+++ b/Projects/AthenaP1/version.txt
@@ -1 +1 @@
-21.1.2
+21.1.18
diff --git a/README.md b/README.md
index 8949b257d08f4965fbd3a6911ce65238d7180bd3..38813ff67c27c7c5432eb60c5e39e824be60539b 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,4 @@
-Athena - 21.0 Branch - Offline Reconstruction 2017
-==========================
+Athena - 21.0-TrigMC Branch - MC production with new trigger developments
 
 This branch is currently used for:
-- Tier0 processing for 2017
-- Derivations for 2017
-
+- Trigger developments that break Frozen Tier-0 Policy
diff --git a/Reconstruction/AODFix/python/AODFix.py b/Reconstruction/AODFix/python/AODFix.py
index e46a0636a0a3eb5c45461c727837f02d6e55dd12..1d6ab2177aca62396e62ec6a559e7b9cba83460f 100644
--- a/Reconstruction/AODFix/python/AODFix.py
+++ b/Reconstruction/AODFix/python/AODFix.py
@@ -25,9 +25,7 @@ from AthenaCommon.Logging import logging
 logAODFix = logging.getLogger( 'AODFix' )
 
 from AODFix_base import AODFix_base
-from AODFix_r191 import AODFix_r191
-from AODFix_r201 import AODFix_r201
-from AODFix_r207 import AODFix_r207
+from AODFix_r210 import AODFix_r210
 
 _aodFixInstance = AODFix_base()
 
@@ -65,33 +63,12 @@ def AODFix_Init():
     logAODFix.debug("curRelease set to " + curRelease)
     
     
-    runningInNightly = False
-    if curRelease.count(".")<2: #Build release always have dots
-        runningInNightly = True
-        # change rec.AtlasReleaseVersion to be more useful
-        atlasBaseDir = os.getenv("AtlasBaseDir") or ''
-
-        import re
-        matchList = re.findall(r"\d+\.\d+\.[^/]*", atlasBaseDir)
-        if len(matchList) > 0:
-            curRelease = matchList[0]
-        logAODFix.info("Running in nightly, curRelease set to " + curRelease)
-
-
-    ##################
-    # exit if not locked to true and running in a nightly
-    ##################
-    if runningInNightly and not rec.doApplyAODFix.is_locked():
-        logAODFix.info("running in a nightly. AODFix not scheduled.")
-        logAODFix.info("Please do manually 'rec.doApplyAODFix.set_Value_and_Lock(True)' to overwrite")
-        return 
- 
     ##################
     # determine athena with which input file was created and previous AODFix
     ##################
    
     # RDO doesn't have MetaData
-    prevAODFix='none'
+    prevAODFix =''
     prevRelease = ''
     isMC = False
 
@@ -103,9 +80,7 @@ def AODFix_Init():
         logAODFix.warning("Could not tell if the input file is data or MC; setting to data")
         isMC = False
 
-    if rec.readRDO():
-        prevRelease = 'bs'
-    else:
+    if not rec.readRDO():
 
         try:
             AtlasReleaseVersionString=inputFileSummary['metadata']['/TagInfo']['AtlasRelease']
@@ -114,7 +89,7 @@ def AODFix_Init():
                 prevRelease = rv[1]
         except Exception:
             logAODFix.warning("no AthenRelease found in input file, setting to <none> !!")
-            prevRelease='none'
+            prevRelease=''
 
 
         ##################
@@ -127,7 +102,7 @@ def AODFix_Init():
                 prevAODFix=prevAODFix.split("_")[0]
         except Exception:
             logAODFix.debug("no AODFixVersion found in input file, setting to <none>.")
-            prevAODFix='none'
+            prevAODFix=''
 
     logAODFix.info("Summary of MetaData for AODFix:")
     if isMC:
@@ -136,19 +111,15 @@ def AODFix_Init():
         logAODFix.info(" Input file is DATA")
     logAODFix.info(" Input file produced with Athena version <%s>." % prevRelease)
     logAODFix.info(" AODFix version <%s> was previously applied." % prevAODFix)
+    if rec.doApplyAODFix.is_locked():
+        logAODFix.info(" AODFix is forced to run!")
 
     ##################
     # determine which AODFix to run (if actually running--to be determined later)
     ##################
 
     doAODFix = False
-    metadataOnly = False
-    if rec.doESD():
-        # running from RAW or ESD, don't apply it, but set metadata
-        logAODFix.debug("detected doESD=True, *not* applying AODFix (but setting metadata)")
-        doAODFix = True
-        metadataOnly = True
-    elif rec.readAOD():  # change in policy: no AODFix if reading ESD.
+    if rec.readAOD():  # change in policy: no AODFix if reading ESD.
         doAODFix = True
         # check to see if it's a DAOD; do not run by default in DAODs
         from RecExConfig.InputFilePeeker import inputFileSummary
@@ -170,28 +141,19 @@ def AODFix_Init():
 
     curReleaseSplit = curRelease.split('.')
     prevReleaseSplit = prevRelease.split('.')
-    if len(curReleaseSplit) >= 2 and (metadataOnly or rec.doApplyAODFix.is_locked() or len(prevReleaseSplit) >= 2):
+    if len(curReleaseSplit) >= 2 and (rec.doApplyAODFix.is_locked() or len(prevReleaseSplit) >= 2):
         ### If adding an AODFix for a release family that does not have it,
         ### please add it to the if-elif... statement below
-        if (curReleaseSplit[0] == '19' and curReleaseSplit[1] == '1' and 
-              (metadataOnly or rec.doApplyAODFix.is_locked() or 
-               (prevReleaseSplit[0] == '19' and prevReleaseSplit[1] == '1'))):
-            _aodFixInstance = AODFix_r191(prevAODFix, isMC, metadataOnly, rec.doApplyAODFix.is_locked())
-        elif (curReleaseSplit[0] == '20' and curReleaseSplit[1] == '1' and 
-              (metadataOnly or rec.doApplyAODFix.is_locked() or 
-               (prevReleaseSplit[0] == '20' and prevReleaseSplit[1] == '1'))):
-            _aodFixInstance = AODFix_r201(prevAODFix, isMC, metadataOnly, rec.doApplyAODFix.is_locked())
-        elif (curReleaseSplit[0] == '20' and curReleaseSplit[1] == '7' and 
-              (metadataOnly or rec.doApplyAODFix.is_locked() or 
-               (prevReleaseSplit[0] == '20' and prevReleaseSplit[1] == '7'))):
-            _aodFixInstance = AODFix_r207(prevAODFix, isMC, metadataOnly, rec.doApplyAODFix.is_locked())
-        else:
-            logAODFix.info("No AODFix scheduled for this release.")
-
-    # file produced by nightly ?
-    #elif prevRelease.startswith("rel_"):
-    elif  len(prevReleaseSplit) <2 and prevRelease not in ("bs","none"):
-        logAODFix.info("input file produced from a nightly, and no AODFix applied. Will *not* schedule AODFix automatically! Please do manually 'rec.doApplyAODFix.set_Value_and_Lock(True)' to overwrite")
+        # if (curReleaseSplit[0] == '21' and (curReleaseSplit[1] == '0' or curReleaseSplit[1] == '2') and 
+        #       (rec.doApplyAODFix.is_locked() or 
+        #        (prevReleaseSplit[0] == '21' and (prevReleaseSplit[1] == '0' or prevReleaseSplit[1] == '2')))):
+        #     _aodFixInstance = AODFix_r210(prevAODFix, isMC, rec.doApplyAODFix.is_locked())
+        # else:
+        #     logAODFix.info("No AODFix scheduled for this release.")
+        logAODFix.info("AODFix disabled.")
+
+    else:
+        logAODFix.info("Current release is of strange form: %s" % curRelease)
 
 # To inquire whether AODFix will be run
 
diff --git a/Reconstruction/AODFix/python/AODFix_base.py b/Reconstruction/AODFix/python/AODFix_base.py
index d277b5471d9548dd0df9ca4a1d84f6923f646029..5781d6ee7ac42d719921957ce272c192f210a727 100644
--- a/Reconstruction/AODFix/python/AODFix_base.py
+++ b/Reconstruction/AODFix/python/AODFix_base.py
@@ -24,56 +24,43 @@ class AODFix_base(object):
     def latestAODFixVersion():
         """ Must override this member function in derived classes
         """
-        return ""
+        return []
 
-    def __init__(self, prevVersion = "", isMC = False, metadataOnly = False, force = False):
+    @staticmethod
+    def excludeFromMetadata():
+        """ Override if you want to remove something from metadata to be written
+        """
+        return []
+
+    def __init__(self, prevVersion = "", isMC = False, force = False):
         """ The default constructor. It implements the default behavior of setting
         up the latest AODFix to run. Only needs to be overriden if doing something
         more complicated.
         """
         self.isMC = isMC
-        self.prevAODFix = prevVersion
-        self.newAODFix = self.latestAODFixVersion()
-        logAODFix.debug( "latestAODFixVersion() = " +  self.latestAODFixVersion())
+        self.prevAODFix = prevVersion if not force else 'none' # if forcing, ignore old AODFix
+        self.newAODFix = "-".join(self.latestAODFixVersion())
+        logAODFix.debug( "latestAODFixVersion() = " +  self.newAODFix)
         logAODFix.debug( "prevVersion = " +  prevVersion)
         logAODFix.debug( "force = " +  str(force))
-        logAODFix.debug( "metadataOnly = " +  str(metadataOnly))
-        if self.latestAODFixVersion() == "":
+        if self.newAODFix == "":
             # the AODFix is empty: do nothing
             self.doAODFix = False
-            self.addMetadata = False
         elif not force:
-            if prevVersion == self.latestAODFixVersion():
+            if prevVersion == self.newAODFix:
                 self.doAODFix = False
-                self.addMetadata = False
-            elif metadataOnly:
-                self.doAODFix = False
-                self.addMetadata = True
             else:
                 self.doAODFix = True
-                self.addMetadata = True
 
         else:  # force running
-            if prevVersion == self.latestAODFixVersion():
-                if metadataOnly:
-                    self.doAODFix = False
-                    self.addMetadata = False
-                else:
-                    self.doAODFix = True
-                    self.addMetadata = False
-            elif metadataOnly:    # this takes precedence
-                self.doAODFix = False
-                self.addMetadata = True
-            else:
-                self.doAODFix = True
-                self.addMetadata = True
+            self.doAODFix = True
 
         if self.doAODFix:
             logAODFix.info("AODFix with version %s scheduled" % self.newAODFix)
 
     def addMetaData(self):
         '''standard function to apply metadata, can overload if necessary for complicated scenarios.'''
-        if self.addMetadata:
+        if self.doAODFix:
             logAODFix.debug("in addMetaData")
 
             from RecExConfig.RecFlags import rec
@@ -84,7 +71,15 @@ class AODFix_base(object):
             elif rec.readAOD():
                 suffix="_AOD"
 
-            str = "AODFix_" + self.newAODFix + suffix
+            # remove any metadata we don't want to write out (in order to rerun again)
+            metadataList = self.newAODFix.split("-")
+            excludeFromMetadata = self.excludeFromMetadata()
+
+            for excl in excludeFromMetadata:
+                if excl in metadataList:
+                    metadataList.remove(excl)
+
+            str = "AODFix_" + "-".join(metadataList) + suffix
 
             logAODFix.info("executing addMetaData, will add as AODFixVersion %s" % str)
             from AthenaCommon.AppMgr import ServiceMgr as svcMgr
diff --git a/Reconstruction/AODFix/python/AODFix_r191.py b/Reconstruction/AODFix/python/AODFix_r191.py
deleted file mode 100644
index ad207ca6c78c7cb99560cc312858580648c36c56..0000000000000000000000000000000000000000
--- a/Reconstruction/AODFix/python/AODFix_r191.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-from AthenaCommon.Logging import logging
-
-logAODFix_r191 = logging.getLogger( 'AODFix_r191' )
-
-from AODFix_base import AODFix_base
-
-class AODFix_r191(AODFix_base):
-    ''' This class just performs AODFix on 19.1.X releases
-
-    Instance variables
-      addMetadata (bool) (inherited): whether to add metaData
-      doAODFix (bool) (inherited): whether to do AODFix
-      prevAODFix (string): previous AODFix applied
-      newAODFix (string): new AODFix to apply
-    '''
-
-    @staticmethod
-    def latestAODFixVersion():
-        """The latest version of the AODFix."""
-        return "r191v1"
-    
-    # inside RecExCommon_topOptions.py:
-    def preInclude(self):
-        if self.doAODFix:
-            logAODFix_r191.debug("executing preIncude")
-
-            # run trigger fix
-            from AthenaCommon.AppMgr import ToolSvc
-            from AthenaCommon.AlgSequence import AlgSequence
-            topSequence=AlgSequence()
-
-            #fix xAOD trigger object by scheduling cnv alg again
-
-            from xAODTriggerCnv.xAODTriggerCnvConf import xAODMaker__TrigDecisionCnvAlg
-            topSequence += xAODMaker__TrigDecisionCnvAlg("TrigDecisionCnvAlg")
-            topSequence.TrigDecisionCnvAlg.xAODKey = 'xTrigDecision'
-
-            from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-            ToolSvc += Trig__TrigDecisionTool( "TrigDecisionTool" )
-
diff --git a/Reconstruction/AODFix/python/AODFix_r201.py b/Reconstruction/AODFix/python/AODFix_r201.py
deleted file mode 100644
index 431cbdda8f762563415c3668d9fc6abb80ed14aa..0000000000000000000000000000000000000000
--- a/Reconstruction/AODFix/python/AODFix_r201.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-from AthenaCommon.Logging import logging
-
-logAODFix_r201 = logging.getLogger( 'AODFix_r201' )
-
-from AODFix_base import AODFix_base
-
-class AODFix_r201(AODFix_base):
-    ''' This class just performs AODFix on 20.1.X releases
-
-    Instance variables
-      addMetadata (bool) (inherited): whether to add metaData
-      doAODFix (bool) (inherited): whether to do AODFix
-      prevAODFix (string): previous AODFix applied
-      newAODFix (string): new AODFix to apply
-    '''
-
-    @staticmethod
-    def latestAODFixVersion():
-        """The latest version of the AODFix."""
-        return "r201v1"
-
-    def postSystemRec(self):
-        if self.doAODFix:
-
-            logAODFix_r201.debug("Executing AODFix_r201_postSystemRec")
-
-            from AthenaCommon.AppMgr import ToolSvc
-            from AthenaCommon.AlgSequence import AlgSequence
-            topSequence = AlgSequence()
-
-            idtp = "InDetTrackParticles"
-            pvs = "PrimaryVertices"
-            from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-            ToolSvc += InDet__InDetTrackSelectionTool(
-                "AODFix_idtracksel",
-                minPt                = 400.0,
-                maxAbsEta            = 2.5,
-                minNSiHits           = 7,
-                maxNPixelSharedHits  = 1,
-                maxOneSharedModule   = True,
-                maxNSiHoles          = 2,
-                maxNPixelHoles       = 1,
-                )
-            from JetRecTools.JetRecToolsConf import JetTrackSelectionTool
-            ToolSvc += JetTrackSelectionTool(
-                "AODFix_tracksel",
-                InputContainer  = idtp,
-                OutputContainer = "AODFix_JetSelectedTracks",
-                Selector        = ToolSvc.AODFix_idtracksel
-                )
-            from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__TightTrackVertexAssociationTool
-            ToolSvc += CP__TightTrackVertexAssociationTool("AODFix_jetTightTVAtool", dzSinTheta_cut=3, doPV=True)
-
-            from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool
-            ToolSvc += TrackVertexAssociationTool(
-                "AODFix_tvassoc",
-                TrackParticleContainer  = idtp,
-                TrackVertexAssociation  = "AODFix_JetTrackVtxAssoc",
-                VertexContainer         = pvs,
-                TrackVertexAssoTool     = ToolSvc.AODFix_jetTightTVAtool,
-                )
-
-            # Jet track info.
-            from JetMomentTools.JetMomentToolsConf import JetTrackMomentsTool
-            ToolSvc += JetTrackMomentsTool(
-                "AODFix_trkmoms",
-                VertexContainer = pvs,
-                AssociatedTracks = "GhostTrack",
-                TrackVertexAssociation = ToolSvc.AODFix_tvassoc.TrackVertexAssociation,
-                TrackMinPtCuts = [500, 1000],
-                TrackSelector = ToolSvc.AODFix_tracksel
-                )
-
-            from JetMomentTools.JetMomentToolsConf import JetClusterMomentsTool
-            ToolSvc += JetClusterMomentsTool(
-                "AODFix_clsmoms",
-                DoClsSecondLambda=False,
-                DoClsCenterLambda=False,
-                DoClsSecondR=False
-                )
-
-            from JetMomentTools.JetMomentToolsConf import JetECPSFractionTool
-            ToolSvc += JetECPSFractionTool(
-                "AODFix_ecpsfrac"
-                )
-
-            from JetMomentTools.JetMomentToolsConf import JetConstitFourMomTool
-            ToolSvc += JetConstitFourMomTool(
-                "AODFix_constfourmom"
-                )
-
-            rtools = [ToolSvc.AODFix_tracksel, ToolSvc.AODFix_tvassoc]
-
-            jetmommods = [ToolSvc.AODFix_trkmoms]
-            LCjetmods = [ToolSvc.AODFix_clsmoms,ToolSvc.AODFix_ecpsfrac]
-            EMjetmods = [ToolSvc.AODFix_constfourmom]
-
-            from JetRec.JetRecConf import JetRecTool
-            ToolSvc += JetRecTool("AODFix_AntiKt4LCTopo",
-                                  InputContainer  = "AntiKt4LCTopoJets",
-                                  OutputContainer = "AntiKt4LCTopoJets",
-                                  JetModifiers    = jetmommods + LCjetmods)
-            ToolSvc += JetRecTool("AODFix_AntiKt4EMTopo",
-                                  InputContainer  = "AntiKt4EMTopoJets",
-                                  OutputContainer = "AntiKt4EMTopoJets",
-                                  JetModifiers    = jetmommods + EMjetmods)
-            rtools += [ ToolSvc.AODFix_AntiKt4LCTopo, ToolSvc.AODFix_AntiKt4EMTopo ]
-
-            from JetRec.JetRecConf import JetAlgorithm
-            topSequence += JetAlgorithm("jetalgAODFix", Tools = rtools)
diff --git a/Reconstruction/AODFix/python/AODFix_r207.py b/Reconstruction/AODFix/python/AODFix_r207.py
deleted file mode 100644
index 1930fbab7035dbcdebae9e902c27ac9828c30a12..0000000000000000000000000000000000000000
--- a/Reconstruction/AODFix/python/AODFix_r207.py
+++ /dev/null
@@ -1,765 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-from AthenaCommon.Logging import logging
-
-logAODFix_r207 = logging.getLogger( 'AODFix_r207' )
-
-from AODFix_base import AODFix_base
-
-class AODFix_r207(AODFix_base):
-    ''' This class just performs AODFix on 20.7.X releases
-
-    Instance variables
-      addMetadata (bool) (inherited): whether to add metaData
-      doAODFix (bool) (inherited): whether to do AODFix
-      prevAODFix (string): previous AODFix applied
-      newAODFix (string): new AODFix to apply
-      isMC (bool): is the input data MC?
-    '''
-
-    @staticmethod
-    def latestAODFixVersion():
-        """The latest version of the AODFix. Moving to new AODFix version scheme"""
-        nextMajRel = "20.7.8"
-
-        # items in this list will be excluded from the metadata, so will always rerun
-        excludeFromMetadata = ["btagging"] 
-
-        metadataList = [item.split("_")[0] for item in sorted(AODFix_r207.__dict__.keys()) 
-                        if ("_" in item and "__" not in item)]
-
-        for excl in excludeFromMetadata:
-            if excl in metadataList:
-                metadataList.remove(excl)
-
-        metadataList.insert(0, nextMajRel)
-
-        return "-".join(metadataList)
-
-    def preInclude( self ):
-        """
-        This function calls the other preincludes base on metadata
-        """
-        if self.doAODFix:
-            oldMetadataList = self.prevAODFix.split("-")
-            # Note that the two (xAOD::)EventInfo fixing functions can't clash
-            # with each other. Since the "pileup" fix is only applied on data,
-            # and the "mcweight" fix is only applied on MC.
-            if "pileup" not in oldMetadataList:
-                self.pileup_preInclude()
-                pass
-            if "mcweight" not in oldMetadataList:
-                self.mcweight_preInclude()
-                pass
-            pass
-        return
-
-    def postSystemRec(self):
-        """
-        This function calls the other postSystemRecs base on metadata"
-        """
-
-        if self.doAODFix:
-
-            logAODFix_r207.debug("Executing AODFix_r207_postSystemRec")
-
-            from AthenaCommon.AlgSequence import AlgSequence
-            topSequence = AlgSequence()
-            
-            oldMetadataList = self.prevAODFix.split("-")
-            if "mcutils" not in oldMetadataList:
-                self.mcutils_postSystemRec(topSequence)
-                pass
-            if "btagging" not in oldMetadataList:
-                self.btagging_postSystemRec(topSequence)
-                pass
-            if "met" not in oldMetadataList:
-                self.met_postSystemRec(topSequence)
-                pass
-            if "pflow" not in oldMetadataList:
-                self.pflow_postSystemRec(topSequence)
-                pass
-            # Muon AODfix
-            if "muon" not in oldMetadataList:
-                self.muon_postSystemRec(topSequence)
-                pass
-
-            # if "tau" not in oldMetadataList:
-            #     self.tau_postSystemRec(topSequence)
-            #     pass
-
-            # Reset all of the ElementLinks. To be safe.
-            from AthenaCommon import CfgMgr
-            topSequence += \
-                CfgMgr.xAODMaker__ElementLinkResetAlg( "AODFix_ElementLinkReset" )
-            pass
-
-        return
-
-
-    # Below are the individual AODfixes, split up and documented
-    # Name must follow format: <fixID>_<whereCalled>
-
-    def mcweight_preInclude( self ):
-        """
-        This fixes the problem with propagating multiple MC weights correctly
-        into the (xAOD::)EventInfo object in MC samples that provide multiple
-        weights. The issue is described in:
-           https://its.cern.ch/jira/browse/ATLASSIM-2989
-        """
-
-        # Tell the user what's happening:
-        logAODFix_r207.debug( "Executing AODFix_r207_mcweight_preInclude" )
-
-        # This fix is only needed for MC files that don't have this fix.
-        from AthenaCommon.GlobalFlags import globalflags
-        if globalflags.DataSource() != "geant4":
-            return
-
-        # Access the main algorithm sequence:
-        from AthenaCommon.AlgSequence import AlgSequence
-        topSequence = AlgSequence()
-
-        # Add the AODFix algorithms to this sub-sequence:
-        from AthenaCommon import CfgMgr
-        topSequence += \
-            CfgMgr.EventInfoMCWeightFixAlg( "AODFix_EventInfoMCWeightFixAlg" )
-        # Note that we must use the default algorithm name, as the CutFlowSvc's
-        # setup will only be correct with that name. Otherwise the event
-        # bookkeeping metadata doesn't see this fix...
-        topSequence += \
-            CfgMgr.xAODMaker__EventInfoCnvAlg( ForceOverwrite = True )
-
-        return
-
-    def pileup_preInclude(self):
-        """
-        This fixes the problem with the in-time pileup number in
-        xAOD::EventInfo, as described in:
-           https://its.cern.ch/jira/browse/ATLASRECTS-3204
-        Incremented version to r207v4.
-        """
-
-        # Tell the user what's happening:
-        logAODFix_r207.debug( "Executing AODFix_r207_pileup_preInclude" )
-
-        # This fix is only needed for 20.7 data files made from data15,
-        # without this fix.
-        from AthenaCommon.GlobalFlags import globalflags
-        if globalflags.DataSource() != "data":
-            return
-        from RecExConfig.RecFlags import rec
-        if rec.projectName() != "data15_13TeV":
-            return
-
-        # Access the main algorithm sequence:
-        from AthenaCommon.AlgSequence import AlgSequence
-        topSequence = AlgSequence()
-
-        # Make sure that the LuminosityTool is configured. This needs at
-        # least LumiBlockComps-01-00-27 to work correctly.
-        from AthenaCommon.AppMgr import ToolSvc
-        if not hasattr( ToolSvc, "LuminosityTool" ):
-            from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault
-            ToolSvc += LuminosityToolDefault()
-            pass
-
-        # Set up the xAOD::EventInfo creator algorithm to overwrite the
-        # existing object. This needs at least xAODEventInfoCnv-00-00-17-01,
-        # or xAODEventInfoCnv-00-00-23.
-        from AthenaCommon import CfgMgr
-        topSequence += \
-            CfgMgr.xAODMaker__EventInfoCnvAlg( "AODFix_EventInfoCnvAlg",
-                                               ForceOverwrite = True )
-
-        return
-
-    def muon_postSystemRec(self, topSequence):
-        """This fixes the muon momenta to match that of its primary TrackParticle.
-        JIRA: https://its.cern.ch/jira/browse/ATLASRECTS-3121
-        Reco meeting: https://indico.cern.ch/event/532806/
-        Incremented version to r207v3.
-        """
-        from xAODMuonCnv.xAODMuonCnvConf import xAOD__MuonAODFixAlg
-        topSequence+=xAOD__MuonAODFixAlg()
-        
-    # Comment out for now so that it doesn't get added in the metadata
-
-    # def tau_postSystemRec(self, topSequence):
-    #     from tauRec.TauRecAODBuilder import TauRecAODProcessor
-    #     TauRecAODProcessor()
-    #     return
-
-    def pflow_postSystemRec(self, topSequence):
-
-        #Only run pflow AOD fix if input file contains AntKt4EMPFlowJets - should be the case for all samples, except HI samples
-        from RecExConfig.ObjKeyStore import cfgKeyStore
-        if cfgKeyStore.isInInputFile("xAOD::JetContainer","AntiKt4EMPFlowJets"):
-
-            #Now we need to rerun the particle flow jet finding
-
-            #This configuration should be identical to the AntiKt4EMPflowJets configured in:
-            #http://acode-browser2.usatlas.bnl.gov/lxr-rel20/source/atlas/Reconstruction/Jet/JetRec/share/JetRec_jobOptions.py
-            #with the addJetFinder function (in the svn tag for 20.7)
-            from AthenaCommon import CfgMgr
-            particleFlowJetFinder_AntiKt4 = CfgMgr.JetFinder("AntiKt4EMPFlowJetsFinder_AODFix")
-            particleFlowJetFinder_AntiKt4.JetAlgorithm = "AntiKt"
-            particleFlowJetFinder_AntiKt4.JetRadius = 0.4
-            particleFlowJetFinder_AntiKt4.GhostArea = 0.01
-            particleFlowJetFinder_AntiKt4.PtMin = 2000
-
-            #Then we setup a jet builder to calculate the areas needed for the rho subtraction
-            from AthenaCommon.AppMgr import ToolSvc
-            particleFlowJetBuilder_AntiKt4 = CfgMgr.JetFromPseudojet("jblda_AODFix", Attributes = ["ActiveArea", "ActiveArea4vec"])
-            ToolSvc += particleFlowJetBuilder_AntiKt4
-            particleFlowJetFinder_AntiKt4.JetBuilder = particleFlowJetBuilder_AntiKt4
-            ToolSvc += particleFlowJetFinder_AntiKt4
-
-            #Now we setup a JetRecTool which will use the above JetFinder
-            particleFlowJetRecTool = CfgMgr.JetRecTool("AntiKt4EMPFlowJets_AODFix")
-            particleFlowJetRecTool.JetFinder = particleFlowJetFinder_AntiKt4
-            ToolSvc += particleFlowJetRecTool
-
-            jpjretriever = CfgMgr.JetPseudojetRetriever("jpjretriever")
-            ToolSvc += jpjretriever
-
-            pflowRetriever = CfgMgr.CP__RetrievePFOTool("pflowretriever_AODFix")
-            ToolSvc += pflowRetriever
-
-            trk_trackselloose = CfgMgr.InDet__InDetTrackSelectionTool(
-                "trk_trackselloose_AODFix",
-                CutLevel = "Loose"
-                )
-            ToolSvc += trk_trackselloose
-
-            trackselloose = CfgMgr.JetTrackSelectionTool(
-              "trackselloose",
-              InputContainer  = "InDetTrackParticles",
-              OutputContainer = "JetSelectedTracks",
-              Selector        = trk_trackselloose
-            )
-            ToolSvc += trackselloose
-
-            tracksel = CfgMgr.JetTrackSelectionTool(
-                "tracksel_AODFix",
-                InputContainer  = "InDetTrackParticles",
-                OutputContainer = "JetSelectedTracks_AODFix",
-                Selector        = trk_trackselloose
-                )
-            ToolSvc += tracksel
-
-            tighttva = CfgMgr.CP__TightTrackVertexAssociationTool("jetTighTVAtool_AODFix", dzSinTheta_cut=3, doPV=True)
-            ToolSvc += tighttva
-
-            tvassoc = CfgMgr.TrackVertexAssociationTool(
-                "tvassoc_AODFix",
-                TrackParticleContainer  = "InDetTrackParticles",
-                TrackVertexAssociation  = "JetTrackVtxAssoc_AODFix",
-                VertexContainer         = "PrimaryVertices",
-                TrackVertexAssoTool     = tighttva,
-                )
-            ToolSvc += tvassoc
-
-            # Ghost tracks.
-            ghostScaleFactor = 1e-40
-            gtrackget = CfgMgr.TrackPseudoJetGetter(
-                "gtrackget_AODFix",
-                InputContainer = tracksel.OutputContainer,
-                Label = "GhostTrack",
-                OutputContainer = "PseudoJetGhostTracks_AODFix",
-                TrackVertexAssociation = tvassoc.TrackVertexAssociation,
-                SkipNegativeEnergy = True,
-                GhostScale = ghostScaleFactor
-                )
-            ToolSvc += gtrackget
-
-            # Muon segments
-            gmusegget = CfgMgr.MuonSegmentPseudoJetGetter(
-                "gmusegget_AODFix",
-                InputContainer = "MuonSegments",
-                Label = "GhostMuonSegment",
-                OutputContainer = "PseudoJetGhostMuonSegment_AODFix",
-                Pt = 1.e-20
-                )
-            ToolSvc += gmusegget
-
-            # AntiKt2 track jets.
-            gakt2trackget = CfgMgr.PseudoJetGetter(
-                "gakt2trackget_AODFix", # give a unique name
-                InputContainer = "AntiKt2PV0TrackJets", # SG key
-                Label = "GhostAntiKt2TrackJet",   # this is the name you'll use to retrieve associated ghosts
-                OutputContainer = "PseudoJetGhostAntiKt2TrackJet_AODFix",
-                SkipNegativeEnergy = True,
-                GhostScale = ghostScaleFactor,   # This makes the PseudoJet Ghosts, and thus the reco flow will treat them as so.
-                )
-            ToolSvc += gakt2trackget
-
-            # AntiKt3 track jets.
-            gakt3trackget = CfgMgr.PseudoJetGetter(
-                "gakt3trackget_AODFix", # give a unique name
-                InputContainer = "AntiKt3PV0TrackJets", # SG key
-                Label = "GhostAntiKt3TrackJet",   # this is the name you'll use to retrieve associated ghosts
-                OutputContainer = "PseudoJetGhostAntiKt3TrackJet_AODFix",
-                SkipNegativeEnergy = True,
-                GhostScale = ghostScaleFactor,   # This makes the PseudoJet Ghosts, and thus the reco flow will treat them as so.
-                )
-            ToolSvc += gakt3trackget
-
-            # AntiKt4 track jets.
-            gakt4trackget = CfgMgr.PseudoJetGetter(
-                "gakt4trackget_AODFix", # give a unique name
-                InputContainer = "AntiKt4PV0TrackJets", # SG key
-                Label = "GhostAntiKt4TrackJet",   # this is the name you'll use to retrieve associated ghosts
-                OutputContainer = "PseudoJetGhostAntiKt4TrackJet_AODFix",
-                SkipNegativeEnergy = True,
-                GhostScale = ghostScaleFactor,   # This makes the PseudoJet Ghosts, and thus the reco flow will treat them as so.
-                )
-            ToolSvc += gakt4trackget
-
-            # Truth.
-            mctc = None
-            truthpartcopy = None
-            gtruthget = None
-            gtruthgetters = []
-            rtools = []
-            rtools += [tracksel, tvassoc]
-            if self.isMC:
-                mctc = CfgMgr.MCTruthClassifier(name = "JetMCTruthClassifier_AODFix",
-                                                ParticleCaloExtensionTool="")
-                ToolSvc += mctc
-
-                truthpartcopy = CfgMgr.CopyTruthJetParticles("truthpartcopy_AODFix",
-                                                             OutputName="JetInputTruthParticles_AODFix",
-                                                             MCTruthClassifier=mctc)
-                ToolSvc += truthpartcopy
-
-                gtruthget = CfgMgr.PseudoJetGetter(
-                    "gtruthget_AODFix",
-                    Label = "GhostTruth",
-                    InputContainer = truthpartcopy.OutputName,
-                    OutputContainer = "PseudoJetGhostTruth_AODFix",
-                    GhostScale = ghostScaleFactor,
-                    SkipNegativeEnergy = True,
-                    )
-                ToolSvc += gtruthget
-
-                # Truth flavor tags.
-                truthFlavourTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                                    "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                                    "TausFinal",
-                                    "WBosons", "ZBosons", "HBosons", "TQuarksFinal",
-                                    "Partons",
-                                    ]
-                for ptype in truthFlavourTags:
-                    gtruthgetters.append(CfgMgr.PseudoJetGetter(
-                            "gtruthget_" + ptype + "_AODFix",
-                            InputContainer = "TruthLabel" + ptype + "_AODFix",
-                            Label = "Ghost" + ptype,
-                            OutputContainer = "PseudoJetGhost" + ptype + "_AODFix",
-                            SkipNegativeEnergy = True,
-                            GhostScale = ghostScaleFactor,
-                            ))
-                    ToolSvc += gtruthgetters[-1]
-
-                    toolname = "CopyTruthTag" + ptype + "_AODFix"
-                    print "Scheduling " + toolname
-                    ptmin = 5000
-                    if ptype == "Partons":
-                        ctp = CfgMgr.CopyTruthPartons(toolname)
-                    elif ptype in ["WBosons", "ZBosons", "HBosons", "TQuarksFinal"]:
-                        ctp = CfgMgr.CopyBosonTopLabelTruthParticles(toolname)
-                        ctp.ParticleType = ptype
-                        ptmin = 100000
-                    else:
-                        ctp = CfgMgr.CopyFlavorLabelTruthParticles(toolname)
-                        ctp.ParticleType = ptype
-                    ctp.OutputName = "TruthLabel" + ptype + "_AODFix"
-                    ctp.PtMin = ptmin
-                    ToolSvc += ctp
-                    rtools.append( ctp )
-
-                # build truth jet input :
-                rtools += [ truthpartcopy]
-
-            jetrun = CfgMgr.JetToolRunner("jetrun_AODFix",
-                                 Tools=rtools,
-                                 )
-            ToolSvc += jetrun
-
-            #Setup a pseudojetgetter to deal with input objects
-            empflowget = CfgMgr.PFlowPseudoJetGetter(
-                "empflowget_AODFix",
-                Label = "EMPFlow",
-                OutputContainer = "PseudoJetEMPFlow_AODFix",
-                RetrievePFOTool = pflowRetriever,
-                InputIsEM = True,
-                CalibratePFO = False,
-                SkipNegativeEnergy = True,
-                UseVertices = True
-            )
-            ToolSvc += empflowget
-
-            empfgetters = [empflowget,gtrackget,gmusegget,gakt2trackget,gakt3trackget,gakt4trackget]
-            if self.isMC:
-                empfgetters += [gtruthget]+gtruthgetters
-
-            particleFlowJetRecTool.PseudoJetGetters = empfgetters
-            particleFlowJetRecTool.Overwrite = True
-            particleFlowJetRecTool.OutputContainer = "AntiKt4EMPFlowJets"
-
-            #setup calibration tools - only want to do area subtraction (as is done in Tier0)
-            jetdefn = particleFlowJetFinder_AntiKt4.JetAlgorithm + str(int(10*particleFlowJetFinder_AntiKt4.JetRadius+0.1)) + empflowget.Label
-            pflowJetCalibToolName_AODFix="calib_"+jetdefn+"_pflow_A_AODFix"
-            ToolSvc += CfgMgr.JetCalibrationTool("pflowJetCalibTool_AODFix",JetCollection=jetdefn,ConfigFile="PFlowJES_September2014.config",CalibSequence="JetArea",RhoKey="Kt4EMPFlowEventShape")
-            particleFlowJetRecTool.JetModifiers = [ToolSvc.pflowJetCalibTool_AODFix]
-
-            #now we setup the other modifiers we need
-            ToolSvc += CfgMgr.JetFilterTool("jetFilter_AODFix",PtMin=5000)
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.jetFilter_AODFix]
-
-            #common_ungroomed_modifiers start here
-            ToolSvc += CfgMgr.JetWidthTool("width_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.width_AODFix]
-
-            ToolSvc += CfgMgr.JetIsolationTool("jetisol_AODFix",IsolationCalculations = ["IsoDelta:2:SumPt", "IsoDelta:3:SumPt"])
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.jetisol_AODFix]
-
-            ToolSvc +=  CfgMgr.KtDeltaRTool("ktdr_AODFix",JetRadius = 0.4);
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.ktdr_AODFix]
-
-            ToolSvc +=  CfgMgr.NSubjettinessTool("nsubjettiness_AODFix",Alpha = 1.0)
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.nsubjettiness_AODFix]
-
-            ToolSvc +=  CfgMgr.KTSplittingScaleTool("ktsplitter_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.ktsplitter_AODFix]
-
-            ToolSvc += CfgMgr.AngularityTool("angularity_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.angularity_AODFix]
-
-            ToolSvc += CfgMgr.DipolarityTool("dipolarity_AODFix", SubJetRadius = 0.3)
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.dipolarity_AODFix]
-
-            ToolSvc += CfgMgr.PlanarFlowTool("planarflow_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.planarflow_AODFix]
-
-            ToolSvc += CfgMgr.KtMassDropTool("ktmassdrop_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.ktmassdrop_AODFix]
-
-            ToolSvc += CfgMgr.EnergyCorrelatorTool("encorr_AODFix", Beta = 1.0)
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.encorr_AODFix]
-
-            ToolSvc += CfgMgr.CenterOfMassShapesTool("comshapes_AODFix")
-            particleFlowJetRecTool.JetModifiers += [ToolSvc.comshapes_AODFix]
-
-            #common_ungroomed_modifiers that are for MC only
-            if self.isMC:
-                ToolSvc += CfgMgr.Analysis__JetPartonTruthLabel("partontruthlabel_AODFix")
-                particleFlowJetRecTool.JetModifiers += [ToolSvc.partontruthlabel_AODFix]
-
-                ToolSvc += CfgMgr.Analysis__JetQuarkLabel("jetquarklabel_AODFix",McEventCollection = "TruthEvents")
-                ToolSvc += CfgMgr.Analysis__JetConeLabeling("truthpartondr_AODFix",JetTruthMatchTool = ToolSvc.jetquarklabel_AODFix)
-                particleFlowJetRecTool.JetModifiers += [ToolSvc.truthpartondr_AODFix]
-            ## end of JM modification
-            #common_ungroomed_modifiers end here
-
-            # Modifiers for topo (and pflow) jets.
-            jetens = CfgMgr.JetCaloEnergies("jetens_AODFix")
-            ToolSvc += jetens
-
-            larhvcorr = CfgMgr.JetLArHVTool("larhvcorr_AODFix")
-            ToolSvc += larhvcorr
-
-            caloqual_cluster = CfgMgr.JetCaloQualityTool(
-                "caloqual_cluster_AODFix",
-                TimingCuts = [5, 10],
-                Calculations = ["LArQuality", "N90Constituents", "FracSamplingMax",
-                                "NegativeE", "Timing", "HECQuality", "Centroid",
-                                "AverageLArQF", "BchCorrCell"],
-                )
-            ToolSvc += caloqual_cluster
-
-            # Jet vertex fraction with selection.
-            jvf = CfgMgr.JetVertexFractionTool(
-              "jvf_AODFix",
-              VertexContainer = "PrimaryVertices",
-              AssociatedTracks = "GhostTrack",
-              TrackVertexAssociation = tvassoc.TrackVertexAssociation,
-              TrackSelector = trackselloose,
-              JVFName = "JVF"
-            )
-            ToolSvc += jvf
-
-            # Jet vertex tagger.
-            jvt = CfgMgr.JetVertexTaggerTool(
-              "jvt_AODFix",
-              VertexContainer = "PrimaryVertices",
-              TrackParticleContainer  = "InDetTrackParticles",
-              AssociatedTracks = "GhostTrack",
-              TrackVertexAssociation = tvassoc.TrackVertexAssociation,
-              TrackSelector = trackselloose,
-              JVTName = "Jvt",
-              K_JVFCorrScale = 0.01,
-              Z0Cut = 3.0,
-              PUTrkPtCut = 30000.0
-            )
-            ToolSvc += jvt
-
-            # Jet track info.
-            trkmoms = CfgMgr.JetTrackMomentsTool(
-              "trkmoms_AODFix",
-              VertexContainer = "PrimaryVertices",
-              AssociatedTracks = "GhostTrack",
-              TrackVertexAssociation = tvassoc.TrackVertexAssociation,
-              TrackMinPtCuts = [500, 1000],
-              TrackSelector = trackselloose
-            )
-            ToolSvc += trkmoms
-
-            charge = CfgMgr.JetChargeTool("charge_AODFix", K=1.0)
-            ToolSvc += charge                
-
-            particleFlowJetRecTool.JetModifiers += [jetens,larhvcorr,caloqual_cluster,
-                                                    jvf,jvt,trkmoms,charge]
-
-            if self.isMC:
-                truthassoc = CfgMgr.JetPtAssociationTool(
-                    "truthassoc_AntiKt4_AODFix",
-                    InputContainer="AntiKt4TruthJets", AssociationName="GhostTruth")
-                ToolSvc += truthassoc
-
-                jetdrlabeler = CfgMgr.ParticleJetDeltaRLabelTool(
-                  "jetdrlabeler_AODFix",
-                  LabelName = "HadronConeExclTruthLabelID",
-                  BLabelName = "ConeExclBHadronsFinal",
-                  CLabelName = "ConeExclCHadronsFinal",
-                  TauLabelName = "ConeExclTausFinal",
-                  BParticleCollection = "TruthLabelBHadronsFinal_AODFix",
-                  CParticleCollection = "TruthLabelCHadronsFinal_AODFix",
-                  TauParticleCollection = "TruthLabelTausFinal_AODFix",
-                  PartPtMin = 5000.0,
-                  JetPtMin = 4500.0,
-                  DRMax = 0.3,
-                  MatchMode = "MinDR"
-                )
-                ToolSvc += jetdrlabeler
-
-                particleFlowJetRecTool.JetModifiers += [truthassoc,jetdrlabeler]
-
-            JetType = 'PFlowJet'
-            PFtermlist = ['PFlowJet','Muon','Ele','Gamma','Tau','Soft']
-            newpfotool = CfgMgr.CP__RetrievePFOTool('MET_PFOTool_AODFix')
-            ToolSvc += newpfotool
-
-            #is this the right config ????? undefined before I put this here <griffith@cern.ch>
-            newtrkseltool=CfgMgr.InDet__InDetTrackSelectionTool("IDTrkSel_METAssoc_AODFix",
-                                                                CutLevel="TightPrimary",
-                                                                maxZ0SinTheta=3,
-                                                                maxD0overSigmaD0=2)
-
-            from METReconstruction.METAssocConfig import AssocConfig, getAssociator
-            PFAssociators = [ getAssociator(AssocConfig(config),suffix='AntiKt4EMPFlow',doPFlow=True,trkseltool=newtrkseltool,pfotool=newpfotool) for config in PFtermlist ]
-            PFAssocTool = CfgMgr.met__METAssociationTool('MET_AssociationTool_AntiKt4EMPFlow_AODFix',
-                                                         METAssociators = PFAssociators,
-                                                         METSuffix = 'AntiKt4EMPFlow',
-                                                         AllowOverwrite=True)
-            ToolSvc += PFAssocTool
-
-            from METUtilities.METMakerConfig import getMETMakerAlg
-
-            METAssocAlg_PFlow = CfgMgr.met__METRecoAlg(name='METAssociation_PFlow_AODFix',RecoTools=[PFAssocTool])
-            METMakerAlg_PF = getMETMakerAlg('AntiKt4EMPFlow',confsuffix="_AODFix")
-            METMakerAlg_PF.AllowOverwrite = True
-            
-            #Set up our own sequence
-            from AthenaCommon.AlgSequence import AthSequencer
-            ParticleFlowJetSequence = AthSequencer("ParticleFlowSelectionSequence")
-            topSequence += ParticleFlowJetSequence
-
-            #Add an event filter to our sequence
-            ParticleFlowJetSequence += CfgMgr.ParticleFlowEventFilter_r207("ParticleFlowEventFilter_r207")
-            #Add the particle flow jet finding to our sequence
-            ParticleFlowJetSequence += CfgMgr.JetAlgorithm("pflowJetAlg_AODFix", Tools = [jetrun,
-                                                                                   ToolSvc.AntiKt4EMPFlowJets_AODFix])
-            #Add MET map builder to our sequence
-            ParticleFlowJetSequence += METAssocAlg_PFlow
-            #Build the reference MET container
-            ParticleFlowJetSequence += METMakerAlg_PF
-    # End PFlow AODFix
-
-    def met_postSystemRec(self, topSequence):
-        # MET AODFix
-        from METReconstruction.METAssocConfig import AssocConfig, getAssociator
-        from METReconstruction.METReconstructionConf import METBadTrackEventFilter
-        from AthenaCommon.AlgSequence import AthSequencer
-        METMapSequence = AthSequencer("MET_LCEM_SelectionSequence_AODFix")
-        topSequence += METMapSequence
-
-        from AthenaCommon import CfgMgr
-        newtrkseltool=CfgMgr.InDet__InDetTrackSelectionTool("IDTrkSel_METAssoc_AODFix",
-                                             CutLevel="TightPrimary",
-                                             maxZ0SinTheta=3,
-                                             maxD0overSigmaD0=2)
-        from AthenaCommon.AppMgr import ToolSvc
-        ToolSvc += newtrkseltool
-
-        METMapSequence += METBadTrackEventFilter("METBadTrackEventFilter_AODFix",TrackSelectorTool=newtrkseltool)
-
-        LCtermlist = ['LCJet','Muon','Ele','Gamma','Tau','Soft']
-        LCAssociators = [ getAssociator(AssocConfig(config),suffix='AntiKt4LCTopo',doPFlow=False,trkseltool=newtrkseltool) for config in LCtermlist ]
-        LCAssocTool = CfgMgr.met__METAssociationTool('MET_AssociationTool_AntiKt4LCTopo_AODFix',
-                                                     METAssociators = LCAssociators,
-                                                     METSuffix = 'AntiKt4LCTopo',
-                                                     AllowOverwrite=True,
-                                                     TCSignalState=1) # LC clusters
-        ToolSvc += LCAssocTool
-
-        EMtermlist = ['EMJet','Muon','Ele','Gamma','Tau','Soft']
-        EMAssociators = [ getAssociator(AssocConfig(config),suffix='AntiKt4EMTopo',doPFlow=False,trkseltool=newtrkseltool) for config in EMtermlist ]
-        EMAssocTool = CfgMgr.met__METAssociationTool('MET_AssociationTool_AntiKt4EMTopo_AODFix',
-                                                     METAssociators = EMAssociators,
-                                                     METSuffix = 'AntiKt4EMTopo',
-                                                     AllowOverwrite=True,
-                                                     TCSignalState=0) # EM clusters
-        ToolSvc += EMAssocTool
-
-        METAssocAlg_LCEM = CfgMgr.met__METRecoAlg(name='METAssociation_LCEM_AODFix',RecoTools=[LCAssocTool,EMAssocTool])
-        METMapSequence += METAssocAlg_LCEM
-
-        from METUtilities.METMakerConfig import getMETMakerAlg
-        METMakerAlg_LC = getMETMakerAlg('AntiKt4LCTopo',confsuffix="_AODFix")
-        METMakerAlg_LC.AllowOverwrite = True
-        METMakerAlg_EM = getMETMakerAlg('AntiKt4EMTopo',confsuffix="_AODFix")
-        METMakerAlg_EM.AllowOverwrite = True
-        METMapSequence += METMakerAlg_LC
-        METMapSequence += METMakerAlg_EM
-
-    # End MET AODFix
-
-    def mcutils_postSystemRec(self, topSequence):
-        """
-        This fixes the MCUtils/TruthUtil bug:
-        https://its.cern.ch/jira/browse/ATLASRECTS-3008
-        """
-
-        from AthenaCommon.AppMgr import ToolSvc
-
-        if self.isMC:
-
-            from ParticleJetTools.ParticleJetToolsConf import CopyFlavorLabelTruthParticles
-            from ParticleJetTools.ParticleJetToolsConf import ParticleJetDeltaRLabelTool
-
-            ptypes = ["TausFinal","BHadronsFinal","CHadronsFinal"]
-            for ptype in ptypes:
-                AODFix_ctp = CopyFlavorLabelTruthParticles("AODFix_CopyTruthTag"+ptype)
-                AODFix_ctp.ParticleType = ptype
-                AODFix_ctp.OutputName = "AODFix_TruthLabel" + ptype
-                ToolSvc += AODFix_ctp
-
-            AODFix_JetDeltaRLabelTool = ParticleJetDeltaRLabelTool(
-              "AODFix_jetdrlabeler",
-              LabelName = "HadronConeExclTruthLabelID",
-              BLabelName = "ConeExclBHadronsFinal",
-              CLabelName = "ConeExclCHadronsFinal",
-              TauLabelName = "ConeExclTausFinal",
-              BParticleCollection = "AODFix_TruthLabelBHadronsFinal",
-              CParticleCollection = "AODFix_TruthLabelCHadronsFinal",
-              TauParticleCollection = "AODFix_TruthLabelTausFinal",
-              PartPtMin = 5000.0,
-              JetPtMin = 0.0,
-              DRMax = 0.3,
-              MatchMode = "MinDR"
-            )
-            ToolSvc += AODFix_JetDeltaRLabelTool
-
-            AODFix_FatJetDeltaRLabelTool = ParticleJetDeltaRLabelTool(
-              "AODFix_fatjetdrlabeler",
-              LabelName = "HadronConeExclTruthLabelID",
-              BLabelName = "ConeExclBHadronsFinal",
-              CLabelName = "ConeExclCHadronsFinal",
-              TauLabelName = "ConeExclTausFinal",
-              BParticleCollection = "AODFix_TruthLabelBHadronsFinal",
-              CParticleCollection = "AODFix_TruthLabelCHadronsFinal",
-              TauParticleCollection = "AODFix_TruthLabelTausFinal",
-              PartPtMin = 5000.0,
-              JetPtMin = 0.0,
-              DRMax = 1.0,
-              MatchMode = "MinDR"
-            )
-            ToolSvc += AODFix_FatJetDeltaRLabelTool
-
-            AODFix_TrackJetDeltaRLabelTool = ParticleJetDeltaRLabelTool(
-              "AODFix_trackjetdrlabeler",
-              LabelName = "HadronConeExclTruthLabelID",
-              BLabelName = "ConeExclBHadronsFinal",
-              CLabelName = "ConeExclCHadronsFinal",
-              TauLabelName = "ConeExclTausFinal",
-              BParticleCollection = "AODFix_TruthLabelBHadronsFinal",
-              CParticleCollection = "AODFix_TruthLabelCHadronsFinal",
-              TauParticleCollection = "AODFix_TruthLabelTausFinal",
-              PartPtMin = 5000.0,
-              JetPtMin = 4500.0,
-              DRMax = 0.3,
-              MatchMode = "MinDR"
-            )
-
-            ToolSvc += AODFix_TrackJetDeltaRLabelTool
-
-            from JetRec.JetRecConf import JetRecTool
-            JetRecTool_AntiKt4EMTopo = JetRecTool("AODFix_AntiKt4EMTopoJets", InputContainer="AntiKt4EMTopoJets", OutputContainer="AntiKt4EMTopoJets", JetModifiers = [ToolSvc.AODFix_jetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt4EMTopo    
-            JetRecTool_AntiKt4LCTopo = JetRecTool("AODFix_AntiKt4LCTopoJets", InputContainer="AntiKt4LCTopoJets", OutputContainer="AntiKt4LCTopoJets", JetModifiers = [ToolSvc.AODFix_jetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt4LCTopo    
-            JetRecTool_AntiKt10LCTopo = JetRecTool("AODFix_AntiKt10LCTopoJets", InputContainer="AntiKt10LCTopoJets", OutputContainer="AntiKt10LCTopoJets", JetModifiers = [ToolSvc.AODFix_fatjetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt10LCTopo    
-            JetRecTool_AntiKt2PV0Track = JetRecTool("AODFix_AntiKt2PV0TrackJets", InputContainer="AntiKt2PV0TrackJets", OutputContainer="AntiKt2PV0TrackJets", JetModifiers = [ToolSvc.AODFix_trackjetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt2PV0Track    
-            JetRecTool_AntiKt3PV0Track = JetRecTool("AODFix_AntiKt3PV0TrackJets", InputContainer="AntiKt3PV0TrackJets", OutputContainer="AntiKt3PV0TrackJets", JetModifiers = [ToolSvc.AODFix_trackjetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt3PV0Track    
-            JetRecTool_AntiKt4PV0Track = JetRecTool("AODFix_AntiKt4PV0TrackJets", InputContainer="AntiKt4PV0TrackJets", OutputContainer="AntiKt4PV0TrackJets", JetModifiers = [ToolSvc.AODFix_trackjetdrlabeler])
-            ToolSvc += JetRecTool_AntiKt4PV0Track   
-
-            from JetRec.JetRecConf import JetAlgorithm
-            topSequence += JetAlgorithm("jetalgAODFix", Tools = [ToolSvc.AODFix_CopyTruthTagCHadronsFinal,ToolSvc.AODFix_CopyTruthTagBHadronsFinal, ToolSvc.AODFix_CopyTruthTagTausFinal, ToolSvc.AODFix_AntiKt2PV0TrackJets, ToolSvc.AODFix_AntiKt3PV0TrackJets, ToolSvc.AODFix_AntiKt4PV0TrackJets, ToolSvc.AODFix_AntiKt4EMTopoJets, ToolSvc.AODFix_AntiKt4LCTopoJets, ToolSvc.AODFix_AntiKt10LCTopoJets])
-
-    def btagging_postSystemRec(self, topSequence):
-        """
-        This fixes the uptodate BTagging calibration conditions tag.
-        """
-
-        from AthenaCommon.AppMgr import ToolSvc
-
-        JetCollectionList = [ 'AntiKt4EMTopoJets','AntiKt4LCTopoJets',
-                              'AntiKt2TrackJets','AntiKt3TrackJets',
-                              'AntiKt4TrackJets']
-
-        SA = 'AODFix_'
-        from BTagging.BTaggingConfiguration import getConfiguration
-        BTagConf = getConfiguration("AODFix")
-        BTagConf.PrefixxAODBaseName(False)
-        BTagConf.PrefixVertexFinderxAODBaseName(False)
-
-        BTagConf.doNotCheckForTaggerObstacles()
-        from BTagging.BTaggingConf import Analysis__StandAloneJetBTaggerAlg as StandAloneJetBTaggerAlg
-
-        btag = "BTagging_"
-        AuthorSubString = [ btag+name[:-4] for name in JetCollectionList]
-        for i, jet in enumerate(JetCollectionList):
-            try:
-                btagger = BTagConf.setupJetBTaggerTool(ToolSvc, JetCollection=jet[:-4], 
-                                                       AddToToolSvc=True, SetupScheme="Retag", 
-                                                       TaggerList = ['IP3D','MV2c00','MV2c10',
-                                                                     'MV2c20','MV2c100','MV2m',
-                                                                     'MV2c10hp','MV2cl100',
-                                                                     'MVb','JetVertexCharge'])
-                jet = jet.replace("Track", "PV0Track")
-                SAbtagger = StandAloneJetBTaggerAlg(name=SA + AuthorSubString[i].lower(),
-                                          JetBTaggerTool=btagger,
-                                          JetCollectionName = jet,
-                                          )
-
-                topSequence += SAbtagger
-            except AttributeError as error:
-                print '#BTAG# --> ' + str(error)
-                print '#BTAG# --> ' + jet
-                print '#BTAG# --> ' + AuthorSubString[i]
diff --git a/Reconstruction/AODFix/python/AODFix_r210.py b/Reconstruction/AODFix/python/AODFix_r210.py
new file mode 100644
index 0000000000000000000000000000000000000000..2eddfc6b05b3069a0f46c9b11f986d36a7719567
--- /dev/null
+++ b/Reconstruction/AODFix/python/AODFix_r210.py
@@ -0,0 +1,129 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+
+from AthenaCommon.Logging import logging
+
+logAODFix_r210 = logging.getLogger( 'AODFix_r210' )
+
+from AODFix_base import AODFix_base
+
+class AODFix_r210(AODFix_base):
+    ''' This class just performs AODFix on 21.0.X releases
+
+    Instance variables
+      addMetadata (bool) (inherited): whether to add metaData
+      doAODFix (bool) (inherited): whether to do AODFix
+      prevAODFix (string): previous AODFix applied
+      newAODFix (string): new AODFix to apply
+      isMC (bool): is the input data MC?
+    '''
+
+    @staticmethod
+    def latestAODFixVersion():
+        """The latest version of the AODFix. Moving to new AODFix version scheme"""
+
+        metadataList = [item.split("_")[0] for item in sorted(AODFix_r210.__dict__.keys()) 
+                        if ("_" in item and "__" not in item)]
+
+        return metadataList
+
+
+    def postSystemRec(self):
+        """
+        This function calls the other postSystemRecs base on metadata"
+        """
+
+        if self.doAODFix:
+
+            logAODFix_r210.debug("Executing AODFix_r210_postSystemRec")
+
+            from AthenaCommon.AlgSequence import AlgSequence
+            topSequence = AlgSequence()
+            
+            oldMetadataList = self.prevAODFix.split("-")
+            if "trklinks" not in oldMetadataList:
+                self.trklinks_postSystemRec(topSequence)
+                pass
+
+            if "egammaStrips" not in oldMetadataList:
+                self.egammaStrips_postSystemRec(topSequence)
+                pass
+
+            if "btagging" not in oldMetadataList:
+                self.btagging_postSystemRec(topSequence)
+                pass
+
+            # Reset all of the ElementLinks. To be safe.
+            from AthenaCommon import CfgMgr
+            topSequence += \
+                CfgMgr.xAODMaker__ElementLinkResetAlg( "AODFix_ElementLinkReset" )
+            pass
+
+        return
+
+
+    # Below are the individual AODfixes, split up and documented
+    # Name must follow format: <fixID>_<whereCalled>
+
+ 
+    def trklinks_postSystemRec(self, topSequence):
+        """This fixes the links to tracks in muons and btagging
+        JIRA: https://its.cern.ch/jira/browse/ATLASRECTS-3988
+        """
+        from AthenaCommon import CfgMgr
+        topSequence += \
+            CfgMgr.xAODMaker__DynVarFixerAlg( "AODFix_DynAuxVariables", Containers = ["CombinedMuonTrackParticlesAux.","BTagging_AntiKt4EMTopoAux.","MuonsAux."] )
+
+    def btagging_postSystemRec(self, topSequence):
+        """
+        This fixes the uptodate BTagging calibration conditions tag.
+        """
+
+        from AthenaCommon.AppMgr import ToolSvc
+
+        JetCollectionList = [ 'AntiKt4EMTopoJets',]
+
+        SA = 'AODFix_'
+        from BTagging.BTaggingConfiguration import getConfiguration
+        BTagConf = getConfiguration("AODFix")
+        BTagConf.PrefixxAODBaseName(False)
+        BTagConf.PrefixVertexFinderxAODBaseName(False)
+
+        BTagConf.doNotCheckForTaggerObstacles()
+        from BTagging.BTaggingConf import Analysis__StandAloneJetBTaggerAlg as StandAloneJetBTaggerAlg
+
+        btag = "BTagging_"
+        AuthorSubString = [ btag+name[:-4] for name in JetCollectionList]
+        for i, jet in enumerate(JetCollectionList):
+            try:
+                btagger = BTagConf.setupJetBTaggerTool(ToolSvc, JetCollection=jet[:-4],
+                                                       AddToToolSvc=True, SetupScheme="Retag",
+                                                       TaggerList = ['IP2D', 'IP3D', 'MultiSVbb1',  'MultiSVbb2', 'SV1', 'JetFitterNN', 'SoftMu', 'MV2c10', 'MV2c10mu', 'MV2c10rnn', 'JetVertexCharge', 'MV2c100', 'MV2cl100' , 'DL1', 'DL1rnn', 'DL1mu', 'RNNIP'])
+                SAbtagger = StandAloneJetBTaggerAlg(name=SA + AuthorSubString[i].lower(),
+                                          JetBTaggerTool=btagger,
+                                          JetCollectionName = jet,
+                                          )
+
+                topSequence += SAbtagger
+            except AttributeError as error:
+                print '#BTAG# --> ' + str(error)
+                print '#BTAG# --> ' + jet
+                print '#BTAG# --> ' + AuthorSubString[i]
+
+
+    def egammaStrips_postSystemRec(self, topSequence):
+        """This fixes the strips shower shapes for electrons and photons
+        JIRA: https://its.cern.ch/jira/browse/ATLASRECTS-4121
+        """
+        from egammaRec.egammaRecConf import egammaAODFixAlg
+        topSequence+=egammaAODFixAlg()
+
+    def IDTide_postSystemRec(self, topSequence):
+        """
+        A dummy fix to just add metadata--not called
+        Please update postSystemRec to call if you want to run it.
+        """
+        pass
+        
+
+                
diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h
index d0c0405384ecaf3c041c301dc62c685c0bd43e99..72f5fea655da513f9c840f0b1948f02346c05823 100755
--- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h
+++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h
@@ -18,6 +18,7 @@
 #include <xAODEgamma/PhotonContainer.h>
 
 #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
+#include "ElectronPhotonSelectorTools/egammaPIDdefs.h"
 
 class TH1;
 class TGraph;
diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
index 3d7244ada35bef500ea6ccd25ba43350b075b872..f244487f5c953429698b58f06c7ac97d597797f3 100644
--- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
+++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
@@ -118,6 +118,8 @@ private:  // methods
                         const std::vector<const xAOD::TrackParticle*>&, 
                         const jet::TrackVertexAssociation*) const;
 
+protected:
+  bool m_isTrigger;  
 };
 
 
diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
index dedfa314ae8fda684c8aa478aaad55df34b4aa35..deaf0209b5835dcd876255475e9b219d0ff805c4 100644
--- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
+++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx
@@ -23,6 +23,7 @@ JetVertexFractionTool::JetVertexFractionTool(const std::string& name)
   declareProperty("JVFName", m_jvfname ="JVF");
   declareProperty("K_JVFCorrScale",m_kcorrJVF = 0.01);
   declareProperty("PUTrkPtCut",m_PUtrkptcut = 30000.);
+  declareProperty("IsTrigger",m_isTrigger =false);
 }
 
 //**********************************************************************
@@ -143,8 +144,9 @@ int JetVertexFractionTool::modify(xAOD::JetContainer& jetCont) const {
     jet->setAttribute(m_jvfname, jvf);
   
     // Get and set the highest JVF vertex
-    jet->setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf));
-
+    if(!m_isTrigger) {
+      jet->setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf));
+    }
     // Calculate RpT and JVFCorr 
     // Default JVFcorr to -1 when no tracks are associated.
     float jvfcorr = -999.;
diff --git a/Reconstruction/Jet/JetRecTools/Root/VoronoiWeightTool.cxx b/Reconstruction/Jet/JetRecTools/Root/VoronoiWeightTool.cxx
index eb4b505366c1b86f4a5948e04e173091188109d1..6cf2381b1ef95115be6e766f01ac696c06655412 100644
--- a/Reconstruction/Jet/JetRecTools/Root/VoronoiWeightTool.cxx
+++ b/Reconstruction/Jet/JetRecTools/Root/VoronoiWeightTool.cxx
@@ -96,7 +96,7 @@ StatusCode VoronoiWeightTool::process(xAOD::CaloClusterContainer* in_clusters) c
     if(!m_doLC) ATH_MSG_ERROR(APP_NAME << ": Unclear how we're going to implement EM scaling as an input to JetConstituentModiferBase tools.");
     fastjet::PseudoJet test;
     test = fastjet::PseudoJet(clust->p4());
-    if(clust->e() >= 0){
+    if(clust->e() >= 0){ //definition of clusters (\label{clust_def})
 	clusters.push_back(test);
 	if(m_debug) std::cout << clust->pt() << std::endl;
     }
@@ -117,7 +117,7 @@ StatusCode VoronoiWeightTool::process(xAOD::CaloClusterContainer* in_clusters) c
   for(auto clust : SortHelper::sort_container_pt(in_clusters)){
     float newE;
    //There should be the same number of positive E Clusters in the container as clusters in the ptvec
-    bool endContainer = clust->e()<=0;
+    bool endContainer = clust->e()<0; //consistent with definition of clusters on L.~\ref{clust_def}
     bool endVec = i>=ptvec.size();
     if(endVec && endContainer){
       newE = 0;  //remove negative energy clusters
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
index 71c6883bac6637c71b28be68e19cd8ab39725fcb..b637e81f580f242c1efaedc8cc0af17801d30a30 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
@@ -851,8 +851,8 @@ namespace MuonCombined {
         }
         else ATH_MSG_WARNING("Creating of MuGirl segment Link failed");         
       }
+      const_cast<MuGirlTag&>(*tag).releaseSegments();
     }  
-    const_cast<MuGirlTag&>(*tag).releaseSegments();
     
     ATH_MSG_DEBUG("Done Adding MuGirl Muon  " << tag->author() << " type " << tag->type());    
   }
@@ -1007,6 +1007,9 @@ namespace MuonCombined {
         ATH_MSG_DEBUG("Track doesn't have extrapolated track. Skipping");
       if (extrapolatedTrack && !extrapolatedTrack->perigeeParameters()) 
         ATH_MSG_DEBUG("Track doesn't have perigee parameters on extrapolated track. Skipping");
+      if( updatedExtrapolatedTrack ) {
+	delete updatedExtrapolatedTrack;
+      }
       //ATH_MSG_DEBUG("Set values to -999.0.");
       //muon.setParameter( (float)-999.0, xAOD::Muon::d0_sa);
       //muon.setParameter( (float)-999.0, xAOD::Muon::z0_sa);
@@ -1114,6 +1117,9 @@ namespace MuonCombined {
 	else{
 	  ATH_MSG_WARNING("failed to create ME track particle for SA muon");
 	}
+	if( updatedExtrapolatedTrack ) {
+	  delete updatedExtrapolatedTrack;
+	}
       }
     }
   }
diff --git a/Reconstruction/RecEventAthenaPool/CMakeLists.txt b/Reconstruction/RecEventAthenaPool/CMakeLists.txt
index 5bb09afd1840259179b9e3f0de4a15f32c899302..106c3e476d465da1577afad8ec6febb12bc3d0b3 100644
--- a/Reconstruction/RecEventAthenaPool/CMakeLists.txt
+++ b/Reconstruction/RecEventAthenaPool/CMakeLists.txt
@@ -17,4 +17,4 @@ atlas_depends_on_subdirs(
 atlas_add_poolcnv_library( RecEventAthenaPoolPoolCnv
    src/*.h src/*.cxx
    FILES RecEvent/RecoTimingObj.h
-   LINK_LIBRARIES AthenaPoolCnvSvcLib GaudiKernel RecEvent RecEventTPCnv )
+   LINK_LIBRARIES AthenaPoolCnvSvcLib GaudiKernel RecEvent RecEventTPCnv )
\ No newline at end of file
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index c1726fd5a5ed6ca6b7591b3c458e06392248c97e..3844a5ee537c924520f1f98c0a9e117be1cce142 100755
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -129,6 +129,9 @@ from AODFix.AODFix import *
 AODFix_Init()
 AODFix_preInclude()
 
+from RecoFix.RecoFix import *
+RecoFix_Init()
+
 
 ###################
 # Common Services #
@@ -184,6 +187,7 @@ else:
 
 
 AODFix_addMetaData()
+RecoFix_addMetaData()
 
 if rec.oldFlagCompatibility:
     print "RecExCommon_flags.py flags values:"
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
index 0c8619ddf8fe8817d97fe6d64b894d5e679e19d1..15dd0f58e332f2fc19511bc9da3012476d1dee30 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_User_Offline_isOnlineTrue.py
@@ -124,10 +124,10 @@ doMuonMon = doAllMon
 from AthenaCommon.BeamFlags import jobproperties
 jobproperties.Beam.beamType.set_Value_and_Lock(beamType)
 
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
-globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
-globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
+#from AthenaCommon.GlobalFlags import globalflags
+#globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2")
+#globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag)
+#globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion)
 
 
 from AthenaCommon.BFieldFlags import jobproperties
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
index d7a0423a0b0b88f6ecbe041193d8bb861a560121..5a6186194e5183f8a8e3aef3f9cb8d491a56dfb5 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig.py
@@ -50,6 +50,10 @@ if (not 'doPixelOnlyMon' in dir()):
 if (not 'REO_doAutoConfiguration' in dir()):
     REO_doAutoConfiguration = False
 
+### harmonize conditions tag and geometry for all monitoring jobs; 26 May 2017
+DetDescrVersion = 'ATLAS-R2-2016-01-00-01' # for new ID alignment 26 May 2017
+if isOnline:
+    ConditionsTag = 'CONDBR2-HLTP-2017-03' # for new ID alignment 26 May 2017
 
 ## -------------------------------------------------------------------
 ## configuration from pickle file
@@ -205,6 +209,10 @@ THistSvc.OutputLevel = ERROR
 from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.doPixelClusterSplitting.set_Value(False) # does not work online
 
+## new ID alignment 26 May 2017
+from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
+GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
+
 # ----------------------------------------------- Online flag
 athenaCommonFlags.EvtMax.set_Value_and_Lock(evtMax)
 athenaCommonFlags.isOnlineStateless = isOnlineStateless
diff --git a/Reconstruction/RecoFix/CMakeLists.txt b/Reconstruction/RecoFix/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d5eee085547dbcf3d8d047b37b46bb15b61726ab
--- /dev/null
+++ b/Reconstruction/RecoFix/CMakeLists.txt
@@ -0,0 +1,10 @@
+################################################################################
+# Package: RecoFix
+################################################################################
+
+# Declare the package name:
+atlas_subdir( RecoFix )
+
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+
diff --git a/Reconstruction/RecoFix/doc/mainpage.h b/Reconstruction/RecoFix/doc/mainpage.h
new file mode 100644
index 0000000000000000000000000000000000000000..59afe184c99fcbfc82828496751b8ae62d801f92
--- /dev/null
+++ b/Reconstruction/RecoFix/doc/mainpage.h
@@ -0,0 +1,65 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+@mainpage
+
+@section RecoFixIntro Introduction
+
+AODFix is a way to break frozen tier-0 in a controlled way. It does it
+in two ways: 
+
+ - When reading "unfixed" AODs or AODs with a fix that is
+not current, it schedules certain algorithms to "fix" the AOD. If the
+fixed AODs are written out, in-file metadata is updated indicating
+which AODFix has been applied.
+
+ - When running full reconstruction, the standard assumption is that
+ the new AODs are fixed to the latest version of AODFix. Therefore,
+ the in-file metadata is updated saying that the latest fix is
+ applied. (See AODFix_r172.py in earlier tags, e.g., AODFix-00-03-01,
+ for an example when full reconstruction brings the file to a
+ different AODFix version.)
+
+By default, AODFix schedules itself when reading AODs (not ESDs or
+DAODs), only in actual releases (not nightlies), and if the AOD was
+produced in a matching actual release (i.e., if the first two numbers,
+like 20.1, match). When running full reconstruction, the metadata is
+only updated when running in an actual release. This behavior can be
+modified by locking rec.doApplyAODFix to True or False. (Note, it has
+to be locked.) Locking it to False always prevents AODFix from
+scheduling fixes or adding metadata. Provided the first two digits of
+the release being run in can be deciphered (which is true in
+20.1.X.Y-VAL style nightlies) locking rec.doApplyAODFix to true
+schedules the fixes associtated with that release when reading AODs
+and adds the metadata when writing AODs, either fixed or due to full
+reconstruction.
+
+Now the AOD to AOD part has been separated from the RAW to ESD part.
+This package is the RAW to ESD part.
+
+@section RecoFixOverview Module and Class Overview
+  The RecoFix package contains of following modules:
+
+  - python.RecoFix : The module that contains the interface to RecoFix. No other module should be imported externally. 
+  - python.AODFix_base.AODFix_base : The AODFix base class
+  - python.AODFix_r191.AODFix_r191 : The class implementing the release 19.1 AODFix
+  - python.AODFix_r201.AODFix_r201 : The class implementing the release 20.1 AODFix
+
+
+@author Rolf Seuster
+@author Jovan Mitrevski
+
+@section ExtrasAODFix Extra Pages
+ - @ref UsedAODFix
+ - @ref RequirementsAODFix
+*/
+/**
+@page UsedAODFix Used Packages
+@htmlinclude used_packages.html
+*/
+/**
+@page RequirementsAODFix Requirements
+@include requirements
+*/
diff --git a/Reconstruction/RecoFix/python/RecoFix.py b/Reconstruction/RecoFix/python/RecoFix.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3f3fd6f0195fae4052323523b2fa3356bf960e6
--- /dev/null
+++ b/Reconstruction/RecoFix/python/RecoFix.py
@@ -0,0 +1,113 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+"""@package RecoFix 
+
+This package is the only one meant to be used externally (mainly by
+RecExCommon). Only the RecoFix_* functions should be called.
+
+When adding a new RecoFix for a release family (where a release family
+is defined by the first two numbers in a release, e.g., 20.1) that
+does not yet have RecoFix, the user needs to create a new
+RecoFix_rXXY.py file with an RecoFix_rXXY class inheriting from the
+RecoFix_base class and overwrite the appropriate member
+functions. Furthermore, the RecoFix_Init() function below needs to set
+_aodFixInstance approprately, as explained in the comments below.
+
+When modifying the RecoFix for a release family for which
+RecoFix_rXXY.py exists, most likely the changes would be restricted to
+the RecoFix_rXXY.py class. The only exception is if the release family
+definition changes (e.g., add 17.3 to the 17.2 family).
+
+"""
+
+from AthenaCommon.Logging import logging
+
+logRecoFix = logging.getLogger( 'RecoFix' )
+
+from RecoFix_base import RecoFix_base
+from RecoFix_r210 import RecoFix_r210
+
+_recoFixInstance = RecoFix_base(False)
+
+def run_once(f):
+    def wrapper(*args, **kwargs):
+        if not wrapper.has_run:
+            wrapper.has_run = True
+            return f(*args, **kwargs)
+    wrapper.has_run = False
+    return wrapper
+
+@run_once
+def RecoFix_Init():
+    ''' This function is called to correctly setup RecoFix.'''
+
+    global _recoFixInstance
+
+    from RecExConfig.RecFlags import rec
+
+
+    ##################
+    # deterimine in what release we are running (and fill some rec variables
+    ##################
+
+    import os
+    curRelease=os.getenv("AtlasVersion") or ''
+
+    logRecoFix.debug("curRelease set to " + curRelease)
+    
+    
+    ##################
+    # determine athena with which input file was created and previous RecoFix
+    ##################
+   
+    # RDO doesn't have MetaData
+    prevAODFix = ''
+    if not rec.readRDO():
+
+        ##################
+        # determine which is the previous verion of the AODFix
+        ##################
+        # is it better to do this or to look at GlobalFlags?
+        from RecExConfig.InputFilePeeker import inputFileSummary
+        try:
+            prevAODFix=inputFileSummary['tag_info']['AODFixVersion']
+            if prevAODFix.startswith("AODFix_"):
+                prevAODFix=prevAODFix[7:]
+                prevAODFix=prevAODFix.split("_")[0]
+        except Exception:
+            logRecoFix.debug("no AODFixVersion found in input file, setting to <none>.")
+            prevAODFix=''
+
+    logRecoFix.info("Summary of MetaData for RecoFix:")
+    logRecoFix.info(" AODFix version <%s> was previously applied." % prevAODFix)
+
+    ##################
+    # determine which RecoFix to run (if actually running--to be determined later)
+    ##################
+
+    doRecoFix = False
+    if rec.doESD():
+        # running from RAW or ESD, set recofix metadata
+        logRecoFix.debug("detected doESD=True, applying RecoFix metadata")
+        doRecoFix = True
+
+    #exit if not doing RecoFix
+    if not doRecoFix:
+        return  
+
+    curReleaseSplit = curRelease.split('.')
+    if len(curReleaseSplit) >= 2:
+        ### If adding an RecoFix for a release family that does not have it,
+        ### please add it to the if-elif... statement below
+        if (curReleaseSplit[0] == '21' and (curReleaseSplit[1] == '0' or curReleaseSplit[1] == '2')):
+            _recoFixInstance = RecoFix_r210()
+        else:
+            logRecoFix.info("No RecoFix scheduled for this release.")
+
+    else:
+        logRecoFix.info("Current release is of strange form: %s" % curRelease)
+
+# The interface routines
+def RecoFix_addMetaData():
+    '''This adds metadata both when AODFix is run or when "fixed" reco is performed'''
+    _recoFixInstance.addMetaData()
diff --git a/Reconstruction/RecoFix/python/RecoFix_base.py b/Reconstruction/RecoFix/python/RecoFix_base.py
new file mode 100644
index 0000000000000000000000000000000000000000..2ab4dc31e3d95ad948f283c1f833d6fae7dd9841
--- /dev/null
+++ b/Reconstruction/RecoFix/python/RecoFix_base.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Logging import logging
+
+logRecoFix = logging.getLogger( 'RecoFix_base' )
+
+#The RecoFix base class
+class RecoFix_base(object):
+    ''' This is the RecoFix base class, which does nothing
+    by default. Specific RecoFix types should inherit from it.
+
+    Derived classes should override do-nothing member functions,
+    like preInclude, to implement the actual RecoFix.
+
+    Instance variables
+      addMetadata (bool): whether to add metaData
+      doAODFix (bool): whether to do AODFix
+      prevAODFix (string): previous AODFix applied
+      newAODFix (string): new AODFix to apply
+      isMC (bool): is the input MC?
+    '''
+
+    @staticmethod
+    def latestAODFixVersion():
+        """ Must override this member function in derived classes
+        """
+        return []
+
+    def __init__(self, addMetadata = True):
+        """ The default constructor.
+        """
+        self.addMetadata = addMetadata
+        return
+
+    def addMetaData(self):
+        '''standard function to apply metadata, can overload if necessary for complicated scenarios.'''
+        if self.addMetadata:
+            logRecoFix.debug("in addMetaData")
+
+            from RecExConfig.RecFlags import rec
+
+            suffix="_RAW"
+            if rec.readESD():
+                suffix="_ESD"
+            elif rec.readAOD():
+                suffix="_AOD"
+
+            str = "AODFix_" + "-".join(self.latestAODFixVersion()) + suffix
+
+            logRecoFix.info("executing addMetaData, will add as AODFixVersion %s" % str)
+            from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+            svcMgr.TagInfoMgr.ExtraTagValuePairs += ["AODFixVersion", str]
+
diff --git a/Reconstruction/RecoFix/python/RecoFix_r210.py b/Reconstruction/RecoFix/python/RecoFix_r210.py
new file mode 100644
index 0000000000000000000000000000000000000000..a24ddea798fbba41849e64fe2ead498a31e6a6ca
--- /dev/null
+++ b/Reconstruction/RecoFix/python/RecoFix_r210.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+
+from AthenaCommon.Logging import logging
+
+logRecoFix_r210 = logging.getLogger( 'RecoFix_r210' )
+
+from RecoFix_base import RecoFix_base
+
+class RecoFix_r210(RecoFix_base):
+    ''' This class just performs RecoFix on 21.0.X releases
+    '''
+
+    @staticmethod
+    def latestAODFixVersion():
+        """The latest version of the AODFix. Use same sort order as in AODFix"""
+        return ["IDTide", "egammaStrips", "trklinks"]
+
diff --git a/Reconstruction/RecoFix/python/__init__.py b/Reconstruction/RecoFix/python/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..74583d364ec2ca794156596c7254d9b234a940c6
--- /dev/null
+++ b/Reconstruction/RecoFix/python/__init__.py
@@ -0,0 +1,2 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
diff --git a/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.cxx b/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.cxx
index 174d8d8e0c431db4301415999ef762338e21ddcd..e657372f0de9465f5f035b4288dcdd79edee7856 100755
--- a/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.cxx
+++ b/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.cxx
@@ -83,11 +83,12 @@ egammaStripsShape::egammaStripsShape(const std::string& type,
   //
   // calculate quantities base on information in the strips in a region
   // around the cluster. 
+  //
   // Use 2 strips in phi and cover a region of +-1.1875
-  // times 0.025 in eta (corresponds to 19 strips in em barrel)
+  // 5 cells in eta based on second sampling granularity ~0.025 in eta.
+  //Corresponds to ~19 strips in em barrel)
   //  
-  //calculate quantities based on information in a region around the cluster. 
-  declareProperty("Neta",m_neta=2.5,
+  declareProperty("Neta",m_neta=5,
 		  "Number of eta cell in each sampling in which to calculated shower shapes");
 
   declareProperty("Nphi",m_nphi=2.,
@@ -101,6 +102,10 @@ egammaStripsShape::egammaStripsShape(const std::string& type,
   declareProperty("ExecOtherVariables",m_ExecOtherVariables=true,
 		  "Calculate some less important variables");  
 
+  // Use cluster  cells or all cells 
+  declareProperty("UseCellsFromCluster" ,m_UseCellsFromCluster=true,
+		"Use Cells from the cluster");  
+
   InitVariables();
   // initialize the arrays  
   std::fill (m_enecell,     m_enecell+STRIP_ARRAY_SIZE,     0);
@@ -156,19 +161,15 @@ StatusCode egammaStripsShape::execute(const xAOD::CaloCluster *cluster,
 {
   //
   // Estimate shower shapes from first compartment
-  // based on hottest cell and deta,dphi
-  // with eta = m_cluster->eta(sam)
-  //      phi = m_cluster->phi(sam)
-  // and search for hottest cell based on granularity in the second sampling 
+  // based on hottest cell in 2nd sampling , the  deta,dphi,
+  // And the barycenter in the 1st sampling (seed) 
   //
   ATH_MSG_DEBUG(" egammaStripsShape: execute");
-
   // check if cluster is available
   if(!cluster) { 
     ATH_MSG_DEBUG(" egammaStripsShape: Invalid pointer to cluster");
     return StatusCode::SUCCESS;
   }
-
   // check if cell container is available
   if(!cell_container) { 
     ATH_MSG_DEBUG(" egammaStripsShape: Invalid pointer to cell_container");
@@ -210,7 +211,7 @@ StatusCode egammaStripsShape::execute(const xAOD::CaloCluster *cluster,
 
   // From the original (eta,phi) position, find the location
   // (sampling, barrel/end-cap, granularity)
-  if (!FindPosition()) return StatusCode::SUCCESS;
+  if (!FindPosition()) {return StatusCode::SUCCESS;}
   
   // Fill the array in energy and eta from which all relevant
   // quantities are estimated
@@ -326,8 +327,8 @@ bool egammaStripsShape::FindPosition()
   // check if cluster is in barrel or end-cap
   // sam is used in SetArray to check that cells belong to strips
   // samgran is used to estimated window to use cells in eta
-  // it is based on granularity of middle
-  // NB: for phi we use the strip granularity !!!!! 
+  // it is based on granularity of middle layer
+  // For phi we use the strip layer granularity  
   bool in_barrel =  m_egammaEnergyPositionAllSamples->inBarrel();
   // define accordingly position of xAOD::CaloCluster
   if (in_barrel) {
@@ -367,7 +368,7 @@ bool egammaStripsShape::FindPosition()
   // if no object then exit
   if (!dde) return false;
   // width in eta is granularity (dde->deta()) times number of cells (m_neta)
-  m_deta = dde->deta()*m_neta;
+  m_deta = dde->deta()*m_neta/2.0;
 
   // use samgran = granularity in first sampling for phi !!!!
   m_calo_dd->decode_sample(m_subcalo, m_barrel, m_sampling_or_module, 
@@ -377,36 +378,9 @@ bool egammaStripsShape::FindPosition()
   // if no object then exit
   if (!dde) return false;
   // width in phi is granularity (dde->dphi()) times number of cells (m_nphi)
-  m_dphi = dde->dphi()*m_nphi/2.;
-
-  // Calculate the size of the arrays
-  // granularity as for 1st sampling
-  CaloCell_ID::CaloSample samgran1;
-  if (in_barrel) {
-    samgran1 = CaloCell_ID::EMB1; 
-  } else {
-    samgran1 = CaloCell_ID::EME1; 
-  }
-  m_calo_dd->decode_sample(m_subcalo, m_barrel, m_sampling_or_module, samgran1);
-  dde = m_calo_dd->get_element(m_subcalo, m_sampling_or_module, m_barrel, m_etamax, m_phimax);
-  double deta1 = dde->deta();
+  m_dphi = dde->dphi()*m_nphi/2.0;
 
-  // granularity as for 2nd sampling
-  if (in_barrel) {
-    samgran1 = CaloCell_ID::EMB2; 
-  } else {
-    samgran1 = CaloCell_ID::EME2; 
-  }
-  m_calo_dd->decode_sample(m_subcalo, m_barrel, m_sampling_or_module, samgran1);
-  dde = m_calo_dd->get_element(m_subcalo, m_sampling_or_module, m_barrel, m_etamax, m_phimax);
-  double deta2 = dde->deta();
-
-  m_sizearrayeta = (int)(2.*m_neta*deta2/deta1);
-  m_sizearrayeta = std::min((int)STRIP_ARRAY_SIZE,m_sizearrayeta);
-
-  // NB: actually we overwrite this logic as we use a constant size array now
   m_sizearrayeta = (int)STRIP_ARRAY_SIZE;
-  //std::cout << " sizearrayeeta = " << m_sizearrayeta << std::endl;
 
   return true;
 }
@@ -426,66 +400,105 @@ void egammaStripsShape::setArray(CaloSampling::CaloSample sam,
   //
 
   // two ways can be used to create the array
-  // 1- from the list of cells attached to the cluster
-  //    NB: one has to remember that a strip is added in cluster
-  //        if phi(strip)-phi(layer2)<dphi/2.
-  //        It can happen that in some areas were granularity is different
-  //        that only one value of this is selected,
-  //        and thus no merging is possible in phi
-
+  // 1- From the list of cells attached to the cluster
+  // 2 -Use a calo Cell List
   // temporary array of cell 
-  StripArrayHelper stripArray[DOUBLE_STRIP_ARRAY_SIZE];
+  StripArrayHelper stripArray[BIG_STRIP_ARRAY_SIZE];
 
-  // Convert eta, phi to raw.
-  // "raw" stands for Ideal/pointing positions (name is historical) 
-  // the other variables, not labeled as raw, are real and sensitive
-  // to (mis)alignment
-  // in particular it is important in end-cap which is shifted by about 4 cm
+  //Raw --> Calo Frame 
+  //Other variables ATLAS Frame
+  //Difference  is important in end-cap which is shifted by about 4 cm
+  //
   double etaraw = eta;
   double phiraw = phi;
   // look for the corresponding DetDescrElement
   const CaloDetDescrElement* dde =
     m_calo_dd->get_element (sam == CaloSampling::EMB1 ? CaloCell_ID::EMB1 :
-			    CaloCell_ID::EME1,
-                            eta, phi);
+			    CaloCell_ID::EME1, eta, phi);
   // if dde is found 
   if (dde) {
-    etaraw += dde->eta_raw() - dde->eta();
-    phiraw += dde->phi_raw() - dde->phi();
-  } else {
-    // FIX-ME : what to do if dde=0 ! jusr keep (eta,phi) ?
+    etaraw = dde->eta_raw();
+    phiraw = dde->phi_raw();
+  }
+  else{
+    return;
   }
-  // defines the boundaries around which to select cells
+
+  //The selection will be done in Raw co-ordinates
+  //defines the boundaries around which to select cells
   double etamin = etaraw - deta;
   double etamax = etaraw + deta;
   double phimin = phiraw - dphi;
-  double phimax = phiraw + dphi;
-
-  
+  double phimax = phiraw + dphi;  
   // index of elements of the array
   int index_array = 0;
   double eta_cell  = 0.;
   double phi_cell0 = 0.;
   double phi_cell  = 0.;
   
-
-  // Now loop over all cells in the cluster  
-  xAOD::CaloCluster::const_cell_iterator first = m_cluster->cell_begin();
-  xAOD::CaloCluster::const_cell_iterator last  = m_cluster->cell_end();
-  for (; first != last; ++first) {        
-    // ensure we are in 1st sampling
-    if( (*first)->caloDDE()->getSampling() == sam ) {
-      // retrieve the eta,phi of the cell
-      eta_cell = (*first)->caloDDE()->eta_raw();
-      // adjust for possible 2*pi offset. 
-      phi_cell0 = (*first)->caloDDE()->phi_raw();
-      phi_cell  = proxim(phi_cell0,phiraw) ;
-      // check if we are within boundaries
+  if(m_UseCellsFromCluster){
+    // Now loop over all cells in the cluster  
+    xAOD::CaloCluster::const_cell_iterator first = m_cluster->cell_begin();
+    xAOD::CaloCluster::const_cell_iterator last  = m_cluster->cell_end();
+    for (; first != last; ++first) {        
+      // ensure we are in 1st sampling
+      const CaloCell* theCell = *first;
+      if (!theCell){
+	continue;
+      }
+      if( theCell->caloDDE()->getSampling() == sam ) {
+	// retrieve the eta,phi of the cell
+	eta_cell = theCell->caloDDE()->eta_raw();
+	// adjust for possible 2*pi offset. 
+	phi_cell0 = theCell->caloDDE()->phi_raw();
+	phi_cell  = proxim(phi_cell0,phiraw) ;
+	// check if we are within boundaries
 	if (eta_cell >= etamin && eta_cell <= etamax) {
 	  if (phi_cell >= phimin && phi_cell <= phimax) {	    
 	    // a protection is put to avoid to have an array larger 
 	    // than 2*STRIP_ARRAY_SIZE
-	    if (index_array<DOUBLE_STRIP_ARRAY_SIZE) {
+	    if (index_array<BIG_STRIP_ARRAY_SIZE) {
+	      // energy
+	      stripArray[index_array].energy = theCell->energy()*(first.weight()); 
+	      // eta 
+	      stripArray[index_array].eta  = theCell->eta();
+	      // eta raw
+	      stripArray[index_array].etaraw = theCell->caloDDE()->eta_raw();
+	      // eta granularity
+	      stripArray[index_array].deta  = theCell->caloDDE()->deta();
+	      // index/number of cells in the array
+	      stripArray[index_array].ncell++;
+	      // increase index 
+	      index_array++;
+	    }
+	  }	  
+	}
+      }
+    }
+  }
+  else {
+    CaloCellList *ccl = new CaloCellList(m_cellContainer);
+    //CaloCellList uses ATLAS co-ordinates
+    ccl->select(dde->eta(),dde->phi_raw(),deta,dphi,sam);
+    // defines the cells interators
+    CaloCellList::list_iterator first=ccl->begin();
+    CaloCellList::list_iterator last =ccl->end();
+    for (; first != last; ++first) {        
+      //Avoid EME1 being inner endcap
+      if(! ((*first)->caloDDE()->is_lar_em_endcap_inner()) )
+      // ensure we are in 1st sampling
+      if( (*first)->caloDDE()->getSampling() == sam ) {
+	// retrieve the eta,phi of the cell
+	eta_cell = (*first)->caloDDE()->eta_raw();
+	// adjust for possible 2*pi offset. 
+	phi_cell0 = (*first)->caloDDE()->phi_raw();
+	phi_cell  = proxim(phi_cell0,phiraw) ;
+	// check if we are within boundaries
+	if (eta_cell >= etamin && eta_cell <= etamax) {
+	  if (phi_cell >= phimin && phi_cell <= phimax) {	    
+	    // a protection is put to avoid to have an array larger 
+	    // than 2*STRIP_ARRAY_SIZE
+	    if (index_array<BIG_STRIP_ARRAY_SIZE) {
 	      // energy
 	      stripArray[index_array].energy = (*first)->energy(); 
 	      // eta 
@@ -501,16 +514,15 @@ void egammaStripsShape::setArray(CaloSampling::CaloSample sam,
 	    }
 	  }	  
 	}
+      }
     }
   }
-
   // Exit early if no cells.
-  if (index_array == 0)
+  if (index_array == 0){
     return;
-
+  }
   // sort intermediate array with eta
   std::sort(stripArray,stripArray+index_array);
-  
 
   // loop on intermediate array and merge two cells in phi (when they exist)
   int ieta = 0;
@@ -532,6 +544,8 @@ void egammaStripsShape::setArray(CaloSampling::CaloSample sam,
       //if (fabs(stripArray[i].eta-stripArry[i+1]).eta>0.00001) next = true;
       if (fabs(stripArray[i].etaraw-stripArray[i+1].etaraw)>0.00001) next = true;
       if (next) {
+	//Increment the final array only if do not want to merge
+	//otherwise continue as to merge
 	ieta++;
 	next = false;
       }
@@ -539,38 +553,25 @@ void egammaStripsShape::setArray(CaloSampling::CaloSample sam,
   }
   // special case for last element which was not treated yet
   int index = index_array-1;
-  //std::cout << " last index = " << index << " " << ieta << std::endl;
   // if previous element had a different eta then append the array
   // NB: this could happen if only one cell in phi was available
   if (index == 0 ||
-      fabs(stripArray[index].etaraw-stripArray[index-1].etaraw)>0.00001)
-  {
+      fabs(stripArray[index].etaraw-stripArray[index-1].etaraw)>0.00001){
     // energy
     if (enecell_arr) enecell_arr[ieta] = stripArray[index].energy;
   }
   if (index != 0 &&
-      fabs(stripArray[index].etaraw-stripArray[index-1].etaraw)<0.00001)
-  {
+      fabs(stripArray[index].etaraw-stripArray[index-1].etaraw)<0.00001){
     // energy
-    if (enecell_arr) enecell_arr[ieta] +=  stripArray[index].energy;
+    if (enecell_arr) {enecell_arr[ieta] += stripArray[index].energy;}
   }
   // eta 
-  if (etacell_arr) etacell_arr[ieta] = stripArray[index].eta;
+  if (etacell_arr) {etacell_arr[ieta] = stripArray[index].eta;}
   // eta granularity
-  if (gracell_arr) gracell_arr[ieta] = stripArray[index].deta;
+  if (gracell_arr) {gracell_arr[ieta] = stripArray[index].deta;}
   // index/number of cells in the array
-  if (ncell_arr) ++ncell_arr[ieta];
-  //ieta++;
+  if (ncell_arr) {++ncell_arr[ieta];}
   
-  /*std::cout << " ieta = " << ieta << std::endl;
-  for (int i=0;i<40;i++) {
-    std::cout << " newetacell = " << i
-	      << " " << etacell_arr[i]
-	      << " " << gracell_arr[i]
-	      << " " << enecell_arr[i]
-	      << " " << ncell_arr[i]
-	      << std::endl;
-	      }*/
   return;
 }
 
@@ -591,14 +592,7 @@ void egammaStripsShape::setIndexSeed(double eta)
     eta_min = m_etacell[ieta]-demi_eta;
     eta_max = m_etacell[ieta]+demi_eta;
     
-    /*std::cout << " eta = " << eta 
-	      << " " << m_etacell[ieta]
-	      << " " << demi_eta
-	      << " " << eta_min
-	      << " " << eta_max
-	      << std::endl;*/
-    // beware that list is arranged from larger values to smaller ones
-    //if (fabs(eta)>fabs(m_etacellseed[ieta]) && fabs(eta)<=fabs(m_etacellseed[ieta+1]))
+    // Beware that list is arranged from larger values to smaller ones
     if ((fabs(eta)>fabs(eta_min) && fabs(eta)<=fabs(eta_max)) ||
 	(fabs(eta)<=fabs(eta_min) && fabs(eta)>fabs(eta_max)))
       m_ncetaseed = ieta;
@@ -866,13 +860,18 @@ int egammaStripsShape::setEmax2()
     if (m_ncell[ieta] == 0) continue;
 
     int ieta_left = ieta - 1;
-    while (ieta_left >= 0 && m_ncell[ieta_left] == 0)
+    while (ieta_left >= 0 && m_ncell[ieta_left] == 0){
       --ieta_left;
-    if (ieta_left < 0) continue;
+    }
+    if (ieta_left < 0) {continue;}
+
     int ieta_right = ieta + 1;
-    while (ieta_right < m_sizearrayeta && m_ncell[ieta_right] ==0)
+    while (ieta_right < m_sizearrayeta && m_ncell[ieta_right] ==0){
       ++ieta_right;
-    if (ieta_right >= m_sizearrayeta) continue;
+    }
+    if (ieta_right >= m_sizearrayeta) {
+      continue;
+    }
 
     double e = m_enecell[ieta]/ m_gracell[ieta];
     double e_left  = m_enecell[ieta_left] / m_gracell[ieta_left];
@@ -894,7 +893,6 @@ int egammaStripsShape::setEmax2()
 	    m_esec    = ecand; 
 	    //ncetasec  = ieta; 
 	}
-
 	// test energy of 2nd hottest local maximum
 	if(e>escalesec1){
           escalesec1 = e;
@@ -997,24 +995,24 @@ void egammaStripsShape::setFside()
 {
   //
   // fraction of energy outside shower core 
-  //     (E(+/-3strips)-E(+/-1strips))/ E(+/-1strips)
+  // (E(+/-3strips)-E(+/-1strips))/ E(+/-1strips)
   // 
-  
   // NB: threshold defined by M. Seman for DC0 data (or before ?), never tuned since
   double Ehsthr = 0.06*GeV; 
-  // local variable with max energy in strips
+  // Local variable with max energy in strips
   double e1     = m_emaxs1; 
-
   // left index defined as max-1
   int ileft = m_ncetamax-1;
-  while (ileft > 0 && m_ncell[ileft] == 0)
+  while (ileft > 0 && m_ncell[ileft] == 0){
     --ileft;
+  }
   double eleft  = ileft >= 0 ? m_enecell[ileft] : 0;
 
   // right index defined as max+1
   int iright = m_ncetamax+1;
-  while (iright < m_sizearrayeta-1 && m_ncell[iright] == 0)
+  while (iright < m_sizearrayeta-1 && m_ncell[iright] == 0){
     ++iright;
+  }
   double eright = iright < m_sizearrayeta ? m_enecell[iright] : 0;
 
   double fracm=0.;
@@ -1024,7 +1022,6 @@ void egammaStripsShape::setFside()
   // define index of the array from max+3 strips strips (if possible)
   int nhi = std::min(m_ncetamax+3,m_sizearrayeta-1); 
 
-  //std::cout << " e1 = " << e1 << " " << Ehsthr << std::endl;
   if(e1>Ehsthr) {
     for(int ieta=nlo;ieta<=nhi;ieta++){
       if (m_ncell[ieta] == 0) continue;
@@ -1060,9 +1057,9 @@ void egammaStripsShape::setF1core()
   // total ennergy
   double energy = m_cluster->e();
   // build fraction only if both quantities are well defined
-  if ( fabs(energy) > 0. && e132 > x )
+  if ( fabs(energy) > 0. && e132 > x ){
     m_f1core = e132/energy;
-
+  }
   return;  
 }
 
diff --git a/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.h b/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.h
index d975210fee9cb233d95f6b084b3bacacb3f98943..3e96452d4623d71234917d13952845bc646422c9 100755
--- a/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.h
+++ b/Reconstruction/egamma/egammaCaloTools/src/egammaStripsShape.h
@@ -173,6 +173,9 @@ class egammaStripsShape : public AthAlgTool, virtual public IegammaStripsShape {
   bool m_ExecAllVariables;
   /** @brief boolean to calculate less important variables*/
   bool m_ExecOtherVariables;
+  /** @brief boolean to use cluster cells or all cells */
+  bool m_UseCellsFromCluster;
+
   // Calo variables
   const CaloDetDescrManager* m_calo_dd;
 
@@ -181,7 +184,7 @@ class egammaStripsShape : public AthAlgTool, virtual public IegammaStripsShape {
   double m_dphi;
 
   enum { STRIP_ARRAY_SIZE = 40 };
-  enum { DOUBLE_STRIP_ARRAY_SIZE = 80 };
+  enum { BIG_STRIP_ARRAY_SIZE = STRIP_ARRAY_SIZE*3 };
   /** @brief array of cell energies*/
   double m_enecell[STRIP_ARRAY_SIZE]; 
   /** @brief array of cell eta*/
diff --git a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
index ea81b7ad2e607ab3e946a819526e414e9cfed659..1e21b9627aba063b4dc9e721a6fb2f39ec9a2b16 100644
--- a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
+++ b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt
@@ -68,7 +68,9 @@ endif()
 # Test(s) in the package:
 atlas_add_test( mem_test SCRIPT test/mem_test.py )
 if( XAOD_STANDALONE )
-   atlas_add_test( ut_test SCRIPT test/ut_test.py )
+# Disable until we have reasonable input/to check 
+# against 
+#  atlas_add_test( ut_test SCRIPT test/ut_test.py)
 endif()
 
 # Install files from the package:
diff --git a/Reconstruction/egamma/egammaMVACalib/Root/egammaMVATool.cxx b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVATool.cxx
index 50e80a4e7b0501dc0ae52c91da0ff3ca3fea9c9c..3040495613c31c760004fdda35c30fafadcc40c5 100644
--- a/Reconstruction/egamma/egammaMVACalib/Root/egammaMVATool.cxx
+++ b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVATool.cxx
@@ -191,49 +191,28 @@ StatusCode egammaMVATool::hltexecute(xAOD::CaloCluster* cluster, const std::stri
   return StatusCode::SUCCESS;
 }
 
-float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const std::string& egType){
-
-  // Check for errors...
-  if ( !cluster ){
-    ATH_MSG_WARNING("no xAOD::CaloCluster object provided");
+float egammaMVATool::getEnergy(const xAOD::Egamma* eg){
+  if (!eg){
+    ATH_MSG_WARNING("no xAOD::Egamma object provided");
     return 0;
   }
-
-
-  if (egType == "Electron") {
-    ATH_MSG_DEBUG("Processing for HLT electron");
-    m_MVATreeElectron->update(nullptr, cluster);
-    return m_mvaElectron->getMVAEnergy();
-  }
-  else if(egType == "Photon"){
-    ATH_MSG_DEBUG("Processing for HLT photon");
-    m_MVATreePhoton->update(nullptr, cluster);
-    return m_mvaPhoton->getMVAEnergy();
-  }
-  else {
-    ATH_MSG_WARNING("Unknown particle type");
-  }
-  return 0;
-  
-
+  return getEnergy(eg->caloCluster(),eg);
 }
 
-float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Egamma* eg){
+float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, 
+			       const xAOD::Egamma* eg){
   ATH_MSG_DEBUG("In execute...");
-
   // Check for errors...
   if ( !eg ){
     ATH_MSG_WARNING("no xAOD::Egamma object provided");
     return 0;
   }
-
   if( eg->type() == xAOD::Type::Electron  ){
-    ATH_MSG_DEBUG("Processing for electron...");
+    ATH_MSG_DEBUG("Processing for electron");
     return getEnergy(cluster, static_cast<const xAOD::Electron*>(eg));
   }
   else if (eg->type() == xAOD::Type::Photon ){
-    ATH_MSG_DEBUG("Processing for photon...");
-
+    ATH_MSG_DEBUG("Processing for photon");
     // this is because topo seeded electron (author == 128) have cluster in
     // another collection, which is not decorated with etaCalo, m_cl_phiCalo
     // needed by the MVA calibration
@@ -245,11 +224,43 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Ega
   else{
     ATH_MSG_INFO("Unknown Type");
   }
+  return 0;
+}
+
 
+float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, 
+			       const std::string& egType){
+  // Check for errors...
+  if ( !cluster ){
+    ATH_MSG_WARNING("no xAOD::CaloCluster object provided");
+    return 0;
+  }
+  if (egType == "Electron") {
+    ATH_MSG_DEBUG("Processing  for type electron");
+    m_MVATreeElectron->update(nullptr, cluster);
+    return m_mvaElectron->getMVAEnergy();
+  }
+  else if(egType == "Photon"){
+    ATH_MSG_DEBUG("Processing for type photon");
+    m_MVATreePhoton->update(nullptr, cluster);
+    return m_mvaPhoton->getMVAEnergy();
+  }
+  else {
+    ATH_MSG_WARNING("Unknown particle type");
+  }
   return 0;
 }
 
-float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Electron* el){
+float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, 
+			       const xAOD::EgammaParameters::EgammaType egType){
+  return  ( (egType==xAOD::EgammaParameters::electron) ?  
+	   getEnergy(cluster, "Electron") : 
+	   getEnergy(cluster, "Photon"));
+}
+
+
+float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, 
+			       const xAOD::Electron* el){
   if(!el){
     ATH_MSG_ERROR("No electron passed");
     return 0;
@@ -259,17 +270,14 @@ float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Ele
   return m_mvaElectron->getMVAEnergy();
 }
 
-float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Photon* ph){
+float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, 
+			       const xAOD::Photon* ph){
   if(!ph){
     ATH_MSG_ERROR("No photon passed");
     return 0;
   }
-
   ATH_MSG_DEBUG("updating variables photon");
   m_MVATreePhoton->update(ph, cluster);
   return m_mvaPhoton->getMVAEnergy();
 }
 
-float egammaMVATool::getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType){
-  return  ( (egType==xAOD::EgammaParameters::electron) ?  getEnergy(cluster, "Electron") : getEnergy(cluster, "Photon") );
-}
diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/IegammaMVATool.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/IegammaMVATool.h
index 302040aa3cbd39bff9ddd4e43661e2610b2d1c6a..ba2f6f7c45a8f757876becdf3c4c40af4dbc41f0 100644
--- a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/IegammaMVATool.h
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/IegammaMVATool.h
@@ -33,6 +33,18 @@ public:
   virtual StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::Egamma* eg)=0;
   virtual StatusCode execute(xAOD::CaloCluster* cluster,const xAOD::EgammaParameters::EgammaType egType)=0;
   virtual StatusCode hltexecute(xAOD::CaloCluster* cluster, const std::string& egType)=0;
+
+  virtual float getEnergy(const xAOD::Egamma* eg)=0;
+  virtual float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Egamma*)=0;
+  virtual float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType)=0;
+
+  virtual float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Electron*)=0;
+  virtual float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Photon*)=0;
+  virtual float getEnergy(const xAOD::CaloCluster* cluster, const std::string&)=0;
+
+
+
+
 };
 
 #endif
diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVATool.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVATool.h
index 45dade09c4f65395518b49cb2decd4067e35cf3a..fd4f22006d37c35c14f4704b801e5da3f9f5246b 100644
--- a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVATool.h
+++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVATool.h
@@ -46,10 +46,12 @@ public:
   StatusCode execute(xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType);
   StatusCode hltexecute(xAOD::CaloCluster* cluster, const std::string& egType);
 
+  float getEnergy(const xAOD::Egamma* eg);
   float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Egamma*);
+  float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType);
+
   float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Electron*);
   float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::Photon*);
-  float getEnergy(const xAOD::CaloCluster* cluster, const xAOD::EgammaParameters::EgammaType egType);
   float getEnergy(const xAOD::CaloCluster* cluster, const std::string&);
 
 private:
diff --git a/Reconstruction/egamma/egammaMVACalib/test/mem_test.py b/Reconstruction/egamma/egammaMVACalib/test/mem_test.py
index 399a5bac5756ab48f6700105142a7e5429f1ed93..259ccafe4a7929009960fe3c8b46fd6121d6f652 100755
--- a/Reconstruction/egamma/egammaMVACalib/test/mem_test.py
+++ b/Reconstruction/egamma/egammaMVACalib/test/mem_test.py
@@ -13,8 +13,7 @@ def Vmem():
 memUsage = [Vmem()]
 
 # import ROOT and load dictionary
-import ROOT, PyCintex, numpy as np
-PyCintex.loadDict('egammaMVACalibDict')
+import ROOT
 memUsage.append( Vmem() )
 
 # Electrons
@@ -25,4 +24,5 @@ memUsage.append( Vmem() )
 m = ROOT.egammaMVACalib(0, True, 'egammaMVACalib/online/v3')
 memUsage.append( Vmem() )
 
-print np.diff(memUsage)/1e6, 'GB'
+for i in memUsage:
+  print i/1e6 , 'GB'
diff --git a/Reconstruction/egamma/egammaMVACalib/util/mem_test_initialize.cxx b/Reconstruction/egamma/egammaMVACalib/util/mem_test_initialize.cxx
index cb3ffef6effcc705a081980793d908bd8c55fb61..47dfe3aa578c04c985880ccaefd35b9ccaca98f3 100644
--- a/Reconstruction/egamma/egammaMVACalib/util/mem_test_initialize.cxx
+++ b/Reconstruction/egamma/egammaMVACalib/util/mem_test_initialize.cxx
@@ -4,10 +4,12 @@
 
 #include "egammaMVACalib/egammaMVATool.h"
 
+
 int main()
 {
   egammaMVATool myMVATool("myMVATool");
   myMVATool.setProperty("folder", "egammaMVACalib/online/v3");
   myMVATool.initialize();
+
   return 0;
 }
diff --git a/Reconstruction/egamma/egammaRec/CMakeLists.txt b/Reconstruction/egamma/egammaRec/CMakeLists.txt
index eac02c4f7f3173d8b9832bef8cf33af7116ea762..70f22e11b95855658f369606dc350109988b5550 100644
--- a/Reconstruction/egamma/egammaRec/CMakeLists.txt
+++ b/Reconstruction/egamma/egammaRec/CMakeLists.txt
@@ -21,7 +21,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/CxxUtils
                           Control/StoreGate
                           Event/xAOD/xAODTracking
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
+                          PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
                           Reconstruction/egamma/egammaInterfaces
                           Reconstruction/egamma/egammaRecEvent
                           Reconstruction/egamma/egammaUtils
@@ -38,13 +38,14 @@ atlas_add_library( egammaRecLib
                    PUBLIC_HEADERS egammaRec
                    PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES AthenaBaseComps EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel MCTruthClassifierLib CaloUtilsLib StoreGateLib SGtests ElectronPhotonSelectorToolsLib
+                   LINK_LIBRARIES AthenaBaseComps EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel MCTruthClassifierLib CaloUtilsLib StoreGateLib SGtests EgammaAnalysisInterfacesLib
                    PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloGeoHelpers AthenaKernel CxxUtils xAODTracking egammaRecEvent egammaUtils PathResolver )
 
 atlas_add_component( egammaRec
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel MCTruthClassifierLib CaloGeoHelpers CaloUtilsLib AthenaKernel CxxUtils StoreGateLib SGtests xAODTracking ElectronPhotonSelectorToolsLib egammaRecEvent egammaUtils PathResolver egammaRecLib )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel MCTruthClassifierLib CaloGeoHelpers CaloUtilsLib 
+		     AthenaKernel CxxUtils StoreGateLib SGtests xAODTracking EgammaAnalysisInterfacesLib egammaRecEvent egammaUtils PathResolver egammaRecLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Reconstruction/egamma/egammaRec/egammaRec/egammaAODFixAlg.h b/Reconstruction/egamma/egammaRec/egammaRec/egammaAODFixAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..657763f6f624a11ce64bb8f494c412fe949645f9
--- /dev/null
+++ b/Reconstruction/egamma/egammaRec/egammaRec/egammaAODFixAlg.h
@@ -0,0 +1,61 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id$
+#ifndef EGAMMAREC_EGAMMAAODFIXALG_H
+#define EGAMMAREC_EGAMMAAODFIXALG_H
+
+// System include(s):
+#include <string>
+
+// Athena/Gaudi include(s):
+#include "AthenaBaseComps/AthAlgorithm.h"
+
+// xAOD include
+#include "xAODEgamma/ElectronContainerFwd.h"
+#include "xAODEgamma/PhotonContainerFwd.h"
+#include "xAODEgamma/EgammaFwd.h"
+#include "StoreGate/ReadHandleKey.h"
+
+/**
+ *  @short Algorithm to fix AOD electrons and photons,
+ *   based on mounAODFixAlg, by Edward Moyse
+ *
+ * @author Jovan Mitrevski <Jovan.Mitrevski@cern.ch>
+ *
+ */
+
+class CaloCellContainer;
+class IegammaStripsShape;
+
+
+class egammaAODFixAlg : public AthAlgorithm {
+  
+public:
+  /// Regular algorithm constructor
+  egammaAODFixAlg( const std::string& name, ISvcLocator* svcLoc );
+  
+  /// Function initialising the algorithm
+  virtual StatusCode initialize() override;
+  /// Function executing the algorithm
+  virtual StatusCode execute() override;
+  
+private:
+
+  StatusCode fixEgamma(xAOD::Egamma* egamma,
+		       const CaloCellContainer *cell_container);
+
+  // not really sure how to do this part with handles
+  std::string m_electronContainerName;
+  std::string m_photonContainerName;
+
+  SG::ReadHandleKey<CaloCellContainer> m_cellsKey; 
+  ToolHandle<IegammaStripsShape> m_stripsShapeTool;
+
+}; // class egammaAODFixAlg
+
+
+#endif 
diff --git a/Reconstruction/egamma/egammaRec/src/components/egammaRec_entries.cxx b/Reconstruction/egamma/egammaRec/src/components/egammaRec_entries.cxx
index 06c0de361e4157db9a285c759264b97ed0d7b374..0dfad2e6224aa56297340a8082f2f92dbb26ff34 100755
--- a/Reconstruction/egamma/egammaRec/src/components/egammaRec_entries.cxx
+++ b/Reconstruction/egamma/egammaRec/src/components/egammaRec_entries.cxx
@@ -6,6 +6,7 @@
 #include "egammaRec/egammaTrackSlimmer.h"
 #include "egammaRec/egammaFinalizeClusters.h"
 #include "egammaRec/egammaLockCollections.h"
+#include "egammaRec/egammaAODFixAlg.h"
 
 
 DECLARE_ALGORITHM_FACTORY( egammaBuilder            )
@@ -15,6 +16,7 @@ DECLARE_ALGORITHM_FACTORY( egammaTruthAssociationAlg)
 DECLARE_ALGORITHM_FACTORY( egammaTrackSlimmer       )
 DECLARE_ALGORITHM_FACTORY( egammaFinalizeClusters   )
 DECLARE_ALGORITHM_FACTORY( egammaLockCollections    )
+DECLARE_ALGORITHM_FACTORY( egammaAODFixAlg          )
 
 
 DECLARE_FACTORY_ENTRIES(egammaRec) {
@@ -25,5 +27,6 @@ DECLARE_FACTORY_ENTRIES(egammaRec) {
      DECLARE_ALGORITHM( egammaTrackSlimmer        )
      DECLARE_ALGORITHM( egammaFinalizeClusters    )
      DECLARE_ALGORITHM( egammaLockCollections     )
+     DECLARE_ALGORITHM( egammaAODFixAlg           )
 
 }
diff --git a/Reconstruction/egamma/egammaRec/src/egammaAODFixAlg.cxx b/Reconstruction/egamma/egammaRec/src/egammaAODFixAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a817ccf2f59fe96e5292956a2c8fb42e0afddb77
--- /dev/null
+++ b/Reconstruction/egamma/egammaRec/src/egammaAODFixAlg.cxx
@@ -0,0 +1,237 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id$
+
+// Gaudi/Athena include(s):
+#include "StoreGate/ReadHandle.h"
+
+// EDM include(s):
+#include "CaloEvent/CaloCellContainer.h"
+#include "egammaInterfaces/IegammaStripsShape.h"
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/PhotonContainer.h"
+#include "xAODEgamma/ElectronAuxContainer.h"
+#include "xAODEgamma/PhotonAuxContainer.h"
+#include "xAODEgamma/Electron.h"
+#include "xAODEgamma/Photon.h"
+
+// Local include(s):
+#include "egammaRec/egammaAODFixAlg.h"
+
+// Misc
+#include <memory>
+
+
+egammaAODFixAlg::egammaAODFixAlg( const std::string& name,
+				  ISvcLocator* svcLoc )
+  : AthAlgorithm( name, svcLoc ),
+    m_stripsShapeTool("egammaStripsShape/egammastripsshape")
+{
+  declareProperty("ElectronContainerName",
+		  m_electronContainerName="Electrons",
+		  "Name of Electron Container to be fixed");
+
+  declareProperty("PhotonContainerName",
+		  m_photonContainerName="Photons",
+		  "Name of Photon Container to be fixed");
+
+  declareProperty("CellsName", m_cellsKey = "AODCellContainer",
+		  "The name of the topocluster collection");
+
+  declareProperty("egammaStripsShapeTool", m_stripsShapeTool, "Tool needed to recalculate strips");
+
+
+}
+
+StatusCode egammaAODFixAlg::initialize() {
+  ATH_CHECK(m_cellsKey.initialize());
+  ATH_CHECK(m_stripsShapeTool.retrieve());
+  // Return gracefully:
+  return StatusCode::SUCCESS;
+  
+}
+
+StatusCode egammaAODFixAlg::execute() {
+
+  SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey);
+  
+  if(!cellcoll.isValid()) {
+    ATH_MSG_ERROR("Failed to retrieve cell container: "<< m_cellsKey.key());
+    return StatusCode::FAILURE;
+  }
+    
+  // Code copied from InDetVxLinksToMuons (via MuonAODFixAlg)
+
+  // first do electrons
+  const SG::DataProxy* proxyEl =
+    evtStore()->proxy (ClassID_traits<xAOD::ElectronContainer>::ID(),
+                       m_electronContainerName);
+  if (!proxyEl) {
+    ATH_MSG_WARNING( "No xAOD::ElectronContainer "
+		     << "with key \"" << m_electronContainerName << "\" found" );
+    return StatusCode::SUCCESS;
+  }
+
+  xAOD::ElectronContainer* electrons=nullptr;
+  
+  if (proxyEl->isConst()) {
+    const xAOD::ElectronContainer* originalElectrons = nullptr;
+    ATH_CHECK( evtStore()->retrieve (originalElectrons,
+				     m_electronContainerName) );
+    
+    electrons = new xAOD::ElectronContainer;
+    auto store = std::make_unique<xAOD::ElectronAuxContainer>();
+    electrons->setStore (store.get());
+    for (const xAOD::Electron* oldElectron : *originalElectrons) {
+      xAOD::Electron* electron = new xAOD::Electron;
+      electrons->push_back (electron);
+      *electrons->back() = *oldElectron;
+      ATH_CHECK(fixEgamma(electron, cellcoll.ptr()));
+    }
+    ATH_CHECK( evtStore()->overwrite (electrons,
+				      m_electronContainerName,
+				      true, false) );
+    ATH_CHECK( evtStore()->overwrite (std::move(store),
+				      m_electronContainerName + "Aux.",
+				      true, false) );
+  } else {
+    ATH_CHECK( evtStore()->retrieve (electrons,
+				     m_electronContainerName) );
+    
+    for (xAOD::Electron* electron : *electrons) {
+      ATH_CHECK(fixEgamma(electron, cellcoll.ptr()));
+    }
+  }
+
+  // now do photons
+  const SG::DataProxy* proxyPh =
+    evtStore()->proxy (ClassID_traits<xAOD::PhotonContainer>::ID(),
+                       m_photonContainerName);
+  if (!proxyPh) {
+    ATH_MSG_WARNING( "No xAOD::PhotonContainer "
+		     << "with key \"" << m_photonContainerName << "\" found" );
+    return StatusCode::SUCCESS;
+  }
+
+  xAOD::PhotonContainer* photons=nullptr;
+  
+  if (proxyPh->isConst()) {
+    const xAOD::PhotonContainer* originalPhotons = nullptr;
+    ATH_CHECK( evtStore()->retrieve (originalPhotons,
+				     m_photonContainerName) );
+    
+    photons = new xAOD::PhotonContainer;
+    auto store = std::make_unique<xAOD::PhotonAuxContainer>();
+    photons->setStore (store.get());
+    for (const xAOD::Photon* oldPhoton : *originalPhotons) {
+      xAOD::Photon* photon = new xAOD::Photon;
+      photons->push_back (photon);
+      *photons->back() = *oldPhoton;
+      ATH_CHECK(fixEgamma(photon, cellcoll.ptr()));
+    }
+    ATH_CHECK( evtStore()->overwrite (photons,
+				      m_photonContainerName,
+				      true, false) );
+    ATH_CHECK( evtStore()->overwrite (std::move(store),
+				      m_photonContainerName + "Aux.",
+				      true, false) );
+  } else {
+    ATH_CHECK( evtStore()->retrieve (photons,
+				     m_photonContainerName) );
+    
+    for (xAOD::Photon* photon : *photons) {
+      ATH_CHECK(fixEgamma(photon, cellcoll.ptr()));
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode egammaAODFixAlg::fixEgamma(xAOD::Egamma* eg,  const CaloCellContainer *cell_container) {
+  const auto clus = eg->caloCluster();
+  ATH_CHECK(m_stripsShapeTool->execute(clus, cell_container));
+
+  // copying from EMShowerBuilder. 
+  float value=0;
+  // E in 3x2 cells in S1
+  float e132 = static_cast<float>(m_stripsShapeTool->e132());
+  eg->setShowerShapeValue(e132, xAOD::EgammaParameters::e132);
+  // E in 15x2 cells in S1
+  float olde1152 = 0;
+  bool validOlde1152 = eg->showerShapeValue(olde1152, xAOD::EgammaParameters::e1152);
+  float e1152 = static_cast<float>(m_stripsShapeTool->e1152());
+  eg->setShowerShapeValue(e1152, xAOD::EgammaParameters::e1152);
+  // fraction of E in S1
+  value=static_cast<float>(m_stripsShapeTool->f1());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::f1);
+  // fraction of E in the core(e132) in S1
+  value=static_cast<float>(m_stripsShapeTool->f1core());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::f1core);
+  // corr width with 3 strips 
+  value=static_cast<float>(m_stripsShapeTool->ws3c());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::weta1);
+  // energy in second max
+  value=static_cast<float>(m_stripsShapeTool->esec());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::e2ts1);
+  // energy strip of second max
+  float esec = static_cast<float>(m_stripsShapeTool->esec1());
+  eg->setShowerShapeValue(esec, xAOD::EgammaParameters::e2tsts1);
+  // fraction of E outside core in S1
+  value=static_cast<float>(m_stripsShapeTool->fside());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::fracs1);
+  // width with 5 strips
+  value=static_cast<float>(m_stripsShapeTool->widths5());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::widths1);
+  //eta pos within cell in S1
+  value=static_cast<float>(m_stripsShapeTool->poscs1());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::poscs1);
+  // asymmetry with 3 strips
+  value=static_cast<float>(m_stripsShapeTool->asymmetrys3());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::asy1);
+  // diff position +/- 1 cells
+  value=static_cast<float>(m_stripsShapeTool->deltaEtaTrackShower());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::pos);
+  // diff position +/- 7 cells
+  value=static_cast<float>(m_stripsShapeTool->deltaEtaTrackShower7());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::pos7);
+  // E of strip with min E 
+  float emin = static_cast<float>(m_stripsShapeTool->emins1());
+  eg->setShowerShapeValue(emin, xAOD::EgammaParameters::emins1);
+  // E of strip with max E
+  float emax = static_cast<float>(m_stripsShapeTool->emaxs1());
+  eg->setShowerShapeValue(emax, xAOD::EgammaParameters::emaxs1);
+  // barycentre in eta in S1
+  value=static_cast<float>(m_stripsShapeTool->etas3());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::barys1);
+  // total width in strips
+  value=static_cast<float>(m_stripsShapeTool->wstot());
+  eg->setShowerShapeValue(value, xAOD::EgammaParameters::wtots1);
+  //
+  // information combining all samplings
+  //
+  // core energy
+  float unfixedecore = 0;
+  if (validOlde1152 && eg->showerShapeValue(unfixedecore, xAOD::EgammaParameters::ecore)) {
+    float ecore = unfixedecore - olde1152 + e1152;
+    eg->setShowerShapeValue(ecore, xAOD::EgammaParameters::ecore);
+  } else {
+    ATH_MSG_WARNING("Missing parameter ecore or e1152");
+  }
+  
+  //
+  // information combining different shower shape
+  //
+  /// @brief (emaxs1-e2tsts1)/(emaxs1+e2tsts1)
+
+  const auto Eratio = std::abs(emax+esec)>0. ? (emax-esec)/(emax+esec) : 0;
+  const auto DeltaE = esec - emin;
+
+  eg->setShowerShapeValue(Eratio, xAOD::EgammaParameters::Eratio);
+
+  eg->setShowerShapeValue(DeltaE, xAOD::EgammaParameters::DeltaE);
+  
+  return StatusCode::SUCCESS;
+}
+
diff --git a/Reconstruction/egamma/egammaRec/src/egammaBuilder.cxx b/Reconstruction/egamma/egammaRec/src/egammaBuilder.cxx
index 20d67c823c65871b9a0bf50a2ac833fcd468c94b..34a1ad6b1f4bb9c4ec75a758081beda191e8a331 100644
--- a/Reconstruction/egamma/egammaRec/src/egammaBuilder.cxx
+++ b/Reconstruction/egamma/egammaRec/src/egammaBuilder.cxx
@@ -38,7 +38,7 @@ PURPOSE:  Algorithm which makes a egammaObjectCollection. For each cluster
 #include "xAODEgamma/Electron.h"
 #include "xAODEgamma/Photon.h"
 
-#include "ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h"
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
 #include "egammaInterfaces/IegammaBaseTool.h" 
 #include "egammaInterfaces/IEMTrackMatchBuilder.h"
 #include "egammaInterfaces/IEMConversionBuilder.h"
diff --git a/Reconstruction/egamma/egammaRec/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaRec/src/egammaForwardBuilder.cxx
index 8592c7a20b8a076925a6aad41269bbcc1cbc3ffb..ae3cf3c1b5eb0a99d6f11826b47cfdbb0bb85c9a 100644
--- a/Reconstruction/egamma/egammaRec/src/egammaForwardBuilder.cxx
+++ b/Reconstruction/egamma/egammaRec/src/egammaForwardBuilder.cxx
@@ -17,9 +17,9 @@
 
 #include "xAODEgamma/ElectronContainer.h"
 #include "xAODEgamma/ElectronAuxContainer.h"
-#include "xAODEgamma/Electron.h"
- 
-#include "ElectronPhotonSelectorTools/IAsgForwardElectronIsEMSelector.h"
+#include "xAODEgamma/Electron.h" 
+
+#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
 
 #include <algorithm> 
 #include <math.h>
diff --git a/Reconstruction/egamma/egammaRec/src/topoEgammaBuilder.cxx b/Reconstruction/egamma/egammaRec/src/topoEgammaBuilder.cxx
index a5596adda47e024c9797d5c5b03d9a8568f0a071..45aec142a96039983fb15acc06ca1f5c9b3430b4 100755
--- a/Reconstruction/egamma/egammaRec/src/topoEgammaBuilder.cxx
+++ b/Reconstruction/egamma/egammaRec/src/topoEgammaBuilder.cxx
@@ -21,7 +21,7 @@
 #include "xAODEgamma/Photon.h"
 
 #include "egammaInterfaces/IegammaBaseTool.h" 
-#include "ElectronPhotonSelectorTools/IEGammaAmbiguityTool.h"
+#include "EgammaAnalysisInterfaces/IEGammaAmbiguityTool.h"
 #include "egammaInterfaces/IEMTrackMatchBuilder.h"
 #include "egammaInterfaces/IEMConversionBuilder.h"
 #include "egammaInterfaces/IegammaCheckEnergyDepositTool.h"
diff --git a/Reconstruction/egamma/egammaTools/CMakeLists.txt b/Reconstruction/egamma/egammaTools/CMakeLists.txt
index 9616c8758bd06d3e37c92713301915179721259c..99100df24ebba2cc86c4fcf32925276d09107f0f 100644
--- a/Reconstruction/egamma/egammaTools/CMakeLists.txt
+++ b/Reconstruction/egamma/egammaTools/CMakeLists.txt
@@ -37,9 +37,9 @@ atlas_depends_on_subdirs( PRIVATE
                           LArCalorimeter/LArCabling
                           LumiBlock/LumiBlockComps
                           PhysicsAnalysis/AnalysisCommon/PATCore
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection
-                          PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
-                          Reconstruction/Particle
+                          PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
+			  PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection
+                          Reconstruction/Particle	
                           Reconstruction/ParticleTruth
                           Reconstruction/egamma/egammaInterfaces
                           Reconstruction/egamma/egammaMVACalib
@@ -63,7 +63,7 @@ atlas_add_component( egammaTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloEvent  CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel CxxUtils AthContainers SGTools StoreGateLib SGtests Identifier EventKernel EventPrimitives FourMom FourMomUtils NavFourMom xAODCaloEvent  xAODEgamma xAODTracking xAODTruth GaudiKernel InDetConversionFinderToolsLib InDetRecToolInterfaces LArRecConditions LArCablingLib LumiBlockCompsLib PATCoreLib ElectronPhotonFourMomentumCorrectionLib ElectronPhotonSelectorToolsLib Particle ParticleTruth egammaMVACalibLib egammaRecEvent egammaUtils TrkEventPrimitives TrkMaterialOnTrack TrkParticleBase TrkPseudoMeasurementOnTrack TrkTrack VxVertex TrkToolInterfaces )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloEvent  CaloIdentifier CaloRecLib CaloUtilsLib AthenaBaseComps AthenaKernel CxxUtils AthContainers SGTools StoreGateLib SGtests Identifier EventKernel EventPrimitives FourMom FourMomUtils NavFourMom xAODCaloEvent  xAODEgamma xAODTracking xAODTruth GaudiKernel InDetConversionFinderToolsLib InDetRecToolInterfaces LArRecConditions LArCablingLib LumiBlockCompsLib PATCoreLib EgammaAnalysisInterfacesLib ElectronPhotonFourMomentumCorrectionLib Particle ParticleTruth egammaMVACalibLib egammaRecEvent egammaUtils TrkEventPrimitives TrkMaterialOnTrack TrkParticleBase TrkPseudoMeasurementOnTrack TrkTrack VxVertex TrkToolInterfaces )
 
 # Install files from the package:
 atlas_install_headers( egammaTools )
diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
index 0153a84596ae054822c0c53d01ba0e313ec725fd..3d026a3ef3838fbe1b9f2e1941935aa5d8076075 100644
--- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
@@ -7,9 +7,9 @@
 
 #include "EMPIDBuilder.h"
 #include "xAODEgamma/Egamma.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h"
-#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
 #include "PATCore/IAsgSelectionTool.h"
 #include "LumiBlockComps/LumiBlockMuTool.h"
 #include "PATCore/TAccept.h"            // for TAccept
diff --git a/Reconstruction/egamma/egammaTools/src/FourMomCombiner.h b/Reconstruction/egamma/egammaTools/src/FourMomCombiner.h
index aebdff34638626be0ba247d559205bae4ae878ba..00de756c078f2f6e3ca6c08a09f7afdf5ea4005c 100644
--- a/Reconstruction/egamma/egammaTools/src/FourMomCombiner.h
+++ b/Reconstruction/egamma/egammaTools/src/FourMomCombiner.h
@@ -25,7 +25,7 @@
 #include "egammaBaseTool.h"
 #include "EventPrimitives/EventPrimitives.h"
 
-//#include "ElectronPhotonFourMomentumCorrection/egammaEnergyCorrectionTool.h"
+//#include "EgammaAnalysisInterfaces/egammaEnergyCorrectionTool.h"
 
 class IEMExtrapolCaloConversion;
 
diff --git a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx
index 6086d2ccb01f8fa7b622ba5c1a9e7296ace36399..7093d2c56217d74b507544dc96486827e24cf793 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx
@@ -203,10 +203,10 @@ bool egammaSuperClusterBuilder::MatchesInWindow(const xAOD::CaloCluster *ref,
     float dPhi(fabs(P4Helpers::deltaPhi(ref->phi(), clus->phi())));
     //
     float dEtaBarrel (fabs(ref->etaSample(CaloSampling::EMB2)-clus->eta())); 
-    float dPhiBarrel =(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),clus->phi())); 
+    float dPhiBarrel (fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),clus->phi()))); 
     //
     float dEtaEndcap (fabs(ref->etaSample(CaloSampling::EME2)-clus->eta()));
-    float dPhiEndcap =(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),clus->phi())); 
+    float dPhiEndcap (fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),clus->phi()))); 
     //Matches any in case of split
     return ( (dEta < m_searchWindowEtaBarrel && dPhi < m_searchWindowPhiBarrel) ||
 	     (dEta < m_searchWindowEtaEndcap && dPhi < m_searchWindowPhiEndcap) ||
@@ -362,8 +362,8 @@ StatusCode egammaSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster
 	   (fabs(ref->etaSample(CaloSampling::EME2)-cell->eta()) > m_addCellsWindowEtaEndcap) ){
 	continue;
       }
-      if ((P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),cell->phi()) > m_addCellsWindowPhiBarrel)&&
-	  (P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),cell->phi()) > m_addCellsWindowPhiEndcap) ){
+      if ((fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),cell->phi())) > m_addCellsWindowPhiBarrel)&&
+	  (fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),cell->phi())) > m_addCellsWindowPhiEndcap) ){
 	continue;
       }
     }
diff --git a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
index 382283fbb29297831d04c51ab65bab964983d5fb..320928a8f22b07dda5cb439de0908860a5455893 100644
--- a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
+++ b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx
@@ -70,7 +70,12 @@ StatusCode TauTrackClassifier::initialize()
 StatusCode TauTrackClassifier::execute(xAOD::TauJet& xTau)
 {
   xAOD::TauTrackContainer* tauTrackCon = 0;
-  ATH_CHECK(evtStore()->retrieve(tauTrackCon, m_tauTrackConName));
+
+    if (m_in_trigger) {
+      ATH_CHECK(tauEventData()->getObject( "TauTrackContainer", tauTrackCon ));
+    } else {
+      ATH_CHECK(evtStore()->retrieve(tauTrackCon, m_tauTrackConName));
+    }
   std::vector<xAOD::TauTrack*> vTracks = xAOD::TauHelpers::allTauTracksNonConst(&xTau, tauTrackCon);
   for (xAOD::TauTrack* xTrack : vTracks)
   {
@@ -148,67 +153,83 @@ StatusCode TrackMVABDT::finalize()
 //______________________________________________________________________________
 StatusCode TrackMVABDT::initialize()
 {
-  m_mAvailableVars={{"TracksAuxDyn.tauPt", new float(0)}
-                    , {"TracksAuxDyn.jetSeedPt", new float(0)}
-                    , {"TracksAuxDyn.tauEta", new float(0)}
-                    , {"TracksAuxDyn.trackEta", new float(0)}
-                    , {"TracksAuxDyn.z0sinThetaTJVA", new float(0)}
-                    , {"TracksAuxDyn.rConv", new float(0)}
-                    , {"TracksAuxDyn.rConvII", new float(0)}
-                    , {"TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII", new float(0)}
-                    , {"TracksAuxDyn.DRJetSeedAxis", new float(0)}
-                    , {"TracksAuxDyn.dRJetSeedAxis", new float(0)}
-                    , {"TracksAux.d0", new float(0)}
-                    , {"TracksAux.qOverP", new float(0)}
-                    , {"TracksAux.theta", new float(0)}
-                    , {"TracksAux.eProbabilityHT", new float(0)}
-                    , {"TracksAux.numberOfInnermostPixelLayerHits", new float(0)}
-                    , {"TracksAux.numberOfPixelHits", new float(0)}
-                    , {"TracksAux.numberOfPixelDeadSensors", new float(0)}
-                    , {"TracksAux.numberOfPixelSharedHits", new float(0)}
-                    , {"TracksAux.numberOfSCTHits", new float(0)}
-                    , {"TracksAux.numberOfSCTDeadSensors", new float(0)}
-                    , {"TracksAux.numberOfSCTSharedHits", new float(0)}
-                    , {"TracksAux.numberOfTRTHighThresholdHits", new float(0)}
-                    , {"TracksAux.numberOfTRTHits", new float(0)}
-                    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors", new float(0)}
-                    , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors", new float(0)}
-
-                    , {"TauTracksAuxDyn.tauPt", new float(0)}
-                    , {"TauTracksAuxDyn.jetSeedPt", new float(0)}
-                    , {"TauTracksAuxDyn.tauEta", new float(0)}
-                    , {"TauTracksAuxDyn.trackEta", new float(0)}
-                    , {"TauTracksAuxDyn.z0sinThetaTJVA", new float(0)}
-                    , {"TauTracksAuxDyn.rConv", new float(0)}
-                    , {"TauTracksAuxDyn.rConvII", new float(0)}
-                    , {"TauTracksAuxDyn.dRJetSeedAxis", new float(0)}
-                    , {"TauTracksAuxDyn.d0", new float(0)}
-                    , {"TauTracksAuxDyn.qOverP", new float(0)}
-                    , {"TauTracksAuxDyn.theta", new float(0)}
-                    , {"TauTracksAuxDyn.eProbabilityHT", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfInnermostPixelLayerHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelSharedHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfSCTHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfSCTSharedHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfTRTHighThresholdHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfTRTHits", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
-
-
-                    , {"1/(TauTracksAuxDyn.trackPt)", new float(0)}
-                    , {"fabs(TauTracksAuxDyn.qOverP)", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfContribPixelLayers", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
-                    , {"TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
+  if (not m_in_trigger) {
+
+    m_mAvailableVars= {{"TracksAuxDyn.tauPt", new float(0)}
+		      , {"TracksAuxDyn.jetSeedPt", new float(0)}
+		      , {"TracksAuxDyn.tauEta", new float(0)}
+		      , {"TracksAuxDyn.trackEta", new float(0)}
+		      , {"TracksAuxDyn.z0sinThetaTJVA", new float(0)}
+		      , {"TracksAuxDyn.rConv", new float(0)}
+		      , {"TracksAuxDyn.rConvII", new float(0)}
+		      , {"TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII", new float(0)}
+		      , {"TracksAuxDyn.DRJetSeedAxis", new float(0)}
+		      , {"TracksAuxDyn.dRJetSeedAxis", new float(0)}
+		      , {"TracksAux.d0", new float(0)}
+		      , {"TracksAux.qOverP", new float(0)}
+		      , {"TracksAux.theta", new float(0)}
+		      , {"TracksAux.eProbabilityHT", new float(0)}
+		      , {"TracksAux.numberOfInnermostPixelLayerHits", new float(0)}
+		      , {"TracksAux.numberOfPixelHits", new float(0)}
+		      , {"TracksAux.numberOfPixelDeadSensors", new float(0)}
+		      , {"TracksAux.numberOfPixelSharedHits", new float(0)}
+		      , {"TracksAux.numberOfSCTHits", new float(0)}
+		      , {"TracksAux.numberOfSCTDeadSensors", new float(0)}
+		      , {"TracksAux.numberOfSCTSharedHits", new float(0)}
+		      , {"TracksAux.numberOfTRTHighThresholdHits", new float(0)}
+		      , {"TracksAux.numberOfTRTHits", new float(0)}
+		      , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors", new float(0)}
+		      , {"TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors", new float(0)}
+
+		      , {"TauTracksAuxDyn.tauPt", new float(0)}
+		      , {"TauTracksAuxDyn.jetSeedPt", new float(0)}
+		      , {"TauTracksAuxDyn.tauEta", new float(0)}
+		      , {"TauTracksAuxDyn.trackEta", new float(0)}
+		      , {"TauTracksAuxDyn.z0sinThetaTJVA", new float(0)}
+		      , {"TauTracksAuxDyn.rConv", new float(0)}
+		      , {"TauTracksAuxDyn.rConvII", new float(0)}
+		      , {"TauTracksAuxDyn.dRJetSeedAxis", new float(0)}
+		      , {"TauTracksAuxDyn.d0", new float(0)}
+		      , {"TauTracksAuxDyn.qOverP", new float(0)}
+		      , {"TauTracksAuxDyn.theta", new float(0)}
+		      , {"TauTracksAuxDyn.eProbabilityHT", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfInnermostPixelLayerHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelSharedHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfSCTHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfSCTSharedHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfTRTHighThresholdHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfTRTHits", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors", new float(0)}
+		      
+		      
+		      , {"1/(TauTracksAuxDyn.trackPt)", new float(0)}
+		      , {"fabs(TauTracksAuxDyn.qOverP)", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfContribPixelLayers", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHoles", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
+		      , {"TauTracksAuxDyn.numberOfSCTHoles", new float(0)}
                     , {"TauTracksAux.pt", new float(0)}
-  };
+    };
+  } else {
+
+    m_mAvailableVars = {
+      {"jetSeedPt", new float(0)}, 
+      {"tauEta", new float(0)},
+      {"dRJetSeedAxis", new float(0)},
+      {"trackEta", new float(0)},
+      {"delta_z0", new float(0)},
+      {"delta_d0", new float(0)},
+      {"nSiHits", new float(0)},
+      {"nPiHits", new float(0)},
+    };
+
+  }
     
   ATH_CHECK(addWeightsFile());
   
@@ -311,98 +332,147 @@ StatusCode TrackMVABDT::parseVariableContent()
 StatusCode TrackMVABDT::setVars(const xAOD::TauTrack& xTrack, const xAOD::TauJet& xTau)
 {
   const xAOD::TrackParticle* xTrackParticle = xTrack.track();
-  uint8_t iTracksNumberOfInnermostPixelLayerHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNumberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits), StatusCode::FAILURE );
-  uint8_t iTracksNPixelHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelHits, xAOD::numberOfPixelHits), StatusCode::FAILURE );
-  uint8_t iTracksNPixelSharedHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelSharedHits, xAOD::numberOfPixelSharedHits), StatusCode::FAILURE );
-  uint8_t iTracksNPixelDeadSensors = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelDeadSensors, xAOD::numberOfPixelDeadSensors), StatusCode::FAILURE );
-  uint8_t iTracksNSCTHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTHits, xAOD::numberOfSCTHits), StatusCode::FAILURE );
-  uint8_t iTracksNSCTSharedHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTSharedHits, xAOD::numberOfSCTSharedHits), StatusCode::FAILURE );
-  uint8_t iTracksNSCTDeadSensors = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTDeadSensors, xAOD::numberOfSCTDeadSensors), StatusCode::FAILURE );
-  uint8_t iTracksNTRTHighThresholdHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue( iTracksNTRTHighThresholdHits, xAOD::numberOfTRTHighThresholdHits), StatusCode::FAILURE );
-  uint8_t iTracksNTRTHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue( iTracksNTRTHits, xAOD::numberOfTRTHits), StatusCode::FAILURE );
-  uint8_t iNumberOfContribPixelLayers = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfContribPixelLayers, xAOD::numberOfContribPixelLayers), StatusCode::FAILURE );
-  uint8_t iNumberOfPixelHoles = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfPixelHoles, xAOD::numberOfPixelHoles), StatusCode::FAILURE );
-  uint8_t iNumberOfSCTHoles = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfSCTHoles, xAOD::numberOfSCTHoles), StatusCode::FAILURE );
-	
-  float fTracksNumberOfInnermostPixelLayerHits = (float)iTracksNumberOfInnermostPixelLayerHits;
-  float fTracksNPixelHits = (float)iTracksNPixelHits;
-  float fTracksNPixelDeadSensors = (float)iTracksNPixelDeadSensors;
-  float fTracksNPixelSharedHits = (float)iTracksNPixelSharedHits;
-  float fTracksNSCTHits = (float)iTracksNSCTHits;
-  float fTracksNSCTDeadSensors = (float)iTracksNSCTDeadSensors;
-  float fTracksNSCTSharedHits = (float)iTracksNSCTSharedHits;
-  float fTracksNTRTHighThresholdHits = (float)iTracksNTRTHighThresholdHits;
-  float fTracksNTRTHits = (float)iTracksNTRTHits;
-	
-  float fTracksNPixHits = fTracksNPixelHits + fTracksNPixelDeadSensors;
-  float fTracksNSiHits = fTracksNPixelHits + fTracksNPixelDeadSensors + fTracksNSCTHits + fTracksNSCTDeadSensors;
-
-  float fTracksEProbabilityHT; TRT_CHECK_BOOL( xTrackParticle->summaryValue( fTracksEProbabilityHT, xAOD::eProbabilityHT), StatusCode::FAILURE );
-
-  float fNumberOfContribPixelLayers = float(iNumberOfContribPixelLayers);
-  float fNumberOfPixelHoles = float(iNumberOfPixelHoles);
-  float fNumberOfSCTHoles = float(iNumberOfSCTHoles);
-
-  setVar("TracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TracksAuxDyn.DRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TracksAux.d0") = xTrackParticle->d0();
-  setVar("TracksAux.qOverP") = xTrackParticle->qOverP();
-  setVar("TracksAux.theta") = xTrackParticle->theta();
-  setVar("TracksAux.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TracksAux.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TracksAux.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TracksAux.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TracksAux.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TracksAux.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TracksAux.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TracksAux.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TracksAux.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TracksAux.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("TauTracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
-  setVar("TauTracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
-  setVar("TauTracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
-  setVar("TauTracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
-  setVar("TauTracksAuxDyn.rConv") = xTrack.rConv(xTau);
-  setVar("TauTracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
-  setVar("TauTracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
-  setVar("TauTracksAuxDyn.trackEta") = xTrackParticle->eta();
-  setVar("TauTracksAuxDyn.d0") = xTrackParticle->d0();
-  setVar("TauTracksAuxDyn.qOverP") = xTrackParticle->qOverP();
-  setVar("TauTracksAuxDyn.theta") = xTrackParticle->theta();
-  setVar("TauTracksAuxDyn.eProbabilityHT") = fTracksEProbabilityHT;
-  setVar("TauTracksAuxDyn.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits") = fTracksNPixelHits;
-  setVar("TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
-  setVar("TauTracksAuxDyn.numberOfSCTHits") = fTracksNSCTHits;
-  setVar("TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
-  setVar("TauTracksAuxDyn.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
-  setVar("TauTracksAuxDyn.numberOfTRTHits") = fTracksNTRTHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixHits;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSiHits;
-
-  setVar("1/(TauTracksAuxDyn.trackPt)") = 1./xTrackParticle->pt();
-  setVar("fabs(TauTracksAuxDyn.qOverP)") = std::abs(xTrackParticle->qOverP());
-  setVar("TauTracksAuxDyn.numberOfContribPixelLayers") = fNumberOfContribPixelLayers;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles") = fTracksNPixHits+fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles") = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles") = fNumberOfPixelHoles;
-  setVar("TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfPixelHoles+fNumberOfSCTHoles;
-  setVar("TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfSCTHoles;
-  setVar("TauTracksAux.pt") = xTrackParticle->pt();
+
+  if (not m_in_trigger) {
+    uint8_t iTracksNumberOfInnermostPixelLayerHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNumberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits), StatusCode::FAILURE );
+    uint8_t iTracksNPixelHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelHits, xAOD::numberOfPixelHits), StatusCode::FAILURE );
+    uint8_t iTracksNPixelSharedHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelSharedHits, xAOD::numberOfPixelSharedHits), StatusCode::FAILURE );
+    uint8_t iTracksNPixelDeadSensors = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNPixelDeadSensors, xAOD::numberOfPixelDeadSensors), StatusCode::FAILURE );
+    uint8_t iTracksNSCTHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTHits, xAOD::numberOfSCTHits), StatusCode::FAILURE );
+    uint8_t iTracksNSCTSharedHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTSharedHits, xAOD::numberOfSCTSharedHits), StatusCode::FAILURE );
+    uint8_t iTracksNSCTDeadSensors = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iTracksNSCTDeadSensors, xAOD::numberOfSCTDeadSensors), StatusCode::FAILURE );
+    uint8_t iTracksNTRTHighThresholdHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue( iTracksNTRTHighThresholdHits, xAOD::numberOfTRTHighThresholdHits), StatusCode::FAILURE );
+    uint8_t iTracksNTRTHits = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue( iTracksNTRTHits, xAOD::numberOfTRTHits), StatusCode::FAILURE );
+    uint8_t iNumberOfContribPixelLayers = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfContribPixelLayers, xAOD::numberOfContribPixelLayers), StatusCode::FAILURE );
+    uint8_t iNumberOfPixelHoles = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfPixelHoles, xAOD::numberOfPixelHoles), StatusCode::FAILURE );
+    uint8_t iNumberOfSCTHoles = 0; TRT_CHECK_BOOL( xTrackParticle->summaryValue(iNumberOfSCTHoles, xAOD::numberOfSCTHoles), StatusCode::FAILURE );
+    
+    float fTracksNumberOfInnermostPixelLayerHits = (float)iTracksNumberOfInnermostPixelLayerHits;
+    float fTracksNPixelHits = (float)iTracksNPixelHits;
+    float fTracksNPixelDeadSensors = (float)iTracksNPixelDeadSensors;
+    float fTracksNPixelSharedHits = (float)iTracksNPixelSharedHits;
+    float fTracksNSCTHits = (float)iTracksNSCTHits;
+    float fTracksNSCTDeadSensors = (float)iTracksNSCTDeadSensors;
+    float fTracksNSCTSharedHits = (float)iTracksNSCTSharedHits;
+    float fTracksNTRTHighThresholdHits = (float)iTracksNTRTHighThresholdHits;
+    float fTracksNTRTHits = (float)iTracksNTRTHits;
+  
+    float fTracksNPixHits = fTracksNPixelHits + fTracksNPixelDeadSensors;
+    float fTracksNSiHits = fTracksNPixelHits + fTracksNPixelDeadSensors + fTracksNSCTHits + fTracksNSCTDeadSensors;
+
+    float fTracksEProbabilityHT; TRT_CHECK_BOOL( xTrackParticle->summaryValue( fTracksEProbabilityHT, xAOD::eProbabilityHT), StatusCode::FAILURE );
+
+    float fNumberOfContribPixelLayers = float(iNumberOfContribPixelLayers);
+    float fNumberOfPixelHoles = float(iNumberOfPixelHoles);
+    float fNumberOfSCTHoles = float(iNumberOfSCTHoles);
+    
+    setVar("TracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
+    setVar("TracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
+    setVar("TracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
+    setVar("TracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
+    setVar("TracksAuxDyn.rConv") = xTrack.rConv(xTau);
+    setVar("TracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
+    setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+    setVar("TracksAuxDyn.DRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
+    setVar("TracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
+    setVar("TracksAuxDyn.trackEta") = xTrackParticle->eta();
+    setVar("TracksAux.d0") = xTrackParticle->d0();
+    setVar("TracksAux.qOverP") = xTrackParticle->qOverP();
+    setVar("TracksAux.theta") = xTrackParticle->theta();
+    setVar("TracksAux.eProbabilityHT") = fTracksEProbabilityHT;
+    setVar("TracksAux.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
+    setVar("TracksAux.numberOfPixelHits") = fTracksNPixelHits;
+    setVar("TracksAux.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
+    setVar("TracksAux.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
+    setVar("TracksAux.numberOfSCTHits") = fTracksNSCTHits;
+    setVar("TracksAux.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
+    setVar("TracksAux.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
+    setVar("TracksAux.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
+    setVar("TracksAux.numberOfTRTHits") = fTracksNTRTHits;
+    setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors") = fTracksNPixHits;
+    setVar("TracksAux.numberOfPixelHits+TracksAux.numberOfPixelDeadSensors+TracksAux.numberOfSCTHits+TracksAux.numberOfSCTDeadSensors") = fTracksNSiHits;
+
+    setVar("TauTracksAuxDyn.jetSeedPt") = xTau.ptJetSeed();
+    setVar("TauTracksAuxDyn.tauPt") = xTau.ptIntermediateAxis();
+    setVar("TauTracksAuxDyn.tauEta") = xTau.etaIntermediateAxis();
+    setVar("TauTracksAuxDyn.z0sinThetaTJVA") = xTrack.z0sinThetaTJVA(xTau);
+    setVar("TauTracksAuxDyn.rConv") = xTrack.rConv(xTau);
+    setVar("TauTracksAuxDyn.rConvII") = xTrack.rConvII(xTau);
+    setVar("TauTracksAuxDyn.rConv/TauTracksAuxDyn.rConvII") = xTrack.rConv(xTau)/xTrack.rConvII(xTau);
+    setVar("TauTracksAuxDyn.dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
+    setVar("TauTracksAuxDyn.trackEta") = xTrackParticle->eta();
+    setVar("TauTracksAuxDyn.d0") = xTrackParticle->d0();
+    setVar("TauTracksAuxDyn.qOverP") = xTrackParticle->qOverP();
+    setVar("TauTracksAuxDyn.theta") = xTrackParticle->theta();
+    setVar("TauTracksAuxDyn.eProbabilityHT") = fTracksEProbabilityHT;
+    setVar("TauTracksAuxDyn.numberOfInnermostPixelLayerHits") = fTracksNumberOfInnermostPixelLayerHits;
+    setVar("TauTracksAuxDyn.numberOfPixelHits") = fTracksNPixelHits;
+    setVar("TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixelDeadSensors;
+    setVar("TauTracksAuxDyn.numberOfPixelSharedHits") = fTracksNPixelSharedHits;
+    setVar("TauTracksAuxDyn.numberOfSCTHits") = fTracksNSCTHits;
+    setVar("TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSCTDeadSensors;
+    setVar("TauTracksAuxDyn.numberOfSCTSharedHits") = fTracksNSCTSharedHits;
+    setVar("TauTracksAuxDyn.numberOfTRTHighThresholdHits") = fTracksNTRTHighThresholdHits;
+    setVar("TauTracksAuxDyn.numberOfTRTHits") = fTracksNTRTHits;
+    setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors") = fTracksNPixHits;
+    setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors") = fTracksNSiHits;
+    
+    setVar("1/(TauTracksAuxDyn.trackPt)") = 1./xTrackParticle->pt();
+    setVar("fabs(TauTracksAuxDyn.qOverP)") = std::abs(xTrackParticle->qOverP());
+    setVar("TauTracksAuxDyn.numberOfContribPixelLayers") = fNumberOfContribPixelLayers;
+    setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles") = fTracksNPixHits+fNumberOfPixelHoles;
+    setVar("TauTracksAuxDyn.numberOfPixelHits+TauTracksAuxDyn.numberOfPixelDeadSensors+TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHits+TauTracksAuxDyn.numberOfSCTDeadSensors+TauTracksAuxDyn.numberOfSCTHoles") = fTracksNSiHits+fNumberOfPixelHoles+fNumberOfSCTHoles;
+    setVar("TauTracksAuxDyn.numberOfPixelHoles") = fNumberOfPixelHoles;
+    setVar("TauTracksAuxDyn.numberOfPixelHoles+TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfPixelHoles+fNumberOfSCTHoles;
+    setVar("TauTracksAuxDyn.numberOfSCTHoles") = fNumberOfSCTHoles;
+    setVar("TauTracksAux.pt") = xTrackParticle->pt();
+  } else {
+
+    // fill the number of hits variables
+    uint8_t n_pix_hits = 0;
+    uint8_t n_pix_dead = 0;
+    uint8_t n_sct_hits = 0;
+    uint8_t n_sct_dead = 0;
+    uint8_t n_ibl_hits = 0;
+
+    TRT_CHECK_BOOL(xTrackParticle->summaryValue(n_pix_hits, xAOD::numberOfPixelHits), StatusCode::FAILURE);
+    TRT_CHECK_BOOL(xTrackParticle->summaryValue(n_pix_dead, xAOD::numberOfPixelDeadSensors), StatusCode::FAILURE);
+    TRT_CHECK_BOOL(xTrackParticle->summaryValue(n_sct_hits, xAOD::numberOfSCTHits), StatusCode::FAILURE);
+    TRT_CHECK_BOOL(xTrackParticle->summaryValue(n_sct_dead, xAOD::numberOfSCTDeadSensors), StatusCode::FAILURE);
+    TRT_CHECK_BOOL(xTrackParticle->summaryValue(n_ibl_hits, xAOD::numberOfInnermostPixelLayerHits), StatusCode::FAILURE);
+
+    float delta_z0 = -9999.;
+    float delta_d0 = -9999.;
+
+    // look for a leading track in the tau container 
+    // (protect against cases there are none)
+    const xAOD::TauTrack * lead_track = NULL;
+    float lead_track_pt = 0;
+    for (const auto track : xTau.tracks()){
+      if (track->pt() > lead_track_pt) {
+	lead_track_pt = track->pt();
+	lead_track = track;
+      }
+    }
+    if (lead_track != NULL) {
+      delta_z0 = lead_track->track()->z0() - xTrackParticle->z0();
+      delta_d0 = lead_track->track()->d0() - xTrackParticle->d0();
+    }
+
+    float nSiHits = (float)(n_pix_hits + n_sct_hits + n_pix_dead + n_sct_dead);
+    float nPiHits = (float)(n_pix_hits + n_pix_dead);
+    
+    // set the variables
+    setVar("jetSeedPt")     = xTau.ptJetSeed();
+    setVar("tauEta")        = xTau.eta();
+    setVar("dRJetSeedAxis") = xTrack.dRJetSeedAxis(xTau);
+    setVar("trackEta")      = xTrackParticle->eta();
+    setVar("delta_z0")      = delta_z0;
+    setVar("delta_d0")      = delta_d0;
+    setVar("nSiHits")       = nSiHits;
+    setVar("nPiHits")       = nPiHits;
+  }
+    
 
   return StatusCode::SUCCESS;
   
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
index 0142ec4d60dee0fa98938182b4b092cd323c574a..cc0bb7f8a4f8a462fa4057b813b45a2eb8df2025 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
@@ -1003,6 +1003,13 @@ StatusCode ISF_HitAnalysis::execute()
 
      float phi_MID;
 
+     std::vector<float> eta_vec_MID;
+                 std::vector<float> phi_vec_MID;
+                 std::vector<float> r_vec_MID;
+                 std::vector<float> z_vec_MID;
+
+     float phi_MID;
+
      for(int sample=CaloCell_ID_FCS::FirstSample;sample<CaloCell_ID_FCS::MaxSample;++sample)
                  {
                         ATH_MSG_DEBUG("sample "<<sample);
diff --git a/SweepRule/config.yaml b/SweepRule/config.yaml
index 1a989fcfda2389ce1a4f4a0768e70141ea31c9d0..1890f2a7a90f2bd940a56da1a840d0e286c0afa1 100644
--- a/SweepRule/config.yaml
+++ b/SweepRule/config.yaml
@@ -1,4 +1,4 @@
 sweep-targets:
-  '21.0':
+  '21.0-mc16d':
     '.*':
       - 'master'
diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx
index 563b68b3c8552843d9e3063d040befb228ab9364..d2a2fc05a7461bd3a3891bb4395095372796ef92 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx
+++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileDigitsContByteStreamCnv.cxx
@@ -75,6 +75,8 @@ StatusCode TileDigitsContByteStreamCnv::initialize() {
 
   CHECK( m_tool.retrieve() );
 
+  CHECK( m_tool.retrieve() );
+
   CHECK( m_robSvc.retrieve() );
 
   // create empty TileDigitsContainer and all collections inside
diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx
index 48b32f62990b905c13a59a31da94b54f483d2673..6048c4ea4cd28ba7ba38146de5fa1b4dda7f0d56 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx
+++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileRawChannelContByteStreamCnv.cxx
@@ -71,6 +71,8 @@ StatusCode TileRawChannelContByteStreamCnv::initialize() {
 
   CHECK( m_tool.retrieve() );
 
+  CHECK( m_tool.retrieve() );
+
   CHECK( m_robSvc.retrieve() );
 
   TileFragHash::TYPE type;
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index 43a9df2838f6ba133e90c5461976db4a84e2443d..58f7de9e1766e3df46c2a9e091fe0f7e4ba6b621 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -1250,7 +1250,17 @@ class athenaExecutor(scriptExecutor):
                         AtlasSetupDirectory = os.environ['AtlasSetup'],
                         asetupStatus        = asetup
                     )
-                    print >>wrapper, 'if [ ${?} != "0" ]; then exit 255; fi'
+                    print >>wrapper, 'if [ ${?} != "0" ]; then exit 255; fi '
+                    #check for TestArea if it exists then source setup.sh, used for local patches areas
+                    print >>wrapper, '#Need to check and source for  TestArea/build/cfgdir/setup.sh  '
+                    print >>wrapper, 'if [ ${TestArea} ]; then '
+                    print >>wrapper, '    cfgdir=`/bin/ls ${TestArea}/build/ | grep gcc` '
+                    print >>wrapper, '    if [ ${?} == "0" ]; then ' 
+                    print >>wrapper, '        echo "${TestArea}/build/${cfgdir} exist , will source setup.sh " '
+                    print >>wrapper, '        source ${TestArea}/build/${cfgdir}/setup.sh '
+                    print >>wrapper, '    fi '
+                    print >>wrapper, 'fi '
+
                 if dbsetup:
                     dbroot = path.dirname(dbsetup)
                     dbversion = path.basename(dbroot)
diff --git a/Tracking/TrkExtrapolation/TrkExTools/CMakeLists.txt b/Tracking/TrkExtrapolation/TrkExTools/CMakeLists.txt
index 703e5fb6b7d74cc603d82764e31b312fe42720c1..fbefa79a47da9d078016531f0ff153529fdacd97 100644
--- a/Tracking/TrkExtrapolation/TrkExTools/CMakeLists.txt
+++ b/Tracking/TrkExtrapolation/TrkExTools/CMakeLists.txt
@@ -25,7 +25,6 @@ atlas_depends_on_subdirs( PUBLIC
                           PRIVATE
                           Control/AthContainers
                           Control/CxxUtils
-                          Control/StoreGate
                           Tracking/TrkDetDescr/TrkDetDescrInterfaces
                           Tracking/TrkEvent/TrkEventUtils
                           Tracking/TrkEvent/TrkMaterialOnTrack
@@ -42,7 +41,7 @@ atlas_add_component( TrkExTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives EventPrimitives xAODTracking GaudiKernel TrkDetDescrUtils TrkGeometry TrkSurfaces TrkVolumes TrkEventPrimitives TrkNeutralParameters TrkParameters TrkExInterfaces TrkExUtils AthContainers CxxUtils StoreGateLib SGtests TrkDetDescrInterfaces TrkEventUtils TrkMaterialOnTrack TrkParticleBase TrkTrack )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives EventPrimitives xAODTracking GaudiKernel TrkDetDescrUtils TrkGeometry TrkSurfaces TrkVolumes TrkEventPrimitives TrkNeutralParameters TrkParameters TrkExInterfaces TrkExUtils AthContainers CxxUtils TrkDetDescrInterfaces TrkEventUtils TrkMaterialOnTrack TrkParticleBase TrkTrack )
 
 # Install files from the package:
 atlas_install_headers( TrkExTools )
diff --git a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NIMatEffUpdator.h b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NIMatEffUpdator.h
index e4e2eeeedd523a6730c01b0ce9fa04f8a50c8754..fe803c391127b2736681116b3d971e7c703ad2f0 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NIMatEffUpdator.h
+++ b/Tracking/TrkExtrapolation/TrkExTools/TrkExTools/NIMatEffUpdator.h
@@ -23,8 +23,6 @@
 #include "TrkExUtils/MaterialUpdateMode.h"
 #include "TrkDetDescrUtils/GeometrySignature.h" 
 
-class StoreGateSvc;
-
 class TTree;
   
 namespace Trk {
diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
index e970d004251373b0de7311cde0773a650ba189e0..616b13bde6f70a7ba406e1582a675be077d5b8f0 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Navigator.cxx
@@ -10,8 +10,6 @@
 #include "GaudiKernel/INTupleSvc.h"
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/SmartDataPtr.h"
-// StoreGate
-#include "StoreGate/StoreGateSvc.h"
 // Trk inlcudes
 #include "TrkExTools/Navigator.h"
 #include "TrkExInterfaces/IPropagator.h"
@@ -698,16 +696,9 @@ Trk::Navigator::trackingGeometry() const {
 StatusCode
 Trk::Navigator::updateTrackingGeometry() const {
   // -------------------- public TrackingGeometry (from DetectorStore) ----------------------------
-  // get the DetectorStore
-  StoreGateSvc *detectorStore = 0;
-  StatusCode s = service("DetectorStore", detectorStore);
 
-  if (s.isFailure()) {
-    ATH_MSG_FATAL("DetectorStore service not found!");
-    throw Trk::NavigatorException();
-  }
-
-  s = detectorStore->retrieve(m_trackingGeometry, m_trackingGeometryName);
+  StatusCode s = StatusCode::SUCCESS;
+  s = detStore()->retrieve(m_trackingGeometry, m_trackingGeometryName);
   if (s.isFailure()) {
     ATH_MSG_FATAL("Could not retrieve TrackingGeometry '" << m_trackingGeometryName << "' from DetectorStore.");
     ATH_MSG_FATAL("  - probably the chosen layout is not supported / no cool tag exists. ");
diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx
index dfd803bc1dadce16d33bd07fa731de0222491629..b250418597c5aed03297cd71c630ed31e1b91db6 100755
--- a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx
+++ b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx
@@ -1073,9 +1073,12 @@ MaterialAllocator::reallocateMaterial (std::list<FitMeasurement*>&	measurements,
     }              
 
 // correct track parameters for high momentum track (otherwise Eloss is too large)
-    trackParameters = (trackParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1],
-                                                              parameterVector[Trk::loc2],parameterVector[Trk::phi],
-                                                              parameterVector[Trk::theta],parameterVector[Trk::qOverP],0);
+    const TrackParameters* trackParametersTemp = (trackParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1],
+								  parameterVector[Trk::loc2],parameterVector[Trk::phi],
+								  parameterVector[Trk::theta],parameterVector[Trk::qOverP],0);
+
+    delete trackParameters;
+    trackParameters = trackParametersTemp;
 
     for (std::list<Trk::FitMeasurement*>::reverse_iterator r = measurements.rbegin();
 	 r != measurements.rend();
@@ -2677,9 +2680,11 @@ MaterialAllocator::spectrometerMaterial (std::list<FitMeasurement*>&	measurement
     }              
 
 // correct track parameters for high momentum track (otherwise Eloss is too large)
-    endParameters = (endParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1],
+    const TrackParameters* endParametersTemp = (endParameters->associatedSurface()).createTrackParameters(parameterVector[Trk::loc1],
                                                               parameterVector[Trk::loc2],parameterVector[Trk::phi],
                                                               parameterVector[Trk::theta],parameterVector[Trk::qOverP],0);
+    delete endParameters;
+    endParameters = endParametersTemp;
 
     if (entranceParameters)
     {
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ZScanSeedFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ZScanSeedFinder.cxx
index efe807c4d33c706f22e13ae6d2e6ab04a49dfdc6..39ef5d1fb082a90f544d30cdcaad541ae9a33aa1 100755
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ZScanSeedFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/ZScanSeedFinder.cxx
@@ -62,27 +62,27 @@ namespace Trk
   StatusCode ZScanSeedFinder::initialize() 
   { 
     if ( m_mode1dfinder.retrieve().isFailure() ) {
-      msg(MSG::FATAL) << "Failed to retrieve tool " << m_mode1dfinder << endreq;
+      ATH_MSG_FATAL("Failed to retrieve tool " << m_mode1dfinder);
       return StatusCode::FAILURE;
     } else if ( m_IPEstimator.retrieve().isFailure() ) {
-      msg(MSG::FATAL) << "Failed to retrieve tool " << m_IPEstimator << endreq;
+      ATH_MSG_FATAL("Failed to retrieve tool " << m_IPEstimator);
     } else {
-      msg(MSG::INFO)<< "Retrieved tools " << m_mode1dfinder << " and " << m_IPEstimator << endreq;
+      ATH_MSG_INFO("Retrieved tools " << m_mode1dfinder << " and " << m_IPEstimator);
     }
 
     if ( m_usePt && m_useLogPt )
     {
-      msg(MSG::FATAL) << "At most one of Pt and LogPt weighting may be selected" << endreq;
+      ATH_MSG_FATAL("At most one of Pt and LogPt weighting may be selected");
       return StatusCode::FAILURE;
     }
 
-    msg(MSG::INFO) << "Initialize successful" << endreq;
+    ATH_MSG_INFO("Initialize successful");
     return StatusCode::SUCCESS;
   }
 
   StatusCode ZScanSeedFinder::finalize() 
   {
-    msg(MSG::INFO) << "Finalize successful" << endreq;
+    ATH_MSG_INFO("Finalize successful");
     return StatusCode::SUCCESS;
   }
 
@@ -127,7 +127,7 @@ namespace Trk
       const xAOD::EventInfo* myEventInfo = 0;
       if (evtStore()->retrieve(myEventInfo).isFailure())
       {
-	  msg(MSG::ERROR) << "Failed to retrieve event information; clearing cached weights" << endreq;
+	  ATH_MSG_ERROR("Failed to retrieve event information; clearing cached weights");
 	  m_weightMap.clear();
 	  m_cachedRunNumber = 0;
 	  m_cachedEventNumber = 0;
@@ -151,7 +151,7 @@ namespace Trk
 	      ( (constraint != 0) && (constraint->position().x() != m_cachedConstraintX) ) ||
 	      ( (constraint != 0) && (constraint->position().y() != m_cachedConstraintY) ))
 	  {
-	    msg(MSG::DEBUG) << "Clearing cached weights due to new event and/or constraint" << endreq;
+	    ATH_MSG_DEBUG("Clearing cached weights due to new event and/or constraint");
 	    m_weightMap.clear();
 	    m_cachedRunNumber = ei_RunNumber;
 	    m_cachedEventNumber = ei_EventNumber;
@@ -179,7 +179,7 @@ namespace Trk
       const Perigee* iTrk = dynamic_cast<const Trk::Perigee*>(i);
       if (iTrk == 0)
       {
-	  msg(MSG::WARNING) << "Neutrals not supported for seeding. Rejecting track..." << endreq;
+	  ATH_MSG_WARNING("Neutrals not supported for seeding. Rejecting track...");
 	  continue;
       }
 
@@ -196,7 +196,7 @@ namespace Trk
 	{
 	  z0AndWeight.first = ipas->IPz0 + constraint->position().z();
 	    double chi2IP = std::pow(ipas->IPd0/ipas->sigmad0, 2);
-	    msg(MSG::VERBOSE) << "d0 from tool: " << ipas->IPd0 << " error: " << ipas->sigmad0 << " chi2: " << chi2IP << endreq;
+	    ATH_MSG_VERBOSE("d0 from tool: " << ipas->IPd0 << " error: " << ipas->sigmad0 << " chi2: " << chi2IP);
 	    if ( !m_disableAllWeights )
 	    {
 	      z0AndWeight.second = 1./(1.+exp(std::min((chi2IP-m_constraintcutoff)/m_constrainttemp, maxExpArg)));
@@ -208,7 +208,7 @@ namespace Trk
 	}
 	else
 	{
-	  if (constraint != 0) msg(MSG::WARNING) << "Unable to compute impact parameter significance; setting IPWeight = 1" << endreq;
+	  if (constraint != 0) ATH_MSG_WARNING("Unable to compute impact parameter significance; setting IPWeight = 1");
 	  z0AndWeight.first = iTrk->position()[Trk::z];
 	  z0AndWeight.second = 1.;
 	}
@@ -229,7 +229,7 @@ namespace Trk
 	// cache the result
 	m_weightMap[*iTrk] = z0AndWeight;
       }  // end of lookup/compute z0AndWeight
-      msg(MSG::DEBUG) << "Found position z: " << z0AndWeight.first << " with weight " << z0AndWeight.second << endreq;
+      ATH_MSG_DEBUG("Found position z: " << z0AndWeight.first << " with weight " << z0AndWeight.second);
 
       if (z0AndWeight.second >= 0.01)
       {
@@ -241,11 +241,11 @@ namespace Trk
     if ( ZPositions.size()>0 ) 
     {
 	ZResult=m_mode1dfinder->getMode(ZPositions);
-        msg(MSG::DEBUG)<< "Resulting mean Z position found: " << ZResult << endreq;
+        ATH_MSG_DEBUG("Resulting mean Z position found: " << ZResult);
     }
     else
     {
-      msg(MSG::DEBUG) << "No tracks with sufficient weight; return z position = 0" << endreq;
+      ATH_MSG_DEBUG("No tracks with sufficient weight; return z position = 0");
     }
 
     if (constraint)
@@ -259,7 +259,7 @@ namespace Trk
   std::vector<Amg::Vector3D> ZScanSeedFinder::findMultiSeeds(const std::vector<const Trk::Track*>& /* vectorTrk */,const xAOD::Vertex * /* constraint */) {
  
     //implemented to satisfy inheritance but this algorithm only supports one seed at a time
-    msg(MSG::WARNING) << "Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds" << endreq;
+    ATH_MSG_WARNING("Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
     return std::vector<Amg::Vector3D>(0);
 
   }
@@ -267,7 +267,7 @@ namespace Trk
   std::vector<Amg::Vector3D> ZScanSeedFinder::findMultiSeeds(const std::vector<const Trk::TrackParameters*>& /* perigeeList */,const xAOD::Vertex * /* constraint */) {
  
     //implemented to satisfy inheritance but this algorithm only supports one seed at a time
-    msg(MSG::WARNING) << "Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds" << endreq;
+    ATH_MSG_WARNING("Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
     return std::vector<Amg::Vector3D>(0);
 
   }
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigDetCalib/CMakeLists.txt
index b7488f113167863c120ce496e1c8be1b8d01ba1e..ff3e03b3bd75d2a159c17f0a728dab351a3c7831 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/CMakeLists.txt
@@ -21,7 +21,8 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigSteer/TrigSteering
                           Trigger/TrigT1/TrigT1Result
-                          Trigger/TrigTools/TrigTimeAlgs )
+                          Trigger/TrigTools/TrigTimeAlgs 
+                          Trigger/TrigEvent/TrigMuonEvent )
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
@@ -32,7 +33,7 @@ atlas_add_component( TrigDetCalib
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} IRegionSelector GaudiKernel TrigInDetEvent TrigSteeringEvent AthenaBaseComps AthenaKernel EventInfo TrkTrack TrigInterfacesLib TrigSteeringLib TrigT1Result TrigTimeAlgsLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} IRegionSelector GaudiKernel TrigInDetEvent TrigSteeringEvent AthenaBaseComps AthenaKernel EventInfo TrkTrack TrigInterfacesLib TrigSteeringLib TrigT1Result TrigTimeAlgsLib TrigMuonEvent)
 
 # Install files from the package:
 atlas_install_headers( TrigDetCalib )
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForMuons.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForMuons.cxx
index fe7a4de50cb7cc53581ff280faabeacd443172c0..4ea0e534b66791d2ed9cb82c0b7f6b399452a673 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForMuons.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForMuons.cxx
@@ -18,7 +18,7 @@ TrigCheckForMuons::TrigCheckForMuons(const std::string& name, ISvcLocator* pSvcL
     //m_clidSvc("ClassIDSvc", name),
     //m_types(), m_names(), m_momType(), m_clid(),
     m_robSelector("TrigROBSelector", this ),
-    m_addCTPResult(0), m_addHLTResult(0),
+    m_addCTPResult(1), m_addHLTResult(1),
     m_addOppositePhiRoI(false), m_addOppositeEtaPhiRoI(false),
     m_nRoIs(0),
     m_mindRSqr(0.01*0.01)
@@ -48,9 +48,17 @@ TrigCheckForMuons::TrigCheckForMuons(const std::string& name, ISvcLocator* pSvcL
 
 HLT::ErrorCode TrigCheckForMuons::hltInitialize()
 {
-  if (m_addCTPResult) m_trigResults.push_back(eformat::TDAQ_CTP);
-  if (m_addHLTResult)  m_trigResults.push_back(eformat::TDAQ_HLT);
-
+  msg() << MSG::INFO << "Initializing CPTResult "<<m_addCTPResult
+                     << " HLTResult "<< m_addHLTResult<< endmsg;
+  if (m_addCTPResult){
+    m_trigResults.push_back(eformat::TDAQ_CTP);
+    m_trigResults.push_back(eformat::TDAQ_MUON_CTP_INTERFACE);
+    msg() << MSG::INFO << " Will add TDAQ_CTP, TDAQ_MUON_CTP_INTERFACE to event record" << endmsg;
+  }
+  if (m_addHLTResult){
+    m_trigResults.push_back(eformat::TDAQ_HLT);
+    msg() << MSG::INFO << " Will add TDAQ_HLT to event record " << endmsg;
+  }
   return HLT::OK;
 }
 
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.cxx
index e28768d0d131ae3f64c87737f66e291494cc2be7..e29d0c03cafa3fbc7a8cf4058fe567772719e3dd 100755
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.cxx
@@ -48,9 +48,9 @@ TrigCheckForTracks::TrigCheckForTracks(const std::string& name, ISvcLocator* pSv
   declareProperty("eta_Width",    m_etaWidth = 0.1);
   declareProperty("etaEdge",      m_etaEdge = 5.0, "Upper limit of |eta| range");
   declareProperty("etaLowEdge",   m_etaLowEdge = 0.0, "Lower limit of |eta| range");
-  declareProperty("tracksName",   tracksName = "HLT_TrigFastTrackFinder_Tau");  
-  declareProperty("doNotPass",           doNotPass = false);        // pass through flag for initial beam items.
-  declareProperty("lookForAnyTracks",    lookForAnyTracks = false); // any vs isolated. any is needed for initial beam items.
+  declareProperty("tracksName",   m_tracksName = "HLT_TrigFastTrackFinder_Tau");  
+  declareProperty("doNotPass",           m_doNotPass = false);        // pass through flag for initial beam items.
+  declareProperty("lookForAnyTracks",    m_lookForAnyTracks = false); // any vs isolated. any is needed for initial beam items.
   declareProperty("AddCTPResult", m_addCTPResult = false, "Add the CTP result to the list of ROBs");
   declareProperty("AddL2Result",  m_addL2Result = false,  "Add the L2 result to the list of ROBs");
   declareProperty("AddEFResult",  m_addEFResult = false,  "Add the EF result to the list of ROBs");
@@ -66,7 +66,7 @@ TrigCheckForTracks::TrigCheckForTracks(const std::string& name, ISvcLocator* pSv
   declareMonitoredStdContainer("phi_tracks",     m_phi);
   declareMonitoredStdContainer("eta_tracks_ISO", m_ROB_eta);
   declareMonitoredStdContainer("phi_tracks_ISO", m_ROB_phi);
-  declareMonitoredVariable("iso_Tracks",         n_IsoTracks);
+  declareMonitoredVariable("iso_Tracks",         m_n_IsoTracks);
 
 }
 
@@ -82,8 +82,8 @@ HLT::ErrorCode TrigCheckForTracks::hltInitialize()
   // Initialize timing service
   //------------------------------
   if( service( "TrigTimerSvc", m_timerSvc).isFailure() ) {
-    msg() << MSG::WARNING << name()
-	<< ": Unable to locate TrigTimer Service" << endmsg;
+    ATH_MSG_WARNING( name()
+                     << ": Unable to locate TrigTimer Service"  );
   }
   if (m_timerSvc)    
     m_timers.push_back(m_timerSvc->addItem("TrigCheckForTracks.TrigCheckForTracksTot"));
@@ -111,7 +111,7 @@ HLT::ErrorCode TrigCheckForTracks::hltBeginRun()
 HLT::ErrorCode TrigCheckForTracks::hltFinalize(){
 // ----------------------------------------------------------------------
 
-  msg() << MSG::INFO << "Events accepted/rejected/errors:  "<< m_acceptedEvts <<" / "<< m_rejectedEvts << " / "<< m_errorEvts << endmsg;
+  ATH_MSG_INFO( "Events accepted/rejected/errors:  "<< m_acceptedEvts <<" / "<< m_rejectedEvts << " / "<< m_errorEvts  );
   return HLT::OK;
 }
 
@@ -121,23 +121,18 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 // ----------------------------------------------------------------------
 
   if (m_executedEvent) {
-    if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "*** Not Executing this TrigCheckForTracks " << name() << ", already executed"  << endmsg;
-    }
-
+    ATH_MSG_DEBUG( "*** Not Executing this TrigCheckForTracks " << name() << ", already executed"   );
     return HLT::OK;
   }
 
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "***  Executing this TrigCheckForTracks : " << name() << endmsg;
-  }
+  ATH_MSG_DEBUG( "***  Executing this TrigCheckForTracks : " << name()  );
 
 
   //--> PEB Related Stuff
 
   PartialEventBuildingInfo* pebInfo = config()->getPEBI();
   if(!pebInfo){
-    if (msgLvl() <= MSG::DEBUG) msg() << "*** Not Executing this TrigCheckForTracks " << name() << ", not a calib chain" << endmsg;
+    ATH_MSG_DEBUG( "*** Not Executing this TrigCheckForTracks " << name() << ", not a calib chain" );
     return HLT::OK;
   }
   //--< PEB Related Stuff
@@ -161,34 +156,25 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 
   const TrackCollection* tracks = 0;
 
-  if (evtStore()->transientContains<TrackCollection>(tracksName)) {
-    if (msgLvl() <= MSG::DEBUG ) {
-      msg()  << MSG::DEBUG << "*** TrackCollection with name "<< tracksName <<" found in StoreGate (transientContains)" << endmsg;
-    }
+  if (evtStore()->transientContains<TrackCollection>(m_tracksName)) {
+    ATH_MSG_DEBUG( MSG::DEBUG << "*** TrackCollection with name "<< m_tracksName <<" found in StoreGate (transientContains)"  );
   }
   else {
-    if (msgLvl() <= MSG::DEBUG ) {
-      msg()  << MSG::DEBUG << "*** No TrackCollection with name" << tracksName << " found in StoreGate (transientContains)" << endmsg;
-    }
+    ATH_MSG_DEBUG( "*** No TrackCollection with name" << m_tracksName << " found in StoreGate (transientContains)"  );
     return HLT::OK;
   }
   
-  StatusCode sc = evtStore()->retrieve(tracks,tracksName);
+  StatusCode sc = evtStore()->retrieve(tracks,m_tracksName);
   
-  msg()  << MSG::DEBUG << "***** Status code: "<< sc << " for key: " << tracksName << endmsg;
+  ATH_MSG_DEBUG( "***** Status code: "<< sc << " for key: " << m_tracksName  );
 
   if (sc.isFailure()) {
-    if (msgLvl() <= MSG::DEBUG ) {
-      msg()  << MSG::DEBUG << "No TrackCollection with name "<<tracksName<<" found in StoreGate" << endmsg;
-    }
+    ATH_MSG_DEBUG( "No TrackCollection with name "<<m_tracksName<<" found in StoreGate"  );
     m_errorEvts++;
     m_rejectedEvts++;
   } else {
-    if (msgLvl() <= MSG::DEBUG ) {
-      msg()  << MSG::DEBUG << "TrackCollection with name "<<tracksName<<" found in StoreGate" << endmsg;
-      msg()  << MSG::DEBUG << "Retrieved "<< tracks->size() <<" reconstructed tracks from StoreGate" << endmsg;
-    }
-    
+    ATH_MSG_DEBUG( "TrackCollection with name "<<m_tracksName<<" found in StoreGate"  );
+    ATH_MSG_DEBUG( "Retrieved "<< tracks->size() <<" reconstructed tracks from StoreGate"  );
 
     // Have found tracks...
     // Now loop over the tracks to find the isolated ones.
@@ -216,7 +202,7 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 	  
 	  bool gotIsoTrack = true;
 	  
-	  if (!lookForAnyTracks) 
+	  if (!m_lookForAnyTracks) 
 	    {
 
 	      for (TrackCollection::const_iterator jt = tracks->begin(); jt!=tracks->end(); ++jt)
@@ -225,8 +211,6 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 
 		  const Trk::Perigee *jp = (*jt)->perigeeParameters();
 		  
-		  //	      msg() << MSG::INFO << "pT " << jp->pT() << " eta " << jp->eta() << endmsg;
-		  
 
 		  double dphi = fabs(ip->parameters()[Trk::phi] - jp->parameters()[Trk::phi]);
 		  if(dphi>M_PI) dphi = 2*M_PI-dphi;
@@ -234,8 +218,6 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 		  double dR = sqrt(pow((ip->eta() - jp->eta()),2) + pow(dphi,2));
 		  m_dR.push_back(dR);
 		  
-		  //	      msg() << MSG::INFO << "DR Tracks " << dR << endmsg; 
-		  
 		  if ((fabs(jp->pT()) > m_pT_min_iso) && (dR > m_dR0_overlap) && (dR < m_dR0 ) ) {
 		    gotIsoTrack = false;	      
 		    continue;
@@ -260,10 +242,10 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 	    while (phiMIN < 0)      phiMIN += 2*M_PI;
 	    while (phiMAX > 2*M_PI) phiMAX -= 2*M_PI;
 	    
-	    TrigRoiDescriptor _roi( ip->eta(), etaMIN, etaMAX, ip->parameters()[Trk::phi], phiMIN, phiMAX );
+	    TrigRoiDescriptor roi( ip->eta(), etaMIN, etaMAX, ip->parameters()[Trk::phi], phiMIN, phiMAX );
 
 	    // now add ROBs
-	    HLT::ErrorCode ec = m_robSelector->fillPEBInfo(*pebInfo, _roi, &m_dets, &m_nROBs);
+	    HLT::ErrorCode ec = m_robSelector->fillPEBInfo(*pebInfo, roi, &m_dets, &m_nROBs);
 	    if (ec != HLT::OK) return ec;
 	    
 	    
@@ -274,7 +256,7 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
             if(m_trigResults.size()!=0)
                 pebInfo->addSubDetector(m_trigResults);
 
-	    if (!doNotPass){
+	    if (!m_doNotPass){
 	      //generate output here
 	      //addRoI(output);
               HLT::TriggerElement* te = addRoI(output);
@@ -286,8 +268,8 @@ HLT::ErrorCode TrigCheckForTracks::hltExecute(std::vector<std::vector<HLT::Trigg
 	}
     
       m_acceptedEvts++;
-      n_IsoTracks = count_IsoTracks ;  
-      msg() << MSG::DEBUG << "Found "<< n_IsoTracks <<" Isolated ("<< lookForAnyTracks  <<") Tracks" << endmsg;
+      m_n_IsoTracks = count_IsoTracks ;  
+      ATH_MSG_DEBUG( "Found "<< m_n_IsoTracks <<" Isolated ("<< m_lookForAnyTracks  <<") Tracks"  );
     }
     else {
       m_rejectedEvts++;
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.h b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.h
index 698210574ce8bb4f68f43aac76127c6c7baaee3f..3e15cf1273d39b93b7984c9a6480dc0120cf41f5 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.h
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigCheckForTracks.h
@@ -60,7 +60,7 @@ ToolHandle<ITrigROBSelector> m_robSelector;
 
   // Switch on Monitoring:
 
-  int                           n_IsoTracks ;
+  int                           m_n_IsoTracks ;
   std::vector<double>           m_pT ;
   std::vector<double>           m_pT_Iso ;
   std::vector<double>           m_dR ;
@@ -80,9 +80,9 @@ ToolHandle<ITrigROBSelector> m_robSelector;
   double           m_etaLowEdge ;
   double           m_etaWidth ;
   double           m_phiWidth ;
-  std::string      tracksName ;
-  bool             doNotPass ;
-  bool             lookForAnyTracks ;
+  std::string      m_tracksName ;
+  bool             m_doNotPass ;
+  bool             m_lookForAnyTracks ;
 
   
   std::string m_pebLabel;
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.cxx
index 14c2a7964bfe9325b4975c097acc3b09aece489b..d97e13056f2ca3fabb698c0c87f2b98a7b7f986b 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.cxx
@@ -20,6 +20,7 @@ TrigL1CaloOverflow::TrigL1CaloOverflow(const std::string& name, ISvcLocator* pSv
   declareProperty("ignoreAbortGap", m_ignoreAbortGap = true, "Ignore overflows in abort gap");
   declareProperty("acceptCMXOverflows", m_acceptCMXOverflows = true, "Accept CMX overflows");
   declareProperty("acceptCaloRoIBOverflows", m_acceptCaloRoIBOverflows = true, "Accept Calo RoIB overflows");
+  declareProperty("acceptLvl1ConsistencyProblems", m_acceptLvl1Consist = true, "Accept events with problems in the Lvl1 consistency checker");
 }
 
 HLT::ErrorCode TrigL1CaloOverflow::hltInitialize()
@@ -64,6 +65,16 @@ HLT::ErrorCode TrigL1CaloOverflow::hltExecute(std::vector<std::vector<HLT::Trigg
     }
   }
   
+  // Events with issues in the consistency checker (not strictly overflows, see ATR-14607)
+  if (m_acceptLvl1Consist) {
+    HLT::ErrorCode ec = config()->getLvlConverterStatus();
+    if ( ec.reason()==HLT::Reason::MISSING_FEATURE &&
+         ec.steeringInternalReason()==HLT::SteeringInternalReason::MISSING_CALO_ROI ) {   // see Lvl1ConsistencyChecker.cxx
+      addRoI(output)->setActiveState(true);
+      ATH_MSG_DEBUG("Event has Lvl1 consistency checker problems");
+    }
+  }
+
   afterExecMonitors().ignore();
   return HLT::OK;
 }
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.h b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.h
index f66de6c1284198199dfddf924a3a74387510d6e2..09d5cb996e0d297217a5e015a75748c29e18232f 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.h
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigL1CaloOverflow.h
@@ -32,6 +32,7 @@ private:
   bool m_ignoreAbortGap;
   bool m_acceptCMXOverflows;
   bool m_acceptCaloRoIBOverflows;
+  bool m_acceptLvl1Consist;
 };
 
 
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBListWriter.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBListWriter.cxx
index 3d0ef968a86b7cf885edefa8e0957243e1e80f11..f4c295858c70de037d2f7fa27e6a5821527a2187 100755
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBListWriter.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBListWriter.cxx
@@ -124,10 +124,10 @@ HLT::ErrorCode TrigROBListWriter::hltExecute(const HLT::TriggerElement* te_in,
   while (phiMin < 0)      phiMin += 2*M_PI;
   while (phiMax > 2*M_PI) phiMax -= 2*M_PI;  // AH HA!! This is wrong! Need in the range -pi .. pi
   
-  TrigRoiDescriptor _roi( roIDescriptor->eta(), etaMin, etaMax, roIDescriptor->phi(), phiMin, phiMax );
+  TrigRoiDescriptor roi( roIDescriptor->eta(), etaMin, etaMax, roIDescriptor->phi(), phiMin, phiMax );
 
   // now add ROBs
-  HLT::ErrorCode ec = m_robSelector->fillPEBInfo(*pebInfo, _roi, &m_dets, &m_nROBs);
+  HLT::ErrorCode ec = m_robSelector->fillPEBInfo(*pebInfo, roi, &m_dets, &m_nROBs);
   if (ec != HLT::OK) return ec;
 
   // Add extra ROBs
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigSubDetListWriter.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigSubDetListWriter.cxx
index ae4de334297315e36c90b222417adf77aa9faebc..28320761eb5f9a217522bbd7c0583638e3aec33b 100755
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigSubDetListWriter.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigSubDetListWriter.cxx
@@ -79,47 +79,41 @@ HLT::ErrorCode TrigSubDetListWriter::hltInitialize()
 
   for(std::vector<std::string>::iterator detit = m_detId.begin(); detit != m_detId.end(); ++detit){
      //if (m_detSpec.find("HLTResult") != std::string::npos) {
-     if (*detit=="HLTResult") {
+     if (*detit=="RPC") { 
+        m_sourceid.push_back(eformat::MUON_RPC_BARREL_A_SIDE);
+        m_sourceid.push_back(eformat::MUON_RPC_BARREL_C_SIDE);
+     } else if (*detit=="HLTResult") {
         m_sourceid.push_back(eformat::TDAQ_HLT);
         m_sourceid.push_back(eformat::TDAQ_CTP);
-     }
-     if (*detit=="L2EFResult") {
+     } else if (*detit=="TDAQ_HLT") {
+        m_sourceid.push_back(eformat::TDAQ_HLT);
+     } else if (*detit=="L2EFResult") {
         m_sourceid.push_back(eformat::TDAQ_LVL2);
         m_sourceid.push_back(eformat::TDAQ_EVENT_FILTER);
         m_sourceid.push_back(eformat::TDAQ_CTP);
-     }
-     if (*detit=="TDAQ_LVL2") {
+     } else if (*detit=="TDAQ_LVL2") {
         m_sourceid.push_back(eformat::TDAQ_LVL2);
-     }
-     if (*detit=="TDAQ_EVENT_FILTER") {
+     } else if (*detit=="TDAQ_EVENT_FILTER") {
         m_sourceid.push_back(eformat::TDAQ_EVENT_FILTER);
-     }
-     if (*detit=="TDAQ_CTP") {
+     } else if (*detit=="TDAQ_CTP") {
         m_sourceid.push_back(eformat::TDAQ_CTP);
-     }
-     if (*detit=="TDAQ_SFI") {
+     } else if (*detit=="TDAQ_SFI") {
         m_sourceid.push_back(eformat::TDAQ_SFI);
-     }
-     if (*detit=="TDAQ_SFO") {
+     } else if (*detit=="TDAQ_SFO") {
         m_sourceid.push_back(eformat::TDAQ_SFO);
-     }
-     if (*detit=="TDAQ_CALO") {
+     } else if (*detit=="TDAQ_CALO" || *detit=="TDAQ_L1CALO") {
         m_sourceid.push_back(eformat::TDAQ_CALO_PREPROC);
         m_sourceid.push_back(eformat::TDAQ_CALO_CLUSTER_PROC_DAQ);
         m_sourceid.push_back(eformat::TDAQ_CALO_CLUSTER_PROC_ROI);
         m_sourceid.push_back(eformat::TDAQ_CALO_JET_PROC_DAQ);
         m_sourceid.push_back(eformat::TDAQ_CALO_JET_PROC_ROI);
-     }
-     if (*detit=="TDAQ_MUON") {     
+     } else if (*detit=="TDAQ_MUON") {     
          m_sourceid.push_back(eformat::TDAQ_MUON_CTP_INTERFACE);
-     }
-     if (*detit=="TDAQ_BEAM_CRATE") {     
+     } else if (*detit=="TDAQ_BEAM_CRATE") {     
          m_sourceid.push_back(eformat::TDAQ_BEAM_CRATE);
-     }
-      if (*detit=="TDAQ_L2SV") {     
+     } else if (*detit=="TDAQ_L2SV") {     
          m_sourceid.push_back(eformat::TDAQ_L2SV);
-     }
-     if (*detit=="InnerDetector") {
+     } else if (*detit=="InnerDetector") {
         m_sourceid.push_back(eformat::PIXEL_IBL);
         m_sourceid.push_back(eformat::PIXEL_BARREL);
         m_sourceid.push_back(eformat::PIXEL_DISK);
@@ -133,8 +127,7 @@ HLT::ErrorCode TrigSubDetListWriter::hltInitialize()
         m_sourceid.push_back(eformat::TRT_BARREL_C_SIDE);
         m_sourceid.push_back(eformat::TRT_ENDCAP_A_SIDE);
         m_sourceid.push_back(eformat::TRT_ENDCAP_C_SIDE);
-     }
-     if (*detit=="SiOnly") {
+     } else if (*detit=="SiOnly") {
         m_sourceid.push_back(eformat::PIXEL_IBL);
         m_sourceid.push_back(eformat::PIXEL_BARREL);
         m_sourceid.push_back(eformat::PIXEL_DISK);
@@ -143,20 +136,16 @@ HLT::ErrorCode TrigSubDetListWriter::hltInitialize()
         m_sourceid.push_back(eformat::SCT_BARREL_C_SIDE);
         m_sourceid.push_back(eformat::SCT_ENDCAP_A_SIDE);
         m_sourceid.push_back(eformat::SCT_ENDCAP_C_SIDE);
-     }
-     if (*detit=="DBM") {
+     } else if (*detit=="DBM") {
         m_sourceid.push_back(eformat::PIXEL_DBM);
-		 }
-     if (*detit=="IBL") {
+		 } else if (*detit=="IBL") {
         m_sourceid.push_back(eformat::PIXEL_IBL);
-		 }
-     if (*detit=="Pixel") {
+		 } else if (*detit=="Pixel") {
         m_sourceid.push_back(eformat::PIXEL_IBL);
         m_sourceid.push_back(eformat::PIXEL_BARREL);
         m_sourceid.push_back(eformat::PIXEL_DISK);
         m_sourceid.push_back(eformat::PIXEL_B_LAYER);
-     }
-     if (*detit=="Muons") {
+     } else if (*detit=="Muons") {
         m_sourceid.push_back(eformat::MUON_ANCILLARY_CRATE);
         m_sourceid.push_back(eformat::MUON_MDT_BARREL_A_SIDE);
         m_sourceid.push_back(eformat::MUON_MDT_BARREL_C_SIDE);
@@ -169,19 +158,16 @@ HLT::ErrorCode TrigSubDetListWriter::hltInitialize()
         m_sourceid.push_back(eformat::MUON_CSC_ENDCAP_A_SIDE);
         m_sourceid.push_back(eformat::MUON_CSC_ENDCAP_C_SIDE);
         m_sourceid.push_back(eformat::TDAQ_MUON_CTP_INTERFACE);
-     }
-     if (*detit=="CSC") {
+     } else if (*detit=="CSC") {
        m_sourceid.push_back(eformat::MUON_CSC_ENDCAP_A_SIDE);
        m_sourceid.push_back(eformat::MUON_CSC_ENDCAP_C_SIDE);
-     }                            
-     if (*detit=="Tile") {
+     } else if (*detit=="Tile") {
         m_sourceid.push_back(eformat::TILECAL_LASER_CRATE);
         m_sourceid.push_back(eformat::TILECAL_BARREL_A_SIDE);
         m_sourceid.push_back(eformat::TILECAL_BARREL_C_SIDE);
         m_sourceid.push_back(eformat::TILECAL_EXT_A_SIDE);
         m_sourceid.push_back(eformat::TILECAL_EXT_C_SIDE);
-     }
-     if (*detit=="LAr") {
+     } else if (*detit=="LAr") {
         m_sourceid.push_back(eformat::LAR_EM_BARREL_A_SIDE);
         m_sourceid.push_back(eformat::LAR_EM_BARREL_C_SIDE);
         m_sourceid.push_back(eformat::LAR_EM_ENDCAP_A_SIDE);
@@ -190,22 +176,20 @@ HLT::ErrorCode TrigSubDetListWriter::hltInitialize()
         m_sourceid.push_back(eformat::LAR_FCAL_C_SIDE);
         m_sourceid.push_back(eformat::LAR_HAD_ENDCAP_A_SIDE);
         m_sourceid.push_back(eformat::LAR_HAD_ENDCAP_C_SIDE);
-     }
-     if (*detit=="FORWARD_BCM") {     
+     } else if (*detit=="FORWARD_BCM") {     
          m_sourceid.push_back(eformat::FORWARD_BCM);
-     }
-     if (*detit=="FORWARD_LUCID") {     
+     } else if (*detit=="FORWARD_LUCID") {     
          m_sourceid.push_back(eformat::FORWARD_LUCID);
-     }
-     if (*detit=="FORWARD_ZDC") {     
+     } else if (*detit=="FORWARD_ZDC") {     
          m_sourceid.push_back(eformat::FORWARD_ZDC);
-     }
-     if (*detit=="FORWARD_ALPHA") {     
+     } else if (*detit=="FORWARD_ALPHA") {     
          m_sourceid.push_back(eformat::FORWARD_ALPHA);
-     }
-     if (*detit=="FORWARD_AFP") {     
+     } else if (*detit=="FORWARD_AFP") {     
          m_sourceid.push_back(eformat::FORWARD_AFP);
+     } else {
+         ATH_MSG_ERROR("Unknown detector ID for partial event building:" << *detit << ". Please update TrigSubSetListWriter.");
      }
+
   }
 
   if (m_detSpec.find("ID") != std::string::npos) {
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/python/TrigEFMissingETConfig.py b/Trigger/TrigAlgorithms/TrigEFMissingET/python/TrigEFMissingETConfig.py
index 8bfeec71d230c122539685b8258f80c93e4f41a8..5c5afddbef3630dd2b7f432fcf18adbd713d6aa8 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/python/TrigEFMissingETConfig.py
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/python/TrigEFMissingETConfig.py
@@ -1463,6 +1463,53 @@ class EFMissingET_Fex_TrackAndJets (EFMissingETBase):
 
         self.AthenaMonTools = [ validation, online, cosmic]
 
+##### loop over tracks and jets #####
+class EFMissingET_Fex_FTKTrackAndJets (EFMissingETBase):
+    __slots__ = []
+    def __init__ (self, name="EFMissingET_Fex_FTKTrackAndJets"):
+        super(EFMissingET_Fex_FTKTrackAndJets, self).__init__(name)
+
+        # name of TrigMissingET object
+        self.MissingETOutputKey = "TrigEFMissingET_trkmhtFTK"
+        self.doJets = True
+        self.doTracks = True
+
+        # tools
+        febTool    = EFMissingETFromFEBHeader("TheFEBTool")
+        jetTool    = EFMissingETFromTrackAndJets("TheTrackAndJetTool")
+        flagTool   = EFMissingETFlags("TheFlagsTool")
+        helperTool = EFMissingETFromHelper("TheHelperTool")
+        #
+        febTool.ParentFexName = name
+        jetTool.ParentFexName = name
+        flagTool.ParentFexName = name
+        helperTool.ParentFexName = name
+        #
+
+        ## Configuration of jet fex
+        jetTool.EtaSeparation = 2.2
+        jetTool.CentralpTCut = 25 #GeV
+        jetTool.ForwardpTCut = 0.0
+        jetTool.TrackpTCut = 1 #GeV
+        jetTool.CentralJetJVTCut = 0.9
+        jetTool.TrackSelectionTool.CutLevel = "Loose"
+        jetTool.TrackSelectionTool.maxZ0SinTheta = 1.5
+        jetTool.TrackSelectionTool.maxD0overSigmaD0 = 3
+
+        ## chain of tools
+        self.Tools = []
+        self.Tools += [ jetTool ]
+        self.Tools += [ flagTool ]
+        self.Tools += [ helperTool ]
+
+        from TrigEFMissingET.TrigEFMissingETMonitoring import TrigEFMissingETValidationMonitoring_alt, TrigEFMissingETOnlineMonitoring_alt, TrigEFMissingETCosmicMonitoring_alt
+        validation = TrigEFMissingETValidationMonitoring_alt()
+        online = TrigEFMissingETOnlineMonitoring_alt()
+        cosmic = TrigEFMissingETCosmicMonitoring_alt()
+
+        self.AthenaMonTools = [ validation, online, cosmic]
+
+
 ##### THE DEFAULT FEX #####
 class EFMissingET_Fex (EFMissingET_Fex_2sidednoiseSupp):
     __slots__ = []
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersPUC.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersPUC.cxx
index 7743b3abdcb42246722beefdd1c44e765637a444..fbafc1320f3301140cfb239de039ee14b05809cd 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersPUC.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersPUC.cxx
@@ -222,6 +222,8 @@ StatusCode EFMissingETFromClustersPUC::execute(xAOD::TrigMissingET * /* met */ ,
       VarEtTower += term;
     }
     VarEtTower *= 1.0/m_ntowers;
+    // Set a minimum value to avoid FPEs
+    if (VarEtTower < 1.0e6) VarEtTower = 1.0e6;
     ptmin_final = EtTowerTrimMean + m_nsigma*sqrt(VarEtTower);
     
     // find binning that gives largest sumEt from bins above threshold
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
index 918db58fdf81964acaa30238cc63666b74bf0a9f..f9da70835ae257769e6761176bf51c07163928d7 100644
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
@@ -143,6 +143,7 @@ from TriggerMenu.egamma.EgammaSliceFlags import EgammaSliceFlags
 from egammaMVACalib import egammaMVACalibConf 
 mlog.info("MVA version version %s"%EgammaSliceFlags.calibMVAVersion() )
 mlog.info("Cluster Correction version %s"%EgammaSliceFlags.clusterCorrectionVersion() )
+EgammaSliceFlags.calibMVAVersion.set_On()
 TrigEgammaMVACalibTool = ToolFactory(egammaMVACalibConf.egammaMVATool,name="TrigEgammaMVACalibTool",
         folder=EgammaSliceFlags.calibMVAVersion(),use_layer_corrected = False)
 
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/TrigFastTrackFinder/TrigFastTrackFinder.h b/Trigger/TrigAlgorithms/TrigFastTrackFinder/TrigFastTrackFinder/TrigFastTrackFinder.h
index 3d51a42875c19fdf4b7e9e36749648dacc5f7a27..c08bd67809fe199d223213d49e420cdb05380898 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/TrigFastTrackFinder/TrigFastTrackFinder.h
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/TrigFastTrackFinder/TrigFastTrackFinder.h
@@ -137,7 +137,7 @@ protected:
   float m_tripletMinPtFrac;
   float m_pTmin;
   float m_initialD0Max;
-
+  float m_Z0Max;                        
   bool m_checkSeedRedundancy;
 
   // Names of IDCs with input data 
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinderMT_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinderMT_Config.py
index 5958268caeff395551fd7a1882cb9d778dc52945..14e0fb675471b0c9996a57739bfd491e617808d9 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinderMT_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinderMT_Config.py
@@ -52,7 +52,10 @@ class TrigFastTrackFinderMTBase(TrigFastTrackFinderMT):
           self.doSeedRedundancyCheck = InDetTrigSliceSettings[('checkRedundantSeeds',remapped_type)]
           self.Triplet_D0Max        = InDetTrigSliceSettings[('d0SeedMax',remapped_type)]
           self.Triplet_D0_PPS_Max   = InDetTrigSliceSettings[('d0SeedPPSMax',remapped_type)] 
-          self.TrackInitialD0Max   = InDetTrigSliceSettings[('d0TrackInitialMax',remapped_type)] 
+          self.TrackInitialD0Max = 20.
+          if remapped_type=='cosmics':
+            self.TrackInitialD0Max = 1000.
+            self.TrackZ0Max   = 1000.
           self.TripletDoPSS   = False
           self.pTmin = InDetTrigSliceSettings[('pTmin',remapped_type)]
           self.DoubletDR_Max = InDetTrigSliceSettings[('dRdoubletMax',remapped_type)]
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index 094365f5d659a46da4c25128f3ee92d492e30038..82bebcd7fd188bc0cf27c3a104d1f2ad676f1894 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
@@ -487,7 +487,11 @@ class TrigFastTrackFinderBase(TrigFastTrackFinder):
           self.doSeedRedundancyCheck = InDetTrigSliceSettings[('checkRedundantSeeds',remapped_type)]
           self.Triplet_D0Max        = InDetTrigSliceSettings[('d0SeedMax',remapped_type)]
           self.Triplet_D0_PPS_Max   = InDetTrigSliceSettings[('d0SeedPPSMax',remapped_type)] 
-          self.TrackInitialD0Max   = InDetTrigSliceSettings[('d0TrackInitialMax',remapped_type)] 
+          self.TrackInitialD0Max = 20.
+          if remapped_type=='cosmics':
+            self.TrackInitialD0Max = 1000.
+            self.TrackZ0Max   = 1000.
+
           self.TripletDoPSS   = False
           self.pTmin = InDetTrigSliceSettings[('pTmin',remapped_type)]
           self.DoubletDR_Max = InDetTrigSliceSettings[('dRdoubletMax',remapped_type)]
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
index 4d5f5926615260b6692ad150787a129ed067601e..74a978ca02d322b2ece33ec9047fb13b8f774794 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx
@@ -149,6 +149,7 @@ TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* p
   declareProperty("Triplet_MinPtFrac",        m_tripletMinPtFrac = 0.3);
   declareProperty("pTmin",                    m_pTmin = 1000.0);
   declareProperty("TrackInitialD0Max",            m_initialD0Max      = 10.0);
+  declareProperty("TrackZ0Max",                   m_Z0Max      = 300.0);
 
   declareProperty("doSeedRedundancyCheck",            m_checkSeedRedundancy = false);
 
@@ -766,9 +767,9 @@ HLT::ErrorCode TrigFastTrackFinder::hltExecute(const HLT::TriggerElement* /*inpu
         if((*t)) {
           float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[Trk::d0]; 
           if (fabs(d0) > m_initialD0Max) {
-            ATH_MSG_DEBUG("REGTEST / Reject track with d0 = " << d0 << " > " << m_initialD0Max);
-            qualityTracks.push_back(std::make_tuple(false,0,(*t)));//Flag track as bad, but keep in vector for later deletion
-            continue;
+	     ATH_MSG_DEBUG("REGTEST / Reject track with d0 = " << d0 << " > " << m_initialD0Max);
+	     qualityTracks.push_back(std::make_tuple(false,0,(*t)));//Flag track as bad, but keep in vector for later deletion
+	     continue;
           }
           if(m_checkSeedRedundancy) {
             //update clusterMap 
@@ -855,11 +856,28 @@ HLT::ErrorCode TrigFastTrackFinder::hltExecute(const HLT::TriggerElement* /*inpu
       ATH_MSG_DEBUG("REGTEST / No tracks fitted");
     }
 
-    for (auto fittedTrack = fittedTracks->begin(); fittedTrack!=fittedTracks->end(); ++fittedTrack) {
+    size_t counter(1);
+    for (auto fittedTrack = fittedTracks->begin(); fittedTrack!=fittedTracks->end(); ) {
+      if ((*fittedTrack)->perigeeParameters()){
+	float d0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::d0]; 
+	float z0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::z0]; 
+	if (fabs(d0) > m_initialD0Max || fabs(z0) > m_Z0Max) {
+	  ATH_MSG_WARNING("REGTEST / Reject track after fit with d0 = " << d0 << " z0= "  << z0
+			  << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")");
+	  ATH_MSG_DEBUG(**fittedTrack);
+	  fittedTrack = fittedTracks->erase(fittedTrack);
+	  continue;
+	}
+
+      } 
+
       (*fittedTrack)->info().setPatternRecognitionInfo(Trk::TrackInfo::FastTrackFinderSeed);
-      ATH_MSG_VERBOSE("Updating fitted track: " << **fittedTrack);
+      ATH_MSG_VERBOSE("Updating fitted track: " << counter);
+      ATH_MSG_VERBOSE(**fittedTrack);
       m_trackSummaryTool->updateTrack(**fittedTrack);
-      ATH_MSG_VERBOSE("Updated track: " << **fittedTrack);
+      ATH_MSG_VERBOSE("Updated track: " << counter);
+      ATH_MSG_VERBOSE(**fittedTrack);
+      counter++; fittedTrack++;
     }
 
     if ( timerSvc() ) { 
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx
index bbbac4d8640e249011809758018901e661ae0ec4..c8325c0a6880eac234035ca61be517609f590072 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx
@@ -6,6 +6,7 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IIncidentSvc.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
+#include "IRegionSelector/IRegSelSvc.h"
 
 namespace PESA
 {
@@ -16,12 +17,18 @@ namespace PESA
       m_etaHalfWidth(0.),
       m_phiHalfWidth(0.),
       m_zHalfWidth(0.),
+      m_regionSelector("RegSelSvc", name),
+      m_requestPIXRobs(true),
+      m_requestSCTRobs(true),
       m_monitorDuplicateRoIs(true),
       m_invocations(0),
       m_duplicateRoIs(0)
   {
     declareProperty("EtaHalfWidth",           m_etaHalfWidth);
     declareProperty("PhiHalfWidth",           m_phiHalfWidth);
+    declareProperty("RegionSelectorTool",     m_regionSelector);
+    declareProperty("RequestPIXRobs",         m_requestPIXRobs);
+    declareProperty("RequestSCTRobs",         m_requestSCTRobs);
     declareProperty("MonitorDuplicateRoIs",   m_monitorDuplicateRoIs);
 
     m_inpPhiMinus = m_inpPhiPlus = m_inpPhiSize = 0.;
@@ -71,6 +78,14 @@ namespace PESA
       return StatusCode::FAILURE;
     }
 
+    // Retrieving Region Selector Tool:
+    if ( (m_requestPIXRobs || m_requestSCTRobs) && m_regionSelector.retrieve().isFailure() ) {
+      ATH_MSG_FATAL( m_regionSelector.propertyName()
+		     << " : Unable to retrieve RegionSelector tool "  
+		     << m_regionSelector.type() );
+      return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
+    }
+
     return HLT::OK;
   }
 
@@ -114,6 +129,10 @@ namespace PESA
 
 
     if (roi->composite()){
+      if (m_requestPIXRobs || m_requestSCTRobs){
+	registerROBs(roi);
+      }
+
       ATH_MSG_DEBUG("Not touching a composite RoI");
       return HLT::OK;
     }
@@ -184,6 +203,11 @@ namespace PESA
       ATH_MSG_DEBUG("REGTEST: attached RoI " << roiName << *outroi);
     }
 
+    if (m_requestPIXRobs || m_requestSCTRobs){
+      registerROBs(outroi);
+    }
+
+
     //check whether we are attaching the same RoI again (this execution could be cache)
     if (m_monitorDuplicateRoIs){
       for (auto it = m_rois.begin(); it != m_rois.end(); it++) {
@@ -207,7 +231,6 @@ namespace PESA
       } else {
 	m_duplicateRoIs++;
       }
-
     }
 
     m_invocations++;
@@ -234,6 +257,40 @@ namespace PESA
     return HLT::OK;
   }
   //---------------------------------------------------------------------------
-} // end namespace
 
+  HLT::ErrorCode TrigRoiUpdater::registerROBs(const TrigRoiDescriptor *roi){
+
+    if (roi == 0) {
+      ATH_MSG_WARNING( "REGTEST / Failed to find RoiDescriptor " );
+      return HLT::NAV_ERROR;
+    }
+
+    ATH_MSG_DEBUG( "REGTEST registerROBs" << *roi );
 
+    std::vector<unsigned int> uIntListOfRobs;
+
+    if (m_requestPIXRobs) {
+      m_regionSelector->DetROBIDListUint( PIXEL, *roi, uIntListOfRobs );
+
+      ATH_MSG_DEBUG( "list of ROBs ID in PIX: " );
+      for(uint i_lid(0); i_lid<uIntListOfRobs.size(); i_lid++)
+	ATH_MSG_DEBUG( "0x" << std::hex << uIntListOfRobs.at(i_lid) << std::dec );
+
+      config()->robRequestInfo()->addRequestScheduledRobIDs( uIntListOfRobs );
+      uIntListOfRobs.clear();
+    }
+
+    if (m_requestSCTRobs){
+      m_regionSelector->DetROBIDListUint( SCT, *roi, uIntListOfRobs );
+
+      ATH_MSG_DEBUG( "list of ROBs ID in SCT: " );
+      for(uint i_lid(0); i_lid<uIntListOfRobs.size(); i_lid++)
+	ATH_MSG_DEBUG( "0x" << std::hex << uIntListOfRobs.at(i_lid) << std::dec );
+
+      config()->robRequestInfo()->addRequestScheduledRobIDs( uIntListOfRobs );
+    }
+
+    return HLT::OK;
+  }
+
+} // end namespace
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.h
index bd57ab0bc7c83ed5ea17115438508703bd210e6d..fe9fee4a75a96a0763c6142014d6dfb0f36c1240 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.h
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.h
@@ -23,7 +23,7 @@
 #include "TrigInterfaces/FexAlgo.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
-//class TrigRoiDescriptor;
+class IRegSelSvc;
 
 namespace PESA
 
@@ -42,10 +42,18 @@ namespace PESA
 
   private:
     
+    HLT::ErrorCode registerROBs(const TrigRoiDescriptor *roi);
+
     float m_etaHalfWidth;
     float m_phiHalfWidth;
     float m_zHalfWidth;
 
+    //ROB prefetching
+    ServiceHandle<IRegSelSvc>     m_regionSelector;     
+    //!< region selector service
+    bool  m_requestPIXRobs;
+    bool  m_requestSCTRobs;
+
     //monitoring
     float m_inpPhiMinus,m_inpPhiPlus, m_inpPhiSize;
     float m_inpEtaMinus,m_inpEtaPlus, m_inpEtaSize;
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
index 156cfe3bd74a9ae5a99481d10a8c3e4343876cf3..f9d3b064e37db81265b1d82555e9d3ba3b25a3da 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTJetRecBase_tpl.h
@@ -304,7 +304,7 @@ TrigHLTJetRecBase<InputContainer>::checkforSecondaryPseudoJets(
                                                  const HLT::TriggerElement* outputTE, 
                                                  LabelIndex* indexMap,
                                                  PseudoJetVector& pjv_secondary){
-  ATH_MSG_INFO("No actions for loading of secondary pseudojets as input not of type calo cluster.");
+  ATH_MSG_DEBUG("No actions for loading of secondary pseudojets as input not of type calo cluster.");
   return HLT::OK;
 }
 
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index 2f1203aa0476742b8af7a1f4d738bf6d5fc88268..f29809e268fb2aa3dfec21fe1773dc8cc9f8b71c 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -170,6 +170,35 @@ def addTrkMomsTool(toolname,
         print 'TrigHLTJetRecConfig.addTrkMomsTool '\
             'Added trkmoms tools "%s" to jtm' % toolname
 
+
+
+def addJVFTool(toolname,
+                  tvSGkey,
+                  vcSGkey,
+                  tpcSGkey, ):
+
+    global jtm
+
+    try:
+        jvfTool  = getattr(jtm, toolname)
+    except AttributeError:       
+        from JetMomentTools.JetMomentToolsConf import JetVertexFractionTool
+ 
+        # Build the tool :
+        jvfTool = JetVertexFractionTool(toolname,
+                                        VertexContainer = vcSGkey, 
+                                        AssociatedTracks = "GhostTrack",
+                                        TrackVertexAssociation = tvSGkey,
+                                        TrackParticleContainer = tpcSGkey, 
+                                        TrackSelector = jtm.trackselloose,
+                                        JVFName = "JVF",
+                                        IsTrigger=True,)
+        
+        jtm += jvfTool
+        print 'TrigHLTJetRecConfig.addJVFTool '\
+            'Added jvf tool "%s" to jtm' % toolname
+
+
 # *** FTK track moment tool helpers set up ***
 def configTVassocTool(name,
                     tvSGkey,
@@ -184,6 +213,7 @@ def configTVassocTool(name,
         TrackParticleContainer = tpcSGkey,
         TrackVertexAssociation = tvSGkey,
         VertexContainer = vcSGkey,
+        TrackVertexAssoTool = jtm.jetLooseTVAtool,
     )
 
     # Build the tool :
@@ -220,6 +250,7 @@ def _getJetBuildTool(merge_param,
                      cluster_calib,
                      do_minimalist_setup,
                      name='',
+                     trkopt = '',
                      secondary_label='',
                      outputLabel=''):
     """Set up offline tools. do_minimalist_setup controls whether
@@ -239,11 +270,12 @@ def _getJetBuildTool(merge_param,
 
     # Ensure the calibration is valid
     _is_calibration_supported(int_merge_param, jet_calib, cluster_calib)
-    
-    if secondary_label == '':     
+   
+    if secondary_label == '': 
         mygetters = [_getTriggerPseudoJetGetter(cluster_calib)]
     else:   
         mygetters = [_getTriggerPseudoJetGetter(cluster_calib), _getTriggerPseudoJetGetter(secondary_label)]
+   
     jtm.gettersMap["mygetters"] = mygetters
    
     print "my getters are "
@@ -268,14 +300,22 @@ def _getJetBuildTool(merge_param,
     if outputLabel!='triggerTowerjets': #towers don't have cluster moments
         mymods.append(jtm.clsmoms)
     if secondary_label == 'GhostTrack': # ghost track association expected, will want track moments.
-        if not hasattr(jtm, 'trkmoms_GhostTracks'):
+        if not hasattr(jtm, 'trkmoms_'+trkopt):
             print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no track moment tools configured. Continuing without trkmodifers."
         else:        
-            trkmoms_ghosttrack = getattr(jtm, 'trkmoms_GhostTracks')
+            trkmoms_ghosttrack = getattr(jtm, 'trkmoms_'+trkopt)
             trkmoms_ghosttrack.unlock()
             trkmoms_ghosttrack.AssociatedTracks = secondary_label
             trkmoms_ghosttrack.lock()
             mymods.append(trkmoms_ghosttrack)
+        if not hasattr(jtm, 'jvf_'+trkopt):
+            print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no JVF tool configured. Continuing without jvf calculations."
+        else:        
+            jvf_ghosttrack = getattr(jtm, 'jvf_'+trkopt)
+            jvf_ghosttrack.unlock()
+            jvf_ghosttrack.AssociatedTracks = secondary_label
+            jvf_ghosttrack.lock()
+            mymods.append(jvf_ghosttrack)
 
     if not do_minimalist_setup:
         # add in extra modofiers. This allows monitoring the ability
@@ -727,7 +767,8 @@ class TrigHLTJetRecFromCluster(TrigHLTJetRecConf.TrigHLTJetRecFromCluster):
             cluster_calib=cluster_calib,
             do_minimalist_setup=do_minimalist_setup,
             name=name,
-            secondary_label=secondary_label, # needed for retrieving the track psjgetter.
+            trkopt = trkopt,
+            secondary_label=secondary_label, # needed for retrieving the track psjgetter and configuring and adding of track modifiers.
             )
         print 'after jetbuild'
         
@@ -1057,6 +1098,7 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
 
     def __init__(self,
                  name,
+                 trkopt,
                  tvassocSGkey,
                  trackSGkey,
                  primVtxSGkey,
@@ -1067,7 +1109,7 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
         self.primVtxSGkey = primVtxSGkey
 
         #retrieve and configure the TVA tool 
-        tvatoolname = 'tvassoc_GhostTracks'
+        tvatoolname = 'tvassoc_'+trkopt
 
         tvaoptions = dict(tvSGkey=tvassocSGkey,
                        tpcSGkey=trackSGkey,
@@ -1077,12 +1119,21 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
         self.tvassocTool = _getTVassocTool(tvatoolname, **tvaoptions)
     
         # add  a specially configured trkmoms tool to jtm 
-        trkmomstoolname = 'trkmoms_GhostTracks'
+        trkmomstoolname = 'trkmoms_'+trkopt
         
         trkmomsoptions = dict(tvSGkey=tvassocSGkey,
                        vcSGkey=primVtxSGkey,
                        )
         addTrkMomsTool(trkmomstoolname, **trkmomsoptions)
+        
+        # add  a specially configured jvf tool to jtm 
+        jvftoolname = 'jvf_'+trkopt
+        
+        jvfoptions = dict(tvSGkey=tvassocSGkey,
+                       tpcSGkey=trackSGkey,
+                       vcSGkey=primVtxSGkey,
+                       )
+        addJVFTool(jvftoolname, **jvfoptions)
 
 # Data scouting algorithm
 class TrigHLTJetDSSelector(TrigHLTJetRecConf.TrigHLTJetDSSelector):
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecFromCluster.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecFromCluster.cxx
index 42fd9612efe8f0af8a9b5f118d5917713e036fd1..ff1ef0952ff842c38c673880cdf472a616239c40 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecFromCluster.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecFromCluster.cxx
@@ -31,12 +31,12 @@ TrigHLTJetRecFromCluster::~TrigHLTJetRecFromCluster(){}
 HLT::ErrorCode
 TrigHLTJetRecFromCluster::retrieveSecondaryPseudoJetGetter(){
   
-     ATH_MSG_INFO("Retrieving track pseudojet getter...");
+	ATH_MSG_DEBUG("Retrieving track pseudojet getter...");
 	if  (m_secondarypseudoJetGetter.retrieve().isSuccess()){
-      		ATH_MSG_INFO("Retrieved  secondary PseudoJetGetter "
+      		ATH_MSG_DEBUG("Retrieved  secondary PseudoJetGetter "
                    <<  m_secondarypseudoJetGetter->name());
   	} else {
-    		ATH_MSG_INFO("Unable to retrieve secondary PseudoJetGetter");
+    		ATH_MSG_DEBUG("Unable to retrieve secondary PseudoJetGetter");
     		return HLT::ERROR;
   	}
  
@@ -92,8 +92,8 @@ TrigHLTJetRecFromCluster::checkforSecondaryPseudoJets(const HLT::TriggerElement*
   // checking if set up for retrieval of secondary pseudojets.
   //
      	  if (m_scantype == "PS" ) {
- 			ATH_MSG_INFO("Scan type of PS. No ghost associations will be attempted.");
-			return HLT::OK;
+		ATH_MSG_DEBUG("Scan type of PS. No ghost associations will be attempted.");
+		return HLT::OK;
    	  }
 	  ATH_MSG_DEBUG("Of scan type FS: About to check if secondary pseudojetgetter label exists.");		
 	
@@ -104,16 +104,16 @@ TrigHLTJetRecFromCluster::checkforSecondaryPseudoJets(const HLT::TriggerElement*
 
  	  auto status = this -> getSecondaryPseudoJets(inputTE, indexMap, pjv_secondary);
   	  if (status == HLT::OK) {
-    		ATH_MSG_INFO("Obtained secondary pseudojets (in case of calo clusters)");
+    		ATH_MSG_DEBUG("Obtained secondary pseudojets (in case of calo clusters)");
   	  }
           else {
 		ATH_MSG_WARNING("Secondary objects not found. Jet will be built with an empty secondary pseudojet set.");
-    		 //return HLT::OK; // don't return here, as the secondary pseudojet getter still needs to be primed, regardless if with an empty vector of pseudojets.
+    		//return HLT::OK; // don't return here, as the secondary pseudojet getter still needs to be primed, regardless if with an empty vector of pseudojets.
   	  }
 
           auto sc_secondarygetter = this->retrieveSecondaryPseudoJetGetter();
   	  if (sc_secondarygetter == HLT::OK) {
-        	ATH_MSG_INFO("Secondary pseudojet getter succesfully retrieved.");
+        	ATH_MSG_DEBUG("Secondary pseudojet getter succesfully retrieved.");
   	  } else {
     		ATH_MSG_WARNING("Error in retrieving shared PseudoJetGetter. Does the chain require a secondary pseudojetgetter?");
     		return HLT::OK;
@@ -121,7 +121,7 @@ TrigHLTJetRecFromCluster::checkforSecondaryPseudoJets(const HLT::TriggerElement*
 
   	  status = this -> loadSecondaryPseudoJets(pjv_secondary);
   	  if (status == HLT::OK) {
-    		ATH_MSG_INFO("Loaded track pseudojets into pj getter (in case of calo clusters)");
+    		ATH_MSG_DEBUG("Loaded track pseudojets into pj getter (in case of calo clusters)");
   	  } else {
     		ATH_MSG_WARNING("Failed to load track pseudojets into pj getter. ");
      	        return status; // actually no error handling here.
@@ -141,11 +141,11 @@ TrigHLTJetRecFromCluster::getSecondaryPseudoJets(const HLT::TriggerElement* inpu
 	  ATH_MSG_DEBUG("outputTE->getId(): " << inputTE->getId());
  
 	  const xAOD::TrackParticleContainer* ictracks = nullptr;
-	  ATH_MSG_INFO("About to retrieve track container..");
+	  ATH_MSG_DEBUG("About to retrieve track container..");
 	  auto hltStatus = getFeature(inputTE, ictracks); 
 	
 	  if (hltStatus == HLT::OK) {
-	          ATH_MSG_INFO("Retrieved the track container at address " << ictracks);
+	          ATH_MSG_DEBUG("Retrieved the track container at address " << ictracks);
 	        } else {
 	          ATH_MSG_WARNING("Failed to retrieve the track input container");
 	          return HLT::MISSING_FEATURE; //maybe?
@@ -178,7 +178,7 @@ TrigHLTJetRecFromCluster::getSecondaryPseudoJets(const HLT::TriggerElement* inpu
 	                 std::back_inserter(pjvtracks),
 	                 toPseudoJet);
 	
-	  ATH_MSG_INFO("No of secondary pseudojets: " << pjvtracks.size());
+	  ATH_MSG_DEBUG("No of secondary pseudojets: " << pjvtracks.size());
   	  for(auto ps : pjvtracks) {ATH_MSG_DEBUG("secondary pseudojet E " << ps.e() << " "<<
                                       "secondary pseudojet pt " << ps.perp() << " "<<
 					"eta "<< ps.eta());}
@@ -189,7 +189,7 @@ TrigHLTJetRecFromCluster::getSecondaryPseudoJets(const HLT::TriggerElement* inpu
 HLT::ErrorCode
 TrigHLTJetRecFromCluster::loadSecondaryPseudoJets(
                                         PseudoJetVector& pjvtracks){
-        ATH_MSG_INFO("Loading secondary pseudo jets into getter...");
+        ATH_MSG_DEBUG("Loading secondary pseudo jets into getter...");
 	m_secondarypseudoJetGetter->prime(&pjvtracks);
 	m_secondarypseudoJetGetter->print();
     
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
index 64e16c3da73627847372d971896358983ac6d179..0f38d1c955499583a71121fb61cc16da4d07c25b 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
@@ -79,10 +79,10 @@ HLT::ErrorCode TrigHLTSoftKiller::hltExecute(const HLT::TriggerElement* inputTE,
     const xAOD::IParticleContainer* IP_inputclusters = dynamic_cast<const xAOD::IParticleContainer*> (inputclusters);
     skclustModSeqTool->setInputClusterCollection(IP_inputclusters);
     //skclustModSeqTool->setInputClusterCollection(inputclusters);
-    ATH_MSG_INFO("Input cluster container: " << inputclusters);
+    ATH_MSG_DEBUG("Input cluster container: " << inputclusters);
     int process_status = skclustModSeqTool->execute();
     const xAOD::CaloClusterContainer* outputclusters = dynamic_cast<const xAOD::CaloClusterContainer*>(skclustModSeqTool->getOutputClusterCollection()); 
-    ATH_MSG_INFO("Output cluster container after: " << outputclusters);
+    ATH_MSG_DEBUG("Output cluster container after: " << outputclusters);
     
     if (process_status == 0)
     {
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtData.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtData.h
index b0a71f7283c01e6a7cada9807a903bb241ab5491..8e572c23fadd043a1a59e6a7fa1160f6dbce9092 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtData.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtData.h
@@ -15,7 +15,6 @@ namespace TrigL2MuonSA {
   {
     unsigned int name;
     int isEndcap;
-    int Station;
     int StationEta;
     int StationPhi;
     int Multilayer;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtDataPreparator.h
index 118cf36435f1185384b9647aaf1d144ade378ab8..ae2da24c2cc7482fce2f6217fb0b9a805fefe8a2 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtDataPreparator.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtDataPreparator.h
@@ -83,7 +83,7 @@ namespace TrigL2MuonSA {
     void setRoIBasedDataAccess(bool use_RoIBasedDataAccess);
 
   public:
-    float etaMinChamber[10],etaMaxChamber[10],phiMinChamber[10],phiMaxChamber[10];
+    float etaMinChamber[11],etaMaxChamber[11],phiMinChamber[11],phiMaxChamber[11];
 
   private:
     
@@ -115,6 +115,8 @@ namespace TrigL2MuonSA {
 					  TrigL2MuonSA::MdtHits& mdtHits,
 					  const TrigL2MuonSA::MuonRoad& muonRoad);
 
+    void initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl);
+
   private:
 
     // Reference to StoreGateSvc;
@@ -151,6 +153,9 @@ namespace TrigL2MuonSA {
 
     bool m_use_mdtcsm;
     bool m_use_RoIBasedDataAccess;
+    bool m_BMGpresent;
+    int  m_BMGid;
+    std::map<Identifier, std::vector<Identifier> > m_DeadChannels;
 
   };
 
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtRegion.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtRegion.h
index 129cfc4c08d039a03bb8546dfc28013158fa1b8b..b40ed0f44f0fbd99293149fa7571a1145c541720 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtRegion.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MdtRegion.h
@@ -18,7 +18,7 @@ namespace TrigL2MuonSA {
     
     void Clear()
 	{
-	  for(int i=0; i<10; i++) {
+	  for(int i=0; i<11; i++) {
 	    for(int j=0; j<2; j++) {
 	      zMin[i][j] = 0;
 	      zMax[i][j] = 0;
@@ -34,15 +34,15 @@ namespace TrigL2MuonSA {
 	};
       
   public:
-      double zMin[10][2];
-      double zMax[10][2];
-      double rMin[10][2];
-      double rMax[10][2];
-      double etaMin[10][2];
-      double etaMax[10][2];
-      double phiMin[10][2];
-      double phiMax[10][2];
-      int chamberType[10][2][2];
+      double zMin[11][2];
+      double zMax[11][2];
+      double rMin[11][2];
+      double rMax[11][2];
+      double etaMin[11][2];
+      double etaMax[11][2];
+      double phiMin[11][2];
+      double phiMax[11][2];
+      int chamberType[11][2][2];
   };
 
 // --------------------------------------------------------------------------------
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastSteering.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastSteering.h
index 6e2f1fb6ac1498dc91eb622416f3e317bb19be99..b041cf45a6042377cfa00b8e90193a4546ceadb3 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastSteering.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastSteering.h
@@ -196,6 +196,7 @@ class MuFastSteering : public HLT::FexAlgo,
   float m_address;
   float m_absolute_pt;
   float m_track_pt;
+  int m_invalid_rpc_roi_number;
   std::vector<float> m_track_eta;
   std::vector<float> m_track_phi;
   std::vector<float> m_failed_eta;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuonRoad.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuonRoad.h
index 5efe66573c84edc36e2e15fbc0fecd04962f3fad..4ed892a9c75baf041914e3fc7980714d97571a9b 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuonRoad.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuonRoad.h
@@ -12,7 +12,7 @@ namespace TrigL2MuonSA {
   // --------------------------------------------------------------------------------
   // --------------------------------------------------------------------------------
   
-  const int N_STATION = 11; //barrel  0: inner, 1: middle, 2: outer, endcap 3: inner, 4: middle, 5: outer, 6: ee, 7: csc 8: BEE 9: BME
+  const int N_STATION = 11; //barrel  0: inner, 1: middle, 2: outer, endcap 3: inner, 4: middle, 5: outer, 6: ee, 7: csc 8: BEE 9: BME 10:BMG
   const int N_SECTOR = 2; // 0: normal, 1:overlap
   const int N_LAYER = 8; 
   
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
index 7a083ee52f6966cb87e240f76ed41997c525af10..64dae867b5c2b9afc44229799d63a4187bc8fa1a 100755
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
@@ -1,12 +1,12 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
+
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 
 class TrigL2MuonSAValidationMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="TrigL2MuonSAValidationMonitoring"):
         super(TrigL2MuonSAValidationMonitoring, self).__init__(name)
         self.defineTarget("Validation")
-
         self.Histograms = [ defineHistogram('InnMdtHits', type='TH1F', title="Hit multiplicity in the INNER road; MDT hits",
                                             xbins=50, xmin=-0.5, xmax=50.5) ]
         self.Histograms += [ defineHistogram('MidMdtHits', type='TH1F', title="Hit multiplicity in the MIDDLE road; MDT hits",
@@ -37,6 +37,8 @@ class TrigL2MuonSAValidationMonitoring(TrigGenericMonitoringToolConfig):
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
         self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi",
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
+        self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI; RoI Number",
+                                            xbins=150, xmin=-0.5, xmax=150.5) ]
         
 class TrigL2MuonSAOnlineMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="TrigL2MuonSAOnlineMonitoring"):
@@ -73,6 +75,8 @@ class TrigL2MuonSAOnlineMonitoring(TrigGenericMonitoringToolConfig):
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
         self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi",
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
+        self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI ; RoI Number",
+                                            xbins=150, xmin=-0.5, xmax=150.5) ]
 
 
 class TrigL2MuonSACosmicMonitoring(TrigGenericMonitoringToolConfig):
@@ -110,4 +114,6 @@ class TrigL2MuonSACosmicMonitoring(TrigGenericMonitoringToolConfig):
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
         self.Histograms += [ defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', title="Location of LVL2 track failure; Eta; Phi",
                                              xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 ) ]
+        self.Histograms += [ defineHistogram('InvalidRpcRoINumber', type='TH1F', title="RoI Number of Invalid RPC RoI; RoI Number",
+                                            xbins=150, xmin=-0.5, xmax=150.5) ]
         
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
index 5bd6847716cf676d1faa35682650eb79567b5734..6f6c78c6b1b390fc17212ec988232f69881ccfd2 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
@@ -31,8 +31,6 @@
 #include "MuonCablingData/MuonMDT_CablingMap.h"
 #include "MuonCablingData/MdtSubdetectorMap.h"
 #include "MuonCablingData/MdtCsmMap.h"
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
-#include "MuonReadoutGeometry/MdtReadoutElement.h"
 #include "MuonReadoutGeometry/MuonStation.h"
 #include "MuonIdHelpers/MdtIdHelper.h"
 
@@ -62,7 +60,9 @@ TrigL2MuonSA::MdtDataPreparator::MdtDataPreparator(const std::string& type,
    m_regionSelector(0), m_robDataProvider(0), m_recMuonRoIUtils(),
    m_mdtRegionDefiner("TrigL2MuonSA::MdtRegionDefiner"),
    m_mdtPrepDataProvider("Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool"),
-   m_use_mdtcsm(true)
+   m_use_mdtcsm(true),
+   m_BMGpresent(false),
+   m_BMGid(-1)
 {
    declareInterface<TrigL2MuonSA::MdtDataPreparator>(this);
 
@@ -179,6 +179,25 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::initialize()
      return sc ;
    }
    ATH_MSG_DEBUG("Retrieved ActiveStoreSvc."); 
+
+   m_BMGpresent = m_mdtIdHelper->stationNameIndex("BMG") != -1;
+   if(m_BMGpresent){
+     ATH_MSG_INFO("Processing configuration for layouts with BMG chambers.");
+     m_BMGid = m_mdtIdHelper->stationNameIndex("BMG");
+     for(int phi=6; phi<8; phi++) { // phi sectors - BMGs are ony in (6 aka 12) and (7 aka 14)
+       for(int eta=1; eta<4; eta++) { // eta sectors - BMGs are in eta 1 to 3
+         for(int side=-1; side<2; side+=2) { // side - both sides have BMGs
+           if( !m_muonMgr->getMuonStation("BMG", side*eta, phi) ) continue;
+           for(int roe=1; roe<=( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
+             const MuonGM::MdtReadoutElement* mdtRE =
+                   dynamic_cast<const MuonGM::MdtReadoutElement*> ( ( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
+             if(mdtRE) initDeadChannels(mdtRE);
+           }
+         }
+       }
+     }
+   }
+
    
    // 
    return StatusCode::SUCCESS; 
@@ -581,6 +600,10 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm,
      
      unsigned short int TdcId     = (*amt)->tdcId();
      unsigned short int ChannelId = (*amt)->channelId();
+     // also for HPTDC the fine time is 5 bits, i.e. the shift by 5 for coarse is ok
+     // even though the total TDC is 17 bits (19 bits for HPTDC) it's ok to use
+     // unsigned short int (16 bit) as no more than 2000 tics are delivered by
+     // the DAQ and therefore hte leading bits of coarse can be lost
      unsigned short int drift     = (*amt)->fine() | ( (*amt)->coarse() << 5);  
      
      int StationPhi;
@@ -640,10 +663,25 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm,
        if (st=='O') chamber = xAOD::L2MuonParameters::Chamber::BarrelOuter;
        if (st=='E' && chamberType[2]=='E') chamber = xAOD::L2MuonParameters::Chamber::BEE;
        if (st=='M' && chamberType[2]=='E') chamber = xAOD::L2MuonParameters::Chamber::BME;
+       if (st=='M' && chamberType[2]=='G') chamber = xAOD::L2MuonParameters::Chamber::Backup;
      }
-     
-     double R = m_mdtReadout->center(TubeLayer, Tube).perp();
-     double Z = m_mdtReadout->center(TubeLayer, Tube).z();
+
+     double R = -99999., Z = -99999.;
+     if(m_BMGpresent) {
+       Identifier tubeId = m_mdtIdHelper->channelID(StationName, StationEta, StationPhi, MultiLayer, Layer, Tube);
+       if(m_mdtIdHelper->stationName(tubeId) == m_BMGid ) {
+         std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( m_muonMgr->getMdtReadoutElement(tubeId)->identify() );
+         if( myIt != m_DeadChannels.end() ){
+           if( std::find( (myIt->second).begin(), (myIt->second).end(), tubeId) != (myIt->second).end() ) {
+             ATH_MSG_DEBUG("Skipping tube with identifier " << m_mdtIdHelper->show_to_string(tubeId) );
+             ++amt;
+             continue;
+           }
+         }
+       }
+     }
+     R = m_mdtReadout->center(TubeLayer, Tube).perp();
+     Z = m_mdtReadout->center(TubeLayer, Tube).z();
      
      Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal());
      if(m_muonStation->endcap()==0){
@@ -769,13 +807,14 @@ void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesBarrel(const TrigL2MuonSA::M
    std::vector<IdentifierHash> idList;
 
    //combine regions of sector and type
-   for(int j_station=0; j_station<5; j_station++) {
+   for(int j_station=0; j_station<6; j_station++) {
      int cha=0;
      if (j_station==0) cha = xAOD::L2MuonParameters::Chamber::BarrelInner; 
      if (j_station==1) cha = xAOD::L2MuonParameters::Chamber::BarrelMiddle;
      if (j_station==2) cha = xAOD::L2MuonParameters::Chamber::BarrelOuter;
      if (j_station==3) cha = xAOD::L2MuonParameters::Chamber::BME;
      if (j_station==4) cha = xAOD::L2MuonParameters::Chamber::EndcapInner;
+     if (j_station==5) cha = xAOD::L2MuonParameters::Chamber::Backup; // BMG
      phiMinChamber[cha]=mdtRegion.phiMin[cha][0];
      phiMaxChamber[cha]=mdtRegion.phiMax[cha][0];
      etaMinChamber[cha]=9999;
@@ -789,13 +828,14 @@ void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesBarrel(const TrigL2MuonSA::M
    }
 
    // get hashIdlist by using region selector
-   for(int i_station=0; i_station<5; i_station++) {
+   for(int i_station=0; i_station<6; i_station++) {
      int chamber=0;
      if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner; 
      if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::BarrelMiddle;
      if (i_station==2) chamber = xAOD::L2MuonParameters::Chamber::BarrelOuter;
      if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::BME;
      if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
+     if (i_station==5) chamber = xAOD::L2MuonParameters::Chamber::Backup; // BMG;
      ATH_MSG_DEBUG( "chamber=" << chamber );
      ATH_MSG_DEBUG( "...etaMin/etaMax/phiMin/phiMax="
        << etaMinChamber[chamber] << "/"
@@ -1018,10 +1058,21 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std
 	if (st=='O') chamber = xAOD::L2MuonParameters::Chamber::BarrelOuter;
   if (st=='E' && chamberType[2]=='E') chamber = xAOD::L2MuonParameters::Chamber::BEE;
   if (st=='M' && chamberType[2]=='E') chamber = xAOD::L2MuonParameters::Chamber::BME;
+  if (st=='M' && chamberType[2]=='G') chamber = xAOD::L2MuonParameters::Chamber::Backup;
       }
-      
-      double R = m_mdtReadout->center(TubeLayer, Tube).perp();
-      double Z = m_mdtReadout->center(TubeLayer, Tube).z();
+
+      double R = -99999., Z = -99999.;
+      if(m_BMGpresent && m_mdtIdHelper->stationName(id) == m_BMGid ) {
+        std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( m_muonMgr->getMdtReadoutElement(id)->identify() );
+        if( myIt != m_DeadChannels.end() ){
+          if( std::find( (myIt->second).begin(), (myIt->second).end(), id) != (myIt->second).end() ) {
+            ATH_MSG_DEBUG("Skipping tube with identifier " << m_mdtIdHelper->show_to_string(id) );
+            continue;
+          }
+        }
+      }
+      R = m_mdtReadout->center(TubeLayer, Tube).perp();
+      Z = m_mdtReadout->center(TubeLayer, Tube).z();
       
       Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal());
       if(m_muonStation->endcap()==0){
@@ -1126,3 +1177,45 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::finalize()
 
 // --------------------------------------------------------------------------------
 // --------------------------------------------------------------------------------
+
+void TrigL2MuonSA::MdtDataPreparator::initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl) {
+  PVConstLink cv = mydetEl->getMaterialGeom(); // it is "Multilayer"
+  int nGrandchildren = cv->getNChildVols();
+  if(nGrandchildren <= 0) return;
+
+  Identifier detElId = mydetEl->identify();
+
+  int name = m_mdtIdHelper->stationName(detElId);
+  int eta = m_mdtIdHelper->stationEta(detElId);
+  int phi = m_mdtIdHelper->stationPhi(detElId);
+  int ml = m_mdtIdHelper->multilayer(detElId);
+  std::vector<Identifier> deadTubes;
+
+  for(int layer = 1; layer <= mydetEl->getNLayers(); layer++){
+    for(int tube = 1; tube <= mydetEl->getNtubesperlayer(); tube++){
+      bool tubefound = false;
+      for(unsigned int kk=0; kk < cv->getNChildVols(); kk++) {
+        int tubegeo = cv->getIdOfChildVol(kk) % 100;
+        int layergeo = ( cv->getIdOfChildVol(kk) - tubegeo ) / 100;
+        if( tubegeo == tube && layergeo == layer ) {
+          tubefound=true;
+          break;
+        }
+        if( layergeo > layer ) break; // don't loop any longer if you cannot find tube anyway anymore
+      }
+      if(!tubefound) {
+        Identifier deadTubeId = m_mdtIdHelper->channelID( name, eta, phi, ml, layer, tube );
+        deadTubes.push_back( deadTubeId );
+        ATH_MSG_VERBOSE("adding dead tube (" << tube  << "), layer(" <<  layer
+                        << "), phi(" << phi << "), eta(" << eta << "), name(" << name
+                        << "), multilayerId(" << ml << ") and identifier " << deadTubeId <<" .");
+      }
+    }
+  }
+  std::sort(deadTubes.begin(), deadTubes.end());
+  m_DeadChannels[detElId] = deadTubes;
+  return;
+}
+
+// --------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
index a0fced2745989865e4c4c8d087204d9e0163bc82..490b8a38dfa19c6e85a3c1920c69cdc35c28dbb8 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
@@ -100,13 +100,14 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
 
   int endcap_inner = xAOD::L2MuonParameters::Chamber::EndcapInner; 
 
-  for(int i_station=0; i_station<5; i_station++) {
+  for(int i_station=0; i_station<6; i_station++) {
     int chamber = 0;
     if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
     if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::BarrelMiddle;
     if (i_station==2) chamber = xAOD::L2MuonParameters::Chamber::BarrelOuter;
     if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::BME;
     if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
+    if (i_station==5) chamber = xAOD::L2MuonParameters::Chamber::Backup; // BMG
     for(int i_sector=0; i_sector<2; i_sector++) { // 0: normal, 1: overlap
       int sector = sectors[i_sector];
       ATH_MSG_DEBUG("--- chamber/sector=" << chamber << "/" << sector);
@@ -216,17 +217,19 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
  
   if (m_use_rpc && rpcFitResult.isSuccess) {
     // use phi from fit
-    for (int i=0; i<5; i++){
+    for (int i=0; i<6; i++){
       for (int j=0; j<2; j++){
         if (i==4) muonRoad.phi[9][j] = rpcFitResult.phi;
+        else if (i==5) muonRoad.phi[10][j] = rpcFitResult.phi;
         else muonRoad.phi[i][j] = rpcFitResult.phi;
       }
     }
   }
   else {
-    for (int i=0; i<5; i++){
+    for (int i=0; i<6; i++){
       for (int j=0; j<2; j++){
         if (i==4) muonRoad.phi[9][j] = p_roi->phi();
+        else if (i==5) muonRoad.phi[10][j] = p_roi->phi();
         else muonRoad.phi[i][j] = p_roi->phi();
       }
     }
@@ -254,7 +257,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
   int barrel_inner = xAOD::L2MuonParameters::Chamber::BarrelInner; 
   int bee = xAOD::L2MuonParameters::Chamber::BEE; 
 
-  for(int i_station=0; i_station<6; i_station++) {
+  for(int i_station=0; i_station<7; i_station++) {
     int chamber = 0;
     if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
     if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::EndcapMiddle;
@@ -262,6 +265,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
     if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::EndcapExtra;
     if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
     if (i_station==5) chamber = xAOD::L2MuonParameters::Chamber::BEE;
+    if (i_station==6) chamber = xAOD::L2MuonParameters::Chamber::Backup;
     for(int i_sector=0; i_sector<2; i_sector++) { // 0: normal, 1: overlap
       int sector = sectors[i_sector];
       ATH_MSG_DEBUG("--- chamber/sector=" << chamber << "/" << sector);
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx
index 0d5c87143929ae2728cb6fc6f56b370e22b9bec8..74c090017903abe256ad90a823a7cf86a04bb173 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx
@@ -248,6 +248,7 @@ StatusCode TrigL2MuonSA::MuFastPatternFinder::findPatterns(const TrigL2MuonSA::M
      // remove outlier
      while(1) {
        if (chamber==9) break;//BME skips this loop
+       if (chamber==10) break;//BMG skips this loop
        unsigned int layer = 999999;
        double DistMax  = 0.;
        double Residual = 0.;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.cxx
index 277d6f1971604b01e2bf8cc55b7430d2d0ef01b3..12ff606756a4bad78477d41a3bece9b627cc72dc 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.cxx
@@ -250,7 +250,7 @@ StatusCode TrigL2MuonSA::MuFastStationFitter::superPointFitter(TrigL2MuonSA::Tra
    float Ymid, Xmid, Amid;
 
    const float ZERO_LIMIT         = 1e-6;
-   const unsigned int MAX_STATION = 10;
+   const unsigned int MAX_STATION = 10; // no BMG(Backup=10)
    const float SIGMA              = 0.0080;
    const float DRIFTSPACE_LIMIT   = 16.;
    const int   MIN_MDT_FOR_FIT    = 3;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx
index 57ab8d1363bc769261ce10b249d0ca76f34f270d..89d66912cc6f4811394b5e05177e95af7c1e1a3a 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastSteering.cxx
@@ -104,6 +104,7 @@ MuFastSteering::MuFastSteering(const std::string& name, ISvcLocator* svc)
   declareMonitoredVariable("AbsPt", m_absolute_pt);
   declareMonitoredVariable("Sagitta", m_sagitta);
   declareMonitoredVariable("TrackPt", m_track_pt);
+  declareMonitoredVariable("InvalidRpcRoINumber", m_invalid_rpc_roi_number);
   declareMonitoredStdContainer("ResInner", m_res_inner);
   declareMonitoredStdContainer("ResMiddle", m_res_middle);
   declareMonitoredStdContainer("ResOuter", m_res_outer);
@@ -328,6 +329,7 @@ HLT::ErrorCode MuFastSteering::hltExecute(const HLT::TriggerElement* inputTE,
   m_inner_mdt_hits  = -1;
   m_middle_mdt_hits = -1;
   m_outer_mdt_hits  = -1;
+  m_invalid_rpc_roi_number = -1;
   
   m_fit_residuals.clear();
   m_res_inner.clear();
@@ -403,6 +405,7 @@ HLT::ErrorCode MuFastSteering::hltExecute(const HLT::TriggerElement* inputTE,
 
       // Data preparation
       m_rpcHits.clear();
+      m_tgcHits.clear();     
       sc = m_dataPreparator->prepareData(*p_roi,
                                          *p_roids,
                                          m_rpcHits,
@@ -474,6 +477,7 @@ HLT::ErrorCode MuFastSteering::hltExecute(const HLT::TriggerElement* inputTE,
       ATH_MSG_DEBUG("Endcap");
 
       // Data preparation
+      m_rpcHits.clear();
       m_tgcHits.clear();     
       sc = m_dataPreparator->prepareData(*p_roi,
                                          *p_roids,
@@ -727,6 +731,7 @@ bool MuFastSteering::updateOutputTE(HLT::TriggerElement*                     out
   int endcapinner = 3;
   int bee = 8;
   int bme = 9;
+  // int bmg = 10;
 
   std::string muonCollKey = "MuonL2SAInfo";
   
@@ -753,6 +758,7 @@ bool MuFastSteering::updateOutputTE(HLT::TriggerElement*                     out
       outer  = xAOD::L2MuonParameters::Chamber::BarrelOuter;
       bme = xAOD::L2MuonParameters::Chamber::BME;
       endcapinner  = xAOD::L2MuonParameters::Chamber::EndcapInner;
+      // bmg  = xAOD::L2MuonParameters::Chamber::Backup;
     }
 
     ATH_MSG_DEBUG("pattern#0: # of hits at inner  =" << pattern.mdtSegments[inner].size());
@@ -1391,6 +1397,7 @@ StatusCode MuFastSteering::updateMonitor(const LVL1::RecMuonRoI*
                                          const TrigL2MuonSA::MdtHits&             mdtHits,
                                          std::vector<TrigL2MuonSA::TrackPattern>& trackPatterns)
 {
+  
   const float ZERO_LIMIT = 1e-5;
   
   if( trackPatterns.size() > 0 ) {
@@ -1432,6 +1439,9 @@ StatusCode MuFastSteering::updateMonitor(const LVL1::RecMuonRoI*
     m_inner_mdt_hits  = count_inner;
     m_middle_mdt_hits = count_middle;
     m_outer_mdt_hits  = count_outer;
+
+    if ( m_rpcErrToDebugStream && m_dataPreparator->isRpcFakeRoi() ) 
+      m_invalid_rpc_roi_number = roi->getRoINumber();
     
     m_track_pt    = (fabs(pattern.pt ) > ZERO_LIMIT)? pattern.charge*pattern.pt: 9999.;
     m_absolute_pt = fabs(m_track_pt);
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
index 3ef1e64c8fb9643b18296bef8aae04f9a5496da2..db8e8bafe3ce0ea48aa8570a2aff7c1bcace1b91 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx
@@ -100,7 +100,7 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
   
   const double ZERO_LIMIT = 1e-5;
   
-  const int N_LAYER = 4; // 0: inner, 1: middle, 2: outer 4: BME
+  const int N_LAYER = 5; // 0: inner, 1: middle, 2: outer 4: BME 5: BMG
   const int N_SECTOR = 2; // 0: normal, 1:overlap
 
   if (m_use_rpc) {
@@ -152,13 +152,14 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
     special = 1;
   muonRoad.Special = special;
   
-  for (int i_station=0; i_station<5; i_station++) {
+  for (int i_station=0; i_station<6; i_station++) {
     for (int i_layer=0; i_layer<8; i_layer++) {
       if (i_station==0)      muonRoad.rWidth[i_station][i_layer] = 400;//for inner
       else if (i_station==1) muonRoad.rWidth[i_station][i_layer] = 200;//for middle
       else if (i_station==2) muonRoad.rWidth[i_station][i_layer] = 400;//for outer
       else if (i_station==3) muonRoad.rWidth[i_station][i_layer] = 400;//EndcapInner
       else if (i_station==4) muonRoad.rWidth[9][i_layer] = m_rWidth_RPC_Failed;//BME
+      else if (i_station==5) muonRoad.rWidth[10][i_layer] = m_rWidth_RPC_Failed;//BMG
       else muonRoad.rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
     }
   }
@@ -200,6 +201,7 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
     std::string name = m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(id));
     
     if ( name[1]=='M' && name[2]=='E' ) continue;//exclude BME
+    if ( name[1]=='M' && name[2]=='G' ) continue;//exclude BMG
     
     int LargeSmall = 0;
     if(name[2]=='S' || name[2]=='F' || name[2]=='G' ) LargeSmall = 1;
@@ -231,6 +233,8 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
       muonRoad.bw[3][i_sector] = rpcFitResult.offset_inner;
       muonRoad.aw[9][i_sector] = rpcFitResult.slope_middle;//BME
       muonRoad.bw[9][i_sector] = rpcFitResult.offset_middle;
+      muonRoad.aw[10][i_sector] = rpcFitResult.slope_middle;//BMG
+      muonRoad.bw[10][i_sector] = rpcFitResult.offset_middle;
     }
    
   } else {
@@ -248,6 +252,7 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI*
 	if (i_station==2) muonRoad.aw[i_station][i_sector] = awHigh;
   if (i_station==3) muonRoad.aw[i_station][i_sector] = awLow; //EI
   if (i_station==4) muonRoad.aw[9][i_sector] = awLow; //BME
+  if (i_station==5) muonRoad.aw[10][i_sector] = awLow; //BMG
       }
     }
   }
diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
index 085a08c9815e036a9d00f814618f70f01e9a6347..bfaaea05a32d80afaa40cb8b52fecf9d0ad07fc7 100644
--- a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
@@ -1,3 +1,4 @@
+
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
@@ -655,7 +656,10 @@ HLT::ErrorCode TrigMuSuperEF::runCombinerOnly(const HLT::TriggerElement* inputTE
       ATH_MSG_DEBUG( "Call buildMuons, n(inDetCandidates) =  " << inDetCandidates.size());
       hltStatus = buildMuons( muonCandidates, &inDetCandidates, combTrackParticleCont, extrapolatedTracks, saTrackParticleCont);
       if(hltStatus!=HLT::OK) {
-  	if(muonCandidates) for(auto cand : *muonCandidates) delete cand;
+  	if(muonCandidates){
+	  delete muonCandidates;
+	  muonCandidates = nullptr;
+	}
   	ATH_MSG_ERROR("Problem building muons");
   	return hltStatus;
       }
@@ -679,20 +683,25 @@ HLT::ErrorCode TrigMuSuperEF::runCombinerOnly(const HLT::TriggerElement* inputTE
     ATH_MSG_DEBUG( "Call buildMuons, n(inDetCandidates) =  " << inDetCandidates.size());
     hltStatus = buildMuons( muonCandidates, &inDetCandidates, combTrackParticleCont, extrapolatedTracks, saTrackParticleCont);
     if(hltStatus!=HLT::OK) {
-      if(muonCandidates) for(auto cand : *muonCandidates) delete cand;
+      if(muonCandidates) {
+	delete muonCandidates;
+	muonCandidates = nullptr;
+      }
       ATH_MSG_ERROR("Problem building muons");
       return hltStatus;
     }
   }
 
-  if(muonCandidates) for(auto cand : *muonCandidates) delete cand;
+  if(muonCandidates) {
+    delete muonCandidates;
+    muonCandidates = nullptr;
+  }
 
   // attach output
   if(attachOutput( TEout, combTrackParticleCont, extrapolatedTracks, saTrackParticleCont, std::move(muonContainerOwn))!=HLT::OK) {
     ATH_MSG_WARNING("Problem attaching output");
     return HLT::MISSING_FEATURE;
   }
-
   return hltStatus;
 }// runCombinedReconstruction
 
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
index b6cdbc3cb5e2a02cb91cc81c017ebe5465b783a4..aeed3a0f6b3016eafd803af8f1310289e15f88f0 100755
--- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
@@ -515,6 +515,7 @@ class TrigMuonEFStandaloneTrackToolConfig (TrigMuonEFStandaloneTrackTool):
         self.maxRpcHits      = 0
         self.maxMdtHits      = 0
         self.doCache = True
+        self.IgnoreMisalginedCSCs = True
 
         self.TrackBuilderTool  = "TMEF_TrackBuilderTool"
         self.TrkSummaryTool = "TMEF_TrackSummaryTool"
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
index b9bce1f6794cc202fa484e813ec3a69c9a10408d..6fd8c2c3f0a7313c449b8378aa639794a480ed18 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
@@ -138,7 +138,8 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string&
     m_totalExtrapolatedCalls(0),
     m_cachedExtrapolatedCalls(0),
     m_muonCandidateTool("MuonCandidateTool/MuonCandidateTool"),
-    m_TrackToTrackParticleConvTool("MuonParticleCreatorTool")
+    m_TrackToTrackParticleConvTool("MuonParticleCreatorTool"),
+    m_ignoreCSC(true)
 {
   m_hashlist.reserve(4);
 
@@ -183,7 +184,7 @@ TrigMuonEFStandaloneTrackTool::TrigMuonEFStandaloneTrackTool(const std::string&
   declareProperty("maxCscHits",m_maxCscHits);
   declareProperty("maxRpcHits",m_maxRpcHits);
   declareProperty("maxMdtHits",m_maxMdtHits);
-  
+  declareProperty("IgnoreMisalginedCSCs", m_ignoreCSC);
 
 
   clearRoiCache();
@@ -1319,6 +1320,10 @@ if (m_useMdtData>0) {
     CscPrepDataContainer::const_iterator CSCcoll;
     for(std::vector<IdentifierHash>::const_iterator idit = csc_hash_ids.begin();
 	idit != csc_hash_ids.end(); ++idit) {
+      if(m_ignoreCSC && (*idit==16 || *idit==17)){
+	ATH_MSG_DEBUG("Skipping misaligned chamber with hashid "<<*idit);
+	continue;
+      }
       CSCcoll = cscPrds->indexFind(*idit);
       if( CSCcoll == cscPrds->end() ) continue;
       if( (*CSCcoll)->size() == 0)    continue;
@@ -1327,8 +1332,8 @@ if (m_useMdtData>0) {
       nCscHits+=(*CSCcoll)->size(); // count hits for TrigMuonEFInfo
       cscCols.push_back(*CSCcoll);
       if (msgLvl(MSG::DEBUG)) msg() << MSG::DEBUG << "Selected Csc Collection: "
-			 << m_cscIdHelper->show_to_string((*CSCcoll)->identify())
-			 << " with size " << (*CSCcoll)->size() << endmsg;
+				    << m_cscIdHelper->show_to_string((*CSCcoll)->identify())
+				    << " with size " << (*CSCcoll)->size() << endmsg;
       else
 	if (testRoiDrivenMode) msg() << MSG::INFO << "Selected Csc Collection: "
 				     << m_cscIdHelper->show_to_string((*CSCcoll)->identify())
@@ -1729,7 +1734,7 @@ TrigMuonEFStandaloneTrackTool::buildTracks(const MuonSegmentCombinationCollectio
 	else
 	  chi2prob = 0.;
       }
-      double eta =  -log(fabs(tan(theta*0.5)));
+      double eta =  -log(tan(theta*0.5));
       
       unsigned short int nRpcEtaHits = 0;
       unsigned short int nRpcPhiHits = 0;
@@ -1898,7 +1903,7 @@ TrigMuonEFStandaloneTrackTool::extrapolate(const xAOD::TrackParticleContainer* s
       else
 	chi2prob = 0.;
     }
-    double eta =  -log(fabs(tan(theta*0.5)));
+    double eta =  -log(tan(theta*0.5));
     
     unsigned short int nRpcEtaHits = 0;
     unsigned short int nRpcPhiHits = 0;
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
index 190032a20fda9f2994e055b1221b70bbfd12a156..b4169bda9d1092a722503bc3d01c0229fccaaabb 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
@@ -329,6 +329,7 @@ class TrigMuonEFStandaloneTrackTool : public AthAlgTool,
   int m_maxRpcHits;
   int m_maxTgcHits;
 
+
   //Map to cache
   std::map<std::vector<std::vector<IdentifierHash> >, SegmentCache*> m_SFCacheSCMap;
   
@@ -381,6 +382,9 @@ class TrigMuonEFStandaloneTrackTool : public AthAlgTool,
   std::ofstream m_fileWithHashIds_csc;
 #endif
 
+  bool m_ignoreCSC;
+
+
 };
 
 #endif // TRIGMUONEF_TRIGMUONEFSTANDALONETRACKTOOL_H
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolation.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolation.cxx
index 6daf1dec00376470978a7572f8fef6d68ad14b0e..f5bf4569000f82e1a3a2c4c57172513a94f4780b 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolation.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolation.cxx
@@ -319,7 +319,11 @@ TrigMuonEFTrackIsolation::hltExecute(const HLT::TriggerElement* inputTE, HLT::Tr
   xAOD::L2IsoMuonAuxContainer caux;
 
   if (m_isoType==2) {
-    // loop on L2 muons
+
+    L2muonIsoContainer = new xAOD::L2IsoMuonContainer();
+    L2muonIsoContainer->setStore(&caux);
+    
+    // loop on L2 muons  
     for(auto muon : *L2muonContainer) {
     
       if (m_debug)
@@ -363,10 +367,6 @@ TrigMuonEFTrackIsolation::hltExecute(const HLT::TriggerElement* inputTE, HLT::Tr
 	m_trkptiso_cone3.push_back(ptcone30FTK * 1e-3); // convert to GeV
 
 	// Set the iso on the L2 muon
-
-	L2muonIsoContainer = new xAOD::L2IsoMuonContainer();
-	L2muonIsoContainer->setStore(&caux);
-
 	xAOD::L2IsoMuon* muonIso = new xAOD::L2IsoMuon();
 	L2muonIsoContainer->push_back(muonIso);
 	muonIso->setPt(muon->pt());
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolationTool.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolationTool.cxx
index 367afe27cc634761881c5e13b76dc6c57b726e0d..1947bbf9b93a25ac073329140f4ef526872f91eb 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolationTool.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFTrackIsolationTool.cxx
@@ -149,7 +149,7 @@ StatusCode TrigMuonEFTrackIsolationTool::calcTrackIsolation(const xAOD::L2Combin
     }
   }//combinedmuon
   else {
-    msg() << MSG::ERROR << "ERROR: L2Combined muon with no ID track? Exiting..." << endmsg;
+    msg() << MSG::WARNING << "L2Combined muon with no ID track? Exiting isolation tool..." << endmsg;
     return StatusCode::FAILURE;
 
     }//not combined
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
index 1f22e9d48dc986e11bb657d0a33eddb61ac51a58..d50125313776ef032ad2efbe07f73eedc663687c 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
@@ -645,11 +645,12 @@ L2MbSpHypo_cos.SctSpEndcaps_cut = -1. # Disable
 hypos["L2MbSpHypo_cos"] = L2MbSpHypo_cos
 
 # Setup for 2016 SCT only non collision bacground filtering
+# 2016: 50 SP, 2017 Sep+: 100 SP 
 L2MbSpHypo_ncb = MbSpHypo("L2MbSpHypo_ncb")
 L2MbSpHypo_ncb.AcceptAll = False
 L2MbSpHypo_ncb.Veto = False
 L2MbSpHypo_ncb.TriggerTypeAND = False # SCT only
-L2MbSpHypo_ncb.SctSpEndcaps_cut = 50 # max(SCT_EC_A, SCT_EC_C)
+L2MbSpHypo_ncb.SctSpEndcaps_cut = 100 # max(SCT_EC_A, SCT_EC_C)
 L2MbSpHypo_ncb.TotalPixelClus = -1. # Disable
 L2MbSpHypo_ncb.PixelClusRatioA = -1. # Disable
 L2MbSpHypo_ncb.PixelClusRatioB = -1. # Disable
diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.cxx b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.cxx
index 41f9627aabb4ed8fd7547af76a6980d939c7e6f1..8c7e633895ed93ef2de1ff8474583f991570a36c 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.cxx
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.cxx
@@ -12,8 +12,7 @@ TrigTRTHTHhypo::TrigTRTHTHhypo(const std::string& name, ISvcLocator* pSvcLocator
   m_minTRTHTHitsWedge(0),
   m_minHTratioWedge(0.),
   m_doWedge(0),
-  m_doRoad(0),
-  m_minCaloE(0.)
+  m_doRoad(0)
 {
   declareProperty("AcceptAll",         m_acceptAll = false ); 
   declareProperty("MinTRTHTHitsRoad",  m_minTRTHTHitsRoad = 20); 
diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.h b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.h
index c1e49397497986c5df4bdad95e0226a98ac2ddce..f47b83f0aef2d188a3caa626e60e1f8605f26199 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.h
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypo.h
@@ -38,6 +38,5 @@ class TrigTRTHTHhypo: public HLT::HypoAlgo {
   float        m_minHTratioWedge;
   unsigned int m_doWedge;
   unsigned int m_doRoad;
-  float        m_minCaloE;
 };
 #endif
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
index 0c7c5d7f20380d35dfd7a50704d3fec3334c179a..0dde295f59bb58f936c5b790e851f0d158a221ea 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
@@ -725,7 +725,50 @@ def getTauGenericPi0Cone():
     cached_instances[_name] = TauGenericPi0Cone
     return TauGenericPi0Cone
 
-#end
+########################################################################
+# TauGenericPi0Cone
+def getTauTrackClassifier():
+
+    _name = sPrefix + 'TauTrackClassifier'
+
+    if _name in cached_instances:
+        return cached_instances[_name]
+    
+    from AthenaCommon.AppMgr import ToolSvc
+    from tauRecTools.tauRecToolsConf import tauRecTools__TauTrackClassifier as TauTrackClassifier
+    from tauRecTools.tauRecToolsConf import tauRecTools__TrackMVABDT as TrackMVABDT
+
+    import PyUtils.RootUtils as ru
+    ROOT = ru.import_root()
+    import cppyy
+    cppyy.loadDictionary('xAODTau_cDict')
+
+    input_file_name = 'ftf_tracks_mva_classifier.root'
+    threshold = 0.5
+    # =========================================================================
+    _ftf_tracks_mva_bdt = TrackMVABDT(
+        name = _name + "_0",
+        # calibFolder='data/TrigTauRec',
+        calibFolder='TrigTauRec/00-11-01/',
+        inTrigger=True,
+        InputWeightsPath=input_file_name,
+        Threshold=threshold,
+        ExpectedFlag   = ROOT.xAOD.TauJetParameters.unclassified, 
+        SignalType     = ROOT.xAOD.TauJetParameters.classifiedIsolation, 
+        BackgroundType = ROOT.xAOD.TauJetParameters.classifiedCharged)
+    ToolSvc += _ftf_tracks_mva_bdt
+
+    classifier = TauTrackClassifier(
+        name=_name, 
+        Classifiers=[_ftf_tracks_mva_bdt])
+        # TauTrackContainerName=_DefaultTrigTauTrackContainer)
+    cached_instances[_name] = classifier
+    return classifier
+
+# end
+
+
+
 
 """ obsolete methods
 
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
index b448439d97e4de8fcaec067b87970abb24ed78a8..3b6038548488e315a2ffddca566de32936a41473 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
@@ -126,6 +126,7 @@ class TrigTauRecMerged_Tau2012 (TrigTauRecMerged) :
 
 
 class TrigTauRecMerged_TauPreselection (TrigTauRecMerged) :
+
         __slots__ = [ '_mytools']
         def __init__(self, name = "TrigTauRecMerged_TauPreselection"):
             super( TrigTauRecMerged_TauPreselection , self ).__init__( name )
@@ -191,7 +192,54 @@ class TrigTauRecMerged_TauPreselection (TrigTauRecMerged) :
             from AthenaCommon.BeamFlags import jobproperties
             self.BeamType = jobproperties.Beam.beamType()
             
+class TrigTauRecMerged_TauPreselectionMva (TrigTauRecMerged) :
+
+        __slots__ = [ '_mytools']
+        def __init__(self, name = "TrigTauRecMerged_TauPreselectionMva"):
+            super( TrigTauRecMerged_TauPreselectionMva , self ).__init__( name )
+            self._mytools = []
+            
+            # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
+            from TrigTauRec.TrigTauRecMonitoring import TrigTauRecValidationMonitoring, TrigTauRecOnlineMonitoring 
+            validation = TrigTauRecValidationMonitoring()        
+            online     = TrigTauRecOnlineMonitoring()
+                
+            from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
+            time = TrigTimeHistToolConfig("Time")
+            self.AthenaMonTools = [ time, validation, online ]
+
+            import TrigTauRec.TrigTauAlgorithmsHolder as taualgs
+            tools = []
+
+            taualgs.setPrefix("TrigTauPreselectionMva_")
+            
+            # Collection name
+            self.OutputCollection = "TrigTauRecPreselection"
+            
+            # Only include tools needed for pre-selection
             
+            tools.append(taualgs.getJetSeedBuilder())
+            tools.append(taualgs.getTauAxis())
+            tools.append(taualgs.getTauTrackFinder(applyZ0cut=True, maxDeltaZ0=1, prefix="TrigTauPreselection_", noSelector=False))
+            tools.append(taualgs.getTauTrackClassifier())
+            tools.append(taualgs.getEnergyCalibrationLC(correctEnergy=True, correctAxis=False, postfix='_onlyEnergy'))
+            tools.append(taualgs.getCellVariables(cellConeSize=0.2, prefix="TrigTauPreselection_"))
+            tools.append(taualgs.getTauCommonCalcVars())
+            tools.append(taualgs.getTauSubstructure())
+            tools.append(taualgs.getPileUpCorrection())
+
+
+            for tool in tools:
+                tool.inTrigger = True
+                tool.calibFolder = 'TrigTauRec/00-11-01/'
+                pass
+
+            self.Tools = tools
+                
+            from AthenaCommon.BeamFlags import jobproperties
+            self.BeamType = jobproperties.Beam.beamType()
+            
+
 class TrigTauRecMerged_TauFTK (TrigTauRecMerged) :
         __slots__ = [ '_mytools']
         def __init__(self, name = "TrigTauRecMerged_TauFTK"):
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx
index c3431802774941066734ed0f7f253607c0faf921..a5bff355ab51037db00f6d79bdb3eb4bd62da991 100755
--- a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx
+++ b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx
@@ -165,8 +165,7 @@ muComb::muComb(const std::string& name, ISvcLocator* pSvcLocator):
 
 HLT::ErrorCode muComb::hltInitialize()
 {
-   msg() << MSG::INFO << "Initializing " << name() << " - package version "
-         << PACKAGE_VERSION << endreq;
+  ATH_MSG_INFO("Initializing " << name() << " - package version " << PACKAGE_VERSION);
    //   msg() << MSG::INFO << ">>>>>>> MB DEVEL - LOCAL COPY <<<<<<<" << PACKAGE_VERSION << endreq;
    m_pStoreGate = store();
 
@@ -177,26 +176,24 @@ HLT::ErrorCode muComb::hltInitialize()
    if (m_useBackExtrapolatorG4) {
       StatusCode sc = m_backExtrapolatorG4.retrieve();
       if (sc.isFailure()) {
-         msg() << MSG::ERROR << "Could not retrieve " << m_backExtrapolatorG4 << endreq;
+	ATH_MSG_ERROR("Could not retrieve " << m_backExtrapolatorG4);
          return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
       } else {
-         msg() << MSG::INFO << "Retrieved tool " << m_backExtrapolatorG4 << endreq;
+	ATH_MSG_INFO("Retrieved tool " << m_backExtrapolatorG4);
       }
    }
 
    if (m_useAthenaFieldService) {
       if (!m_MagFieldSvc) service("AtlasFieldSvc", m_MagFieldSvc, /*createIf=*/ false).ignore();
       if (m_MagFieldSvc) {
-         msg() << MSG::INFO << "Retrieved AtlasFieldSvc " << endreq;
+	ATH_MSG_INFO("Retrieved AtlasFieldSvc ");
       } else {
-         msg() << MSG::ERROR << "Could not retrieve AtlasFieldSvc" << endreq;
+	ATH_MSG_ERROR("Could not retrieve AtlasFieldSvc");
          return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
       }
    }
 
-   msg() << MSG::INFO
-         << "Initialization completed successfully"
-         << endreq;
+   ATH_MSG_INFO("Initialization completed successfully");
 
    return HLT::OK;
 }
@@ -225,8 +222,8 @@ int muComb::drptMatch(double pt, double eta, double phi, double id_pt, double id
    // algo: 3 --> R match, MS pt
    // algo: 4 --> R match, infinite pt
    if (algo < 1 || algo > 4) {
-      msg() << MSG::DEBUG << " muComb::drptMatch wrong algo parameter, it is: " << algo
-            << " while must be in the range [1,4], match failed!!!" << endreq;
+     ATH_MSG_DEBUG(" muComb::drptMatch wrong algo parameter, it is: " << algo
+		   << " while must be in the range [1,4], match failed!!!");
       return 0;
    }
 
@@ -258,22 +255,20 @@ int muComb::drptMatch(double pt, double eta, double phi, double id_pt, double id
 
    if (tmp_dr > winDR)  passDR = false;
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Angular MU-ID match / dR / threshold / result:"
-         << " / " << tmp_dr
-         << " / " << winDR
-         << " / " << (passDR ? "true" : "false")
-         << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Angular MU-ID match / dR / threshold / result:"
+		 << " / " << tmp_dr
+		 << " / " << winDR
+		 << " / " << (passDR ? "true" : "false"));
 
    if (algo == 1 && winPt > 0) {
       double tmp_dpt = fabs(fabs(pt) - fabs(id_pt)) / CLHEP::GeV; //don't use charge info
       if (tmp_dpt > winPt) passPt = false;
-      msg() << MSG::DEBUG << m_test_string
-            << " REGTEST MU-ID match / dpt (GeV) / threshold (GeV) / result:"
-            << " / " << tmp_dpt
-            << " / " << winPt
-            << " / " << (passPt ? "true" : "false")
-            << endreq;
+      ATH_MSG_DEBUG(m_test_string
+		    << " REGTEST MU-ID match / dpt (GeV) / threshold (GeV) / result:"
+		    << " / " << tmp_dpt
+		    << " / " << winPt
+		    << " / " << (passPt ? "true" : "false"));
    }
 
    if (passDR && passPt) return 0;
@@ -420,7 +415,7 @@ int muComb::g4Match(const xAOD::L2StandAloneMuon* feature,
 
    //Masaki/Kunihiro treatment of TGC/RPC readout problems
    if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << " Enlarge phi matching error in case TGC/RPC readout failed. : " << feature->isRpcFailure() << " / " << feature->isTgcFailure() << endreq;
+     ATH_MSG_DEBUG(" Enlarge phi matching error in case TGC/RPC readout failed. : " << feature->isRpcFailure() << " / " << feature->isTgcFailure());
 
    if (feature->isTgcFailure() || feature->isRpcFailure()) extr_ephi *= 2.0;
 
@@ -435,26 +430,25 @@ int muComb::g4Match(const xAOD::L2StandAloneMuon* feature,
                               id_eta, id_eeta, id_phi, id_ephi, id_ptinv, id_eptinv, m_UseAbsPt);
 
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Resolution / OLDIdRes / IdRes / muFastRes / combRes:"
-         << " / " << std::setw(11) << id_eptinv_OLD / CLHEP::GeV
-         << " / " << std::setw(11) << id_eptinv / CLHEP::GeV
-         << " / " << std::setw(11) << extr_eptinv / CLHEP::GeV
-         << " / " << std::setw(11) << combPtRes / CLHEP::GeV
-         << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Resolution / OLDIdRes / IdRes / muFastRes / combRes:"
+		 << " / " << std::setw(11) << id_eptinv_OLD / CLHEP::GeV
+		 << " / " << std::setw(11) << id_eptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << extr_eptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << combPtRes / CLHEP::GeV);
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Momentum / IdPt / muFastPt  / CombPt :"
-         << " / " << std::setw(11) << 1. / id_ptinv / CLHEP::GeV
-         << " / " << std::setw(11) << 1. / extr_ptinv / CLHEP::GeV
-         << " / " << std::setw(11) << 1. / combPtInv / CLHEP::GeV << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Momentum / IdPt / muFastPt  / CombPt :"
+		 << " / " << std::setw(11) << 1. / id_ptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << 1. / extr_ptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << 1. / combPtInv / CLHEP::GeV);
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Chi2 / ndof // Chi2OLD / ndofOLD :"
-         << " / " << std::setw(11) << chi2
-         << " / " << std::setw(11) << ndof
-         << " // " << std::setw(11) << chi2_OLD
-         << " / " << std::setw(11) << ndof_OLD << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Chi2 / ndof // Chi2OLD / ndofOLD :"
+		 << " / " << std::setw(11) << chi2
+		 << " / " << std::setw(11) << ndof
+		 << " // " << std::setw(11) << chi2_OLD
+		 << " / " << std::setw(11) << ndof_OLD);
 
    //Cuts
    double winEtaSigma = m_WinEta_g4;
@@ -466,13 +460,12 @@ int muComb::g4Match(const xAOD::L2StandAloneMuon* feature,
       maxChi2     = m_Chi2Max_EC_g4;
    }
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST DeltaEta / DeltaPhi / WinEta / WinPhi:"
-         << " / " << std::setw(11) << fabs(deta)
-         << " / " << std::setw(11) << fabs(dphi)
-         << " / " << std::setw(11) << m_WeightEta_g4*winEtaSigma*sqrt(extr_eeta * extr_eeta)
-         << " / " << std::setw(11) << m_WeightPhi_g4*winPhiSigma*sqrt(extr_ephi * extr_ephi)
-         << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST DeltaEta / DeltaPhi / WinEta / WinPhi:"
+		 << " / " << std::setw(11) << fabs(deta)
+		 << " / " << std::setw(11) << fabs(dphi)
+		 << " / " << std::setw(11) << m_WeightEta_g4*winEtaSigma*sqrt(extr_eeta * extr_eeta)
+		 << " / " << std::setw(11) << m_WeightPhi_g4*winPhiSigma*sqrt(extr_ephi * extr_ephi));
 
    if (fabs(deta) > m_WeightEta_g4 * winEtaSigma * sqrt(extr_eeta * extr_eeta)) {
       return 4;
@@ -542,7 +535,7 @@ int muComb::mfMatch(const xAOD::L2StandAloneMuon* feature,
    double extr_eptinv = eptinv;
 
    //Masaki/Kunihiro treatment of TGC/RPC readout problems
-   msg() << MSG::DEBUG << " Enlarge phi matching error in case TGC/RPC readout failed. : " << feature->isRpcFailure() << " / " << feature->isTgcFailure() << endreq;
+   ATH_MSG_DEBUG(" Enlarge phi matching error in case TGC/RPC readout failed. : " << feature->isRpcFailure() << " / " << feature->isTgcFailure());
 
    if (feature->isTgcFailure() || feature->isRpcFailure()) extr_ephi *= 2.0;
 
@@ -553,24 +546,23 @@ int muComb::mfMatch(const xAOD::L2StandAloneMuon* feature,
                               id_eta, 0.0, id_phi, 0.0, id_ptinv, id_eptinv, m_UseAbsPt);
 
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Resolution / IdRes / muFastRes / combRes:"
-         << " / " << std::setw(11) << id_eptinv / CLHEP::GeV
-         << " / " << std::setw(11) << extr_eptinv / CLHEP::GeV
-         << " / " << std::setw(11) << combPtRes / CLHEP::GeV
-         << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Resolution / IdRes / muFastRes / combRes:"
+		 << " / " << std::setw(11) << id_eptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << extr_eptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << combPtRes / CLHEP::GeV);
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Momentum / IdPt / muFastPt  / CombPt :"
-         << " / " << std::setw(11) << 1. / id_ptinv / CLHEP::GeV
-         << " / " << std::setw(11) << 1. / ptinv / CLHEP::GeV
-         << " / " << std::setw(11) << 1. / combPtInv / CLHEP::GeV << endreq;
-
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST Chi2 / ndof :"
-         << " / " << std::setw(11) << chi2
-         << " / " << std::setw(11) << ndof << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Momentum / IdPt / muFastPt  / CombPt :"
+		 << " / " << std::setw(11) << 1. / id_ptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << 1. / ptinv / CLHEP::GeV
+		 << " / " << std::setw(11) << 1. / combPtInv / CLHEP::GeV);
 
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST Chi2 / ndof :"
+		 << " / " << std::setw(11) << chi2
+		 << " / " << std::setw(11) << ndof);
+		 
    //Cuts
    double winEtaSigma = m_WinEta;
    double winPhiSigma = m_WinPhi;
@@ -595,13 +587,12 @@ int muComb::mfMatch(const xAOD::L2StandAloneMuon* feature,
       maxChi2     = m_Chi2Max_FE;
    }
 
-   msg() << MSG::DEBUG << m_test_string
-         << " REGTEST DeltaEta / DeltaPhi / WinEta / WinPhi:"
-         << " / " << std::setw(11) << fabs(deta)
-         << " / " << std::setw(11) << fabs(dphi)
-         << " / " << std::setw(11) << m_WeightEta*winEtaSigma*sqrt(extr_eeta * extr_eeta)
-         << " / " << std::setw(11) << m_WeightPhi*winPhiSigma*sqrt(extr_ephi * extr_ephi)
-         << endreq;
+   ATH_MSG_DEBUG(m_test_string
+		 << " REGTEST DeltaEta / DeltaPhi / WinEta / WinPhi:"
+		 << " / " << std::setw(11) << fabs(deta)
+		 << " / " << std::setw(11) << fabs(dphi)
+		 << " / " << std::setw(11) << m_WeightEta*winEtaSigma*sqrt(extr_eeta * extr_eeta)
+		 << " / " << std::setw(11) << m_WeightPhi*winPhiSigma*sqrt(extr_ephi * extr_ephi));
 
    if (fabs(deta) > m_WeightEta * winEtaSigma * sqrt(extr_eeta * extr_eeta)) {
       return 4;
@@ -657,14 +648,13 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
          solenoidOn = m_MagFieldSvc->solenoidOn() && !m_assumeSolenoidOff;
       }
    }
-   if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "=========== Magnetic Field Status ========== " << endreq;
-      msg() << MSG::DEBUG << " B Fields read from AthenaFieldService:   " << (m_useAthenaFieldService ? "TRUE" : "FALSE") << endreq;
-      msg() << MSG::DEBUG << " Assuming Toroid OFF is:                  " << (m_assumeToroidOff ? "TRUE" : "FALSE") << endreq;
-      msg() << MSG::DEBUG << " Assuming Solenoid OFF is:                " << (m_assumeSolenoidOff ? "TRUE" : "FALSE") << endreq;
-      msg() << MSG::DEBUG << " ---> Solenoid : " << ((solenoidOn) ? "ON" : "OFF") << endreq;
-      msg() << MSG::DEBUG << " ---> Toroid   : " << ((toroidOn) ?   "ON" : "OFF") << endreq;
-   }
+   ATH_MSG_DEBUG("=========== Magnetic Field Status ========== ");
+   ATH_MSG_DEBUG(" B Fields read from AthenaFieldService:   " << (m_useAthenaFieldService ? "TRUE" : "FALSE"));
+   ATH_MSG_DEBUG(" Assuming Toroid OFF is:                  " << (m_assumeToroidOff ? "TRUE" : "FALSE"));
+   ATH_MSG_DEBUG(" Assuming Solenoid OFF is:                " << (m_assumeSolenoidOff ? "TRUE" : "FALSE"));
+   ATH_MSG_DEBUG(" ---> Solenoid : " << ((solenoidOn) ? "ON" : "OFF"));
+   ATH_MSG_DEBUG(" ---> Toroid   : " << ((toroidOn) ?   "ON" : "OFF"));
+
 
    // Algorithm strategy
    // select best matchinig strategy
@@ -681,26 +671,21 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
       else          usealgo = 4;           //simple R-match w/o extrapolation (pt inf)
    }
 
-   if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << "MuCombStrategy: " << usealgo << endreq;
-
-   if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "=========== Matching windows g4 ========== " << endreq;
-      msg() << MSG::DEBUG << " WinEtaSigma g4: " << m_WinEta_g4 << endreq;
-      msg() << MSG::DEBUG << " WinPhiSigma g4: " << m_WinPhi_g4 << endreq;
-      msg() << MSG::DEBUG << " WinEtaSigma g4 EC: " << m_WinEta_EC_g4 << endreq;
-      msg() << MSG::DEBUG << " WinPhiSigma g4 EC: " << m_WinPhi_EC_g4 << endreq;
-      msg() << MSG::DEBUG << " WeightEta g4: " << m_WeightEta_g4 << endreq;
-      msg() << MSG::DEBUG << " WeightPhi g4: " << m_WeightPhi_g4 << endreq;
-      msg() << MSG::DEBUG << " Chi2Weight g4: " << m_Chi2Weight_g4 << endreq;
-      msg() << MSG::DEBUG << " " << endreq;
-   }
+   ATH_MSG_DEBUG("MuCombStrategy: " << usealgo);
+
+   ATH_MSG_DEBUG("=========== Matching windows g4 ========== ");
+   ATH_MSG_DEBUG(" WinEtaSigma g4: " << m_WinEta_g4);
+   ATH_MSG_DEBUG(" WinPhiSigma g4: " << m_WinPhi_g4);
+   ATH_MSG_DEBUG(" WinEtaSigma g4 EC: " << m_WinEta_EC_g4);
+   ATH_MSG_DEBUG(" WinPhiSigma g4 EC: " << m_WinPhi_EC_g4);
+   ATH_MSG_DEBUG(" WeightEta g4: " << m_WeightEta_g4);
+   ATH_MSG_DEBUG(" WeightPhi g4: " << m_WeightPhi_g4);
+   ATH_MSG_DEBUG(" Chi2Weight g4: " << m_Chi2Weight_g4);
+   ATH_MSG_DEBUG(" ");
 
    // Decode TE
-   if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "outputTE->getId(): " << outputTE->getId() << endreq;
-      msg() << MSG::DEBUG << "inputTE->getId(): " << inputTE->getId() << endreq;
-   }
+   ATH_MSG_DEBUG("outputTE->getId(): " << outputTE->getId());
+   ATH_MSG_DEBUG("inputTE->getId(): " << inputTE->getId());
 
    // Get input for seeding
    const xAOD::L2StandAloneMuonContainer* const_muonColl(0);
@@ -712,7 +697,7 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
       if (usealgo == 2) {
          useL1 = true;
       } else {
-         msg() << MSG::ERROR << " L2StandAloneMuonContainer not found --> ABORT" << endreq;
+	ATH_MSG_ERROR(" L2StandAloneMuonContainer not found --> ABORT");
          return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);
       }
    }
@@ -735,10 +720,10 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
    if (muonSA->pt() == 0.) {
       m_ErrorFlagMC = 1;
       if (usealgo == 2 || usealgo == 4) {
-         if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " L2StandAloneMuon pt = 0 --> using angular match" << endreq;
+	ATH_MSG_DEBUG(" L2StandAloneMuon pt = 0 --> using angular match");
          if (usealgo == 2) useL1 = true;
       } else {
-         if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " L2StandAloneMuon pt = 0 --> stop processing RoI" << endreq;
+	ATH_MSG_DEBUG(" L2StandAloneMuon pt = 0 --> stop processing RoI");
          muonCB->setErrorFlag(m_ErrorFlagMC);
          muonCBColl->push_back(muonCB);
          return muCombSeed(outputTE, muonCBColl);
@@ -757,8 +742,8 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
    if (useL1) {
       const LVL1::RecMuonRoI* muonRoI;
       if (HLT::OK != getFeature(inputTE, muonRoI, "")) {
-         msg() << MSG::DEBUG << "Could not find the LVL1 roi" << endreq;
-         msg() << MSG::DEBUG << "L2StandAloneMuon pt == 0. && no L1 && torid=OFF --> no match" << endreq;
+         ATH_MSG_DEBUG("Could not find the LVL1 roi");
+         ATH_MSG_DEBUG("L2StandAloneMuon pt == 0. && no L1 && torid=OFF --> no match");
          m_ErrorFlagMC = 1;
          muonCB->setErrorFlag(m_ErrorFlagMC);
          return muCombSeed(outputTE, muonCBColl);
@@ -767,12 +752,9 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
          etaL1 = muonRoI->eta();
          phiL1 = muonRoI->phi();
       }
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG
-               << "Input L1 muon pt (GeV) = " << ptL1
-               << " / eta = "                 << etaL1
-               << " / phi = "                 << phiL1
-               << endreq;
+      ATH_MSG_DEBUG("Input L1 muon pt (GeV) = " << ptL1
+		    << " / eta = "                 << etaL1
+		    << " / phi = "                 << phiL1);
    } else {
       // Save SA muon EL into CB muon
       ElementLink<xAOD::L2StandAloneMuonContainer> muonSAEL(*muonColl, 0);
@@ -785,15 +767,12 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
       phi_ms   = muonSA->phiMS();
       zeta_ms  = muonSA->zMS();
 
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG
-               << "Input L2StandaloneMuon pt (GeV) = " << pt
-               << " / eta = "                    << eta
-               << " / phi = "                    << phi
-               << " / etaMS = "                  << eta_ms
-               << " / phiMS = "                  << phi_ms
-               << " / zMS = "                    << zeta_ms
-               << endreq;
+      ATH_MSG_DEBUG("Input L2StandaloneMuon pt (GeV) = " << pt
+		    << " / eta = "                    << eta
+		    << " / phi = "                    << phi
+		    << " / etaMS = "                  << eta_ms
+		    << " / phiMS = "                  << phi_ms
+		    << " / zMS = "                    << zeta_ms);
    }
 
    // ID tracks Decoding
@@ -803,21 +782,19 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
    status = getFeature(outputTE, idTrackParticles, algoId);
 
    if (status != HLT::OK) {
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG << " Failed to get " << algoId << " xAOD::TrackParticleContainer --> ABORT" << endreq;
-      m_ErrorFlagMC = 2;
-      return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);
+     ATH_MSG_DEBUG(" Failed to get " << algoId << " xAOD::TrackParticleContainer --> ABORT");
+     m_ErrorFlagMC = 2;
+     return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);
    }
    if (!idTrackParticles) {
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG << "Pointer to xAOD::TrackParticleContainer[" << algoId << "] = 0 --> no match" << endreq;
+     ATH_MSG_DEBUG("Pointer to xAOD::TrackParticleContainer[" << algoId << "] = 0 --> no match");
       m_ErrorFlagMC = 2;
       muonCB->setErrorFlag(m_ErrorFlagMC);
       muonCBColl->push_back(muonCB);
       return muCombSeed(outputTE, muonCBColl);
    }
 
-   if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " Got xAOD::TrackParticleContainer with size: " << idTrackParticles->size() << endreq;
+   ATH_MSG_DEBUG(" Got xAOD::TrackParticleContainer with size: " << idTrackParticles->size());
 
    // matching
    double ptinv_comb = 0.;
@@ -848,9 +825,8 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
 
       // Check if event timeout was reached
       if (Athena::Timeout::instance().reached()) {
-         if (msgLvl() <= MSG::DEBUG)
-            msg() << MSG::DEBUG << "Timeout reached. Trk loop, Aborting sequence." << endreq;
-         return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT);
+	ATH_MSG_DEBUG("Timeout reached. Trk loop, Aborting sequence.");
+	return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT);
       }
 
       //Select tracks
@@ -870,27 +846,25 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
       double theta_id = (*trkit)->theta();
       if (sin(theta_id) != 0) e_qoverpt_id /= fabs(sin(theta_id)); //approximate
 
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG << "Found track: "
-               << "  with pt (GeV) = " << pt_id / CLHEP::GeV
-               << ", q    = " << q_id
-               << ", eta  = " << eta_id
-               << ", phi  = " << phi_id
-               << ", th   = " << theta_id
-               << ", ephi = " << e_phi_id
-               << ", eth  = " << e_theta_id
-               << ", eeta = " << e_eta_id
-               << ", ip   = " << qoverp_id
-               << ", eip  = " << e_qoverp_id
-               << ", eipt = " << e_qoverpt_id
-               << endreq;
+      ATH_MSG_DEBUG("Found track: "
+		    << "  with pt (GeV) = " << pt_id / CLHEP::GeV
+		    << ", q    = " << q_id
+		    << ", eta  = " << eta_id
+		    << ", phi  = " << phi_id
+		    << ", th   = " << theta_id
+		    << ", ephi = " << e_phi_id
+		    << ", eth  = " << e_theta_id
+		    << ", eeta = " << e_eta_id
+		    << ", ip   = " << qoverp_id
+		    << ", eip  = " << e_qoverp_id
+		    << ", eipt = " << e_qoverpt_id);
 
       if (usealgo != 3) {
          if ((fabs(pt_id) / CLHEP::GeV) < m_PtMinTrk)       continue;
       }
       if (fabs(eta_id)  > m_EtaMaxTrk)      continue;
 
-      if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Track selected " << endreq;
+      ATH_MSG_DEBUG("Track selected ");
 
       if (usealgo > 0) {//DeltaR match
          if (useL1) {
@@ -904,17 +878,15 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
             imatch_tmp = mfMatch(muonSA, eta_id, phi_id, pt_id, q_id, ptinv_tmp, ptres_tmp, deta_tmp, dphi_tmp, chi2_tmp, ndof_tmp);
             if (imatch_tmp == 0) has_match_tmp = true;
             if (Athena::Timeout::instance().reached()) {
-               if (msgLvl() <= MSG::DEBUG)
-                  msg() << MSG::DEBUG << "Timeout reached. mfMatch backextrapolation, Aborting sequence." << endreq;
+	      ATH_MSG_DEBUG("Timeout reached. mfMatch backextrapolation, Aborting sequence.");
                return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT);
             }
          } else { //G4 match
             imatch_tmp = g4Match(muonSA, eta_id, phi_id, pt_id, q_id, e_eta_id, e_phi_id, e_qoverpt_id, ptinv_tmp, ptres_tmp, deta_tmp, dphi_tmp, chi2_tmp, ndof_tmp);
             if (imatch_tmp == 0) has_match_tmp = true;
             if (Athena::Timeout::instance().reached()) {
-               if (msgLvl() <= MSG::DEBUG)
-                  msg() << MSG::DEBUG << "Timeout reached. g4Match backextrapolation, Aborting sequence." << endreq;
-               return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT);
+	      ATH_MSG_DEBUG("Timeout reached. g4Match backextrapolation, Aborting sequence.");
+	      return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::TIMEOUT);
             }
          }
       }
@@ -959,8 +931,7 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
       m_ErrorFlagMC = 3;
       m_MatchFlagMC = imatch;
       if (usealgo == 0 && fabs(pt) >= 6.)  m_efficiency = 0; //monitor only efficiency for mu6 && standard matching
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG << " No matched ID tracks --> no match" << endreq;
+      ATH_MSG_DEBUG(" No matched ID tracks --> no match");
       muonCB->setErrorFlag(m_ErrorFlagMC);
       muonCB->setMatchFlag(m_MatchFlagMC);
       muonCBColl->push_back(muonCB);
@@ -978,8 +949,7 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
    //const Trk::Perigee& idtrk_perigee = muonCB->idTrack()->perigeeParameters();
    double zPos_id      = muonCB->idTrack()->z0(); //idtrk_perigee.parameters()[Trk::z0];
 
-   if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << " SA muon macthed to ID track ..." << endreq;
+   ATH_MSG_DEBUG(" SA muon macthed to ID track ...");
 
    //Update monitored vars
    m_MatchFlagMC = imatch;
@@ -1006,9 +976,9 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
 
    double prt_pt = pt;
    if (useL1) prt_pt = ptL1;
-   msg() << MSG::DEBUG << m_test_string << " REGTEST Combination chosen: "
-         << " usealgo / IdPt (GeV) / muonPt (GeV) / CombPt (GeV) / chi2 / ndof: "
-         << " / " << usealgo << " / " << pt_id*q_id / CLHEP::GeV << " / " << prt_pt << " / " << 1. / ptinv_comb / CLHEP::GeV << " / " << chi2_comb << " / " << ndof_comb << endreq;
+   ATH_MSG_DEBUG(m_test_string << " REGTEST Combination chosen: "
+		 << " usealgo / IdPt (GeV) / muonPt (GeV) / CombPt (GeV) / chi2 / ndof: "
+		 << " / " << usealgo << " / " << pt_id*q_id / CLHEP::GeV << " / " << prt_pt << " / " << 1. / ptinv_comb / CLHEP::GeV << " / " << chi2_comb << " / " << ndof_comb);
 
    muonCB->setPt(fabs(1. / ptinv_comb));
    muonCB->setEta(eta_id);
@@ -1020,8 +990,7 @@ HLT::ErrorCode muComb::hltExecute(const HLT::TriggerElement* inputTE,
    muonCB->setCharge(mcq);
 
    float mcresu = fabs(ptres_comb / (ptinv_comb * ptinv_comb));
-   if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << " SigmaPt (GeV) is: " << mcresu / CLHEP::GeV << endreq;
+   ATH_MSG_DEBUG(" SigmaPt (GeV) is: " << mcresu / CLHEP::GeV);
    muonCB->setSigmaPt(mcresu);
 
    muonCB->setErrorFlag(m_ErrorFlagMC);
@@ -1040,15 +1009,10 @@ muComb::muCombSeed(HLT::TriggerElement* outputTE, xAOD::L2CombinedMuonContainer*
    if (status != HLT::OK) {
       outputTE->setActiveState(false);
       delete muon_cont;
-      msg() << MSG::ERROR
-            << " Record of xAOD::L2CombinedMuonContainer in TriggerElement failed"
-            << endreq;
+      ATH_MSG_ERROR(" Record of xAOD::L2CombinedMuonContainer in TriggerElement failed");
       return status;
    } else {
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG
-               << " xAOD::L2CombinedMuonContainer attached to the TriggerElement"
-               << endreq;
+     ATH_MSG_DEBUG(" xAOD::L2CombinedMuonContainer attached to the TriggerElement");
    }
    // Temporary
    ElementLink<MuonFeatureContainer> pMuon(0, 0);
@@ -1056,14 +1020,9 @@ muComb::muCombSeed(HLT::TriggerElement* outputTE, xAOD::L2CombinedMuonContainer*
    CombinedMuonFeature* muon_feature = new CombinedMuonFeature(0., -1.0, 1.0, 0, 0, 0, pMuon, pTrack);
    status = attachFeature(outputTE, muon_feature);
    if (status != HLT::OK) {
-      msg() << MSG::ERROR
-            << " Record of fake/empty CombinedMuonFeature in TriggerElement failed"
-            << endreq;
+     ATH_MSG_ERROR(" Record of fake/empty CombinedMuonFeature in TriggerElement failed");
    } else {
-      if (msgLvl() <= MSG::DEBUG)
-         msg() << MSG::DEBUG
-               << " fake/empty CombinedMuonFeature attached to the TriggerElement"
-               << endreq;
+     ATH_MSG_DEBUG(" fake/empty CombinedMuonFeature attached to the TriggerElement");
    }
    outputTE->setActiveState(true);
    return HLT::OK;
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h
index 72abbdc279c237533fac774c22a2da22e61b1f3a..4e9f3cf6299337de4dc67177fbd31612ced56e5e 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h
@@ -169,7 +169,8 @@ inline std::ostream& operator<<( std::ostream& s, const TIDA::Track& t) {
 	    << "\talgo=" << t.author()
             << "\tbl="   << t.bLayerHits() 
             << ":"  << ( t.expectBL() ? "t" : "f" )
-	    << "\tid=0x" << std::hex << t.id() << std::dec
+            << ":"  << ( t.hasTruth() ? "t" : "f" )
+	    << "\tid=0x" << std::hex << t.id() << std::dec << std::hex << t.barcode() << std::dec
 	    << "\t] ";
 }
 
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/dataset.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/dataset.h
index 30bee7d459e52b42fb366c0bd1ba9c55b3cd6dc6..fc686eda89f6e74e0f76589066819ecb21561999 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/dataset.h
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/dataset.h
@@ -47,7 +47,7 @@ public:
       while( !infile.fail() ) {
 	std::string file;
 	infile >>  file;
-	if ( !infile.fail() && file.find(".root")!=std::string::npos ) push_back( s+"/"+file );
+	if ( !infile.fail() && file.find(".root")!=std::string::npos && file.find(".part")==std::string::npos ) push_back( s+"/"+file );
       }
 
       //      for ( unsigned i=size() ; i-- ; ) std::cout << at(i) << std::endl;
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
index 2c130ba4168fff6df05556fbc97916ec01e73d55..c568a927f6dcdde48e46fca3aa74e647dad6b034 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
@@ -21,6 +21,7 @@
 
 #include "TrigInDetAnalysisUtils/Associator_BestMatch.h"
 #include "TrigInDetAnalysisUtils/Filters.h"
+#include "TrigInDetAnalysisUtils/Filter_Offline2017.h"
 #include "TrigInDetAnalysisExample/NtupleTrackSelector.h"
 #include "TrigInDetAnalysisExample/ChainString.h"
 #include "TrigInDetAnalysisUtils/Associator_TruthMatch.h"
@@ -181,6 +182,56 @@ std::ostream& operator<<(std::ostream& s, const std::vector<T>& v ) {
 }
 
 
+const std::vector<TIDA::Track> ibl_filter( const std::vector<TIDA::Track>& tv ) { 
+
+  static TH2D* h  = 0;
+  static TH2D* h2 = 0;
+
+  static int ic = 0;
+
+
+  if ( h==0 ) { 
+    h  = new TH2D( "hzvphi",  "hzvphi", 150, -300, 300, 150, -M_PI, M_PI ); 
+    h2 = new TH2D( "hzvphi2", "hzvphi", 150, -300, 300, 150, -M_PI, M_PI ); 
+  }
+
+  for ( size_t i=tv.size() ; i-- ; ) { 
+    
+    if ( tv[i].author()!=5 ) break;
+
+    double eta = tv[i].eta();
+      
+    double theta = 2*std::atan(-std::exp(eta));
+
+    double ribl = 34.2; // actually 32.26 - 36.21 mm
+
+    double z = tv[i].z0() + ribl/std::tan(theta);
+
+    if ( !tv[i].expectBL() ) { 
+      std::cout << "missing IBL: phi: " << tv[i].phi() << "\tz: " << z << " (" << eta << " " << theta*180/3.14159 << ")" << std::endl; 
+      if ( h ) h->Fill( z, tv[i].phi() );
+    }
+    else { 
+      if ( h2 ) h2->Fill( z, tv[i].phi() );
+    }
+  }
+
+  if ( ic>=500 ) { 
+    ic = 0;
+    if ( h ) { 
+      h->DrawCopy();
+      gPad->Print("zphimap.pdf");
+      h2->DrawCopy();
+      gPad->Print("zphimap2.pdf");
+    }
+  }
+
+  ic++;
+
+  return tv;
+}
+
+
 const std::vector<TIDA::Track> replaceauthor( const std::vector<TIDA::Track>& tv, int a0=5, int a1=4 ) { 
 
   if ( a0==a1 ) return tv;
@@ -835,7 +886,7 @@ int main(int argc, char** argv)
   Filter_Author    filter_auth(author);
 
   Filter_TrackQuality filter_q(0.01);  
-  Filter_Combined   filter_off (&filter_offline, &filter_vertex);
+  Filter_Combined   filter_off(&filter_offline, &filter_vertex);
 
   Filter_Combined  filter_truth( &filter_pdgtruth, &filter_etaPT);
 
@@ -849,21 +900,42 @@ int main(int argc, char** argv)
   Filter_Combined   filter_offtight( &filter_offkinetight, &filter_inout ); 
 
 
+
+  Filter_Offline2017* filter_offline2017 = 0;
+  Filter_Combined*    filter_off2017     = 0;
   /// track selectors so we can select multiple times with different 
   /// filters if we want (simpler then looping over vectors each time 
 
   TrackFilter* refFilter;
   TrackFilter* truthFilter;
-  if      ( refChain=="Offline" )            refFilter = &filter_off;
-  else if ( contains(refChain,"Electrons") ) refFilter = &filter_off;
-  else if ( contains( refChain, "Muons" ) )  refFilter = &filter_muon;
-  else if ( contains( refChain,"1Prong" ) )  refFilter = &filter_off;  // tau ref chains
-  else if ( contains( refChain,"3Prong" ) )  refFilter = &filter_off;  // tau ref chains
-  else if ( refChain=="Truth" && pdgId!=0 )  refFilter = &filter_truth;
-  else if ( refChain=="Truth" && pdgId==0 )  refFilter = &filter_off;
+
+
+  if ( inputdata.isTagDefined("Filter" ) ) { 
+    ChainString filter = inputdata.GetString("Filter");
+    std::cout << "Filter: " << inputdata.GetString("Filter") << " : " << filter << std::endl;
+    if ( filter.head()=="Offline2017" ) {
+      std::string filter_type = filter.tail();
+      filter_offline2017 = new Filter_Offline2017( pT, filter_type ); 
+      filter_off2017     = new Filter_Combined ( filter_offline2017, &filter_vertex);
+      refFilter = filter_off2017;
+    }
+    else { 
+      std::cerr << "unimplemented Filter requested: " << filter.head() << std::endl; 
+      return -1; 
+    }
+  }
   else { 
-    std::cerr << "unknown reference chain defined" << std::endl;
-    return (-1);
+    if      ( refChain=="Offline" )             refFilter = &filter_off;
+    else if ( contains( refChain,"Electrons") ) refFilter = &filter_off;
+    else if ( contains( refChain, "Muons" ) )   refFilter = &filter_muon;
+    else if ( contains( refChain,"1Prong" ) )   refFilter = &filter_off;  // tau ref chains
+    else if ( contains( refChain,"3Prong" ) )   refFilter = &filter_off;  // tau ref chains
+    else if ( refChain=="Truth" && pdgId!=0 )   refFilter = &filter_truth;
+    else if ( refChain=="Truth" && pdgId==0 )   refFilter = &filter_off;
+    else { 
+      std::cerr << "unknown reference chain defined" << std::endl;
+      return (-1);
+    }
   }
 
   if (pdgId==0) truthFilter = &filter_off;
@@ -1082,14 +1154,11 @@ int main(int argc, char** argv)
   }
   
 
-  //NtupleTrackSelector  roiTracks( refFilter );
+  // NtupleTrackSelector  roiTracks( refFilter );
 
 
   /// track selectors for purities
 
-  //  NtupleTrackSelector  refPurityTracks( &filter_offtight );
-  //  NtupleTrackSelector  testPurityTracks( &filter_online );
-
   NtupleTrackSelector  refPurityTracks( &filter_inout );
   NtupleTrackSelector  testPurityTracks( &filter_online );
 
@@ -1465,6 +1534,10 @@ int main(int argc, char** argv)
       for ( unsigned iv=0 ; iv<mv.size() ; iv++ ) vertices.push_back( mv[iv] );
     }
     
+    
+    if ( vertices.size()>0 ) std::cout << "vertex " << vertices[0] << std::endl;
+    else                     std::cout << "NO vertex !!!" << std::endl;
+
     /// always push back the vector - if required there will be only one vertex on it
     filter_vertex.setVertex( vertices );
 
@@ -1501,6 +1574,7 @@ int main(int argc, char** argv)
 	refchain = &chains[ic];
      	foundReference = true;
 	//Get tracks from within reference roi
+        //        ibl_filter( chains[ic].rois()[0].tracks() ); 
 	refTracks.selectTracks( chains[ic].rois()[0].tracks() );
 	break;
       }
@@ -1555,16 +1629,6 @@ int main(int argc, char** argv)
 	/// do we want to filter on the RoI properties? 
 	/// If so, if the RoI fails the cuts, then skip this roi
 
-
-	// 	std::cout << "\nfilterRoi: " << filterRoi << "\t" << chain.name() << std::endl;
-	// 	if ( filterRoi ) { 
-	// 	  bool keeproi = roiFilter.filter( roi );
-	// 	  std::cout << "\t\t" << roiFilter << std::endl;
-	// 	  std::cout << "\t\t" << roi << std::endl; 
-	// 	  std::cout << "\tkeep roi:\t" << keeproi << std::endl;
-	// 	  if ( !keeproi ) continue; 
-	// 	}
-
 	if ( filterRoi && !roiFilter.filter( roi ) ) continue; 
 	
 	
@@ -1648,7 +1712,7 @@ int main(int argc, char** argv)
 	}
 	
 	testTracks.clear();
-	
+
 	testTracks.selectTracks( troi.tracks() );
 	
 	/// trigger tracks already restricted by roi - so no roi filtering required 
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/COPYING b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..7e0f595dc2e28e78b0e7c8645df83e8e60161143
--- /dev/null
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/COPYING
@@ -0,0 +1,674 @@
+                     GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/Filter_Offline2017.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/Filter_Offline2017.h
new file mode 100644
index 0000000000000000000000000000000000000000..a831f3de1370beaa313f6efdef904c2deef63ba1
--- /dev/null
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/Filter_Offline2017.h
@@ -0,0 +1,124 @@
+// emacs: this is -*- c++ -*-
+//
+//   @file    Filter_Offline2017.h        
+//
+//            Filter class to implement the 2017 CP recomendations
+//            on hadronic tracks as found in 
+//              https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TrackingCPPreRecsSummer2017
+// 
+//   Copyright (C) 2017 M.Sutton (sutt@cern.ch)    
+//
+//   This program is free software; you can redistribute it and/or
+//   modify it under the terms of the GNU General Public License
+//   as published by the Free Software Foundation; either version 2
+//   of the License, or (at your option) any later version.
+//    
+//   This program is distributed in the hope that it will be useful,
+//   but WITHOUT ANY WARRANTY; without even the implied warranty of
+//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//   GNU General Public License for more details.
+//   
+//   You should have received a copy of the GNU General Public License
+//   along with this program; if not, write to the Free Software
+//   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+//   MA  02110-1301, USA.
+//
+
+
+#ifndef TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H 
+#define TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H 
+
+#include <iostream>
+#include <cmath>
+
+#include "TrigInDetAnalysis/TrackFilter.h"
+#include "TrigInDetAnalysis/Track.h"
+#include "TrigInDetAnalysis/TIDARoiDescriptor.h"
+
+
+// generic selection cut selection function 
+
+class Filter_Offline2017 : public TrackFilter { 
+
+public:
+  
+  Filter_Offline2017(  double pTMin=1000, const std::string& type="tight" ) :  
+    m_pTMin(pTMin),
+    m_type(type)
+  {
+    if ( m_type!="loose" && m_type!="loose-primary" && m_type!="tight" ) { 
+      std::cerr << "Filter_Offline2017::type: " << m_type << "not recognised" << std::endl;
+      std::exit(-1);
+    }
+  } 
+
+  bool select(const TIDA::Track* t, const TIDARoiDescriptor* =0 ) { 
+    // Select track parameters
+    bool selected = true;
+    
+    int Nsi      = t->pixelHits()*0.5 + t->sctHits();
+    int Nsiholes = t->pixelHoles()+t->sctHoles();
+    
+    if ( m_type=="loose" ) { 
+      if ( std::fabs(t->eta())>2.5 || std::fabs(t->pT())<m_pTMin ) selected = false;
+    
+      // Select track silicon hit content
+      if( Nsi<7 )              selected = false;
+      if( Nsiholes>2 )         selected = false;
+      if ( t->pixelHoles()>1 ) selected = false;
+
+      //      if ( m_expectBL && ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1) )  selected = false;
+    }
+    else if ( m_type=="loose-primary" ) { 
+      if ( std::fabs(t->eta())>2.5 || std::fabs(t->pT())<m_pTMin ) selected = false;
+
+      // Select track silicon hit content
+      if ( ( Nsi<10 ) && ( Nsi<7 || Nsiholes>0 ) ) selected = false;
+
+
+    }
+    else if ( m_type=="tight" ) { 
+      if ( std::fabs(t->eta())>2.5 || std::fabs(t->pT())<m_pTMin ) selected = false;
+      
+      // Select track silicon hit content
+      if ( std::fabs(t->eta())< 1.65 && Nsi<9  ) selected = false;
+      if ( std::fabs(t->eta())>=1.65 && Nsi<11 ) selected = false;
+      
+      if ( t->pixelHoles()>0 ) selected = false;
+
+      /// require a blayer (ibl in run2) hit only if one is expected
+      if ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1 )  selected = false;
+    }
+
+    return selected;
+  } 
+
+private:
+
+  // selection 
+
+  double      m_pTMin;
+  std::string m_type;
+
+};
+
+
+
+
+
+inline std::ostream& operator<<( std::ostream& s, const Filter_Offline2017& ) { 
+  return s;
+}
+
+
+#endif  // TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H 
+
+
+
+
+
+
+
+
+
+
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
index 7e32edc8555212b21517040f4b84187eaba82f2b..33b70e4c9dff17a6300141b178c95710fab0de3e 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
@@ -18,7 +18,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( ROOT COMPONENTS Core Tree MathCore MathMore Hist RIO pthread )
 find_package( tdaq-common )
 
 # tag NEEDS_CORAL_BASE was not recognized in automatic conversion in cmt2cmake
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
index f8ff8341e843c54b86c42f9e539fbc65b8355ab7..200ad1724242b5b8779bca4a6d9592f8fa801d98 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
@@ -1729,6 +1729,119 @@ private:
 
 
 
+//////////////////////////////////////// CHECK NO L1CALO ITEM HAS THRESHOLD LOWER THAN IN MINTOBPT ////////////////////////////////////////
+class MinTOBPtCheck : public TrigConfTest {
+public:
+   MinTOBPtCheck()
+      : TrigConfTest("MinimumTOBPtCheck", "Check if all L1Calo items have threshold above MinTOBPt value", WARNING),
+        m_belowMinTOBpt("")
+   {}
+
+
+   virtual void execute(const Exc_t&) {
+     if ( !m_ctp ) return;
+
+     const TrigConf::CaloInfo caloinfo = m_ctp->menu().thresholdConfig().caloInfo();
+
+     unsigned int em_min  = caloinfo.minTobEM().ptmin;
+     unsigned int tau_min  = caloinfo.minTobTau().ptmin;
+     unsigned int Jsmall_min  = caloinfo.minTobJetSmall().ptmin;
+     unsigned int Jlarge_min  = caloinfo.minTobJetLarge().ptmin;
+
+     for(const TrigConf::TriggerThreshold* thr : m_ctp->menu().thresholdConfig().thresholdVector() ) {
+       if(thr->type() == "EM" || thr->type() == "TAU" || thr->type() == "JET"){
+
+         for( const TrigConf::TriggerThresholdValue* thrVal :  thr->thresholdValueVector() ) {
+
+	   if(thr->type() == "EM" && thrVal->ptcut() < em_min) m_belowMinTOBpt += thr->name() + ", ";
+	   if(thr->type() == "TAU" && thrVal->ptcut() < tau_min) m_belowMinTOBpt += thr->name() + ", ";
+
+	   if(thr->type() == "JET"){
+	     const TrigConf::JetThresholdValue* jetThrVal = dynamic_cast<const TrigConf::JetThresholdValue*>(thrVal);
+
+	     if(jetThrVal->windowSizeAsString() == "LARGE" && thrVal->ptcut() < Jlarge_min) m_belowMinTOBpt += thr->name() + ", ";
+	     if(jetThrVal->windowSizeAsString() == "SMALL" && thrVal->ptcut() < Jsmall_min) m_belowMinTOBpt += thr->name() + ", ";
+	   }
+	 }
+       }
+     }
+
+
+      if(m_belowMinTOBpt.size()>0) {
+         m_error = "L1 calo thresholds that are below the MinTOBPt: " + m_belowMinTOBpt;
+      }
+   }
+
+private:
+   std::string m_belowMinTOBpt;
+};
+
+
+
+
+//////////////////////////////////////// CHECK ALL PEB CHAINS GO INTO A CALIBRATION STREAM ////////////////////////////////////////
+class PEBCalibCheck : public TrigConfTest {
+public:
+  PEBCalibCheck()
+    : TrigConfTest("PEBCalibrationStream", "All streams with PEB must be of type calibration or monitoring", WARNING),
+      m_nonCalibPEB("")
+  {}
+
+  virtual void execute(const Exc_t&) {
+    if ( ! m_hlt ) return;
+
+
+    // find all sequences using PEB with the corresponding output TE
+    std::set<std::string> teOutFromSeq;
+
+    for (const TrigConf::HLTSequence* seq : m_hlt->getHLTSequenceList()) {
+      const std::vector<std::string>& algolist = seq->algorithms();
+
+      for( std::string algoname : algolist ){
+
+	if( algoname.find("TrigSubDetListWriter")!= std::string::npos || algoname.find("TrigROBListWriter")!= std::string::npos || algoname.find("ScoutingStreamWriter")!= std::string::npos){
+	  const std::string& tename = seq->outputTE()->name();
+
+	  if ( teOutFromSeq.count( tename ) == 0 ) {
+            teOutFromSeq.insert( tename);
+	  }
+
+	  //	  m_nonCalibPEB += algoname + ": " + tename + ", ";
+	}
+      }
+    }
+
+    //loop over chains comparing signature output TEs to PEB TEs
+    for(const HLTChain* ch : m_hlt->getHLTChainList()) {
+      for ( unsigned int s = 0; s < ch->signatureList().size(); s++ ) {
+	HLTSignature* sig = ch->signatureList()[s];
+	for ( unsigned int t = 0; t < sig->outputTEs().size(); ++t ) {
+	  if ( teOutFromSeq.count(sig->outputTEs()[t]->name()) != 0 ){
+
+	    for(const HLTStreamTag *s : ch->streams()) {
+
+	      //	      m_nonCalibPEB += ch->chain_name() + " stream type: " + s->type() + ", ";
+	      if ( s->type() != "calibration" && s->type() != "monitoring" )  m_nonCalibPEB += ch->chain_name() + ", stream: " + s->stream() + ", stream type: " + s->type() + ", ";
+	    }
+	  }
+
+	}
+      }
+    }
+
+    if(m_nonCalibPEB.size()>0) {
+      m_error = "Streams that use PEB but are not of type 'calibration':  " + m_nonCalibPEB;
+    }
+  }
+
+private:
+   std::string m_nonCalibPEB;
+};
+
+
+
+
+
 
 // set of tests
 ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFrame* hlt) {
@@ -1765,6 +1878,8 @@ ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFr
   m_tests.push_back(new L1SeedLenghtTest());
   //m_tests.push_back(new SignaturesConnectedTest());
 
+  m_tests.push_back(new MinTOBPtCheck());
+  m_tests.push_back(new PEBCalibCheck());
 
   std::vector<TrigConfTest*>::iterator testIt;
   for ( testIt = m_tests.begin(); 
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
index afbf50004bdceb2376989bb8478aa0b79668f885..7ce0d5be9b9ca2baddb9009df04dd6288541ee02 100755
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
@@ -17,7 +17,7 @@ using namespace TrigConf;
 
 XMLThresholdConfigLoader::XMLThresholdConfigLoader( XMLStorageMgr& sm, const ptree::value_type* pt ) : 
    XMLLoader("XMLThresholdConfigLoader", sm, pt)
-{};
+{}
 
 
 bool
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx
index ce7596882dd7c1338b7cadda72fa1213d8f7d4d3..3a3714e4a9bfc43fbec4f6bd633a985d73af5833 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx
@@ -346,10 +346,12 @@ JobConfig::PrintSetup(std::ostream & log, std::ostream& (*lineend) ( std::ostrea
    log << lineend;
    log << "----------" << lineend;
    log << "   Input               : ";
-   for(string s: inpar) log << s << ", "; log << lineend;
+   for(string s: inpar) log << s << ", ";
+   log << lineend;
    if( input2 != UNDEF ) {
       log << "   Input for comparison: ";
-      for(string s: inpar2) log << s << ", "; log << lineend;
+      for(string s: inpar2) log << s << ", ";
+      log << lineend;
    }
    if( output != UNDEF ) {
       log << "   Output              : ";
diff --git a/Trigger/TrigConfiguration/TrigDbHltUpload/share/buildConfigInstaller.sh b/Trigger/TrigConfiguration/TrigDbHltUpload/share/buildConfigInstaller.sh
index 4d7558230336ab0fa984201c66af230e1d95a8be..d501c55f9afeaf89c6660283b1aa527d7956ee73 100755
--- a/Trigger/TrigConfiguration/TrigDbHltUpload/share/buildConfigInstaller.sh
+++ b/Trigger/TrigConfiguration/TrigDbHltUpload/share/buildConfigInstaller.sh
@@ -8,7 +8,9 @@ echo "Self Extracting Menu TriggerDB Installer"
 echo ""
 
 export TMPDIR=\`mktemp -d /tmp/selfextract.XXXXXX\`
-export TRIGGER_EXP_CORAL_PATH=/afs/cern.ch/user/a/attrgcnf/.expertauth 
+unset TRIGGER_EXP_CORAL_PATH 
+export TRIGGER_EXP_CORAL_PATH_RUN2=/afs/cern.ch/user/a/attrgcnf/.dbauth/menuexperts
+
 ARCHIVE=\`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' \$0\`
 
 tail -n+\$ARCHIVE \$0 | tar xz -C \$TMPDIR
@@ -41,10 +43,11 @@ fi
 
 _JAVA_OPTIONS="-Xms250m -Xmx1400m"
 TTJAR=\${TRIGGERTOOL:-/afs/cern.ch/user/a/attrgcnf/TriggerTool/TriggerTool-new.jar}
+TTSH=\${TRIGGERTOOL:-/afs/cern.ch/user/a/attrgcnf/TriggerTool/run_TriggerTool.sh}
 DB=\${TRIGGERDB:-TRIGGERDBREPR}
 NAME=\${CONFIGNAME:-USEXML}
 
-CMD="java -jar \$TTJAR -db \$DB -up -l1  \$TARGET/lvl1Menu.xml -hlt \$TARGET/hltMenu.xml -l2s \$TARGET/l2setup.xml -efs \$TARGET/efsetup.xml \$p1ConfigTT -rel $2 -o \$TARGET/$1-\$TIME-UploadTT.log -n \$NAME"
+CMD="\$TTSH -db \$DB -up -l1  \$TARGET/lvl1Menu.xml -hlt \$TARGET/hltMenu.xml -l1topo \$TARGET/l1topoMenu.xml -efs \$TARGET/efsetup.xml \$p1ConfigTT -rel $2 -o \$TARGET/$1-\$TIME-UploadTT.log -n \$NAME"
 echo \$CMD
 
 echo ""
@@ -69,7 +72,7 @@ fi
 
 ARCHIVE=./payload_$1.tar.gz
 
-tar zcf $ARCHIVE -C setup/$1 ./lvl1Menu.xml ./hltMenu.xml ./l2setup.xml ./efsetup.xml
+tar zcf $ARCHIVE -C setup/$1 ./LVL1config.dtd ./lvl1Menu.xml ./hltMenu.xml ./l1topoMenu.xml ./efsetup.xml
 
 SELFEXTRACTFILE=selfextract-$1-`date +%F-%H-%M-%S`.bsx
 
diff --git a/Trigger/TrigConfiguration/TrigDbHltUpload/share/prepareOnlineTriggerConfig.py b/Trigger/TrigConfiguration/TrigDbHltUpload/share/prepareOnlineTriggerConfig.py
index a32c71c7e66aa7be018f798ebfde436391526002..fc13f686e770b6f902195e2cf7624bc0357bb6d0 100755
--- a/Trigger/TrigConfiguration/TrigDbHltUpload/share/prepareOnlineTriggerConfig.py
+++ b/Trigger/TrigConfiguration/TrigDbHltUpload/share/prepareOnlineTriggerConfig.py
@@ -2,8 +2,11 @@
 
 import sys, subprocess, tempfile, os, re, signal
 import __main__
-from PyQt4 import QtGui, QtCore
-from PyQt4.QtGui import QLabel, QCheckBox,QMessageBox
+from PyQt5 import QtCore, QtWidgets
+from PyQt5.QtWidgets import QLabel, QCheckBox, QMessageBox
+from PyQt5.QtGui import QColor, QPalette, QPixmap
+import timeit, socket, getpass
+from collections import OrderedDict
 
 class StringVar:
     def __init__(self,value=""):
@@ -39,11 +42,11 @@ class Option:
         if qtw!=None:
             self.qtw = qtw
         elif self.name=='userPreCommand':
-            self.qtw = QtGui.QTextEdit()
+            self.qtw = QtWidgets.QTextEdit()
             self.qtw.setMinimumHeight(60)
             self.qtw.textChanged.connect(self.textChanged)
         else:
-            self.qtw = QtGui.QLineEdit()
+            self.qtw = QtWidgets.QLineEdit()
             self.qtw.textEdited.connect(self.textEdited)
         self.set(value)
 
@@ -66,6 +69,9 @@ class BoolOption:
     def __init__(self, name, isChecked, description, label):
         self.name        = name
         self.cb          = QCheckBox(label)
+        palette = QPalette( self.cb.palette() )
+        palette.setColor( palette.WindowText, QColor("#ffffff") )    
+        self.cb.setPalette(palette)
         self.description = description
         self.cb.setCheckState(QtCore.Qt.Checked if isChecked else QtCore.Qt.Unchecked)
         self.cb.setToolTip(description)
@@ -84,10 +90,12 @@ class Process:
         self.w_label.setCheckState(QtCore.Qt.Checked)
         self.w_state     = QLabel()
         self.w_logfile   = QLabel()
+        button_style ="QPushButton {padding: 4px; font-size: 14px; color: #3a81c7; font-weight: bold; background-color: #ffffff; border-radius: 1px; border: 1px solid #3a81c7;}"
         if name == 'jobCheckRes':
-            self.w_showMT  = QtGui.QPushButton("Show MT Result")
-            self.w_showPT  = QtGui.QPushButton("Show PT Result")
-        self.w_clearbutton = QtGui.QPushButton("Clear")
+            self.w_showHLT  = QtWidgets.QPushButton("Show athenaHLT Result")
+            self.w_showHLT.setStyleSheet(button_style)
+        self.w_clearbutton = QtWidgets.QPushButton("Clear")
+        self.w_clearbutton.setStyleSheet(button_style)
 
     def __str__(self):
         return "### %s\nprocess['%s'] = (%i, '%s', '%s')\n" % (self.description, self.name, self.enabled, self.w_state.text(), self.logfile)
@@ -168,51 +176,52 @@ class Config:
         import os
         tempdir = os.environ["TMPDIR"] if "TMPDIR" in os.environ else (tempfile.gettempdir() + '/' + os.environ["USER"])
         # red 
-        self.addOption('release','',"The release tag",  'Release:'      , QtGui.QLabel())
-        self.addOption('patch',  '',"The patch tag",    'Patch:'        , QtGui.QLabel())
-        self.addOption('swpath','',"The software path", 'Software path:', QtGui.QLabel())
-        self.addOption('tt','/afs/cern.ch/user/a/attrgcnf/TriggerTool/TriggerTool-new.jar',"The TriggerTool jar-file", 'TriggerTool:')
+        self.addOption('release','',"The release tag number",  'Release number:'      , QtWidgets.QLabel())
+        self.addOption('relName',  '',"The release build name",    'Release build:'        , QtWidgets.QLabel())
+        self.addOption('swpath','',"The software path", 'Software path:', QtWidgets.QLabel())
+        self.addOption('tt','/afs/cern.ch/user/a/attrgcnf/TriggerTool/run_TriggerTool.sh',"The TriggerTool run script", 'TriggerTool:')
         # green
         self.addOption('jobName', 'Default',"Job name", 'Job name:')
         self.addOption('jobOption','',"The python job option file", 'Joboption file')
-        self.addOption('userPreCommand','',"The users precommands to be run", 'Pre-command:')
+        self.addOption('userPreCommand','',"The user pre-commands to be run", 'Pre-command:')
+        self.addOption('userPostCommand', '', "The post-commands to be run", 'Post-command:')
         self.addOption('setupDir','./setup',"Directory for setup and xml files (a subdir for each job is created)", 'Output directory:')
         self.addOption('tmpDir',tempdir,"Directory for temporary results", 'Temp directory:')
         self.addOption('nEvt',10,"Number of Events", 'Number of Events:')
-        self.addOption('inputL2','input.data',"Input data file L2", 'MT input data:')
-        self.addOption('inputEF','',          "Input data file EF", 'PT input data:')
+        self.addOption('inputBSFile','input.data',"Input bs file", 'Input file:')
         self.addOption('l1menu',   '',"LVL1 menu file",   'L1 menu:')
-        self.addOption('hltl2menu','',"HLT L2 menu file", 'L2 menu:')
-        self.addOption('hltefmenu','',"HLT EF menu file", 'EF menu:')
-        self.addOption('setupL2','',"Setup file L2", 'L2 setup:')
-        self.addOption('setupEF','',"Setup file EF", 'EF setup:')
+        self.addOption('l1topomenu','',"L1Topo menu file", 'L1Topo menu:')
+        self.addOption('hltmenu','',"HLT menu file", 'HLT menu:')
+        self.addOption('setupEF','',"EF Setup file", 'EF setup:')
         self.addOption('dbAlias','TRIGGERDBREPR',"Alias for TriggerDB connection", 'DB connection')
         self.addOption('dbPW','',"Password for writer accound (not needed by experts)", 'DB password')
-        self.addOption('cfgKey',0,"Configuration key", 'Configuration key:')
+        self.addOption('cfgKey',0,"Super Master key", 'Super master key:')
         self.addOption('l1psKey',0,"LVL1 prescale key", 'LVL1 prescale key:')
         self.addOption('hltpsKey',0,"HLT prescale key", 'HLT prescale key:')
         self.addBoolOption('onlineMonitoring', 'Online Monitoring', 'Online Monitoring switch (e.g. online histogram service)', True)
         self.addBoolOption('cafConfig', 'Reprocessing', 'Configuration for reprocessings (enable additional monitoring)', False)
-        self.addBoolOption('l1rerun', 'Rerun Level 1', 'Rerun level 1 simulation (should be on for CAF)', False)
-        self.dontStore('cafConfig', 'l1rerun', 'release', 'patch', 'swpath') # excempt from storage option to avoid accidental use for online
+        self.addBoolOption('l1rerun', 'Rerun Level 1', 'Rerun level 1 simulation (should be on for reprocessings if L1 menu has changed since last EB run)', False)
+        self.addBoolOption('doDBConfig', 'doDBConfig', 'Needs to be true to generate the text files for configuration', True)
+        self.dontStore('cafConfig', 'l1rerun', 'release', 'relName', 'swpath') # excempt from storage option to avoid accidental use for online
         # blue
-        self.addProcess('jobMTjo',     "Run athenaMT from JobOptions", 'run athenaMT from JO')
-        self.addProcess('jobPTjo',     "Run athenaPT from JobOptions", 'run athenaPT from JO')
-        self.addProcess('jobSetupCnv', "Run setup conversion script",  'convert setup')
-        self.addProcess('jobUploadDb', "Load TriggerDB",               'load TriggerDB')
-        self.addProcess('jobMTdb',     "Run athenaMT from TriggerDB",  'run athenaMT from DB')
-        self.addProcess('jobPTdb',     "Run athenaPT from TriggerDB",  'run athenaPT from DB')
-        self.addProcess('jobCheckRes', "Compare counts",               'check results')
+        self.addProcess('jobHLTjo',     "Run athenaHLT from JobOptions", 'Run athenaHLT from JO')
+        self.addProcess('jobSetupCnv', "Run setup conversion script",  'Convert ef setup')
+        self.addProcess('jobUploadDb', "Upload xmls to TriggerDB",               'Upload xmls to TriggerDB')
+        self.addProcess('jobHLTdb',     "Run athenaHLT from TriggerDB",  'Run athenaHLT from DB')
+        self.addProcess('jobCheckRes', "Compare counts",               'Compare athenaHLT results')
         self.jobOption.qtw.textChanged.connect(self.readMenus)
         self.cafConfig.cb.stateChanged.connect(self.toggleModifierCAF)
         self.l1rerun.cb.stateChanged.connect(self.toggleL1RerunOption)
+        self.doDBConfig.cb.stateChanged.connect(self.toggleDBConfigOption)
 
     def toggleModifierCAF(self):
-        self.setPreCommandModifier('caf', 'True' if self.cafConfig() else None)
+        self.setPreCommandModifier('enableCostForCAF', 'True' if self.cafConfig() else None)
 
     def toggleL1RerunOption(self):
         self.setPreCommandModifier('rerunLVL1', 'True' if self.l1rerun() else None)
 
+    def toggleDBConfigOption(self):
+        self.setPreCommandModifier('doDBConfig', 'True' if self.doDBConfig() else None)
 
     def read(self):
         if self.inputFile==None: return
@@ -222,7 +231,7 @@ class Config:
         print "Reading configuration from %s!" % self.inputFile
         execfile(self.inputFile,__main__.__dict__)
         for name, (value, desc) in option.iteritems():
-            if name in ['athenaMTjo','athenaMTdb','athenaPTjo','athenaPTdb','checkRes','uploadDb','setupCnv','mtJoLog', 'ptJoLog','mtDbLog', 'ptDbLog', 'cnvLog', 'loadDbLog']: continue  # for backward compatibility
+            if name in ['athenaHLTjo','athenaHLTdb','checkRes','uploadDb','setupCnv','mtJoLog', 'ptJoLog','mtDbLog', 'ptDbLog', 'cnvLog', 'loadDbLog']: continue  # for backward compatibility
             self.options[name].set(value)
         if 'process' in dir(__main__):
             for name, content in process.iteritems():
@@ -267,36 +276,39 @@ class Config:
                     end=i+1
                     break
             exec(''.join(lines[begin:end]))
-            self.menus = sorted(menuMap.keys())
+            self.menus = sorted(menuMap.keys()) 
         except:
             self.menus = None
 
     def setPreCommandModifier(self, name, value):
         pc = self.userPreCommand().strip(';')
-        mods = {} if not pc else dict([tuple(m.split('=')) for m in pc.split(';')])
+        mods = {} if not pc else OrderedDict([tuple(m.split('=')) if '=' in m else [m,''] for m in pc.split(';')])
+
         if value==None:
             if name in mods: mods.pop(name)
         else:
             mods[name] = value
-        pc = ';'.join(['='.join([k,v]) for k,v in sorted(mods.iteritems())])
+        pc = ';'.join(['='.join([k,v]) if v != '' else ''.join([k,v]) for k,v in mods.iteritems()])
         self.userPreCommand.set(pc)            
 
     def write(self):
         outputfile = 'myPref_%s.py' % self.jobName()
         print "Saving configuration to %s !" % outputfile
-        f = open(outputfile, 'w')
-        print >>f, 'option = {}'
-        print >>f, 'process = {}\n'
-        for opt in self.options:
-            if opt in self.excempt: continue
-            print >>f, self.options[opt]
-        for pro in self.processes:
-            if pro in self.excempt: continue
-            print >>f, self.processes[pro]
-        f.close()
-
-
-class KeyPrep(QtGui.QScrollArea):
+        try:
+          f = open(outputfile, 'w')
+          print >>f, 'option = {}'
+          print >>f, 'process = {}\n'
+          for opt in self.options:
+              if opt in self.excempt: continue
+              print >>f, self.options[opt]
+          for pro in self.processes:
+              if pro in self.excempt: continue
+              print >>f, self.processes[pro]
+          f.close()
+        except:
+          print "Error: couldn't write the configuration files, not sure why!" 
+ 
+class KeyPrep(QtWidgets.QScrollArea):
     def __init__(self, configFile, parent=None):
         super(KeyPrep,self).__init__(parent)
         self.config = Config(configFile)
@@ -306,11 +318,13 @@ class KeyPrep(QtGui.QScrollArea):
         self.layout()
         self.checkReleaseAndTT()
         self.updateMenuComboBox()
+        self.updateCommandBox()
+        self.checkMachine()
         self.runThread = KeyPrep.RunThread(self)
         self.currentSubprocess = None
 
-    def position(self, w=550, h=870, m=30):
-        desktop = QtGui.QApplication.desktop()
+    def position(self, w=675, h=870, m=30):
+        desktop = QtWidgets.QApplication.desktop()
         dw = desktop.availableGeometry().width()
         dh = desktop.availableGeometry().height()
         h = min(h,dh-2*m)
@@ -320,60 +334,74 @@ class KeyPrep(QtGui.QScrollArea):
     def elements(self):
         self.position()
         self.setWindowTitle('Prepare Trigger Configuration')
-
         self.gr_relconf = {
-            'box' : QtGui.QGroupBox("Release configuration"),
-            'cont': [ self.config.release, self.config.patch, self.config.swpath, self.config.tt ]
+            'box' : QtWidgets.QGroupBox("Release configuration"),
+            'cont': [ self.config.relName, self.config.release, self.config.swpath, self.config.tt ]
             }
-        self.gr_relconf['box'].setStyleSheet("QGroupBox { background-color: #8CDBFF; }");
-
+        self.gr_relconf['box'].setStyleSheet("QGroupBox { background-color: #3a81c7; color: #e2e2e2; font-weight: bold; font-size: 12pt; }")
 
         self.gr_setup = {
-            'box' : QtGui.QGroupBox("Job configuration"),
-            'cont': [ self.config.jobName, self.config.jobOption, self.config.userPreCommand, self.config.setupDir,
-                      self.config.tmpDir, self.config.dbAlias, self.config.dbPW, self.config.nEvt, self.config.inputL2,
-                      self.config.inputEF, self.config.l1menu, self.config.hltl2menu, self.config.hltefmenu,
-                      self.config.setupL2, self.config.setupEF, self.config.cfgKey, self.config.l1psKey, self.config.hltpsKey ]
+            'box' : QtWidgets.QGroupBox("Job configuration"),
+            'cont': [ self.config.jobName, self.config.jobOption, self.config.userPreCommand,self.config.userPostCommand, self.config.setupDir,
+                      self.config.tmpDir, self.config.dbAlias, self.config.dbPW, self.config.nEvt,
+                      self.config.inputBSFile, self.config.l1menu, self.config.l1topomenu, self.config.hltmenu,
+                      self.config.setupEF, self.config.cfgKey, self.config.l1psKey, self.config.hltpsKey ]
             }
-        self.gr_setup['box'].setStyleSheet("QGroupBox { background-color: #FFE430; }");
+        self.gr_setup['box'].setStyleSheet("QGroupBox { background-color: #7c7c7c; color: #ffffff;font-weight: bold; font-size: 12pt;  }");
 
         self.gr_run = {
-            'box' : QtGui.QGroupBox("Run state"),
-            'cont': [ self.config.jobMTjo, self.config.jobPTjo, self.config.jobSetupCnv, self.config.jobUploadDb,
-                      self.config.jobMTdb, self.config.jobPTdb, self.config.jobCheckRes ]
+            'box' : QtWidgets.QGroupBox("Run state"),
+            'cont': [ self.config.jobHLTjo, self.config.jobSetupCnv, self.config.jobUploadDb,
+                      self.config.jobHLTdb, self.config.jobCheckRes ]
             }
-        self.gr_run['box'].setStyleSheet("QGroupBox { background-color: #A5FF00; }");
-
-        self.config.jobCheckRes.w_showMT.clicked.connect(self.displayResultMT)
-        self.config.jobCheckRes.w_showPT.clicked.connect(self.displayResultPT)
-
-        self.d_menu = QtGui.QComboBox()
-        self.b_save = QtGui.QPushButton("Save",self)
-        self.b_kill = QtGui.QPushButton("Kill Process",self)
-        self.b_run  = QtGui.QPushButton("Run",self)
-        self.b_quit = QtGui.QPushButton("Quit",self)
-        self.connect(self.b_run,  QtCore.SIGNAL('clicked()'), self.run)
-        self.connect(self.b_kill, QtCore.SIGNAL('clicked()'), self.killCurrentProcess)
-        self.connect(self.b_save, QtCore.SIGNAL('clicked()'), self.config.write)
-        self.connect(self.b_quit, QtCore.SIGNAL('clicked()'), self.quit)
+        self.gr_run['box'].setStyleSheet("QGroupBox { background-color: #e2e2e2; font-weight: bold; font-size: 12pt;}");
+
+        self.config.jobCheckRes.w_showHLT.clicked.connect(self.displayResultHLT)
+
+        button_style ="QPushButton {padding: 4px; font-size: 14px; color: #3a81c7; \
+                      font-weight: bold; background-color: #ffffff; border-radius: 1px; border: 1px solid #3a81c7;}"
+
+        self.d_menu = QtWidgets.QComboBox()
+        self.d_menu.setStyleSheet("QComboBox {padding: 2px; color #3a81c7; border-radius: 1px; border: 1px solid #3a81c7;}")
+        self.b_save = QtWidgets.QPushButton("Save",self)
+        self.b_save.setStyleSheet(button_style)
+        self.b_kill = QtWidgets.QPushButton("Kill Process",self)
+        self.b_kill.setStyleSheet(button_style)
+        self.b_run  = QtWidgets.QPushButton("Run",self)
+        self.b_run.setStyleSheet(button_style)
+        self.b_quit = QtWidgets.QPushButton("Quit",self)
+        self.b_quit.setStyleSheet(button_style)
+        self.b_run.clicked.connect(self.run)
+        self.b_kill.clicked.connect(self.killCurrentProcess)
+        self.b_save.clicked.connect(self.config.write)
+        self.b_quit.clicked.connect(self.quit)
 
     def layout(self):
-        top = QtGui.QVBoxLayout()
+        top = QtWidgets.QVBoxLayout()
+        top.setContentsMargins(0,0,0,0)
 
         # release info
-        grid = QtGui.QGridLayout()
+        grid = QtWidgets.QGridLayout()
         for i,c in enumerate(self.gr_relconf['cont']):
             grid.addWidget(c.w_label,i,0,1,1)
+            c.w_label.setStyleSheet("QWidget { color: #e2e2e2; font-weight: bold; font-size: 11pt; }")
             grid.addWidget(c.qtw,i,1,1,3)
+            c.qtw.setStyleSheet("QWidget { color: #e2e2e2; }")
+            if c.name =="tt":
+              c.qtw.setStyleSheet("QWidget { background-color: #a9a9a9; }")
+
         self.gr_relconf['box'].setLayout(grid)
         top.addWidget(self.gr_relconf['box'])
 
         # job setup
-        grid = QtGui.QGridLayout()
+        grid = QtWidgets.QGridLayout()
         grid.setVerticalSpacing(0)
+        grid.setHorizontalSpacing(0)
+        
         line = 0
         for c in self.gr_setup['cont']:
-            if c.name=='userPreCommand':
+            c.w_label.setStyleSheet("QWidget { color: #ffffff; }")
+            if c.name=='userPreCommand' or c.name=='userPostCommand':
                 grid.addWidget(c.w_label,line,0) # label
                 grid.addWidget(self.d_menu,line+1,0,QtCore.Qt.AlignTop) # menu combo box
                 grid.addWidget(c.qtw,line,1,2,7) # field
@@ -382,9 +410,14 @@ class KeyPrep(QtGui.QScrollArea):
                 grid.addWidget(c.w_label,line,0) # label
                 grid.addWidget(c.qtw,line,1,1,7) # field
                 line += 1
-        grid.addItem(QtGui.QSpacerItem(10,10),line,0,1,4) # space
-        hl = QtGui.QHBoxLayout() # horizontal box for buttons
+            if c.name in ['jobOption','l1psKey', 'hltpsKey', 'cfgKey', 'dbPW', 'l1menu','l1topomenu','hltmenu','setupEF']:
+                c.qtw.setStyleSheet("QWidget { background-color: #D4E1EA; }")
+
+        grid.addItem(QtWidgets.QSpacerItem(10,10),line,0,1,4) # space
+        hl = QtWidgets.QHBoxLayout() # horizontal box for buttons
+
         hl.addWidget(self.config.onlineMonitoring.cb)
+        hl.addWidget(self.config.doDBConfig.cb)
         hl.addWidget(self.config.cafConfig.cb)
         hl.addWidget(self.config.l1rerun.cb)
         hl.addStretch(1)
@@ -394,39 +427,56 @@ class KeyPrep(QtGui.QScrollArea):
         top.addWidget(self.gr_setup['box'])
 
         # job progress
-        grid = QtGui.QGridLayout()
+        grid = QtWidgets.QGridLayout()
         grid.setVerticalSpacing(0)
+        grid.setHorizontalSpacing(0)
+        grid.setContentsMargins(0,0,0,0)
         line = 0
         for c in self.gr_run['cont']:
             grid.addWidget(c.w_label,line,0) # label
             grid.addWidget(c.w_state,line,1) # state
             if c.name != 'jobCheckRes':
                 grid.addWidget(c.w_logfile,line,2,1,6) # field
-                #c.w_logfile.setStyleSheet("QLineEdit { background-color: rgb(255, 176, 165); }");
             else:
-                grid.addWidget(c.w_showMT,line,6) # show res button
-                grid.addWidget(c.w_showPT,line,7) # show res button
-            #grid.addWidget(c.w_clearbutton,line,9) # clear button
+                grid.addWidget(c.w_showHLT,line,6) # show res button
             line += 1
         self.gr_run['box'].setLayout(grid)
         top.addWidget(self.gr_run['box'])
 
-        actions = QtGui.QHBoxLayout()
-        #actions.addWidget(self.b_style)
+        actions = QtWidgets.QHBoxLayout()
+        actions.setContentsMargins(4,0,4,4)
         actions.addWidget(self.b_kill)
         actions.addStretch(1)
         actions.addWidget(self.b_run)
         actions.addWidget(self.b_quit)
         top.addLayout(actions)
+        top.addStretch(1)
 
-        #self.setLayout(top)
-
-        frame = QtGui.QFrame()
+        frame = QtWidgets.QFrame()
         frame.setLayout(top)
-        self.setWidget(frame)
-        self.setWidgetResizable(True)
 
+        palette = QPalette( frame.palette() )
+        palette.setColor( frame.backgroundRole(), QColor("#7c7c7c") )
 
+        frame.setAutoFillBackground(True)
+        frame.setPalette( palette )
+        
+        self.setWidget(frame)
+        self.setWidgetResizable(True)
+        self.setContentsMargins(0,0,100,0)
+
+        label = QLabel(self)
+        pixmap = QPixmap('/afs/cern.ch/user/a/attrgcnf/TriggerDBReplica/TrigDbHltUploadFiles/logo.png') 
+        label.setPixmap(pixmap)
+        label.setGeometry(675-5-100,5,675-5,100+5)
+
+    def changeWidgetSetting(self, setting):
+        self.config.onlineMonitoring.cb.setEnabled(setting)
+        self.config.doDBConfig.cb.setEnabled(setting) 
+        self.config.cafConfig.cb.setEnabled(setting)
+        self.config.l1rerun.cb.setEnabled(setting)
+        for c in self.gr_setup['cont']:
+            c.qtw.setEnabled(setting)
 
     def updateMenuComboBox(self):
         menus = self.config.menus
@@ -441,24 +491,30 @@ class KeyPrep(QtGui.QScrollArea):
         index=-1
         if self.menuInPreCommand:
             index = menus.index(self.menuInPreCommand)
-        elif "PhysicsV4" in menus:
-            index = menus.index("PhysicsV4")            
-        elif "PhysicsV3" in menus:
-            index = menus.index("PhysicsV3")
-        elif "PhysicsV2" in menus:
-            index = menus.index("PhysicsV2")
+        elif "PhysicsV7" in menus:
+            index = menus.index("PhysicsV7")            
         if index>=0:
             self.d_menu.setCurrentIndex(index)
-          
+
+    def updateCommandBox(self):
+        if self.config.doDBConfig():
+             self.config.setPreCommandModifier('doDBConfig', 'True')
+      
     def selectMenu(self, menu):
         if self.menuInPreCommand!=None: # remove the old one first
             self.config.setPreCommandModifier('test%s' % self.menuInPreCommand, None)
         self.config.setPreCommandModifier('test%s' % menu, 'True') # set the selected one
         self.menuInPreCommand = menu
+   
+    def checkMachine(self):
+      if "lxplus" in socket.gethostname():
+          QMessageBox.information(None, '', "Warning! You're running on lxplus, and this will be slow!")
+      elif "tbed" not in socket.gethostname():
+          QMessageBox.information(None, '', "Warning! You're not running on the testbed, it could be slow!")
 
     def quit(self):
         self.config.write()
-        QtGui.qApp.quit()
+        QtWidgets.qApp.quit()
 
     def setFrameTitle(self,title):
         self.setWindowTitle(title)
@@ -469,9 +525,9 @@ class KeyPrep(QtGui.QScrollArea):
 
     def checkReleaseAndTT(self):
         self.config.release.set(os.getenv('AtlasVersion'))
-        self.config.swpath.set(os.getenv('AtlasBaseDir'))
-        if os.getenv('AtlasProject') in ['AtlasP1HLT','AtlasCAFHLT','AtlasProduction']:
-            self.config.patch.set(os.getenv('AtlasProject'))
+        self.config.swpath.set(os.getenv('AtlasBaseDir'))	
+        if os.getenv('AtlasProject') in ['Athena','AthenaP1']:
+            self.config.relName.set(os.getenv('AtlasProject'))
         
         if self.config.tt()=='':
             for p in os.getenv('DATAPATH').split(os.pathsep):
@@ -481,7 +537,7 @@ class KeyPrep(QtGui.QScrollArea):
 
     def guessMenuInPreCommand(self):
         pc = self.config.userPreCommand().strip(';')
-        mods = {} if not pc else dict([tuple(m.split('=')) for m in pc.split(';')])
+        mods = {} if not pc else OrderedDict([tuple(m.split('=')) if '=' in m else [m,''] for m in pc.split(';')])
         p = re.compile("test.*")
         menucands = filter(p.match,mods.keys())
         self.menuInPreCommand = menucands[0][4:] if menucands else None
@@ -489,7 +545,7 @@ class KeyPrep(QtGui.QScrollArea):
     def write(self,s):
         if not self.summarylog:
             base = self.config.jobName()
-            mode = "w" if self.config.jobMTjo.enabled else "a"
+            mode = "w" if self.config.jobHLTjo.enabled else "a"
             self.summarylog=open('%s/log%sSummary' % (self.config.tmpDir(),base), mode)
         print s,
         print >>self.summarylog, s,
@@ -502,7 +558,9 @@ class KeyPrep(QtGui.QScrollArea):
             self.success = True
 
         def run(self):
-            for job in ['MTjo', 'PTjo', 'SetupCnv', 'UploadDb', 'MTdb', 'PTdb', 'CheckRes']:
+            processing_times = []
+            for job in ['HLTjo', 'SetupCnv', 'UploadDb', 'HLTdb', 'CheckRes']:
+                start_time = timeit.default_timer()
                 proc_conf = getattr(self.gui.config, "job%s" % job)
                 if not proc_conf.enabled:
                     proc_conf.setSkipped()
@@ -519,20 +577,28 @@ class KeyPrep(QtGui.QScrollArea):
                     if proc_conf.inError():
                         self.gui.addFrameTitle(' -> Failure')
                     self.success = False
+                    self.gui.changeWidgetSetting(True)
                     return
                 if not proc(proc_conf): # exec
                     if proc_conf.inError(): self.gui.addFrameTitle(' -> Failure')
                     if proc_conf.isKilled(): self.gui.addFrameTitle(' -> Killed')
                     self.success = False
+                    self.gui.changeWidgetSetting(True)
                     return
                 proc_conf.setSuccess()
                 print >>self.gui, "===>>> Success"
-
+                elapsed = timeit.default_timer() - start_time
+		timer_line = "Elapsed time for " + job + ": " + str(elapsed)
+                print timer_line
+                processing_times += [timer_line]
+            makeTimingFile(processing_times)     
             print "===>>> Success"
             self.gui.setFrameTitle('Success')
+            self.gui.changeWidgetSetting(True)
             self.success = True
             return
 
+    
     def run(self):
         import os
         tmpdir = self.config.tmpDir()
@@ -543,6 +609,7 @@ class KeyPrep(QtGui.QScrollArea):
                 os.makedirs(tmpdir)
             except OSError, e:
                 raise RuntimeError("Can't create temporary directory %s (reason: %s)" % (tmpdir,e) )
+        self.changeWidgetSetting(False)
         self.runThread.start() # starts the thread
 
     def killCurrentProcess(self):
@@ -552,16 +619,15 @@ class KeyPrep(QtGui.QScrollArea):
                 if pr.isRunning():
                     runningProcess=pr
                     break
-            if QMessageBox.question(None, '', "Are you sure you want to kill \nthe process '' ?" % runningProcess.label,
+            if QMessageBox.question(None, '', "Are you sure you want to kill \nthe process %s ?" % runningProcess.label,
                                     QMessageBox.Yes | QMessageBox.No,
                                     QMessageBox.No) == QMessageBox.Yes:
                 if self.currentSubprocess:
                     self.currentSubprocess.kill()
+                    self.changeWidgetSetting(True)
         else:
             QMessageBox.information(None, '', "No process running!")
 
-
-
     # helper functions
     # check existence of file
     def checkFile(self,proc_conf, filename,filedesc):
@@ -570,7 +636,7 @@ class KeyPrep(QtGui.QScrollArea):
             print 'ERROR: <%s> No %s configured' % (caller, filedesc)
             proc_conf.setError()
             return False
-        if not os.path.exists(filename):
+        if 'root://eosatlas//eos/atlas/' not in filename and not os.path.exists(filename):
             print 'ERROR: <%s> %s %s does not exist in %s' % (caller, filedesc, filename, os.path.realpath('.'))
             proc_conf.setError()
             return False
@@ -601,7 +667,7 @@ class KeyPrep(QtGui.QScrollArea):
         for opt in optlist:
             getattr(self.config,opt).clear()
 
-    # execute cmd (string)
+    # 	 cmd (string)
     def executeProcess(self, cmd, proc_conf):
         try:
             FD = open(proc_conf.logfile,'w')
@@ -624,89 +690,74 @@ class KeyPrep(QtGui.QScrollArea):
             return False
         return True
 
+    def executeProcessList(self, cmd_list, proc_conf):
+        try:
+            FD = open(proc_conf.logfile,'w')
+            self.currentSubprocess = subprocess.Popen(cmd_list,stdout=FD,stderr=FD)
+            self.currentSubprocess.wait()
+            retCode = self.currentSubprocess.returncode
+            self.currentSubprocess = None
+        except OSError, v:
+            print 'ERROR: <%s> %r' % (proc_conf.name,v)
+            proc_conf.setError()
+            FD.close()
+            return False
+        FD.close()
+        if retCode==-9:
+            proc_conf.setKilled()
+            return False
+        if retCode!=0:
+            print 'ERROR: <%s> job failed with exit code: %r' % (proc_conf.name, retCode)
+            proc_conf.setError()
+            return False
+        return True
+
     #####################################################
     ###
-    ### Running athenaMT from the JO
+    ### Running athenaHLT from the JO
     ###
     #####################################################
-    def clearMTjo(self):
+    def clearHLTjo(self):
         base = self.config.jobName()
         self.deleteLocalFile("%s-1._0001.data" % base)
         self.deleteLocalFile("%s-1._0001.data.writing" % base)
-        self.deleteTmpFile('log%sMT' % base)
-        self.clearOptions( ['l1menu', 'hltl2menu', 'hltefmenu', 'setupL2', 'inputEF', 'jobMTjo'] )
+        self.deleteTmpFile('log%sHLT' % base)
+        self.clearOptions( ['l1menu', 'hltmenu', 'setupEF', 'jobHLTjo'] )
 
-    def checkPreReqMTjo(self,proc_conf):
-        return self.checkInput(proc_conf, 'inputL2', '') and \
-               self.checkFile(proc_conf, self.config.inputL2(), "Input file")
+    def checkPreReqHLTjo(self,proc_conf):
+        return self.checkInput(proc_conf, 'inputBSFile', '') and \
+               self.checkFile(proc_conf, self.config.inputBSFile(), "Input file")
 
-    def runMTjo(self, proc_conf):
+    def runHLTjo(self, proc_conf):
         base    = self.config.jobName()
-        logfile = '%s/log%sMT' % (self.config.tmpDir(),base)
+        logfile = '%s/log%sHLT' % (self.config.tmpDir(),base)
         proc_conf.setLogfile(logfile)
 
 
-        args = [ '-n %i' % self.config.nEvt(),
-                 '-o %s' % base,
-                 "-c doDBConfig=True",
-                 "-c trigBase='\"%s\"'" % base,
-                 "" if self.config.userPreCommand().strip()=='' else " -c '%s'"  % self.config.userPreCommand().strip(),
-                 '-f %s' % self.config.inputL2(),
-                 '--oh-monitoring' if self.config.onlineMonitoring() else '' ]
-        cmd = 'athenaMT.py %s %s' % ( " ".join(args), self.config.jobOption() )
-        print >>self, '%s &>! %s' % (cmd,logfile)
-
-        if not self.executeProcess(cmd, proc_conf): return False
-
-        try:
-            self.config.l1menu     = subprocess.Popen("egrep 'DBCONFIG LVL1XML' %s" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1]
-            self.config.hltl2menu  = subprocess.Popen("egrep 'DBCONFIG HLTXML' %s" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1]
-            self.config.inputEF    = "%s-1._0001.data" % base
-            self.config.setupL2    = './l2_%s_setup.txt' % base
-        except:
-            return False
-        return True
-
-    #####################################################
-    ###
-    ### athenaPT from JobOptions
-    ###
-    #####################################################
-    def clearPTjo(self):
-        base = self.config.jobName()
-        self.deleteLocalFile("ef_%s_setup.txt" % base)
-        self.deleteLocalFile("%s-1._0001.data.writing" % base)
-        self.deleteTmpFile('log%sPT' % base)
-        self.clearOptions( ['hltefmenu', 'setupEF', 'jobPTjo'] )
-
-    def checkPreReqPTjo(self,proc_conf):
-        return self.checkInput(proc_conf, 'inputEF', '') and \
-               self.checkFile(proc_conf, self.config.inputEF(), "Input file")
+        args = [ '-n 1 -f %s' % self.config.inputBSFile(),
+                 '-M' if self.config.onlineMonitoring() else '', 
+                 "" if self.config.userPreCommand().strip()=='' else " -c %s"  % self.config.userPreCommand().strip(),
+                 "" if self.config.userPostCommand().strip()=='' else " -C %s"  % self.config.userPostCommand().strip() ]
+        cmd = 'athenaHLT.py %s %s' % ( " ".join(args), self.config.jobOption() )
 
-    def runPTjo(self, proc_conf):
-        base = self.config.jobName()
-        logfile = '%s/log%sPT' % (self.config.tmpDir(),base)
-        proc_conf.setLogfile(logfile)
+        cmd_list = ['athenaHLT.py' ,  '-n', '1', '-f','%s' % self.config.inputBSFile(),
+                 '-M' if self.config.onlineMonitoring() else '', 
+                  '-c', "%s"  % self.config.userPreCommand().strip(),'-C', "%s"  % self.config.userPostCommand().strip(), self.config.jobOption()]
 
-        args = [ '-n %i' % self.config.nEvt(),
-                 '-c doDBConfig=True',
-                 "-c trigBase='\"%s\"'" % base,
-                 "" if self.config.userPreCommand().strip()=='' else " -c '%s'"  % self.config.userPreCommand().strip(),
-                 '-f %s' % self.config.inputEF(),
-                 '--oh-monitoring' if self.config.onlineMonitoring() else '' ]
-        cmd = 'athenaPT.py %s %s' % ( " ".join(args), self.config.jobOption() )
-        print >>self, '%s &>! %s' % (cmd,logfile)
+        print >>self, '%s &> %s' % (cmd,logfile)
+        print cmd_list
 
-        if not self.executeProcess(cmd, proc_conf): return False
+        if not self.executeProcessList(cmd_list, proc_conf): return False
 
         try:
-            self.config.hltefmenu = subprocess.Popen("egrep 'DBCONFIG HLTXML' %s" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1]
-            self.config.setupEF   = './ef_%s_setup.txt' % base
+            self.config.l1menu     = subprocess.Popen("egrep 'DBCONFIG LVL1XML' %s" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1]
+            self.config.l1topomenu = self.config.l1menu().split("LVL1")[0]+"L1Topo"+self.config.l1menu().split("LVL1")[1]
+            self.config.hltmenu    = subprocess.Popen("egrep 'DBCONFIG HLTXML' %s" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1]
+            self.config.setupEF    = './ef__setup.txt'
         except:
             return False
         return True
-
-
+    
     #####################################################
     ###
     ### setup conversion
@@ -722,50 +773,49 @@ class KeyPrep(QtGui.QScrollArea):
 
     def checkPreReqSetupCnv(self,proc_conf):
         allfiles = \
-                 self.checkFile(proc_conf, self.config.setupL2(), "L2 setup file") and \
                  self.checkFile(proc_conf, self.config.setupEF(), 'EF setup file') and \
-                 self.checkFile(proc_conf, self.config.hltl2menu(), 'HLT L2 menu file') and \
-                 self.checkFile(proc_conf, self.config.hltefmenu(), 'HLT EF menu file')
+                 self.checkFile(proc_conf, self.config.hltmenu(), 'HLT menu file')
         if not allfiles: return False
         return self.checkInput(proc_conf, 'l1menu', '')
 
     def runSetupCnv(self, proc_conf):
+
+        print 'Running the setup conversion'
+
         # check for level 1 menu
         base = self.config.jobName()
         fullSetupDir = '%s/%s' % (self.config.setupDir(), base)
+
+        print 'I think things are in the folder',fullSetupDir,', and this is where I\'ll put the files'
+
         l1menuName = os.path.basename(self.config.l1menu())
-        subprocess.call( ('cp -f %s .' % self.config.l1menu()).split() ) 
+        subprocess.call( ('cp -f %s .' % self.config.l1menu()).split() )
+        subprocess.call( ('cp -f %s .' % self.config.l1topomenu()).split()  )
+        l1topoName = os.path.basename(self.config.l1topomenu()) 
+
         #l1menuName = os.path.basename(self.config.l1menu())
         #if not os.path.exists(l1menuName):
         #    subprocess.call(('get_files -xmls %s' % l1menuName).split())
         if not self.checkFile(proc_conf, l1menuName, "L1 menu file after running get_files"):
             return False
+        if not self.checkFile(proc_conf, l1topoName, "L1 topo menu file after running get_files"):
+            return False
         
         logfile = '%s/log%sConv' % (self.config.tmpDir(),base)
         proc_conf.setLogfile(logfile)
 
-        subprocess.call(['cp', self.config.setupL2(), fullSetupDir+'/l2setup.txt'])
-        subprocess.call(['cp', self.config.setupEF(), fullSetupDir+'/efsetup.txt'])
-        subprocess.call(['cp', l1menuName,            fullSetupDir+'/lvl1Menu.xml'])
-        subprocess.call(['cp', self.config.hltl2menu(), fullSetupDir+'/hltL2Menu.xml'])
-        subprocess.call(['cp', self.config.hltefmenu(), fullSetupDir+'/hltEFMenu.xml'])
-        subprocess.call(['cp', self.config.setupL2().replace('.txt','_setup.txt'), fullSetupDir+'/l2setuppy.txt'])
-        subprocess.call(['cp', self.config.setupEF().replace('.txt','_setup.txt'), fullSetupDir+'/efsetuppy.txt'])
+        subprocess.call(['cp', self.config.setupEF(),   fullSetupDir+'/efsetup.txt'])
+        subprocess.call(['cp', l1menuName,              fullSetupDir+'/lvl1Menu.xml'])
+        subprocess.call(['cp', l1topoName,              fullSetupDir+'/l1topoMenu.xml'])
+        subprocess.call(['cp', self.config.hltmenu(),   fullSetupDir+'/hltMenu.xml'])
+        subprocess.call(['cp', self.config.setupEF().replace('.txt','_setup.txt'), fullSetupDir+'/efsetup_setup.txt'])
 
         cwd = os.getcwd()
         os.chdir(fullSetupDir)
 
-        cmd = 'menumerge.py --l2menu hltL2Menu.xml --efmenu hltEFMenu.xml --output hltMenu.xml'
-        print '%s &>! %s' % (cmd,logfile)
-        if not self.executeProcess(cmd, proc_conf): return False
-
-
-        cmd = 'ConvertHLTSetup_txt2xml.py l2setup.txt l2setuppy.txt'
-        print >>self,'%s &>>! %s' % (cmd,logfile)
-        if not self.executeProcess(cmd, proc_conf): return False
+        cmd = 'ConvertHLTSetup_txt2xml.py efsetup.txt efsetup_setup.txt'
+        print >>self,'%s &> %s' % (cmd,logfile)
 
-        cmd = 'ConvertHLTSetup_txt2xml.py efsetup.txt efsetuppy.txt'
-        print >>self,'%s &>>! %s' % (cmd,logfile)
         if not self.executeProcess(cmd, proc_conf): return False
 
         os.chdir(cwd)
@@ -786,18 +836,20 @@ class KeyPrep(QtGui.QScrollArea):
         fullSetupDir = '%s/%s' % (self.config.setupDir(), self.config.jobName())
         cwd = os.getcwd()
         os.chdir(fullSetupDir)
+        subprocess.call(['get_files','LVL1config.dtd'])
         allfiles = \
-                 self.checkFile(proc_conf, 'l2setup.xml', 'L2 setup file') and \
                  self.checkFile(proc_conf, 'efsetup.xml', 'EF setup file') and \
                  self.checkFile(proc_conf, 'hltMenu.xml', 'HLT menu file') and \
-                 self.checkFile(proc_conf, 'lvl1Menu.xml','LVL1 menu file')
+                 self.checkFile(proc_conf, 'lvl1Menu.xml','LVL1 menu file') and \
+                 self.checkFile(proc_conf, 'LVL1config.dtd','LVL1 configuration file') and \
+                 self.checkFile(proc_conf, 'l1topoMenu.xml','L1Topo menu file')
         os.chdir(cwd)
         return allfiles
 
     def runUploadDb(self,proc_conf):
         base = self.config.jobName()
         fullSetupDir = '%s/%s' % (self.config.setupDir(),base)
-        java='/afs/cern.ch/sw/lcg/external/Java/JDK/1.6.0/ia32/jre/bin/java -Xms512m -Xmx2000m'
+        #java='/afs/cern.ch/sw/lcg/external/Java/JDK/Oracle_1.8.0_31/amd64/bin/java -Xms512m -Xmx2000m'
         TT=self.config.tt()
         
         logfile = '%s/log%sUpload' % (self.config.tmpDir(),base)
@@ -815,83 +867,60 @@ class KeyPrep(QtGui.QScrollArea):
                     '-pw %s' % self.config.dbPW()]
         args += ['-up',
                  '-l1  %s/lvl1Menu.xml' % fullSetupDir,
+                 '-l1topo  %s/l1topoMenu.xml' % fullSetupDir,
                  '-hlt %s/hltMenu.xml'  % fullSetupDir,
-                 '-l2s %s/l2setup.xml'  % fullSetupDir,
                  '-efs %s/efsetup.xml'  % fullSetupDir,
                  '-rel %s'  % self.config.release(),
-                 '-o %sTT'  % logfile ]
-
-        cmd  = '%s -jar %s %s' % (java,TT,' '.join(args))
-        print >>self,'%s &>! %s' % (cmd,logfile)
-        if not self.executeProcess(cmd, proc_conf): return False
+                 '-m \"Upload from script\"',
+                 '-onl',
+                 '-o %sTTlog'  % logfile ]
 
-        self.config.cfgKey   = int(subprocess.Popen("egrep 'UPLOAD Supermasterkey' %sTT" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
-        self.config.l1psKey  = int(subprocess.Popen("egrep 'UPLOAD LVL1prescalekey' %sTT" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
-        self.config.hltpsKey = int(subprocess.Popen("egrep 'UPLOAD HLTprescalekey' %sTT" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
-        return True
+        cmd  = '%s %s' % (TT,' '.join(args))
+        print >>self,'%s &> %s' % (cmd,logfile)
 
+        os.unsetenv("TRIGGER_EXP_CORAL_PATH")
+        os.environ["TRIGGER_EXP_CORAL_PATH_RUN2"] = "/afs/cern.ch/user/a/attrgcnf/.dbauth/menuexperts"
+        subprocess.call(cmd, shell=True) 
 
+        self.config.cfgKey   = int(subprocess.Popen("egrep 'UPLOAD Supermasterkey' %sTTlog" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
+        self.config.l1psKey  = int(subprocess.Popen("egrep 'UPLOAD LVL1prescalekey' %sTTlog" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
+        self.config.hltpsKey = int(subprocess.Popen("egrep 'UPLOAD HLTprescalekey' %sTTlog" % logfile, shell=True,stdout=subprocess.PIPE).communicate()[0].split()[-1])
+        return True
 
     #####################################################
     ###
-    ### Running athenaMT from the DB
+    ### Running athenaHLT from the DB
     ###
     #####################################################
-    def clearMTdb(self):
+    def clearHLTdb(self):
         base = self.config.jobName()
         self.deleteLocalFile("%s-1._0001.data" % base)
         self.deleteLocalFile("%s-1._0001.data.writing" % base)
-        self.deleteTmpFile('log%sMTdb' % base)
-        self.clearOptions( ['jobMTdb'] )
-    def checkPreReqMTdb(self,proc_conf):
+        self.deleteTmpFile('log%sHLTdb' % base)
+        self.clearOptions( ['jobHLTdb'] )
+    def checkPreReqHLTdb(self,proc_conf):
         return self.checkInput(proc_conf, 'cfgKey', 0) and \
                    self.checkInput(proc_conf, 'l1psKey', 0) and \
                    self.checkInput(proc_conf, 'hltpsKey', 0)
-    def runMTdb(self,proc_conf):
-        base = self.config.jobName()
-        logfile = '%s/log%sMTdb' % (self.config.tmpDir(),base)
-        proc_conf.setLogfile(logfile)
-
-        args = [ '-f %s' % self.config.inputL2(),
-                 '-n %i' % self.config.nEvt(),
-                 '-o %s' % base,
-                 '--oh-monitoring' if self.config.onlineMonitoring() else '',
-                 '-J TrigConf::HLTJobOptionsSvc',
-                 '-b DBServer=%s:DBSMKey=%i:DBHLTPSKey=%i:DBLVL1PSKey=%i:Instance=L2' % (self.config.dbAlias(),self.config.cfgKey(),self.config.hltpsKey(),self.config.l1psKey()) ]
-        cmd  = 'athenaMT.py %s' % ' '.join(args)
-        print >>self,'%s &>! %s' % (cmd,logfile)
-        if not self.executeProcess(cmd, proc_conf): return False
-        return True
-
-    #####################################################
-    ###
-    ### Running athenaPT from the DB
-    ###
-    #####################################################
-    def clearPTdb(self):
-        base = self.config.jobName()
-        self.deleteTmpFile('log%sPTdb' % base)
-        self.clearOptions( ['jobPTdb'] )
-
-    def checkPreReqPTdb(self,proc_conf):
-        return self.checkInput(proc_conf, 'cfgKey', 0)
-
-    def runPTdb(self,proc_conf):
+    def runHLTdb(self,proc_conf):
         base = self.config.jobName()
-        logfile = '%s/log%sPTdb' % (self.config.tmpDir(),base)
+        logfile = '%s/log%sHLTdb' % (self.config.tmpDir(),base)
         proc_conf.setLogfile(logfile)
 
-        args = [ '-f %s' % self.config.inputEF(),
+        args = [ '-f %s' % self.config.inputBSFile(),
                  '-n %i' % self.config.nEvt(),
-                 '--oh-monitoring' if self.config.onlineMonitoring() else '',
                  '-J TrigConf::HLTJobOptionsSvc',
-                 '-b DBServer=%s:DBSMKey=%i:DBHLTPSKey=%i:DBLVL1PSKey=%i:Instance=EF' % (self.config.dbAlias(),self.config.cfgKey(),self.config.hltpsKey(),self.config.l1psKey()) ]
-        cmd  = 'athenaPT.py %s' % ' '.join(args)
-        print >>self,'%s &>! %s' % (cmd,logfile)
+                 '-M' if self.config.onlineMonitoring() else '', 
+                 '--use-database --db-type Coral  --db-server %s --db-smk %i --db-hltpskey %i --db-extra {"lvl1key":%i}' % (self.config.dbAlias(),self.config.cfgKey(),self.config.hltpsKey(),self.config.l1psKey()) ]
+
+        cmd  = 'athenaHLT.py %s' % ' '.join(args)
+        print >>self,'%s &> %s' % (cmd,logfile)
+      
+        os.unsetenv("FRONTIER_SERVER")
+       
         if not self.executeProcess(cmd, proc_conf): return False
         return True
 
-
     #####################################################
     ###
     ### Running the Result Checker
@@ -904,31 +933,21 @@ class KeyPrep(QtGui.QScrollArea):
 
     def checkPreReqCheckRes(self, proc_conf):
         allfiles = \
-                 self.checkFile(proc_conf, self.config.jobMTjo.logfile, "L2 JO log file") and \
-                 self.checkFile(proc_conf, self.config.jobMTdb.logfile, 'L2 DB log file') and \
-                 self.checkFile(proc_conf, self.config.jobPTjo.logfile, "EF JO log file") and \
-                 self.checkFile(proc_conf, self.config.jobPTdb.logfile, 'EF DB log file')
+                 self.checkFile(proc_conf, self.config.jobHLTjo.logfile, "HLT JO log file") and \
+                 self.checkFile(proc_conf, self.config.jobHLTdb.logfile, 'HLT DB log file')
         return allfiles
 
     def runCheckRes(self, proc_conf):
         base = self.config.jobName()
-        resMtJo = self.getResultFromLog(self.config.jobMTjo.logfile)
-        resMtDb = self.getResultFromLog(self.config.jobMTdb.logfile)
+        resHltJo = self.getResultFromLog(self.config.jobHLTjo.logfile)
+        resHltDb = self.getResultFromLog(self.config.jobHLTdb.logfile)
         self.testresults = {
-            'mtjo' : resMtJo,
-            'mtdb' : resMtDb
+            'hltjo' : resHltJo,
+            'hltdb' : resHltDb
             }
-        print >>self,"Checking L2\n==========="
-        successMT = self.checkResultInLevel(proc_conf, resMtJo, resMtDb)
+        print >>self,"Checking HLT\n==========="
+        success = self.checkResultInLevel(proc_conf, resHltJo, resHltDb)
         
-        resPtJo = self.getResultFromLog(self.config.jobPTjo.logfile)
-        resPtDb = self.getResultFromLog(self.config.jobPTdb.logfile)
-        self.testresults['ptjo'] = resPtJo
-        self.testresults['ptdb'] = resPtDb
-        print >>self,"Checking EF\n==========="
-        successPT = self.checkResultInLevel(proc_conf, resPtJo, resPtDb)
-
-        success = successMT and successPT
         if success:
             print >>self,"Check successful! This database key returns the correct answers and can be used online!"
         else:
@@ -937,7 +956,7 @@ class KeyPrep(QtGui.QScrollArea):
         if True:
             logfile = '%s/log%sCheckRes' % (self.config.tmpDir(),base)
             cmd  = 'buildConfigInstaller.sh %s %s' % (self.config.jobName(), self.config.release())
-            print >>self,'%s &>! %s' % (cmd,logfile)
+            print >>self,'%s &> %s' % (cmd,logfile)
             try:
                 successBuildInstaller = ( 0 == subprocess.call(cmd.split()) )
             except OSError, v:
@@ -992,14 +1011,11 @@ class KeyPrep(QtGui.QScrollArea):
                 d[m.group('chain')] = m.groupdict()
         return d
 
-    def displayResultMT(self):
-        self.displayResult('mt')
+    def displayResultHLT(self):
+        self.displayResult('hlt')
         
-    def displayResultPT(self):
-        self.displayResult('pt')
-
     def displayResult(self, name):
-        if name!='mt' and name!='pt':
+        if name!='hlt':
             return
         if not (self.testresults.has_key('%sjo' % name) and self.testresults.has_key('%sdb' % name)):
             print "Results for %s are missing" % name
@@ -1071,10 +1087,6 @@ class KeyPrep(QtGui.QScrollArea):
         #t.insert("%s+1l" % INSERT, ul)
         print ul
 
-
-
-
-
 def parse_programm_options():
     import getopt
     short_opt = "h?F:"
@@ -1102,11 +1114,21 @@ def parse_programm_options():
             inputFile = v
     return inputFile
 
+def makeTimingFile(lines = []):
+    import time
+    timestr = time.strftime("%Y%m%d-%H%M%S")
+    timing_file = open('/afs/cern.ch/user/a/attrgcnf/TriggerDBReplica/TrigDbHltUploadFiles/timingLogs/logTiming'+timestr, 'w')
+    timing_file.write('Machine: '+socket.gethostname()+'\n')
+    timing_file.write('User: '+getpass.getuser()+'\n') 
+    for line in lines:
+        timing_file.write(line+'\n')
+    timing_file.close()  # you can omit in most cases as the destructor will call it
 
 def main():
     signal.signal(signal.SIGINT, sigint_handler)
     inputFile = parse_programm_options()
-    app = QtGui.QApplication(sys.argv)
+    app = QtWidgets.QApplication(sys.argv)
+    app.setStyle('cleanlooks')
     timer = QtCore.QTimer()
     timer.start(500)  # interval after which timeout signal is called
     timer.timeout.connect(lambda: None)
@@ -1120,7 +1142,7 @@ def sigint_handler(*args):
     #if QMessageBox.question(None, '', "Are you sure you want to quit?",
     #                        QMessageBox.Yes | QMessageBox.No,
     #                        QMessageBox.No) == QMessageBox.Yes:
-    QtGui.QApplication.quit()
+    QtWidgets.QApplication.quit()
 
 if __name__ == "__main__":
     main()
diff --git a/Trigger/TrigConfiguration/TrigDbHltUpload/share/setupOnlineTriggerConfigEnv.sh b/Trigger/TrigConfiguration/TrigDbHltUpload/share/setupOnlineTriggerConfigEnv.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ca6722d7eb65626ea554b3e935800e61d372be7c
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigDbHltUpload/share/setupOnlineTriggerConfigEnv.sh
@@ -0,0 +1,3 @@
+lsetup "lcgenv -p LCG_88 x86_64-slc6-gcc62-opt pyqt5"
+export QT_PLUGIN_PATH=/cvmfs/sft.cern.ch/lcg/releases/LCG_88/qt5/5.6.0/x86_64-slc6-gcc62-opt/plugins/
+export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Doxyfile b/Trigger/TrigCost/TrigCostRootAnalysis/Doxyfile
index d72ee4f43934326cfc17a7ff85b4ef799e7f7c88..0d6105b9e41e1c76c32673ac6f8d0a92aecad9af 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Doxyfile
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Doxyfile
@@ -1790,3 +1790,4 @@ GENERATE_LEGEND        = YES
 # the various graphs.
 
 DOT_CLEANUP            = YES
+
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/Config.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/Config.cxx
index 7b39916563e3c61b677535a62657ab84b7994088..3507b44feade7dc0d45f7e3bf36be7ffa5720931 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/Config.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/Config.cxx
@@ -134,6 +134,8 @@ namespace TrigCostRootAnalysis {
     static Int_t _upgradeMergeTOBOverlap = kFALSE;
     static Int_t _doExponentialMu = kFALSE;
     static Int_t _invertHighMuRunVeto = kFALSE;
+    static Int_t _ignoreGRL = kFALSE;
+    static Int_t _ignorePSGreaterThanOne = kFALSE;
 
     // User options
     std::vector< std::string > _inputFiles;
@@ -433,6 +435,12 @@ namespace TrigCostRootAnalysis {
         {
           "doExponentialMu", no_argument, &_doExponentialMu, 1
         },
+        {
+          "ignoreGRL", no_argument, &_ignoreGRL, 1
+        },  
+        {
+          "ignorePSGreaterThanOne", no_argument, &_ignorePSGreaterThanOne, 1
+        }, 
         {
           "invertHighMuRunVeto", no_argument, &_invertHighMuRunVeto, 1
         }, // Hidden option
@@ -781,6 +789,9 @@ namespace TrigCostRootAnalysis {
           std::cout <<
             "--noLBRescaling\t\t\t\t\tFlag to prevent the rescaling of the effective time per LB in EB runs based on the events processed and the known run size."
                     << std::endl;
+          std::cout <<
+            "--ignoreGRL\t\t\t\tFlag to switch off the exclusion of LB which fail the good run lists in ehnaced bias runs."
+                    << std::endl;
           std::cout <<
             "--patternsMonitor patt1 patt2 ...\t\tPatterns to match in names when running. Regex currently NOT supported. Partial matched allowed. Only entries which match will be analysed."
                     << std::endl;
@@ -829,6 +840,9 @@ namespace TrigCostRootAnalysis {
           std::cout <<
             "--forceAllPass\t\t\t\t\tForce all L1 and HLT chains to pass-raw in every event. Use to isolate the effect of prescales."
                     << std::endl;
+          std::cout <<
+            "--ignorePSGreaterThanOne\t\t\t\t\tAll prescales greater than 1 will be set to -1."
+                    << std::endl;
           std::cout << "--doUniqueRates\t\t\t\t\tCalculate unique rates for chains. Warning, this is slow." <<
             std::endl;
           std::cout << "--doCPS\t\t\t\t\t\tEnable special treatment for chains in coherent prescale groups." <<
@@ -1815,6 +1829,8 @@ namespace TrigCostRootAnalysis {
     set(kDoExponentialMu, _doExponentialMu, "DoExponentialMu");
     set(kInvertHighMuRunVeto, _invertHighMuRunVeto, "InvertHighMuRunVeto");
     set(kUseOnlyTheseBCIDs, _useOnlyTheseBCIDs, "UseOnlyTheseBCIDs");
+    set(kIgnoreGRL, _ignoreGRL, "IgnoreGRL");
+    set(kIgnorePSGreaterThanOne, _ignorePSGreaterThanOne, "IgnorePSGreaterThanOne");
 
     std::stringstream _multiRunss(_multiRun); // Comma separated
     std::string _tempStr;
@@ -2019,15 +2035,10 @@ namespace TrigCostRootAnalysis {
     set(kVersionString, _version, "Version");
 
     // Different variables to save
+    for (int i = 0; i <= 90; ++i) {
+      set(ConfKey_t(kVarSteeringTimeCPUType + 8192 + i), std::string("Rack" + intToString(i)) );
+    }
     set(kVarTime, "Time");
-    set(kVarSteeringTimeCPUType1, "SteeringTimeCPUType1");
-    set(kVarSteeringTimeCPUType2, "SteeringTimeCPUType2");
-    set(kVarSteeringTimeCPUType3, "SteeringTimeCPUType3");
-    set(kVarSteeringTimeCPUType4, "SteeringTimeCPUType4");
-    set(kVarEventsCPUType1, "EventsCPUType1");
-    set(kVarEventsCPUType2, "EventsCPUType2");
-    set(kVarEventsCPUType3, "EventsCPUType3");
-    set(kVarEventsCPUType4, "EventsCPUType4");
     set(kVarRerunTime, "RerunTime");
     set(kVarPassTime, "PassTime");
     set(kVarTimeExec, "TimeExec");
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterBaseRates.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterBaseRates.cxx
index b1a17663f5c15ed28203c74eaea11313a2510f07..31e6ed2ccc41fa1304a924550ee3998d1b8640f9 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterBaseRates.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterBaseRates.cxx
@@ -278,6 +278,16 @@ namespace TrigCostRootAnalysis {
     if (dynamic_cast<CounterRatesUnion*>(this) != NULL) { //If I am actually a CounterRatesUnion
       if (_toAdd->getLower().size() > (UInt_t) Config::config().getInt(kMaxMultiSeed)) {
         // We are much stricter if this is a GLOBAL counter - don't want to have to disable it
+        // HACK - we don't want to vero MU20||MU21 (June 17)
+        if (_toAdd->getLower().size() == 2) { // TODO this is temporary for July 2017
+          bool passesHack = kTRUE;
+          for (ChainItemSetIt_t _L1Hack = _toAdd->getLower().begin(); _L1Hack != _toAdd->getLower().end(); ++_L1Hack) {
+            if ((*_L1Hack)->getName() == "L1_MU20") continue;
+            else if ((*_L1Hack)->getName() == "L1_MU21") continue;
+            passesHack = kFALSE;
+          }
+          if (passesHack) return kTRUE;
+        }
         Bool_t _isGlobal = kFALSE;
         if (getName() == Config::config().getStr(kRateGlobalL1String)) _isGlobal = kTRUE;
         else if (getName() == Config::config().getStr(kRateGlobalHLTString)) _isGlobal = kTRUE;
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterGlobals.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterGlobals.cxx
index 71650000f05538a813ca99333d2bad836d5fc48e..a8e418c8645d4d171395563902db746a547cf7e5 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterGlobals.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterGlobals.cxx
@@ -86,27 +86,12 @@ namespace TrigCostRootAnalysis {
       "Time Taken by Monitoring Tools Per Event;Time [ms];Events");
 
     TrigXMLService::trigXMLService().parseHLTFarmXML();
-    const IntStringMap_t _comp = TrigXMLService::trigXMLService().getComputerTypeToNameMap();
-    if (_comp.size() >= 4) {
-      m_dataStore.newVariable(kVarSteeringTimeCPUType1).setSavePerEvent(std::string("Steering Time Per Event by " +
-                                                                                    _comp.at(1) +
+    for (int i = 0; i <= 90; ++i) {
+      m_dataStore.newVariable(ConfKey_t(kVarSteeringTimeCPUType + 8192 + i)).setSavePerEvent(std::string("Steering Time Per Event by Rack " +
+                                                                                    (i == 0 ? "UNKNOWN" : intToString(i)) +
                                                                                     ";Steering Time [ms];Events"));
-      m_dataStore.newVariable(kVarSteeringTimeCPUType2).setSavePerEvent(std::string("Steering Time Per Event by " +
-                                                                                    _comp.at(2) +
-                                                                                    ";Steering Time [ms];Events"));
-      m_dataStore.newVariable(kVarSteeringTimeCPUType3).setSavePerEvent(std::string("Steering Time Per Event by " +
-                                                                                    _comp.at(3) +
-                                                                                    ";Steering Time [ms];Events"));
-      m_dataStore.newVariable(kVarSteeringTimeCPUType4).setSavePerEvent(std::string("Steering Time Per Event by " +
-                                                                                    _comp.at(4) +
-                                                                                    ";Steering Time [ms];Events"));
-      m_dataStore.newVariable(kVarEventsCPUType1).setSavePerCall();
-      m_dataStore.newVariable(kVarEventsCPUType2).setSavePerCall();
-      m_dataStore.newVariable(kVarEventsCPUType3).setSavePerCall();
-      m_dataStore.newVariable(kVarEventsCPUType4).setSavePerCall();
+      m_dataStore.newVariable(ConfKey_t(kVarEventsCPUType + 16384 + i)).setSavePerCall();
       m_CPUBreakDown = kTRUE;
-    } else {
-      m_CPUBreakDown = kFALSE;
     }
   }
 
@@ -238,25 +223,10 @@ namespace TrigCostRootAnalysis {
     m_processingUnits[ m_costData->getAppId() ] += 1;
 
     if (m_CPUBreakDown == kTRUE) {
-      Int_t _computerType = TrigXMLService::trigXMLService().getComputerType(((UInt_t) m_costData->getAppId()));
-      switch (_computerType) {
-      case 1: m_dataStore.store(kVarSteeringTimeCPUType1, m_steeringTime, _weight);
-        m_dataStore.store(kVarEventsCPUType1, 1., _weight);
-        break;
-
-      case 2: m_dataStore.store(kVarSteeringTimeCPUType2, m_steeringTime, _weight);
-        m_dataStore.store(kVarEventsCPUType2, 1., _weight);
-        break;
-
-      case 3: m_dataStore.store(kVarSteeringTimeCPUType3, m_steeringTime, _weight);
-        m_dataStore.store(kVarEventsCPUType3, 1., _weight);
-        break;
-
-      case 4: m_dataStore.store(kVarSteeringTimeCPUType4, m_steeringTime, _weight);
-        m_dataStore.store(kVarEventsCPUType4, 1., _weight);
-        break;
-
-      default: Error("CounterGlobals::processEventCounter", "Unknown computer type ID %i", _computerType);
+      Int_t _computerRack = TrigXMLService::trigXMLService().getComputerType(((UInt_t) m_costData->getAppId()));
+      if (_computerRack >= 0 && _computerRack <= 90) {
+        m_dataStore.store(ConfKey_t(kVarSteeringTimeCPUType + 8192 + _computerRack), m_steeringTime, _weight);
+        m_dataStore.store(ConfKey_t(kVarEventsCPUType + 16384 + _computerRack), 1., _weight);
       }
     }
 
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterRatesUnion.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterRatesUnion.cxx
index 97e5584e6f869207b0979129374b1b96c3adc1c2..16bd5728b90e367f846302036a4a6a4b2c8c1f87 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterRatesUnion.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/CounterRatesUnion.cxx
@@ -228,7 +228,14 @@ namespace TrigCostRootAnalysis {
     for (ChainItemSetIt_t _L2TestIt = m_L2s.begin(); _L2TestIt != m_L2s.end(); ++_L2TestIt) {
       RatesChainItem* _L2Test = (*_L2TestIt);
       // Check that I have exactly one seed
-      if (_L2Test->getLower().size() != 1) {
+      if (_L2Test->getLower().size() == 2) { // TODO this is temporary for July 2017
+        for (ChainItemSetIt_t _L1Hack = _L2Test->getLower().begin(); _L1Hack != _L2Test->getLower().end(); ++_L1Hack) {
+          if ((*_L1Hack)->getName() == "L1_MU20") continue;
+          else if ((*_L1Hack)->getName() == "L1_MU21") continue;
+          _allOneToMany = kFALSE;
+          break; 
+        }
+      } else if (_L2Test->getLower().size() != 1) {
         _allOneToMany = kFALSE;
         break;
       }
@@ -239,7 +246,15 @@ namespace TrigCostRootAnalysis {
       for (ChainItemSetIt_t _L2It = _cpsGroup->getChainStart(); _L2It != _cpsGroup->getChainEnd(); ++_L2It) {
         if (m_myCPSChains.count((*_L2It)->getName()) == 0) continue;
         //This CPS group member is not in this rates group
-        if ((*_L2It)->getLower().size() != 1) {
+        RatesChainItem* _L2Test = (*_L2It);
+        if (_L2Test->getLower().size() == 2) { // TODO this is temporary for July 2017
+          for (ChainItemSetIt_t _L1Hack = _L2Test->getLower().begin(); _L1Hack != _L2Test->getLower().end(); ++_L1Hack) {
+            if ((*_L1Hack)->getName() == "L1_MU20") continue;
+            else if ((*_L1Hack)->getName() == "L1_MU21") continue;
+            _allOneToMany = kFALSE;
+            break; 
+          }
+        } else if (_L2Test->getLower().size() != 1) {
           _allOneToMany = kFALSE;
           break;
         }
@@ -256,9 +271,9 @@ namespace TrigCostRootAnalysis {
     }
 
     // Otherwise we have to use the general form
-    if (m_L1s.size() > 20) { // 32 is the technical maximim - but the this is already impractical
+    if (m_L1s.size() > 15) { // 32 is the technical maximim - but the this is already impractical
       Warning("CounterRatesUnion::classify",
-              "Union %s topology is Many-To-Many with NL1:%i (Complexity (2^NL1-1)=%e). Disabling (max L1 seeds is 20 for Many-To-Many).",
+              "Union %s topology is Many-To-Many with NL1:%i (Complexity (2^NL1-1)=%e). Disabling (max L1 seeds is 15 for Many-To-Many).",
               getName().c_str(), (Int_t) m_L1s.size(), TMath::Power(2., (Double_t) m_L1s.size()) - 1.);
       m_cannotCompute = kTRUE;
     } else if (m_L1s.size() > 10) {
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/MonitorGlobals.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/MonitorGlobals.cxx
index 01e0f273878ca2a0b1736db8397d7b577eb8d4d9..0169c6810628ebaeae1ad5bb18168fc8b376685f 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/MonitorGlobals.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/MonitorGlobals.cxx
@@ -246,29 +246,6 @@ namespace TrigCostRootAnalysis {
                                            "Average per event number of Regions of Interest supplied from the lower trigger level.",
                                            kVarROI, kSavePerEvent, kVarEventsActive, kSavePerCall, 2));
 
-    const IntStringMap_t _comp = TrigXMLService::trigXMLService().getComputerTypeToNameMap();
-    if (_comp.size() >= 4) {
-      _toSave.push_back(TableColumnFormatter(std::string(_comp.at(1) + " Steering Time/Event [ms]"),
-                                             "Total steering time per event for this type of CPU",
-                                             kVarSteeringTimeCPUType1, kSavePerEvent, kVarEventsCPUType1, kSavePerCall,
-                                             2));
-
-      _toSave.push_back(TableColumnFormatter(std::string(_comp.at(2) + " Steering Time/Event [ms]"),
-                                             "Total steering time per event for this type of CPU",
-                                             kVarSteeringTimeCPUType2, kSavePerEvent, kVarEventsCPUType2, kSavePerCall,
-                                             2));
-
-      _toSave.push_back(TableColumnFormatter(std::string(_comp.at(3) + " Steering Time/Event [ms]"),
-                                             "Total steering time per event for this type of CPU",
-                                             kVarSteeringTimeCPUType3, kSavePerEvent, kVarEventsCPUType3, kSavePerCall,
-                                             2));
-
-      _toSave.push_back(TableColumnFormatter(std::string(_comp.at(4) + " Steering Time/Event [ms]"),
-                                             "Total steering time per event for this type of CPU",
-                                             kVarSteeringTimeCPUType4, kSavePerEvent, kVarEventsCPUType4, kSavePerCall,
-                                             2));
-    }
-
     _toSave.push_back(TableColumnFormatter("CostMon Time/Event [ms]",
                                            "Average time per event to execute cost monitoring.",
                                            kVarTrigCostTime, kSavePerEvent, kVarEventsActive, kSavePerCall, 2));
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/RatesCPSGroup.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/RatesCPSGroup.cxx
index 6109394fac0dee1e50f4495b61f4d2348f397f5e..bb0d00c15a164fad9d2c09fde0706f520542d997 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/RatesCPSGroup.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/RatesCPSGroup.cxx
@@ -51,8 +51,10 @@ namespace TrigCostRootAnalysis {
     // We can only do this if all of our chains have the same L1 seed
     for (const auto _item : m_items) {
       if (_item->getLower().size() != 1) {
-        Error("RatesCPSGroup::calculateCPSFactor", "Cannot factor out CPS for %s, there is not exactly one L1 seed",
-              getName().c_str());
+        Error("RatesCPSGroup::calculateCPSFactor", "Cannot factor out CPS for %s, there is not exactly one L1 seed. ASSUMING THE L1 SEED TO BE %s",
+              getName().c_str(), (*_item->getLowerStart())->getName().c_str() );
+        ChainItemSetIt_t _it = _item->getLowerStart(); // Leaving m_l1 as a nullprt here causes a bad de-reference later 
+        if (m_l1 == nullptr) m_l1 = (*_it);
         return;
       }
       ChainItemSetIt_t _it = _item->getLowerStart(); // We know there is only one
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
index 24ae623b3acdb70eb22a3bd9dd17320a65ad84d6..aed0edc1e7cb21d7eef5e45c975855012dbe62ed 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
@@ -75,6 +75,7 @@ namespace TrigCostRootAnalysis {
   }
 
   void TrigXMLService::init() {
+    m_ignoreGRL = Config::config().getInt(kIgnoreGRL);
     parseRunXML(Config::config().getInt(kRunNumber), kTRUE);
     // Is this a "multi run"? If so - load details from the LB of the other runs
     std::vector<Int_t> _multiRun = Config::config().getIntVec(kMultiRun);
@@ -460,6 +461,8 @@ namespace TrigCostRootAnalysis {
     // Get access to main node
     XMLNodePointer_t _mainNode = _xml->DocGetRootElement(_xmlDoc);
 
+    const Bool_t ignorePSGreaterThanOne = (Bool_t) Config::config().getInt(kIgnorePSGreaterThanOne);
+
     assert(_xml->GetNodeName(_mainNode) == std::string("HLT_MENU"));
     XMLNodePointer_t _listNode = _xml->GetChild(_mainNode);
     m_menuName = _xml->GetAttr(_mainNode, "menu_name");
@@ -493,6 +496,8 @@ namespace TrigCostRootAnalysis {
         }
         ++_chainsRead;
 
+        if (ignorePSGreaterThanOne && m_chainPS[_chainName] > 1.) m_chainPS[_chainName] = -1;
+
         if (Config::config().debug()) {
           Info("TrigXMLService::parseMenuXML", "Parsed Chain:%s, Counter:%i, LowerChain:%s, PS:%f, PT:%f, RerunPS:%f, Express:%f",
                _chainName.c_str(),
@@ -528,6 +533,8 @@ namespace TrigCostRootAnalysis {
     // Get access to main node
     XMLNodePointer_t _mainNode = _xml->DocGetRootElement(_xmlDoc);
 
+    const Bool_t ignorePSGreaterThanOne = (Bool_t) Config::config().getInt(kIgnorePSGreaterThanOne);
+
     assert(_xml->GetNodeName(_mainNode) == std::string("LVL1Config"));
     XMLNodePointer_t _listNode = _xml->GetChild(_mainNode);
     Int_t _chainsRead = 0;
@@ -567,6 +574,9 @@ namespace TrigCostRootAnalysis {
           }
           m_chainCounter[_L1Name] = _ctpid;
           m_chainPS[_L1Name] = _prescale;
+
+          if (ignorePSGreaterThanOne && m_chainPS[_L1Name] > 1.) m_chainPS[_L1Name] = -1;
+
           ++_chainsRead;
           if (Config::config().debug()) {
             Info("TrigXMLService::parseL1MenuXML", "Step 2: L1 %s = PS %f", _L1Name.c_str(), _prescale);
@@ -593,6 +603,8 @@ namespace TrigCostRootAnalysis {
     // Get access to main node
     XMLNodePointer_t _mainNode = _xml->DocGetRootElement(_xmlDoc);
 
+    const Bool_t ignorePSGreaterThanOne = (Bool_t) Config::config().getInt(kIgnorePSGreaterThanOne);
+
     assert(_xml->GetNodeName(_mainNode) == std::string("trigger"));
     XMLNodePointer_t _listNode = _xml->GetChild(_mainNode);
 
@@ -685,6 +697,8 @@ namespace TrigCostRootAnalysis {
                                                     "will have been lost.", m_chainPS[_chainName], _chainName.c_str());
         }
 
+        if (ignorePSGreaterThanOne && m_chainPS[_chainName] > 1.) m_chainPS[_chainName] = -1;
+
         if (Config::config().debug()) {
           Info("TrigXMLService::parsePrescaleXML", "Parsed Chain:%s, "
                                                    "Counter:%i, "
@@ -743,7 +757,10 @@ namespace TrigCostRootAnalysis {
     } else {
 // CAUTION - "ATHENA ONLY" CODE
 #ifndef ROOTCORE
-      _path = PathResolverFindDataFile(_file);
+      _path = PathResolverFindDataFile(_file); // Get from CALIB area
+      if (_path == Config::config().getStr(kBlankString)) { // One more place we can look
+        _path = std::string(Config::config().getStr(kAFSDataDir) + _file);
+      }
 #endif // not ROOTCORE
     }
 
@@ -865,6 +882,7 @@ namespace TrigCostRootAnalysis {
    *could affect rates prediction
    */
   Bool_t TrigXMLService::getIsLBFlaggedBad(Int_t _lb) {
+    if (m_ignoreGRL) return kFALSE;
     return (Bool_t) m_badLumiBlocks.count(_lb);
   }
 
@@ -934,132 +952,184 @@ namespace TrigCostRootAnalysis {
   }
 
   /**
-   * Load which PCs have which CPUs
+   * Load which PCs have which CPUs.
+   * This used to be based on an XML but now is not, hence the naming 
    */
   void TrigXMLService::parseHLTFarmXML() {
-    TXMLEngine* _xml = new TXMLEngine();
 
-    std::string _path;
-    if (Config::config().getInt(kIsRootCore) == kTRUE) {
-      _path = std::string(Config::config().getStr(kDataDir) + Config::config().getStr(kFarmXML));
-    } else {
-// CAUTION - "ATHENA ONLY" CODE
-#ifndef ROOTCORE
-      _path = PathResolverFindDataFile(Config::config().getStr(kFarmXML));
-#endif // not ROOTCORE
+    // Now build a map of PU hash to computer type
+    const std::string _hltLevel = "HLT";
+
+    for (Int_t _rack = 94; _rack <= 95; ++_rack) {
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 12; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-12:HLT-12-NoTS:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+          if (Config::config().debug()) Info("TrigXMLService::parseHLTFarmXML", "%s = %i = %i", _s.c_str(), stringToIntHash(_s), _rack);
+        }
+      }
     }
 
-    XMLDocPointer_t _xmlDoc = _xml->ParseFile(_path.c_str());
+    for (Int_t _rack = 1; _rack <= 70; ++_rack) {
+      if (_rack > 13 && _rack < 64) continue;
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 12; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-12:HLT-12:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
+    }
 
-    if (_xmlDoc == 0) {
-      Error("TrigXMLService::parseHLTFarmXML", "Unable to load HLT farm XML %s.", Config::config().getStr(kFarmXML).c_str());
-      delete _xml;
-      return;
+    for (Int_t _rack = 1; _rack <= 70; ++_rack) {
+      if (_rack > 13 && _rack < 64) continue;
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 12; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-12:HLT-allracks:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
     }
 
-    // Navigate XML
-    XMLNodePointer_t _mainNode = _xml->DocGetRootElement(_xmlDoc);
-    assert(_xml->GetNodeName(_mainNode) == std::string("oks-data"));
-    XMLNodePointer_t _typesNode = _xml->GetChild(_mainNode);
-    XMLNodePointer_t _compsNode = _xml->GetNext(_typesNode);
-
-    XMLNodePointer_t _typeNode = _xml->GetChild(_typesNode);
-    XMLNodePointer_t _compNode = _xml->GetChild(_compsNode);
-
-    while (_typeNode != 0) { // Loop over all menu elements
-      assert(_xml->GetNodeName(_typeNode) == std::string("type"));
-      UInt_t _id = stringToInt(_xml->GetAttr(_typeNode, "code"));
-      std::string _name = _xml->GetAttr(_typeNode, "name");
-      m_computerTypeToNameMap[_id] = _name;
-      if (_name == "UNKNOWN CPU") m_computerUnknownID = _id;
-      _typeNode = _xml->GetNext(_typeNode);
+    for (Int_t _rack = 77; _rack <= 77; ++_rack) {
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 24; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-24:HLT-24-Merge:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
     }
 
-    std::map< std::pair<UInt_t, UInt_t>, UInt_t> _computerIDToTypeMap;
-    std::map< std::pair<UInt_t, UInt_t>, UInt_t>::const_iterator _compIt;
-    while (_compNode != 0) { // Loop over all menu elements
-      assert(_xml->GetNodeName(_compNode) == std::string("c"));
-      std::string _computer = _xml->GetAttr(_compNode, "i");
-      UInt_t _rack = stringToInt(_computer.substr(0, 2));
-      UInt_t _comp = stringToInt(_computer.substr(2, 3));
-      UInt_t _type = stringToInt(_xml->GetAttr(_compNode, "t"));
-      _computerIDToTypeMap[ std::make_pair(_rack, _comp) ] = _type;
-      _compNode = _xml->GetNext(_compNode);
+    for (Int_t _rack = 16; _rack <= 90; ++_rack) {
+      if (_rack > 24 && _rack < 70) continue;
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 24; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-24:HLT-24:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
     }
 
-    // Now build a map of PU hash to computer type
-    const std::string _hltLevel = "HLT";
-    std::set<Int_t> _coreTypes = {
-      8, 12, 24
-    };
-    Int_t _myCompType = -1;
-    for (Int_t _core : _coreTypes) {
-      for (Int_t _rack = 1; _rack <= 95; ++_rack) {
-        for (Int_t _pc = 1; _pc <= 40; ++_pc) {
-          _compIt = _computerIDToTypeMap.find(std::make_pair(_rack, _pc));
-          if (_compIt != _computerIDToTypeMap.end()) _myCompType = (*_compIt).second;
-          else _myCompType = m_computerUnknownID;
-          for (Int_t _pu = 1; _pu <= _core; ++_pu) {
-            std::stringstream _ss;
-            std::string _s;
-            _ss << std::setfill('0')
-                << "APP_" << _hltLevel
-                << ":HLTMPPU-"
-                << _core
-                << "-MTS:HLT-"
-                << _core
-                << ":tpu-rack-"
-                << std::setw(2) << _rack
-                << ":pc-tdq-tpu-"
-                << std::setw(2) << _rack
-                << std::setw(3) << _pc
-                << "-"
-                << std::setw(2) << _pu;
-            _s = _ss.str();
-            m_PUHashToPUType[stringToIntHash(_s)] = _myCompType;
-
-            _ss.str(std::string());
-            _ss << std::setfill('0')
-                << "APP_" << _hltLevel
-                << ":HLTMPPU-"
-                << _core
-                << "-MTS:HLT-"
-                << _core
-                << "-MTS:tpu-rack-"
-                << std::setw(2) << _rack
-                << ":pc-tdq-tpu-"
-                << std::setw(2) << _rack
-                << std::setw(3) << _pc
-                << "-"
-                << std::setw(2) << _pu;
-            _s = _ss.str();
-            m_PUHashToPUType[stringToIntHash(_s)] = _myCompType;
-
-            _ss.str(std::string());
-            _ss << std::setfill('0')
-                << "APP_" << _hltLevel
-                << ":HLTMPPU-"
-                << _core
-                << ":HLT-"
-                << _core
-                << "-NoTS:tpu-rack-"
-                << std::setw(2) << _rack
-                << ":pc-tdq-tpu-"
-                << std::setw(2) << _rack
-                << std::setw(3) << _pc
-                << "-"
-                << std::setw(2) << _pu;
-            _s = _ss.str();
-            m_PUHashToPUType[stringToIntHash(_s)] = _myCompType;
-          }
+    for (Int_t _rack = 25; _rack <= 25; ++_rack) {
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 36; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-36:HLT-24-HT:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
+    }
+
+    for (Int_t _rack = 26; _rack <= 26; ++_rack) {
+      for (Int_t _pc = 1; _pc <= 64; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 48; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-48:HLT-24-HTPlus:tpu-rack-"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
+        }
+      }
+    }
+
+    for (Int_t _rack = 44; _rack <= 44; ++_rack) {
+      for (Int_t _pc = 18; _pc <= 20; ++_pc) {
+        for (Int_t _pu = 1; _pu <= 28; ++_pu) {
+          std::stringstream _ss;
+          std::string _s;
+          _ss << std::setfill('0')
+              << "APP_" << _hltLevel
+              << ":HLTMPPU-24:HLT-24-IT:tpu-rack"
+              << std::setw(2) << _rack
+              << ":pc-tdq-tpu-"
+              << std::setw(2) << _rack
+              << std::setw(3) << _pc
+              << "-"
+              << std::setw(2) << _pu;
+          _s = _ss.str();
+          m_PUHashToPUType[stringToIntHash(_s)] = _rack;
         }
       }
     }
 
-    delete _xml;
     return;
   }
 
+  /**
+   * @reutrn The rack number the current PU is located in. Or 0 for unknown
+   */
   UInt_t TrigXMLService::getComputerType(UInt_t _hash) {
     UIntUIntMapIt_t _it = m_PUHashToPUType.find(_hash);
 
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/Utility.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/Utility.cxx
index 2f335fea4888c164e47e4c322d4010f1850a4c68..ea68ee8cc26062561d1249bc3343c01a736dc45e 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/Utility.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/Utility.cxx
@@ -312,7 +312,7 @@ namespace TrigCostRootAnalysis {
    * @param _s String to hash
    * @returns Hash value.
    */
-  UInt_t stringToIntHash(std::string& _s) {
+  UInt_t stringToIntHash(const std::string& _s) {
     UInt_t _hash;
 
     _hash = 0xd2d84a61;
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/TrigXMLService.h b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/TrigXMLService.h
index 372db8f758b23e3dce2b21a541ea0db0bc87ade6..412108e280cedaf4d52a94e5236308857e6c1805 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/TrigXMLService.h
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/TrigXMLService.h
@@ -68,7 +68,6 @@ namespace TrigCostRootAnalysis {
     Int_t getOnlineEventsInLB(Int_t _lb);
 
     void parseHLTFarmXML();
-    const IntStringMap_t& getComputerTypeToNameMap() {return m_computerTypeToNameMap;}
     UInt_t getComputerType(UInt_t _hash);
   private:
     void parseRunXML(const Int_t _runNumber, const Bool_t _primaryRun);
@@ -152,6 +151,7 @@ namespace TrigCostRootAnalysis {
     IntIntMap_t m_totalEventsPerLB; //!< Map of how many events there were online per LB (from COOL, stored in XML)
     Int_PairStringInt_Map_t m_bunchGroupXML; //!< Bunchgroup config, loaded from XML
     Bool_t m_parsedRunXML; //!< If we managed to read the run XML
+    Bool_t m_ignoreGRL; //!< Cache this setting if GRL is to be ignored in enhanced bias data 
     std::set<Int_t>         m_badLumiBlocks; //!< LBs flagged as bad by rate experts in the run XML
     Int_t m_minLB; //!< Lower lumi block with information in the run XML
     Int_t m_maxLB; //!< Upper lumi block with information in the run XML
@@ -159,7 +159,6 @@ namespace TrigCostRootAnalysis {
 
     // For decoding a PUs location in the farm
     UIntUIntMap_t m_PUHashToPUType; //!< Map of a PU's HASH to it's processor type
-    IntStringMap_t m_computerTypeToNameMap; //!< Map of a processor type to its name
     UInt_t m_computerUnknownID; //!< ID of the "UNKNOWN" type
 
     Float_t m_loadedDeadtime; //!< Currently loaded deadtime from run XML (will change with time if doing MultiRun)
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
index 12dcefff9b5dc2acf5ced8858019b68895b69d5f..10a534c61576a204f691c9121182591c809f06cb 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
@@ -240,7 +240,9 @@ namespace TrigCostRootAnalysis {
     kNBunchGroups,
     kDoEBWeighting,
     kDoCPS,
+    kIgnorePSGreaterThanOne,
     kIgnoreNonPhysBunchGroups,
+    kIgnoreGRL,
     kNoLBRescaling,
     kPatternsInvert,
     kDirectlyApplyPrescales,
@@ -367,14 +369,8 @@ namespace TrigCostRootAnalysis {
     kVersionString,
     kLBPerKeyset,
     kVarTime,     // Study Variable ENUMs
-    kVarSteeringTimeCPUType1,
-    kVarSteeringTimeCPUType2,
-    kVarSteeringTimeCPUType3,
-    kVarSteeringTimeCPUType4,
-    kVarEventsCPUType1,
-    kVarEventsCPUType2,
-    kVarEventsCPUType3,
-    kVarEventsCPUType4,
+    kVarSteeringTimeCPUType,
+    kVarEventsCPUType,
     kVarRerunTime,
     kVarPassTime,
     kVarTimeExec,
@@ -614,7 +610,7 @@ namespace TrigCostRootAnalysis {
   Bool_t isZero(Float_t _float, Float_t _precision = 0.00000001);
   Bool_t isEqual(Float_t _float1, Float_t _float2, Float_t _precision = 0.00000001);
   ConfVariableOptionPair_t makePair(ConfKey_t _name, VariableOption_t _vo);
-  UInt_t stringToIntHash(std::string& s);
+  UInt_t stringToIntHash(const std::string& s);
   const std::string& getLevelString(UInt_t _level);
   Float_t deltaR(Float_t _phi1, Float_t _phi2, Float_t _eta1, Float_t _eta2);
 
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/HLTFarm.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/HLTFarm.xml
deleted file mode 100644
index fa439167d7cffae2114791ab0958ded2add41e54..0000000000000000000000000000000000000000
--- a/Trigger/TrigCost/TrigCostRootAnalysis/data/HLTFarm.xml
+++ /dev/null
@@ -1,2444 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<oks-data>
-<types>
-  <type code="1" name="Xeon X5650 2.67GHz" />
-  <type code="2" name="Xeon E5540 2.53GHz" />
-  <type code="3" name="Xeon E5-2680 v3 2.50GHz" />
-  <type code="4" name="UNKNOWN CPU" />
-</types>
-<computers>
-<c i="01001" t="1" />
-<c i="01001" t="1" />
-<c i="01002" t="1" />
-<c i="01003" t="1" />
-<c i="01004" t="1" />
-<c i="01005" t="1" />
-<c i="01006" t="1" />
-<c i="01007" t="1" />
-<c i="01008" t="1" />
-<c i="01009" t="1" />
-<c i="01010" t="1" />
-<c i="01011" t="1" />
-<c i="01012" t="1" />
-<c i="01013" t="1" />
-<c i="01014" t="1" />
-<c i="01015" t="1" />
-<c i="01016" t="1" />
-<c i="01017" t="1" />
-<c i="01018" t="1" />
-<c i="01019" t="1" />
-<c i="01020" t="1" />
-<c i="01021" t="1" />
-<c i="01022" t="1" />
-<c i="01023" t="1" />
-<c i="01024" t="1" />
-<c i="01025" t="1" />
-<c i="01026" t="1" />
-<c i="01027" t="1" />
-<c i="01028" t="1" />
-<c i="01029" t="1" />
-<c i="01030" t="1" />
-<c i="01031" t="1" />
-<c i="01032" t="1" />
-<c i="02001" t="1" />
-<c i="02002" t="1" />
-<c i="02003" t="1" />
-<c i="02004" t="1" />
-<c i="02005" t="1" />
-<c i="02006" t="1" />
-<c i="02007" t="1" />
-<c i="02008" t="1" />
-<c i="02009" t="1" />
-<c i="02010" t="1" />
-<c i="02011" t="1" />
-<c i="02012" t="1" />
-<c i="02013" t="1" />
-<c i="02014" t="1" />
-<c i="02015" t="1" />
-<c i="02016" t="1" />
-<c i="02017" t="1" />
-<c i="02018" t="1" />
-<c i="02019" t="1" />
-<c i="02020" t="1" />
-<c i="02021" t="1" />
-<c i="02022" t="1" />
-<c i="02023" t="1" />
-<c i="02024" t="1" />
-<c i="02025" t="1" />
-<c i="02026" t="1" />
-<c i="02027" t="1" />
-<c i="02028" t="1" />
-<c i="02029" t="1" />
-<c i="02030" t="1" />
-<c i="02031" t="1" />
-<c i="02032" t="1" />
-<c i="03001" t="1" />
-<c i="03002" t="1" />
-<c i="03003" t="1" />
-<c i="03004" t="1" />
-<c i="03005" t="1" />
-<c i="03006" t="1" />
-<c i="03007" t="1" />
-<c i="03008" t="1" />
-<c i="03009" t="1" />
-<c i="03010" t="1" />
-<c i="03011" t="1" />
-<c i="03012" t="1" />
-<c i="03013" t="1" />
-<c i="03014" t="1" />
-<c i="03015" t="1" />
-<c i="03016" t="1" />
-<c i="03017" t="1" />
-<c i="03018" t="1" />
-<c i="03019" t="1" />
-<c i="03020" t="1" />
-<c i="03021" t="1" />
-<c i="03022" t="1" />
-<c i="03023" t="1" />
-<c i="03024" t="1" />
-<c i="03025" t="1" />
-<c i="03026" t="1" />
-<c i="03027" t="1" />
-<c i="03028" t="1" />
-<c i="03029" t="1" />
-<c i="03030" t="1" />
-<c i="03031" t="1" />
-<c i="03032" t="1" />
-<c i="04001" t="1" />
-<c i="04002" t="1" />
-<c i="04003" t="1" />
-<c i="04004" t="1" />
-<c i="04005" t="1" />
-<c i="04006" t="1" />
-<c i="04007" t="1" />
-<c i="04008" t="1" />
-<c i="04009" t="1" />
-<c i="04010" t="1" />
-<c i="04011" t="1" />
-<c i="04012" t="1" />
-<c i="04013" t="1" />
-<c i="04014" t="1" />
-<c i="04015" t="1" />
-<c i="04016" t="1" />
-<c i="04017" t="1" />
-<c i="04018" t="1" />
-<c i="04019" t="1" />
-<c i="04020" t="1" />
-<c i="04021" t="1" />
-<c i="04022" t="1" />
-<c i="04023" t="1" />
-<c i="04024" t="1" />
-<c i="04025" t="1" />
-<c i="04026" t="1" />
-<c i="04027" t="1" />
-<c i="04028" t="1" />
-<c i="04029" t="1" />
-<c i="04030" t="1" />
-<c i="04031" t="1" />
-<c i="04032" t="1" />
-<c i="05001" t="2" />
-<c i="05002" t="2" />
-<c i="05003" t="2" />
-<c i="05004" t="2" />
-<c i="05005" t="2" />
-<c i="05006" t="2" />
-<c i="05007" t="2" />
-<c i="05008" t="2" />
-<c i="05009" t="2" />
-<c i="05010" t="2" />
-<c i="05011" t="2" />
-<c i="05012" t="2" />
-<c i="05013" t="2" />
-<c i="05014" t="2" />
-<c i="05015" t="2" />
-<c i="05016" t="2" />
-<c i="05017" t="2" />
-<c i="05018" t="2" />
-<c i="05019" t="2" />
-<c i="05020" t="2" />
-<c i="05021" t="2" />
-<c i="05022" t="2" />
-<c i="05023" t="2" />
-<c i="05024" t="2" />
-<c i="05025" t="2" />
-<c i="05026" t="2" />
-<c i="05027" t="2" />
-<c i="05028" t="2" />
-<c i="05029" t="2" />
-<c i="05030" t="2" />
-<c i="05031" t="2" />
-<c i="05032" t="2" />
-<c i="06001" t="1" />
-<c i="06002" t="1" />
-<c i="06003" t="1" />
-<c i="06004" t="1" />
-<c i="06005" t="1" />
-<c i="06006" t="1" />
-<c i="06007" t="1" />
-<c i="06008" t="1" />
-<c i="06009" t="1" />
-<c i="06010" t="1" />
-<c i="06011" t="1" />
-<c i="06012" t="1" />
-<c i="06013" t="1" />
-<c i="06014" t="1" />
-<c i="06015" t="1" />
-<c i="06016" t="1" />
-<c i="06017" t="1" />
-<c i="06018" t="1" />
-<c i="06019" t="1" />
-<c i="06020" t="1" />
-<c i="06021" t="1" />
-<c i="06022" t="1" />
-<c i="06023" t="1" />
-<c i="06024" t="1" />
-<c i="06025" t="1" />
-<c i="06026" t="1" />
-<c i="06027" t="1" />
-<c i="06028" t="1" />
-<c i="06029" t="1" />
-<c i="06030" t="1" />
-<c i="06031" t="1" />
-<c i="06032" t="1" />
-<c i="07001" t="1" />
-<c i="07002" t="1" />
-<c i="07003" t="1" />
-<c i="07004" t="1" />
-<c i="07005" t="1" />
-<c i="07006" t="1" />
-<c i="07007" t="1" />
-<c i="07008" t="1" />
-<c i="07009" t="1" />
-<c i="07010" t="1" />
-<c i="07011" t="1" />
-<c i="07012" t="1" />
-<c i="07013" t="1" />
-<c i="07014" t="1" />
-<c i="07015" t="1" />
-<c i="07016" t="1" />
-<c i="07017" t="1" />
-<c i="07018" t="1" />
-<c i="07019" t="1" />
-<c i="07020" t="1" />
-<c i="07021" t="1" />
-<c i="07022" t="1" />
-<c i="07023" t="1" />
-<c i="07024" t="1" />
-<c i="07025" t="1" />
-<c i="07026" t="1" />
-<c i="07027" t="1" />
-<c i="07028" t="1" />
-<c i="07029" t="1" />
-<c i="07030" t="1" />
-<c i="07031" t="1" />
-<c i="07032" t="1" />
-<c i="08001" t="1" />
-<c i="08002" t="1" />
-<c i="08003" t="1" />
-<c i="08004" t="1" />
-<c i="08005" t="1" />
-<c i="08006" t="1" />
-<c i="08007" t="1" />
-<c i="08008" t="1" />
-<c i="08009" t="1" />
-<c i="08010" t="1" />
-<c i="08011" t="1" />
-<c i="08012" t="1" />
-<c i="08013" t="1" />
-<c i="08014" t="1" />
-<c i="08015" t="1" />
-<c i="08016" t="1" />
-<c i="08017" t="1" />
-<c i="08018" t="1" />
-<c i="08019" t="1" />
-<c i="08020" t="1" />
-<c i="08021" t="1" />
-<c i="08022" t="1" />
-<c i="08023" t="1" />
-<c i="08024" t="1" />
-<c i="08025" t="1" />
-<c i="08026" t="1" />
-<c i="08027" t="1" />
-<c i="08028" t="1" />
-<c i="08029" t="1" />
-<c i="08030" t="1" />
-<c i="08031" t="1" />
-<c i="08032" t="1" />
-<c i="09001" t="1" />
-<c i="09002" t="1" />
-<c i="09003" t="1" />
-<c i="09004" t="1" />
-<c i="09005" t="1" />
-<c i="09006" t="1" />
-<c i="09007" t="1" />
-<c i="09008" t="1" />
-<c i="09009" t="1" />
-<c i="09010" t="1" />
-<c i="09011" t="1" />
-<c i="09012" t="1" />
-<c i="09013" t="1" />
-<c i="09014" t="1" />
-<c i="09015" t="1" />
-<c i="09016" t="1" />
-<c i="09017" t="1" />
-<c i="09018" t="1" />
-<c i="09019" t="1" />
-<c i="09020" t="1" />
-<c i="09021" t="1" />
-<c i="09022" t="1" />
-<c i="09023" t="1" />
-<c i="09024" t="1" />
-<c i="09025" t="1" />
-<c i="09026" t="1" />
-<c i="09027" t="1" />
-<c i="09028" t="1" />
-<c i="09029" t="1" />
-<c i="09030" t="1" />
-<c i="09031" t="1" />
-<c i="09032" t="1" />
-<c i="10001" t="1" />
-<c i="10002" t="1" />
-<c i="10003" t="1" />
-<c i="10004" t="1" />
-<c i="10005" t="1" />
-<c i="10006" t="1" />
-<c i="10007" t="1" />
-<c i="10008" t="1" />
-<c i="10009" t="1" />
-<c i="10010" t="1" />
-<c i="10011" t="1" />
-<c i="10012" t="1" />
-<c i="10013" t="1" />
-<c i="10014" t="1" />
-<c i="10015" t="1" />
-<c i="10016" t="1" />
-<c i="10017" t="1" />
-<c i="10018" t="1" />
-<c i="10019" t="1" />
-<c i="10020" t="1" />
-<c i="10021" t="1" />
-<c i="10022" t="1" />
-<c i="10023" t="1" />
-<c i="10024" t="1" />
-<c i="10025" t="1" />
-<c i="10026" t="1" />
-<c i="10027" t="1" />
-<c i="10028" t="1" />
-<c i="10029" t="1" />
-<c i="10030" t="1" />
-<c i="10031" t="1" />
-<c i="10032" t="1" />
-<c i="11001" t="1" />
-<c i="11002" t="1" />
-<c i="11003" t="1" />
-<c i="11004" t="1" />
-<c i="11005" t="1" />
-<c i="11006" t="1" />
-<c i="11007" t="1" />
-<c i="11008" t="1" />
-<c i="11009" t="1" />
-<c i="11010" t="1" />
-<c i="11011" t="1" />
-<c i="11012" t="1" />
-<c i="11013" t="1" />
-<c i="11014" t="1" />
-<c i="11015" t="1" />
-<c i="11016" t="1" />
-<c i="11017" t="1" />
-<c i="11018" t="1" />
-<c i="11019" t="1" />
-<c i="11020" t="1" />
-<c i="11021" t="1" />
-<c i="11022" t="1" />
-<c i="11023" t="1" />
-<c i="11024" t="1" />
-<c i="11025" t="1" />
-<c i="11026" t="1" />
-<c i="11027" t="1" />
-<c i="11028" t="1" />
-<c i="11029" t="1" />
-<c i="11030" t="1" />
-<c i="11031" t="1" />
-<c i="11032" t="1" />
-<c i="12001" t="1" />
-<c i="12002" t="1" />
-<c i="12003" t="1" />
-<c i="12004" t="1" />
-<c i="12005" t="1" />
-<c i="12006" t="1" />
-<c i="12007" t="1" />
-<c i="12008" t="1" />
-<c i="12009" t="1" />
-<c i="12010" t="1" />
-<c i="12011" t="1" />
-<c i="12012" t="1" />
-<c i="12013" t="1" />
-<c i="12014" t="1" />
-<c i="12015" t="1" />
-<c i="12016" t="1" />
-<c i="12017" t="1" />
-<c i="12018" t="1" />
-<c i="12019" t="1" />
-<c i="12020" t="1" />
-<c i="12021" t="1" />
-<c i="12022" t="1" />
-<c i="12023" t="1" />
-<c i="12024" t="1" />
-<c i="12025" t="1" />
-<c i="12026" t="1" />
-<c i="12027" t="1" />
-<c i="12028" t="1" />
-<c i="12029" t="1" />
-<c i="12030" t="1" />
-<c i="12031" t="1" />
-<c i="12032" t="1" />
-<c i="13001" t="1" />
-<c i="13002" t="1" />
-<c i="13003" t="1" />
-<c i="13004" t="1" />
-<c i="13005" t="1" />
-<c i="13006" t="1" />
-<c i="13007" t="1" />
-<c i="13008" t="1" />
-<c i="13009" t="1" />
-<c i="13010" t="1" />
-<c i="13011" t="1" />
-<c i="13012" t="1" />
-<c i="13013" t="1" />
-<c i="13014" t="1" />
-<c i="13015" t="1" />
-<c i="13016" t="1" />
-<c i="13017" t="1" />
-<c i="13018" t="1" />
-<c i="13019" t="1" />
-<c i="13020" t="1" />
-<c i="13021" t="1" />
-<c i="13022" t="1" />
-<c i="13023" t="1" />
-<c i="13024" t="1" />
-<c i="13025" t="1" />
-<c i="13026" t="1" />
-<c i="13027" t="1" />
-<c i="13028" t="1" />
-<c i="13029" t="1" />
-<c i="13030" t="1" />
-<c i="13031" t="1" />
-<c i="13032" t="1" />
-<c i="16001" t="3" />
-<c i="16002" t="3" />
-<c i="16003" t="3" />
-<c i="16004" t="3" />
-<c i="16005" t="3" />
-<c i="16006" t="3" />
-<c i="16007" t="3" />
-<c i="16008" t="3" />
-<c i="16009" t="3" />
-<c i="16010" t="3" />
-<c i="16011" t="3" />
-<c i="16012" t="3" />
-<c i="16013" t="3" />
-<c i="16014" t="3" />
-<c i="16015" t="3" />
-<c i="16016" t="3" />
-<c i="16017" t="3" />
-<c i="16018" t="3" />
-<c i="16019" t="3" />
-<c i="16020" t="3" />
-<c i="16021" t="3" />
-<c i="16022" t="3" />
-<c i="16023" t="3" />
-<c i="16024" t="3" />
-<c i="16025" t="3" />
-<c i="16026" t="3" />
-<c i="16027" t="3" />
-<c i="16028" t="3" />
-<c i="16029" t="3" />
-<c i="16030" t="3" />
-<c i="16031" t="3" />
-<c i="16032" t="3" />
-<c i="17001" t="4" />
-<c i="17002" t="4" />
-<c i="17003" t="4" />
-<c i="17004" t="4" />
-<c i="17005" t="4" />
-<c i="17006" t="4" />
-<c i="17007" t="4" />
-<c i="17008" t="4" />
-<c i="17009" t="4" />
-<c i="17010" t="4" />
-<c i="17011" t="4" />
-<c i="17012" t="4" />
-<c i="17013" t="4" />
-<c i="17014" t="4" />
-<c i="17015" t="4" />
-<c i="17016" t="4" />
-<c i="17017" t="4" />
-<c i="17018" t="4" />
-<c i="17019" t="4" />
-<c i="17020" t="4" />
-<c i="17021" t="3" />
-<c i="17022" t="4" />
-<c i="17023" t="4" />
-<c i="17024" t="4" />
-<c i="17025" t="4" />
-<c i="17026" t="4" />
-<c i="17027" t="4" />
-<c i="17028" t="4" />
-<c i="17029" t="4" />
-<c i="17030" t="4" />
-<c i="17031" t="4" />
-<c i="17032" t="4" />
-<c i="18001" t="4" />
-<c i="18002" t="4" />
-<c i="18003" t="4" />
-<c i="18004" t="4" />
-<c i="18005" t="4" />
-<c i="18006" t="4" />
-<c i="18007" t="3" />
-<c i="18008" t="4" />
-<c i="18009" t="4" />
-<c i="18010" t="4" />
-<c i="18011" t="4" />
-<c i="18012" t="4" />
-<c i="18013" t="4" />
-<c i="18014" t="4" />
-<c i="18015" t="4" />
-<c i="18016" t="4" />
-<c i="18017" t="4" />
-<c i="18018" t="4" />
-<c i="18019" t="4" />
-<c i="18020" t="4" />
-<c i="18021" t="4" />
-<c i="18022" t="4" />
-<c i="18023" t="4" />
-<c i="18024" t="4" />
-<c i="18025" t="4" />
-<c i="18026" t="4" />
-<c i="18027" t="4" />
-<c i="18028" t="4" />
-<c i="18029" t="4" />
-<c i="18030" t="4" />
-<c i="18031" t="4" />
-<c i="18032" t="4" />
-<c i="19001" t="4" />
-<c i="19002" t="4" />
-<c i="19003" t="4" />
-<c i="19004" t="4" />
-<c i="19005" t="4" />
-<c i="19006" t="4" />
-<c i="19007" t="4" />
-<c i="19008" t="4" />
-<c i="19009" t="4" />
-<c i="19010" t="4" />
-<c i="19011" t="4" />
-<c i="19012" t="4" />
-<c i="19013" t="4" />
-<c i="19014" t="4" />
-<c i="19015" t="4" />
-<c i="19016" t="4" />
-<c i="19017" t="4" />
-<c i="19018" t="4" />
-<c i="19019" t="4" />
-<c i="19020" t="4" />
-<c i="19021" t="4" />
-<c i="19022" t="4" />
-<c i="19023" t="4" />
-<c i="19024" t="4" />
-<c i="19025" t="4" />
-<c i="19026" t="3" />
-<c i="19027" t="4" />
-<c i="19028" t="4" />
-<c i="19029" t="4" />
-<c i="19030" t="4" />
-<c i="19031" t="4" />
-<c i="19032" t="4" />
-<c i="20001" t="4" />
-<c i="20002" t="4" />
-<c i="20003" t="4" />
-<c i="20004" t="4" />
-<c i="20005" t="4" />
-<c i="20006" t="4" />
-<c i="20007" t="4" />
-<c i="20008" t="4" />
-<c i="20009" t="4" />
-<c i="20010" t="4" />
-<c i="20011" t="4" />
-<c i="20012" t="4" />
-<c i="20013" t="4" />
-<c i="20014" t="4" />
-<c i="20015" t="4" />
-<c i="20016" t="4" />
-<c i="20017" t="4" />
-<c i="20018" t="4" />
-<c i="20019" t="4" />
-<c i="20020" t="4" />
-<c i="20021" t="4" />
-<c i="20022" t="4" />
-<c i="20023" t="4" />
-<c i="20024" t="4" />
-<c i="20025" t="4" />
-<c i="20026" t="4" />
-<c i="20027" t="3" />
-<c i="20028" t="4" />
-<c i="20029" t="4" />
-<c i="20030" t="4" />
-<c i="20031" t="4" />
-<c i="20032" t="4" />
-<c i="21001" t="4" />
-<c i="21002" t="4" />
-<c i="21003" t="4" />
-<c i="21004" t="4" />
-<c i="21005" t="4" />
-<c i="21006" t="4" />
-<c i="21007" t="4" />
-<c i="21008" t="4" />
-<c i="21009" t="4" />
-<c i="21010" t="4" />
-<c i="21011" t="4" />
-<c i="21012" t="4" />
-<c i="21013" t="4" />
-<c i="21014" t="4" />
-<c i="21015" t="4" />
-<c i="21016" t="4" />
-<c i="21017" t="4" />
-<c i="21018" t="4" />
-<c i="21019" t="4" />
-<c i="21020" t="4" />
-<c i="21021" t="4" />
-<c i="21022" t="4" />
-<c i="21023" t="4" />
-<c i="21024" t="4" />
-<c i="21025" t="4" />
-<c i="21026" t="4" />
-<c i="21027" t="4" />
-<c i="21028" t="4" />
-<c i="21029" t="4" />
-<c i="21030" t="4" />
-<c i="21031" t="4" />
-<c i="21032" t="4" />
-<c i="22001" t="4" />
-<c i="22002" t="4" />
-<c i="22003" t="4" />
-<c i="22004" t="4" />
-<c i="22005" t="4" />
-<c i="22006" t="4" />
-<c i="22007" t="4" />
-<c i="22008" t="4" />
-<c i="22009" t="4" />
-<c i="22010" t="4" />
-<c i="22011" t="4" />
-<c i="22012" t="4" />
-<c i="22013" t="4" />
-<c i="22014" t="4" />
-<c i="22015" t="4" />
-<c i="22016" t="4" />
-<c i="22017" t="4" />
-<c i="22018" t="4" />
-<c i="22019" t="4" />
-<c i="22020" t="4" />
-<c i="22021" t="4" />
-<c i="22022" t="4" />
-<c i="22023" t="4" />
-<c i="22024" t="4" />
-<c i="22025" t="4" />
-<c i="22026" t="4" />
-<c i="22027" t="4" />
-<c i="22028" t="4" />
-<c i="22029" t="4" />
-<c i="22030" t="4" />
-<c i="22031" t="4" />
-<c i="22032" t="4" />
-<c i="23001" t="4" />
-<c i="23002" t="4" />
-<c i="23003" t="4" />
-<c i="23004" t="4" />
-<c i="23005" t="4" />
-<c i="23006" t="4" />
-<c i="23007" t="4" />
-<c i="23008" t="4" />
-<c i="23009" t="4" />
-<c i="23010" t="4" />
-<c i="23011" t="4" />
-<c i="23012" t="4" />
-<c i="23013" t="4" />
-<c i="23014" t="4" />
-<c i="23015" t="4" />
-<c i="23016" t="4" />
-<c i="23017" t="4" />
-<c i="23018" t="4" />
-<c i="23019" t="4" />
-<c i="23020" t="4" />
-<c i="23021" t="4" />
-<c i="23022" t="4" />
-<c i="23023" t="4" />
-<c i="23024" t="4" />
-<c i="23025" t="4" />
-<c i="23026" t="4" />
-<c i="23027" t="4" />
-<c i="23028" t="4" />
-<c i="23029" t="4" />
-<c i="23030" t="4" />
-<c i="23031" t="4" />
-<c i="23032" t="4" />
-<c i="24001" t="4" />
-<c i="24002" t="4" />
-<c i="24003" t="4" />
-<c i="24004" t="4" />
-<c i="24005" t="4" />
-<c i="24006" t="4" />
-<c i="24007" t="4" />
-<c i="24008" t="4" />
-<c i="24009" t="4" />
-<c i="24010" t="4" />
-<c i="24011" t="4" />
-<c i="24012" t="4" />
-<c i="24013" t="4" />
-<c i="24014" t="4" />
-<c i="24015" t="4" />
-<c i="24016" t="4" />
-<c i="24017" t="3" />
-<c i="24018" t="4" />
-<c i="24019" t="4" />
-<c i="24020" t="4" />
-<c i="24021" t="4" />
-<c i="24022" t="4" />
-<c i="24023" t="4" />
-<c i="24024" t="4" />
-<c i="24025" t="4" />
-<c i="24026" t="4" />
-<c i="24027" t="4" />
-<c i="24028" t="4" />
-<c i="24029" t="4" />
-<c i="24030" t="4" />
-<c i="24031" t="4" />
-<c i="24032" t="4" />
-<c i="25001" t="3" />
-<c i="25002" t="3" />
-<c i="25003" t="3" />
-<c i="25004" t="3" />
-<c i="25005" t="3" />
-<c i="25006" t="3" />
-<c i="25007" t="3" />
-<c i="25008" t="3" />
-<c i="25009" t="3" />
-<c i="25010" t="3" />
-<c i="25011" t="3" />
-<c i="25012" t="3" />
-<c i="25013" t="3" />
-<c i="25014" t="3" />
-<c i="25015" t="3" />
-<c i="25016" t="3" />
-<c i="25017" t="3" />
-<c i="25018" t="3" />
-<c i="25019" t="3" />
-<c i="25020" t="3" />
-<c i="25021" t="3" />
-<c i="25022" t="3" />
-<c i="25023" t="3" />
-<c i="25024" t="3" />
-<c i="25025" t="3" />
-<c i="25026" t="3" />
-<c i="25027" t="3" />
-<c i="25028" t="3" />
-<c i="25029" t="3" />
-<c i="25030" t="3" />
-<c i="25031" t="3" />
-<c i="25032" t="3" />
-<c i="26001" t="3" />
-<c i="26002" t="3" />
-<c i="26003" t="3" />
-<c i="26004" t="3" />
-<c i="26005" t="3" />
-<c i="26006" t="3" />
-<c i="26007" t="3" />
-<c i="26008" t="3" />
-<c i="26009" t="3" />
-<c i="26010" t="3" />
-<c i="26011" t="3" />
-<c i="26012" t="3" />
-<c i="26013" t="3" />
-<c i="26014" t="3" />
-<c i="26015" t="3" />
-<c i="26016" t="3" />
-<c i="26017" t="3" />
-<c i="26018" t="3" />
-<c i="26019" t="3" />
-<c i="26020" t="3" />
-<c i="26021" t="3" />
-<c i="26022" t="3" />
-<c i="26023" t="3" />
-<c i="26024" t="3" />
-<c i="26025" t="3" />
-<c i="26026" t="3" />
-<c i="26027" t="3" />
-<c i="26028" t="3" />
-<c i="26029" t="3" />
-<c i="26030" t="3" />
-<c i="26031" t="3" />
-<c i="26032" t="3" />
-<c i="44001" t="2" />
-<c i="44002" t="2" />
-<c i="44003" t="2" />
-<c i="44004" t="2" />
-<c i="44005" t="2" />
-<c i="44006" t="2" />
-<c i="44007" t="2" />
-<c i="44008" t="2" />
-<c i="44009" t="2" />
-<c i="44010" t="2" />
-<c i="44011" t="2" />
-<c i="44012" t="2" />
-<c i="44013" t="2" />
-<c i="44014" t="2" />
-<c i="44015" t="2" />
-<c i="44016" t="2" />
-<c i="44017" t="2" />
-<c i="44018" t="2" />
-<c i="44019" t="2" />
-<c i="44020" t="2" />
-<c i="44021" t="2" />
-<c i="44022" t="2" />
-<c i="44023" t="2" />
-<c i="44024" t="2" />
-<c i="44025" t="2" />
-<c i="44026" t="2" />
-<c i="44027" t="2" />
-<c i="44028" t="2" />
-<c i="44029" t="2" />
-<c i="44030" t="2" />
-<c i="44031" t="2" />
-<c i="44032" t="2" />
-<c i="45001" t="2" />
-<c i="45002" t="2" />
-<c i="45003" t="2" />
-<c i="45004" t="2" />
-<c i="45005" t="2" />
-<c i="45006" t="2" />
-<c i="45007" t="2" />
-<c i="45008" t="2" />
-<c i="45009" t="2" />
-<c i="45010" t="2" />
-<c i="45011" t="4" />
-<c i="45012" t="2" />
-<c i="45013" t="2" />
-<c i="45014" t="2" />
-<c i="45015" t="2" />
-<c i="45016" t="2" />
-<c i="45017" t="2" />
-<c i="45018" t="2" />
-<c i="45019" t="2" />
-<c i="45020" t="2" />
-<c i="45021" t="2" />
-<c i="45022" t="2" />
-<c i="45023" t="2" />
-<c i="45024" t="2" />
-<c i="45025" t="2" />
-<c i="45026" t="2" />
-<c i="45027" t="2" />
-<c i="45028" t="2" />
-<c i="45029" t="2" />
-<c i="45030" t="2" />
-<c i="45031" t="2" />
-<c i="45032" t="2" />
-<c i="46001" t="2" />
-<c i="46002" t="2" />
-<c i="46003" t="2" />
-<c i="46004" t="2" />
-<c i="46005" t="2" />
-<c i="46006" t="2" />
-<c i="46007" t="2" />
-<c i="46008" t="2" />
-<c i="46009" t="2" />
-<c i="46010" t="2" />
-<c i="46011" t="2" />
-<c i="46012" t="2" />
-<c i="46013" t="2" />
-<c i="46014" t="2" />
-<c i="46015" t="2" />
-<c i="46016" t="2" />
-<c i="46017" t="2" />
-<c i="46018" t="2" />
-<c i="46019" t="2" />
-<c i="46020" t="2" />
-<c i="46021" t="2" />
-<c i="46022" t="2" />
-<c i="46023" t="2" />
-<c i="46024" t="2" />
-<c i="46025" t="2" />
-<c i="46026" t="2" />
-<c i="46027" t="2" />
-<c i="46028" t="2" />
-<c i="46029" t="2" />
-<c i="46030" t="2" />
-<c i="46031" t="2" />
-<c i="46032" t="2" />
-<c i="47001" t="2" />
-<c i="47002" t="2" />
-<c i="47003" t="2" />
-<c i="47004" t="2" />
-<c i="47005" t="2" />
-<c i="47006" t="2" />
-<c i="47007" t="2" />
-<c i="47008" t="2" />
-<c i="47009" t="2" />
-<c i="47010" t="2" />
-<c i="47011" t="2" />
-<c i="47012" t="2" />
-<c i="47013" t="2" />
-<c i="47014" t="2" />
-<c i="47015" t="2" />
-<c i="47016" t="2" />
-<c i="47017" t="2" />
-<c i="47018" t="2" />
-<c i="47019" t="2" />
-<c i="47020" t="2" />
-<c i="47021" t="2" />
-<c i="47022" t="2" />
-<c i="47023" t="2" />
-<c i="47024" t="2" />
-<c i="47025" t="2" />
-<c i="47026" t="2" />
-<c i="47027" t="2" />
-<c i="47028" t="2" />
-<c i="47029" t="2" />
-<c i="47030" t="2" />
-<c i="47031" t="2" />
-<c i="47032" t="2" />
-<c i="48001" t="2" />
-<c i="48002" t="2" />
-<c i="48003" t="2" />
-<c i="48004" t="2" />
-<c i="48005" t="2" />
-<c i="48006" t="2" />
-<c i="48007" t="2" />
-<c i="48008" t="2" />
-<c i="48009" t="2" />
-<c i="48010" t="2" />
-<c i="48011" t="2" />
-<c i="48012" t="2" />
-<c i="48013" t="2" />
-<c i="48014" t="2" />
-<c i="48015" t="2" />
-<c i="48016" t="2" />
-<c i="48017" t="2" />
-<c i="48018" t="2" />
-<c i="48019" t="2" />
-<c i="48020" t="2" />
-<c i="48021" t="2" />
-<c i="48022" t="2" />
-<c i="48023" t="2" />
-<c i="48024" t="2" />
-<c i="48025" t="2" />
-<c i="48026" t="2" />
-<c i="48027" t="2" />
-<c i="48028" t="2" />
-<c i="48029" t="2" />
-<c i="48030" t="2" />
-<c i="48031" t="2" />
-<c i="48032" t="2" />
-<c i="49001" t="2" />
-<c i="49002" t="2" />
-<c i="49003" t="2" />
-<c i="49004" t="2" />
-<c i="49005" t="2" />
-<c i="49006" t="2" />
-<c i="49007" t="2" />
-<c i="49008" t="2" />
-<c i="49009" t="2" />
-<c i="49010" t="2" />
-<c i="49011" t="2" />
-<c i="49012" t="2" />
-<c i="49013" t="2" />
-<c i="49014" t="2" />
-<c i="49015" t="2" />
-<c i="49016" t="2" />
-<c i="49017" t="2" />
-<c i="49018" t="2" />
-<c i="49019" t="2" />
-<c i="49020" t="2" />
-<c i="49021" t="2" />
-<c i="49022" t="2" />
-<c i="49023" t="2" />
-<c i="49024" t="2" />
-<c i="49025" t="2" />
-<c i="49026" t="2" />
-<c i="49027" t="2" />
-<c i="49028" t="2" />
-<c i="49029" t="2" />
-<c i="49030" t="2" />
-<c i="49031" t="2" />
-<c i="49032" t="2" />
-<c i="50001" t="2" />
-<c i="50002" t="2" />
-<c i="50003" t="2" />
-<c i="50004" t="2" />
-<c i="50005" t="2" />
-<c i="50006" t="2" />
-<c i="50007" t="2" />
-<c i="50008" t="2" />
-<c i="50009" t="2" />
-<c i="50010" t="2" />
-<c i="50011" t="2" />
-<c i="50012" t="2" />
-<c i="50013" t="2" />
-<c i="50014" t="2" />
-<c i="50015" t="2" />
-<c i="50016" t="2" />
-<c i="50017" t="2" />
-<c i="50018" t="2" />
-<c i="50019" t="2" />
-<c i="50020" t="2" />
-<c i="50021" t="2" />
-<c i="50022" t="2" />
-<c i="50023" t="2" />
-<c i="50024" t="2" />
-<c i="50025" t="2" />
-<c i="50026" t="2" />
-<c i="50027" t="2" />
-<c i="50028" t="2" />
-<c i="50029" t="2" />
-<c i="50030" t="2" />
-<c i="50031" t="2" />
-<c i="50032" t="2" />
-<c i="51001" t="2" />
-<c i="51002" t="2" />
-<c i="51003" t="2" />
-<c i="51004" t="2" />
-<c i="51005" t="2" />
-<c i="51006" t="2" />
-<c i="51007" t="2" />
-<c i="51008" t="2" />
-<c i="51009" t="2" />
-<c i="51010" t="2" />
-<c i="51011" t="2" />
-<c i="51012" t="2" />
-<c i="51013" t="2" />
-<c i="51014" t="2" />
-<c i="51015" t="2" />
-<c i="51016" t="2" />
-<c i="51017" t="2" />
-<c i="51018" t="2" />
-<c i="51019" t="2" />
-<c i="51020" t="2" />
-<c i="51021" t="2" />
-<c i="51022" t="2" />
-<c i="51023" t="2" />
-<c i="51024" t="2" />
-<c i="51025" t="2" />
-<c i="51026" t="2" />
-<c i="51027" t="2" />
-<c i="51028" t="2" />
-<c i="51029" t="2" />
-<c i="51030" t="2" />
-<c i="51031" t="2" />
-<c i="51032" t="2" />
-<c i="52001" t="2" />
-<c i="52002" t="2" />
-<c i="52003" t="2" />
-<c i="52004" t="2" />
-<c i="52005" t="2" />
-<c i="52006" t="2" />
-<c i="52007" t="2" />
-<c i="52008" t="2" />
-<c i="52009" t="2" />
-<c i="52010" t="2" />
-<c i="52011" t="2" />
-<c i="52012" t="2" />
-<c i="52013" t="2" />
-<c i="52014" t="2" />
-<c i="52015" t="2" />
-<c i="52016" t="2" />
-<c i="52017" t="2" />
-<c i="52018" t="2" />
-<c i="52019" t="2" />
-<c i="52020" t="2" />
-<c i="52021" t="2" />
-<c i="52022" t="2" />
-<c i="52023" t="2" />
-<c i="52024" t="2" />
-<c i="52025" t="2" />
-<c i="52026" t="2" />
-<c i="52027" t="2" />
-<c i="52028" t="2" />
-<c i="52029" t="2" />
-<c i="52030" t="2" />
-<c i="52031" t="2" />
-<c i="52032" t="2" />
-<c i="53001" t="2" />
-<c i="53002" t="2" />
-<c i="53003" t="2" />
-<c i="53004" t="2" />
-<c i="53005" t="2" />
-<c i="53006" t="2" />
-<c i="53007" t="2" />
-<c i="53008" t="2" />
-<c i="53009" t="2" />
-<c i="53010" t="2" />
-<c i="53011" t="2" />
-<c i="53012" t="2" />
-<c i="53013" t="2" />
-<c i="53014" t="2" />
-<c i="53015" t="2" />
-<c i="53016" t="2" />
-<c i="53017" t="2" />
-<c i="53018" t="2" />
-<c i="53019" t="2" />
-<c i="53020" t="2" />
-<c i="53021" t="2" />
-<c i="53022" t="2" />
-<c i="53023" t="2" />
-<c i="53024" t="2" />
-<c i="53025" t="2" />
-<c i="53026" t="2" />
-<c i="53027" t="2" />
-<c i="53028" t="2" />
-<c i="53029" t="2" />
-<c i="53030" t="2" />
-<c i="53031" t="2" />
-<c i="53032" t="2" />
-<c i="54001" t="1" />
-<c i="54002" t="1" />
-<c i="54003" t="1" />
-<c i="54004" t="1" />
-<c i="54005" t="1" />
-<c i="54006" t="1" />
-<c i="54007" t="1" />
-<c i="54008" t="1" />
-<c i="54009" t="1" />
-<c i="54010" t="1" />
-<c i="54011" t="1" />
-<c i="54012" t="1" />
-<c i="54013" t="1" />
-<c i="54014" t="1" />
-<c i="54015" t="1" />
-<c i="54016" t="1" />
-<c i="54017" t="1" />
-<c i="54018" t="1" />
-<c i="54019" t="1" />
-<c i="54020" t="1" />
-<c i="54021" t="1" />
-<c i="54022" t="1" />
-<c i="54023" t="1" />
-<c i="54024" t="1" />
-<c i="54025" t="1" />
-<c i="54026" t="1" />
-<c i="54027" t="1" />
-<c i="54028" t="1" />
-<c i="54029" t="1" />
-<c i="54030" t="1" />
-<c i="54031" t="1" />
-<c i="54032" t="1" />
-<c i="55001" t="1" />
-<c i="55002" t="1" />
-<c i="55003" t="1" />
-<c i="55004" t="1" />
-<c i="55005" t="1" />
-<c i="55006" t="1" />
-<c i="55007" t="1" />
-<c i="55008" t="1" />
-<c i="55009" t="1" />
-<c i="55010" t="1" />
-<c i="55011" t="1" />
-<c i="55012" t="1" />
-<c i="55013" t="1" />
-<c i="55014" t="1" />
-<c i="55015" t="1" />
-<c i="55016" t="1" />
-<c i="55017" t="1" />
-<c i="55018" t="1" />
-<c i="55019" t="1" />
-<c i="55020" t="1" />
-<c i="55021" t="1" />
-<c i="55022" t="1" />
-<c i="55023" t="1" />
-<c i="55024" t="1" />
-<c i="55025" t="1" />
-<c i="55026" t="1" />
-<c i="55027" t="1" />
-<c i="55028" t="1" />
-<c i="55029" t="1" />
-<c i="55030" t="1" />
-<c i="55031" t="1" />
-<c i="55032" t="1" />
-<c i="56001" t="1" />
-<c i="56002" t="1" />
-<c i="56003" t="1" />
-<c i="56004" t="1" />
-<c i="56005" t="1" />
-<c i="56006" t="1" />
-<c i="56007" t="1" />
-<c i="56008" t="1" />
-<c i="56009" t="1" />
-<c i="56010" t="1" />
-<c i="56011" t="1" />
-<c i="56012" t="1" />
-<c i="56013" t="1" />
-<c i="56014" t="1" />
-<c i="56015" t="1" />
-<c i="56016" t="1" />
-<c i="56017" t="1" />
-<c i="56018" t="1" />
-<c i="56019" t="1" />
-<c i="56020" t="1" />
-<c i="56021" t="1" />
-<c i="56022" t="1" />
-<c i="56023" t="1" />
-<c i="56024" t="1" />
-<c i="56025" t="1" />
-<c i="56026" t="1" />
-<c i="56027" t="1" />
-<c i="56028" t="1" />
-<c i="56029" t="1" />
-<c i="56030" t="1" />
-<c i="56031" t="1" />
-<c i="56032" t="1" />
-<c i="57001" t="1" />
-<c i="57002" t="1" />
-<c i="57003" t="1" />
-<c i="57004" t="1" />
-<c i="57005" t="1" />
-<c i="57006" t="1" />
-<c i="57007" t="1" />
-<c i="57008" t="1" />
-<c i="57009" t="1" />
-<c i="57010" t="1" />
-<c i="57011" t="1" />
-<c i="57012" t="1" />
-<c i="57013" t="1" />
-<c i="57014" t="1" />
-<c i="57015" t="1" />
-<c i="57016" t="1" />
-<c i="57017" t="1" />
-<c i="57018" t="1" />
-<c i="57019" t="1" />
-<c i="57020" t="1" />
-<c i="57021" t="1" />
-<c i="57022" t="1" />
-<c i="57023" t="1" />
-<c i="57024" t="1" />
-<c i="57025" t="1" />
-<c i="57026" t="1" />
-<c i="57027" t="1" />
-<c i="57028" t="1" />
-<c i="57029" t="1" />
-<c i="57030" t="1" />
-<c i="57031" t="1" />
-<c i="57032" t="1" />
-<c i="58001" t="1" />
-<c i="58002" t="1" />
-<c i="58003" t="1" />
-<c i="58004" t="1" />
-<c i="58005" t="1" />
-<c i="58006" t="1" />
-<c i="58007" t="1" />
-<c i="58008" t="1" />
-<c i="58009" t="1" />
-<c i="58010" t="1" />
-<c i="58011" t="1" />
-<c i="58012" t="1" />
-<c i="58013" t="1" />
-<c i="58014" t="1" />
-<c i="58015" t="1" />
-<c i="58016" t="1" />
-<c i="58017" t="1" />
-<c i="58018" t="1" />
-<c i="58019" t="1" />
-<c i="58020" t="1" />
-<c i="58021" t="1" />
-<c i="58022" t="1" />
-<c i="58023" t="1" />
-<c i="58024" t="1" />
-<c i="58025" t="1" />
-<c i="58026" t="1" />
-<c i="58027" t="1" />
-<c i="58028" t="1" />
-<c i="58029" t="1" />
-<c i="58030" t="1" />
-<c i="58031" t="1" />
-<c i="58032" t="1" />
-<c i="58033" t="1" />
-<c i="58034" t="1" />
-<c i="58035" t="1" />
-<c i="58036" t="1" />
-<c i="58037" t="1" />
-<c i="58038" t="1" />
-<c i="58039" t="1" />
-<c i="58040" t="1" />
-<c i="59001" t="1" />
-<c i="59002" t="1" />
-<c i="59003" t="1" />
-<c i="59004" t="1" />
-<c i="59005" t="1" />
-<c i="59006" t="1" />
-<c i="59007" t="1" />
-<c i="59008" t="1" />
-<c i="59009" t="1" />
-<c i="59010" t="1" />
-<c i="59011" t="1" />
-<c i="59012" t="1" />
-<c i="59013" t="1" />
-<c i="59014" t="1" />
-<c i="59015" t="1" />
-<c i="59016" t="1" />
-<c i="59017" t="1" />
-<c i="59018" t="1" />
-<c i="59019" t="1" />
-<c i="59020" t="1" />
-<c i="59021" t="1" />
-<c i="59022" t="1" />
-<c i="59023" t="1" />
-<c i="59024" t="1" />
-<c i="59025" t="1" />
-<c i="59026" t="1" />
-<c i="59027" t="1" />
-<c i="59028" t="1" />
-<c i="59029" t="1" />
-<c i="59030" t="1" />
-<c i="59031" t="1" />
-<c i="59032" t="1" />
-<c i="59033" t="1" />
-<c i="59034" t="1" />
-<c i="59035" t="1" />
-<c i="59036" t="1" />
-<c i="59037" t="1" />
-<c i="59038" t="1" />
-<c i="59039" t="1" />
-<c i="59040" t="1" />
-<c i="60001" t="1" />
-<c i="60002" t="1" />
-<c i="60003" t="1" />
-<c i="60004" t="1" />
-<c i="60005" t="1" />
-<c i="60006" t="1" />
-<c i="60007" t="1" />
-<c i="60008" t="1" />
-<c i="60009" t="1" />
-<c i="60010" t="1" />
-<c i="60011" t="1" />
-<c i="60012" t="1" />
-<c i="60013" t="1" />
-<c i="60014" t="1" />
-<c i="60015" t="1" />
-<c i="60016" t="1" />
-<c i="60017" t="1" />
-<c i="60018" t="1" />
-<c i="60019" t="1" />
-<c i="60020" t="1" />
-<c i="60021" t="1" />
-<c i="60022" t="1" />
-<c i="60023" t="1" />
-<c i="60024" t="1" />
-<c i="60025" t="1" />
-<c i="60026" t="1" />
-<c i="60027" t="1" />
-<c i="60028" t="1" />
-<c i="60029" t="1" />
-<c i="60030" t="1" />
-<c i="60031" t="1" />
-<c i="60032" t="1" />
-<c i="60033" t="1" />
-<c i="60034" t="1" />
-<c i="60035" t="1" />
-<c i="60036" t="1" />
-<c i="60037" t="1" />
-<c i="60038" t="1" />
-<c i="60039" t="1" />
-<c i="60040" t="1" />
-<c i="61001" t="1" />
-<c i="61002" t="1" />
-<c i="61003" t="1" />
-<c i="61004" t="1" />
-<c i="61005" t="1" />
-<c i="61006" t="1" />
-<c i="61007" t="1" />
-<c i="61008" t="1" />
-<c i="61009" t="1" />
-<c i="61010" t="1" />
-<c i="61011" t="1" />
-<c i="61012" t="1" />
-<c i="61013" t="1" />
-<c i="61014" t="1" />
-<c i="61015" t="1" />
-<c i="61016" t="1" />
-<c i="61017" t="1" />
-<c i="61018" t="1" />
-<c i="61019" t="1" />
-<c i="61020" t="1" />
-<c i="61021" t="1" />
-<c i="61022" t="1" />
-<c i="61023" t="1" />
-<c i="61024" t="1" />
-<c i="61025" t="1" />
-<c i="61026" t="1" />
-<c i="61027" t="1" />
-<c i="61028" t="1" />
-<c i="61029" t="1" />
-<c i="61030" t="1" />
-<c i="61031" t="1" />
-<c i="61032" t="1" />
-<c i="61033" t="1" />
-<c i="61034" t="1" />
-<c i="61035" t="1" />
-<c i="61036" t="1" />
-<c i="61037" t="1" />
-<c i="61038" t="1" />
-<c i="61039" t="1" />
-<c i="61040" t="1" />
-<c i="62001" t="1" />
-<c i="62002" t="1" />
-<c i="62003" t="1" />
-<c i="62004" t="1" />
-<c i="62005" t="1" />
-<c i="62006" t="1" />
-<c i="62007" t="1" />
-<c i="62008" t="1" />
-<c i="62009" t="1" />
-<c i="62010" t="1" />
-<c i="62011" t="1" />
-<c i="62012" t="1" />
-<c i="62013" t="1" />
-<c i="62014" t="1" />
-<c i="62015" t="1" />
-<c i="62016" t="1" />
-<c i="62017" t="1" />
-<c i="62018" t="1" />
-<c i="62019" t="1" />
-<c i="62020" t="1" />
-<c i="62021" t="1" />
-<c i="62022" t="1" />
-<c i="62023" t="1" />
-<c i="62024" t="1" />
-<c i="62025" t="1" />
-<c i="62026" t="1" />
-<c i="62027" t="1" />
-<c i="62028" t="1" />
-<c i="62029" t="1" />
-<c i="62030" t="1" />
-<c i="62031" t="1" />
-<c i="62032" t="1" />
-<c i="62033" t="1" />
-<c i="62034" t="1" />
-<c i="62035" t="1" />
-<c i="62036" t="1" />
-<c i="62037" t="1" />
-<c i="62038" t="1" />
-<c i="62039" t="1" />
-<c i="62040" t="1" />
-<c i="63001" t="1" />
-<c i="63002" t="1" />
-<c i="63003" t="1" />
-<c i="63004" t="1" />
-<c i="63005" t="1" />
-<c i="63006" t="1" />
-<c i="63007" t="1" />
-<c i="63008" t="1" />
-<c i="63009" t="1" />
-<c i="63010" t="1" />
-<c i="63011" t="1" />
-<c i="63012" t="1" />
-<c i="63013" t="1" />
-<c i="63014" t="1" />
-<c i="63015" t="1" />
-<c i="63016" t="1" />
-<c i="63017" t="1" />
-<c i="63018" t="1" />
-<c i="63019" t="1" />
-<c i="63020" t="1" />
-<c i="63021" t="1" />
-<c i="63022" t="1" />
-<c i="63023" t="1" />
-<c i="63024" t="1" />
-<c i="63025" t="1" />
-<c i="63026" t="1" />
-<c i="63027" t="1" />
-<c i="63028" t="1" />
-<c i="63029" t="1" />
-<c i="63030" t="1" />
-<c i="63031" t="1" />
-<c i="63032" t="1" />
-<c i="63033" t="1" />
-<c i="63034" t="1" />
-<c i="63035" t="1" />
-<c i="63036" t="1" />
-<c i="63037" t="1" />
-<c i="63038" t="1" />
-<c i="63039" t="1" />
-<c i="63040" t="1" />
-<c i="64001" t="1" />
-<c i="64002" t="1" />
-<c i="64003" t="1" />
-<c i="64004" t="1" />
-<c i="64005" t="1" />
-<c i="64006" t="1" />
-<c i="64007" t="1" />
-<c i="64008" t="1" />
-<c i="64009" t="1" />
-<c i="64010" t="1" />
-<c i="64011" t="1" />
-<c i="64012" t="1" />
-<c i="64013" t="1" />
-<c i="64014" t="1" />
-<c i="64015" t="1" />
-<c i="64016" t="1" />
-<c i="64017" t="1" />
-<c i="64018" t="1" />
-<c i="64019" t="1" />
-<c i="64020" t="1" />
-<c i="64021" t="1" />
-<c i="64022" t="1" />
-<c i="64023" t="1" />
-<c i="64024" t="1" />
-<c i="64025" t="1" />
-<c i="64026" t="1" />
-<c i="64027" t="1" />
-<c i="64028" t="1" />
-<c i="64029" t="1" />
-<c i="64030" t="1" />
-<c i="64031" t="1" />
-<c i="64032" t="1" />
-<c i="64033" t="1" />
-<c i="64034" t="1" />
-<c i="64035" t="1" />
-<c i="64036" t="1" />
-<c i="64037" t="1" />
-<c i="64038" t="1" />
-<c i="64039" t="1" />
-<c i="64040" t="1" />
-<c i="65001" t="1" />
-<c i="65002" t="1" />
-<c i="65003" t="1" />
-<c i="65004" t="1" />
-<c i="65005" t="1" />
-<c i="65006" t="1" />
-<c i="65007" t="1" />
-<c i="65008" t="1" />
-<c i="65009" t="1" />
-<c i="65010" t="1" />
-<c i="65011" t="1" />
-<c i="65012" t="1" />
-<c i="65013" t="1" />
-<c i="65014" t="1" />
-<c i="65015" t="1" />
-<c i="65016" t="1" />
-<c i="65017" t="1" />
-<c i="65018" t="1" />
-<c i="65019" t="1" />
-<c i="65020" t="1" />
-<c i="65021" t="1" />
-<c i="65022" t="1" />
-<c i="65023" t="1" />
-<c i="65024" t="1" />
-<c i="65025" t="1" />
-<c i="65026" t="1" />
-<c i="65027" t="1" />
-<c i="65028" t="1" />
-<c i="65029" t="1" />
-<c i="65030" t="1" />
-<c i="65031" t="1" />
-<c i="65032" t="1" />
-<c i="65033" t="1" />
-<c i="65034" t="1" />
-<c i="65035" t="1" />
-<c i="65036" t="1" />
-<c i="65037" t="1" />
-<c i="65038" t="1" />
-<c i="65039" t="1" />
-<c i="65040" t="1" />
-<c i="66001" t="1" />
-<c i="66002" t="1" />
-<c i="66003" t="1" />
-<c i="66004" t="1" />
-<c i="66005" t="1" />
-<c i="66006" t="1" />
-<c i="66007" t="1" />
-<c i="66008" t="1" />
-<c i="66009" t="1" />
-<c i="66010" t="1" />
-<c i="66011" t="1" />
-<c i="66012" t="1" />
-<c i="66013" t="1" />
-<c i="66014" t="1" />
-<c i="66015" t="1" />
-<c i="66016" t="1" />
-<c i="66017" t="1" />
-<c i="66018" t="1" />
-<c i="66019" t="1" />
-<c i="66020" t="1" />
-<c i="66021" t="1" />
-<c i="66022" t="1" />
-<c i="66023" t="1" />
-<c i="66024" t="1" />
-<c i="66025" t="1" />
-<c i="66026" t="1" />
-<c i="66027" t="1" />
-<c i="66028" t="1" />
-<c i="66029" t="1" />
-<c i="66030" t="1" />
-<c i="66031" t="1" />
-<c i="66032" t="1" />
-<c i="66033" t="1" />
-<c i="66034" t="1" />
-<c i="66035" t="1" />
-<c i="66036" t="1" />
-<c i="66037" t="1" />
-<c i="66038" t="1" />
-<c i="66039" t="1" />
-<c i="66040" t="1" />
-<c i="67001" t="1" />
-<c i="67002" t="1" />
-<c i="67003" t="1" />
-<c i="67004" t="1" />
-<c i="67005" t="1" />
-<c i="67006" t="1" />
-<c i="67007" t="1" />
-<c i="67008" t="1" />
-<c i="67009" t="1" />
-<c i="67010" t="1" />
-<c i="67011" t="1" />
-<c i="67012" t="1" />
-<c i="67013" t="1" />
-<c i="67014" t="1" />
-<c i="67015" t="1" />
-<c i="67016" t="1" />
-<c i="67017" t="1" />
-<c i="67018" t="1" />
-<c i="67019" t="1" />
-<c i="67020" t="1" />
-<c i="67021" t="1" />
-<c i="67022" t="1" />
-<c i="67023" t="1" />
-<c i="67024" t="1" />
-<c i="67025" t="1" />
-<c i="67026" t="1" />
-<c i="67027" t="1" />
-<c i="67028" t="1" />
-<c i="67029" t="1" />
-<c i="67030" t="1" />
-<c i="67031" t="1" />
-<c i="67032" t="1" />
-<c i="67033" t="1" />
-<c i="67034" t="1" />
-<c i="67035" t="1" />
-<c i="67036" t="1" />
-<c i="67037" t="1" />
-<c i="67038" t="1" />
-<c i="67039" t="1" />
-<c i="67040" t="1" />
-<c i="68001" t="1" />
-<c i="68002" t="1" />
-<c i="68003" t="1" />
-<c i="68004" t="1" />
-<c i="68005" t="1" />
-<c i="68006" t="1" />
-<c i="68007" t="1" />
-<c i="68008" t="1" />
-<c i="68009" t="1" />
-<c i="68010" t="1" />
-<c i="68011" t="1" />
-<c i="68012" t="1" />
-<c i="68013" t="1" />
-<c i="68014" t="1" />
-<c i="68015" t="1" />
-<c i="68016" t="1" />
-<c i="68017" t="1" />
-<c i="68018" t="1" />
-<c i="68019" t="1" />
-<c i="68020" t="1" />
-<c i="68021" t="1" />
-<c i="68022" t="1" />
-<c i="68023" t="1" />
-<c i="68024" t="1" />
-<c i="68025" t="1" />
-<c i="68026" t="1" />
-<c i="68027" t="1" />
-<c i="68028" t="1" />
-<c i="68029" t="1" />
-<c i="68030" t="1" />
-<c i="68031" t="1" />
-<c i="68032" t="1" />
-<c i="68033" t="1" />
-<c i="68034" t="1" />
-<c i="68035" t="1" />
-<c i="68036" t="1" />
-<c i="68037" t="1" />
-<c i="68038" t="1" />
-<c i="68039" t="1" />
-<c i="68040" t="1" />
-<c i="69001" t="1" />
-<c i="69002" t="1" />
-<c i="69003" t="1" />
-<c i="69004" t="1" />
-<c i="69005" t="1" />
-<c i="69006" t="1" />
-<c i="69007" t="1" />
-<c i="69008" t="1" />
-<c i="69009" t="1" />
-<c i="69010" t="1" />
-<c i="69011" t="1" />
-<c i="69012" t="1" />
-<c i="69013" t="1" />
-<c i="69014" t="1" />
-<c i="69015" t="1" />
-<c i="69016" t="1" />
-<c i="69017" t="1" />
-<c i="69018" t="1" />
-<c i="69019" t="1" />
-<c i="69020" t="1" />
-<c i="69021" t="1" />
-<c i="69022" t="1" />
-<c i="69023" t="1" />
-<c i="69024" t="1" />
-<c i="69025" t="1" />
-<c i="69026" t="1" />
-<c i="69027" t="1" />
-<c i="69028" t="1" />
-<c i="69029" t="1" />
-<c i="69030" t="1" />
-<c i="69031" t="1" />
-<c i="69032" t="1" />
-<c i="69033" t="1" />
-<c i="69034" t="1" />
-<c i="69035" t="1" />
-<c i="69036" t="1" />
-<c i="69037" t="1" />
-<c i="69038" t="1" />
-<c i="69039" t="1" />
-<c i="69040" t="1" />
-<c i="70001" t="3" />
-<c i="70002" t="3" />
-<c i="70003" t="3" />
-<c i="70004" t="3" />
-<c i="70005" t="3" />
-<c i="70006" t="3" />
-<c i="70007" t="3" />
-<c i="70008" t="3" />
-<c i="70009" t="3" />
-<c i="70010" t="3" />
-<c i="70011" t="3" />
-<c i="70012" t="3" />
-<c i="70013" t="3" />
-<c i="70014" t="3" />
-<c i="70015" t="3" />
-<c i="70016" t="3" />
-<c i="70017" t="3" />
-<c i="70018" t="3" />
-<c i="70019" t="3" />
-<c i="70020" t="3" />
-<c i="70021" t="3" />
-<c i="70022" t="3" />
-<c i="70023" t="3" />
-<c i="70024" t="3" />
-<c i="70025" t="3" />
-<c i="70026" t="3" />
-<c i="70027" t="3" />
-<c i="70028" t="3" />
-<c i="70029" t="3" />
-<c i="70030" t="3" />
-<c i="70031" t="3" />
-<c i="70032" t="3" />
-<c i="70033" t="3" />
-<c i="70034" t="3" />
-<c i="70035" t="3" />
-<c i="70036" t="3" />
-<c i="70037" t="3" />
-<c i="70038" t="3" />
-<c i="70039" t="3" />
-<c i="70040" t="3" />
-<c i="71001" t="3" />
-<c i="71002" t="3" />
-<c i="71003" t="3" />
-<c i="71004" t="3" />
-<c i="71005" t="3" />
-<c i="71006" t="3" />
-<c i="71007" t="3" />
-<c i="71008" t="3" />
-<c i="71009" t="3" />
-<c i="71010" t="3" />
-<c i="71011" t="3" />
-<c i="71012" t="3" />
-<c i="71013" t="3" />
-<c i="71014" t="3" />
-<c i="71015" t="3" />
-<c i="71016" t="3" />
-<c i="71017" t="3" />
-<c i="71018" t="3" />
-<c i="71019" t="3" />
-<c i="71020" t="3" />
-<c i="71021" t="3" />
-<c i="71022" t="3" />
-<c i="71023" t="3" />
-<c i="71024" t="3" />
-<c i="71025" t="3" />
-<c i="71026" t="3" />
-<c i="71027" t="3" />
-<c i="71028" t="3" />
-<c i="71029" t="3" />
-<c i="71030" t="3" />
-<c i="71031" t="3" />
-<c i="71032" t="3" />
-<c i="71033" t="3" />
-<c i="71034" t="3" />
-<c i="71035" t="3" />
-<c i="71036" t="3" />
-<c i="71037" t="3" />
-<c i="71038" t="3" />
-<c i="71039" t="3" />
-<c i="71040" t="3" />
-<c i="72001" t="3" />
-<c i="72002" t="3" />
-<c i="72003" t="3" />
-<c i="72004" t="3" />
-<c i="72005" t="3" />
-<c i="72006" t="4" />
-<c i="72007" t="3" />
-<c i="72008" t="3" />
-<c i="72009" t="3" />
-<c i="72010" t="3" />
-<c i="72011" t="3" />
-<c i="72012" t="3" />
-<c i="72013" t="3" />
-<c i="72014" t="3" />
-<c i="72015" t="3" />
-<c i="72016" t="3" />
-<c i="72017" t="3" />
-<c i="72018" t="3" />
-<c i="72019" t="3" />
-<c i="72020" t="3" />
-<c i="72021" t="3" />
-<c i="72022" t="3" />
-<c i="72023" t="3" />
-<c i="72024" t="3" />
-<c i="72025" t="3" />
-<c i="72026" t="3" />
-<c i="72027" t="3" />
-<c i="72028" t="3" />
-<c i="72029" t="3" />
-<c i="72030" t="3" />
-<c i="72031" t="3" />
-<c i="72032" t="3" />
-<c i="72033" t="3" />
-<c i="72034" t="3" />
-<c i="72035" t="3" />
-<c i="72036" t="3" />
-<c i="72037" t="3" />
-<c i="72038" t="3" />
-<c i="72039" t="3" />
-<c i="72040" t="3" />
-<c i="73001" t="3" />
-<c i="73002" t="3" />
-<c i="73003" t="3" />
-<c i="73004" t="3" />
-<c i="73005" t="3" />
-<c i="73006" t="3" />
-<c i="73007" t="3" />
-<c i="73008" t="3" />
-<c i="73009" t="3" />
-<c i="73010" t="3" />
-<c i="73011" t="3" />
-<c i="73012" t="3" />
-<c i="73013" t="3" />
-<c i="73014" t="3" />
-<c i="73015" t="3" />
-<c i="73016" t="3" />
-<c i="73017" t="3" />
-<c i="73018" t="3" />
-<c i="73019" t="3" />
-<c i="73020" t="3" />
-<c i="73021" t="3" />
-<c i="73022" t="3" />
-<c i="73023" t="3" />
-<c i="73024" t="3" />
-<c i="73025" t="3" />
-<c i="73026" t="3" />
-<c i="73027" t="3" />
-<c i="73028" t="3" />
-<c i="73029" t="3" />
-<c i="73030" t="3" />
-<c i="73031" t="3" />
-<c i="73032" t="3" />
-<c i="73033" t="3" />
-<c i="73034" t="3" />
-<c i="73035" t="3" />
-<c i="73036" t="3" />
-<c i="73037" t="3" />
-<c i="73038" t="3" />
-<c i="73039" t="3" />
-<c i="73040" t="3" />
-<c i="79001" t="3" />
-<c i="79002" t="3" />
-<c i="79003" t="3" />
-<c i="79004" t="3" />
-<c i="79005" t="3" />
-<c i="79006" t="3" />
-<c i="79007" t="3" />
-<c i="79008" t="3" />
-<c i="79009" t="3" />
-<c i="79010" t="3" />
-<c i="79011" t="3" />
-<c i="79012" t="3" />
-<c i="79013" t="3" />
-<c i="79014" t="3" />
-<c i="79015" t="3" />
-<c i="79016" t="3" />
-<c i="79017" t="3" />
-<c i="79018" t="3" />
-<c i="79019" t="3" />
-<c i="79020" t="3" />
-<c i="79021" t="3" />
-<c i="79022" t="3" />
-<c i="79023" t="3" />
-<c i="79024" t="3" />
-<c i="79025" t="3" />
-<c i="79026" t="3" />
-<c i="79027" t="3" />
-<c i="79028" t="3" />
-<c i="79029" t="3" />
-<c i="79030" t="3" />
-<c i="79031" t="3" />
-<c i="79032" t="3" />
-<c i="79033" t="3" />
-<c i="79034" t="3" />
-<c i="79035" t="3" />
-<c i="79036" t="3" />
-<c i="79037" t="3" />
-<c i="79038" t="3" />
-<c i="79039" t="3" />
-<c i="79040" t="3" />
-<c i="80001" t="3" />
-<c i="80002" t="3" />
-<c i="80003" t="3" />
-<c i="80004" t="3" />
-<c i="80005" t="3" />
-<c i="80006" t="3" />
-<c i="80007" t="3" />
-<c i="80008" t="3" />
-<c i="80009" t="3" />
-<c i="80010" t="3" />
-<c i="80011" t="3" />
-<c i="80012" t="3" />
-<c i="80013" t="3" />
-<c i="80014" t="3" />
-<c i="80015" t="3" />
-<c i="80016" t="3" />
-<c i="80017" t="3" />
-<c i="80018" t="3" />
-<c i="80019" t="3" />
-<c i="80020" t="3" />
-<c i="80021" t="3" />
-<c i="80022" t="3" />
-<c i="80023" t="3" />
-<c i="80024" t="3" />
-<c i="80025" t="3" />
-<c i="80026" t="3" />
-<c i="80027" t="3" />
-<c i="80028" t="3" />
-<c i="80029" t="3" />
-<c i="80030" t="3" />
-<c i="80031" t="3" />
-<c i="80032" t="3" />
-<c i="80033" t="3" />
-<c i="80034" t="3" />
-<c i="80035" t="3" />
-<c i="80036" t="3" />
-<c i="80037" t="3" />
-<c i="80038" t="3" />
-<c i="80039" t="3" />
-<c i="80040" t="3" />
-<c i="81001" t="3" />
-<c i="81002" t="3" />
-<c i="81003" t="3" />
-<c i="81004" t="3" />
-<c i="81005" t="3" />
-<c i="81006" t="3" />
-<c i="81007" t="3" />
-<c i="81008" t="3" />
-<c i="81009" t="3" />
-<c i="81010" t="3" />
-<c i="81011" t="3" />
-<c i="81012" t="3" />
-<c i="81013" t="3" />
-<c i="81014" t="3" />
-<c i="81015" t="3" />
-<c i="81016" t="3" />
-<c i="81017" t="3" />
-<c i="81018" t="3" />
-<c i="81019" t="3" />
-<c i="81020" t="3" />
-<c i="81021" t="3" />
-<c i="81022" t="3" />
-<c i="81023" t="3" />
-<c i="81024" t="3" />
-<c i="81025" t="3" />
-<c i="81026" t="3" />
-<c i="81027" t="3" />
-<c i="81028" t="3" />
-<c i="81029" t="3" />
-<c i="81030" t="3" />
-<c i="81031" t="3" />
-<c i="81032" t="3" />
-<c i="81033" t="3" />
-<c i="81034" t="3" />
-<c i="81035" t="3" />
-<c i="81036" t="3" />
-<c i="81037" t="3" />
-<c i="81038" t="3" />
-<c i="81039" t="3" />
-<c i="81040" t="3" />
-<c i="82001" t="3" />
-<c i="82002" t="3" />
-<c i="82003" t="3" />
-<c i="82004" t="3" />
-<c i="82005" t="3" />
-<c i="82006" t="3" />
-<c i="82007" t="3" />
-<c i="82008" t="3" />
-<c i="82009" t="3" />
-<c i="82010" t="3" />
-<c i="82011" t="3" />
-<c i="82012" t="3" />
-<c i="82013" t="3" />
-<c i="82014" t="3" />
-<c i="82015" t="3" />
-<c i="82016" t="3" />
-<c i="82017" t="3" />
-<c i="82018" t="3" />
-<c i="82019" t="3" />
-<c i="82020" t="3" />
-<c i="82021" t="3" />
-<c i="82022" t="3" />
-<c i="82023" t="3" />
-<c i="82024" t="3" />
-<c i="82025" t="3" />
-<c i="82026" t="3" />
-<c i="82027" t="3" />
-<c i="82028" t="3" />
-<c i="82029" t="3" />
-<c i="82030" t="3" />
-<c i="82031" t="3" />
-<c i="82032" t="3" />
-<c i="82033" t="3" />
-<c i="82034" t="3" />
-<c i="82035" t="3" />
-<c i="82036" t="3" />
-<c i="82037" t="3" />
-<c i="82038" t="3" />
-<c i="82039" t="3" />
-<c i="82040" t="3" />
-<c i="83001" t="3" />
-<c i="83002" t="3" />
-<c i="83003" t="3" />
-<c i="83004" t="3" />
-<c i="83005" t="3" />
-<c i="83006" t="3" />
-<c i="83007" t="3" />
-<c i="83008" t="3" />
-<c i="83009" t="3" />
-<c i="83010" t="3" />
-<c i="83011" t="3" />
-<c i="83012" t="3" />
-<c i="83013" t="3" />
-<c i="83014" t="3" />
-<c i="83015" t="3" />
-<c i="83016" t="3" />
-<c i="83017" t="3" />
-<c i="83018" t="3" />
-<c i="83019" t="3" />
-<c i="83020" t="3" />
-<c i="83021" t="3" />
-<c i="83022" t="3" />
-<c i="83023" t="3" />
-<c i="83024" t="3" />
-<c i="83025" t="3" />
-<c i="83026" t="3" />
-<c i="83027" t="3" />
-<c i="83028" t="3" />
-<c i="83029" t="3" />
-<c i="83030" t="3" />
-<c i="83031" t="3" />
-<c i="83032" t="3" />
-<c i="83033" t="3" />
-<c i="83034" t="3" />
-<c i="83035" t="3" />
-<c i="83036" t="3" />
-<c i="83037" t="3" />
-<c i="83038" t="3" />
-<c i="83039" t="3" />
-<c i="83040" t="3" />
-<c i="84001" t="3" />
-<c i="84002" t="3" />
-<c i="84003" t="3" />
-<c i="84004" t="3" />
-<c i="84005" t="3" />
-<c i="84006" t="3" />
-<c i="84007" t="3" />
-<c i="84008" t="3" />
-<c i="84009" t="3" />
-<c i="84010" t="3" />
-<c i="84011" t="3" />
-<c i="84012" t="3" />
-<c i="84013" t="3" />
-<c i="84014" t="3" />
-<c i="84015" t="3" />
-<c i="84016" t="3" />
-<c i="84017" t="3" />
-<c i="84018" t="3" />
-<c i="84019" t="3" />
-<c i="84020" t="3" />
-<c i="84021" t="3" />
-<c i="84022" t="3" />
-<c i="84023" t="3" />
-<c i="84024" t="3" />
-<c i="84025" t="3" />
-<c i="84026" t="3" />
-<c i="84027" t="3" />
-<c i="84028" t="3" />
-<c i="84029" t="3" />
-<c i="84030" t="3" />
-<c i="84031" t="3" />
-<c i="84032" t="3" />
-<c i="84033" t="3" />
-<c i="84034" t="3" />
-<c i="84035" t="3" />
-<c i="84036" t="3" />
-<c i="84037" t="3" />
-<c i="84038" t="3" />
-<c i="84039" t="3" />
-<c i="84040" t="3" />
-<c i="85001" t="3" />
-<c i="85002" t="3" />
-<c i="85003" t="3" />
-<c i="85004" t="3" />
-<c i="85005" t="3" />
-<c i="85006" t="3" />
-<c i="85007" t="3" />
-<c i="85008" t="3" />
-<c i="85009" t="3" />
-<c i="85010" t="3" />
-<c i="85011" t="3" />
-<c i="85012" t="3" />
-<c i="85013" t="3" />
-<c i="85014" t="3" />
-<c i="85015" t="3" />
-<c i="85016" t="3" />
-<c i="85017" t="3" />
-<c i="85018" t="3" />
-<c i="85019" t="3" />
-<c i="85020" t="3" />
-<c i="85021" t="3" />
-<c i="85022" t="3" />
-<c i="85023" t="3" />
-<c i="85024" t="3" />
-<c i="85025" t="3" />
-<c i="85026" t="3" />
-<c i="85027" t="3" />
-<c i="85028" t="3" />
-<c i="85029" t="3" />
-<c i="85030" t="3" />
-<c i="85031" t="3" />
-<c i="85032" t="3" />
-<c i="85033" t="3" />
-<c i="85034" t="3" />
-<c i="85035" t="3" />
-<c i="85036" t="3" />
-<c i="85037" t="3" />
-<c i="85038" t="3" />
-<c i="85039" t="3" />
-<c i="85040" t="3" />
-<c i="86001" t="3" />
-<c i="86002" t="3" />
-<c i="86003" t="3" />
-<c i="86004" t="3" />
-<c i="86005" t="3" />
-<c i="86006" t="3" />
-<c i="86007" t="3" />
-<c i="86008" t="3" />
-<c i="86009" t="3" />
-<c i="86010" t="3" />
-<c i="86011" t="3" />
-<c i="86012" t="3" />
-<c i="86013" t="3" />
-<c i="86014" t="3" />
-<c i="86015" t="3" />
-<c i="86016" t="3" />
-<c i="86017" t="3" />
-<c i="86018" t="3" />
-<c i="86019" t="3" />
-<c i="86020" t="3" />
-<c i="86021" t="3" />
-<c i="86022" t="3" />
-<c i="86023" t="3" />
-<c i="86024" t="3" />
-<c i="86025" t="3" />
-<c i="86026" t="3" />
-<c i="86027" t="3" />
-<c i="86028" t="3" />
-<c i="86029" t="3" />
-<c i="86030" t="3" />
-<c i="86031" t="3" />
-<c i="86032" t="3" />
-<c i="86033" t="3" />
-<c i="86034" t="3" />
-<c i="86035" t="3" />
-<c i="86036" t="3" />
-<c i="86037" t="3" />
-<c i="86038" t="3" />
-<c i="86039" t="3" />
-<c i="86040" t="3" />
-<c i="87001" t="3" />
-<c i="87002" t="3" />
-<c i="87003" t="3" />
-<c i="87004" t="3" />
-<c i="87005" t="3" />
-<c i="87006" t="3" />
-<c i="87007" t="3" />
-<c i="87008" t="3" />
-<c i="87009" t="3" />
-<c i="87010" t="3" />
-<c i="87011" t="3" />
-<c i="87012" t="3" />
-<c i="87013" t="3" />
-<c i="87014" t="3" />
-<c i="87015" t="3" />
-<c i="87016" t="3" />
-<c i="87017" t="3" />
-<c i="87018" t="3" />
-<c i="87019" t="3" />
-<c i="87020" t="3" />
-<c i="87021" t="3" />
-<c i="87022" t="3" />
-<c i="87023" t="3" />
-<c i="87024" t="3" />
-<c i="87025" t="3" />
-<c i="87026" t="3" />
-<c i="87027" t="3" />
-<c i="87028" t="3" />
-<c i="87029" t="3" />
-<c i="87030" t="3" />
-<c i="87031" t="3" />
-<c i="87032" t="3" />
-<c i="87033" t="3" />
-<c i="87034" t="3" />
-<c i="87035" t="3" />
-<c i="87036" t="3" />
-<c i="87037" t="3" />
-<c i="87038" t="3" />
-<c i="87039" t="3" />
-<c i="87040" t="3" />
-<c i="88001" t="3" />
-<c i="88002" t="3" />
-<c i="88003" t="3" />
-<c i="88004" t="3" />
-<c i="88005" t="3" />
-<c i="88006" t="3" />
-<c i="88007" t="3" />
-<c i="88008" t="3" />
-<c i="88009" t="3" />
-<c i="88010" t="3" />
-<c i="88011" t="3" />
-<c i="88012" t="3" />
-<c i="88013" t="3" />
-<c i="88014" t="3" />
-<c i="88015" t="3" />
-<c i="88016" t="3" />
-<c i="88017" t="3" />
-<c i="88018" t="3" />
-<c i="88019" t="3" />
-<c i="88020" t="3" />
-<c i="88021" t="3" />
-<c i="88022" t="3" />
-<c i="88023" t="3" />
-<c i="88024" t="3" />
-<c i="88025" t="3" />
-<c i="88026" t="3" />
-<c i="88027" t="3" />
-<c i="88028" t="3" />
-<c i="88029" t="3" />
-<c i="88030" t="3" />
-<c i="88031" t="3" />
-<c i="88032" t="3" />
-<c i="88033" t="3" />
-<c i="88034" t="3" />
-<c i="88035" t="3" />
-<c i="88036" t="3" />
-<c i="88037" t="3" />
-<c i="88038" t="3" />
-<c i="88039" t="3" />
-<c i="88040" t="3" />
-<c i="89001" t="3" />
-<c i="89002" t="3" />
-<c i="89003" t="3" />
-<c i="89004" t="3" />
-<c i="89005" t="3" />
-<c i="89006" t="3" />
-<c i="89007" t="3" />
-<c i="89008" t="3" />
-<c i="89009" t="3" />
-<c i="89010" t="3" />
-<c i="89011" t="3" />
-<c i="89012" t="3" />
-<c i="89013" t="3" />
-<c i="89014" t="3" />
-<c i="89015" t="3" />
-<c i="89016" t="3" />
-<c i="89017" t="3" />
-<c i="89018" t="3" />
-<c i="89019" t="3" />
-<c i="89020" t="3" />
-<c i="89021" t="3" />
-<c i="89022" t="3" />
-<c i="89023" t="3" />
-<c i="89024" t="3" />
-<c i="89025" t="3" />
-<c i="89026" t="3" />
-<c i="89027" t="3" />
-<c i="89028" t="3" />
-<c i="89029" t="3" />
-<c i="89030" t="3" />
-<c i="89031" t="3" />
-<c i="89032" t="3" />
-<c i="89033" t="3" />
-<c i="89034" t="3" />
-<c i="89035" t="3" />
-<c i="89036" t="3" />
-<c i="89037" t="3" />
-<c i="89038" t="3" />
-<c i="89039" t="3" />
-<c i="89040" t="3" />
-<c i="90001" t="3" />
-<c i="90002" t="3" />
-<c i="90003" t="3" />
-<c i="90004" t="3" />
-<c i="90005" t="3" />
-<c i="90006" t="3" />
-<c i="90007" t="3" />
-<c i="90008" t="3" />
-<c i="90009" t="3" />
-<c i="90010" t="3" />
-<c i="90011" t="3" />
-<c i="90012" t="3" />
-<c i="90013" t="3" />
-<c i="90014" t="3" />
-<c i="90015" t="3" />
-<c i="90016" t="3" />
-<c i="90017" t="3" />
-<c i="90018" t="3" />
-<c i="90019" t="3" />
-<c i="90020" t="3" />
-<c i="90021" t="3" />
-<c i="90022" t="3" />
-<c i="90023" t="3" />
-<c i="90024" t="3" />
-<c i="90025" t="3" />
-<c i="90026" t="3" />
-<c i="90027" t="3" />
-<c i="90028" t="3" />
-<c i="90029" t="3" />
-<c i="90030" t="3" />
-<c i="90031" t="3" />
-<c i="90032" t="3" />
-<c i="90033" t="3" />
-<c i="90034" t="3" />
-<c i="90035" t="3" />
-<c i="90036" t="3" />
-<c i="90037" t="3" />
-<c i="90038" t="3" />
-<c i="90039" t="3" />
-<c i="90040" t="3" />
-<c i="93001" t="2" />
-<c i="93002" t="2" />
-<c i="93003" t="2" />
-<c i="93004" t="2" />
-<c i="93005" t="2" />
-<c i="93006" t="2" />
-<c i="93007" t="2" />
-<c i="93008" t="2" />
-<c i="93009" t="2" />
-<c i="93010" t="2" />
-<c i="93011" t="2" />
-<c i="93012" t="2" />
-<c i="93013" t="2" />
-<c i="93014" t="2" />
-<c i="93015" t="2" />
-<c i="93016" t="2" />
-<c i="93017" t="2" />
-<c i="93018" t="2" />
-<c i="93019" t="2" />
-<c i="93020" t="2" />
-<c i="93021" t="2" />
-<c i="93022" t="2" />
-<c i="93023" t="2" />
-<c i="93024" t="2" />
-<c i="93025" t="2" />
-<c i="93026" t="2" />
-<c i="93027" t="2" />
-<c i="93028" t="2" />
-<c i="93029" t="2" />
-<c i="93030" t="2" />
-<c i="93031" t="2" />
-<c i="93032" t="2" />
-<c i="94001" t="1" />
-<c i="94002" t="1" />
-<c i="94003" t="1" />
-<c i="94004" t="1" />
-<c i="94005" t="1" />
-<c i="94006" t="1" />
-<c i="94007" t="1" />
-<c i="94008" t="1" />
-<c i="94009" t="1" />
-<c i="94010" t="1" />
-<c i="94011" t="1" />
-<c i="94012" t="1" />
-<c i="94013" t="1" />
-<c i="94014" t="1" />
-<c i="94015" t="1" />
-<c i="94016" t="1" />
-<c i="94017" t="1" />
-<c i="94018" t="1" />
-<c i="94019" t="1" />
-<c i="94020" t="1" />
-<c i="94021" t="1" />
-<c i="94022" t="1" />
-<c i="94023" t="1" />
-<c i="94024" t="1" />
-<c i="94025" t="1" />
-<c i="94026" t="1" />
-<c i="94027" t="1" />
-<c i="94028" t="1" />
-<c i="94029" t="1" />
-<c i="94030" t="1" />
-<c i="94031" t="1" />
-<c i="94032" t="1" />
-<c i="95001" t="1" />
-<c i="95002" t="1" />
-<c i="95003" t="1" />
-<c i="95004" t="1" />
-<c i="95005" t="1" />
-<c i="95006" t="1" />
-<c i="95007" t="1" />
-<c i="95008" t="1" />
-<c i="95009" t="1" />
-<c i="95010" t="1" />
-<c i="95011" t="1" />
-<c i="95012" t="1" />
-<c i="95013" t="1" />
-<c i="95014" t="1" />
-<c i="95015" t="1" />
-<c i="95016" t="1" />
-<c i="95017" t="1" />
-<c i="95018" t="1" />
-<c i="95019" t="1" />
-<c i="95020" t="1" />
-<c i="95021" t="1" />
-<c i="95022" t="1" />
-<c i="95023" t="1" />
-<c i="95024" t="1" />
-<c i="95025" t="1" />
-<c i="95026" t="1" />
-<c i="95027" t="1" />
-<c i="95028" t="1" />
-<c i="95029" t="1" />
-<c i="95030" t="1" />
-<c i="95031" t="1" />
-<c i="95032" t="1" />
-</computers>
-</oks-data>
\ No newline at end of file
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml
new file mode 100644
index 0000000000000000000000000000000000000000..eff96ceaa8052a718da618ef2e97c03648843776
--- /dev/null
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_327265.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" ?>
+<trigger>
+  <lumivalues>
+    <lumivalues_data>1e+34</lumivalues_data>
+    <lumivalues_pred>1e34</lumivalues_pred>
+    <deadtime>0.063</deadtime>
+    <peak_mu_av>41.79</peak_mu_av>
+  </lumivalues>
+  <bunchgroups>
+    <bunchgroup id="0" name="BCRVeto">3543</bunchgroup>
+    <bunchgroup id="1" name="Paired">1729</bunchgroup>
+    <bunchgroup id="2" name="CalReq">70</bunchgroup> 
+    <bunchgroup id="3" name="Empty">1388</bunchgroup>
+    <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup>
+    <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup>
+    <bunchgroup id="6" name="EmptyBeforeAfterPaired">322</bunchgroup>
+    <bunchgroup id="7" name="InTrain">1512</bunchgroup>
+    <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup>
+    <bunchgroup id="9" name="AfterGlow">8</bunchgroup>
+    <bunchgroup id="10" name="ALFA">4</bunchgroup>
+    <bunchgroup id="11" name="EmptyBeforePaired">37</bunchgroup>
+    <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup>
+    <bunchgroup id="13" name="BG13">0</bunchgroup>
+    <bunchgroup id="14" name="BG14">0</bunchgroup>
+    <bunchgroup id="15" name="BG15">0</bunchgroup>
+  </bunchgroups>
+  <lb_list>
+    <lb id="80" lumi="11000" mu="45.3">5394</lb>
+    <lb id="81" lumi="10980" mu="45.2">18508</lb>
+    <lb id="82" lumi="10960" mu="45.1">18540</lb>
+    <lb id="83" lumi="10920" mu="44.9">18023</lb>
+    <lb id="84" lumi="10890" mu="44.8">14684</lb>
+    <lb id="85" lumi="10870" mu="44.7">18333</lb>
+    <lb id="86" lumi="10850" mu="44.6">13636</lb>
+    <lb id="87" lumi="10860" mu="44.7">18113</lb>
+    <lb id="88" lumi="10800" mu="44.4">13558</lb>
+    <lb id="89" lumi="10820" mu="44.5">18244</lb>
+    <lb id="90" lumi="10790" mu="44.4">18127</lb>
+    <lb id="91" lumi="10780" mu="44.4">17255</lb>
+    <lb id="92" lumi="10730" mu="44.1">17876</lb>
+    <lb id="93" lumi="10700" mu="44">17724</lb>
+    <lb id="94" lumi="10670" mu="43.9">18233</lb>
+    <lb id="95" lumi="10660" mu="43.8">8267</lb>
+    <lb id="96" lumi="10650" mu="43.8">2768</lb>
+    <lb id="97" lumi="10640" mu="43.8">18419</lb>
+    <lb id="98" lumi="10610" mu="43.7">18477</lb>
+    <lb id="99" lumi="10590" mu="43.6">18702</lb>
+    <lb id="100" lumi="10590" mu="43.6">4735</lb>
+    <lb id="101" lumi="10570" mu="43.5">18433</lb>
+    <lb id="102" lumi="10540" mu="43.4">18621</lb>
+    <lb id="103" lumi="10520" mu="43.3">18436</lb>
+    <lb id="104" lumi="10490" mu="43.2">17503</lb>
+    <lb id="105" lumi="10480" mu="43.1">5948</lb>
+    <lb id="106" lumi="10460" mu="43">18736</lb>
+    <lb id="107" lumi="10430" mu="42.9">19140</lb>
+    <lb id="108" lumi="10410" mu="42.8">18903</lb>
+    <lb id="109" lumi="10380" mu="42.7">19053</lb>
+    <lb id="110" lumi="10350" mu="42.6">18872</lb>
+    <lb id="111" lumi="10330" mu="42.5">18869</lb>
+    <lb id="112" lumi="10320" mu="42.5">18995</lb>
+    <lb id="113" lumi="10310" mu="42.4">2033</lb>
+    <lb id="114" lumi="10310" mu="42.4">3205</lb>
+    <lb id="115" lumi="10300" mu="42.4">11806</lb>
+    <lb id="116" lumi="10280" mu="42.3">18845</lb>
+    <lb id="117" lumi="10270" mu="42.3">18880</lb>
+    <lb id="118" lumi="10260" mu="42.2">18576</lb>
+    <lb id="119" lumi="10240" mu="42.1">18456</lb>
+    <lb id="120" lumi="10220" mu="42.1">18408</lb>
+    <lb id="121" lumi="10210" mu="42">18679</lb>
+    <lb id="122" lumi="10180" mu="41.9">18481</lb>
+    <lb id="123" lumi="10160" mu="41.8">18277</lb>
+    <lb id="124" lumi="10140" mu="41.7">18494</lb>
+    <lb id="125" lumi="10110" mu="41.6">18412</lb>
+    <lb id="126" lumi="10090" mu="41.5">18615</lb>
+    <lb id="127" lumi="10070" mu="41.4">18093</lb>
+    <lb id="128" lumi="10040" mu="41.3">17882</lb>
+    <lb id="129" lumi="10020" mu="41.2">15411</lb>
+    <lb id="130" lumi="10000" mu="41.2">15790</lb>
+    <lb id="131" lumi="9978" mu="41.1">18263</lb>
+    <lb id="132" lumi="9962" mu="41">17958</lb>
+    <lb id="133" lumi="9934" mu="40.9">18155</lb>
+    <lb id="134" lumi="9918" mu="40.8">9007</lb>
+    <lb id="135" lumi="9918" mu="40.8">8534</lb>
+    <lb id="136" lumi="9900" mu="40.7">19410</lb>
+    <lb id="137" lumi="9893" mu="40.7">3340</lb>
+    <lb id="138" lumi="9885" mu="40.7">6510</lb>
+    <lb id="139" lumi="9880" mu="40.7">17975</lb>
+    <lb id="140" lumi="9863" mu="40.6">17621</lb>
+    <lb id="141" lumi="9838" mu="40.5">17870</lb>
+    <lb id="142" lumi="9837" mu="40.5">18070</lb>
+    <lb id="143" lumi="9812" mu="40.4">18070</lb>
+    <lb id="144" lumi="9802" mu="40.3">17795</lb>
+    <lb id="145" lumi="9779" mu="40.2">17636</lb>
+    <lb id="146" lumi="9759" mu="40.2">17806</lb>
+    <lb id="147" lumi="9742" mu="40.1">17679</lb>
+    <lb id="148" lumi="9741" mu="40.1">17340</lb>
+    <lb id="149" lumi="9728" mu="40">17673</lb>
+    <lb id="150" lumi="9714" mu="40">17613</lb>
+    <lb id="151" lumi="9699" mu="39.9">17652</lb>
+    <lb id="152" lumi="9683" mu="39.8">17487</lb>
+    <lb id="153" lumi="9663" mu="39.8">16992</lb>
+    <lb id="154" lumi="9660" mu="39.7">11598</lb>
+    <lb id="155" lumi="9633" mu="39.6">17323</lb>
+    <lb id="156" lumi="9614" mu="39.6">16967</lb>
+    <lb id="157" lumi="9607" mu="39.5">17357</lb>
+    <lb id="158" lumi="9600" mu="39.5">17374</lb>
+    <lb id="159" lumi="9577" mu="39.4">17454</lb>
+    <lb id="160" lumi="9473" mu="39">17511</lb>
+    <lb id="161" lumi="9450" mu="38.9">17222</lb>
+    <lb id="162" lumi="9409" mu="38.7">17175</lb>
+    <lb id="163" lumi="9403" mu="38.7">17212</lb>
+    <lb id="164" lumi="9373" mu="38.6">10661</lb>
+    <lb id="165" lumi="9391" mu="38.6">16919</lb>
+    <lb id="166" lumi="9361" mu="38.5">16953</lb>
+    <lb id="167" lumi="9353" mu="38.5">2894</lb>
+  </lb_list>
+  <filters>
+    <filter>
+      <eb_hlt_chains>
+        <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name>
+        <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM12_2EM3</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J20.31ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J30</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_ZB</lv1_ebtrigs>
+      </eb_hlt_chains>
+      <eb_hlt_chains>
+        <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name>
+        <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6-B</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6-BO</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_3EM3_J40_XE50_DPHI-J20s2XE50</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_3J15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-2M9-2MU6_BPH-2DR15-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-8M15-2MU6_BPH-0DR22-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DY-BOX-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15VHI_2TAU12IM_J25_3J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15_XS30</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM18VHI</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM20VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J40.0ETA25_2J15.31ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J50</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_LFV-MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MJJ-400</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_TAU12IM</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_TAU12IM_J25_2J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_XE35</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU40</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_XE35</lv1_ebtrigs>
+      </eb_hlt_chains>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name>
+
+      <lv1_filter>L1_2EM20VH</lv1_filter>
+      <lv1_filter>L1_2EM8VH_MU10</lv1_filter>
+      <lv1_filter>L1_2J15_XE55</lv1_filter>
+      <lv1_filter>L1_2MU10</lv1_filter>
+      <lv1_filter>L1_2MU4_J20_XE30_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_2MU6_3MU4</lv1_filter>
+      <lv1_filter>L1_3J50</lv1_filter>
+      <lv1_filter>L1_3MU4</lv1_filter>
+      <lv1_filter>L1_4J15.0ETA25</lv1_filter>
+      <lv1_filter>L1_4J20</lv1_filter>
+      <lv1_filter>L1_5J15.0ETA25</lv1_filter>
+      <lv1_filter>L1_DR-EM15TAU12I-J25</lv1_filter>
+      <lv1_filter>L1_DR-MU10TAU12I_TAU12I-J25</lv1_filter>
+      <lv1_filter>L1_DR-TAU20ITAU12I-J25</lv1_filter>
+      <lv1_filter>L1_EM15VHI_2TAU12IM_XE35</lv1_filter>
+      <lv1_filter>L1_EM15VHI_TAU40_2TAU15</lv1_filter>
+      <lv1_filter>L1_EM15VH_MU10</lv1_filter>
+      <lv1_filter>L1_EM20VH_3EM10VH</lv1_filter>
+      <lv1_filter>L1_EM24VHI</lv1_filter>
+      <lv1_filter>L1_HT190-J15s5.ETA21</lv1_filter>
+      <lv1_filter>L1_J100</lv1_filter>
+      <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter>
+      <lv1_filter>L1_J40_XE50_DPHI-J20s2XE50</lv1_filter>
+      <lv1_filter>L1_J75.31ETA49</lv1_filter>
+      <lv1_filter>L1_LLP-RO</lv1_filter>
+      <lv1_filter>L1_MU10_2J20</lv1_filter>
+      <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter>
+      <lv1_filter>L1_MU11_2MU6</lv1_filter>
+      <lv1_filter>L1_MU20</lv1_filter>
+      <lv1_filter>L1_MU4_J30_XE40_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_MU4_J50_XE50_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_MU6_3MU4</lv1_filter>
+      <lv1_filter>L1_TAU100</lv1_filter>
+      <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter>
+      <lv1_filter>L1_TAU60_DR-TAU20ITAU12I</lv1_filter>
+      <lv1_filter>L1_XE60</lv1_filter>  
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name>
+      <lv1_filter>L1_6J15</lv1_filter>
+      <lv1_filter>L1_J100.31ETA49</lv1_filter>
+      <lv1_filter>L1_J400</lv1_filter>
+      <lv1_filter>L1_XE80</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name>
+      <lv1_filter>L1_J12_EMPTY</lv1_filter>
+      <lv1_filter>L1_MU11_EMPTY</lv1_filter>
+      <lv1_filter>L1_TAU8_EMPTY</lv1_filter>
+      <lv1_filter>L1_EM7_EMPTY</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name>
+      <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name>
+      <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name>
+      <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name>
+      <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name>
+      <lv1_filter>L1_RD3_FILLED</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name>
+      <lv1_filter>L1_RD3_EMPTY</lv1_filter>
+    </filter>
+  </filters>
+</trigger>
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5f1323cc04a14afc6f3d6dfb3857ff1ce2aeb82e
--- /dev/null
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/data/enhanced_bias_run_334443.xml
@@ -0,0 +1,294 @@
+<?xml version="1.0" ?>
+<trigger>
+  <lumivalues>
+    <lumivalues_data>0.8376e+34</lumivalues_data>
+    <lumivalues_pred>2e34</lumivalues_pred>
+    <deadtime>0.051</deadtime>
+    <peak_mu_av>42.2</peak_mu_av>
+  </lumivalues>
+  <bunchgroups>
+    <bunchgroup id="0" name="BCRVeto">3543</bunchgroup>
+    <bunchgroup id="1" name="Paired">1538</bunchgroup>
+    <bunchgroup id="2" name="CalReq">70</bunchgroup> 
+    <bunchgroup id="3" name="Empty">1594</bunchgroup>
+    <bunchgroup id="4" name="IsolatedUnpaired">10</bunchgroup>
+    <bunchgroup id="5" name="NonIsolatedUnpaired">14</bunchgroup>
+    <bunchgroup id="6" name="EmptyBeforeAfterPaired">308</bunchgroup>
+    <bunchgroup id="7" name="InTrain">1344</bunchgroup>
+    <bunchgroup id="8" name="AbortGapNotCalReq">29</bunchgroup>
+    <bunchgroup id="9" name="AfterGlow">0</bunchgroup>
+    <bunchgroup id="10" name="ALFA">4</bunchgroup>
+    <bunchgroup id="11" name="EmptyBeforePaired">34</bunchgroup>
+    <bunchgroup id="12" name="AllWithoutCalreq">3473</bunchgroup>
+    <bunchgroup id="13" name="BG13">0</bunchgroup>
+    <bunchgroup id="14" name="BG14">0</bunchgroup>
+    <bunchgroup id="15" name="BG15">0</bunchgroup>
+  </bunchgroups>
+  <lb_list>
+    <lb id="84" lumi="8771" mu="40.6">15416</lb>
+    <lb id="85" lumi="8696" mu="40.2">18313</lb>
+    <lb id="86" lumi="8729" mu="40.4">18293</lb>
+    <lb id="87" lumi="8710" mu="40.3">11424</lb>
+    <lb id="88" lumi="8695" mu="40.2">18477</lb>
+    <lb id="89" lumi="8679" mu="40.1">17461</lb>
+    <lb id="90" lumi="8666" mu="40.1">16657</lb>
+    <lb id="91" lumi="8643" mu="40">18211</lb>
+    <lb id="92" lumi="8625" mu="39.9">13543</lb>
+    <lb id="93" lumi="8605" mu="39.8">18159</lb>
+    <lb id="94" lumi="8584" mu="39.7">18208</lb>
+    <lb id="95" lumi="8565" mu="39.6">17723</lb>
+    <lb id="96" lumi="8544" mu="39.5">18144</lb>
+    <lb id="97" lumi="8533" mu="39.5">18106</lb>
+    <lb id="98" lumi="8512" mu="39.4">17996</lb>
+    <lb id="99" lumi="8502" mu="39.3">9090</lb>
+    <lb id="100" lumi="8486" mu="39.3">17969</lb>
+    <lb id="101" lumi="8266" mu="38.2">17625</lb>
+    <lb id="102" lumi="8012" mu="37.1">17300</lb>
+    <lb id="103" lumi="8487" mu="39.3">17979</lb>
+    <lb id="104" lumi="8654" mu="40">18456</lb>
+    <lb id="105" lumi="8640" mu="40">18081</lb>
+    <lb id="106" lumi="8629" mu="39.9">18215</lb>
+    <lb id="107" lumi="8618" mu="39.9">18090</lb>
+    <lb id="108" lumi="8594" mu="39.8">18115</lb>
+    <lb id="109" lumi="8581" mu="39.7">18423</lb>
+    <lb id="110" lumi="8566" mu="39.6">17919</lb>
+    <lb id="111" lumi="8556" mu="39.6">17987</lb>
+    <lb id="112" lumi="8543" mu="39.5">17978</lb>
+    <lb id="113" lumi="8532" mu="39.5">17863</lb>
+    <lb id="114" lumi="8519" mu="39.4">18171</lb>
+    <lb id="115" lumi="8508" mu="39.4">17968</lb>
+    <lb id="116" lumi="8496" mu="39.3">17879</lb>
+    <lb id="117" lumi="8492" mu="39.3">5566</lb>
+    <lb id="118" lumi="8483" mu="39.2">17442</lb>
+    <lb id="119" lumi="8470" mu="39.2">17861</lb>
+    <lb id="120" lumi="8457" mu="39.1">17815</lb>
+    <lb id="121" lumi="8442" mu="39.1">17771</lb>
+    <lb id="122" lumi="8433" mu="39">17922</lb>
+    <lb id="123" lumi="8419" mu="38.9">17805</lb>
+    <lb id="124" lumi="8408" mu="38.9">17831</lb>
+    <lb id="125" lumi="8395" mu="38.8">17809</lb>
+    <lb id="126" lumi="8384" mu="38.8">17734</lb>
+    <lb id="127" lumi="8372" mu="38.7">13409</lb>
+    <lb id="128" lumi="8365" mu="38.7">0</lb>
+    <lb id="129" lumi="8354" mu="38.6">16698</lb>
+    <lb id="130" lumi="8348" mu="38.6">0</lb>
+    <lb id="131" lumi="8342" mu="38.6">16851</lb>
+    <lb id="132" lumi="8329" mu="38.5">17498</lb>
+    <lb id="133" lumi="8319" mu="38.5">17256</lb>
+    <lb id="134" lumi="8306" mu="38.4">17451</lb>
+    <lb id="135" lumi="8295" mu="38.4">17764</lb>
+    <lb id="136" lumi="8281" mu="38.3">17553</lb>
+    <lb id="137" lumi="8267" mu="38.2">17621</lb>
+    <lb id="138" lumi="8254" mu="38.2">17479</lb>
+    <lb id="139" lumi="8240" mu="38.1">17588</lb>
+    <lb id="140" lumi="8227" mu="38.1">17511</lb>
+    <lb id="141" lumi="8218" mu="38">17431</lb>
+    <lb id="142" lumi="8209" mu="38">17460</lb>
+    <lb id="143" lumi="8198" mu="37.9">17592</lb>
+    <lb id="144" lumi="8187" mu="37.9">17519</lb>
+    <lb id="145" lumi="8173" mu="37.8">9717</lb>
+    <lb id="146" lumi="8170" mu="37.8">17447</lb>
+    <lb id="147" lumi="8152" mu="37.7">17255</lb>
+    <lb id="148" lumi="8144" mu="37.7">17331</lb>
+    <lb id="149" lumi="8135" mu="37.6">17332</lb>
+    <lb id="150" lumi="8124" mu="37.6">15825</lb>
+    <lb id="151" lumi="8111" mu="37.5">17248</lb>
+    <lb id="152" lumi="8104" mu="37.5">17206</lb>
+    <lb id="153" lumi="8089" mu="37.4">15822</lb>
+    <lb id="154" lumi="8084" mu="37.4">17222</lb>
+    <lb id="155" lumi="8074" mu="37.3">17282</lb>
+    <lb id="156" lumi="8058" mu="37.3">17116</lb>
+    <lb id="157" lumi="8045" mu="37.2">15309</lb>
+    <lb id="158" lumi="8030" mu="37.1">17097</lb>
+    <lb id="159" lumi="8017" mu="37.1">17000</lb>
+    <lb id="160" lumi="8004" mu="37">16908</lb>
+    <lb id="161" lumi="7998" mu="37">17121</lb>
+    <lb id="162" lumi="7983" mu="36.9">15403</lb>
+  </lb_list>
+  <filters>
+    <filter>
+      <eb_hlt_chains>
+        <eb_hlt_name>HLT_eb_low_L1RD2_FILLED</eb_hlt_name>
+        <lv1_ebtrigs>L1_2EM7</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM10VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM12_2EM3</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J20.31ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J30</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU4_J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_ZB</lv1_ebtrigs>
+      </eb_hlt_chains>
+      <eb_hlt_chains>
+        <eb_hlt_name>HLT_eb_high_L1RD2_FILLED</eb_hlt_name>
+        <lv1_ebtrigs>L1_2EM10VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2EM15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4-B</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU4-BO</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6-B</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_2MU6-BO</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_3EM3_J40_XE50_DPHI-J20s2XE50</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_3J15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-2M9-2MU6_BPH-2DR15-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-8M15-2MU6_BPH-0DR22-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_BTAG-MU4J15</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DR-TAU20ITAU12I</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DY-BOX-2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_DY-DR-2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15I_MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15VHI_2TAU12IM_J25_3J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15VH_3EM7</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM15_XS30</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM18VHI</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM20VH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_EM7_MU10</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_HT190-J15.ETA21</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J4-MATCH</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J40.0ETA25_2J15.31ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_J50</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_LFV-MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MJJ-400</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_2MU6</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_TAU12IM</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU10_TAU12IM_J25_2J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_2MU4</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_J20</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_MU6_J30.0ETA49_2J20.0ETA49</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_J25_2J20_3J12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20IM_2TAU12IM_XE35</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20_2TAU12</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU20_2TAU12_XE35</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_TAU40</lv1_ebtrigs>
+        <lv1_ebtrigs>L1_XE35</lv1_ebtrigs>
+      </eb_hlt_chains>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1PhysicsLow_noPS</filter_name>
+      <lv1_filter>L1_2EM15VHI</lv1_filter> 
+      <lv1_filter>L1_2EM20VH</lv1_filter>
+      <lv1_filter>L1_2EM8VH_MU10</lv1_filter>
+      <lv1_filter>L1_2J15_XE55</lv1_filter>
+      <lv1_filter>L1_2J50_XE40</lv1_filter> 
+      <lv1_filter>L1_2MU10</lv1_filter>
+      <lv1_filter>L1_2MU4_J20_XE30_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_2MU4_J40_XE50</lv1_filter> 
+      <lv1_filter>L1_2MU6_3MU4</lv1_filter>
+      <lv1_filter>L1_3J15.0ETA25_XE40</lv1_filter> 
+      <lv1_filter>L1_3J35.0ETA23</lv1_filter> 
+      <lv1_filter>L1_3J50</lv1_filter>
+      <lv1_filter>L1_3MU4</lv1_filter>
+      <lv1_filter>L1_4J15.0ETA25</lv1_filter>
+      <lv1_filter>L1_4MU4</lv1_filter> 
+      <lv1_filter>L1_4J20</lv1_filter>
+      <lv1_filter>L1_5J15.0ETA25</lv1_filter>
+      <lv1_filter>L1_DR-EM15TAU12I-J25</lv1_filter>
+      <lv1_filter>L1_EM15VHI_2TAU12IM_4J12</lv1_filter> 
+      <lv1_filter>L1_DR-MU10TAU12I_TAU12I-J25</lv1_filter>
+      <lv1_filter>L1_DR-TAU20ITAU12I-J25</lv1_filter>
+      <lv1_filter>L1_EM15VHI_2TAU12IM_XE35</lv1_filter>
+      <lv1_filter>L1_EM15VHI_TAU40_2TAU15</lv1_filter>
+      <lv1_filter>L1_EM15VH_MU10</lv1_filter>
+      <lv1_filter>L1_EM18VHI_3J20</lv1_filter> 
+      <lv1_filter>L1_EM18VHI_MJJ-300</lv1_filter> 
+      <lv1_filter>L1_EM20VHI_TAU20IM_2TAU20_J25_3J20</lv1_filter> 
+      <lv1_filter>L1_EM20VH_3EM10VH</lv1_filter>
+      <lv1_filter>L1_EM22VHI</lv1_filter> 
+      <lv1_filter>L1_EM22VHIM</lv1_filter> 
+      <lv1_filter>L1_EM24VHI</lv1_filter>
+      <lv1_filter>L1_EM7_MU20</lv1_filter> 
+      <lv1_filter>L1_EM8VH_MU20</lv1_filter> 
+      <lv1_filter>L1_HT150-J20s5.ETA31_MJJ-400-CF</lv1_filter> 
+      <lv1_filter>L1_HT190-J15s5.ETA21</lv1_filter>
+      <lv1_filter>L1_J100</lv1_filter>
+      <lv1_filter>L1_J25.0ETA23_2J15.31ETA49</lv1_filter> 
+      <lv1_filter>L1_J40.0ETA25_2J25_J20.31ETA49</lv1_filter>
+      <lv1_filter>L1_J40_XE50_DPHI-J20s2XE50</lv1_filter>
+      <lv1_filter>L1_J40_XE60</lv1_filter> 
+      <lv1_filter>L1_J75.31ETA49</lv1_filter>
+      <lv1_filter>L1_J85_3J30</lv1_filter> 
+      <lv1_filter>L1_LATE-MU10_J50</lv1_filter> 
+      <lv1_filter>L1_LATE-MU10_XE40</lv1_filter> 
+      <lv1_filter>L1_LATE-MU10_XE50</lv1_filter> 
+      <lv1_filter>L1_LLP-NOMATCH</lv1_filter> 
+      <lv1_filter>L1_LLP-RO</lv1_filter>
+      <lv1_filter>L1_MU10_2J15_J20</lv1_filter> 
+      <lv1_filter>L1_MU10_2J20</lv1_filter>
+      <lv1_filter>L1_MU10_TAU12IM_3J12</lv1_filter> 
+      <lv1_filter>L1_MU10_TAU12IM_XE35</lv1_filter>
+      <lv1_filter>L1_MU11_2MU6</lv1_filter>
+      <lv1_filter>L1_MU20</lv1_filter>
+      <lv1_filter>L1_MU20_J40</lv1_filter> 
+      <lv1_filter>L1_MU20_XE30</lv1_filter> 
+      <lv1_filter>L1_MU4_J30_XE40_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_MU4_XE60</lv1_filter> 
+      <lv1_filter>L1_MU4_J50_XE50_DPHI-J20s2XE30</lv1_filter>
+      <lv1_filter>L1_MU6_3MU4</lv1_filter>
+      <lv1_filter>L1_MU6_J75</lv1_filter> 
+      <lv1_filter>L1_TAU100</lv1_filter>
+      <lv1_filter>L1_TAU20IM_2TAU12IM_4J12</lv1_filter> 
+      <lv1_filter>L1_TAU40_2TAU12IM_XE40</lv1_filter> 
+      <lv1_filter>L1_TAU60_2TAU40</lv1_filter> 
+      <lv1_filter>L1_TAU20IM_2J20_XE45</lv1_filter>
+      <lv1_filter>L1_TAU60_DR-TAU20ITAU12I</lv1_filter>
+      <lv1_filter>L1_XE55</lv1_filter> 
+      <lv1_filter>L1_XE60</lv1_filter>  
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1PhysicsHigh_noPS</filter_name>
+      <lv1_filter>L1_6J15</lv1_filter>
+      <lv1_filter>L1_J100.31ETA49</lv1_filter>
+      <lv1_filter>L1_J400</lv1_filter>
+      <lv1_filter>L1_XE80</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1EMPTY_noPS</filter_name>
+      <lv1_filter>L1_J12_EMPTY</lv1_filter>
+      <lv1_filter>L1_MU11_EMPTY</lv1_filter>
+      <lv1_filter>L1_TAU8_EMPTY</lv1_filter>
+      <lv1_filter>L1_EM7_EMPTY</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1FIRSTEMPTY_noPS</filter_name>
+      <lv1_filter>L1_J12_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_MU20_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_TAU8_FIRSTEMPTY</lv1_filter>
+      <lv1_filter>L1_EM7_FIRSTEMPTY</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1UNPAIRED_ISO_noPS</filter_name>
+      <lv1_filter>L1_BCM_AC_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_BCM_CA_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_BCM_Wide_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_J12_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_J15.31ETA49_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_MU4_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_EM7_UNPAIRED_ISO</lv1_filter>
+      <lv1_filter>L1_TAU8_UNPAIRED_ISO</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1UNPAIRED_NONISO_noPS</filter_name>
+      <lv1_filter>L1_BCM_AC_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_BCM_CA_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_BCM_Wide_UNPAIRED_NONISO</lv1_filter>
+      <lv1_filter>L1_J12_UNPAIRED_NONISO</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1ABORTGAPNOTCALIB_noPS</filter_name>
+      <lv1_filter>L1_J12_ABORTGAPNOTCALIB</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1RD3_FILLED</filter_name>
+      <lv1_filter>L1_RD3_FILLED</lv1_filter>
+    </filter>
+    <filter>
+      <filter_name>HLT_noalg_eb_L1RD3_EMPTY</filter_name>
+      <lv1_filter>L1_RD3_EMPTY</lv1_filter>
+    </filter>
+  </filters>
+</trigger>
+
diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h
index cb23bda2c9da7a2517eca7db1ab3ab1f01846b04..3a98ebc1e02787a6cbd0b23eb188a679ba5863ad 100755
--- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h
+++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h
@@ -23,28 +23,12 @@ public:
   /// Retrieve interface ID
   static const InterfaceID& interfaceID() { return IID_ITrigROBDataProviderSvc_RTT; }
 
-  /// Return vector with all ROBFragments stored in the cache 
-  virtual void addROBData(const std::vector<uint32_t>& robIds,
-			  const std::string callerName="UNKNOWN") = 0;
-
    //return status of prefecthing
   virtual bool  isMissingPrefetching()  = 0;
 
   // return setup of pre-fetching
   virtual bool isPrefetchingAtAlgoLevel() = 0;
 
-  /// set the name of the program which uses the ROBDataProviderSvc
-  virtual void setCallerName(const std::string) = 0;
-
-  /// Check if complete event data are already in cache
-  virtual bool isEventComplete() = 0;
-
-  /// Collect all data for an event from the ROS and put them into the cache
-  /// Return value: number of ROBs which were retrieved to complete the event
-  /// Optinonally the name of the caller of this method can be specified for cost monitoring
-  virtual int collectCompleteEventData(const std::string callerName="UNKNOWN") = 0;
-
-
 };
 
 #endif
diff --git a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
index af9fb1de435696bec9003b8f9016798c8168ae3a..2da54342b76e70bc88d5bc67ab2ab219116691ca 100644
--- a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
+++ b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
@@ -13,7 +13,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/StoreGate
                           GaudiKernel
                           PRIVATE
-                          Control/AthenaKernel
                           Control/DataModelRoot
                           Database/APR/CollectionBase
                           Database/APR/CollectionUtilities
@@ -33,10 +32,10 @@ atlas_add_library( TrigSerializeCnvSvcLib
                    PUBLIC_HEADERS TrigSerializeCnvSvc
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                    LINK_LIBRARIES AthContainers AthenaBaseComps SGTools GaudiKernel StoreGateLib SGtests TrigSerializeResultLib TrigSerializeTPLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel DataModelRoot CollectionBase CollectionUtilities POOLCore PersistencySvc StorageSvc PersistentDataModel )
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} DataModelRoot CollectionBase CollectionUtilities POOLCore PersistencySvc StorageSvc PersistentDataModel )
 
 atlas_add_component( TrigSerializeCnvSvc
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaBaseComps SGTools StoreGateLib SGtests GaudiKernel AthenaKernel DataModelRoot CollectionBase CollectionUtilities POOLCore PersistencySvc StorageSvc PersistentDataModel TrigSerializeResultLib TrigSerializeTPLib TrigSerializeCnvSvcLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaBaseComps SGTools StoreGateLib SGtests GaudiKernel DataModelRoot CollectionBase CollectionUtilities POOLCore PersistencySvc StorageSvc PersistentDataModel TrigSerializeResultLib TrigSerializeTPLib TrigSerializeCnvSvcLib )
 
diff --git a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/src/TrigSerializeConvHelper.cxx b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/src/TrigSerializeConvHelper.cxx
index aae0a1e80a1860e36b925352598f6b3438301670..27e408aabf770e29d1cb2491b52625c3f82bb38c 100644
--- a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/src/TrigSerializeConvHelper.cxx
+++ b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/src/TrigSerializeConvHelper.cxx
@@ -6,8 +6,6 @@
 #include "TrigSerializeCnvSvc/TrigSerializeConvHelper.h"
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/ClassID.h"
-#include "AthenaKernel/getMessageSvc.h"
-#include "StoreGate/StoreGateSvc.h"
 
 
 #include "TrigSerializeCnvSvc/TrigStreamAddress.h"
@@ -39,35 +37,35 @@ StatusCode TrigSerializeConvHelper::initialize(){
   StatusCode sc = m_serializerTool.retrieve();
 
   if (!sc.isSuccess()){
-    msg(MSG::DEBUG) << "m_serializer not retrieved" << endmsg;
+    ATH_MSG_DEBUG("m_serializer not retrieved");
     return sc;
   } else {
-    msg(MSG::DEBUG) << "m_serializer retrieved" << endmsg;
+    ATH_MSG_DEBUG("m_serializer retrieved");
     /*
       if (m_serializerTool->initialize().isSuccess()){
-      msg(MSG::DEBUG) << "serializer initialized" << endmsg;
+      ATH_MSG_DEBUG( "serializer initialized" );
       }
     */
   }
   
   StatusCode sctp = m_TPTool.retrieve();
   if (!sctp.isSuccess()){
-    msg(MSG::DEBUG) << "m_TPTool not retrieved" << endmsg;
+    ATH_MSG_DEBUG( "m_TPTool not retrieved" );
     return sctp;
   } else {
-    msg(MSG::DEBUG) << "m_TPTool retrieved" << endmsg;
+    ATH_MSG_DEBUG( "m_TPTool retrieved" );
     /*
       if (m_TPTool->initialize().isSuccess())
-      msg(MSG::DEBUG) << "m_TPTool initialized" << endmsg;
+      ATH_MSG_DEBUG( "m_TPTool initialized" );
       */
   }
 
   StatusCode scg = m_guidTool.retrieve();
   if (!scg.isSuccess()){
-    msg(MSG::DEBUG) << m_guidTool << " not retrieved" << endmsg;
+    ATH_MSG_DEBUG( m_guidTool << " not retrieved" );
     return scg;
   } else {
-    msg(MSG::DEBUG) << m_guidTool << "retrieved" << endmsg;
+    ATH_MSG_DEBUG( m_guidTool << "retrieved" );
   }
   
   m_oldEDMmap[ "TrigRoiDescriptor" ]         = "TrigRoiDescriptorCollection_tlp1";
@@ -122,12 +120,12 @@ StatusCode TrigSerializeConvHelper::initialize(){
 StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaqueAddress* iAddr, void *&ptr, bool isxAOD){
     
   ptr = 0;
-  msg(MSG::DEBUG) << "in TrigSerializeConvHelper::createObj for clname" << clname << " is xAOD? " << (isxAOD?"yes":"no") << endmsg;
+  ATH_MSG_DEBUG("in TrigSerializeConvHelper::createObj for clname" << clname << " is xAOD? " << (isxAOD?"yes":"no"));
   
   //could alse get DATA (perhaps as boost::any) from the IOA
   TrigStreamAddress *addr = dynamic_cast<TrigStreamAddress*>(iAddr);
   if (!addr) {
-    msg(MSG::WARNING) << "createObj cast failed" << endmsg;
+    ATH_MSG_WARNING("createObj cast failed");
     return StatusCode::FAILURE;
   }
   
@@ -154,12 +152,11 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
     scid = serializer->peekCLID(v, guid);
     if (scid.isFailure()){
       //BS has no hint on the pers class - use the original table
-      if (msgLvl(MSG::DEBUG))
-	msg(MSG::DEBUG) << "BS does not hint on payload object " << cl << endmsg;
+      ATH_MSG_DEBUG("BS does not hint on payload object " << cl);
       if (m_oldEDMmap.find(clname)!=m_oldEDMmap.end()){
 	if (cl!=m_oldEDMmap[clname]){
-	  msg(MSG::DEBUG) << "Using backward compatibility map with " <<  m_oldEDMmap[clname]
-			  << " instead of " << cl << endmsg;
+	  ATH_MSG_DEBUG("Using backward compatibility map with " <<  m_oldEDMmap[clname]
+			  << " instead of " << cl);
 	  cl = m_oldEDMmap[clname];
 	}
       }
@@ -173,12 +170,10 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
       }
       if (cl != nclass){
 	cl =  nclass;
-	if (msgLvl(MSG::DEBUG))
-	  msg(MSG::DEBUG) << "Got hint of " << cl
-			  << " different persistent class from the BS payload. Name from GUID: " << nclass << endmsg;
+	  ATH_MSG_DEBUG("Got hint of " << cl << " different persistent class from the BS payload. Name from GUID: " << nclass);
 
 	if(isxAOD){
-	  msg(MSG::DEBUG) << "This is an xAOD so probably the BS version is an older version of the xAOD type." << endmsg;
+	  ATH_MSG_DEBUG("This is an xAOD so probably the BS version is an older version of the xAOD type.");
 	}
 	versionChange = true;
       }
@@ -186,7 +181,7 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
 
     ptr = serializer->deserialize(cl, v);
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << cl << " deserialized to " << ptr << " version change detected: " << (versionChange ? "yes":"no") << endmsg;
+    ATH_MSG_DEBUG(cl << " deserialized to " << ptr << " version change detected: " << (versionChange ? "yes":"no"));
   }
    
   // T/P separation
@@ -194,11 +189,11 @@ StatusCode TrigSerializeConvHelper::createObj(const std::string &clname, IOpaque
   if (m_doTP and (!isxAOD or versionChange) and !isViewVector){
     std::string transclass;
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "converting with pername " << cl << endmsg;
+    ATH_MSG_DEBUG("converting with pername " << cl);
     
     void *transObj = m_TPTool->convertPT(cl,ptr, transclass);
 
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "was converted to " << transclass << " at " << transObj << endmsg;
+    ATH_MSG_DEBUG("was converted to " << transclass << " at " << transObj);
 
     //persistent object not needed anymore
     TClass *persClObj = gROOT->GetClass(cl.c_str());
@@ -218,7 +213,7 @@ StatusCode TrigSerializeConvHelper::createRep(const std::string &clname,
   
   StatusCode sc(StatusCode::SUCCESS);
 
-  msg(MSG::DEBUG) << "in TrigSerializeConvHelper::createRep for clname" << clname << " is xAOD? " << (isxAOD?"yes":"no") << endmsg;
+  ATH_MSG_DEBUG("in TrigSerializeConvHelper::createRep for clname" << clname << " is xAOD? " << (isxAOD?"yes":"no"));
 
   std::string cl = clname;
   void *pObj = ptr;
@@ -230,31 +225,29 @@ StatusCode TrigSerializeConvHelper::createRep(const std::string &clname,
     cl = persclass;
   }
 
-  msg(MSG::DEBUG) << "convertTP: " << pObj << " of "
-	 << cl << endmsg;
+  ATH_MSG_DEBUG("convertTP: " << pObj << " of " << cl);
   
   //void *serptr(0);
   //
   ITrigSerializerToolBase* serializer = m_serializerTool.operator->();
   serializer->reset();
 
-  msg(MSG::VERBOSE) << "About to get GUID for " << cl << endmsg;
+  ATH_MSG_VERBOSE("About to get GUID for " << cl);
   
   //opposite from string to class
   uint32_t irep[4];
   StatusCode ai = m_guidTool->ClassNameToInts(cl, irep);
   if (ai.isFailure()){
-    msg(MSG::WARNING) << "Cannot store class identification for "
-		      << cl << " to BS" << endmsg;
+    ATH_MSG_WARNING("Cannot store class identification for " << cl << " to BS");
   }
 
-  msg(MSG::VERBOSE) << "got GUID: " << irep[0] << "-" << irep[1] << "-" << irep[2] << "-" << irep[3] << endmsg;
+  ATH_MSG_VERBOSE("got GUID: " << irep[0] << "-" << irep[1] << "-" << irep[2] << "-" << irep[3]);
   
   if (cl != "" && pObj){
     serializer->setCLID(irep);
     serializer->serialize(cl, pObj, out);
   } else {
-    msg(MSG::WARNING) << "did not serialize " << ptr << " of " << clname << endmsg;
+    ATH_MSG_WARNING("did not serialize " << ptr << " of " << clname);
   }
 
   if (m_doTP and !isxAOD){
@@ -264,8 +257,7 @@ StatusCode TrigSerializeConvHelper::createRep(const std::string &clname,
       persClObj->Destructor(pObj);
   }
 
-  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "pObj: " << pObj << " of " << cl
-	 << " payload: " << out.size() << endmsg;
+  ATH_MSG_DEBUG("pObj: " << pObj << " of " << cl << " payload: " << out.size());
 
   return sc;
 }
diff --git a/Trigger/TrigEvent/TrigNavStructure/Root/TrigNavStructure.cxx b/Trigger/TrigEvent/TrigNavStructure/Root/TrigNavStructure.cxx
index 12ab1cc4da60aea761750f903530647ebfeddc58..7ead2e595351a86a847fffe2acb1c337c656094f 100644
--- a/Trigger/TrigEvent/TrigNavStructure/Root/TrigNavStructure.cxx
+++ b/Trigger/TrigEvent/TrigNavStructure/Root/TrigNavStructure.cxx
@@ -254,7 +254,7 @@ bool TrigNavStructure::deserializeTEs(std::vector<uint32_t>::const_iterator& sta
   const size_t payloadSize = *inputIt++; 
   
   if ( totalSize < payloadSize ) { // not all TEs were recorded
-    std::cerr << "size of the navigation payload smaller then reported size used to save TEs. " << totalSize << " < " << payloadSize << std::endl;
+    std::cerr << "size of the navigation payload smaller than the one required to save TEs. " << totalSize << " < " << payloadSize << std::endl;
     return false;
   }
 
diff --git a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/StandaloneNavigation.h b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/StandaloneNavigation.h
index 9b9d6a0ff8ef4953a0d3d92f6c828cdc22114dc1..ed0c20f013e94532a3f02dea3de2dd663242d039 100644
--- a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/StandaloneNavigation.h
+++ b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/StandaloneNavigation.h
@@ -17,8 +17,8 @@ namespace HLT{
     virtual ~StandaloneNavigation();
 
     /**
-     * @brief method serizlizes the helper objects allowing use of FeatureAccessHelpers w/o CLID
-     * This methods should be owerwritten by the derived classes
+     * @brief method serializes the helper objects allowing use of FeatureAccessHelpers w/o CLID
+     * This methods should be overwritten by the derived classes
      *
      * @param output vector to place the result
      *
@@ -28,7 +28,7 @@ namespace HLT{
     virtual bool deserializeHolders(std::vector<uint32_t>::const_iterator& start,  const std::vector<uint32_t>::const_iterator& end);
 
     /**
-     * @brief method serizlizes entire navigation
+     * @brief method serializes entire navigation
      *
      * @param output vector to place the result
      *
diff --git a/Trigger/TrigEvent/TrigNavStructure/share/ut_build_trignav_test.ref b/Trigger/TrigEvent/TrigNavStructure/share/ut_build_trignav_test.ref
index 49ace4ccc1a8365980c323b1d299061b9cae2a48..6f327edc7bb6bbd14d2e59dfc72fd9039a2868c6 100644
--- a/Trigger/TrigEvent/TrigNavStructure/share/ut_build_trignav_test.ref
+++ b/Trigger/TrigEvent/TrigNavStructure/share/ut_build_trignav_test.ref
@@ -1,20 +1,24 @@
-INFO       LINE:24   Test empty
-DEBUG      LINE:31   Test progressing
-DEBUG      LINE:37   Test progressing
-OK         LINE:42   Empty nav test passed
-INFO       LINE:48   Test singleTE
-DEBUG      LINE:56   Test progressing
-DEBUG      LINE:64   Test progressing
-OK         LINE:70   One TE navigation serialization
-INFO       LINE:75   Test realTEs
-DEBUG      LINE:91   Test progressing
-DEBUG      LINE:98   Test progressing
-DEBUG      LINE:110  Test progressing
-OK         LINE:119  One TE navigation serialization
-INFO       LINE:125  Test truncate
-DEBUG      LINE:132  Test progressing
-DEBUG      LINE:140  Test progressing
-DEBUG      LINE:143  Test progressing
-size of the navigation payload smaller than the one required to save TEs17 < 18
-DEBUG      LINE:148  Test progressing
-OK         LINE:167  Test passed
+INFO       LINE:28   
+INFO       LINE:28   Test empty
+DEBUG      LINE:35   Test progressing
+DEBUG      LINE:41   Test progressing
+OK         LINE:46   Empty nav test passed
+INFO       LINE:52   
+INFO       LINE:52   Test singleTE
+DEBUG      LINE:60   Test progressing
+DEBUG      LINE:68   Test progressing
+OK         LINE:74   One TE navigation serialization
+INFO       LINE:79   
+INFO       LINE:79   Test realTEs
+DEBUG      LINE:95   Test progressing
+DEBUG      LINE:102  Test progressing
+DEBUG      LINE:114  Test progressing
+OK         LINE:123  One TE navigation serialization
+INFO       LINE:129  
+INFO       LINE:129  Test truncate
+DEBUG      LINE:136  Test progressing
+DEBUG      LINE:144  Test progressing
+DEBUG      LINE:147  Test progressing
+size of the navigation payload smaller than the one required to save TEs. 17 < 18
+DEBUG      LINE:152  Test progressing
+OK         LINE:171  Test passed
diff --git a/Trigger/TrigEvent/TrigNavStructure/share/ut_features_test.ref b/Trigger/TrigEvent/TrigNavStructure/share/ut_features_test.ref
index a5eaf918c3b5f04d573ab5a4fa4f3a8e16a564ab..44bf820e907bdff05b6a3cbb87b195729b685f2f 100644
--- a/Trigger/TrigEvent/TrigNavStructure/share/ut_features_test.ref
+++ b/Trigger/TrigEvent/TrigNavStructure/share/ut_features_test.ref
@@ -1,42 +1,58 @@
-INFO       LINE:146  Test getFromExplicitTE
-DEBUG      LINE:151  Test progressing
+DEBUG      LINE:18   added holder for clid/label/sub: 6171771/initial/0
+DEBUG      LINE:18   added holder for clid/label/sub: 6171771/secondary/1
+DEBUG      LINE:18   added holder for clid/label/sub: 19188792/L2ElectronClusters/3
+DEBUG      LINE:18   added holder for clid/label/sub: 472619874/L2ElectronTracks/0
+DEBUG      LINE:18   added holder for clid/label/sub: 788776/L2Electrons/0
+INFO       LINE:303  build navigation. test.
+INFO       LINE:151  
+INFO       LINE:151  Test getFromExplicitTE
 DEBUG      LINE:156  Test progressing
-DEBUG      LINE:162  Test progressing
-DEBUG      LINE:167  Test progressing
-DEBUG      LINE:172  Test progressing
-INFO       LINE:179  Test getRecursivelyTEbyCLID
-DEBUG      LINE:187  Test progressing
-DEBUG      LINE:195  Test progressing
-DEBUG      LINE:204  Test progressing
+DEBUG      LINE:161  Test progressing
+DEBUG      LINE:165  Test progressing
+DEBUG      LINE:171  Test progressing
+DEBUG      LINE:178  Test progressing
+DEBUG      LINE:184  Test progressing
+DEBUG      LINE:190  Test progressing
+INFO       LINE:197  
+INFO       LINE:197  Test getRecursivelyTEbyCLID
+DEBUG      LINE:205  Test progressing
 DEBUG      LINE:213  Test progressing
-INFO       LINE:219  Test getRecursivelyTEbyLabel
-DEBUG      LINE:226  Test progressing
-DEBUG      LINE:232  Test progressing
-DEBUG      LINE:238  Test progressing
-INFO       LINE:249  Number of TEs before re-serailziation 11
-INFO       LINE:256  size of serialzied navigation is 95
-INFO       LINE:257  elements: 3 95 52 11
-INFO       LINE:268  Number of TEs after deserailziation 11
-INFO       LINE:299  tests after serialization, deserialization
-DEBUG      LINE:33   dumpHolders
-DEBUG      LINE:35   Holder CLID:6171771 label: initial sub: 0
-DEBUG      LINE:35   Holder CLID:6171771 label: secondary sub: 1
-DEBUG      LINE:35   Holder CLID:19188792 label: L2ElectronClusters sub: 3
-DEBUG      LINE:35   Holder CLID:472619874 label: L2ElectronTracks sub: 0
-DEBUG      LINE:35   Holder CLID:788776 label: L2Electrons sub: 0
-INFO       LINE:146  Test getFromExplicitTE
-DEBUG      LINE:151  Test progressing
+DEBUG      LINE:222  Test progressing
+DEBUG      LINE:231  Test progressing
+INFO       LINE:237  
+INFO       LINE:237  Test getRecursivelyTEbyLabel
+DEBUG      LINE:244  Test progressing
+DEBUG      LINE:250  Test progressing
+DEBUG      LINE:256  Test progressing
+INFO       LINE:267  Number of TEs before re-serailziation 11
+INFO       LINE:274  size of serialzied navigation is 95
+INFO       LINE:275  elements: 3 95 52 11
+INFO       LINE:286  Number of TEs after deserailziation 11
+INFO       LINE:319  tests after serialization, deserialization
+DEBUG      LINE:38   dumpHolders
+DEBUG      LINE:40   Holder CLID:788776 label: L2Electrons sub: 0
+DEBUG      LINE:40   Holder CLID:6171771 label: initial sub: 0
+DEBUG      LINE:40   Holder CLID:6171771 label: secondary sub: 1
+DEBUG      LINE:40   Holder CLID:19188792 label: L2ElectronClusters sub: 3
+DEBUG      LINE:40   Holder CLID:472619874 label: L2ElectronTracks sub: 0
+INFO       LINE:151  
+INFO       LINE:151  Test getFromExplicitTE
 DEBUG      LINE:156  Test progressing
-DEBUG      LINE:162  Test progressing
-DEBUG      LINE:167  Test progressing
-DEBUG      LINE:172  Test progressing
-INFO       LINE:179  Test getRecursivelyTEbyCLID
-DEBUG      LINE:187  Test progressing
-DEBUG      LINE:195  Test progressing
-DEBUG      LINE:204  Test progressing
+DEBUG      LINE:161  Test progressing
+DEBUG      LINE:165  Test progressing
+DEBUG      LINE:171  Test progressing
+DEBUG      LINE:178  Test progressing
+DEBUG      LINE:184  Test progressing
+DEBUG      LINE:190  Test progressing
+INFO       LINE:197  
+INFO       LINE:197  Test getRecursivelyTEbyCLID
+DEBUG      LINE:205  Test progressing
 DEBUG      LINE:213  Test progressing
-INFO       LINE:219  Test getRecursivelyTEbyLabel
-DEBUG      LINE:226  Test progressing
-DEBUG      LINE:232  Test progressing
-DEBUG      LINE:238  Test progressing
-OK         LINE:310  test passed
+DEBUG      LINE:222  Test progressing
+DEBUG      LINE:231  Test progressing
+INFO       LINE:237  
+INFO       LINE:237  Test getRecursivelyTEbyLabel
+DEBUG      LINE:244  Test progressing
+DEBUG      LINE:250  Test progressing
+DEBUG      LINE:256  Test progressing
+OK         LINE:330  test passed
diff --git a/Trigger/TrigEvent/TrigNavStructure/share/ut_iterators_test.ref b/Trigger/TrigEvent/TrigNavStructure/share/ut_iterators_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..ccc8ed021e9c9686e7a8b98dd234075968e52ebe
--- /dev/null
+++ b/Trigger/TrigEvent/TrigNavStructure/share/ut_iterators_test.ref
@@ -0,0 +1,36 @@
+INFO       LINE:99   
+INFO       LINE:99   Test testPlainIteratorSymmetric
+DEBUG      LINE:108  Test progressing
+INFO       LINE:81   Combination 0 of TEs seeded of 1101 1102
+INFO       LINE:81   Combination 1 of TEs seeded of 1101 1103
+INFO       LINE:81   Combination 2 of TEs seeded of 1101 1104
+INFO       LINE:81   Combination 3 of TEs seeded of 1102 1103
+INFO       LINE:81   Combination 4 of TEs seeded of 1102 1104
+INFO       LINE:81   Combination 5 of TEs seeded of 1103 1104
+INFO       LINE:113  Plain iterator test passed ok on symmetric test
+INFO       LINE:119  
+INFO       LINE:119  Test testPlainIteratorAsymmetric
+INFO       LINE:81   Combination 0 of TEs seeded of 1101 3301
+INFO       LINE:81   Combination 1 of TEs seeded of 1101 3302
+INFO       LINE:81   Combination 2 of TEs seeded of 1101 3303
+INFO       LINE:81   Combination 3 of TEs seeded of 1102 3301
+INFO       LINE:81   Combination 4 of TEs seeded of 1102 3302
+INFO       LINE:81   Combination 5 of TEs seeded of 1102 3303
+INFO       LINE:81   Combination 6 of TEs seeded of 1103 3301
+INFO       LINE:81   Combination 7 of TEs seeded of 1103 3302
+INFO       LINE:81   Combination 8 of TEs seeded of 1103 3303
+INFO       LINE:81   Combination 9 of TEs seeded of 1104 3301
+INFO       LINE:81   Combination 10 of TEs seeded of 1104 3302
+INFO       LINE:81   Combination 11 of TEs seeded of 1104 3303
+INFO       LINE:141  
+INFO       LINE:141  Test testTopoIterator
+DEBUG      LINE:149  Test progressing
+INFO       LINE:81   Combination 0 of TEs seeded of 1101 1102
+INFO       LINE:81   Combination 1 of TEs seeded of 1101 1103
+DEBUG      LINE:158  Test progressing
+INFO       LINE:81   Combination 0 of TEs seeded of 3301 3303
+DEBUG      LINE:167  Test progressing
+DEBUG      LINE:176  Test progressing
+INFO       LINE:81   Combination 0 of TEs seeded of 3301 1101
+INFO       LINE:81   Combination 1 of TEs seeded of 3302 1101
+OK         LINE:201  Test passed
diff --git a/Trigger/TrigEvent/TrigNavStructure/share/ut_serializer_test.ref b/Trigger/TrigEvent/TrigNavStructure/share/ut_serializer_test.ref
index f2a6ba0c8241f591cfc7fcdf28fd19e00cb3a344..66605c3321c26ab014487292492b1b9657934fd9 100644
--- a/Trigger/TrigEvent/TrigNavStructure/share/ut_serializer_test.ref
+++ b/Trigger/TrigEvent/TrigNavStructure/share/ut_serializer_test.ref
@@ -1,3 +1,5 @@
-INFO       LINE:8    Test contentMany
-INFO       LINE:23   Test contentOne
-OK         LINE:45   test passed
+INFO       LINE:12   
+INFO       LINE:12   Test contentMany
+INFO       LINE:27   
+INFO       LINE:27   Test contentOne
+OK         LINE:49   test passed
diff --git a/Trigger/TrigEvent/TrigNavigation/TrigNavigation/Navigation.icc b/Trigger/TrigEvent/TrigNavigation/TrigNavigation/Navigation.icc
index b0477a01a264031b9acb8d217fd62d5319c827fa..317eb420b5d16813bfdd7e7c14421b2f4e027471 100644
--- a/Trigger/TrigEvent/TrigNavigation/TrigNavigation/Navigation.icc
+++ b/Trigger/TrigEvent/TrigNavigation/TrigNavigation/Navigation.icc
@@ -18,9 +18,6 @@
 #include "TrigNavigation/Holder.h"
 #include "TrigNavigation/RoICacheHistory.h"
 
-#undef  MLOG
-#define MLOG(x)   if (m_log->level()<=MSG::x) *m_log << MSG::x
-
 /*****************************************************************************
  *
  * FEATURES OPERATIONS
@@ -35,19 +32,19 @@ bool HLT::Navigation::attachFeature( TriggerElement* te, const T* feature,
   // Get clid
   CLID clid = ClassID_traits<T>::ID();
 
-  MLOG(DEBUG) << "attachFeature: of clid: " << clid << "(" << ClassID_traits<T>::typeName() << ")"
+  ATH_MSG_DEBUG("attachFeature: of clid: " << clid << "(" << ClassID_traits<T>::typeName() << ")"
 	      << " to TE: " << te->getId()
 	      << " label: \"" << label << "\""
-	      << " memory management: " << mmanagement <<  endreq;
+	      << " memory management: " << mmanagement);
 
   // get a holder for this type --- if that's new it will be created
 
-  MLOG(VERBOSE) << "getting Holder for label: " << label << endreq;
+  ATH_MSG_VERBOSE("getting Holder for label: " << label );
   HLTNavDetails::Holder<T>* holder = getHolder<T>(label, nextSubTypeIndex(clid,label));
-  MLOG(VERBOSE) << "got Holder: " << holder << endreq;
+  ATH_MSG_VERBOSE("got Holder: " << holder );
 
   if ( ! holder ) {
-    MLOG(WARNING) << "attachFeature: Holder missing for CLID: " << clid << endreq;
+    ATH_MSG_WARNING( "attachFeature: Holder missing for CLID: " << clid );
     return false;
   }
 
@@ -64,11 +61,11 @@ __attribute__((__used__))
 bool HLT::Navigation::associateExternalCollection(const std::string& label) {
   CLID clid = ClassID_traits<T>::ID();
   
-  MLOG(DEBUG) << "associateExternalCollection: of clid: " << clid << "(" << ClassID_traits<T>::typeName() << ")"
-	      << " label: \"" << label << "\"" <<  endreq;
+  ATH_MSG_DEBUG("associateExternalCollection: of clid: " << clid << "(" << ClassID_traits<T>::typeName() << ")"
+	      << " label: \"" << label << "\"");
   HLTNavDetails::Holder<T>* holder = getHolder<T>(label, nextSubTypeIndex(clid,label));    
   if ( ! holder ) { 
-    MLOG(WARNING) << "associateExternalCollection: Holder missing for CLID: " << clid << endreq;
+    ATH_MSG_WARNING( "associateExternalCollection: Holder missing for CLID: " << clid );
     return false;
   }
   return true;
@@ -84,9 +81,9 @@ bool HLT::Navigation::findOwners(const T* obj, std::vector<const TriggerElement*
   if ( id != 0 ) {
     it      = m_factory.listOfProduced(id).begin();
     itEnd   = m_factory.listOfProduced(id).end();
-    MLOG(VERBOSE) << "findOwners will scann TEs of ID : " << id << " #: " << itEnd-it << endreq;
+    ATH_MSG_VERBOSE("findOwners will scann TEs of ID : " << id << " #: " << itEnd-it );
   } else {
-    MLOG(VERBOSE) << "findOwners will scann ALL TEs (slow):" << itEnd-it << endreq;
+    ATH_MSG_VERBOSE("findOwners will scann ALL TEs (slow):" << itEnd-it );
   }
 
   CLID clid = ClassID_traits<T>::ID();
@@ -96,13 +93,13 @@ bool HLT::Navigation::findOwners(const T* obj, std::vector<const TriggerElement*
   if(holders_of_clid.empty())
     return true;
 
-  MLOG(VERBOSE) << "findOwners features of this CLID present " << endreq;
+  ATH_MSG_VERBOSE("findOwners features of this CLID present " );
   bool holderFound = false;
   HLT::TriggerElement::ObjectIndex idx;
   for(auto holder : holders_of_clid ) {
     if ( holder->contains(obj, idx) ) {
       holderFound = true;
-      MLOG(VERBOSE) << "findOwners found holder owning the object " << *holder << " and index: " << idx << endreq;
+      ATH_MSG_VERBOSE("findOwners found holder owning the object " << *holder << " and index: " << idx );
       break;
     }
   }
@@ -120,7 +117,7 @@ bool HLT::Navigation::findOwners(const T* obj, std::vector<const TriggerElement*
       if ( featureAccessIt->getCLID() == clid &&
 	   featureAccessIt->getIndex().isSameOrWithin(&idx) ) {
 	owners.push_back(*it);
-	MLOG(VERBOSE) << "findOwners while looking in TE(id): " << *it <<"(" << (*it)->getId() << ")" << " and access helper " << featureAccessIt->getIndex() << " found owner " << endreq;	
+	ATH_MSG_VERBOSE("findOwners while looking in TE(id): " << *it <<"(" << (*it)->getId() << ")" << " and access helper " << featureAccessIt->getIndex() << " found owner " );	
 	break;
       }
     }
@@ -150,6 +147,5 @@ const std::string HLT::Navigation::getUniqueKey( const std::string& label ) {
 }
 
 
-#undef MLOG
 //EOF
 #endif // TRIGNAVIGATION_HLTNAVIGATION_ICC
diff --git a/Trigger/TrigEvent/TrigNavigation/share/HLTNavigation_test.ref b/Trigger/TrigEvent/TrigNavigation/share/HLTNavigation_test.ref
index 6a0908620805d7c2aec8f3b984db6879e0fb297e..a5fae23025af50803edc7fe4e50f6c92928bbfea 100644
--- a/Trigger/TrigEvent/TrigNavigation/share/HLTNavigation_test.ref
+++ b/Trigger/TrigEvent/TrigNavigation/share/HLTNavigation_test.ref
@@ -1,7 +1,7 @@
 
 
 Initializing Gaudi ApplicationMgr using job opts ../share/test.txt
-JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3e/Trigger/TrigEvent/TrigNavigation/share/../share/test.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/work/s/smh/MR_5043/athena/Trigger/TrigEvent/TrigNavigation/share/../share/test.txt
 JobOptionsSvc        INFO # (2,1): ApplicationMgr.DLLs += ["StoreGate", "TrigNavigation", "TrigSerializeCnvSvc"]
 JobOptionsSvc        INFO # (3,1): ApplicationMgr.ExtSvc += ["ClassIDSvc"]
 JobOptionsSvc        INFO # (4,1): ApplicationMgr.ExtSvc += ["TrigSerializeCnvSvc"]
@@ -12,27 +12,27 @@ JobOptionsSvc        INFO # (8,1): AuditorSvc.Auditors += ["AlgContextAuditor"]
 JobOptionsSvc        INFO # (9,1): StoreGateSvc.OutputLevel = 0
 JobOptionsSvc        INFO # (10,1): StoreGateSvc.ActivateHistory = 0
 JobOptionsSvc        INFO # (14,1): MessageSvc.useColors = 0
-JobOptionsSvc        INFO # (30,1): ToolSvc.Navigation.ReferenceAllClasses = 1
-JobOptionsSvc        INFO # (31,1): ToolSvc.Navigation.ClassesToPreregister = ["TestA#EverEmptyButPresent", "TestA#AgainPresentButEmpty", "TestA#", "TestBContainer#BContainer1", "TestBContainer#BContainer2", "TestDContainer#DContainer1"]
-JobOptionsSvc        INFO # (34,1): ToolSvc.Navigation.OutputLevel = 1
-JobOptionsSvc        INFO # (35,1): Holder_test.OutputLevel = 1
-JobOptionsSvc        INFO # (36,1): RoICache_test.OutputLevel = 3
+JobOptionsSvc        INFO # (15,1): MessageSvc.setDebug = ["NavigationCore"]
+JobOptionsSvc        INFO # (31,1): ToolSvc.Navigation.ReferenceAllClasses = 1
+JobOptionsSvc        INFO # (32,1): ToolSvc.Navigation.ClassesToPreregister = ["TestA#EverEmptyButPresent", "TestA#AgainPresentButEmpty", "TestA#", "TestBContainer#BContainer1", "TestBContainer#BContainer2", "TestDContainer#DContainer1"]
+JobOptionsSvc        INFO # (35,1): ToolSvc.Navigation.OutputLevel = 1
+JobOptionsSvc        INFO # (36,1): Holder_test.OutputLevel = 1
+JobOptionsSvc        INFO # (37,1): RoICache_test.OutputLevel = 1
 JobOptionsSvc        INFO Job options successfully read in from ../share/test.txt
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v4r1)
-                                          running on lxplus051.cern.ch on Tue Jul 19 19:41:21 2016
+                                          running on pc-tbed-pub-01.cern.ch on Sat Oct  7 17:04:22 2017
 ====================================================================================================================================
 ApplicationMgr       INFO Successfully loaded modules : StoreGate, TrigNavigation, TrigSerializeCnvSvc
 ApplicationMgr       INFO Application Manager Configured successfully
-ClassIDSvc           INFO Initializing ClassIDSvc - package version CLIDComps-00-06-20
-ClassIDSvc           INFO  getRegistryEntries: read 1319 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1369 CLIDRegistry entries for module ALL
 TrigSerializeCn...   INFO initialize()
 StoreGateSvc        DEBUG Service base class initialized successfully
 StoreGateSvc      VERBOSE ServiceLocatorHelper::service: found service EventPersistencySvc
 StoreGateSvc      VERBOSE ServiceLocatorHelper::service: found service ClassIDSvc
-ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-02-08
-ActiveStoreSvc       INFO Initializing ActiveStoreSvc - package version StoreGate-03-07-04
+ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
+ActiveStoreSvc       INFO Initializing ActiveStoreSvc - package version StoreGate-00-00-00
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
 HistogramPersis...WARNING Histograms saving not required.
@@ -40,7 +40,7 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 ToolSvc.Navigation  DEBUG Property update for OutputLevel : new value = 1
 ToolSvc.Navigation  DEBUG Navigation::initialize() got TrigSerializeCnvSvc
-ClassIDSvc           INFO  getRegistryEntries: read 343 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 357 CLIDRegistry entries for module ALL
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: EverEmptyButPresent
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: AgainPresentButEmpty
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: 
@@ -53,429 +53,385 @@ ToolSvc.NavigationVERBOSE type: TestBContainer(96422) container: TestBContainer(
 ToolSvc.NavigationVERBOSE type: TestBContainerView(96423) container: TestBContainerView(96423)label: "" subTypeIndex: 0 container not allocated yet
 ToolSvc.NavigationVERBOSE type: TestDContainer(96477) container: TestDContainer(96477)label: "" subTypeIndex: 0 container not allocated yet
 ToolSvc.Navigation  DEBUG  successfully initialized Navigation 
-ToolSvc.Navigation  DEBUG Navigation reset done
-HLTNavigation_test   INFO LINE:356 Start of the test: Construction
-HLTNavigation_test   INFO LINE:383 Test progress fine:  after adding inital nodes
-HLTNavigation_test   INFO LINE:396 Test progress fine:  RoIs made
-HLTNavigation_test   INFO LINE:430 Test progress fine:  RoIs Common/Distinct check made
-HLTNavigation_test   INFO LINE:475 End of the test: Construction
-HLTNavigation_test   INFO LINE:480 Start of the test: counting
-HLTNavigation_test   INFO LINE:502 Test progress fine:  SUCCESS TEST of getAllOfType method
-HLTNavigation_test   INFO LINE:512 End of the test: counting
-HLTNavigation_test   INFO LINE:541 Start of the test: topo
-HLTNavigation_test   INFO LINE:558 Test progress fine:  SUCCESS tests of isTopological method
-HLTNavigation_test   INFO LINE:577 Test progress fine:   of haveCommonSeed method
-HLTNavigation_test   INFO LINE:582 End of the test: topo
-HLTNavigation_test   INFO LINE:588 Start of the test: single feature operations test
+NavigationCore      DEBUG Navigation reset done
+HLTNavigation_test   INFO LINE:360 Start of the test: Construction
+HLTNavigation_test   INFO LINE:387 Test progress fine:  after adding inital nodes
+HLTNavigation_test   INFO LINE:400 Test progress fine:  RoIs made
+HLTNavigation_test   INFO LINE:434 Test progress fine:  RoIs Common/Distinct check made
+HLTNavigation_test   INFO LINE:479 End of the test: Construction
+HLTNavigation_test   INFO LINE:484 Start of the test: counting
+HLTNavigation_test   INFO LINE:506 Test progress fine:  SUCCESS TEST of getAllOfType method
+HLTNavigation_test   INFO LINE:516 End of the test: counting
+HLTNavigation_test   INFO LINE:545 Start of the test: topo
+HLTNavigation_test   INFO LINE:562 Test progress fine:  SUCCESS tests of isTopological method
+HLTNavigation_test   INFO LINE:581 Test progress fine:   of haveCommonSeed method
+HLTNavigation_test   INFO LINE:586 End of the test: topo
+HLTNavigation_test   INFO LINE:592 Start of the test: single feature operations test
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 111 label: "Single" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: Single
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: Single
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: Single and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "Single" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xde2650
-StoreGateSvc        DEBUG Recorded object @0xde2ea0 with key HLT_DataVector<TestA>_SingleAux. of type TestAuxA(CLID 642300)
- in DataObject @0xde28d0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde2d90 with key HLT_DataVector<TestA>_Single of type DataVector<TestA>(CLID 64210)
- in DataObject @0xde3bc0
- object modifiable when retrieved
+NavigationCore      DEBUG Getting holder for type: 6421 label: Single
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: Single and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "Single" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f54910
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 111 label: "Single" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: Single
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: Single
-ToolSvc.NavigationVERBOSE got Holder: 0xde2650
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421 label: Single
+ToolSvc.NavigationVERBOSE got Holder: 0x1f54910
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1111 label: ""
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 111 label: "ToolTestA" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: ToolTestA
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: ToolTestA
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: ToolTestA and index: 1
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "ToolTestA" subTypeIndex: 1 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xde4910
-StoreGateSvc        DEBUG Recorded object @0xde4e10 with key HLT_DataVector<TestA>_ToolTestAAux. of type TestAuxA(CLID 642300)
- in DataObject @0xde50b0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde4d00 with key HLT_DataVector<TestA>_ToolTestA of type DataVector<TestA>(CLID 64210)
- in DataObject @0xde5730
- object modifiable when retrieved
+NavigationCore      DEBUG Getting holder for type: 6421 label: ToolTestA
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: ToolTestA and index: 1
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "ToolTestA" subTypeIndex: 1 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f56630
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 111 label: "ToolB" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: ToolB
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: ToolB
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: ToolB and index: 2
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "ToolB" subTypeIndex: 2 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xde5bf0
-StoreGateSvc        DEBUG Recorded object @0xde6180 with key HLT_DataVector<TestA>_ToolBAux. of type TestAuxA(CLID 642300)
- in DataObject @0xde6450
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde6070 with key HLT_DataVector<TestA>_ToolB of type DataVector<TestA>(CLID 64210)
- in DataObject @0xde6a20
- object modifiable when retrieved
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: "ToolTestA"
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421 label: ToolB
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: ToolB and index: 2
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "ToolB" subTypeIndex: 2 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f57e30
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: "ToolTestA"
+NavigationCore      DEBUG Getting holder for type: 6421
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 1111 label: "ToolB" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: ToolB
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: ToolB
-ToolSvc.NavigationVERBOSE got Holder: 0xde5bf0
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 11 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 12 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 13 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 14 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 11111 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33301 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33311 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33321 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33323 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33324 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5000 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5001 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5002 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5003 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5004 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5005 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5006 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5007 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5008 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5009 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5010 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5011 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5012 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5013 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5014 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5015 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5016 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5017 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5018 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5019 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5020 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5021 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5022 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5023 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 5024 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
-ToolSvc.Navigation  DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
-ToolSvc.Navigation  DEBUG getRecentFeatures: looking for CLID: 6421(TestA) in TE: 11111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-ToolSvc.Navigation  DEBUG getRecentFeatures: looking for CLID: 6421(TestA) in TE: 11111 label: "ToolTestA"
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
-HLTNavigation_test   INFO LINE:655 Test progress fine:  Get features worked fine
-HLTNavigation_test   INFO LINE:657 End of the test: single feature operations test
-HLTNavigation_test   INFO LINE:673 Start of the test: container feature operations test
+NavigationCore      DEBUG Getting holder for type: 6421 label: ToolB
+ToolSvc.NavigationVERBOSE got Holder: 0x1f57e30
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 11 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 12 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 13 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 14 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 11111 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33301 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33311 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33321 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33323 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33324 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 33399 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5000 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5001 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5002 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5003 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5004 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5005 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5006 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5007 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5008 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5009 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5010 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5011 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5012 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5013 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5014 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5015 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5016 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5017 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5018 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5019 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5020 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5021 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5022 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5023 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 5024 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 50 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 60 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 150 label: ""
+NavigationCore      DEBUG getFeatures: of clid: 6421(TestA) to TE: 1050 label: ""
+NavigationCore      DEBUG getRecentFeatures: looking for CLID: 6421(TestA) in TE: 11111 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeatures: looking for CLID: 6421(TestA) in TE: 11111 label: "ToolTestA"
+NavigationCore      DEBUG Getting holder for type: 6421
+HLTNavigation_test   INFO LINE:659 Test progress fine:  Get features worked fine
+HLTNavigation_test   INFO LINE:661 End of the test: single feature operations test
+HLTNavigation_test   INFO LINE:677 Start of the test: container feature operations test
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 111 label: "Test1" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: Test1
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: Test1
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: Test1 and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "Test1" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xde6e50
-StoreGateSvc        DEBUG Recorded object @0xde7dd0 with key HLT_TestBContainer_Test1Aux. of type TestAuxB(CLID 642311)
- in DataObject @0xde80a0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde7cc0 with key HLT_TestBContainer_Test1 of type TestBContainer(CLID 96422)
- in DataObject @0xde8880
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde7330 with key HLTAutoKey_Test1_96422_0_to_0 of type TestBContainer(CLID 96422)
- in DataObject @0xcd8530
- object not modifiable when retrieved
+NavigationCore      DEBUG Getting holder for type: 96422 label: Test1
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: Test1 and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "Test1" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f59d00
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 111 label: "BContainer2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: BContainer2
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: BContainer2
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: BContainer2 and index: 1
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer2" subTypeIndex: 1 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xde9a90
-StoreGateSvc        DEBUG Recorded object @0xde9e90 with key HLT_TestBContainer_BContainer2Aux. of type TestAuxB(CLID 642311)
- in DataObject @0xdea160
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde9d80 with key HLT_TestBContainer_BContainer2 of type TestBContainer(CLID 96422)
- in DataObject @0xdea3b0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xde9230 with key HLTAutoKey_BContainer2_96422_1_to_0 of type TestBContainer(CLID 96422)
- in DataObject @0xdeaa10
- object not modifiable when retrieved
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 11111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 11111 label: "Test1"
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422
-HLTNavigation_test   INFO LINE:703 End of the test: container feature operations test
-HLTNavigation_test   INFO LINE:729 Start of the test: const attach test
+NavigationCore      DEBUG Getting holder for type: 96422 label: BContainer2
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: BContainer2 and index: 1
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer2" subTypeIndex: 1 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f5c7e0
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 11111 label: ""
+NavigationCore      DEBUG Getting holder for type: 96422
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 11111 label: "Test1"
+NavigationCore      DEBUG Getting holder for type: 96422
+HLTNavigation_test   INFO LINE:707 End of the test: container feature operations test
+HLTNavigation_test   INFO LINE:733 Start of the test: const attach test
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 11111 label: "ConstBContainer" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: ConstBContainer
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: ConstBContainer
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: ConstBContainer and index: 2
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "ConstBContainer" subTypeIndex: 2 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xdeb380
-StoreGateSvc        DEBUG Recorded object @0xdeb7c0 with key HLT_TestBContainer_ConstBContainerAux. of type TestAuxB(CLID 642311)
- in DataObject @0xdeb450
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xdeb6b0 with key HLT_TestBContainer_ConstBContainer of type TestBContainer(CLID 96422)
- in DataObject @0xdeb4e0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xdeb180 with key HLTAutoKey_ConstBContainer_96422_2_to_0 of type TestBContainer(CLID 96422)
- in DataObject @0xdec2d0
- object not modifiable when retrieved
-ToolSvc.Navigation  DEBUG getFeature: of clid: 96422(TestBContainer) to TE: 11111 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422
-ToolSvc.Navigation  DEBUG getFeature: of clid: 96422(TestBContainer) to TE: 111 label: "BContainer2"
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422
-HLTNavigation_test   INFO LINE:759 Test progress fine:  Got the already attached container 2
-HLTNavigation_test   INFO LINE:768 Test progress fine:  Prepared ConstTestBContainer wiht contnt already present in another non-cont container
+NavigationCore      DEBUG Getting holder for type: 96422 label: ConstBContainer
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: ConstBContainer and index: 2
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "ConstBContainer" subTypeIndex: 2 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f5e590
+NavigationCore      DEBUG getFeature: of clid: 96422(TestBContainer) to TE: 11111 label: ""
+NavigationCore      DEBUG Getting holder for type: 96422
+NavigationCore      DEBUG getFeature: of clid: 96422(TestBContainer) to TE: 111 label: "BContainer2"
+NavigationCore      DEBUG Getting holder for type: 96422
+HLTNavigation_test   INFO LINE:763 Test progress fine:  Got the already attached container 2
+HLTNavigation_test   INFO LINE:772 Test progress fine:  Prepared ConstTestBContainer wiht contnt already present in another non-cont container
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 11111 label: "ConstBContainer2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: ConstBContainer2
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: ConstBContainer2
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: ConstBContainer2 and index: 3
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "ConstBContainer2" subTypeIndex: 3 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0xdecae0
-StoreGateSvc        DEBUG Recorded object @0xdecf70 with key HLT_TestBContainer_ConstBContainer2Aux. of type TestAuxB(CLID 642311)
- in DataObject @0xdecc00
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xdece60 with key HLT_TestBContainer_ConstBContainer2 of type TestBContainer(CLID 96422)
- in DataObject @0xdecc90
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0xdec940 with key HLTAutoKey_ConstBContainer2_96422_3_to_0 of type TestBContainer(CLID 96422)
- in DataObject @0xdedbe0
- object not modifiable when retrieved
-HLTNavigation_test   INFO LINE:774 End of the test: const attach test
-HLTNavigation_test   INFO LINE:779 Start of the test: external_collection test
-StoreGateSvc        DEBUG Recorded object @0xdee180 with key HLT_external of type TestBContainer(CLID 96422)
- in DataObject @0xdee0c0
- object modifiable when retrieved
+NavigationCore      DEBUG Getting holder for type: 96422 label: ConstBContainer2
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: ConstBContainer2 and index: 3
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "ConstBContainer2" subTypeIndex: 3 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1f60150
+HLTNavigation_test   INFO LINE:778 End of the test: const attach test
+HLTNavigation_test   INFO LINE:783 Start of the test: external_collection test
 ToolSvc.Navigation  DEBUG associateExternalCollection: of clid: 96422(TestBContainer) label: "external"
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: external
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: external and index: 4
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "external" subTypeIndex: 4 container not allocated yet
+NavigationCore      DEBUG Getting holder for type: 96422 label: external
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: external and index: 4
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "external" subTypeIndex: 4 container not allocated yet
 ToolSvc.Navigation  DEBUG associateExternalCollection: of clid: 96422(TestBContainer) label: "external"
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: external
-HLTNavigation_test   INFO LINE:790 End of the test: external_collection test
-HLTNavigation_test   INFO LINE:878 Test progress fine:  OK navigation tool retrieved
-HLTNavigation_test   INFO LINE:711 Start of the test: serialize test
-ToolSvc.Navigation  DEBUG serialization of feature: 6421 label: Single size of payload: 0
-ToolSvc.Navigation  DEBUG serialization of feature: 6421 label: ToolTestA size of payload: 7
-ToolSvc.Navigation  DEBUG serialization of feature: 6421 label: ToolB size of payload: 15
-ToolSvc.Navigation  DEBUG serialization of feature: 96422 label: Test1 size of payload: 22
-ToolSvc.Navigation  DEBUG serialization of feature: 96422 label: BContainer2 size of payload: 29
-ToolSvc.Navigation  DEBUG serialization of feature: 96422 label: ConstBContainer size of payload: 37
-ToolSvc.Navigation  DEBUG serialization of feature: 96422 label: ConstBContainer2 size of payload: 46
-ToolSvc.Navigation  DEBUG serialization of feature: 96422 label: external size of payload: 56
-ToolSvc.Navigation  DEBUG NavigationCore::serialize: serializing with version 4
-ToolSvc.Navigation  DEBUG serializes: TE serialization status: 1 size: 795
-ToolSvc.Navigation  DEBUG serialization done
-ToolSvc.Navigation  DEBUG total size of serialized navigation: 859
-HLTNavigation_test   INFO LINE:718 Test progress fine:  serialize/deserialze sequence worked
-HLTNavigation_test   INFO LINE:725 End of the test: serialize test
-HLTNavigation_test   INFO LINE:887 Test progress fine:  SUCCESS test passed OK 
+NavigationCore      DEBUG Getting holder for type: 96422 label: external
+HLTNavigation_test   INFO LINE:794 End of the test: external_collection test
+HLTNavigation_test   INFO LINE:882 Test progress fine:  OK navigation tool retrieved
+HLTNavigation_test   INFO LINE:715 Start of the test: serialize test
+NavigationCore      DEBUG serialization of feature: 6421 label: Single size of payload: 0
+NavigationCore      DEBUG serialization of feature: 6421 label: ToolTestA size of payload: 7
+NavigationCore      DEBUG serialization of feature: 6421 label: ToolB size of payload: 15
+NavigationCore      DEBUG serialization of feature: 96422 label: Test1 size of payload: 22
+NavigationCore      DEBUG serialization of feature: 96422 label: BContainer2 size of payload: 29
+NavigationCore      DEBUG serialization of feature: 96422 label: ConstBContainer size of payload: 37
+NavigationCore      DEBUG serialization of feature: 96422 label: ConstBContainer2 size of payload: 46
+NavigationCore      DEBUG serialization of feature: 96422 label: external size of payload: 56
+NavigationCore      DEBUG NavigationCore::serialize: serializing with version 4
+NavigationCore      DEBUG serializes: TE serialization status: 1 size: 795
+NavigationCore      DEBUG serialization done
+NavigationCore      DEBUG total size of serialized navigation: 859
+NavigationCore      DEBUG deserialize: deserializing input of size:  859
+NavigationCore      DEBUG deserialize: the serialized input has versions 4
+NavigationCore      DEBUG deserialize: deserialization of Navigation version: 4
+NavigationCore      DEBUG deserialize: TEs structure unpacked, status: 1
+NavigationCore      DEBUG do we have holder payload? 1
+NavigationCore      DEBUG deserializing holder blob of size: 6
+NavigationCore      DEBUG deserializing holder blob of size: 7
+NavigationCore      DEBUG deserializing holder blob of size: 6
+NavigationCore      DEBUG deserializing holder blob of size: 6
+NavigationCore      DEBUG deserializing holder blob of size: 7
+NavigationCore      DEBUG deserializing holder blob of size: 8
+NavigationCore      DEBUG deserializing holder blob of size: 9
+NavigationCore      DEBUG deserializing holder blob of size: 7
+HLTNavigation_test   INFO LINE:722 Test progress fine:  serialize/deserialze sequence worked
+HLTNavigation_test   INFO LINE:729 End of the test: serialize test
+HLTNavigation_test   INFO LINE:891 Test progress fine:  SUCCESS test passed OK 
diff --git a/Trigger/TrigEvent/TrigNavigation/share/Registration_test.ref b/Trigger/TrigEvent/TrigNavigation/share/Registration_test.ref
index 7b7843a9ca01766cf120218264f944ea2f02fda0..3472fd08b887205b8bce342fdd14a0df0868fb20 100644
--- a/Trigger/TrigEvent/TrigNavigation/share/Registration_test.ref
+++ b/Trigger/TrigEvent/TrigNavigation/share/Registration_test.ref
@@ -1,7 +1,7 @@
 
 
 Initializing Gaudi ApplicationMgr using job opts ../share/test.txt
-JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3e/Trigger/TrigEvent/TrigNavigation/share/../share/test.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/work/s/smh/MR_5043/athena/Trigger/TrigEvent/TrigNavigation/share/../share/test.txt
 JobOptionsSvc        INFO # (2,1): ApplicationMgr.DLLs += ["StoreGate", "TrigNavigation", "TrigSerializeCnvSvc"]
 JobOptionsSvc        INFO # (3,1): ApplicationMgr.ExtSvc += ["ClassIDSvc"]
 JobOptionsSvc        INFO # (4,1): ApplicationMgr.ExtSvc += ["TrigSerializeCnvSvc"]
@@ -12,27 +12,27 @@ JobOptionsSvc        INFO # (8,1): AuditorSvc.Auditors += ["AlgContextAuditor"]
 JobOptionsSvc        INFO # (9,1): StoreGateSvc.OutputLevel = 0
 JobOptionsSvc        INFO # (10,1): StoreGateSvc.ActivateHistory = 0
 JobOptionsSvc        INFO # (14,1): MessageSvc.useColors = 0
-JobOptionsSvc        INFO # (30,1): ToolSvc.Navigation.ReferenceAllClasses = 1
-JobOptionsSvc        INFO # (31,1): ToolSvc.Navigation.ClassesToPreregister = ["TestA#EverEmptyButPresent", "TestA#AgainPresentButEmpty", "TestA#", "TestBContainer#BContainer1", "TestBContainer#BContainer2", "TestDContainer#DContainer1"]
-JobOptionsSvc        INFO # (34,1): ToolSvc.Navigation.OutputLevel = 1
-JobOptionsSvc        INFO # (35,1): Holder_test.OutputLevel = 1
-JobOptionsSvc        INFO # (36,1): RoICache_test.OutputLevel = 3
+JobOptionsSvc        INFO # (15,1): MessageSvc.setDebug = ["NavigationCore"]
+JobOptionsSvc        INFO # (31,1): ToolSvc.Navigation.ReferenceAllClasses = 1
+JobOptionsSvc        INFO # (32,1): ToolSvc.Navigation.ClassesToPreregister = ["TestA#EverEmptyButPresent", "TestA#AgainPresentButEmpty", "TestA#", "TestBContainer#BContainer1", "TestBContainer#BContainer2", "TestDContainer#DContainer1"]
+JobOptionsSvc        INFO # (35,1): ToolSvc.Navigation.OutputLevel = 1
+JobOptionsSvc        INFO # (36,1): Holder_test.OutputLevel = 1
+JobOptionsSvc        INFO # (37,1): RoICache_test.OutputLevel = 1
 JobOptionsSvc        INFO Job options successfully read in from ../share/test.txt
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v4r1)
-                                          running on lxplus051.cern.ch on Tue Jul 19 18:33:48 2016
+                                          running on pc-tbed-pub-01.cern.ch on Sat Oct  7 17:04:22 2017
 ====================================================================================================================================
 ApplicationMgr       INFO Successfully loaded modules : StoreGate, TrigNavigation, TrigSerializeCnvSvc
 ApplicationMgr       INFO Application Manager Configured successfully
-ClassIDSvc           INFO Initializing ClassIDSvc - package version CLIDComps-00-06-20
-ClassIDSvc           INFO  getRegistryEntries: read 1319 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1369 CLIDRegistry entries for module ALL
 TrigSerializeCn...   INFO initialize()
 StoreGateSvc        DEBUG Service base class initialized successfully
 StoreGateSvc      VERBOSE ServiceLocatorHelper::service: found service EventPersistencySvc
 StoreGateSvc      VERBOSE ServiceLocatorHelper::service: found service ClassIDSvc
-ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-02-08
-ActiveStoreSvc       INFO Initializing ActiveStoreSvc - package version StoreGate-03-07-04
+ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
+ActiveStoreSvc       INFO Initializing ActiveStoreSvc - package version StoreGate-00-00-00
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
 HistogramPersis...WARNING Histograms saving not required.
@@ -40,7 +40,7 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 ToolSvc.Navigation  DEBUG Property update for OutputLevel : new value = 1
 ToolSvc.Navigation  DEBUG Navigation::initialize() got TrigSerializeCnvSvc
-ClassIDSvc           INFO  getRegistryEntries: read 343 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 357 CLIDRegistry entries for module ALL
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: EverEmptyButPresent
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: AgainPresentButEmpty
 ToolSvc.Navigation  DEBUG Recognized CLID : TestA and key: 
@@ -53,75 +53,18 @@ ToolSvc.NavigationVERBOSE type: TestBContainer(96422) container: TestBContainer(
 ToolSvc.NavigationVERBOSE type: TestBContainerView(96423) container: TestBContainerView(96423)label: "" subTypeIndex: 0 container not allocated yet
 ToolSvc.NavigationVERBOSE type: TestDContainer(96477) container: TestDContainer(96477)label: "" subTypeIndex: 0 container not allocated yet
 ToolSvc.Navigation  DEBUG  successfully initialized Navigation 
-ToolSvc.Navigation  DEBUG Navigation reset done
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Compile time known types : type: TestA(6421) container: DataVector<TestA>(64210)label: "" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Compile time known types : type: TestC(7800) container: DataVector<TestC>(78001)label: "" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Compile time known types : type: TestBContainer(96422) container: TestBContainer(96422)label: "" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Compile time known types : type: TestBContainerView(96423) container: TestBContainerView(96423)label: "" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Compile time known types : type: TestDContainer(96477) container: TestDContainer(96477)label: "" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE NavigationCore::prepare Preregistering objects #:6
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 6421 label: EverEmptyButPresent
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 6421 label: EverEmptyButPresent index: 0
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: EverEmptyButPresent and index: 0
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27c8d70 type: TestA(6421) container: DataVector<TestA>(64210)label: "EverEmptyButPresent" subTypeIndex: 0 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "EverEmptyButPresent" subTypeIndex: 0 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27c9360 with key HLT_DataVector<TestA>_EverEmptyButPresentAux. of type TestAuxA(CLID 642300)
- in DataObject @0x2725f90
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x27c7950 with key HLT_DataVector<TestA>_EverEmptyButPresent of type DataVector<TestA>(CLID 64210)
- in DataObject @0x27e2e70
- object modifiable when retrieved
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 6421 label: AgainPresentButEmpty
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 6421 label: AgainPresentButEmpty index: 1
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: AgainPresentButEmpty and index: 1
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27ca4f0 type: TestA(6421) container: DataVector<TestA>(64210)label: "AgainPresentButEmpty" subTypeIndex: 1 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "AgainPresentButEmpty" subTypeIndex: 1 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27e3d10 with key HLT_DataVector<TestA>_AgainPresentButEmptyAux. of type TestAuxA(CLID 642300)
- in DataObject @0x27c8ef0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x27ca0c0 with key HLT_DataVector<TestA>_AgainPresentButEmpty of type DataVector<TestA>(CLID 64210)
- in DataObject @0x27e3f90
- object modifiable when retrieved
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 6421 label: 
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 6421 label:  index: 2
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label:  and index: 2
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27e4320 type: TestA(6421) container: DataVector<TestA>(64210)label: "" subTypeIndex: 2 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "" subTypeIndex: 2 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27e4690 with key HLT_DataVector<TestA>Aux. of type TestAuxA(CLID 642300)
- in DataObject @0x27e49a0
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x27e4580 with key HLT_DataVector<TestA> of type DataVector<TestA>(CLID 64210)
- in DataObject @0x27e41f0
- object modifiable when retrieved
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 96422 label: BContainer1
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 96422 label: BContainer1 index: 0
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: BContainer1 and index: 0
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27e4f30 type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer1" subTypeIndex: 0 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer1" subTypeIndex: 0 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27e5450 with key HLT_TestBContainer_BContainer1Aux. of type TestAuxB(CLID 642311)
- in DataObject @0x27e5270
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x27e5340 with key HLT_TestBContainer_BContainer1 of type TestBContainer(CLID 96422)
- in DataObject @0x27e56f0
- object modifiable when retrieved
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 96422 label: BContainer2
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 96422 label: BContainer2 index: 1
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: BContainer2 and index: 1
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27e5f10 type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer2" subTypeIndex: 1 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer2" subTypeIndex: 1 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27e6380 with key HLT_TestBContainer_BContainer2Aux. of type TestAuxB(CLID 642311)
- in DataObject @0x27e6220
- object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x27e6270 with key HLT_TestBContainer_BContainer2 of type TestBContainer(CLID 96422)
- in DataObject @0x27e67a0
- object modifiable when retrieved
-ToolSvc.NavigationVERBOSE NavigationCore::prepare preregistering objects of clid: 96477 label: DContainer1
-ToolSvc.NavigationVERBOSE NavigationCore::prepare creating handler for type (CLID): 96477 label: DContainer1 index: 0
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96477 label: DContainer1 and index: 0
-ToolSvc.NavigationVERBOSE Holder created, registering 0x27e6c10 type: TestDContainer(96477) container: TestDContainer(96477)label: "DContainer1" subTypeIndex: 0 container not allocated yet
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestDContainer(96477) container: TestDContainer(96477)label: "DContainer1" subTypeIndex: 0 container not allocated yet
-StoreGateSvc        DEBUG Recorded object @0x27e7010 with key HLT_TestDContainer_DContainer1 of type TestDContainer(CLID 96477)
- in DataObject @0x27e6ed0
- object modifiable when retrieved
-ToolSvc.Navigation  DEBUG NavigationCore::prepare Navigation structure prepared for next event
-Registration_test    INFO LINE:96 Test progress fine:  Test finished
+NavigationCore      DEBUG Navigation reset done
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: EverEmptyButPresent and index: 0
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "EverEmptyButPresent" subTypeIndex: 0 container not allocated yet
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: AgainPresentButEmpty and index: 1
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "AgainPresentButEmpty" subTypeIndex: 1 container not allocated yet
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label:  and index: 2
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "" subTypeIndex: 2 container not allocated yet
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: BContainer1 and index: 0
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer1" subTypeIndex: 0 container not allocated yet
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: BContainer2 and index: 1
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "BContainer2" subTypeIndex: 1 container not allocated yet
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96477 label: DContainer1 and index: 0
+NavigationCore      DEBUG registerHolder for OK type: TestDContainer(96477) container: TestDContainer(96477)label: "DContainer1" subTypeIndex: 0 container not allocated yet
+NavigationCore      DEBUG NavigationCore::prepare Navigation structure prepared for next event
+Registration_test    INFO LINE:100 Test progress fine:  Test finished
diff --git a/Trigger/TrigEvent/TrigNavigation/share/RoICache_test.ref b/Trigger/TrigEvent/TrigNavigation/share/RoICache_test.ref
index 0463952708554c54cd89b7f96c3916f36fbeae12..c9ecdfb25bad551f0f553134dfa01c6456643b8d 100644
--- a/Trigger/TrigEvent/TrigNavigation/share/RoICache_test.ref
+++ b/Trigger/TrigEvent/TrigNavigation/share/RoICache_test.ref
@@ -3,7 +3,7 @@ RoICache_test        INFO LINE:81 Start of the test: RoIcaching test
 
 
 Initializing Gaudi ApplicationMgr using job opts ../share/test2.txt
-JobOptionsSvc        INFO # =======> /afs/cern.ch/user/t/tbold/workarea/ATR-16158/athena/Trigger/TrigEvent/TrigNavigation/share/../share/test2.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/work/s/smh/MR_5043/athena/Trigger/TrigEvent/TrigNavigation/share/../share/test2.txt
 JobOptionsSvc        INFO # (2,1): ApplicationMgr.DLLs += ["StoreGate", "TrigNavigation", "TrigSerializeCnvSvc"]
 JobOptionsSvc        INFO # (3,1): ApplicationMgr.ExtSvc += ["ClassIDSvc"]
 JobOptionsSvc        INFO # (4,1): ApplicationMgr.ExtSvc += ["TrigSerializeCnvSvc"]
@@ -14,14 +14,15 @@ JobOptionsSvc        INFO # (8,1): AuditorSvc.Auditors += ["AlgContextAuditor"]
 JobOptionsSvc        INFO # (9,1): StoreGateSvc.OutputLevel = 1
 JobOptionsSvc        INFO # (10,1): StoreGateSvc.ActivateHistory = 0
 JobOptionsSvc        INFO # (14,1): MessageSvc.useColors = 0
-JobOptionsSvc        INFO # (30,1): ToolSvc.Navigation.ReferenceAllClasses = 1
-JobOptionsSvc        INFO # (36,1): ToolSvc.Navigation.OutputLevel = 1
-JobOptionsSvc        INFO # (37,1): Holder_test.OutputLevel = 1
+JobOptionsSvc        INFO # (15,1): MessageSvc.setDebug = ["NavigationCore"]
+JobOptionsSvc        INFO # (31,1): ToolSvc.Navigation.ReferenceAllClasses = 1
+JobOptionsSvc        INFO # (37,1): ToolSvc.Navigation.OutputLevel = 1
+JobOptionsSvc        INFO # (38,1): Holder_test.OutputLevel = 1
 JobOptionsSvc        INFO Job options successfully read in from ../share/test2.txt
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v4r1)
-                                          running on lxplus058.cern.ch on Fri Apr 21 08:37:06 2017
+                                          running on pc-tbed-pub-09.cern.ch on Fri Oct  6 16:23:23 2017
 ====================================================================================================================================
 ApplicationMgr       INFO Successfully loaded modules : StoreGate, TrigNavigation, TrigSerializeCnvSvc
 ApplicationMgr       INFO Application Manager Configured successfully
@@ -38,8 +39,8 @@ EventLoopMgr      WARNING No events will be processed from external input.
 HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
-RoICache_test        INFO LINE:94 Test progress fine:  SG pointer: 0x1ea9a70
-RoICache_test        INFO LINE:102 Test progress fine:  ToolSvc pointer obtained: 0x1eae760
+RoICache_test        INFO LINE:94 Test progress fine:  SG pointer: 0x1c4b8e0
+RoICache_test        INFO LINE:102 Test progress fine:  ToolSvc pointer obtained: 0x1c506d0
 ToolSvc.Navigation  DEBUG Property update for OutputLevel : new value = 1
 ToolSvc.Navigation  DEBUG Navigation::initialize() got TrigSerializeCnvSvc
 ToolSvc.NavigationVERBOSE type: TestA(6421) container: DataVector<TestA>(64210)label: "" subTypeIndex: 0 container not allocated yet
@@ -50,31 +51,31 @@ ToolSvc.NavigationVERBOSE type: TestDContainer(96477) container: TestDContainer(
 ToolSvc.Navigation  DEBUG  successfully initialized Navigation 
 RoICache_test        INFO LINE:110 Test progress fine:  OK navigation tool retrieved
 RoICache_test        INFO LINE:113 Test progress fine:  OK navigation casted
-ToolSvc.Navigation  DEBUG Navigation reset done
+NavigationCore      DEBUG Navigation reset done
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 0 label: "initialRoI" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: initialRoI
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: initialRoI
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: initialRoI and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "initialRoI" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f7f3f0
+NavigationCore      DEBUG Getting holder for type: 6421 label: initialRoI
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: initialRoI and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "initialRoI" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d1fa40
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 0 label: "initialRoI" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: initialRoI
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: initialRoI
-ToolSvc.NavigationVERBOSE got Holder: 0x1f7f3f0
+NavigationCore      DEBUG Getting holder for type: 6421 label: initialRoI
+ToolSvc.NavigationVERBOSE got Holder: 0x1d1fa40
 RoICache_test        INFO LINE:157 Test progress fine:  Navigation structure built
 RoICache_test:calo   INFO LINE:38 Start of the test: One algorithm test calo
 RoICache_test:calo   INFO REGTEST executing on 11
 RoICache_test:calo   INFO REGTEST REAL execution needed on 11
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 11 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 11 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 11 label: "made_by_calo" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_calo
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: made_by_calo
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: made_by_calo and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "made_by_calo" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f83030
+NavigationCore      DEBUG Getting holder for type: 96422 label: made_by_calo
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: made_by_calo and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "made_by_calo" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d23750
 RoICache_test:calo   INFO LINE:60 End of the test: One algorithm test calo
 RoICache_test:calo   INFO LINE:38 Start of the test: One algorithm test calo
 RoICache_test:calo   INFO REGTEST executing on 12
@@ -91,26 +92,26 @@ RoICache_test:calo   INFO LINE:60 End of the test: One algorithm test calo
 RoICache_test:calo   INFO LINE:38 Start of the test: One algorithm test calo
 RoICache_test:calo   INFO REGTEST executing on 1200
 RoICache_test:calo   INFO REGTEST REAL execution needed on 1200
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 1200 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 1200 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 1200 label: "made_by_calo" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_calo
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: made_by_calo
-ToolSvc.NavigationVERBOSE got Holder: 0x1f83030
+NavigationCore      DEBUG Getting holder for type: 96422 label: made_by_calo
+ToolSvc.NavigationVERBOSE got Holder: 0x1d23750
 RoICache_test:calo   INFO LINE:60 End of the test: One algorithm test calo
 RoICache_test        INFO LINE:182 Test progress fine:  Executed calo on clusters
 RoICache_test:caux   INFO LINE:38 Start of the test: One algorithm test caux
 RoICache_test:caux   INFO REGTEST executing on 13
 RoICache_test:caux   INFO REGTEST REAL execution needed on 13
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 13 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 96422(TestBContainer) in TE: 13 label: ""
+NavigationCore      DEBUG Getting holder for type: 96422
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 6421(TestA) to TE: 13 label: "refined_by_aux" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: refined_by_aux
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421 label: refined_by_aux
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 6421 label: refined_by_aux and index: 1
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "refined_by_aux" subTypeIndex: 1 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f85d50
+NavigationCore      DEBUG Getting holder for type: 6421 label: refined_by_aux
+NavigationCore      DEBUG createHolder: creating holder for CLID: 6421 label: refined_by_aux and index: 1
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestA(6421) container: DataVector<TestA>(64210)label: "refined_by_aux" subTypeIndex: 1 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d26380
 RoICache_test:caux   INFO LINE:60 End of the test: One algorithm test caux
 RoICache_test:caux   INFO LINE:38 Start of the test: One algorithm test caux
 RoICache_test:caux   INFO REGTEST executing on 14
@@ -119,16 +120,16 @@ RoICache_test:caux   INFO LINE:60 End of the test: One algorithm test caux
 RoICache_test:c...   INFO LINE:38 Start of the test: One algorithm test calo2
 RoICache_test:c...   INFO REGTEST executing on 14
 RoICache_test:c...   INFO REGTEST REAL execution needed on 14
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 14 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 14 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
 RoICache_test        INFO LINE:214 Test progress fine:  got back object -38
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 14 label: "made_by_calo2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_calo2
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: made_by_calo2
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96422 label: made_by_calo2 and index: 1
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "made_by_calo2" subTypeIndex: 1 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f87a10
+NavigationCore      DEBUG Getting holder for type: 96422 label: made_by_calo2
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96422 label: made_by_calo2 and index: 1
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestBContainer(96422) container: TestBContainer(96422)label: "made_by_calo2" subTypeIndex: 1 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d28060
 RoICache_test:c...   INFO LINE:60 End of the test: One algorithm test calo2
 RoICache_test:c...   INFO LINE:38 Start of the test: One algorithm test calo2
 RoICache_test:c...   INFO REGTEST executing on 13
@@ -137,13 +138,13 @@ RoICache_test:c...   INFO LINE:60 End of the test: One algorithm test calo2
 RoICache_test:c...   INFO LINE:38 Start of the test: One algorithm test calo2
 RoICache_test:c...   INFO REGTEST executing on 12
 RoICache_test:c...   INFO REGTEST REAL execution needed on 12
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 12 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 12 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
 RoICache_test        INFO LINE:214 Test progress fine:  got back object -34
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 12 label: "made_by_calo2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_calo2
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: made_by_calo2
-ToolSvc.NavigationVERBOSE got Holder: 0x1f87a10
+NavigationCore      DEBUG Getting holder for type: 96422 label: made_by_calo2
+ToolSvc.NavigationVERBOSE got Holder: 0x1d28060
 RoICache_test:c...   INFO LINE:60 End of the test: One algorithm test calo2
 RoICache_test:c...   INFO LINE:38 Start of the test: One algorithm test calo2
 RoICache_test:c...   INFO REGTEST executing on 11
@@ -152,28 +153,28 @@ RoICache_test:c...   INFO LINE:60 End of the test: One algorithm test calo2
 RoICache_test:c...   INFO LINE:38 Start of the test: One algorithm test calo2
 RoICache_test:c...   INFO REGTEST executing on 1200
 RoICache_test:c...   INFO REGTEST REAL execution needed on 1200
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 1200 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 1200 label: ""
+NavigationCore      DEBUG Getting holder for type: 6421
 RoICache_test        INFO LINE:214 Test progress fine:  got back object -34
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96422(TestBContainer) to TE: 1200 label: "made_by_calo2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_calo2
-ToolSvc.Navigation  DEBUG Getting holder for type: 96422 label: made_by_calo2
-ToolSvc.NavigationVERBOSE got Holder: 0x1f87a10
+NavigationCore      DEBUG Getting holder for type: 96422 label: made_by_calo2
+ToolSvc.NavigationVERBOSE got Holder: 0x1d28060
 RoICache_test:c...   INFO LINE:60 End of the test: One algorithm test calo2
 RoICache_test        INFO LINE:232 Test progress fine:  Executed c2 on clusters
 RoICache_test:trk    INFO LINE:38 Start of the test: One algorithm test trk
 RoICache_test:trk    INFO REGTEST executing on 102
 RoICache_test:trk    INFO REGTEST REAL execution needed on 102
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 102 label: "initialRoI"
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 102 label: "initialRoI"
+NavigationCore      DEBUG Getting holder for type: 6421
 RoICache_test        INFO LINE:255 Test progress fine:  got back object -34
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 7800(TestC) to TE: 102 label: "made_by_trk" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_trk
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800 label: made_by_trk
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 7800 label: made_by_trk and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestC(7800) container: DataVector<TestC>(78001)label: "made_by_trk" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8b440
+NavigationCore      DEBUG Getting holder for type: 7800 label: made_by_trk
+NavigationCore      DEBUG createHolder: creating holder for CLID: 7800 label: made_by_trk and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestC(7800) container: DataVector<TestC>(78001)label: "made_by_trk" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2ba90
 RoICache_test:trk    INFO LINE:60 End of the test: One algorithm test trk
 RoICache_test:trk    INFO LINE:38 Start of the test: One algorithm test trk
 RoICache_test:trk    INFO REGTEST executing on 104
@@ -190,46 +191,46 @@ RoICache_test:trk    INFO LINE:60 End of the test: One algorithm test trk
 RoICache_test:trk    INFO LINE:38 Start of the test: One algorithm test trk
 RoICache_test:trk    INFO REGTEST executing on 10100
 RoICache_test:trk    INFO REGTEST REAL execution needed on 10100
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 10100 label: "initialRoI"
-ToolSvc.Navigation  DEBUG Getting holder for type: 6421
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 6421(TestA) in TE: 10100 label: "initialRoI"
+NavigationCore      DEBUG Getting holder for type: 6421
 RoICache_test        INFO LINE:255 Test progress fine:  got back object -34
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 7800(TestC) to TE: 10100 label: "made_by_trk" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_trk
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800 label: made_by_trk
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8b440
+NavigationCore      DEBUG Getting holder for type: 7800 label: made_by_trk
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2ba90
 RoICache_test:trk    INFO LINE:60 End of the test: One algorithm test trk
 RoICache_test        INFO LINE:272 Test progress fine:  Executed trk
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 7800(TestC) to TE: 101 label: "made_by_tr2" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_tr2
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800 label: made_by_tr2
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 7800 label: made_by_tr2 and index: 1
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestC(7800) container: DataVector<TestC>(78001)label: "made_by_tr2" subTypeIndex: 1 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8b030
+NavigationCore      DEBUG Getting holder for type: 7800 label: made_by_tr2
+NavigationCore      DEBUG createHolder: creating holder for CLID: 7800 label: made_by_tr2 and index: 1
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestC(7800) container: DataVector<TestC>(78001)label: "made_by_tr2" subTypeIndex: 1 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2b680
 RoICache_test:m...   INFO LINE:38 Start of the test: One algorithm test matcher
 RoICache_test:m...   INFO REGTEST executing on 1001
 RoICache_test:m...   INFO REGTEST REAL execution needed on 1001
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 1001 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 1001 label: ""
+NavigationCore      DEBUG Getting holder for type: 7800
 RoICache_test        INFO LINE:299 Test progress fine:  got back object 55
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96477(TestDContainer) to TE: 1001 label: "made_by_ma" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_ma
-ToolSvc.Navigation  DEBUG Getting holder for type: 96477 label: made_by_ma
-ToolSvc.Navigation  DEBUG createHolder: creating holder for CLID: 96477 label: made_by_ma and index: 0
-ToolSvc.Navigation  DEBUG getHolder: predefined holder got
-ToolSvc.Navigation  DEBUG registerHolder for OK type: TestDContainer(96477) container: TestDContainer(96477)label: "made_by_ma" subTypeIndex: 0 container not allocated yet
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8db40
+NavigationCore      DEBUG Getting holder for type: 96477 label: made_by_ma
+NavigationCore      DEBUG createHolder: creating holder for CLID: 96477 label: made_by_ma and index: 0
+NavigationCore      DEBUG getHolder: predefined holder got
+NavigationCore      DEBUG registerHolder for OK type: TestDContainer(96477) container: TestDContainer(96477)label: "made_by_ma" subTypeIndex: 0 container not allocated yet
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2e120
 RoICache_test:m...   INFO LINE:60 End of the test: One algorithm test matcher
 RoICache_test:m...   INFO LINE:38 Start of the test: One algorithm test matcher
 RoICache_test:m...   INFO REGTEST executing on 1002
 RoICache_test:m...   INFO REGTEST REAL execution needed on 1002
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 1002 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 1002 label: ""
+NavigationCore      DEBUG Getting holder for type: 7800
 RoICache_test        INFO LINE:299 Test progress fine:  got back object 77
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96477(TestDContainer) to TE: 1002 label: "made_by_ma" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_ma
-ToolSvc.Navigation  DEBUG Getting holder for type: 96477 label: made_by_ma
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8db40
+NavigationCore      DEBUG Getting holder for type: 96477 label: made_by_ma
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2e120
 RoICache_test:m...   INFO LINE:60 End of the test: One algorithm test matcher
 RoICache_test:m...   INFO LINE:38 Start of the test: One algorithm test matcher
 RoICache_test:m...   INFO REGTEST executing on 1003
@@ -242,19 +243,19 @@ RoICache_test:m...   INFO LINE:60 End of the test: One algorithm test matcher
 RoICache_test:m...   INFO LINE:38 Start of the test: One algorithm test matcher
 RoICache_test:m...   INFO REGTEST executing on 100100
 RoICache_test:m...   INFO REGTEST REAL execution needed on 100100
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 100100 label: ""
-ToolSvc.Navigation  DEBUG Getting holder for type: 7800
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 7800(TestC) in TE: 100100 label: ""
+NavigationCore      DEBUG Getting holder for type: 7800
 RoICache_test        INFO LINE:299 Test progress fine:  got back object 77
 ToolSvc.Navigation  DEBUG attachFeature: of clid: 96477(TestDContainer) to TE: 100100 label: "made_by_ma" memory management: 3
 ToolSvc.NavigationVERBOSE getting Holder for label: made_by_ma
-ToolSvc.Navigation  DEBUG Getting holder for type: 96477 label: made_by_ma
-ToolSvc.NavigationVERBOSE got Holder: 0x1f8db40
+NavigationCore      DEBUG Getting holder for type: 96477 label: made_by_ma
+ToolSvc.NavigationVERBOSE got Holder: 0x1d2e120
 RoICache_test:m...   INFO LINE:60 End of the test: One algorithm test matcher
 RoICache_test        INFO LINE:317 Test progress fine:  Executed ma on electron TEs
 RoICache_test:o...   INFO LINE:38 Start of the test: One algorithm test overlap
 RoICache_test:o...   INFO REGTEST executing on 222
 RoICache_test:o...   INFO REGTEST REAL execution needed on 222
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 96477(TestDContainer) in TE: 222 label: ""
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 96477(TestDContainer) in TE: 222 label: ""
 RoICache_test:o...   INFO LINE:60 End of the test: One algorithm test overlap
 RoICache_test:o...   INFO LINE:38 Start of the test: One algorithm test overlap
 RoICache_test:o...   INFO REGTEST executing on 223
@@ -263,7 +264,7 @@ RoICache_test:o...   INFO LINE:60 End of the test: One algorithm test overlap
 RoICache_test:o...   INFO LINE:38 Start of the test: One algorithm test overlap
 RoICache_test:o...   INFO REGTEST executing on 224
 RoICache_test:o...   INFO REGTEST REAL execution needed on 224
-ToolSvc.Navigation  DEBUG getRecentFeature: looking for CLID: 96477(TestDContainer) in TE: 224 label: ""
+NavigationCore      DEBUG getRecentFeature: looking for CLID: 96477(TestDContainer) in TE: 224 label: ""
 RoICache_test:o...   INFO LINE:60 End of the test: One algorithm test overlap
 RoICache_test        INFO LINE:357 Test progress fine:  Executed on topo TEs
 RoICache_test        INFO LINE:358 Test progress fine:  ALLOK
diff --git a/Trigger/TrigEvent/TrigNavigation/share/test.txt b/Trigger/TrigEvent/TrigNavigation/share/test.txt
index e75da4415a8362a25254b4d32681827b622ebf2e..693834078ea34f967e12fca0578edf4bba59bfbc 100644
--- a/Trigger/TrigEvent/TrigNavigation/share/test.txt
+++ b/Trigger/TrigEvent/TrigNavigation/share/test.txt
@@ -12,6 +12,7 @@ StoreGateSvc.ActivateHistory = false;
 //ClassIDSvc.OutputLevel = 1;
 //MessageSvc.OutputLevel = 1;
 MessageSvc.useColors        = false;
+MessageSvc.setDebug = {"NavigationCore"};
 
 //StoreGateSvc.FolderNameList = { "MyFolder", "YourFolder" };
 //MyFolder.ItemList = {"Foo#Bla", "Bar#*"};
@@ -33,4 +34,4 @@ ToolSvc.Navigation.ClassesToPreregister = {"TestA#EverEmptyButPresent", "TestA#A
 
 ToolSvc.Navigation.OutputLevel=1;
 Holder_test.OutputLevel=1;
-RoICache_test.OutputLevel=3;
+RoICache_test.OutputLevel=1;
diff --git a/Trigger/TrigEvent/TrigNavigation/share/test2.txt b/Trigger/TrigEvent/TrigNavigation/share/test2.txt
index 8984ee62c20d9e82493c13abaa0922bf3e4028bf..f69d8d84624a449041e301fd35983a71fc5888ef 100755
--- a/Trigger/TrigEvent/TrigNavigation/share/test2.txt
+++ b/Trigger/TrigEvent/TrigNavigation/share/test2.txt
@@ -12,6 +12,7 @@ StoreGateSvc.ActivateHistory = false;
 //ClassIDSvc.OutputLevel = 1;
 //MessageSvc.OutputLevel = 1;
 MessageSvc.useColors        = false;
+MessageSvc.setDebug = {"NavigationCore"};
 
 //StoreGateSvc.FolderNameList = { "MyFolder", "YourFolder" };
 //MyFolder.ItemList = {"Foo#Bla", "Bar#*"};
diff --git a/Trigger/TrigEvent/TrigNavigation/src/Navigation.cxx b/Trigger/TrigEvent/TrigNavigation/src/Navigation.cxx
index f9ab204c23ffe83d7ec266a52159a4e4bf1b0c48..f2a0d0a59ff1ce5473fc3c8296870fe71917edf7 100644
--- a/Trigger/TrigEvent/TrigNavigation/src/Navigation.cxx
+++ b/Trigger/TrigEvent/TrigNavigation/src/Navigation.cxx
@@ -57,27 +57,20 @@ Navigation::~Navigation() {
  *
  *****************************************************************************/
 StatusCode Navigation::initialize() {
-  // message log
-  delete m_log;
-  m_log = new MsgStream(msgSvc(), name() );
 
  // get StoreGate
   StatusCode sc = m_storeGateHandle.retrieve();
   if(sc.isFailure()) {
-    (*m_log) << MSG::FATAL << "Unable to get pointer to StoreGate Service: "
-             << m_storeGateHandle << endreq;
+    ATH_MSG_FATAL("Unable to get pointer to StoreGate Service: " << m_storeGateHandle);
     return StatusCode::FAILURE;
   }
   m_storeGate = m_storeGateHandle.operator->();
 
   StatusCode scnv = m_serializerServiceHandle.retrieve();
   if (scnv.isFailure()){
-    *m_log << MSG::FATAL << "Navigation::initialize() cannot get TrigSerializeCnvSvc"
-           << endreq;
+    ATH_MSG_FATAL("Navigation::initialize() cannot get TrigSerializeCnvSvc");
   } else {
-    if (m_log->level() <= MSG::DEBUG )
-      *m_log << MSG::DEBUG << "Navigation::initialize() got TrigSerializeCnvSvc"
-             << endreq;
+    ATH_MSG_DEBUG("Navigation::initialize() got TrigSerializeCnvSvc");
   }
   m_serializerSvc = m_serializerServiceHandle.operator->();
 
@@ -88,14 +81,12 @@ StatusCode Navigation::initialize() {
 
   // payload def
   if ( classKey2CLIDKey(m_classesToPayloadProperty,  m_classesToPayload).isFailure() ) {
-    (*m_log) << MSG::FATAL << "failed to decode property ClassesToPayload: "
-             << m_classesToPayloadProperty << endreq;
+    ATH_MSG_FATAL("failed to decode property ClassesToPayload: " << m_classesToPayloadProperty);
     return  StatusCode::FAILURE;
   }
 
   if ( classKey2CLIDKey(m_classesToPayloadProperty_DSonly,  m_classesToPayload_DSonly).isFailure() ) {
-    (*m_log) << MSG::FATAL << "failed to decode property ClassesToPayload: " 
-	     << m_classesToPayloadProperty_DSonly << endreq;
+    ATH_MSG_FATAL("failed to decode property ClassesToPayload: " << m_classesToPayloadProperty_DSonly);
     
     return  StatusCode::FAILURE;
   }
@@ -105,25 +96,24 @@ StatusCode Navigation::initialize() {
     CLID cl = m_classesToPayload.at(icl).first;
     StatusCode stmp = m_serializerSvc->addConverter(cl);
     if (stmp.isFailure())
-      *m_log << MSG::WARNING << "Initialization of a converter for CLID=" << cl << " failed" << endreq;
+      ATH_MSG_WARNING("Initialization of a converter for CLID=" << cl << " failed");
   }
 
 
   // preregistration def
   if ( classKey2CLIDKey(m_classesToPreregisterProperty,  m_classesToPreregister).isFailure() ) {
-    (*m_log) << MSG::FATAL << "failed to decode property ClassesToPreregister: "
-             << m_classesToPreregisterProperty << endreq;
+    ATH_MSG_FATAL("failed to decode property ClassesToPreregister: " << m_classesToPreregisterProperty);
     return  StatusCode::FAILURE;
   }
 
   // print out registered holders
   HLT::TypeMaps::CLIDtoHolderMap::const_iterator holderIt;
-  if (m_log->level() <= MSG::VERBOSE ) {
+  if (msgLvl(MSG::VERBOSE) ) {
     for ( holderIt = HLT::TypeMaps::holders().begin(); holderIt != HLT::TypeMaps::holders().end(); ++holderIt ) {
       if(!holderIt->second){
-	(*m_log) << MSG::FATAL << "static type information not intialized. Holder is null pointer" << endreq;
+        ATH_MSG_FATAL("static type information not intialized. Holder is null pointer");
       }
-      (*m_log) << MSG::VERBOSE << *(holderIt->second) << endreq;
+      ATH_MSG_VERBOSE(*(holderIt->second));
     }
   }
 
@@ -132,17 +122,14 @@ StatusCode Navigation::initialize() {
   for ( dlIt = m_dlls.begin(); dlIt != m_dlls.end(); ++dlIt ) {
     System::ImageHandle handle = 0;
     if ( System::loadDynamicLib( *dlIt, &handle)  != 1 ) {
-      (*m_log) << MSG::WARNING << "failed to load " << *dlIt << endreq;
+      ATH_MSG_WARNING("failed to load " << *dlIt);
     } else {
-      if (m_log->level() <= MSG::DEBUG )
-        (*m_log) << MSG::DEBUG << "forcibly loaded library " << *dlIt << endreq;
+        ATH_MSG_DEBUG("forcibly loaded library " << *dlIt);
     }
   }
 
   // translate Class names into CLID numbers
-  if (m_log->level() <= MSG::DEBUG )
-    (*m_log) << MSG::DEBUG << " successfully initialized Navigation "
-             << endreq;
+  ATH_MSG_DEBUG(" successfully initialized Navigation ");
 
   return StatusCode::SUCCESS;
 }
@@ -168,14 +155,11 @@ Navigation::classKey2CLIDKey(const std::vector<std::string> property,
     }
 
     if ( m_clidSvc->getIDOfTypeName(type, clid).isFailure() ) {
-      (*m_log) << MSG::FATAL << "Unable to get CLID for class: " << *it
-               << " check property" << endreq;
+      ATH_MSG_FATAL("Unable to get CLID for class: " << *it << " check property");
       return StatusCode::FAILURE;
     }
 
-    if (m_log->level() <= MSG::DEBUG )
-      (*m_log) << MSG::DEBUG << "Recognized CLID : " << type << " and key: " << key
-               << endreq;
+      ATH_MSG_DEBUG("Recognized CLID : " << type << " and key: " << key);
 
     decoded.push_back(std::make_pair(clid, key));
   }
@@ -183,8 +167,7 @@ Navigation::classKey2CLIDKey(const std::vector<std::string> property,
 }
 
 StatusCode Navigation::finalize() {
-  if (m_log->level() <= MSG::DEBUG )
-    *m_log << MSG::DEBUG << "Navigation finalize" << endreq;
+    ATH_MSG_DEBUG("Navigation finalize");
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigEvent/TrigNavigation/src/NavigationCore.cxx b/Trigger/TrigEvent/TrigNavigation/src/NavigationCore.cxx
index 45f9458afdb2455fe2bdeb97fd21e35d598d513c..95c1e3e7b0c8d2967074f72910f690fcbed006e7 100644
--- a/Trigger/TrigEvent/TrigNavigation/src/NavigationCore.cxx
+++ b/Trigger/TrigEvent/TrigNavigation/src/NavigationCore.cxx
@@ -380,12 +380,12 @@ void NavigationCore::prepare() {
 bool NavigationCore::registerHolder(IHolder* holder) {
   auto shared_holder = std::shared_ptr<HLT::BaseHolder>(holder);
   m_holderstorage.registerHolder(shared_holder);
-  *m_log << MSG::DEBUG <<  "registerHolder for OK " << *holder << endreq;
+  MLOG(DEBUG) <<  "registerHolder for OK " << *holder << endreq;
   return true;
 }
 
 bool NavigationCore::createHolder( IHolder*& holder,  CLID clid, const std::string& label, uint16_t index) {
-  *m_log << MSG::DEBUG << "createHolder: creating holder for CLID: " << clid  << " label: " << label << " and index: " << index << endreq;
+  MLOG(DEBUG) << "createHolder: creating holder for CLID: " << clid  << " label: " << label << " and index: " << index << endreq;
   //reset holder
   holder = 0;
   auto baseholder = m_holderfactory->createHolder(clid,label, index);
diff --git a/Trigger/TrigEvent/TrigSteeringEvent/Root/Enums.cxx b/Trigger/TrigEvent/TrigSteeringEvent/Root/Enums.cxx
index d383c2f10ccc9f308da6ccbfbbe3476902054db4..c94eddc7af2f10d3b0ce3b9dd660f221d4b1fe00 100644
--- a/Trigger/TrigEvent/TrigSteeringEvent/Root/Enums.cxx
+++ b/Trigger/TrigEvent/TrigSteeringEvent/Root/Enums.cxx
@@ -64,6 +64,9 @@ namespace HLTEnums {
 						       "TIMEOUT",
 						       "BUSY",
 						       "BAD_JOB_SETUP",
+                               "MISSING_CALO_ROI",
+                               "MISSING_MUON_ROI",
+                               "MISSING_OTHER_ROI",
 						       "LAST_"};
 }
 
diff --git a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h
index 5fde356159d2d2042e58b45c82cb28a595b29559..3b9f1fbdb20aa36da508328946b8225db184edc3 100644
--- a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h
+++ b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h
@@ -60,6 +60,9 @@ namespace HLT {
       TIMEOUT,          //!< timeout forced by the steering
       BUSY,             //!< to flag that the event was busy
       BAD_JOB_SETUP,    //!< job is badly configured
+      MISSING_CALO_ROI, //!< one ore more missing CALO RoIs
+      MISSING_MUON_ROI, //!< one ore more missing MUON RoIs
+      MISSING_OTHER_ROI,//!< one ore more missing RoI except CALO/MUON (e.g. MBTS, NIM, ...)
       LAST_,            //!< there is basically no restriction on size since these errors are not saved per chain so do not need to be serialized in 6 bits.
       UNSPECIFIED_ = -1 //!< do not use
     } Code;
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/CMakeLists.txt b/Trigger/TrigFTK/FTKStandaloneMonitoring/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..486eb00df2a544ffd7ad635f30c067b6ed02ba39
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/CMakeLists.txt
@@ -0,0 +1,29 @@
+atlas_subdir(FTKStandaloneMonitoring)
+
+atlas_depends_on_subdirs( PUBLIC
+                          Event/ByteStreamData
+                          Trigger/TrigFTK/TrigFTK_RawData
+			  Trigger/TrigAnalysis/TrigInDetAnalysis
+			  Trigger/TrigAnalysis/TrigInDetAnalysisUtils
+                          PRIVATE
+                          Trigger/TrigFTK/TrigFTKSim
+                          )
+
+# External dependencies:
+find_package( tdaq-common COMPONENTS eformat_write ) 
+find_package( tdaq COMPONENTS rc_RunController ipc omnithread omniORB4 rc RunControl rc_OnlSvc ohroot )
+
+atlas_add_library(FTKStandaloneMonitoring
+                  src/*.cxx
+                  PUBLIC_HEADERS FTKStandaloneMonitoring
+                  PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${TDAQ_INCLUDE_DIRS}
+                  LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${TDAQ_LIBRARIES}  ByteStreamData   TrigFTK_RawData TrigFTKSimLib TrigInDetAnalysisUtils TrigInDetAnalysis TrigFTK_RawData
+                  PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+
+atlas_add_executable(MonitoringFTKHWSWComparison
+                     test/MonitoringComparison.cxx
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${TDAQ_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES}  ${TDAQ_LIBRARIES} ByteStreamData TrigFTK_RawData TrigFTKSimLib TrigInDetAnalysisUtils TrigInDetAnalysis TrigFTK_RawData FTKStandaloneMonitoring
+		     )
+
+atlas_install_headers( FTKStandaloneMonitoring )
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKEvents.h b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKEvents.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad0c7c674193d196c07701dd006de9c9a9db849c
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKEvents.h
@@ -0,0 +1,181 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+////////////////////////////////////////////////////////////////////
+///
+/// This class aims to get the event-by-event comparison
+/// of two files one containing HW FTK tracks (BS/RAW file)
+/// the other containing simulated (SW) FTK tracks (NTUP_FTK file)
+/// The comparison output consits of histograms published on OH,
+/// if the partition is set-up, or by histograms saved in the 
+/// out.histo.root file.
+///
+/// There are 4 types of histograms:
+/// HWSW*: if HW and SW tracks are completely matched, i.e. have the same track parameters within 0.1% of relative error
+/// 	  the distrubutions of the track paramters (like pt, eta, ...) are displayed in the histograms
+/// HWonly*: if HW tracks do not have SW tracks within m_dmax=0.2, 
+/// 	    the distrubutions of these HW track paramters (like pt, eta, ...) are displayed in the histograms
+/// SWonly*: if SW tracks do not have HW tracks within m_dmax=0.2, 
+/// 	    the distrubutions of these SW track paramters (like pt, eta, ...) are displayed in the histograms
+/// HWvsSW: if HW and SW tracks are not completely matched, 
+/// 	    i.e. they are geometrically closed but do not have the same track parameters
+/// 	    these histograms in turn are divided into :
+/// 	    HWvsSWsw*: the distrubutions of the SW track paramters (like pt, eta, ...) are displayed in the histograms
+/// 	    HWvsSWhw*: the distrubutions of the HW track paramters (like pt, eta, ...) are displayed in the histograms
+/// 	    HWvsSWdiff*: the distrubutions of the difference btw the HW and SW track paramters (like pt, eta, ...) 
+/// 			 are displayed in the histograms
+/// other general histos are 
+/// nTrk_SW: number of SW tracks per event
+/// nTrk_HW: number of HW tracks per event
+///
+////////////////////////////////////////////////////////////////////
+
+#ifndef __CompareFTKEvents__
+#define __CompareFTKEvents__
+
+
+#include <iostream>
+#include <fstream>
+
+#include <getopt.h>
+#include <vector>
+#include <cmath>
+#include "TTree.h"
+#include "TFile.h"
+
+
+#include "ByteStreamData/RawEvent.h"
+#include "TrigFTKSim/FTKTrackStream.h"
+#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
+#include "TrigFTK_RawData/FTK_RawPixelCluster.h"
+#include "TrigFTK_RawData/FTK_RawSCT_Cluster.h"
+#include "FTKStandaloneMonitoring/FTKTrkAssoc.h"
+#include "FTKStandaloneMonitoring/CompareFTKTracks.h"
+#undef PACKAGE_VERSION
+#include "RunControl/Common/OnlineServices.h"
+#include "ipc/partition.h"
+#include "ipc/core.h"
+#include "oh/OHRootProvider.h"	
+#include "RunControl/Common/Exceptions.h"
+class CompareFTKEvents{
+  public:
+    CompareFTKEvents();
+    /// initialization with the path/namefile string of the HW (BS/RAW) and SW (NTUP_FTK) files
+    CompareFTKEvents(const std::string &BSfile, const std::string &NTUP_FTK_file);
+    
+    /// setting up partition
+    void SetupPartition(const std::string &partition_name);
+       
+    /// function to read each BS event given the pointer position where it last stopped reading the event
+    std::streampos readBSevent(int ievent,std::streampos startbufpos);
+    
+    /// reading the SW NTUP_FTK TTrees which should contain some TTrees: 
+    ///  "evtinfo" containing basic event infos, 
+    ///  "ftkdata" containing a branch of FTKTrackStream objects with name "FTKMergedTracksStream"
+    void readNTUP_FTKfile();
+    
+    /// print input files
+    void PrintFiles();
+    
+    /// Looping over events of the HW (BS_FTK) and SW (NTUP_FTK files) and collecting track info
+    void EventLoop();
+    
+    /// histogram initialization: for the naming convention see CompareFTKEvents.h
+    void SetHistos(std::vector<std::string> histo_list);
+    
+    /// change the name of the event info ttree: default is evtinfo
+    void SetEvtInfoString(std::string &str_tree_evtinfo){m_str_tree_evtinfo=str_tree_evtinfo;}
+
+    /// change the name of the data ttree: default is ftkdata
+    void SetTreeNTUPString(std::string &str_tree_ftkdata){m_str_tree_ftkdata=str_tree_ftkdata;}
+
+    /// change the name of the FTK Stream branch: default is FTKMergedTracksStream
+    void SetBranchString(std::string &str_tree_ftkstream){m_str_tree_ftkstream=str_tree_ftkstream;}
+    
+    /// set verbose
+    void SetVerbose(){m_verbose=true;}
+
+    /// set maximum number of events
+    void SetNEvents(int nevtmax){m_nevtmax=nevtmax;}
+
+    /// reading BS file, starting loop on events and writing histograms
+    void Execute();
+
+    /// Get the total number of events in the BS file
+    int GetNEventsBS();
+    
+    /// destructor that prints out if the tracks were all matched or differences were found
+    ~CompareFTKEvents();
+  private:
+
+    /// decoding functions from FTKByteStreamDecoderEncoder of package Trigger/TrigFTK/TrigFTKByteStream
+    StatusCode decode(uint32_t nTracks, OFFLINE_FRAGMENTS_NAMESPACE::PointerType rodData, FTK_RawTrackContainer* result);
+
+    /// decoding functions from FTKByteStreamDecoderEncoder to get track info from BS
+    FTK_RawTrack* unpackFTTrack( OFFLINE_FRAGMENTS_NAMESPACE::PointerType data);
+
+    /// decoding functions from FTKByteStreamDecoderEncoder **never tested** and **never used**
+    void unpackPixCluster(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, FTK_RawPixelCluster& cluster);
+    
+    /// decoding functions from FTKByteStreamDecoderEncoder **never tested** and **never used**
+    void unpackSCTCluster(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, FTK_RawSCT_Cluster& cluster) {cluster.setWord(*data);}
+    
+    /// writing histograms into file and/or publishing on OH
+    void WriteHistos();
+
+    int m_nevtmax=0;
+    const size_t m_TrackBlobSize = 22; // magic number from BS specification
+    const size_t m_TrackParamsBlobSize = 6; // --||--
+    const size_t m_PixHitParamsBlobSize = 2; // --||--
+    const size_t m_SCTHitParamsBlobSize = 1; // --||--
+    const size_t m_NPixLayers=4;
+    const size_t m_NSCTLayers=8;
+    std::vector<uint32_t> m_data;
+    std::string m_BSfile;
+    std::string m_NTUP_FTK_file;
+    uint32_t m_checkword=0xaa1234aa;
+    uint32_t m_trackBlockOffsetStart=0;	  // Nr of words in ROB data block before track blocks start
+    uint32_t m_trackBlockOffsetEnd=0;	  // Nr of words in ROB data block after track blocks end
+    int m_Nevents_BS;
+    int m_Nevents_NTUPFTK;
+    std::ifstream m_myBSfile;
+    std::streampos m_tmpbufpos=0;
+    TTree *m_tevtinfo;
+    TTree *m_theTree;
+    TFile *m_fntupftk;
+    int m_RN, m_EN, m_LB, m_BCID, m_EL1ID, m_l1TT;
+    FTKTrackStream *m_ft;
+    bool m_allmatched=true;
+    bool m_verbose=false;
+    bool m_setup_partition=false;
+    CompareFTKTracks * m_compTrk;
+    std::vector<std::string> m_histo_list;
+    std::map<std::string , TH1D * > m_map_histo;
+    std::map<std::string , TH2D * > m_map_histo_2D;
+    TFile * m_fout;
+    std::string m_str_tree_evtinfo="evtinfo";
+    std::string m_str_tree_ftkdata="ftkdata";
+    std::string m_str_tree_ftkstream="FTKMergedTracksStream";
+    std::string m_partition_name="";
+    std::map<std::string, std::vector<double> > m_histo_param={{"pt",{1000.,0.,100000.}},
+                                                              {"eta",{100.,-2.5,2.5}},
+							      {"phi",{100.,-3.2,3.2}},
+							      {"d0",{100.,-5.,5.}},
+							      {"z0",{100,-50,50}},
+							      {"chi2",{100,0,50}},
+							      {"ETA_PHI",{100,-2.5,2.5,100,-3.2,3.2}}};
+    std::map<std::string, std::string>  m_param_units={{"pt"," [MeV]"},
+                                                              {"eta",""},
+							      {"phi",""},
+							      {"d0"," [mm]"},
+							      {"z0"," [mm]"},
+							      {"chi2",""},
+							      {"ETA_PHI",""}};
+    std::vector<std::string> m_variable_list={"pt","eta","phi","d0","z0","chi2","ETA_PHI"};    
+    IPCPartition                                    m_ipcpartition;     // Partition 
+    std::string                         m_name="HLmon_HWSWcomp";
+    OHRootProvider                      *m_ohProvider;
+    TH1F                                *m_histogram;       // Histogram
+  };
+#endif //__CompareFTKEvents__
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKTracks.h b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKTracks.h
new file mode 100644
index 0000000000000000000000000000000000000000..32235c7c3fd160f60aaff9917db63789d58566f4
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/CompareFTKTracks.h
@@ -0,0 +1,78 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+///
+/// This class aims to do track matching given two vectors of 
+/// FTK_RawTrack: one is the reference and one is the test
+/// this class gets also maps of histograms to be filled with
+/// the track parameters.
+/// The goal is to have a summary of the matching into four types of histos:
+/// HWSW*: if HW and SW tracks are completely matched, i.e. have the same track parameters within 0.1% of relative error
+///	      the distrubutions of the track paramters (like pt, eta, ...) are displayed in the histograms
+/// HWonly*: if HW tracks do not have SW tracks within m_dmax=0.2, 
+///		the distrubutions of these HW track paramters (like pt, eta, ...) are displayed in the histograms
+/// SWonly*: if SW tracks do not have HW tracks within m_dmax=0.2, 
+///		the distrubutions of these SW track paramters (like pt, eta, ...) are displayed in the histograms
+/// HWvsSW: if HW and SW tracks are not completely matched, 
+///		i.e. they are geometrically closed but do not have the same track parameters
+///		these histograms in turn are divided into :
+///		HWvsSWsw*: the distrubutions of the SW track paramters (like pt, eta, ...) are displayed in the histograms
+///		HWvsSWhw*: the distrubutions of the HW track paramters (like pt, eta, ...) are displayed in the histograms
+///		HWvsSWdiff*: the distrubutions of the difference btw the HW and SW track paramters (like pt, eta, ...) 
+///			     are displayed in the histograms
+/// 
+///////////////////////////////////////////////////////////////////
+
+
+#ifndef __CompareFTKTracks__
+#define __CompareFTKTracks__
+
+
+#include <iostream>
+#include <fstream>
+
+#include <vector>
+#include <cmath>
+#include "TTree.h"
+#include "TFile.h"
+#include "TH1.h"
+#include "TH2.h"
+
+#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
+#include "FTKStandaloneMonitoring/FTKTrkAssoc.h"
+class CompareFTKTracks{
+  public:
+    CompareFTKTracks();
+    
+    /// initialization of the object with the vectors of reference and test FTK_RawTrack, and the maps of histos to be filled
+    CompareFTKTracks(std::vector<const FTK_RawTrack *> &ref, std::vector<const FTK_RawTrack *> &test, std::map<std::string , TH1D * > &map_histo, std::map<std::string , TH2D * > &map_histo_2D);
+    
+    /// here the matching is done: the criterium is angular distance specified by m_dmax
+    void AssociateTracks();
+    
+    /// change the maximum distance between two tracks for angular matching: default 0.2
+    void SetDRmax(double dmax){m_dmax=dmax;}
+    
+    /// here a rough printout equivalence between the two vectors of tracks is performed
+    void TestEquivalence();
+
+    /// here histograms are filled wrt to the 4 types of histograms:
+    void FillHistos();
+
+    /// functions which from a string concerning the track parameter returns the value of the track parameter, 
+    /// through the FTK_RawTrack method 
+    double GetValue(std::string & variable, const FTK_RawTrack * tmptrk);
+
+  private:
+    std::map<std::string , TH1D * > m_map_histo;
+    std::map<std::string , TH2D * > m_map_histo_2D;
+    std::vector<const FTK_RawTrack *> m_ref;
+    std::vector<const FTK_RawTrack *> m_test;
+    FTKTrkAssoc* m_associator;
+    double m_dmax=0.2;
+    bool m_allmatched=true;
+    std::vector<std::string> m_variable_list={"pt","eta","phi","d0","z0","chi2","ETA_PHI"};
+};
+#endif //__CompareFTKTracks__
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/FTKTrkAssoc.h b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/FTKTrkAssoc.h
new file mode 100644
index 0000000000000000000000000000000000000000..6478974105ac1ba169a21905e0e455a5edcd0645
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/FTKStandaloneMonitoring/FTKTrkAssoc.h
@@ -0,0 +1,24 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef __FTKTRKASSOC_H__
+#define __FTKTRKASSOC_H__
+#include "TrigFTK_RawData/FTK_RawTrack.h"
+#include "TrigInDetAnalysisUtils/BestMatcher.h"
+#include "TMath.h"
+typedef BestMatcher<const FTK_RawTrack> TrkMatch;
+class FTKTrkAssoc : public TrkMatch { 
+    public:
+      FTKTrkAssoc(const std::string& name, double d) : 
+        TrkMatch(name, d)
+    { } 
+      virtual ~FTKTrkAssoc() { } 
+      double distance( const FTK_RawTrack* t0,  const FTK_RawTrack* t1 ) const {
+        double deta = TMath::ASinH(t0->getCotTh())-TMath::ASinH(t1->getCotTh());
+        double dphi = t0->getPhi()-t1->getPhi(); 
+        if ( dphi> M_PI ) dphi-=2*M_PI; 
+        if ( dphi<-M_PI ) dphi+=2*M_PI;
+        return std::sqrt( deta*deta + dphi*dphi );
+      }
+  };
+#endif
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/README.md b/Trigger/TrigFTK/FTKStandaloneMonitoring/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..d147802b8d91fe2c1ac1f11d7f0bc01a68a794aa
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/README.md
@@ -0,0 +1,106 @@
+# Reference
+
+Explanation of the package structure in [FTKStandaloneMonitoringDoc](https://twiki.cern.ch/twiki/bin/view/Atlas/FTKStandaloneMonitoringDoc)
+
+
+# Check out (lxplus only)
+
+```
+setupATLAS 
+lsetup git
+mkdir testdir
+cd testdir
+git atlas init-workdir https://:@gitlab.cern.ch:8443/giulini/athena.git
+cd athena/
+git atlas addpkg FTKStandaloneMonitoring
+git fetch upstream 
+git checkout -b FTKSM-ckeckout upstream/21.1 --no-track
+cd ..
+```
+
+#  Compilation
+
+if not already done
+```
+setupATLAS 
+lsetup git
+```
+
+for old athena releases e.g. 21.0.17,AtlasHLT
+```
+asetup 21.0.17,AtlasHLT,here
+mv CMakeLists.txt athena/
+cd athena
+rm -r Projects
+mv Trigger/TrigFTK/FTKStandaloneMonitoring/ .
+rm -r Trigger
+mkdir build
+cd build/
+cmake ../athena/
+make
+```
+
+for new athena releases
+```
+asetup 21.1.2,AthenaP1,here
+mkdir build
+cd build/
+cmake ../athena/Projects/WorkDir/
+make
+```
+#  Setup and Running
+
+* At lxplus
+
+```
+source x86*/setup.sh
+cd x86*/bin
+
+./MonitoringFTKHWSWComparison -f /eos/user/a/amaranti/FTK_DQM_tests/21.0.11_lxplus/OUT.BS_FTK.root -n /eos/user/a/amaranti/FTK_DQM_tests/20.11.2.6.2_AtlasP1MON_lxplus/FTKIPtoFTK/OUT.NTUP.root -s -v
+```
+* At P1
+
+first setup athena at P1:
+```
+source /det/ftk/ftk_setup.sh FTK-02-00-01
+export TDAQ_PARTITION=FTK-DQM-HWSWComparison
+alias asetup='. /sw/atlas/AtlasSetup/scripts/asetup.sh'
+asetup 21.1.2,AthenaP1,here
+```
+assuming you are in testdir
+```
+source build/x86*/setup.sh
+cd build/x86*/bin
+```
+
+running
+```
+./MonitoringFTKHWSWComparison -f /atlas-home/0/giulini/xTakashiAlex/files/alex.OUT.BS_FTK.root -n /atlas-home/0/giulini/xTakashiAlex/files/alex.OUT.NTUP.root
+```
+to be added if you are not running within the partition
+```
+ -p PARTITION_NAME 
+```
+
+to see the histograms:
+```
+oh_display 
+```
+
+click on Histogram repository and then on the partition name and again on the partition name
+
+#  Setup and running script from offline release at P1
+
+
+```
+source /det/ftk/ftk_setup.sh FTK-02-00-04
+export TDAQ_PARTITION=FTK-DQM-HWSWComparison
+alias asetup='. /sw/atlas/AtlasSetup/scripts/asetup.sh'
+asetup 21.1.4,AthenaP1,here
+MonitoringFTKHWSWComparison -f /atlas-home/0/giulini/xTakashiAlex/files/alex.OUT.BS_FTK.root -n /atlas-home/0/giulini/xTakashiAlex/files/alex.OUT.NTUP.root -p $TDAQ_PARTITION 
+```
+or without -p option if run within the partition
+```
+oh_display 
+```
+click on Histogram repository and then on the partition name and again on the partition name
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKEvents.cxx b/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKEvents.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..18cd14a7b55e5bce76470079fad42ef7104a7c2c
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKEvents.cxx
@@ -0,0 +1,432 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+#include "FTKStandaloneMonitoring/CompareFTKEvents.h"
+#include <iostream>
+#include <string>
+CompareFTKEvents::CompareFTKEvents()
+{
+    std::cout<<"Empty constructor"<<std::endl;
+}
+
+CompareFTKEvents::CompareFTKEvents(const std::string &BSfile, const std::string &NTUP_FTK_file):
+   m_BSfile(BSfile),
+   m_NTUP_FTK_file(NTUP_FTK_file)
+{
+    std::cout<<"Input files constructor"<<std::endl;
+    std::cout<<m_BSfile<<std::endl;
+    std::cout<<m_NTUP_FTK_file<<std::endl;
+    m_myBSfile.open(m_BSfile.c_str(),std::ios::in | std::ios::binary);
+    if (m_myBSfile.fail()){
+        std::cout << "ERROR! cannot open file "<<m_BSfile.c_str();
+	m_myBSfile.clear( );
+    }
+}
+
+void CompareFTKEvents::SetupPartition(const std::string &partition_name)
+{   
+    m_partition_name=partition_name;
+    m_setup_partition=true;
+    // initialization of IPCParition
+    try {
+       m_ipcpartition      = daq::rc::OnlineServices::instance().getIPCPartition();
+       std::cout<<"==> Getting partition from Online Service Instance: you are running in a partition"<<std::endl;
+    }
+    catch ( daq::rc::Exception & ex ){	    
+       ers::warning(ex);  //or throw e; 
+       if (m_partition_name!="") std::cout<< "Partition set to the input variable: "<<m_partition_name<<std::endl;
+       else if (std::getenv("TDAQ_PARTITION")!=nullptr) {
+           m_partition_name = std::getenv("TDAQ_PARTITION");
+	   std::cout<< "Partition set to the environment variable TDAQ_PARTITION: "<<m_partition_name<<std::endl;
+       }	   
+       //set to some default, e.g. ATLAS and print a warning, this should not happen
+       else {
+           m_partition_name="ATLAS";
+	   std::cout<< "Partition set to ATLAS, this should not happen!!! "<<std::endl;
+       }   
+       m_ipcpartition = IPCPartition( m_partition_name );
+       std::cout<<"==> Setting up partition from the name you provided in the command line: "<<m_partition_name<<std::endl;
+       if (m_partition_name.empty()) std::cout<<"!!!! Empty partition name => you should provide it with \"-p [partition_name]\" as argument while executing"<<std::endl;
+    }
+    // Creating the Histogramming provider
+    std::string OHServer("Histogramming"); 
+    std::string OHName("FTK_" + m_name);   
+    std::cout<<"partition initialized"<<std::endl;
+    //initialization of the OH provider
+    try {
+      m_ohProvider = new OHRootProvider ( m_ipcpartition , OHServer, OHName );
+      ERS_LOG("OH: publishing in " << OHServer << "." << m_name );
+    }
+    catch ( daq::oh::Exception & ex)
+    { // Raise a warning or throw an exception.
+      std::cout<<"OH error exception"<<std::endl;
+      ers::warning(ex);  
+    }  
+}
+
+void CompareFTKEvents::SetHistos(std::vector<std::string> histo_list){
+    m_histo_list=histo_list;
+    for (auto & istr : m_histo_list){
+	std::size_t pos = istr.find("_");      
+        std::string str3 = istr.substr (pos+1);
+        std::stringstream ss;
+        
+	// definition of the titles and axis labels of 1D histograms published on OH
+	if (istr.find("HWSW")!=std::string::npos)        ss<<"HW=SIM;"<<str3<<m_param_units[str3]<<";FTK HW=SIM Tracks";
+        else if (istr.find("HWonly")!=std::string::npos) ss<<"HW only;"<<str3<<m_param_units[str3]<<";FTK HW Tracks w/o SW match";
+        else if (istr.find("SWonly")!=std::string::npos) ss<<"SW only;"<<str3<<m_param_units[str3]<<";FTK SW Tracks w/o HW match";
+        else if (istr.find("HWvsSWhw")!=std::string::npos) ss<<"Matched Tracks but HW!=SW; HW "<<str3<<m_param_units[str3]<<";FTK HW Tracks w/ SW match "<<str3;
+        else if (istr.find("HWvsSWsw")!=std::string::npos) ss<<"Matched Tracks but HW!=SW; SW "<<str3<<m_param_units[str3]<<";FTK SW Tracks w/ HW match "<<str3;
+	//else if (istr.find("res")!=std::string::npos)  ss<<"Matched Tracks but HW!=SW, #Delta  (SW-HW)/ HW;"<<str3<<";FTK HW Tracks w/ SW match";
+	else if (istr.find("nTrk")!=std::string::npos) ss<<istr<<";N tracks;Events";
+	std::string title = ss.str();
+	
+	//1D histograms
+	//if histo is NOT eta vs phi 2D histo these histos are published on OH
+        if (istr.find("ETA_PHI")==std::string::npos){
+            if (istr.find("nTrk")!=std::string::npos) m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),title.c_str(),100,0,100)));
+ 	    else if (istr.find("HWSW")!=std::string::npos|| istr.find("HWonly")!=std::string::npos||istr.find("SWonly")!=std::string::npos||(istr.find("HWvsSW")!=std::string::npos&&istr.find("diff")==std::string::npos))
+	       m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),title.c_str(),m_histo_param[str3].at(0),m_histo_param[str3].at(1),m_histo_param[str3].at(2))));
+            else if (istr.find("HWvsSWdiff_pt")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta p_{T} (test-ref); p_{T}^{test} - p_{T}^{ref} [MeV];FTK Tracks",1000,-5000,5000)));
+            else if (istr.find("HWvsSWdiff_eta")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta #eta (test-ref); #eta^{test} - #eta^{ref} ;FTK Tracks",2000,-0.1,0.1)));
+            else if (istr.find("HWvsSWdiff_phi")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta #phi (test-ref); #phi^{test} - #phi^{ref} ;FTK Tracks",2000,-0.1,0.1)));
+            else if (istr.find("HWvsSWdiff_d0")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta d_{0} (test-ref); d_{0}^{test} - d_{0}^{ref} [mm];FTK Tracks",4000,-5.,5.)));
+            else if (istr.find("HWvsSWdiff_z0")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta z_{0} (test-ref); z_{0}^{test} - z_{0}^{ref} [mm];FTK Tracks",4000,-2.,2.)));
+            else if (istr.find("HWvsSWdiff_chi2")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta chi2 (test-ref); chi2^{test} - chi2^{ref} ;FTK Tracks",4000,-5.,5.)));
+            else if (istr.find("res_pt")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta p_{T} (test-ref)/ p_{T}^{ref};( p_{T}^{test} - p_{T}^{ref} )/ p_{T}^{ref};FTK Tracks",2000,-1.,1.)));
+            else if (istr.find("res_eta")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta #eta (test-ref)/ #eta^{ref};( #eta^{test} - #eta^{ref} )/ #eta^{ref};FTK Tracks",2000,-1.,1.)));
+            else if (istr.find("res_phi")!=std::string::npos)
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta #phi (test-ref)/ #phi^{ref};( #phi^{test} - #phi^{ref} )/ #phi^{ref};FTK Tracks",2000,-1.,1.)));
+            else if (istr.find("res_d0")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta d_{0} (test-ref)/ d_{0}^{ref};( d_{0}^{test} - d_{0}^{ref} )/ d_{0}^{ref};FTK Tracks",4000,-2.,2.)));
+            else if (istr.find("res_z0")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta z_{0} (test-ref)/ z_{0}^{ref};( z_{0}^{test} - z_{0}^{ref} )/ z_{0}^{ref};FTK Tracks",4000,-2.,2.)));
+            else if (istr.find("res_chi2")!=std::string::npos) 
+		m_map_histo.insert(std::map<std::string, TH1D *>::value_type(istr, new TH1D(istr.c_str(),"#Delta chi2 (test-ref)/ chi2^{ref};( chi2^{test} - chi2^{ref} )/ chi2^{ref};FTK Tracks",4000,-2.,2.)));
+	}
+	
+	// 2D histograms containing ETA_PHI in the histo name are not published on OH
+	else {
+ 	    m_map_histo_2D.insert(std::map<std::string, TH2D *>::value_type(istr, new TH2D(istr.c_str(),title.c_str(),100,-2.5,2.5,100,-3.2,3.2)));	
+	}
+    }	
+}
+
+void CompareFTKEvents::Execute()
+{
+    //Getting BS file event number
+    m_Nevents_BS=GetNEventsBS();
+    std::cout<<"Input BS file has N events: "<<m_Nevents_BS<<std::endl;
+    // reading NTUP_FTK file
+    readNTUP_FTKfile();
+    if (m_Nevents_BS!=m_Nevents_NTUPFTK) {
+	std::cout<<"different number of events: "<<m_Nevents_BS<<" "<<m_Nevents_NTUPFTK<<std::endl;
+	m_allmatched=false;
+    }
+    //looping over events
+    EventLoop();
+    // writing the histograms
+    WriteHistos();
+}
+
+void CompareFTKEvents::readNTUP_FTKfile()
+{
+    std::cout<<"Reading NTUP_FTK file "<<m_NTUP_FTK_file<<std::endl;
+    m_fntupftk = new TFile(m_NTUP_FTK_file.c_str());
+    if (!m_fntupftk) std::cout<<"ERROR!! NTUP_FTK file could not be opened: "<<m_NTUP_FTK_file.c_str()<<std::endl;
+    if (!m_fntupftk->GetListOfKeys()->Contains(m_str_tree_evtinfo.c_str())) std::cout<<"ERROR!! NTUP_FTK file does not contain tree: "<<m_str_tree_evtinfo.c_str()<<std::endl;
+    m_tevtinfo = (TTree*)m_fntupftk->Get(m_str_tree_evtinfo.c_str());
+    m_tevtinfo->SetBranchAddress("RunNumber",&m_RN);  
+    m_tevtinfo->SetBranchAddress("EventNumber",&m_EN);  
+    m_tevtinfo->SetBranchAddress("LB",&m_LB);  
+    m_tevtinfo->SetBranchAddress("BCID",&m_BCID);  
+    m_tevtinfo->SetBranchAddress("ExtendedLevel1ID",&m_EL1ID);  
+    m_tevtinfo->SetBranchAddress("Level1TriggerType",&m_l1TT); 
+    if (!m_fntupftk->GetListOfKeys()->Contains(m_str_tree_ftkdata.c_str())) std::cout<<"ERROR!! NTUP_FTK file does not contain tree: "<<m_str_tree_ftkdata.c_str()<<std::endl;
+    m_theTree=(TTree *)m_fntupftk->Get(m_str_tree_ftkdata.c_str());
+    m_ft=new FTKTrackStream();
+    if (!m_theTree->GetListOfBranches()->Contains(m_str_tree_ftkstream.c_str()))std::cout<<"ERROR!! NTUP_FTK file does not contain branch: "<<m_str_tree_ftkstream.c_str()<<std::endl;
+    auto branch  = m_theTree->GetBranch(m_str_tree_ftkstream.c_str());
+    branch->SetAddress(&m_ft);
+    m_Nevents_NTUPFTK=m_theTree->GetEntries();
+}
+
+StatusCode CompareFTKEvents::decode(uint32_t nTracks, OFFLINE_FRAGMENTS_NAMESPACE::PointerType rodData, FTK_RawTrackContainer* result) {
+
+  result->reserve(result->size() + nTracks);
+  for ( size_t i = 0; i < nTracks; ++i ) {
+    FTK_RawTrack* track = unpackFTTrack( rodData );
+    rodData += m_TrackBlobSize;
+    result->push_back(track);
+  }
+  return StatusCode::SUCCESS;
+}
+
+FTK_RawTrack* CompareFTKEvents::unpackFTTrack( OFFLINE_FRAGMENTS_NAMESPACE::PointerType data) {  
+  FTK_RawTrack* track = new FTK_RawTrack(data[0], data[1], data[2], data[3], data[4], data[5]); // first six words are track params
+  data += m_TrackParamsBlobSize;
+
+  // get pixel hits  
+  track->getPixelClusters().resize(m_NPixLayers);
+  for ( size_t i = 0; i < size_t(m_NPixLayers); ++i) {
+    size_t offset = m_PixHitParamsBlobSize*i;
+    unpackPixCluster(data+offset, track->getPixelCluster(i) );    
+  }
+  data += m_PixHitParamsBlobSize*m_NPixLayers;
+
+  // gets SCT hits
+  track->getSCTClusters().resize(m_NSCTLayers);
+  for ( size_t i = 0; i < size_t(m_NSCTLayers); ++i) {
+    size_t offset = m_SCTHitParamsBlobSize*i;
+    unpackSCTCluster(data+offset, track->getSCTCluster(i) );    
+  }
+  // no more shifts needed
+  return track;
+}  
+
+void CompareFTKEvents::unpackPixCluster(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, FTK_RawPixelCluster& cluster) {
+  cluster.setWordA(*data);
+  cluster.setWordB(*(data+1));
+}
+
+void CompareFTKEvents::EventLoop()
+{
+    std::cout<<"Starting Loop"<<std::endl;
+    m_tmpbufpos=0;
+    if (m_nevtmax==0)m_nevtmax=std::min(m_Nevents_BS,m_Nevents_NTUPFTK);
+    // looping over the requested number of events 
+    for (int ievent=1;ievent<=m_nevtmax;ievent++){
+       m_tmpbufpos =readBSevent( 1,m_tmpbufpos);  
+       int lengthdata=m_data.size();
+       // some transformation into a uint32_t vector and then into a PointerType
+       uint32_t * data32=NULL;
+       data32=new uint32_t[lengthdata]; 
+       for(int ij=0; ij<lengthdata; ij++) {
+           data32[ij]=m_data[ij];
+       }
+       OFFLINE_FRAGMENTS_NAMESPACE::PointerType pdata=data32;
+       //event info are given to FullEventFragment
+       eformat::read::FullEventFragment fe(pdata);
+       std::vector< eformat::read::ROBFragment > ROBFragments_v;
+       if (m_verbose)std::cout<<"Run Number "<<fe.run_no()<<" Lvl1 "<<fe.lvl1_id()<<" BCID "<<fe.bc_id()<<std::endl;
+       fe.robs( ROBFragments_v );
+       FTK_RawTrackContainer* trkcontainerBS= new FTK_RawTrackContainer();
+       std::vector<const FTK_RawTrack *> ftkBSref;
+       int nrob=0;
+       int nTrks=0;
+       for(auto& ROBFragment : ROBFragments_v){
+           unsigned int niTrks=0;
+           eformat::helper::SourceIdentifier ROBSource_id = eformat::helper::SourceIdentifier( ROBFragment.source_id() );
+           if(ROBSource_id.subdetector_id() != eformat::TDAQ_FTK ){
+              continue;
+           }
+           const uint32_t *rod_data = ROBFragment.rod_data();
+           uint32_t rod_ndata = ROBFragment.rod_ndata();
+	   if( ( rod_ndata - m_trackBlockOffsetStart - m_trackBlockOffsetEnd ) % m_TrackBlobSize != 0 ){
+	      std::cout<<"Error: wrong size of rod"<<rod_ndata<<std::endl;
+	      continue;
+	   }
+           niTrks = ( rod_ndata - m_trackBlockOffsetStart - m_trackBlockOffsetEnd ) / m_TrackBlobSize;
+	   nTrks+=niTrks;
+           rod_data += m_trackBlockOffsetStart;            // moving data pointer to first track block
+	   if (m_verbose){
+	      std::cout<<"test of working rod l1 "<<ROBFragment.rod_lvl1_id()<<" ndata "<<rod_ndata<<std::endl;
+	   }
+	   // decoding the rod info into FTK track container
+           StatusCode sc;
+	   sc=decode(niTrks,rod_data, trkcontainerBS);
+	   if (!sc.isSuccess()) std::cout<<"ERROR!! decode function did not return success"<<std::endl;
+	   if (trkcontainerBS->size()==0) {
+               std::cout<<"no FTK tracks from BS file continue"<<std::endl;
+	       continue;
+	   }
+	   if (m_verbose){
+	      std::cout<<sc.isSuccess()<<std::endl;
+              std::cout<< "collection of size " << trkcontainerBS->size() << std::endl;
+	   }
+           for ( unsigned int i = 0 ; i < niTrks; ++i ) {
+	       ftkBSref.push_back(trkcontainerBS->at(i));
+	   }
+	   nrob+=1;	  
+       }
+       // filling histograms with number of HW tracks per event
+       auto search = m_map_histo.find("nTrk_HW");
+       if(search != m_map_histo.end()) search->second->Fill(nTrks);
+       else  std::cout << "Not found "<<search->first<<std::endl;
+       if (nrob>1){std::cout<<"!!!!!!!!!!SOMETHING WRONG number of robs >1:"<<nrob<<std::endl;}
+       std::cout<<"Event "<<ievent<<" N tracks BS file "<<trkcontainerBS->size()<<std::endl;
+       // end reading info from BS file
+       //---------------------------------------------------------------------//
+       // start reading info from NTUP_FTK file
+       m_theTree->GetEvent(ievent-1); 
+       FTK_RawTrackContainer* trkcontainerNTUP= new FTK_RawTrackContainer();
+       std::vector<const FTK_RawTrack *> ftkNTUPtest;
+       int NTracksNTUP;
+       NTracksNTUP=m_ft->getNTracks();
+       // filling histograms with number of SW tracks per event
+       auto search_SW = m_map_histo.find("nTrk_SW");
+       if(search_SW != m_map_histo.end()) search_SW->second->Fill(NTracksNTUP);
+       else  std::cout << "Not found "<<search_SW->first<<std::endl;
+       // to be able to match SW and HW tracks the same object class needs to be used:
+       // HW tracks are FTK_RawTrack; SW tracks are FTKTrack.
+       // needed a by-hand transformation of a FTKTrack object into a FTK_RawTrack object 
+       for(int it=0; it<NTracksNTUP;it++){
+         FTKTrack* ftktrk=m_ft->getTrack(it);
+         FTK_RawTrack* rawftktrk=new FTK_RawTrack();
+	 rawftktrk->setD0(ftktrk->getIP());
+	 rawftktrk->setZ0(ftktrk->getZ0());
+	 rawftktrk->setPhi(ftktrk->getPhi());
+	 rawftktrk->setCotTh(ftktrk->getCotTheta());
+	 rawftktrk->setInvPt(2*ftktrk->getHalfInvPt());
+	 rawftktrk->setChi2(ftktrk->getChi2());
+	 rawftktrk->setBarcode(ftktrk->getBarcode());
+	 trkcontainerNTUP->push_back(rawftktrk);
+         ftkNTUPtest.push_back(trkcontainerNTUP->at(it));
+       }
+       std::cout<<"Event "<<ievent<<" N tracks NTUP_FTK "<<trkcontainerNTUP->size()<<std::endl;
+       // end reading info from NTUP_FTK file
+       //---------------------------------------------------------------------//
+       // start comparing infos
+       m_tevtinfo->GetEntry(ievent-1);
+       if (NTracksNTUP!=nTrks){std::cout<<"different N tracks: "<<NTracksNTUP<<" "<<nTrks<<std::endl;m_allmatched=false;}
+       if (fe.run_no()!=(unsigned int)m_RN){std::cout<<"different RunNUmber: "<<fe.run_no()<<" "<<m_RN<<std::endl; m_allmatched=false;}
+       if (fe.bc_id()!=(unsigned int)m_BCID){std::cout<<"different BCID: "<<fe.bc_id()<<" "<<m_BCID<<std::endl;m_allmatched=false;}
+       // end comparing infos
+       //---------------------------------------------------------------------//
+       // quick manual check of the parameters of SW and HW tracks before doing the real matching
+       // if the two files BS anf NTUP_FTK contained exactly the same information, 
+       // there should be no difference in the track parameters
+       for ( int i = 0 ; i < std::min((int) nTrks,NTracksNTUP); ++i ) {
+           if(trkcontainerNTUP->at(i)->getD0()!=0&&trkcontainerNTUP->at(i)->getZ0()!=0&&trkcontainerNTUP->at(i)->getInvPt()!=0&&
+	      trkcontainerNTUP->at(i)->getPhi()!=0&&trkcontainerNTUP->at(i)->getCotTh()!=0&&trkcontainerNTUP->at(i)->getChi2()!=0
+	      &&(
+	       fabs(trkcontainerBS->at(i)->getD0()/trkcontainerNTUP->at(i)->getD0()-1.)>0.001||
+               fabs(trkcontainerBS->at(i)->getZ0()/trkcontainerNTUP->at(i)->getZ0()-1.)>0.001||
+               fabs(trkcontainerBS->at(i)->getInvPt()/trkcontainerNTUP->at(i)->getInvPt()-1.)>0.001||
+               fabs(trkcontainerBS->at(i)->getPhi()/trkcontainerNTUP->at(i)->getPhi()-1.)>0.001||
+               fabs(trkcontainerBS->at(i)->getCotTh()/trkcontainerNTUP->at(i)->getCotTh()-1.)>0.001||
+               fabs(trkcontainerBS->at(i)->getChi2()/trkcontainerNTUP->at(i)->getChi2()-1.)>0.001)){
+		   if (m_verbose){
+		       std::cout<<"Difference in comparing trk "<<i<<std::endl;
+		       std::cout<<"\td0 : \t"<<trkcontainerBS->at(i)->getD0()<<"\t"<<trkcontainerNTUP->at(i)->getD0()<<std::endl;
+		       std::cout<<"\tz0 : \t"<<trkcontainerBS->at(i)->getZ0()<<"\t"<<trkcontainerNTUP->at(i)->getZ0()<<std::endl;
+		       std::cout<<"\tipt : \t"<<trkcontainerBS->at(i)->getInvPt()<<"\t"<<trkcontainerNTUP->at(i)->getInvPt()<<std::endl;
+		       std::cout<<"\tPhi : \t"<<trkcontainerBS->at(i)->getPhi()<<"\t"<<trkcontainerNTUP->at(i)->getPhi()<<std::endl;
+		       std::cout<<"\tCotTh : \t"<<trkcontainerBS->at(i)->getCotTh()<<"\t"<<trkcontainerNTUP->at(i)->getCotTh()<<std::endl;
+		       std::cout<<"\tChi2 : \t"<<trkcontainerBS->at(i)->getChi2()<<"\t"<<trkcontainerNTUP->at(i)->getChi2()<<std::endl;
+		   }    
+		   m_allmatched=false;
+               }
+	   else {if (i%std::min(nTrks,NTracksNTUP)==0 && m_allmatched){std::cout<<"Track Parameters btw BS_FTK and NTUP_FTK are the same: good!"<<std::endl;}}
+       }
+       //---------------------------------------------------------------------//
+       // start matching
+       m_compTrk= new CompareFTKTracks(ftkBSref,ftkNTUPtest, m_map_histo, m_map_histo_2D);
+       m_compTrk->AssociateTracks();
+       m_compTrk->FillHistos();
+       //---------------------------------------------------------------------//
+       delete data32;
+     }
+}
+
+void CompareFTKEvents::WriteHistos(){
+    m_fout= new TFile("./out.histo.root","RECREATE");
+    m_fout->cd();
+    for(auto & imap : m_map_histo){
+        imap.second->Write();
+	if (m_setup_partition){
+	   try { m_ohProvider->publish( imap.second, imap.second->GetName(), true ); }
+	   catch ( daq::oh::Exception & ex)
+	   { // Raise a warning or throw an exception.
+	     std::cout<<"ERROR: OH provider error"<<std::endl;
+	     ers::warning(ex);  //or throw e; 
+	   }
+	}
+    }
+    for(auto & imap : m_map_histo_2D){
+        imap.second->Write();
+    }
+    m_fout->Write();
+    m_fout->Close();
+    std::cout<<"Histo written into file "<<m_fout->GetName()<<std::endl;
+}
+
+std::streampos CompareFTKEvents::readBSevent(int ievent,std::streampos startbufpos)
+{
+    if (m_verbose) std::cout<<"Reading BS event"<<std::endl;
+    m_data.clear();
+    uint32_t word;
+    int iil=0;
+    int nprocessedevents=0;
+    std::streampos lastpos;
+    if (m_verbose) std::cout<<"pointer position start"<<m_myBSfile.tellg()<<std::endl;
+    if (ievent ==1){
+       if (m_verbose) std::cout<<"going to buffer position "<<startbufpos<<std::endl;
+       m_myBSfile.seekg(startbufpos);
+    }
+    if (m_verbose) std::cout<<"starting reading words "<<startbufpos<<std::endl;
+    while(m_myBSfile.is_open())
+    {
+       if(m_myBSfile.eof()){  break; }
+       word=0;
+       m_myBSfile.read ((char*)&word, sizeof(word));
+       if (word==m_checkword) {
+	  nprocessedevents+=1;
+          if (m_verbose) std::cout<<"pointer position start event"<<m_myBSfile.tellg()<<std::endl;
+       }
+       if (nprocessedevents==ievent){ 
+          m_data.push_back(word);
+          iil++;
+	  lastpos=m_myBSfile.tellg();
+       }
+       else if (nprocessedevents>ievent) {
+          if (m_verbose) std::cout<<"pointer position end event "<<lastpos<<std::endl;
+          break;
+       }
+    }
+    if (m_verbose) std::cout<<"pointer position before closing"<<m_myBSfile.tellg()<<std::endl;
+    return lastpos;    
+}
+
+int CompareFTKEvents::GetNEventsBS()
+{
+    std::cout<<"Getting N events BS file"<<std::endl;
+    uint32_t word;
+    int nevents=0;
+    while(m_myBSfile.is_open())
+    {
+       if(m_myBSfile.eof()){ break; }
+       word=0;
+       m_myBSfile.read ((char*)&word, sizeof(word));
+       if (word==m_checkword) {
+	  nevents+=1;
+       }
+    }
+    m_myBSfile.clear();
+    m_myBSfile.seekg(0,std::ios::beg);
+    return nevents;    
+}
+
+
+void CompareFTKEvents::PrintFiles()
+{
+    std::cout<<"Print Input files"<<std::endl;
+    std::cout<<m_BSfile<<std::endl;
+    std::cout<<m_NTUP_FTK_file<<std::endl;    
+}
+
+CompareFTKEvents::~CompareFTKEvents()
+{
+    m_myBSfile.close();
+    if (m_allmatched) std::cout<<"====>Finished successfully: the two files contain the same infos"<<std::endl;
+    else std::cout<<"====>There was something different, check the printouts"<<std::endl;
+    
+}
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKTracks.cxx b/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKTracks.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..4c97ca3ef07105a1af231776bb6de54477fbf87e
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/src/CompareFTKTracks.cxx
@@ -0,0 +1,177 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+#include "FTKStandaloneMonitoring/CompareFTKTracks.h"
+#include <iostream>
+#include <string>
+
+CompareFTKTracks::CompareFTKTracks(std::vector<const FTK_RawTrack *> &ref, std::vector<const FTK_RawTrack *> &test, std::map<std::string , TH1D * > &map_histo, std::map<std::string , TH2D * > &map_histo_2D){
+      m_ref=ref;
+      m_test=test;
+      m_map_histo=map_histo;
+      m_map_histo_2D=map_histo_2D;
+}
+
+void CompareFTKTracks::AssociateTracks(){
+      m_associator= new FTKTrkAssoc("FTKTrkAssoc", m_dmax);
+      m_associator->match( m_ref,m_test);
+      std::cout<<"Of N ref trks ("<<m_ref.size()<<") wrt to test trk ("<<m_test.size()<<"), number of matched trks: "<<m_associator->size()<<std::endl;
+}
+
+void CompareFTKTracks::TestEquivalence(){
+      const FTK_RawTrack* match_track = NULL;
+      int itrk=0;
+      for(auto& ref_track : m_ref){
+         itrk+=1;
+         match_track = m_associator->matched(ref_track);
+	 if (!match_track) {std::cout<<"the "<<itrk<<"-th track has no matched track"<<std::endl; continue;}
+	 if (ref_track->getPhi()!=0&&fabs(match_track->getPhi()/ref_track->getPhi()-1.)>0.001){	    
+      	    std::cout<<"Wrong matching: Phi matched "<<match_track->getPhi()<<" ref "<<ref_track->getPhi()<<std::endl;
+	    m_allmatched=false;
+	 }
+      }
+      if (m_allmatched) std::cout<<"CompareFTKTracks: All matched tracks had the same phi"<<std::endl;
+      else std::cout<<"CompareFTKTracks: Some matched tracks had different phi"<<std::endl;
+}
+
+double CompareFTKTracks::GetValue(std::string & variable, const FTK_RawTrack  *tmptrk){
+     double outvar=0.;
+     if (variable.find("pt")!=std::string::npos)        {outvar= 1./tmptrk->getInvPt();}
+     else if (variable.find("d0")!=std::string::npos)   {outvar= tmptrk->getD0();}
+     else if (variable.find("z0")!=std::string::npos)   {outvar= tmptrk->getZ0();}
+     else if (variable.find("chi2")!=std::string::npos) {outvar= tmptrk->getChi2();}
+     else if (variable.find("phi")!=std::string::npos)  {outvar= tmptrk->getPhi();}
+     else if (variable.find("eta")!=std::string::npos)  {outvar= TMath::ASinH(tmptrk->getCotTh());}
+     else std::cout<<"variable not found!! "<<variable<<std::endl;
+     return outvar;
+}
+
+void CompareFTKTracks::FillHistos(){
+      const FTK_RawTrack* match_track = NULL;
+      int itrk=0;
+      int HWSWmatched=0;
+      int HWSWdifferent=0;
+      int HWonly=0;
+      int SWonly=0;
+      // filling the SWonly histograms by looping over the test tracks
+      for(auto& test_track : m_test){
+          match_track = m_associator->revmatched(test_track);
+	  if (!match_track) {
+	     std::cout<<"the "<<itrk<<"-th SW track has no matched track"<<std::endl; 
+             for (auto& imap : m_map_histo){
+	         if (imap.first.find("SWonly")==std::string::npos) continue;
+		 std::size_t pos = imap.first.find("_");      
+        	 std::string istr = imap.first.substr (pos+1);		 
+                 imap.second->Fill(GetValue(istr,test_track));
+	     } 
+             for (auto& imap : m_map_histo_2D){
+		 std::size_t pos = imap.first.find("_");      
+        	 std::string istr = imap.first.substr (pos+1);		 
+	         if (imap.first.find("SWonly")==std::string::npos) continue;
+		 if (istr.find("ETA_PHI")!=std::string::npos) {		     
+		     std::string etastr("eta");
+		     std::string phistr("phi");
+		     imap.second->Fill(GetValue(etastr,test_track),GetValue(phistr,test_track));
+		 }    
+             }
+	     SWonly+=1;	      
+	  }    
+      }  
+      
+      // loop over the reference tracks
+      for(auto& ref_track : m_ref){
+         itrk+=1;
+         match_track = m_associator->matched(ref_track);
+	 //no SW matched track -> HWonly histograms
+	 if (!match_track) {
+	     std::cout<<"the "<<itrk<<"-th HW track has no matched track"<<std::endl; 
+             for (auto& imap : m_map_histo){
+	         if (imap.first.find("HWonly")==std::string::npos) continue;
+		 std::size_t pos = imap.first.find("_");      
+        	 std::string istr = imap.first.substr (pos+1);		 
+                 imap.second->Fill(GetValue(istr,ref_track));
+	     } 
+             for (auto& imap : m_map_histo_2D){
+		 std::size_t pos = imap.first.find("_");      
+        	 std::string istr = imap.first.substr (pos+1);		 
+	         if (imap.first.find("HWonly")==std::string::npos) continue;
+		 if (istr.find("ETA_PHI")!=std::string::npos) {		     
+		     std::string etastr("eta");
+		     std::string phistr("phi");
+		     imap.second->Fill(GetValue(etastr,ref_track),GetValue(phistr,ref_track));
+		 }    
+             }
+	     HWonly+=1;
+	 }
+	 //completely matched tracks : HWSW histograms   
+	 else if (!(
+	      (ref_track->getPhi()!=0&&fabs(match_track->getPhi()/ref_track->getPhi()-1.)>0.001)||
+	      (ref_track->getInvPt()!=0&&fabs(match_track->getInvPt()/ref_track->getInvPt()-1.)>0.001)||
+	      (ref_track->getD0()!=0&&fabs(match_track->getD0()/ref_track->getD0()-1.)>0.001)||
+	      (ref_track->getZ0()!=0&&fabs(match_track->getZ0()/ref_track->getZ0()-1.)>0.001)||
+	      (ref_track->getChi2()!=0&&fabs(match_track->getChi2()/ref_track->getChi2()-1.)>0.001)||
+	      (ref_track->getCotTh()!=0&&fabs(match_track->getCotTh()/ref_track->getCotTh()-1.)>0.001)
+	      )
+	     ){	     
+             for (auto& imap : m_map_histo){
+	         if (imap.first.find("HWSW")==std::string::npos) continue;
+		 std::size_t pos = imap.first.find("_");      
+        	 std::string istr = imap.first.substr (pos+1);		 
+                 imap.second->Fill(GetValue(istr,match_track));
+	     } 
+             for (auto& imap : m_map_histo_2D){
+		std::size_t pos = imap.first.find("_");      
+        	std::string istr = imap.first.substr (pos+1);
+	         if (imap.first.find("HWSW")==std::string::npos) continue;
+		 if (istr.find("ETA_PHI")!=std::string::npos) {		     
+		     std::string etastr("eta");
+		     std::string phistr("phi");
+		     imap.second->Fill(GetValue(etastr,match_track),GetValue(phistr,match_track));
+		 }    
+             }
+             
+	     HWSWmatched+=1;
+	 }
+	 //not matched tracks -> HWvsSW histograms
+	 else{
+	     for (auto& imap : m_map_histo){
+	        if (imap.first.find("HWvsSW")==std::string::npos && imap.first.find("res")==std::string::npos) continue;
+		std::size_t pos = imap.first.find("_");      
+        	std::string istr = imap.first.substr (pos+1);
+		double refval,testval;
+		refval=GetValue(istr,ref_track);
+		testval=GetValue(istr,match_track);
+		if (imap.first.find("res")!=std::string::npos) {
+                    imap.second->Fill( (testval-refval)/(refval));
+        	}
+		else if (imap.first.find("HWvsSWdiff")!=std::string::npos) {
+                    imap.second->Fill( (testval-refval));
+        	}
+		else if (imap.first.find("HWvsSWsw")!=std::string::npos) {
+                    imap.second->Fill( testval);
+        	}
+		else if (imap.first.find("HWvsSWhw")!=std::string::npos) {
+                    imap.second->Fill( refval);
+        	}
+             }
+	     auto search_h2HW = m_map_histo_2D.find("HWvsSWhw_ETA_PHI");
+	     std::string etastr("eta");
+	     std::string phistr("phi");
+	     if(search_h2HW != m_map_histo_2D.end()) search_h2HW->second->Fill(GetValue(etastr,ref_track),GetValue(phistr,ref_track));
+	     else  std::cout << "Not found "<<search_h2HW->first<<std::endl;
+	     auto search_h2SW = m_map_histo_2D.find("HWvsSWsw_ETA_PHI");
+	     if(search_h2SW != m_map_histo_2D.end()) search_h2SW->second->Fill(GetValue(etastr,match_track),GetValue(phistr,match_track));
+	     else  std::cout << "Not found "<<search_h2SW->first<<std::endl;
+	     HWSWdifferent+=1;
+	 }   
+      }
+      //histogram cointaining the number of SW tracks not matched to any HW track per event
+      m_map_histo["nTrk_only_sw"]->Fill(SWonly); 
+      //histogram cointaining the number of HW tracks not matched to any SW track per event
+      m_map_histo["nTrk_only_hw"]->Fill(HWonly); 
+      //histogram cointaining the number of HW tracks not completely matched 
+      // to SW tracks per event (some differences in the track paramters)
+      m_map_histo["nTrk_different_hw_sw"]->Fill(HWSWdifferent); 
+      //histogram cointaining the number of HW tracks completely matched to SW tracks per event
+      m_map_histo["nTrk_same_hw_sw"]->Fill(HWSWmatched); 
+}
diff --git a/Trigger/TrigFTK/FTKStandaloneMonitoring/test/MonitoringComparison.cxx b/Trigger/TrigFTK/FTKStandaloneMonitoring/test/MonitoringComparison.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a5be33bfdb96aaa0595f55259874e094a4b41534
--- /dev/null
+++ b/Trigger/TrigFTK/FTKStandaloneMonitoring/test/MonitoringComparison.cxx
@@ -0,0 +1,171 @@
+/*
+Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+#include <iostream>
+#include <fstream>
+
+#include <getopt.h>
+
+#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
+#include "TTree.h"
+#include "TFile.h"
+#include "TCanvas.h"
+#include "TFrame.h"
+#include "TH1F.h"
+#include "TBenchmark.h"
+#include "TRandom.h"
+#include "TSystem.h"
+#include "TrigFTKSim/FTKTrackStream.h"
+#include "FTKStandaloneMonitoring/FTKTrkAssoc.h"
+#include "FTKStandaloneMonitoring/CompareFTKEvents.h"
+#include <ipc/core.h>
+
+using namespace std;
+
+#ifndef TRUE
+  #define TRUE                  0x01
+#endif
+
+#ifndef FALSE
+  #define FALSE                 0x00
+#endif
+
+#define BUFSIZE  (4*1024)
+
+// Globals
+int verbose = FALSE;
+int readfile = FALSE;
+char filename[200] = {0};
+
+
+
+/**************/
+void usage(void)
+/**************/
+{
+  std::cout << "Valid options are ..." << std::endl;
+  std::cout << "-f x: Read BS_FTK data from file. The parameter is the path and the name of the file" << std::endl;
+  std::cout << "-n x: Read NTUP_FTK data from file. The parameter is the path and the name of the file" << std::endl;
+  std::cout << "-m x: maximum number of events" << std::endl;
+  std::cout << "-v  : Verbose output                               -> Default: FALSE" << std::endl;
+  std::cout << "-p x: partition name" << std::endl;
+  std::cout << "-s  : not to initialize a partition" << std::endl;
+  std::cout << std::endl;
+}
+
+
+
+/*****************************/
+int main(int argc, char **argv)
+/*****************************/
+{
+
+  std::string  partition_name="";
+  //default files
+  std::string inputfilenameBS= "/afs/cern.ch/user/g/giulini/workdir/public/FTKcomparison/compareInputs/OUT.BS_FTK.root";
+  std::string inputfilenameNTUPFTK= "/afs/cern.ch/user/g/giulini/workdir/public/FTKcomparison/compareInputs/OUT.NTUP_FTK.root";
+  //evtinfo TTree NTUP_FTK
+  int c;
+  int evtmax=0;
+  bool setup_partition=true;
+  static struct option long_options[] = {"DVS", no_argument, NULL, '1'}; 
+  while ((c = getopt_long(argc, argv, "f:n:m:p:svh", long_options, NULL)) != -1)
+    switch (c) 
+    {
+    case 'h':
+      std::cout << "Usage: " << argv[0] << " [options]: "<< std::endl;
+      usage();
+      exit(-1);
+      break;
+
+    case 'f':   
+      readfile = TRUE;
+      sscanf(optarg,"%s", filename);
+      inputfilenameBS.clear();
+      inputfilenameBS.append(filename);
+      std::cout << "read BS_FTK data from file: " << std::endl<< inputfilenameBS<< std::endl << std::endl;
+      break;
+
+    case 'n':   
+      readfile = TRUE;
+      sscanf(optarg,"%s", filename);
+      inputfilenameNTUPFTK.clear();
+      inputfilenameNTUPFTK.append(filename);
+      std::cout << "read NTUP_FTK data from file: "<< std::endl << inputfilenameNTUPFTK<< std::endl << std::endl;
+      break;
+      
+    case 'p':   
+      sscanf(optarg,"%s", filename);
+      partition_name.clear();
+      partition_name.append(filename);
+      std::cout << "parition name: " << std::endl<< partition_name<< std::endl << std::endl;
+      break;
+      
+    case 'm':   
+      sscanf(optarg,"%d", &evtmax);
+      std::cout << "maximum number of events: "<< evtmax << std::endl << std::endl;
+      break;
+      
+    case 's': setup_partition = false;  break;
+
+    case 'v': verbose = TRUE;  break;
+
+
+    default:
+      std::cout << "Invalid option " << c << std::endl;
+      std::cout << "Usage: " << argv[0] << " [options]: " << std::endl;
+      usage();
+      exit (-1);
+    }
+  ;
+
+  try {
+     IPCCore::init( argc, argv );
+  }
+  catch( daq::ipc::Exception & ex ) {
+      //something went very bad, report and exit
+      std::cout<<"ERROR: IPCCore could not be initialised"<<std::endl;
+      return 1;
+  }
+
+  // initialization of the class to compare FTK events of HW (BS_FTK) and SW (NTUP_FTK)
+  CompareFTKEvents *comparison= new CompareFTKEvents(inputfilenameBS,inputfilenameNTUPFTK);
+  if (setup_partition) comparison->SetupPartition(partition_name);
+  if (verbose) comparison->SetVerbose();  
+  if (evtmax!=0)    comparison->SetNEvents(evtmax);
+  // create list of histograms to be published on oh
+  std::vector<std::string> variable_list={"pt","eta","phi","d0","z0","chi2","ETA_PHI"};//  
+  std::vector<std::string> histo_list;
+  for (auto & istr: variable_list){
+      std::stringstream ss;
+      ss << "HWSW_" << istr; // labels for FTK tracks completely matched (= same track parameters) btw HW and SW
+      std::stringstream ss2;
+      ss2 << "HWonly_" << istr; // labels for HW FTK tracks not matched to any SW track
+      std::stringstream ss3;
+      ss3 << "SWonly_" << istr; // labels for SW FTK tracks not matched to any HW track
+      std::stringstream ss4;
+      ss4 << "HWvsSWhw_" << istr; // labels for HW FTK tracks geometrically matched to SW tracks but with different track parameters
+      std::stringstream ss5;
+      ss5 << "HWvsSWsw_" << istr; // labels for SW FTK tracks geometrically matched to HW tracks but with different track parameters
+      histo_list.push_back(ss.str());
+      histo_list.push_back(ss2.str());
+      histo_list.push_back(ss3.str());
+      histo_list.push_back(ss4.str());
+      histo_list.push_back(ss5.str());
+      if (istr!="ETA_PHI"){
+          std::stringstream ss6;
+          ss6 << "HWvsSWdiff_" << istr; // resolution distributions for FTK tracks matched btw HW and SW but with different track parameters
+          histo_list.push_back(ss6.str());
+      }
+  }
+  histo_list.push_back("nTrk_same_hw_sw");
+  histo_list.push_back("nTrk_different_hw_sw");
+  histo_list.push_back("nTrk_only_hw");
+  histo_list.push_back("nTrk_only_sw");
+  histo_list.push_back("nTrk_HW");
+  histo_list.push_back("nTrk_SW");
+  comparison->SetHistos(histo_list);
+  comparison->Execute();      
+  return 0;
+}
+
diff --git a/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_DataProviderSvc.h b/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_DataProviderSvc.h
index 201a4323693efda8f4e06c86ae38d9e6d4cbdfe0..4db70748e782edd1724eeb31a0da7b74020bc612 100644
--- a/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_DataProviderSvc.h
+++ b/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_DataProviderSvc.h
@@ -43,10 +43,15 @@ public:
   static const InterfaceID& interfaceID() { return IID_IFTK_DataProviderSvc; }
   
   virtual TrackCollection* getTracks(const bool withRefit) = 0;
+  virtual TrackCollection* getTracks(const bool withRefit, unsigned int& nErrors) = 0;
+
   virtual TrackCollection* getTracksInRoi(const IRoiDescriptor&, const bool withRefit) = 0;
+  virtual TrackCollection* getTracksInRoi(const IRoiDescriptor&, const bool withRefit, unsigned int& nErrors) = 0;
 
   virtual xAOD::TrackParticleContainer* getTrackParticles(const bool withRefit) = 0;
+  virtual xAOD::TrackParticleContainer* getTrackParticles(const bool withRefit, unsigned int& nErrors) = 0;
   virtual xAOD::TrackParticleContainer* getTrackParticlesInRoi(const IRoiDescriptor&, const bool withRefit) = 0;
+  virtual xAOD::TrackParticleContainer* getTrackParticlesInRoi(const IRoiDescriptor&, const bool withRefit, unsigned int& nErrors) = 0;
 
   virtual xAOD::VertexContainer* getFastVertices(const ftk::FTK_TrackType trackType=ftk::RawTrack) =0;
 
@@ -64,6 +69,18 @@ public:
 
   virtual std::string getFastVertexCacheName(const bool withRefit)=0;
 
+  virtual std::vector<unsigned int> nMissingSCTClusters()=0;
+  virtual std::vector<unsigned int> nMissingPixelClusters()=0;
+  virtual std::vector<unsigned int> nFailedSCTClusters()=0;
+  virtual std::vector<unsigned int> nFailedPixelClusters()=0;
+
+  virtual unsigned int nRawTracks()=0;
+  virtual unsigned int nTracks(const bool withRefit)=0;
+  virtual unsigned int nTrackParticles(const bool withRefit)=0;
+  virtual unsigned int nTrackErrors(const bool withRefit)=0;
+  virtual unsigned int nTrackParticleErrors(const bool withRefit)=0;
+ 
+
 };
 
 #endif
diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h
index 8bc315c3c9d040c64ec922ff68fd084e0ec9a0f4..afe507c141bc7b255bc5bcef6d5de841a1b1ed2e 100644
--- a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h
+++ b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h
@@ -32,6 +32,7 @@
 #include "xAODTracking/VertexContainer.h"
 #include "xAODTracking/TrackParticleContainer.h"
 #include "FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h"
+#include "FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h"
 
 /// Forward Declarations ///
 class AtlasDetectorID;
@@ -86,9 +87,16 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
  virtual StatusCode initialize();
  virtual StatusCode finalize();
  virtual TrackCollection* getTracksInRoi(const IRoiDescriptor&, const bool withRefit);
+ virtual TrackCollection* getTracksInRoi(const IRoiDescriptor&, const bool withRefit, unsigned int& nErrors);
+
  virtual TrackCollection* getTracks(const bool withRefit);
+ virtual TrackCollection* getTracks(const bool withRefit,unsigned int& nErrors);
+
  virtual xAOD::TrackParticleContainer* getTrackParticles(const bool withRefit);
+ virtual xAOD::TrackParticleContainer* getTrackParticles(const bool withRefit, unsigned int& nErrors);
+
  virtual xAOD::TrackParticleContainer* getTrackParticlesInRoi(const IRoiDescriptor&, const bool withRefit);
+ virtual xAOD::TrackParticleContainer* getTrackParticlesInRoi(const IRoiDescriptor&, const bool withRefit, unsigned int& nErrors);
 
  virtual  xAOD::VertexContainer* getFastVertices(const ftk::FTK_TrackType trackType=ftk::RawTrack);
  
@@ -106,6 +114,20 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
 
  virtual void handle( const Incident &incident );
 
+ virtual unsigned int nRawTracks();
+ virtual unsigned int nTracks(const bool withRefit);
+ virtual unsigned int nTrackParticles(const bool withRefit);
+ virtual unsigned int nTrackErrors(const bool withRefit);
+ virtual unsigned int nTrackParticleErrors(const bool withRefit);
+ 
+ virtual std::vector<unsigned int> nMissingSCTClusters();
+ virtual std::vector<unsigned int> nMissingPixelClusters();
+ virtual std::vector<unsigned int> nFailedSCTClusters();
+ virtual std::vector<unsigned int> nFailedPixelClusters();
+ 
+
+ private:
+
  void getFTK_RawTracksFromSG();
  Trk::Track* ConvertTrack(const unsigned int track);
  Trk::Track* getCachedTrack(const unsigned int track, const bool do_refit);
@@ -114,13 +136,8 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
  StatusCode fillTrackCache(bool do_refit);
  StatusCode fillTrackParticleCache(const bool withRefit);
 
-
-
  bool fillVertexContainerCache(bool withRefit, xAOD::TrackParticleContainer*);
 
-
- protected:
-
  
  const Trk::RIO_OnTrack* createPixelCluster(const FTK_RawPixelCluster& raw_pixel_cluster,  const Trk::TrackParameters& trkPerigee);
  const Trk::RIO_OnTrack* createSCT_Cluster( const FTK_RawSCT_Cluster& raw_sct_cluster, const Trk::TrackParameters& trkPerigee);
@@ -157,14 +174,16 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
   ToolHandle< InDet::IVertexFinder > m_VertexFinderTool;
   ToolHandle< IFTK_VertexFinderTool > m_RawVertexFinderTool;
   ToolHandle< Trk::IRIO_OnTrackCreator >      m_ROTcreator;
+  ToolHandle< IFTK_DuplicateTrackRemovalTool > m_DuplicateTrackRemovalTool;
 
   double m_trainingBeamspotX;
   double m_trainingBeamspotY;
   double m_trainingBeamspotZ;
   double m_trainingBeamspotTiltX;
   double m_trainingBeamspotTiltY;
-
-
+  
+  bool m_remove_duplicates;
+  
   const FTK_RawTrackContainer* m_ftk_tracks;
 
   // Track Cache
@@ -179,19 +198,13 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
 
   // xAOD vertex cache
   xAOD::VertexContainer* m_conv_vertex;
-  xAOD::VertexAuxContainer* m_conv_vertexAux;
   xAOD::VertexContainer* m_refit_vertex;
-  xAOD::VertexAuxContainer* m_refit_vertexAux;
 
   // for fast vertexing algorithm
   xAOD::VertexContainer* m_fast_vertex_raw;
-  xAOD::VertexAuxContainer* m_fast_vertex_rawAux;
   xAOD::VertexContainer* m_fast_vertex_conv;
-  xAOD::VertexAuxContainer* m_fast_vertex_convAux;
   xAOD::VertexContainer* m_fast_vertex_refit;
-  xAOD::VertexAuxContainer* m_fast_vertex_refitAux;
 
-  bool m_got_raw_vertex;
   bool m_got_conv_vertex;
   bool m_got_refit_vertex;
   bool m_got_fast_vertex_refit;
@@ -241,6 +254,14 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public
   std::vector<float>  m_pixelEndCapPhiOffsets;
   std::vector<float> m_pixelEndCapEtaOffsets;
 
+  unsigned int  m_nErrors;
+  std::vector<unsigned int> m_nFailedSCTClusters;
+  std::vector<unsigned int> m_nFailedPixelClusters;
+  std::vector<unsigned int> m_nMissingSCTClusters;
+  std::vector<unsigned int> m_nMissingPixelClusters;
+
+  bool m_reverseIBLlocx;
+
 };
 
 inline bool compareFTK_Clusters (const Trk::RIO_OnTrack* cl1, const Trk::RIO_OnTrack* cl2) {
diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx
index 8209962a828718646c966d833c5f0de3948d7533..0d8acecf02583aff930687157e1c725c48a15283 100644
--- a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx
+++ b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx
@@ -53,6 +53,7 @@
 #include "PixelConditionsServices/IPixelOfflineCalibSvc.h"
 #include "TrkToolInterfaces/ITrackSummaryTool.h"
 #include "TrkTrackSummary/TrackSummary.h"
+#include "FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h"
 #include "FTK_RecToolInterfaces/IFTK_VertexFinderTool.h"
 #include "FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h"
 
@@ -102,11 +103,13 @@ FTK_DataProviderSvc::FTK_DataProviderSvc(const std::string& name, ISvcLocator* s
   m_VertexFinderTool("InDet::InDetIterativePriVxFinderTool"),
   m_RawVertexFinderTool("FTK_VertexFinderTool"),
   m_ROTcreator("Trk::IRIO_OnTrackCreator/FTK_ROTcreatorTool"),
+  m_DuplicateTrackRemovalTool("FTK_DuplicateTrackRemovalTool"),
   m_trainingBeamspotX(0.),
   m_trainingBeamspotY(0.),
   m_trainingBeamspotZ(0.),
   m_trainingBeamspotTiltX(0.),
   m_trainingBeamspotTiltY(0.),
+  m_remove_duplicates(false),
   m_ftk_tracks(nullptr),
   m_conv_tracks(nullptr),
   m_refit_tracks(nullptr),
@@ -147,7 +150,9 @@ FTK_DataProviderSvc::FTK_DataProviderSvc(const std::string& name, ISvcLocator* s
   m_pTscaleFactor(1.),
   m_rejectBadTracks(false),
   m_dPhiCut(0.4),
-  m_dEtaCut(0.6)
+  m_dEtaCut(0.6),
+  m_nErrors(0),
+  m_reverseIBLlocx(false)
 {
   m_pixelBarrelPhiOffsets.reserve(4);
   m_pixelBarrelEtaOffsets.reserve(4);
@@ -161,12 +166,26 @@ FTK_DataProviderSvc::FTK_DataProviderSvc(const std::string& name, ISvcLocator* s
     m_pixelEndCapPhiOffsets.push_back(0.); 
     m_pixelEndCapEtaOffsets.push_back(0.);
   }
+  m_nFailedSCTClusters.reserve(8);
+  m_nMissingSCTClusters.reserve(8);
+  m_nFailedPixelClusters.reserve(4);
+  m_nMissingPixelClusters.reserve(4);
+  for (int ie=0; ie<4; ie++){
+    m_nFailedPixelClusters.push_back(0);
+    m_nMissingPixelClusters.push_back(0);
+  }
+  for (int ie=0; ie<8; ie++){
+    m_nFailedSCTClusters.push_back(0);
+    m_nMissingSCTClusters.push_back(0);
+  }
+
   declareProperty("TrackCollectionName",m_trackCacheName);
   declareProperty("TrackParticleContainerName",m_trackParticleCacheName);
   declareProperty("VertexContainerName",m_vertexCacheName);
   declareProperty("TrackFitter", m_trackFitter);
   declareProperty("UncertaintyTool",m_uncertaintyTool);
   declareProperty("TrackSummaryTool", m_trackSumTool);
+  declareProperty("DuplicateTrackRemovalTool",m_DuplicateTrackRemovalTool);
   declareProperty("TrackParticleCreatorTool", m_particleCreatorTool);
   declareProperty("VertexFinderTool",m_VertexFinderTool);
   declareProperty("ROTcreatorTool",m_ROTcreator);
@@ -194,7 +213,8 @@ FTK_DataProviderSvc::FTK_DataProviderSvc(const std::string& name, ISvcLocator* s
   declareProperty("CorrectSCTClusters",m_correctSCTClusters);
   declareProperty("setBroadPixelClusterOnTrackErrors",m_broadPixelErrors);
   declareProperty("setBroadSCT_ClusterOnTrackErrors",m_broadSCT_Errors);
-
+  declareProperty("RemoveDuplicates",m_remove_duplicates);
+  declareProperty("ReverseIBLlocX",m_reverseIBLlocx, "reverse the direction of IBL locX from FTK");
 
 
 }
@@ -203,6 +223,23 @@ FTK_DataProviderSvc::~FTK_DataProviderSvc(){
 }
 
 
+std::vector<unsigned int> FTK_DataProviderSvc::nMissingSCTClusters() {
+  return m_nMissingSCTClusters;
+}
+
+std::vector<unsigned int> FTK_DataProviderSvc::nMissingPixelClusters() {
+  return m_nMissingPixelClusters;
+}
+
+std::vector<unsigned int> FTK_DataProviderSvc::nFailedSCTClusters() {
+  return m_nFailedSCTClusters;
+}
+
+std::vector<unsigned int> FTK_DataProviderSvc::nFailedPixelClusters() {
+  return m_nFailedPixelClusters;
+}
+
+
 std::string FTK_DataProviderSvc::getTrackParticleCacheName(const bool withRefit) {
   return (withRefit? m_trackParticleCacheName+"Refit": m_trackParticleCacheName);
 }
@@ -240,6 +277,8 @@ StatusCode FTK_DataProviderSvc::initialize() {
   ATH_CHECK(m_particleCreatorTool.retrieve());
   ATH_MSG_INFO( " getting vertexFinderTool tool with name " << m_VertexFinderTool.name());
   ATH_CHECK(m_VertexFinderTool.retrieve());
+  ATH_MSG_INFO( " getting DuplicateTrackRemovalTool tool with name " << m_DuplicateTrackRemovalTool.name());
+  ATH_CHECK(m_DuplicateTrackRemovalTool.retrieve());
   ATH_MSG_INFO( " getting FTK_RawTrackVertexFinderTool tool with name " << m_RawVertexFinderTool.name());
   ATH_CHECK(m_RawVertexFinderTool.retrieve());
   ATH_MSG_INFO( " getting ROTcreator tool with name " << m_ROTcreator.name());
@@ -264,7 +303,7 @@ StatusCode FTK_DataProviderSvc::initialize() {
   ATH_MSG_INFO( " Pixel Barrel Eta Offsets (pixels): " << m_pixelBarrelEtaOffsets);
   ATH_MSG_INFO( " Pixel EndCap Phi Offsets (pixels): " << m_pixelEndCapPhiOffsets);
   ATH_MSG_INFO( " Pixel EndCap Eta Offsets (pixels): " << m_pixelEndCapEtaOffsets);
-
+  if  (m_reverseIBLlocx) ATH_MSG_INFO( "Reversing the direction of IBL LocX");
 
   if (m_correctPixelClusters) {
     ATH_MSG_INFO( " applying all corrections (lorentz, angle,  sag) to Pixel Clusters on converted tracks using RotCreatorTool");
@@ -289,6 +328,81 @@ StatusCode FTK_DataProviderSvc::finalize() {
 }
 
 
+unsigned int FTK_DataProviderSvc::nTrackParticleErrors(const bool withRefit) {
+
+  unsigned int nErrors=0;
+
+  if (withRefit) {
+    for (auto& it : m_refit_tp_map) 
+      if (it==-2) nErrors++;
+  } else {
+    for (auto& it : m_conv_tp_map) 
+      if (it==-2) nErrors++;
+  }    
+  return nErrors;
+
+}
+
+
+unsigned int FTK_DataProviderSvc::nRawTracks() {
+  if (!m_gotRawTracks) getFTK_RawTracksFromSG();
+  return m_ftk_tracks->size();
+}
+
+
+unsigned int FTK_DataProviderSvc::nTracks(const bool withRefit) {
+
+  unsigned int nTrk=0;
+
+  if (withRefit) {
+    for (auto& it : m_refit_track_map) 
+      if (it>=0) nTrk++;
+  } else {
+    for (auto& it : m_conv_track_map) 
+      if (it>=0) nTrk++;
+  }    
+  return nTrk;
+
+}
+
+unsigned int FTK_DataProviderSvc::nTrackParticles(const bool withRefit) {
+
+  unsigned int nTrk=0;
+
+  if (withRefit) {
+    for (auto& it : m_refit_tp_map) 
+      if (it>=0) nTrk++;
+  } else {
+    for (auto& it : m_conv_tp_map) 
+      if (it>=0) nTrk++;
+  }    
+  return nTrk;
+
+}
+
+unsigned int FTK_DataProviderSvc::nTrackErrors(const bool withRefit) {
+
+  unsigned int nErrors=0;
+
+  if (withRefit) {
+    for (auto& it : m_refit_track_map) 
+      if (it==-2) nErrors++;
+  } else {
+    for (auto& it : m_conv_track_map) 
+      if (it==-2) nErrors++;
+  }    
+  return nErrors;
+
+}
+
+
+xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticlesInRoi(const IRoiDescriptor& roi, const bool withRefit, unsigned int& nErrors){
+  m_nErrors=0;
+  xAOD::TrackParticleContainer* tracks = this->getTrackParticlesInRoi(roi, withRefit);
+  nErrors = m_nErrors;
+  return tracks;
+}
+
 xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticlesInRoi(const IRoiDescriptor& roi, const bool withRefit){
 
   ATH_MSG_DEBUG("FTK_DataProviderSvc::getTrackParticlesInRoi called with Refit " << withRefit);
@@ -336,10 +450,12 @@ xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticlesInRoi(const
             } else { //trackLink not valid
               ATH_MSG_ERROR ("invalid ElementLink to m_refit_track_map["<<ftk_track_index<<"] = " << m_refit_track_map[ftk_track_index]);
               m_refit_tp_map[ftk_track_index]=-2;
+	      m_nErrors++;
             }
           } else { // track==nullptr
             ATH_MSG_VERBOSE("Setting m_refit_tp_map["<<  ftk_track_index <<"]=-2");
             m_refit_tp_map[ftk_track_index]=-2;
+	    m_nErrors++;
           }
         }
       }
@@ -376,11 +492,13 @@ xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticlesInRoi(const
               } else {
                 ATH_MSG_ERROR ("invalid ElementLink to m_refit_conv_map["<<ftk_track_index<<"] = " <<m_conv_track_map[ftk_track_index]);
                 m_refit_tp_map[ftk_track_index]=-2;
+		m_nErrors++;
               }
             }
           } else { // track==nullptr
             ATH_MSG_VERBOSE("Setting m_conv_tp_map["<<  ftk_track_index <<"]=-2");
             m_conv_tp_map[ftk_track_index] = -2;
+	    m_nErrors++;
           }
         }
       }
@@ -475,6 +593,17 @@ StatusCode FTK_DataProviderSvc::fillTrackParticleCache(const bool withRefit){
   return  StatusCode::SUCCESS;
 }
 
+
+xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticles(const bool withRefit, unsigned int& nErrors){
+
+  // Return TrackParticleCollection plus number of missing tracks du to errors 
+
+  m_nErrors=0;
+  xAOD::TrackParticleContainer* tracks=this->getTrackParticles(withRefit);
+  nErrors=m_nErrors;
+  return tracks;
+}
+
 xAOD::TrackParticleContainer* FTK_DataProviderSvc::getTrackParticles(const bool withRefit){
 
 #ifdef  FTK_useViewVector
@@ -824,6 +953,14 @@ StatusCode FTK_DataProviderSvc::getVertexContainer(xAOD::VertexContainer* userVe
 }
 
 
+
+TrackCollection* FTK_DataProviderSvc::getTracks(const bool withRefit, unsigned int& nErrors){
+  m_nErrors=0;
+  TrackCollection* tracks = this->getTracks(withRefit);
+  nErrors=m_nErrors;
+  return tracks;
+}
+
 TrackCollection* FTK_DataProviderSvc::getTracks(const bool withRefit){
 
 #ifdef  FTK_useViewVector
@@ -843,7 +980,6 @@ TrackCollection* FTK_DataProviderSvc::getTracks(const bool withRefit){
   ATH_MSG_DEBUG( "getTracks: Raw FTK Container Size = " << m_ftk_tracks->size());
   ATH_MSG_VERBOSE( "getTracks: Converting Tracks");
   for (unsigned int ftk_track_index = 0; ftk_track_index != m_ftk_tracks->size(); ++ftk_track_index){
-
     Trk::Track* track = this->getCachedTrack(ftk_track_index, withRefit);
     if (track != nullptr) userTracks->push_back(track);
   }
@@ -857,6 +993,13 @@ TrackCollection* FTK_DataProviderSvc::getTracks(const bool withRefit){
 
 }
 
+TrackCollection* FTK_DataProviderSvc::getTracksInRoi(const IRoiDescriptor& roi, const bool withRefit, unsigned int& nErrors){
+  m_nErrors=0;
+  TrackCollection* tracks = this->getTracksInRoi(roi,withRefit);
+  nErrors=m_nErrors;
+  return tracks;
+}
+
 TrackCollection* FTK_DataProviderSvc::getTracksInRoi(const IRoiDescriptor& roi, const bool withRefit){
 
 #ifdef  FTK_useViewVector
@@ -883,7 +1026,12 @@ TrackCollection* FTK_DataProviderSvc::getTracksInRoi(const IRoiDescriptor& roi,
     if (roi.isFullscan() || (RoiUtil::containsPhi(roi,ftk_track->getPhi()) && RoiUtil::contains(roi,ftk_track->getZ0(), ftk_track->getCotTh()))) {
     //if (roi.isFullscan() || (roi.containsPhi(ftk_track->getPhi()) && roi.contains(ftk_track->getZ0(), ftk_track->getCotTh()))) {
       Trk::Track* track = this->getCachedTrack(ftk_track_index, withRefit);
-      if (track != nullptr) userTracks->push_back(track);
+      if (track != nullptr) {
+	userTracks->push_back(track);
+      } else {
+	m_nErrors++;
+      } 
+
     }
   }
   if (withRefit) {
@@ -1003,12 +1151,23 @@ void FTK_DataProviderSvc::getFTK_RawTracksFromSG(){
   }
 
   // new event - get the tracks from StoreGate
-
   if (!m_storeGate->contains<FTK_RawTrackContainer>(m_RDO_key)) {
     ATH_MSG_DEBUG( "getFTK_RawTracksFromSG: FTK tracks  "<< m_RDO_key <<" not found in StoreGate !");
-  } else {
-    ATH_MSG_VERBOSE( "getFTK_RawTracksFromSG:  Doing storegate retreive");
-    StatusCode sc = m_storeGate->retrieve(m_ftk_tracks, m_RDO_key);
+  } else {    
+
+    StatusCode sc = StatusCode::SUCCESS;
+    if (m_remove_duplicates){//get all tracks, and then call duplicate removal tool
+      const FTK_RawTrackContainer* temporaryTracks=nullptr;
+      sc = m_storeGate->retrieve(temporaryTracks, m_RDO_key);
+      if (!sc.isFailure()) {
+	ATH_MSG_DEBUG( "getFTK_RawTracksFromSG:  Got " << temporaryTracks->size() << " raw FTK tracks (RDO) from  StoreGate before removeDuplicates");
+	m_ftk_tracks = m_DuplicateTrackRemovalTool->removeDuplicates(temporaryTracks);
+      }
+    }
+    else{//the original way
+      sc = m_storeGate->retrieve(m_ftk_tracks, m_RDO_key);
+    }
+
     if (sc.isFailure()) {
       ATH_MSG_VERBOSE( "getFTK_RawTracksFromSG: Failed to get FTK Tracks Container");
     } else {
@@ -1018,10 +1177,10 @@ void FTK_DataProviderSvc::getFTK_RawTracksFromSG(){
       } else {
 	m_gotRawTracks = true;
       }
-    }
+    }      
   }
-  // Creating collection for pixel clusters
 
+  // Creating collection for pixel clusters
   m_PixelClusterContainer = new InDet::PixelClusterContainer(m_pixelId->wafer_hash_max());
   m_PixelClusterContainer->addRef();
   StatusCode sc = m_storeGate->record(m_PixelClusterContainer,m_PixelClusterContainerName);
@@ -1204,7 +1363,7 @@ Trk::Track* FTK_DataProviderSvc::ConvertTrack(const unsigned int iTrack){
   // Find if the track includes IBL - needed for the error calculaton 
   for( unsigned int cluster_number = 0; cluster_number < track.getPixelClusters().size(); ++cluster_number){
     if ( !track.isMissingPixelLayer(cluster_number)) {
-      Identifier wafer_id = m_pixelId->wafer_id(track.getPixelClusters()[cluster_number].getModuleID());
+      Identifier wafer_id = m_pixelId->wafer_id(Identifier(track.getPixelClusters()[cluster_number].getModuleID()));
       if (m_pixelId->barrel_ec(wafer_id)==0 && m_pixelId->layer_disk(wafer_id)==0) {
 	hasIBL=true;
 	break;
@@ -1276,6 +1435,7 @@ Trk::Track* FTK_DataProviderSvc::ConvertTrack(const unsigned int iTrack){
     if ( track.isMissingPixelLayer(cluster_number)) {
 
       ATH_MSG_VERBOSE( " No hit for layer " << cluster_number);
+      m_nMissingPixelClusters[cluster_number]++;
       continue;
     }
     if (raw_pixel_cluster.getModuleID()==0){
@@ -1285,6 +1445,7 @@ Trk::Track* FTK_DataProviderSvc::ConvertTrack(const unsigned int iTrack){
     const Trk::RIO_OnTrack* pixel_cluster_on_track = createPixelCluster(raw_pixel_cluster,*trkPerigee);
     if (pixel_cluster_on_track==nullptr){
       ATH_MSG_WARNING(" PixelClusterOnTrack failed to create cluster " << cluster_number);
+      m_nFailedPixelClusters[cluster_number]++;
     } else {
 
       clusters.push_back(pixel_cluster_on_track);
@@ -1311,6 +1472,7 @@ Trk::Track* FTK_DataProviderSvc::ConvertTrack(const unsigned int iTrack){
     FTK_RawSCT_Cluster raw_cluster = track.getSCTCluster(cluster_number);
     if ( track.isMissingSCTLayer(cluster_number)) {
       ATH_MSG_VERBOSE( "  No SCT Hit for layer "  << cluster_number);
+      m_nMissingSCTClusters[cluster_number]++;
       continue;
     }
     const Trk::RIO_OnTrack* sct_cluster_on_track = createSCT_Cluster(raw_cluster, *trkPerigee);
@@ -1318,6 +1480,7 @@ Trk::Track* FTK_DataProviderSvc::ConvertTrack(const unsigned int iTrack){
 	
     if (sct_cluster_on_track==nullptr){
       ATH_MSG_WARNING(" SCT_ClusterOnTrack failed to create cluster " <<  cluster_number);
+      m_nFailedSCTClusters[cluster_number]++;
     } else {
       
       ATH_MSG_VERBOSE( cluster_number << ": r= " << std::sqrt(std::pow(sct_cluster_on_track->globalPosition().x(),2)+std::pow(sct_cluster_on_track->globalPosition().y(),2))
@@ -1610,7 +1773,7 @@ const Trk::RIO_OnTrack*  FTK_DataProviderSvc::createPixelCluster(const FTK_RawPi
 
   ATH_MSG_VERBOSE( "FTK_DataProviderSvc::createPixelCluster: raw FTK cluster position: " <<
       " Row(phi): " <<  raw_pixel_cluster.getRowCoord() << " Col(eta): " << raw_pixel_cluster.getColCoord() <<
-      " RowWidth: " << raw_pixel_cluster.getRowWidth()+1 << " ColWidth: " << raw_pixel_cluster.getColWidth()+1);
+      " RowWidth: " << raw_pixel_cluster.getRowWidth() << " ColWidth: " << raw_pixel_cluster.getColWidth());
 
   unsigned int layer = m_pixelId->layer_disk(wafer_id);
   bool isBarrel = (m_pixelId->barrel_ec(wafer_id)==0);
@@ -1628,7 +1791,14 @@ const Trk::RIO_OnTrack*  FTK_DataProviderSvc::createPixelCluster(const FTK_RawPi
   ATH_MSG_VERBOSE( " Module rows= " << design->rows() << " phiPitch= " << design->phiPitch() << " width= " << design->width() );
   ATH_MSG_VERBOSE( " columns = " << design->columns() << " etaPitch= " << design->etaPitch() <<  " length " << design->length());
 
-  int rawLocalPhiCoord = raw_pixel_cluster.getRowCoord();
+  int rawLocalPhiCoord;
+  
+  if (m_reverseIBLlocx && isBarrel && layer==0) {
+    rawLocalPhiCoord = 2680 -  raw_pixel_cluster.getRowCoord(); //335*8=2680
+  } else {
+    rawLocalPhiCoord = raw_pixel_cluster.getRowCoord();
+  }
+
   int rawLocalEtaCoord= raw_pixel_cluster.getColCoord();
 
   const InDetDD::SiCellId cornerCell(0, 0);
@@ -1638,6 +1808,8 @@ const Trk::RIO_OnTrack*  FTK_DataProviderSvc::createPixelCluster(const FTK_RawPi
 
   ATH_MSG_VERBOSE( " local position of pixel at (0,0) is "<<  phi0 << ",  " << eta0);
 
+
+
   // zero is center of the row coordinates, so to find the cell we can use it, units of 6.25 microns
   // zero is edge of the column coordinates, so to find the cell we add 0.5, units of 25 microns
   double phiPos = ((double) rawLocalPhiCoord) * 6.25e-3 + phi0; // rawLocalPhiCoord=0 is the centre of the zeroth pixel
@@ -1682,8 +1854,8 @@ const Trk::RIO_OnTrack*  FTK_DataProviderSvc::createPixelCluster(const FTK_RawPi
   Identifier pixel_id = m_pixelId->pixel_id(wafer_id, phi_index, eta_index);
 
 
-  int phiWidth    = raw_pixel_cluster.getRowWidth();
-  int etaWidth    = raw_pixel_cluster.getColWidth();
+  int phiWidth    = std::max(raw_pixel_cluster.getRowWidth(),1u);
+  int etaWidth    = std::max(raw_pixel_cluster.getColWidth(),1u);
 
   int colMin = (int)(eta_index-0.5*etaWidth);
   int colMax = colMin+etaWidth;
@@ -1951,5 +2123,11 @@ void FTK_DataProviderSvc::handle(const Incident& incident) {
     m_got_fast_vertex_refit = false;
     m_got_fast_vertex_conv = false;
     m_got_fast_vertex_raw = false;
+    m_nErrors=0;
+    for (auto& it :  m_nFailedSCTClusters) it=0;
+    for (auto& it :  m_nFailedPixelClusters) it=0;
+    for (auto& it :  m_nMissingSCTClusters) it=0;
+    for (auto& it :  m_nMissingPixelClusters) it=0;
+
   }
 }
diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
index 09233cc96120d071a87272592f3255dcadd5e01d..a771a55af75450e2aec8c231e389d7c9d202acc1 100644
--- a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
+++ b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration 
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -39,7 +39,6 @@ FTK_UncertaintyTool::FTK_UncertaintyTool(const std::string& t,
 StatusCode FTK_UncertaintyTool::initialize() {
 
   StatusCode sc = AlgTool::initialize();
-  MsgStream athenaLog(msgSvc(), name());
 
   //
   //   Load Constants
@@ -50,7 +49,7 @@ StatusCode FTK_UncertaintyTool::initialize() {
     LoadConstants();
 
 
-  athenaLog << MSG::INFO << "FTK_UncertaintyTool initialized "<< endmsg;
+  ATH_MSG_INFO("FTK_UncertaintyTool initialized ");
   return sc;
 }
 
@@ -64,9 +63,7 @@ StatusCode FTK_UncertaintyTool::finalize() {
 //
 double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL, int id0, int id1)
 {
-  MsgStream athenaLog(msgSvc(), name());
-  int outputLevel = msgSvc()->outputLevel( name() );
-  athenaLog << MSG::VERBOSE << "In getParamCovMtx: id0: " << id0 << " id1: " << id1 << endmsg; 
+  ATH_MSG_VERBOSE("In getParamCovMtx: id0: " << id0 << " id1: " << id1); 
 
 
   //
@@ -76,22 +73,19 @@ double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL,
     return 0.;
   }
 
-  if(outputLevel <= MSG::DEBUG)
-    athenaLog << MSG::DEBUG << "FTK_UncertaintyTool:: has BL " << hasIBL << endmsg; 
+  ATH_MSG_DEBUG("FTK_UncertaintyTool:: has BL " << hasIBL); 
   
   double trkIpt = trk.getInvPt();  
   double trkTheta = atan2(1.0,trk.getCotTh());
   double trkEta = -log(tan(trkTheta/2));
 
-  if(outputLevel <= MSG::VERBOSE){
-    athenaLog << MSG::VERBOSE << "FTK_UncertaintyTool:: trkIpt " << trkIpt << endmsg; 
-    athenaLog << MSG::VERBOSE << "FTK_UncertaintyTool:: trkEta " << trkEta << endmsg; 
-  }
+  ATH_MSG_VERBOSE("FTK_UncertaintyTool:: trkIpt " << trkIpt);
+  ATH_MSG_VERBOSE("FTK_UncertaintyTool:: trkEta " << trkEta); 
 
   double sigmaTP = -1.0;
 
   //
-  //  Uncertianties are stored using eta and 1/pt
+  //  Uncertainties are stored using eta and 1/pt
   //
   int lookUpParam = id0;
 
@@ -111,28 +105,25 @@ double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL,
   //
   if(allConsts[hasIBL].mode(lookUpParam,trkEta) == FTK_UncertaintyTool::sqroot){
     sigmaTP = sqrt(allConsts[hasIBL].par0(lookUpParam,trkEta)+allConsts[hasIBL].par1(lookUpParam,trkEta)*trkIpt*trkIpt);
-    if(outputLevel <= MSG::DEBUG){
-      athenaLog << MSG::DEBUG << "FTK_UncertaintyTool:: sigmaTP ("   
-		<< sigmaTP <<") = sqrt("<<allConsts[hasIBL].par0(lookUpParam,trkEta) 
-		<< "+" << allConsts[hasIBL].par1(lookUpParam,trkEta) << "*" << trkIpt << "**2)" <<  endmsg; 
-      athenaLog << MSG::DEBUG << "FTK_UncertaintyTool:: (sqrt)cov "   << sigmaTP*sigmaTP << endmsg; 
-    }
+    ATH_MSG_DEBUG("FTK_UncertaintyTool:: sigmaTP ("   
+		  << sigmaTP <<") = sqrt("<<allConsts[hasIBL].par0(lookUpParam,trkEta) 
+		  << "+" << allConsts[hasIBL].par1(lookUpParam,trkEta) << "*" << trkIpt << "**2)");
+    ATH_MSG_DEBUG("FTK_UncertaintyTool:: (sqrt)cov "   << sigmaTP*sigmaTP); 
+    
     
   //
   // linear model
   //
   }else{
     sigmaTP = allConsts[hasIBL].par0(lookUpParam,trkEta) + allConsts[hasIBL].par1(lookUpParam,trkEta)*fabs(trkIpt);
-    if(outputLevel <= MSG::DEBUG){
-      athenaLog << MSG::DEBUG << "FTK_UncertaintyTool:: sigmaTP ("   
-		<< sigmaTP <<") = "<<allConsts[hasIBL].par0(lookUpParam,trkEta) 
-		<< "+" << allConsts[hasIBL].par1(lookUpParam,trkEta) << "*" << fabs(trkIpt) <<  endmsg; 
-      athenaLog << MSG::DEBUG << "FTK_UncertaintyTool:: (linear)cov "   << sigmaTP*sigmaTP << endmsg; 
-    }
+    ATH_MSG_DEBUG("FTK_UncertaintyTool:: sigmaTP ("   
+		  << sigmaTP <<") = "<<allConsts[hasIBL].par0(lookUpParam,trkEta) 
+		  << "+" << allConsts[hasIBL].par1(lookUpParam,trkEta) << "*" << fabs(trkIpt)); 
+    ATH_MSG_DEBUG("FTK_UncertaintyTool:: (linear)cov "   << sigmaTP*sigmaTP); 
   }
 
   if(sigmaTP < 0)
-    athenaLog << MSG::ERROR << " sigma TP" << sigmaTP << endmsg;
+    ATH_MSG_ERROR(" sigma TP" << sigmaTP);
 
   //
   // Convert eta to theta
diff --git a/Trigger/TrigFTK/FTK_RecToolInterfaces/FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h b/Trigger/TrigFTK/FTK_RecToolInterfaces/FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc4fbffa813afd924436d23d9d18e2cd873c901f
--- /dev/null
+++ b/Trigger/TrigFTK/FTK_RecToolInterfaces/FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h
@@ -0,0 +1,25 @@
+
+//abstract interface
+
+#ifndef __IFTK_DUPLICATETRACKREMOVAL_TOOL_H__
+#define __IFTK_DUPLICATETRACKREMOVAL_TOOL_H__
+
+#include "GaudiKernel/IAlgTool.h"
+#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
+
+static const InterfaceID IID_IFTK_DuplicateTrackRemovalTool("IFTK_DuplicateTrackRemovalTool",1,0);
+
+class IFTK_DuplicateTrackRemovalTool : virtual public IAlgTool { 
+
+ public:
+  /** other standard AlgTool methods */
+  static const InterfaceID& interfaceID ()   //!< the Tool's interface
+  {  return IID_IFTK_DuplicateTrackRemovalTool; }  	
+
+  virtual FTK_RawTrackContainer* removeDuplicates(const FTK_RawTrackContainer* trks) = 0;
+
+ private:
+
+};
+
+#endif
diff --git a/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_DuplicateTrackRemovalTool.h b/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_DuplicateTrackRemovalTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..45f4f573350175b857503eb7059a3f00b6b5b02f
--- /dev/null
+++ b/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_DuplicateTrackRemovalTool.h
@@ -0,0 +1,48 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// FTK_DuplicateTrackRemovalTool tool
+// -------------------------------
+// Remove duplicate (overlapping) tracks
+// June 2017: Tool created
+// Author: Andy Haas, NYU
+// e-mail: ahaas@cern.ch
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef __TRIG_FTK_DUPLICATETRACKREMOVAL_TOOL_H__
+#define __TRIG_FTK_DUPLICATETRACKREMOVAL_TOOL_H__
+
+#include "GaudiKernel/ToolHandle.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "FTK_RecToolInterfaces/IFTK_DuplicateTrackRemovalTool.h"
+#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
+#include <map>
+
+//#define FTKDuplicateTrackRemovalTiming
+#define FTKDuplicateTrackRemovalUseMap
+//#define FTKDuplicateTrackRemovalTestMultiple
+
+class FTK_DuplicateTrackRemovalTool : public AthAlgTool, virtual public IFTK_DuplicateTrackRemovalTool
+{
+ public:
+  FTK_DuplicateTrackRemovalTool( const std::string&, const std::string&, const IInterface* );
+  virtual ~FTK_DuplicateTrackRemovalTool(){};
+  virtual StatusCode initialize();
+  virtual  StatusCode finalize  ();
+  FTK_RawTrackContainer* removeDuplicates(const FTK_RawTrackContainer* trks);
+ private:
+    FTK_RawTrackContainer* m_trks_nodups;
+    bool match(const FTK_RawTrack* track, const FTK_RawTrack* oldtrack) const;
+    const FTK_RawTrack* besttrack(const FTK_RawTrack* track, const FTK_RawTrack* oldtrack) const;
+    int m_HW_ndiff;
+    double m_dphi_roughmatch;
+#ifdef FTKDuplicateTrackRemovalUseMap
+    std::map<double, std::vector<unsigned int> > phimap;//keep track of the phi of tracks in the output container - at each phi there could be a vector of track indices...
+    void addtophimap(double trackphi, unsigned int pos);
+    void removefromphimap(double trackphi, unsigned int pos);
+#endif
+};
+
+#endif
diff --git a/Trigger/TrigFTK/FTK_RecTools/src/FTK_DuplicateTrackRemovalTool.cxx b/Trigger/TrigFTK/FTK_RecTools/src/FTK_DuplicateTrackRemovalTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c9af56a9d02ab580ad7a59d2f0b7853f8260d7b5
--- /dev/null
+++ b/Trigger/TrigFTK/FTK_RecTools/src/FTK_DuplicateTrackRemovalTool.cxx
@@ -0,0 +1,303 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "FTK_RecTools/FTK_DuplicateTrackRemovalTool.h"
+#include <vector>
+#include "TVector2.h"
+#include "CLHEP/Units/PhysicalConstants.h"
+
+FTK_DuplicateTrackRemovalTool::FTK_DuplicateTrackRemovalTool(const std::string& t,
+                                               const std::string& n,
+                                               const IInterface*  p ):
+  AthAlgTool(t,n,p),
+  m_trks_nodups(NULL),
+  m_HW_ndiff(6),
+  m_dphi_roughmatch(0.3)
+{
+  declareInterface< IFTK_DuplicateTrackRemovalTool >( this );
+  declareProperty("HW_ndiff",m_HW_ndiff);
+  declareProperty("dphi_roughmatch",m_dphi_roughmatch);
+}
+
+StatusCode FTK_DuplicateTrackRemovalTool::initialize() {
+
+  StatusCode sc = AlgTool::initialize();
+  MsgStream athenaLog(msgSvc(), name());
+
+  m_trks_nodups = new FTK_RawTrackContainer(SG::VIEW_ELEMENTS);//we don't own the tracks, we're just going to hold them
+
+  athenaLog << MSG::INFO << "FTK_DuplicateTrackRemovalTool initialized "<< endmsg;
+  return sc;
+}
+
+StatusCode FTK_DuplicateTrackRemovalTool::finalize() {
+  StatusCode sc = AlgTool::finalize();
+  m_trks_nodups->clear();
+  delete m_trks_nodups;
+  return sc;
+}
+
+//tell whether the two tracks match, based on number of matching hits and unmatching hits
+bool FTK_DuplicateTrackRemovalTool::match(const FTK_RawTrack* track, const FTK_RawTrack* oldtrack) const {
+
+	const std::vector<FTK_RawPixelCluster>& pixclus = track->getPixelClusters();
+	const std::vector<FTK_RawSCT_Cluster>& sctclus = track->getSCTClusters();
+
+	//Note to self: Clusters are made from sim in FTK_RDO_CreatorAlgo...
+
+	int nclus = pixclus.size() + sctclus.size();
+	int nmatchingclus=0;
+	int nclusleft=12;// there's at most 12 hits, 4 pixel and 8 sct
+	const std::vector<FTK_RawPixelCluster>& oldpixclus = oldtrack->getPixelClusters();
+	for (auto clus : pixclus){
+		//is this pixel clus matched by any on the old track?
+		unsigned int id = clus.getModuleID();
+		for (auto oldclus : oldpixclus){
+			if (oldclus.getModuleID()==id){ // if the ID matches, it's on the same module // stored in WordA
+				if (clus.getWordB()==oldclus.getWordB()) { // is it the same eta and phi position and width? // stored in WordB
+					nmatchingclus++;
+
+					//it matches if the number of unmatched clusters is <= 6 (or HW_diff)
+					if ( (nclus-nmatchingclus) <= m_HW_ndiff){ //corresponding criteria in simulation
+						return true; //return as soon as we know the answer!
+					}
+					break; //we already found a matching cluster to this cluster, so no need to look for more matches to this cluster
+				}
+			}
+		}//loop over old tracks' clusters
+		nclusleft--;
+		if ((nclus-nmatchingclus-nclusleft)>m_HW_ndiff) return false; // no way we can get there with just nclusleft remaining
+	}
+
+	const std::vector<FTK_RawSCT_Cluster>& oldsctclus = oldtrack->getSCTClusters();
+	for (auto clus : sctclus){
+		//is this sct clus matched by any on the old track?
+		unsigned int id = clus.getWord();
+		for (auto oldclus : oldsctclus){
+			if (oldclus.getWord()==id){ // if the word matches, it's the same dude
+				nmatchingclus++;
+
+				//it matches if the number of unmatched clusters is <= 6 (or HW_diff)
+				if ( (nclus-nmatchingclus) <= m_HW_ndiff){ //corresponding criteria in simulation
+					return true; //return as soon as we know the answer!
+				}
+				break; //we already found a matching cluster to this cluster, so no need to look for more matches to this cluster
+			}
+		}//loop over old tracks' clusters
+		nclusleft--;
+		if ((nclus-nmatchingclus-nclusleft)>m_HW_ndiff) return false; // no way we can get there with just nclusleft remaining
+	}
+
+	//ATH_MSG_DEBUG("Found "<<nmatchingpixclus<<" matching pix clus out of "<<pixclus.size());
+	//ATH_MSG_DEBUG("Found "<<nmatchingsctclus<<" matching sct clus out of "<<sctclus.size());
+
+	//ATH_MSG_VERBOSE("ACH888: "<<matching<<" "<<track->getSectorID()<<" "<<track->getPhi()<<" "<<track->getCotTh()<<" "<<track->getZ0()<<" "<<oldtrack->getSectorID()<<" "<<oldtrack->getPhi()<<" "<<oldtrack->getCotTh()<<" "<<oldtrack->getZ0());
+	return false;
+}
+
+//return the better of two tracks, based on number of missing layers, and if those tie, chi2
+const FTK_RawTrack* FTK_DuplicateTrackRemovalTool::besttrack(const FTK_RawTrack* track, const FTK_RawTrack* oldtrack) const {
+	//return track;//ACH-temporary test to see if this is slow
+
+	unsigned int trackhits = track->getPixelClusters().size()+track->getSCTClusters().size();
+	unsigned int oldtrackhits = oldtrack->getPixelClusters().size()+oldtrack->getSCTClusters().size();
+	if (trackhits > oldtrackhits) return track;
+	if (oldtrackhits > trackhits) return oldtrack;
+
+	//in case of a tie, use chi2
+	if (track->getChi2() < oldtrack->getChi2()) return track; // smaller chi2 wins
+	else return oldtrack;
+}
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+void FTK_DuplicateTrackRemovalTool::addtophimap(double trackphi, unsigned int pos){
+	phimap[trackphi].push_back(pos);//add it to the map
+
+	//check that track phi is within -pi to pi
+	if (trackphi<(-CLHEP::pi-0.1)) ATH_MSG_WARNING("FTK track with phi < -pi! "<<trackphi);
+	else if (trackphi>(CLHEP::pi+0.1)) ATH_MSG_WARNING("FTK track with phi > pi! "<<trackphi);
+
+	//add extra copy in case of wraparound
+	if (trackphi>(CLHEP::pi-m_dphi_roughmatch)) phimap[trackphi-CLHEP::twopi].push_back(pos);
+	else if (trackphi<(-CLHEP::pi+m_dphi_roughmatch)) phimap[trackphi+CLHEP::twopi].push_back(pos);
+}
+void FTK_DuplicateTrackRemovalTool::removefromphimap(double oldtrackphi, unsigned int e){
+
+	//remove the old track from the map
+	auto& vec = phimap[oldtrackphi];
+	auto ind = std::find(vec.begin(),vec.end(),e);
+	if (ind==vec.end()) ATH_MSG_WARNING("Wasn't in the map?! "<<oldtrackphi<<" "<<e);
+	else vec.erase(ind);
+
+	//take of removing wraparound entries
+	if (oldtrackphi>(CLHEP::pi-m_dphi_roughmatch)) {
+		vec = phimap[oldtrackphi-CLHEP::twopi];
+		auto ind = std::find(vec.begin(),vec.end(),e);
+		if (ind==vec.end()) ATH_MSG_WARNING("Wasn't in the map?! "<<oldtrackphi<<" "<<e);
+		else vec.erase(ind);
+	}
+	else if (oldtrackphi<(-CLHEP::pi+m_dphi_roughmatch)) {
+		vec = phimap[oldtrackphi+CLHEP::twopi];
+		auto ind = std::find(vec.begin(),vec.end(),e);
+		if (ind==vec.end()) ATH_MSG_WARNING("Wasn't in the map?! "<<oldtrackphi<<" "<<e);
+		else vec.erase(ind);
+	}
+}
+#endif
+
+FTK_RawTrackContainer* FTK_DuplicateTrackRemovalTool::removeDuplicates(const FTK_RawTrackContainer* trks){
+
+#ifdef FTKDuplicateTrackRemovalTiming
+  clock_t tStart = clock();
+  for (int tim=0;tim<1000;++tim){
+#endif
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+	  phimap.clear();
+	  std::set<unsigned int> trackstokill;
+#endif
+
+  ATH_MSG_DEBUG("I'm in removeDuplicates!");
+  m_trks_nodups->clear();
+  m_trks_nodups->reserve(trks->size());
+  for (unsigned int i = 0; i!=trks->size(); i++) {
+	  const FTK_RawTrack *track = trks->at(i);
+
+	  //now we should see whether this track overlaps with one (or more?) tracks already in the nodups container
+	  std::vector<unsigned int> matching_oldtracks;
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+	  //search just the range of phi in the map of old tracks near the phi of this new track
+	  //the map goes from -pi-dphi_roughmatch to pi+dphi_roughmatch, to handle wraparound
+	  double trackphi = track->getPhi();
+	  auto lower = phimap.lower_bound(trackphi-m_dphi_roughmatch);
+	  auto upper = phimap.upper_bound(trackphi+m_dphi_roughmatch);
+	  for (auto it=lower; it!=upper; it++){
+		  for (unsigned int e : it->second) {//these are the indices of the old tracks at each phi value in the phi range
+			  //ATH_MSG_DEBUG("Looking for match of track "<<i<<" with oldtrack "<<e);
+			  const FTK_RawTrack *oldtrack = m_trks_nodups->at(e);
+			  if (this->match(track,oldtrack)) {
+				  matching_oldtracks.push_back(e);
+			  }
+		  }
+	  }
+#else
+	  //loop over all old tracks and see if they match
+	  for (unsigned int e = 0; e!=m_trks_nodups->size(); e++) {
+		  const FTK_RawTrack *oldtrack = m_trks_nodups->at(e);
+
+		  //first check for a rough match in phi
+		  double dphi = TVector2::Phi_mpi_pi(track->getPhi()-oldtrack->getPhi());//make sure it's in -pi..pi
+		  dphi = fabs(dphi);//then take abs since we don't care about sign
+		  if (dphi>m_dphi_roughmatch) continue;//no match if dphi is larger than dphi_roughmatch, 0.3 by default
+
+		  if (this->match(track,oldtrack)) {
+			  matching_oldtracks.push_back(e);
+		  }
+	  }
+#endif
+
+	  //ATH_MSG_DEBUG("Found "<<matching_oldtracks.size()<<" old tracks matching track "<<i);
+	  if (matching_oldtracks.size()==0){//if there's no match, just add the new track
+#ifdef FTKDuplicateTrackRemovalTestMultiple
+		  for (int j=0; j<3; ++j){ // ACH - temporary test - add multiple times, to test multiple matches!
+#endif
+#ifdef FTKDuplicateTrackRemovalUseMap
+		  addtophimap(trackphi,m_trks_nodups->size());//so e.g. the first track will be index 0, since the size is 0 just before we push_back the first track
+#endif
+		  m_trks_nodups->push_back((FTK_RawTrack*)track);
+#ifdef FTKDuplicateTrackRemovalTestMultiple
+		  } // ACH - temporary test - add multiple times, to test multiple matches!
+#endif
+	  }
+
+	  //if it does match, either replace the matching track(s) with this new track, or ignore this new track, depending on which track we like best
+	  else if (matching_oldtracks.size()==1){
+		  unsigned int e = matching_oldtracks[0];
+		  const FTK_RawTrack *oldtrack = m_trks_nodups->at(e);
+		  const FTK_RawTrack *besttrack = this->besttrack(track,oldtrack);
+		  if (besttrack==track){
+#ifdef FTKDuplicateTrackRemovalUseMap
+			  removefromphimap(oldtrack->getPhi(),e);//remove the old track from the map
+			  addtophimap(trackphi,e);//add the new track to the map
+#endif
+			  m_trks_nodups->at(e)=(FTK_RawTrack*)track;
+		  }
+		  else{
+			  //nothing to do - the better track was already in the output container
+		  }
+	  }
+
+	  else { // more than 1 matching existing track (yet the existing matching tracks did not match each other)
+		  ATH_MSG_WARNING("Found multiple tracks ("<<matching_oldtracks.size()<<") matching track "<<i);
+
+		  // is the new track better than all the matching old tracks?
+		  bool newisbest = true;//start with an optimistic attitude!
+		  for (unsigned int e : matching_oldtracks){
+			  const FTK_RawTrack *oldtrack = m_trks_nodups->at(e);
+			  const FTK_RawTrack *besttrack = this->besttrack(track,oldtrack);
+			  if (besttrack!=track){
+				  newisbest=false; // guess we're not the best, give up!
+				  break;
+			  }
+		  }
+
+		  // if the new track is better than all the matching old tracks, remove the old tracks and add this one, otherwise do nothing (the new track is dropped)
+		  if (newisbest){
+			  //yikes, we're better than all the matching old tracks
+			  bool replacedfirsttrack = false;//I want to check that the algorithm really replaces the first old track with the new one, and just once
+			  for (unsigned int e : matching_oldtracks){
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+				  removefromphimap(m_trks_nodups->at(e)->getPhi(),e);
+#endif
+				  if (e==matching_oldtracks[0]) {//this should be a little faster than removing all the old matching tracks and then adding the new one
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+					  addtophimap(trackphi,e);
+#endif
+					  m_trks_nodups->at(e)=(FTK_RawTrack*)track; // replace the first matching track with this new track
+					  if (replacedfirsttrack) ATH_MSG_WARNING("We already did replace the first matching track!");
+					  replacedfirsttrack=true;//just check that we really did it!
+				  }
+				  else {
+					  //remove the old matching tracks beyond the first  one
+#ifdef FTKDuplicateTrackRemovalUseMap
+					  trackstokill.insert(e);//we'll remove these from the tracks returned at the end of the day, so we don't screw up the map in the meantime
+#else
+					  m_trks_nodups->erase(m_trks_nodups->begin()+e); // yes this is really the way you remove an element from a vector, you have to pass in the iterator
+#endif
+				  }
+			  }
+			  if (!replacedfirsttrack)  ATH_MSG_WARNING("Why did I not replace the first track?!");
+
+		  } // new track is best one
+
+	  } // deciding what to do based on the number of matches
+
+  } // loop over incoming tracks
+
+#ifdef FTKDuplicateTrackRemovalUseMap
+  //remove those tracks that we flagged for killing
+  if (trackstokill.size()){
+	  ATH_MSG_WARNING("Killing an extra "<<trackstokill.size()<<" tracks from multiple matches");
+	  FTK_RawTrackContainer* trks_nodups_temp  = new FTK_RawTrackContainer(SG::VIEW_ELEMENTS);//we don't own the tracks, we're just going to hold them
+	  for (unsigned int e = 0; e!=m_trks_nodups->size(); e++) {
+		  if (std::find(trackstokill.begin(),trackstokill.end(),e)==trackstokill.end()) trks_nodups_temp->push_back((FTK_RawTrack*)m_trks_nodups->at(e));
+	  }
+	  m_trks_nodups->clear();
+	  delete m_trks_nodups;
+	  m_trks_nodups = trks_nodups_temp;
+  }
+#endif
+
+#ifdef FTKDuplicateTrackRemovalTiming
+  } // loop over doing the removal
+  clock_t tEnd = clock();
+  double elapsed_secs = double(tEnd - tStart) / CLOCKS_PER_SEC;
+  ATH_MSG_INFO("Time taken: "<<elapsed_secs<<" ms");//it's "ms", not "s", since we did 1000 times
+#endif
+
+  return m_trks_nodups;
+}
diff --git a/Trigger/TrigFTK/FTK_RecTools/src/components/FTK_RecTools_entries.cxx b/Trigger/TrigFTK/FTK_RecTools/src/components/FTK_RecTools_entries.cxx
index f376046dab2dd39d49f034fe50f97b6bb725c999..ee4c8bcdf7c0fc3635a6597d65705c74b5435457 100644
--- a/Trigger/TrigFTK/FTK_RecTools/src/components/FTK_RecTools_entries.cxx
+++ b/Trigger/TrigFTK/FTK_RecTools/src/components/FTK_RecTools_entries.cxx
@@ -3,13 +3,16 @@
 #include "FTK_RecTools/FTK_VertexFinderTool.h"
 #include "FTK_RecTools/FTK_PixelClusterOnTrackTool.h"
 #include "FTK_RecTools/FTK_SCTClusterOnTrackTool.h"
+#include "FTK_RecTools/FTK_DuplicateTrackRemovalTool.h"
 
 DECLARE_TOOL_FACTORY(FTK_VertexFinderTool)
 DECLARE_TOOL_FACTORY(FTK_PixelClusterOnTrackTool)
 DECLARE_TOOL_FACTORY(FTK_SCTClusterOnTrackTool)
+DECLARE_TOOL_FACTORY(FTK_DuplicateTrackRemovalTool)
 
 DECLARE_FACTORY_ENTRIES(FTK_RecTools) {
   DECLARE_TOOL(FTK_VertexFinderTool)
   DECLARE_TOOL(FTK_PixelClusterOnTrackTool)
   DECLARE_TOOL(FTK_SCTClusterOnTrackTool)
+  DECLARE_TOOL(FTK_DuplicateTrackRemovalTool)
 }
diff --git a/Trigger/TrigFTK/TrigFTKSim/python/FTKSimOptions.py b/Trigger/TrigFTK/TrigFTKSim/python/FTKSimOptions.py
index 208201e717d376a1d9e83c15c373a3d937f1bb71..96308763e810fdc5470570daf48f8edd0e8d6b30 100644
--- a/Trigger/TrigFTK/TrigFTKSim/python/FTKSimOptions.py
+++ b/Trigger/TrigFTK/TrigFTKSim/python/FTKSimOptions.py
@@ -3,8 +3,16 @@
 import PyJobTransforms.trfExceptions as trfExceptions
 import PyJobTransforms.trfArgClasses as trfArgClasses
 
+
+def addTrigFTKAthenaOptions(parser):
+    parser.defineArgGroup('Athena', 'General Athena Options')
+    parser.add_argument('--asetup', group='Athena', type=trfArgClasses.argFactory(trfArgClasses.argSubstep, runarg=False), nargs='+', metavar='substep:ASETUP',
+                        help='asetup command string to be run before this substep is executed')
+    return None
+
 def addTrigFTKSimOptions(parser,nsubregions=4):
     parser.defineArgGroup('TrigFTKSim', 'Fast tracker simulation generic options')
+
     parser.add_argument('--NBanks', type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True),
                         help='Number of pattern banks', group='TrigFTKSim')
     # Here we set a default value as the merger wants this explicitly
@@ -33,7 +41,7 @@ def addTrigFTKSimOptions(parser,nsubregions=4):
     parser.add_argument('--UseCompressedBank', type=trfArgClasses.argFactory(trfArgClasses.argBool, runarg=True),
                         help='use compressed bank algorithm', group='TrigFTKSim')
 
-    parser.add_argument('--ReadFTKHits', type=trfArgClasses.argFactory(trfArgClasses.argBool, runarg= True),
+    parser.add_argument('--ReadFTKHits', type=trfArgClasses.argFactory(trfArgClasses.argBool, runarg=True),
                             help='Read FTKHits directly', group='TrigFTKSim')
 
     # Cannot take maxEvents as an argument from addAthenaArguments() as it will have the wrong
@@ -217,15 +225,15 @@ def addTrigFTKSimTFOptions(parser):
                         help="Print SSB Constants in firmware-style", group='TrigFTKTrackFitter')
 
     parser.add_argument('--dTIBL', type=trfArgClasses.argFactory(trfArgClasses.argFloat, runarg=True),
-                        help="dT for IBL temperature shifts in SSB fit.", group='TrigFTKSim')
+                        help="dT for IBL temperature shifts in SSB fit.", group='TrigFTKTrackFitter')
 
 
     parser.add_argument('--doAuxFW', type=trfArgClasses.argFactory(trfArgClasses.argBool, runarg=True),
-                        help="Enables firmware-style constants", group='TrigFTKSim')
+                        help="Enables firmware-style constants", group='TrigFTKTrackFitter')
     parser.add_argument('--MaxNcomb', type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True),
-                        help="Limit on the number of combinations per road", group='TrigFTKSim')
+                        help="Limit on the number of combinations per road", group='TrigFTKTrackFitter')
     parser.add_argument('--MaxNhitsPerPlane', type=trfArgClasses.argFactory(trfArgClasses.argInt, runarg=True),
-                        help="limit the number of hits per plane per road", group='TrigFTKSim')
+                        help="limit the number of hits per plane per road", group='TrigFTKTrackFitter')
 
     parser.add_argument("--Save1stStageTrks", type=trfArgClasses.argFactory(trfArgClasses.argBool, runarg=True),
                         help="Save the tracks after the first stage", group='TrigFTKTrackFitter')
diff --git a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM1Un_tf.py b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM1Un_tf.py
index eedc64f93b64aca8d8a7a3a45d13ccb43c04c1cf..2359842feeb7f333b4a5b46f995df2e3723f32e2 100755
--- a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM1Un_tf.py
+++ b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM1Un_tf.py
@@ -18,7 +18,7 @@ msg.info('logging set in %s' % sys.argv[0])
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
-from PyJobTransforms.trfArgs import addAthenaArguments
+from PyJobTransforms.trfArgs import addDetectorArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
 
 import PyJobTransforms.trfExceptions as trfExceptions
@@ -127,7 +127,8 @@ def getTransform():
                                 'subregions merge and final merge.'.format(
                                     ntowers, subregions))
 
-    #addAthenaArguments(trf.parser)
+    addTrigFTKAthenaOptions(trf.parser)
+    addDetectorArguments(trf.parser)
     addTrigFTKSimOptions(trf.parser, nsubregions=subregions)
     addTrigFTKSimMergeOptions(trf.parser);
     addTrigFTKSimTFOptions(trf.parser)
diff --git a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM4Un_tf.py b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM4Un_tf.py
index 5456c1fe6632015db1ce9009b6539a1207a345f2..e0537a92d9361f7d9354246882db7448790693cf 100755
--- a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM4Un_tf.py
+++ b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM32SM4Un_tf.py
@@ -18,7 +18,7 @@ msg.info('logging set in %s' % sys.argv[0])
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
-from PyJobTransforms.trfArgs import addAthenaArguments
+from PyJobTransforms.trfArgs import addDetectorArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
 
 import PyJobTransforms.trfExceptions as trfExceptions
@@ -141,7 +141,8 @@ def getTransform():
                                 'subregions merge and final merge.'.format(
                                     ntowers, subregions))
 
-    #addAthenaArguments(trf.parser)
+    addTrigFTKAthenaOptions(trf.parser)
+    addDetectorArguments(trf.parser)
     addTrigFTKSimOptions(trf.parser, nsubregions=subregions)
     addTrigFTKSimMergeOptions(trf.parser);
     addTrigFTKSimTFOptions(trf.parser)
diff --git a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM1Un_tf.py b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM1Un_tf.py
index e3b68bfec7a8deb58bae1c88cbb2d42456fd2729..31042b102ba6437109312b37617fac9ff433c976 100755
--- a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM1Un_tf.py
+++ b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM1Un_tf.py
@@ -18,7 +18,8 @@ msg.info('logging set in %s' % sys.argv[0])
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
-from PyJobTransforms.trfArgs import addAthenaArguments
+from PyJobTransforms.trfArgs import addDetectorArguments
+
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
 
 import PyJobTransforms.trfExceptions as trfExceptions
@@ -127,7 +128,8 @@ def getTransform():
                                 'subregions merge and final merge.'.format(
                                     ntowers, subregions))
 
-    #addAthenaArguments(trf.parser)
+    addTrigFTKAthenaOptions(trf.parser)
+    addDetectorArguments(trf.parser)
     addTrigFTKSimOptions(trf.parser, nsubregions=subregions)
     addTrigFTKSimMergeOptions(trf.parser);
     addTrigFTKSimTFOptions(trf.parser)
diff --git a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM4Un_tf.py b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM4Un_tf.py
index 7724e668011b95c79b4f318ee9551b000a3292ce..c02cdb8e2c47503f402ca7b677b9ebdc9b7f0e27 100755
--- a/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM4Un_tf.py
+++ b/Trigger/TrigFTK/TrigFTKSim/scripts/TrigFTKTM64SM4Un_tf.py
@@ -18,8 +18,8 @@ msg.info('logging set in %s' % sys.argv[0])
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
-from PyJobTransforms.trfArgs import addAthenaArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
+from PyJobTransforms.trfArgs import addDetectorArguments
 
 import PyJobTransforms.trfExceptions as trfExceptions
 import PyJobTransforms.trfArgClasses as trfArgClasses
@@ -150,12 +150,14 @@ def getTransform():
                                 'subregions merge and final merge.'.format(
                                     ntowers, subregions))
 
-    #addAthenaArguments(trf.parser)
+    addTrigFTKAthenaOptions(trf.parser)
+    addDetectorArguments(trf.parser)
     addTrigFTKSimOptions(trf.parser, nsubregions=subregions)
     addTrigFTKSimMergeOptions(trf.parser);
     addTrigFTKSimTFOptions(trf.parser)
     addTrigFTKSimRFOptions(trf.parser)
     addFTKSimulationArgs(trf.parser)
+    
     return trf
 
 
diff --git a/Trigger/TrigFTK/TrigFTKSim/share/skeleton.BS_FTK_Creator.py b/Trigger/TrigFTK/TrigFTKSim/share/skeleton.BS_FTK_Creator.py
index 252856bcd68f748b20572c9d779c044ca69f1396..241859de0f56dd1bf52fcc11fbf0cff37433738d 100755
--- a/Trigger/TrigFTK/TrigFTKSim/share/skeleton.BS_FTK_Creator.py
+++ b/Trigger/TrigFTK/TrigFTKSim/share/skeleton.BS_FTK_Creator.py
@@ -39,12 +39,15 @@ if hasattr(runArgs, "skipEvents"):
 elif hasattr(runArgs, "firstEvent"):
     athenaCommonFlags.SkipEvents.set_Value_and_Lock(runArgs.firstEvent)
 
+from AthenaCommon.GlobalFlags import jobproperties
 from AthenaCommon.GlobalFlags import globalflags
 globalflags.InputFormat="bytestream"
-from AthenaCommon.GlobalFlags import jobproperties
-###jobproperties.Global.ConditionsTag.set_Value_and_Lock ('CONDBR2-BLKPA-2015-11')
-###jobproperties.Global.DetDescrVersion.set_Value_and_Lock("ATLAS-R2-2015-03-01-00")
+if hasattr(runArgs,"geometryVersion"):
+   globalflags.DetDescrVersion.set_Value_and_Lock(runArgs.geometryVersion)
 
+if hasattr(runArgs,"conditionsTag"):
+   globalflags.ConditionsTag.set_Value_and_Lock(runArgs.conditionsTag)
+   
 inputNTUP_FTKFile = runArgs.inputNTUP_FTKFile
 
 from TrigFTK_RawDataAlgs.TrigFTK_RawDataAlgsConf import FTK_RDO_CreatorAlgo
@@ -84,7 +87,6 @@ jobproperties.LArRODFlags.doLArFebErrorSummary.set_Value_and_Lock(False)
 # main jobOption
 include ("RecExCommon/RecExCommon_topOptions.py")
 
-
 StreamBSFileOutput.ItemList = ["FTK_RawTrackContainer#*"]
 
 # Merge with original bytestream
diff --git a/Trigger/TrigFTK/TrigFTKSim/share/skeleton.FTKStandaloneSim.py b/Trigger/TrigFTK/TrigFTKSim/share/skeleton.FTKStandaloneSim.py
index de19c009737066068440831d830af9a7e60eff53..b8573ec4335f07029f3985b9879a0e8ed13419bf 100644
--- a/Trigger/TrigFTK/TrigFTKSim/share/skeleton.FTKStandaloneSim.py
+++ b/Trigger/TrigFTK/TrigFTKSim/share/skeleton.FTKStandaloneSim.py
@@ -1,5 +1,5 @@
 # FTK Simulation Transform Skeleton Job Options
-# $Id: skeleton.FTKStandaloneSim.py 796937 2017-02-13 21:43:06Z jahreda $
+# $Id: skeleton.FTKStandaloneSim.py 802670 2017-04-10 22:03:45Z jahreda $
 
 from AthenaCommon.AthenaCommonFlags import jobproperties as jp
 from AthenaCommon.Logging import logging
diff --git a/Trigger/TrigFTK/TrigFTKSim/src/FTKDataInput.cxx b/Trigger/TrigFTK/TrigFTKSim/src/FTKDataInput.cxx
index 4774973c9e53b48eb0e5b71ffdba489d02672228..761beb20ef7409977ed183f18e6189af63bcccbf 100644
--- a/Trigger/TrigFTK/TrigFTKSim/src/FTKDataInput.cxx
+++ b/Trigger/TrigFTK/TrigFTKSim/src/FTKDataInput.cxx
@@ -245,6 +245,7 @@ void FTKDataInput::processRegion(int curreg, bool clearOrig)
        MultiTruth mt;
        MultiTruth::Barcode uniquecode(curhit.getEventIndex(),curhit.getBarcode());
        mt.maximize(uniquecode,curhit.getBarcodePt());
+      cout << "actually I'm here ! " << endl; 
        curhit.setTruth(mt);
          } // end hit
        }
diff --git a/Trigger/TrigFTK/TrigFTKSim/standalone/dataflow.h b/Trigger/TrigFTK/TrigFTKSim/standalone/dataflow.h
index ef22c9466f499dc034cd44171c96cd2285d93bc1..4f8fbf5200a9ecfafcfaf1e2ae63a0e744ccfc43 100644
--- a/Trigger/TrigFTK/TrigFTKSim/standalone/dataflow.h
+++ b/Trigger/TrigFTK/TrigFTKSim/standalone/dataflow.h
@@ -12,7 +12,6 @@
 
 #define MAXTOWER 64
 #define MAXL 8
-
 ///#define HIST_MAXBINS 35
 
 #define HIST_MAXBINS 100
diff --git a/Trigger/TrigFTK/TrigFTK_Monitoring/TrigFTK_Monitoring/FtkHltEfficiencyFex.h b/Trigger/TrigFTK/TrigFTK_Monitoring/TrigFTK_Monitoring/FtkHltEfficiencyFex.h
index ba5e459c328976eb00cf542105a0d5b92e5c186b..82aa869e93eb18b4175740ea625e04e3a1b6b84e 100644
--- a/Trigger/TrigFTK/TrigFTK_Monitoring/TrigFTK_Monitoring/FtkHltEfficiencyFex.h
+++ b/Trigger/TrigFTK/TrigFTK_Monitoring/TrigFTK_Monitoring/FtkHltEfficiencyFex.h
@@ -102,6 +102,7 @@ namespace TrigFTK {
       double        m_max2DZ0;
 
       std::vector<TrigTimer*> m_timer;
+
       enum FtkHltEfficiencyTimers
       {
         AlgoTime            =  0,
@@ -113,7 +114,34 @@ namespace TrigFTK {
         nTimers /// Leave this entry at the end
       };
       int eventCounter;
-  };
+      
+      unsigned int m_nFTKRawTracks;
+
+      unsigned int m_nFTKTracks;
+      unsigned int m_nFTKTrackParticles;
+      unsigned int m_nTrackErrors;
+      unsigned int m_nTrackParticleErrors;
+
+      double m_fMissPix0;
+      double m_fMissPix1;
+      double m_fMissPix2;
+      double m_fMissPix3;
+
+      int m_nFailPix;
+
+      double m_fMissSCT0;
+      double m_fMissSCT1;
+      double m_fMissSCT2;
+      double m_fMissSCT3;
+      double m_fMissSCT4;
+      double m_fMissSCT5;
+      double m_fMissSCT6;
+      double m_fMissSCT7;
+
+
+      int m_nFailSCT;
+
+};
 
 } // end namespace
 #endif
diff --git a/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyConfig.py b/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyConfig.py
index 370fc4944184a754f8c77d13123048f970ba6b15..e5af4952670a108deb3a8e12296a2fb566c52c65 100644
--- a/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyConfig.py
+++ b/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyConfig.py
@@ -28,10 +28,10 @@ class FtkHltEfficiencyFex ( TrigFTK__FtkHltEfficiencyFex ) :
         self.DeltaRMax            = 0.05    # float
 
         # Track Filtering
-        self.MinPt              = 0.0     # float
+        self.MinPt              = 2.0     # float
         self.MaxEta             = 10.0    # float
         self.MaxZ0              = 100.0   # float
-        self.MaxD0              = 2.0     # float
+        self.MaxD0              = 1.0     # float
 
         self.MaxHLTZ0Err        = 100.0   # float
         self.MaxHLTD0Err        = 100.0   # float
diff --git a/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyMonitoring.py b/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyMonitoring.py
index b4eaa27cd0d81ce6d5b7117089bd9ea3089d26ab..d357cea67858bd18701a8baad6817986960eaf88 100644
--- a/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyMonitoring.py
+++ b/Trigger/TrigFTK/TrigFTK_Monitoring/python/FtkHltEfficiencyMonitoring.py
@@ -108,17 +108,119 @@ class FtkHltEfficiencyMonitoring(TrigGenericMonitoringToolConfig):
         xbins=2, xmin=-.5, xmax=1.5) ]
 
     # others
-    nBins += 5 + 5
+    nBins += 50 + 50
     self.Histograms += [ defineHistogram(
         'numb_HLT_trks',
         type='TH1F',
-        title='number of HLT tracks;#tracks;#events',
+        title='number of HLT tracks (effic Denominator);#tracks;#events',
         xbins=50, xmin=0, xmax=500)]
     self.Histograms += [ defineHistogram(
         'numb_FTK_trks',
         type='TH1F',
-        title='number of FTK tracks;#tracks;#events',
+        title='number of FTK tracks (effic numerator);#tracks;#events',
         xbins=50, xmin=0, xmax=500)]
 
+
+    nBins += 50*3
+    self.Histograms += [ defineHistogram(
+        'nFTKRawTrk',
+        type='TH1F',
+        title='number of FTK RAW tracks;#tracks;#events',
+        xbins=50, xmin=0, xmax=500)]
+    self.Histograms += [ defineHistogram(
+        'nTrackErrors',
+        type='TH1F',
+        title='number of FTK tracks not converted due to errors;#tracks;#events',
+        xbins=50, xmin=0, xmax=500)]
+    self.Histograms += [ defineHistogram(
+        'nTPErrors',
+        type='TH1F',
+        title='number of FTK TrackParticles missing due to Errors;#tracks;#events',
+        xbins=50, xmin=0, xmax=500)]
+
+    nBins += 50*4
+
+    self.Histograms += [ defineHistogram(
+        'fTrkMissingPix0',
+        type='TH1F',
+        title='fraction of tracks per event missing IBL;Fraction of Tracks;No. Events',
+        xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+        'fTrkMissingPix1',
+        type='TH1F',
+        title='fraction of tracks per event missing Pix1;Fraction of Tracks;No. Events',
+        xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+        'fTrkMissingPix2',
+        type='TH1F',
+        title='fraction of tracks per event missing Pix2;Fraction of Tracks;No. Events',
+        xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+        'fTrkMissingPix3',
+        type='TH1F',
+        title='fraction of tracks per event missing Pix3;Fraction of Tracks;No. Events',
+        xbins=50, xmin=0, xmax=1)]
+
+    nBins += 50*8
+
+
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT0',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT0;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT1',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT1;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT2',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT2;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT3',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT3;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT4',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT4;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT5',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT5;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT6',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT6;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
+    self.Histograms += [ defineHistogram(
+      'fTrkMissingSCT7',
+      type='TH1F',
+      title='fraction of tracks per event missing SCT7;Fraction of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
+    nBins += 50*2
+
+    self.Histograms += [ defineHistogram(
+      'nTrkFailedPix',
+      type='TH1F',
+      title='No. tracks per event with failed Pixel hit conversion;No. of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
+    self.Histograms += [ defineHistogram(
+      'nTrkFailedSCT',
+      type='TH1F',
+      title='No. tracks per event with failed SCT hit conversion;No. of Tracks;No. Events',
+      xbins=50, xmin=0, xmax=1)]
+
     print "FtkHltEfficiencyMonitoring: booked", nBins, " histogram bins"
 
diff --git a/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx b/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx
index 54ea73a695f8c6cb6c629be94192e8bf0a644ff1..bcd422fe5cb89caa7afed34f714254cbc6fb6bd0 100644
--- a/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx
+++ b/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx
@@ -33,10 +33,10 @@ using namespace TrigFTK;
   declareProperty("FTK_DataProvider", m_FTKDataProviderSvc);
   declareProperty("DeltaRMax", m_deltaR_max = 0.05);
 
-  declareProperty("MinPt",           m_minPt          = 0);
+  declareProperty("MinPt",           m_minPt          = 2);
   declareProperty("MaxEta",          m_maxEta         = 10);
   declareProperty("MaxZ0",           m_maxZ0          = 100);
-  declareProperty("MaxD0",           m_maxD0          = 2);
+  declareProperty("MaxD0",           m_maxD0          = 1);
 
   declareProperty("MaxHLTZ0Err",        m_maxHLTZ0err       = 100);
   declareProperty("MaxHLTD0Err",        m_maxHLTD0err       = 100);
@@ -73,6 +73,26 @@ using namespace TrigFTK;
   declareMonitoredVariable("numb_HLT_trks",                 m_efficiencyAnalysis->m_numb_ref_trks );
   declareMonitoredVariable("numb_FTK_trks",                 m_efficiencyAnalysis->m_numb_test_trks );
 
+  declareMonitoredVariable("nFTKRawTrk",m_nFTKRawTracks);
+  declareMonitoredVariable("nFTKTrackParticles", m_nFTKTrackParticles);
+  declareMonitoredVariable("nTrackErrors", m_nTrackErrors);
+  declareMonitoredVariable("nTPErrors", m_nTrackParticleErrors);
+  
+  declareMonitoredVariable("nTrkFailedPix", m_nFailPix);
+  declareMonitoredVariable("nTrkFailedSCT", m_nFailSCT);
+  declareMonitoredVariable("fTrkMissingPix0", m_fMissPix0);
+  declareMonitoredVariable("fTrkMissingPix1", m_fMissPix1);
+  declareMonitoredVariable("fTrkMissingPix2", m_fMissPix2);
+  declareMonitoredVariable("fTrkMissingPix3", m_fMissPix3);
+  declareMonitoredVariable("fTrkMissingSCT0",m_fMissSCT0);
+  declareMonitoredVariable("fTrkMissingSCT1",m_fMissSCT1);
+  declareMonitoredVariable("fTrkMissingSCT2",m_fMissSCT2);
+  declareMonitoredVariable("fTrkMissingSCT3",m_fMissSCT3);
+  declareMonitoredVariable("fTrkMissingSCT4",m_fMissSCT4);
+  declareMonitoredVariable("fTrkMissingSCT5",m_fMissSCT5);
+  declareMonitoredVariable("fTrkMissingSCT6",m_fMissSCT6);
+  declareMonitoredVariable("fTrkMissingSCT7",m_fMissSCT7);
+
   // purity variables from m_purityAnalysis
   m_purityAnalysis->monitored_ref_track.declareForMonitoring( this, "FTK_trk_");
   m_purityAnalysis->monitored_ref_unmatched_track.declareForMonitoring( this, "FTK_fake_trk_");
@@ -172,6 +192,9 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input,
   m_efficiencyAnalysis->Clear();
   m_purityAnalysis->Clear();
 
+
+ 
+
   // Get the ROI descriptor
   const TrigRoiDescriptor* roiDescriptor = 0;
   HLT::ErrorCode status = getFeature( input, roiDescriptor );
@@ -199,6 +222,7 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input,
       ATH_MSG_DEBUG("Failed to get TrackParticleContainers ");
     if(m_timer[GetHltTracksTime]) m_timer[GetHltTracksTime]->stop();
 
+
     // Get FTK tracks in ROI
     if(m_timer[GetFtkTracksTime]) m_timer[GetFtkTracksTime]->start(); 
     const xAOD::TrackParticleContainer* FTK_tpcPtr;
@@ -211,6 +235,62 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input,
       ATH_MSG_DEBUG("Failed to get FTK TrackParticleContainer ");
     if(m_timer[GetFtkTracksTime]) m_timer[GetFtkTracksTime]->stop();    
     ATH_MSG_DEBUG("FTK retrieval time " << m_timer[GetFtkTracksTime]->elapsed());
+
+    m_nFTKRawTracks = m_FTKDataProviderSvc->nRawTracks();
+    m_nFTKTracks = m_FTKDataProviderSvc->nTracks(false);
+    m_nFTKTrackParticles = m_FTKDataProviderSvc->nTrackParticles(false);
+    m_nTrackErrors = m_FTKDataProviderSvc->nTrackErrors(false);
+    m_nTrackParticleErrors = m_FTKDataProviderSvc->nTrackParticleErrors(false);
+    ATH_MSG_DEBUG(" No. RAW tracks= " << m_nFTKRawTracks);
+    ATH_MSG_DEBUG(" No. Converted tracks = " << m_nFTKTracks << " with " <<  m_nTrackErrors << " Errors");
+    ATH_MSG_DEBUG(" No. Converted tracks = " << m_nFTKTracks << " with " <<  m_nTrackErrors << " Errors");
+    ATH_MSG_DEBUG(" TrackParticles = " << m_nTrackParticleErrors << " with " << m_nTrackParticleErrors << " Errors");
+
+    m_fMissPix0=m_fMissPix1=m_fMissPix2=m_fMissPix3=m_nFailPix=-1;
+    m_fMissSCT0=m_fMissSCT1=m_fMissSCT2=m_fMissSCT3=m_fMissSCT4=m_fMissSCT5=m_fMissSCT6=m_fMissSCT7=m_nFailSCT=-1;
+
+
+    if (m_nFTKRawTracks>0){
+      std::vector<unsigned int> nMissingPixelClusters = m_FTKDataProviderSvc->nMissingPixelClusters();
+      std::vector<unsigned int> nFailedPixelClusters = m_FTKDataProviderSvc->nFailedPixelClusters();
+      unsigned nFailPix=0; 
+      for (unsigned int lay=0; lay<4; lay++) nFailPix+=nFailedPixelClusters[lay];
+      m_nFailPix=nFailPix;
+
+      ATH_MSG_DEBUG(" Missing Pixel Hits in IBL: " <<  nMissingPixelClusters[0] << ", Lay1: "<<  nMissingPixelClusters[1] << ", Lay2: "<<  nMissingPixelClusters[2] << ", Lay3: "<<  nMissingPixelClusters[3]);
+      ATH_MSG_DEBUG(" Failed  Pixel Hits in IBL: " <<  nFailedPixelClusters[0] << ", Lay1: "<<  nFailedPixelClusters[1] << ", Lay2: "<<  nFailedPixelClusters[2]<< ", Lay3: "<<  nFailedPixelClusters[3]);
+      m_fMissPix0=(double)nMissingPixelClusters[0]/(double)m_nFTKRawTracks;
+      m_fMissPix1=(double)nMissingPixelClusters[1]/(double)m_nFTKRawTracks;
+      m_fMissPix2=(double)nMissingPixelClusters[2]/(double)m_nFTKRawTracks;
+      m_fMissPix3=(double)nMissingPixelClusters[3]/(double)m_nFTKRawTracks;
+      ATH_MSG_DEBUG(" Fraction of Tracks missing Pixel Hits in IBL: " <<  m_fMissPix0 << ", Lay1: "<<  m_fMissPix1 << ", Lay2: "<<  m_fMissPix2 << ", Lay3: "<<  m_fMissPix3);
+
+      std::vector<unsigned int> nMissingSCTClusters = m_FTKDataProviderSvc->nMissingSCTClusters();
+      std::vector<unsigned int> nFailedSCTClusters = m_FTKDataProviderSvc->nFailedSCTClusters();
+
+      unsigned nFailSCT=0; 
+      for (unsigned int lay=0; lay<8; lay++) nFailSCT+=nFailedSCTClusters[lay];
+      m_nFailSCT=nFailSCT;
+      
+      ATH_MSG_DEBUG(" Missing SCT Hits in Lay0: " <<  nMissingSCTClusters[0] << ", Lay1: "<<  nMissingSCTClusters[1] << ", Lay2: "<<  nMissingSCTClusters[2] << 
+		    ", Lay3: " <<  nMissingSCTClusters[3] << ", Lay4: " <<  nMissingSCTClusters[4] << ", Lay5: "<<  nMissingSCTClusters[5]<< 
+		    ", Lay6: "<<  nMissingSCTClusters[6] << ", Lay7: "<<  nMissingSCTClusters[7]);
+      ATH_MSG_DEBUG(" Failed SCT Hits in Lay0: " <<  nFailedSCTClusters[0] << ", Lay1: "<<  nFailedSCTClusters[1] << ", Lay2: "<<  nFailedSCTClusters[2] << 
+		    ", Lay3: " <<  nFailedSCTClusters[3] << ", Lay4: " <<  nFailedSCTClusters[4] << ", Lay5: "<<  nFailedSCTClusters[5]<< 
+		    ", Lay6: "<<  nFailedSCTClusters[6] << ", Lay7: "<<  nFailedSCTClusters[7]);
+
+      m_fMissSCT0=(double)nMissingSCTClusters[0]/(double)m_nFTKRawTracks;
+      m_fMissSCT1=(double)nMissingSCTClusters[1]/(double)m_nFTKRawTracks;
+      m_fMissSCT2=(double)nMissingSCTClusters[2]/(double)m_nFTKRawTracks;
+      m_fMissSCT3=(double)nMissingSCTClusters[3]/(double)m_nFTKRawTracks;
+      m_fMissSCT4=(double)nMissingSCTClusters[4]/(double)m_nFTKRawTracks;
+      m_fMissSCT5=(double)nMissingSCTClusters[5]/(double)m_nFTKRawTracks;
+      m_fMissSCT6=(double)nMissingSCTClusters[6]/(double)m_nFTKRawTracks;
+      m_fMissSCT7=(double)nMissingSCTClusters[7]/(double)m_nFTKRawTracks;
+      ATH_MSG_DEBUG(" Fraction Tracks Missing SCT Hits in Lay0: " <<  m_fMissSCT0 << ", Lay1: "<<  m_fMissSCT1 << ", Lay2: "<<  m_fMissSCT2 << ", Lay3: "<<  m_fMissSCT3<< 
+		    ", Lay4: " <<  m_fMissSCT4 << ", Lay5: "<<  m_fMissSCT5 << ", Lay6: "<<  m_fMissSCT6 << ", Lay7: "<<  m_fMissSCT7);
+    }
+
   }
   
   // run efficiency analysis
diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/TrigFTK_RawDataAlgs/FTK_RDO_CreatorAlgo.h b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/TrigFTK_RawDataAlgs/FTK_RDO_CreatorAlgo.h
index 4e457673a825a122542a66b1993b694deb12535e..9d69e057c93aa64c44ab1560885479775430bb7a 100644
--- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/TrigFTK_RawDataAlgs/FTK_RDO_CreatorAlgo.h
+++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/TrigFTK_RawDataAlgs/FTK_RDO_CreatorAlgo.h
@@ -91,6 +91,7 @@ private:
   double m_trainingBeamspotZ;
   double m_trainingBeamspotTiltX;
   double m_trainingBeamspotTiltY;
+  bool m_reverseIBLlocx;
 
   // Convertor for RDO objects 
   FTK_RawTrack* SimToRaw(const FTKTrack&);
diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_CreatorAlgo.cxx b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_CreatorAlgo.cxx
index 58b7829f6f3d9e5864353fc7045fe7b30b42ae90..442615728ef35278af7751950272e9c54954ef08 100644
--- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_CreatorAlgo.cxx
+++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_CreatorAlgo.cxx
@@ -54,7 +54,8 @@ FTK_RDO_CreatorAlgo::FTK_RDO_CreatorAlgo(const std::string& name, ISvcLocator* p
   m_trainingBeamspotX(0.),
   m_trainingBeamspotY(0.),
   m_trainingBeamspotTiltX(0.),
-  m_trainingBeamspotTiltY(0.)
+  m_trainingBeamspotTiltY(0.),
+  m_reverseIBLlocx(false)
 {
   declareProperty("mergedTrackPaths",m_ftktrack_paths_merged,
       "Paths of the merged tracks");
@@ -64,6 +65,7 @@ FTK_RDO_CreatorAlgo::FTK_RDO_CreatorAlgo(const std::string& name, ISvcLocator* p
   declareProperty("TrainingBeamspotY", m_trainingBeamspotY);
   declareProperty("TrainingBeamspotTiltX", m_trainingBeamspotTiltX);
   declareProperty("TrainingBeamspotTiltY", m_trainingBeamspotTiltY);
+  declareProperty("ReverseIBLlocX",m_reverseIBLlocx, "reverse the direction of IBL locX from FTK");
 
   m_FTK_RawTrack_checkFails.reserve(9);
   m_FTK_RawSCT_Cluster_checkFails.reserve(5);
@@ -81,19 +83,20 @@ FTK_RDO_CreatorAlgo::~FTK_RDO_CreatorAlgo()
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 StatusCode FTK_RDO_CreatorAlgo::initialize(){
   MsgStream log(msgSvc(), name());
-  log << MSG::INFO << "FTK_RDO_CreatorAlgo::initialize()" << endmsg;
+  ATH_MSG_INFO("FTK_RDO_CreatorAlgo::initialize()");
 
-  log << MSG::VERBOSE << "mergedTrackPaths: "<<m_ftktrack_paths_merged<<
-    "Paths of the merged tracks: "<< endmsg;
-  log << MSG::VERBOSE << "mergeTrackBName: "<<m_mergedtracks_bname<<" - Branch name for the merged tracks"<< endmsg;
-
-  log << MSG::INFO << "Correcting for FTK training beamspot at x " <<  m_trainingBeamspotX <<" y " << 	m_trainingBeamspotY
-      << " z " <<  m_trainingBeamspotZ << " TiltX " << m_trainingBeamspotTiltX << "TiltY " << m_trainingBeamspotTiltY << endmsg;
+  ATH_MSG_VERBOSE("mergedTrackPaths: "<<m_ftktrack_paths_merged<<
+		  "Paths of the merged tracks: ");
+  ATH_MSG_VERBOSE("mergeTrackBName: "<<m_mergedtracks_bname<<" - Branch name for the merged tracks");
+  
+  ATH_MSG_INFO("Correcting for FTK training beamspot at x " <<  m_trainingBeamspotX <<" y " << 	m_trainingBeamspotY
+	       << " z " <<  m_trainingBeamspotZ << " TiltX " << m_trainingBeamspotTiltX << "TiltY " << m_trainingBeamspotTiltY);
+  if (m_reverseIBLlocx)ATH_MSG_INFO(" Reversing direction of IBL hit phi position");
 
 
   StatusCode scSG = service( "StoreGateSvc", m_StoreGate );
   if (scSG.isFailure()) {
-    log << MSG::FATAL << "Unable to retrieve StoreGate service" << endmsg;
+    ATH_MSG_FATAL("Unable to retrieve StoreGate service");
     return scSG;
   }
 
@@ -108,17 +111,17 @@ StatusCode FTK_RDO_CreatorAlgo::initialize(){
   // prepare the input from the FTK tracks, merged in an external simulation
   m_mergedtracks_chain = new TChain("ftkdata","Merged tracks chain");
   // add the file to the chain
-  log << MSG::INFO << "Loading " << m_ftktrack_paths_merged.size() << " files with FTK merged tracks" << endmsg;
+  ATH_MSG_INFO("Loading " << m_ftktrack_paths_merged.size() << " files with FTK merged tracks" );
   vector<string>::const_iterator imtp = m_ftktrack_paths_merged.begin();
   for (;imtp!=m_ftktrack_paths_merged.end();++imtp) {
     Int_t addres = m_mergedtracks_chain->Add((*imtp).c_str());
-    log << MSG::DEBUG << "Added: " << *imtp << '[' << addres << ']' <<endmsg;
+    ATH_MSG_DEBUG("Added: " << *imtp << '[' << addres << ']');
   }
   m_mergedtracks_stream = new FTKTrackStream();
   TBranch *mergedtracks_branch;
   Int_t res = m_mergedtracks_chain->SetBranchAddress(m_mergedtracks_bname.c_str(),&m_mergedtracks_stream,&mergedtracks_branch);
   if (res<0) {
-    log << MSG::FATAL << "Branch \"" << m_mergedtracks_bname << "\" with merged tracks not found" << endmsg;
+    ATH_MSG_FATAL("Branch \"" << m_mergedtracks_bname << "\" with merged tracks not found" );
     return StatusCode::FAILURE;
   }
 
@@ -146,24 +149,24 @@ StatusCode FTK_RDO_CreatorAlgo::initialize(){
         prevEventNumber = eventNumber;
       }
       else {
-        log << MSG::FATAL << "A duplicated event was found before the end of file, the error cannot be recoverd" << endmsg;
+        ATH_MSG_FATAL("A duplicated event was found before the end of file, the error cannot be recoverd" );
         return StatusCode::FAILURE;
       }
     }
     else if (eventNumber==prevEventNumber) {
-      log << MSG::WARNING << "Event " << eventNumber << " found in the previous event, failure condition masked if this happens at the end of the file" << endmsg;
+      ATH_MSG_WARNING("Event " << eventNumber << " found in the previous event, failure condition masked if this happens at the end of the file" );
       hasRepeatedEvents = true;
     }
     else {
       // Duplicate events are a condition error at the moment, this
       // can be fixed using a runNumber and eventNumber paier as key
-      log << MSG::FATAL << "Tracks for the current event (" << eventNumber << ") already exist. Duplication not allowed" << endmsg;
+      ATH_MSG_FATAL("Tracks for the current event (" << eventNumber << ") already exist. Duplication not allowed" );
       return StatusCode::FAILURE;
     }
 
   }
 
-  log << MSG::DEBUG << "Tracks from " << m_trackVectorMap.size() << " events loaded"<<endmsg;
+  ATH_MSG_DEBUG("Tracks from " << m_trackVectorMap.size() << " events loaded");
 
   return StatusCode::SUCCESS;
 }
@@ -171,37 +174,37 @@ StatusCode FTK_RDO_CreatorAlgo::initialize(){
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 StatusCode FTK_RDO_CreatorAlgo::execute() {
   MsgStream log(msgSvc(), name());
-  log << MSG::DEBUG << "FTK_RDO_CreatorAlgo::execute() start" << endmsg;
+  ATH_MSG_DEBUG("FTK_RDO_CreatorAlgo::execute() start" );
   // Get information on the events
   const EventInfo* eventInfo(0);
   if( m_StoreGate->retrieve(eventInfo).isFailure() ) {
-    log << MSG::ERROR << "Could not retrieve event info" << endmsg;
+    ATH_MSG_ERROR("Could not retrieve event info" );
     return StatusCode::FAILURE;
   }
   const EventID* eventID( eventInfo->event_ID() );
   int eventNumber =  eventID->event_number();
 
-  log << MSG::DEBUG
-    << "entered execution for run " << eventID->run_number()
-    << "   event " << eventNumber
-    << endmsg;
+  ATH_MSG_DEBUG(
+		"entered execution for run " << eventID->run_number()
+		<< "   event " << eventNumber
+		);
 
   // Extract the vector of tracks found by the FTK for the current event
   std::map<int, Long64_t >::iterator mapIt = m_trackVectorMap.find(eventNumber);
   if(mapIt == m_trackVectorMap.end()) {
-    log << MSG::ERROR << "No FTK tracks for event " << eventNumber << " found, possible mismatch between RDO and FTK files"<<endmsg;
+    ATH_MSG_ERROR("No FTK tracks for event " << eventNumber << " found, possible mismatch between RDO and FTK files");
     return StatusCode::FAILURE;
   }
 
   //Have Tracks
   const Long64_t &FTKEntry = (*mapIt).second;
   if (m_mergedtracks_chain->GetEntry(FTKEntry)==-1) {
-    log << MSG::ERROR << "Error reading the FTK entry: " << FTKEntry <<endmsg;
+    ATH_MSG_ERROR("Error reading the FTK entry: " << FTKEntry);
     return StatusCode::FAILURE;
   }
 
   int ntracks_merged = m_mergedtracks_stream->getNTracks();
-  log << MSG::DEBUG << "Number of FTK tracks to merge in SG: " << ntracks_merged << endmsg;
+  ATH_MSG_DEBUG("Number of FTK tracks to merge in SG: " << ntracks_merged );
 
 
 
@@ -209,10 +212,10 @@ StatusCode FTK_RDO_CreatorAlgo::execute() {
 
   StatusCode scJ = m_StoreGate->record(m_ftk_raw_trackcollection, m_ftk_raw_trackcollection_Name);
   if (scJ.isFailure()) {
-    log << MSG::FATAL << "Failure registering FTK_RawTrackContainer" << endmsg;
+    ATH_MSG_FATAL("Failure registering FTK_RawTrackContainer" );
     return StatusCode::FAILURE;
   } else{
-    log << MSG::DEBUG << "Setting FTK_RawTrackContainer registered" << endmsg;
+    ATH_MSG_DEBUG("Setting FTK_RawTrackContainer registered" );
   }
 
   //
@@ -233,7 +236,7 @@ StatusCode FTK_RDO_CreatorAlgo::execute() {
   // prepare to move to the next event
   m_mergedtracks_iev += 1;
 
-  log << MSG::DEBUG << "FTK_RDO_CreatorAlgo::execute() end" << endmsg;
+  ATH_MSG_DEBUG("FTK_RDO_CreatorAlgo::execute() end" );
 
   return StatusCode::SUCCESS;
 }
@@ -241,7 +244,7 @@ StatusCode FTK_RDO_CreatorAlgo::execute() {
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 StatusCode FTK_RDO_CreatorAlgo::finalize() {
   MsgStream log(msgSvc(), name());
-  log << MSG::INFO << "finalize()" << endmsg;
+  ATH_MSG_INFO("finalize()" );
 
   //
   //  Clean up output and input merged files
@@ -276,10 +279,10 @@ StatusCode FTK_RDO_CreatorAlgo::finalize() {
 
 
   // cleanup the map containing the list of FTK tracks found in each event
-  log << MSG::DEBUG << "Clear Track map" << endmsg;
+  ATH_MSG_DEBUG("Clear Track map" );
   m_trackVectorMap.clear();
 
-  log << MSG::DEBUG << "end Finalize() " << endmsg;
+  ATH_MSG_DEBUG("end Finalize() " );
   return StatusCode::SUCCESS;
 }
 
@@ -332,11 +335,21 @@ FTK_RawTrack* FTK_RDO_CreatorAlgo::SimToRaw(const FTKTrack &track)
 	valid = false;
       }
       ATH_MSG_VERBOSE( " Creating Pixel cluster for layer " << iPlane);
-      //Identifier wafer_id = m_pixelId->wafer_id(hitHashId);
+      
 
       float phi_index= hit.getHwCoord(0);
       float eta_index = hit.getHwCoord(1);
 
+      if (m_reverseIBLlocx) {
+	Identifier wafer_id = m_pixelId->wafer_id(hitHashId);
+	bool isBarrel = (m_pixelId->barrel_ec(wafer_id)==0);
+	unsigned int layer = m_pixelId->layer_disk(wafer_id);
+
+	if (isBarrel && layer==0) {
+	  phi_index = 2680. -   phi_index; //335*8=2680
+	} 
+      }
+
       //      if (phi_index > m_pixelId->phi_index_max(wafer_id)){
         //ATH_MSG_INFO( " Invalid Pixel phi_index " << phi_index << " max phi index " <<  m_pixelId->phi_index_max(wafer_id) << " and original value before scaling = " <<  hit.getHwCoord(0));
         //valid = false;
@@ -469,7 +482,7 @@ void FTK_RDO_CreatorAlgo::printTrack(const FTKTrack& track, const FTK_RawTrack *
     " invPt= " << raw_track->getInvPt()   <<
     " chi2= " << raw_track->getChi2()   <<
     " barcode= " << raw_track->getBarcode()<< 
-    " layermap bits: ";
+    " layermap bits: "<<std::endl;
   this->printBits(raw_track->getLayerMap() ,12);
   std::cout << std::endl;
   std::cout << "FTKTRack:   "<<
@@ -545,8 +558,6 @@ void FTK_RDO_CreatorAlgo::printTrack(const FTKTrack& track, const FTK_RawTrack *
   std::cout << std::endl;
 }
 
-
-bool FTK_RDO_CreatorAlgo::check_track(const FTKTrack &track, FTK_RawTrack &rdo) {
 #define d0Res 0.001
 #define z0Res 0.01
 #define phiRes 0.0001
@@ -557,6 +568,8 @@ bool FTK_RDO_CreatorAlgo::check_track(const FTKTrack &track, FTK_RawTrack &rdo)
 #define pixColRes 0.1
 #define pixRowRes 0.1
 
+bool FTK_RDO_CreatorAlgo::check_track(const FTKTrack &track, FTK_RawTrack &rdo) {
+
   bool check_ok= true;
   if (!(this->checkInt(track.getRoadID(), rdo.getRoadID(), "RoadID"))) {
     m_FTK_RawTrack_checkFails[8]+=1; check_ok=false;
@@ -625,7 +638,19 @@ bool FTK_RDO_CreatorAlgo::check_track(const FTKTrack &track, FTK_RawTrack &rdo)
 	  if (!(this->checkInt(hit.getIdentifierHash(), rdo.getPixelClusters()[i].getModuleID(), "Pixel moduleID"))){
 	    m_FTK_RawPixelCluster_checkFails[0]+=1;hitOK=false;
 	  }
-	  if (!(this->checkValue(hit.getHwCoord(0), rdo.getPixelClusters()[i].getRowCoord(),pixRowRes,"Pixel Row"))){
+
+	  float phi_index= hit.getHwCoord(0);
+	  
+	  if (m_reverseIBLlocx) {
+	    Identifier wafer_id = m_pixelId->wafer_id(hit.getIdentifierHash());
+	    bool isBarrel = (m_pixelId->barrel_ec(wafer_id)==0);
+	    unsigned int layer = m_pixelId->layer_disk(wafer_id);
+	    
+	    if (isBarrel && layer==0) {
+	      phi_index = 2680 -   phi_index; //335*8=2680
+	    } 
+	  }
+	  if (!(this->checkValue(phi_index, rdo.getPixelClusters()[i].getRowCoord(),pixRowRes,"Pixel Row"))){
 	    m_FTK_RawPixelCluster_checkFails[1]+=1;hitOK=false;
 	  }
 	  if (!(this->checkValue(hit.getHwCoord(1), rdo.getPixelClusters()[i].getColCoord(),pixColRes,"Pixel Column"))){
@@ -694,7 +719,7 @@ void FTK_RDO_CreatorAlgo::printBits(unsigned int num, unsigned int length){
   unsigned int bit=length;
   for(unsigned int i=0; i<length; i++){
     bit--;
-    std::cout << int( (num & (0x1<<bit))>>bit);
+    std::cout << int( (num & (0x1<<bit))>>bit)<<std::endl;
   }
 }
 
diff --git a/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimary.h b/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimary.h
index cfd3cddc3c0c4a04f940865b09c8a941a50d8c61..50d4324cad4e87d703d842109599b2a840bd53b2 100755
--- a/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimary.h
+++ b/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimary.h
@@ -53,7 +53,6 @@ class TrigFTK_VxPrimary : public HLT::FexAlgo
 
     bool m_useRawTracks;
     bool m_useRefittedTracks;
-    bool m_getVertexContainer;
     ftk::FTK_TrackType m_trackType;
     std::string m_vertexContainerName;
     std::string m_vxContainerName;
diff --git a/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimaryAllTE.h b/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimaryAllTE.h
index 8a835d387836f0253b916d90561a1836aa500c70..f7732863b0b86840463c2e0974ba7e9775ce310a 100755
--- a/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimaryAllTE.h
+++ b/Trigger/TrigFTK/TrigFTK_RecAlgs/TrigFTK_RecAlgs/TrigFTK_VxPrimaryAllTE.h
@@ -41,7 +41,6 @@
     ServiceHandle<IFTK_DataProviderSvc> m_DataProviderSvc;
     bool m_useRawTracks;
     bool m_useRefittedTracks;
-    bool m_getVertexContainer;
     ftk::FTK_TrackType m_trackType;
     std::string m_vertexContainerName;
     std::string m_vxContainerName;
diff --git a/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimary.cxx b/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimary.cxx
index 8f73b7e6f13e6c14c207e39dbb0f50e49c906cf9..50573bd2095636330903e161045a17e441dec918 100755
--- a/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimary.cxx
+++ b/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimary.cxx
@@ -37,7 +37,6 @@ TrigFTK_VxPrimary::TrigFTK_VxPrimary(const std::string &n, ISvcLocator *pSvcLoc)
     m_DataProviderSvc("TrigFTK_DataProviderSvc",n),
     m_useRawTracks(false),
     m_useRefittedTracks(false),
-    m_getVertexContainer(true),
     m_trackType(ftk::ConvertedTrack),
     m_vertexContainerName("HLT_PrimVertexFTK"),
     m_vxContainerName("HLT_PrimVxFTK"),
@@ -45,7 +44,6 @@ TrigFTK_VxPrimary::TrigFTK_VxPrimary(const std::string &n, ISvcLocator *pSvcLoc)
 {
   declareProperty("useRawTracks", m_useRawTracks);
   declareProperty("useRefittedTracks", m_useRefittedTracks);
-  declareProperty("getVertexContainer", m_getVertexContainer);
   declareProperty("FTK_DataProvider", m_DataProviderSvc);
   declareProperty("vertexContainerName", m_vertexContainerName);
   declareProperty("vxContainerName", m_vxContainerName);
diff --git a/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimaryAllTE.cxx b/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimaryAllTE.cxx
index feab9c8bb2d2e95bb7985043a5485f0289ab4b0f..6d298c803b2fa8aa642755232c9862cb6151114d 100755
--- a/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimaryAllTE.cxx
+++ b/Trigger/TrigFTK/TrigFTK_RecAlgs/src/TrigFTK_VxPrimaryAllTE.cxx
@@ -27,7 +27,6 @@ TrigFTK_VxPrimaryAllTE::TrigFTK_VxPrimaryAllTE(const std::string &n, ISvcLocator
     m_DataProviderSvc("TrigFTK_DataProviderSvc",n),
     m_useRawTracks(false),
     m_useRefittedTracks(false),
-    m_getVertexContainer(false),
     m_trackType(ftk::ConvertedTrack),
     m_vertexContainerName("FTK_PrimVertex"),
     m_vxContainerName("FTK_PrimVx"),
@@ -36,7 +35,6 @@ TrigFTK_VxPrimaryAllTE::TrigFTK_VxPrimaryAllTE(const std::string &n, ISvcLocator
 {
   declareProperty("useRawTracks", m_useRawTracks);
   declareProperty("useRefittedTracks", m_useRefittedTracks);
-  declareProperty("getVertexContainer", m_getVertexContainer);
   declareProperty("useFastVertexTool", m_useFastVertexTool);
   declareProperty("FTK_DataProvider", m_DataProviderSvc);
   
diff --git a/Trigger/TrigFake/CMakeLists.txt b/Trigger/TrigFake/CMakeLists.txt
index 75cd78001fa9ed6aefa6915ad0f2387c466e6883..758a63a80c67c6cedf61b948745e70a618cf239f 100644
--- a/Trigger/TrigFake/CMakeLists.txt
+++ b/Trigger/TrigFake/CMakeLists.txt
@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigSteeringEvent
                           Trigger/TrigSteer/TrigSteering
                           PRIVATE
+                          AtlasTest/TestTools
                           Control/StoreGate
                           Generators/GeneratorObjects
                           Trigger/TrigConfiguration/TrigConfHLTData
@@ -31,14 +32,18 @@ atlas_add_library( TrigFakeLib
                    PUBLIC_HEADERS TrigFake
                    PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES AthenaBaseComps GaudiKernel TrigInDetEvent TrigSteeringEvent TrigSteeringLib StoreGateLib SGtests TrigNavigationLib TrigInterfacesLib
-                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} GeneratorObjects TrigConfHLTData TrigT1Interfaces TrigT1Result )
+                   LINK_LIBRARIES AthenaBaseComps GaudiKernel TrigInDetEvent TrigSteeringEvent TrigSteeringLib StoreGateLib SGtests TrigNavigationLib TrigInterfacesLib 
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} GeneratorObjects TrigConfHLTData TrigT1Interfaces TrigT1Result  )
 
 atlas_add_component( TrigFake
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
                      LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel TrigInDetEvent TrigSteeringEvent TrigSteeringLib StoreGateLib SGtests GeneratorObjects TrigConfHLTData TrigNavigationLib TrigInterfacesLib TrigT1Interfaces TrigT1Result TrigFakeLib )
 
+atlas_add_test( FakeRoIB_test
+		SOURCES test/FakeRoIB_test.cxx
+		LINK_LIBRARIES TrigFakeLib TrigT1Result )
+
 # Install files from the package:
 atlas_install_joboptions( share/jobOfragment_TrigFake.* )
 
diff --git a/Trigger/TrigFake/src/FakeRoIB.cxx b/Trigger/TrigFake/src/FakeRoIB.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..8220b5bae6903171f8267014e86cb3a14f42e516
--- /dev/null
+++ b/Trigger/TrigFake/src/FakeRoIB.cxx
@@ -0,0 +1,101 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <iostream>
+#include <fstream>
+#include "TrigT1Result/RoIBResult.h"
+#include "eformat/SourceIdentifier.h"
+#include "FakeRoIB.h"
+using namespace ROIB;
+
+FakeRoIB::FakeRoIB( const std::string& name, ISvcLocator* pSvcLocator ):                                
+  AthAlgorithm( name, pSvcLocator ), 
+  m_eventCounter( 0 ) {
+  declareProperty( "InputFile", m_inputFile, "File wiht fake input" );
+}
+
+StatusCode FakeRoIB::initialize() {
+  std::ifstream inputFile( m_inputFile );
+  if ( not inputFile.good() ) {
+    ATH_MSG_DEBUG( "Input file is wrong: " << m_inputFile );
+    return StatusCode::FAILURE;
+  }
+  auto checkBitChar = [&]( char c ){ return ( ( c == '1' or c == '0' ) ?  StatusCode::SUCCESS : StatusCode::FAILURE );  };
+  auto isChar   = [&]( char c, const char req ) { return ( ( c == req ) ?  StatusCode::SUCCESS : StatusCode::FAILURE ); };
+
+  auto setBit   = [&]( std::vector<uint32_t>& v, size_t position ) {
+    size_t word = position / 32;
+    uint32_t bitMask  = 1<< ( position % 32 );
+    v[word] = v[word] | bitMask;
+  };
+
+  std::string line;
+  while ( std::getline( inputFile, line ) ) {
+    std::istringstream items( line );
+    std::vector<uint32_t>  TBP( 16 ); // 16  x 32 =  512 bits, number of CTP item bits
+    std::vector<uint32_t>  TAV( 16 );
+
+    while ( items )  {
+      int itemID( 0 );
+      items >> itemID;
+      char colon;
+      items >> colon;
+      CHECK( isChar( colon, ':' ) );
+      // now we will read pttern like 1,0 which TBP and TAV
+      char TBPBit, TAVBit, coma;
+
+      items >> TBPBit >> coma >> TAVBit;
+      CHECK( checkBitChar( TBPBit ) );
+      CHECK( checkBitChar( TAVBit ) );
+
+      CHECK( isChar( coma, ',' ) );
+      
+      if ( TBPBit == '1' ) setBit( TBP, itemID );
+      if ( TAVBit == '1' ) setBit( TAV, itemID );
+    }
+    m_data.push_back( CTPRecord( TBP, TAV ) );
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode FakeRoIB::execute() {
+  const size_t index = m_eventCounter % m_data.size(); 
+  ATH_MSG_DEBUG( "Inserting event: " << index );
+  
+  CTPResult ctp = FakeRoIBHelper::buildCTPFragment( m_data[index].TBP, m_data[index].TAV, index );
+  ATH_MSG_DEBUG( "CTP words: " << ctp.print() );
+  if ( not ctp.isComplete() )  {
+    ATH_MSG_ERROR( "Cant't construct compte CTP fragment" );
+    return StatusCode::FAILURE;
+  }
+    
+  RoIBResult *result = new RoIBResult ( ctp );
+
+  CHECK( evtStore()->record( result, "RoIBResult" ) );
+
+  m_eventCounter ++;
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+namespace FakeRoIBHelper {
+  CTPResult buildCTPFragment( const std::vector<uint32_t>& tbp, const std::vector<uint32_t>& tav,  uint32_t index ) {
+    const uint32_t eformatVersion = 5;
+    const uint32_t subdetID = 0x770001;
+    Header h( subdetID, index, eformatVersion );
+
+    std::vector<uint32_t> in( 2 ); // unused timing words
+    in[0] = 0x00;
+    in[1] = 0x00;
+    in.insert( in.end(), tbp.begin(), tbp.end() );
+    in.insert( in.end(), tav.begin(), tav.end() );
+    Trailer t( in.size() ); 
+    CTPResult ctp( eformatVersion, h, t, in );
+    return ctp;
+  }
+
+}
diff --git a/Trigger/TrigFake/src/FakeRoIB.h b/Trigger/TrigFake/src/FakeRoIB.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4a9eabb6773fe89020bafb9f4b6b5e96e758920
--- /dev/null
+++ b/Trigger/TrigFake/src/FakeRoIB.h
@@ -0,0 +1,43 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TrigFake_FakeRoIB_h
+#define TrigFake_FakeRoIB_h
+#include "TrigT1Result/CTPResult.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
+
+
+class FakeRoIB : public AthAlgorithm {
+ public:
+  FakeRoIB( const std::string& name, ISvcLocator* pSvcLocator );
+  /**
+   * @brief this function reads the input file formatted as follows:
+   * item:TBP,TAP,TAV item:TBP,TAP,TAV ... e.g. 12:1,0,0 13:1,1,1 ....
+   **/
+  StatusCode initialize() override;
+  StatusCode execute() override;
+  
+ private:
+
+  
+  struct CTPRecord {
+    CTPRecord( const std::vector<uint32_t>& tbp, const std::vector<uint32_t>& tav ) 
+    :  TBP(tbp), TAV(tav) {}
+    std::vector<uint32_t> TBP;
+    std::vector<uint32_t> TAV;
+
+  };
+  
+  std::vector<CTPRecord> m_data;
+  size_t m_eventCounter;
+  std::string m_inputFile;
+};
+
+namespace FakeRoIBHelper {
+  ROIB::CTPResult buildCTPFragment( const std::vector<uint32_t>& tbp, const std::vector<uint32_t>& tav, uint32_t index );
+
+}
+
+
+#endif 
diff --git a/Trigger/TrigFake/src/components/TrigFake_entries.cxx b/Trigger/TrigFake/src/components/TrigFake_entries.cxx
index d0892344b80e2c5226f51897fcc2a550683c23be..0870b0d5938268d27d7e8ca205b7cf3ccb8cbdb7 100755
--- a/Trigger/TrigFake/src/components/TrigFake_entries.cxx
+++ b/Trigger/TrigFake/src/components/TrigFake_entries.cxx
@@ -1,16 +1,17 @@
+#include "GaudiKernel/DeclareFactoryEntries.h"
 #include "TrigFake/FakeLvl1RoIatFixedEtaPhi.h"
 #include "TrigFake/FakeLvl1MultipleRoIsatFixedEtaPhi.h"
 //#include "TrigFake/FakeLvl1ConversionTestBeam.h"
 #include "TrigFake/FakeLvl1RoIfromKine.h"
 #include "TrigFake/ZVertexFromKine.h"
-#include "GaudiKernel/DeclareFactoryEntries.h"
-
+#include "../FakeRoIB.h"
 
 DECLARE_TOOL_FACTORY( FakeLvl1RoIfromKine )
   //DECLARE_ALGORITHM_FACTORY( FakeLvl1ConversionTestBeam )
 DECLARE_TOOL_FACTORY( FakeLvl1RoIatFixedEtaPhi )
 DECLARE_TOOL_FACTORY( FakeLvl1MultipleRoIsatFixedEtaPhi )
 DECLARE_ALGORITHM_FACTORY( ZVertexFromKine )
+DECLARE_ALGORITHM_FACTORY( FakeRoIB )
 
 DECLARE_FACTORY_ENTRIES(TrigFake) {
     DECLARE_TOOL( FakeLvl1RoIfromKine )
@@ -18,4 +19,5 @@ DECLARE_FACTORY_ENTRIES(TrigFake) {
     DECLARE_TOOL( FakeLvl1RoIatFixedEtaPhi )
     DECLARE_TOOL( FakeLvl1MultipleRoIsatFixedEtaPhi )
     DECLARE_ALGORITHM( ZVertexFromKine )
+    DECLARE_ALGORITHM( FakeRoIB )
 }
diff --git a/Trigger/TrigFake/test/FakeRoIB_test.cxx b/Trigger/TrigFake/test/FakeRoIB_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..efacc993368323e64f9ce31dcc5f64aa3594a5af
--- /dev/null
+++ b/Trigger/TrigFake/test/FakeRoIB_test.cxx
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+#include "CTPfragment/CTPdataformatVersion.h"
+#include "../src/FakeRoIB.h"
+using namespace ROIB;
+int main() {
+
+  std::vector<uint32_t> tbp(16);
+  tbp[0] = 0x11; // just not to be all 0 in TBP
+  std::vector<uint32_t> tav(16);
+  tav[0] = 0x11; // just not to be all 0 in TAV
+  CTPdataformatVersion format(5); // we will use version 5 
+  CTPResult r = FakeRoIBHelper::buildCTPFragment( tbp, tav, 0x55 ); // 0x55 is event number 
+  std::cout << "time words: " << format.getNumberTimeWords() << " RoIB words per bunch " << format.getRoIBwordsPerBunch() << " " << format.getDAQwordsPerBunch() << std::endl;
+  std::cout << " header size " << r.header().size() << " trailer size " << r.trailer().size()  <<  " CTP RoI " << r.roIVec().size() << std::endl;
+
+
+  std::cout << std::endl;
+  std::cout << r.print(true);
+  std::cout << std::endl;
+  
+  
+  if ( not r.isComplete() ) {
+    std::cout << "CTP Result is not complete \n" ;
+    return 1;    
+  }
+
+  return 0;
+}
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetHypo.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetHypo.h
index df3a481e9003dcacc0cedfbf2f2e1bd5faaab362..a5ea05cb6d2ef1c8e7a279347361d1bcd6383ee1 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetHypo.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetHypo.h
@@ -86,6 +86,10 @@ class TrigBjetHypo : public HLT::HypoAlgo {
   /** @brief to check the beam spot flag status. */
   bool m_useBeamSpotFlag;
 
+  /** @brief Overide the requirement that the BS is valid. */
+  /** @brief Used to not apply the correction to the GSC chains */
+  bool m_overRideBeamSpotValid;
+  
   /** @brief DeclareProperty: to monitor method used to perform the cut. */
   float m_monitorMethod;
 
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
index 44c8880f261c492ca463a3be893abc3529392d7b..f87de8c8c1069d1882c65b9c2a20a3873c89b6b1 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
@@ -198,10 +198,18 @@ class TrigBtagFex: public HLT::FexAlgo {
 
   /** @brief Run-2 monitored variables. */
 
-  float m_mon_sv_mass;
-  float m_mon_sv_evtx;
-  int   m_mon_sv_nvtx;
-
+  //SV1 variables
+  float m_mon_sv_mass; 
+  float m_mon_sv_evtx; 
+  int   m_mon_sv_nvtx; 
+  //2017 variables - Nghia
+  int     m_mon_sv_ntkv;
+  float   m_mon_sv_Lxy;
+  float   m_mon_sv_L3d;
+  float   m_mon_sv_sig3;
+  float   m_mon_sv_dR;
+ 
+  //IP2/IP3 variables
   float m_mon_tag_IP2D;
   float m_mon_tag_IP3D;
   float m_mon_tag_SV1;
@@ -209,7 +217,34 @@ class TrigBtagFex: public HLT::FexAlgo {
   float m_mon_tag_MV2c00;
   float m_mon_tag_MV2c10;
   float m_mon_tag_MV2c20;
-
+  //2017 variables - Nghia
+  float m_mon_tag_IP2_c;
+  float m_mon_tag_IP2_cu;
+  float m_mon_tag_IP3_c;
+  float m_mon_tag_IP3_cu;
+
+  //JetFitter variables - Nghia
+  int   m_mon_jf_n2tv;
+  int   m_mon_jf_ntrkv; 
+  int   m_mon_jf_nvtx; 
+  int   m_mon_jf_nvtx1t; 
+  float m_mon_jf_mass; 
+  float m_mon_jf_efrc; 
+  float m_mon_jf_dR; 
+  float m_mon_jf_sig3;
+  /// @brief JetFitter : Delta eta between jet and momentum sum of all tracks associated with displaced vertices reconstructed by JetFitter
+  float m_mon_jf_deta; 
+  /// @brief JetFitter : Delta phi between jet and momentum sum of all tracks associated with displaced vertices reconstructed by JetFitter
+  float m_mon_jf_dphi;  
+
+  //jet variables - Nghia
+  float m_mon_jet_pt;
+  float m_mon_jet_eta;
+  float sv_check;
+  float sv_mass_check ;
+  float jf_check;
+  int   m_mon_sv_bool; 
+  int   m_mon_jf_bool; 
 
   // /** @brief to monitor track selection. */
   // std::vector<float> m_listCutApplied;
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
index e48bc5af437397d81aa8fa5423adb4c855371524..32cefa5c48cd460b1b04545d2d00c37a01916aa1 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
@@ -94,8 +94,11 @@ class TrigGSCFex: public HLT::FexAlgo {
   // 
 
   /** @brief Run-2 monitored variables. */
-
-  //float m_mon_sv_mass;
+  int   m_mon_gsc_ntrk;
+  float m_mon_gsc_width;
+  float m_mon_gsc_ptsum;
+  float m_mon_gsc_ptdiff;
+  float m_mon_gsc_ptratio;
 
   std::string m_trackKey;
   std::string m_jetKey;
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoConfig.py
index d7499cef6bc326191e5bc49d1c90e4db9cf805e1..e58200b71e22dc8ae0a2d741eca8fc9751d72604 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoConfig.py
@@ -45,8 +45,8 @@ class BjetHypo (TrigBjetHypo):
             return None
 
         if instance=="EF" :
-            self.AcceptAll = False
-            self.Instance  = "EF"
+            self.AcceptAll       = False
+            self.Instance        = "EF"
             self.UseBeamSpotFlag = False
 
         self.JetKey = ""
@@ -132,9 +132,10 @@ class BjetHypoNoCut (TrigBjetHypo):
         if instance in AllowedInstances :
             
             if instance=="EF" :
-                self.AcceptAll = True
-                self.Instance  = "EF"
-                self.UseBeamSpotFlag = False
+                self.AcceptAll             = True
+                self.Instance              = "EF"
+                self.UseBeamSpotFlag       = False
+                self.OverrideBeamSpotValid = True
                 from TrigBjetHypo.TrigBjetHypoMonitoring import TrigEFBjetHypoValidationMonitoring, TrigEFBjetHypoOnlineMonitoring
                 validation = TrigEFBjetHypoValidationMonitoring()
                 online     = TrigEFBjetHypoOnlineMonitoring()
@@ -185,8 +186,8 @@ class BjetHypoSplit (TrigBjetHypo):
             instance = "EF"
 
         if instance=="EF" :
-            self.AcceptAll = False
-            self.Instance  = "EF"
+            self.AcceptAll       = False
+            self.Instance        = "EF"
             self.UseBeamSpotFlag = False
         
         if instance=="EF" :
@@ -276,9 +277,10 @@ class BjetHypoSplitNoCut (TrigBjetHypo):
                 instance = "EF"
                 
             if instance=="EF" :
-                self.AcceptAll = True
-                self.Instance  = "EF"
-                self.UseBeamSpotFlag = False
+                self.AcceptAll             = True
+                self.Instance              = "EF"
+                self.UseBeamSpotFlag       = False
+                self.OverrideBeamSpotValid = True
                 from TrigBjetHypo.TrigBjetHypoMonitoring import TrigEFBjetHypoValidationMonitoring, TrigEFBjetHypoOnlineMonitoring
                 validation = TrigEFBjetHypoValidationMonitoring()
                 online     = TrigEFBjetHypoOnlineMonitoring()
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMonitoring.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMonitoring.py
index 7f94669901e20437a565eb4c5406da3aea29bbb5..53a2ecd29845d5d7a93507a1896bc0e560ff5a0a 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMonitoring.py
@@ -7,29 +7,73 @@ class TrigBtagFexMonitoring(TrigGenericMonitoringToolConfig):
         super(TrigBtagFexMonitoring, self).__init__(name)
 
         # Run-2 histograms
-        self.Histograms += [ defineHistogram('sv_mass', type='TH1F', title="BtagFex SV Mass",
-                                             xbins=200, xmin=0.0, xmax=6000.0) ]
-        self.Histograms += [ defineHistogram('sv_evtx', type='TH1F', title="BtagFex SV Energy Fraction",
+        self.Histograms += [ defineHistogram('sv1_mass', type='TH1F', title="BtagFex SV Mass",
+                                             xbins=200, xmin=0.0, xmax=6000.0) ] 
+        self.Histograms += [ defineHistogram('sv1_evtx', type='TH1F', title="BtagFex SV Energy Fraction",
                                              xbins=200, xmin=0.0, xmax=1.0) ]
-        self.Histograms += [ defineHistogram('sv_nvtx', type='TH1F', title="BtagFex SV Two-Track Vertex Number",
+        self.Histograms += [ defineHistogram('sv1_nvtx', type='TH1F', title="BtagFex SV Two-Track Vertex Number",
+                                             xbins=31, xmin=-0.5, xmax=30.5) ]
+        self.Histograms += [ defineHistogram('sv1_ntkv', type='TH1F', title="BtagFex SV Number of tracks used in the SV",
                                              xbins=21, xmin=-0.5, xmax=20.5) ]
+        self.Histograms += [ defineHistogram('sv1_sig3', type='TH1F', title="BtagFex SV 3D Vertex Significance",
+                                             xbins=210, xmin=0.0, xmax=210.0) ]
+        self.Histograms += [ defineHistogram('sv1_Lxy', type='TH1F', title="BtagFex SV Transverse distance between PV and SV",
+                                             xbins=220, xmin=0.0, xmax=110.0) ]
+        self.Histograms += [ defineHistogram('sv1_L3d', type='TH1F', title="BtagFex SV Distance between PV and SV",
+                                             xbins=220, xmin=0.0, xmax=110.0) ]
+        self.Histograms += [ defineHistogram('sv1_dR', type='TH1F', title="BtagFex SV delta R",
+                                             xbins=220, xmin=0.0, xmax=1.1) ]
 
         self.Histograms += [ defineHistogram('tag_IP2D', type='TH1F', title="BtagFex IP2D Likelihood Ratio",
-                                             xbins=200, xmin=-50.0, xmax=50.0) ]
+                                             xbins=200, xmin=-30.0, xmax=40.0) ]
         self.Histograms += [ defineHistogram('tag_IP3D', type='TH1F', title="BtagFex IP3D Likelihood Ratio",
-                                             xbins=200, xmin=-50.0, xmax=50.0) ]
+                                             xbins=200, xmin=-30.0, xmax=40.0) ]
         self.Histograms += [ defineHistogram('tag_SV1', type='TH1F', title="BtagFex SV1 Likelihood Ratio",
-                                             xbins=200, xmin=-50.0, xmax=50.0) ]
+                                             xbins=200, xmin=-20.0, xmax=30.0) ]
         self.Histograms += [ defineHistogram('tag_IP3DSV1', type='TH1F', title="BtagFex IP3D+SV1 Discriminant",
-                                             xbins=200, xmin=-50.0, xmax=50.0) ]
-        self.Histograms += [ defineHistogram('tag_MV2c00', type='TH1F', title="BtagFex MV2c00 Discriminant",
-                                             xbins=200, xmin=-1., xmax=1.) ]
+                                             xbins=200, xmin=-20.0, xmax=50.0) ] 
+        #   self.Histograms += [ defineHistogram('tag_MV2c00', type='TH1F', title="BtagFex MV2c00 Discriminant",
+        #                                        xbins=200, xmin=-1., xmax=1.) ]
         self.Histograms += [ defineHistogram('tag_MV2c10', type='TH1F', title="BtagFex MV2c10 Discriminant",
-                                             xbins=200, xmin=--1., xmax=1.) ]
-        self.Histograms += [ defineHistogram('tag_MV2c20', type='TH1F', title="BtagFex MV2c20 Discriminant",
                                              xbins=200, xmin=-1., xmax=1.) ]
+        self.Histograms += [ defineHistogram('tag_MV2c20', type='TH1F', title="BtagFex MV2c20 Discriminant",
+                                             xbins=200, xmin=-1., xmax=1.) ]  
+        self.Histograms += [ defineHistogram('tag_IP2_c', type='TH1F', title="BtagFex IP2D Likelihood Ratio between b- and c-jet",
+                                             xbins=200, xmin=-30.0, xmax=30.0) ]
+        self.Histograms += [ defineHistogram('tag_IP2_cu', type='TH1F', title="BtagFex IP2D Likelihood Ratio between c- and light jet",
+                                             xbins=200, xmin=-30.0, xmax=30.0) ]
+        self.Histograms += [ defineHistogram('tag_IP3_c', type='TH1F', title="BtagFex IP3D Likelihood Ratio between b- and c-jet",
+                                             xbins=200, xmin=-30.0, xmax=30.0) ]
+        self.Histograms += [ defineHistogram('tag_IP3_cu', type='TH1F', title="BtagFex IP3D Likelihood Ratio between c- and light jet",
+                                             xbins=200, xmin=-30.0, xmax=30.0) ]
 
-
+        #MV2 taggers 
+        self.Histograms += [ defineHistogram('jf_n2tv', type='TH1F', title="BtagFex JetFitter Number of 2-track vertex",
+                                             xbins=21, xmin=-0.5, xmax=20.5) ]
+        self.Histograms += [ defineHistogram('jf_ntrkv', type='TH1F', title="BtagFex JetFitter Number of tracks from displaced vertices",
+                                             xbins=16, xmin=-0.5, xmax=15.5) ]
+        self.Histograms += [ defineHistogram('jf_nvtx', type='TH1F', title="BtagFex JetFitter Number of displaced vertices ",
+                                             xbins=11, xmin=-0.5, xmax=10.5) ]
+        self.Histograms += [ defineHistogram('jf_nvtx1t', type='TH1F', title="BtagFex JetFitter Number of displaced vertices wih 1-track",
+                                             xbins=11, xmin=-0.5, xmax=10.5) ]
+        self.Histograms += [ defineHistogram('jf_mass', type='TH1F', title="BtagFex JetFitter Jet mass",
+                                             xbins=200, xmin=0.0, xmax=9100.0) ]
+        self.Histograms += [ defineHistogram('jf_efrc', type='TH1F', title="BtagFex JetFitter Jet efrac ",
+                                             xbins=220, xmin=0.0, xmax=1.1) ]  
+        self.Histograms += [ defineHistogram('jf_dR', type='TH1F', title="BtagFex JetFitter Delta R ",
+                                             xbins=200, xmin=-1.0, xmax=1.0) ]
+        self.Histograms += [ defineHistogram('jf_sig3', type='TH1F', title="BtagFex JetFitter 3D vertex significance ",
+                                             xbins=200, xmin=-0.0, xmax=100.0) ]
+        self.Histograms += [ defineHistogram('jet_pt', type='TH1F', title="BtagFex Jet PT",
+                                             xbins=200, xmin=0.0, xmax=800000.0) ]
+        self.Histograms += [ defineHistogram('jet_eta', type='TH1F', title="BtagFex Jet Eta ",
+                                             xbins=200, xmin=-4.9, xmax=4.9) ]
+        self.Histograms += [ defineHistogram('sv_bool', type='TH1F', title="BtagFex Boolean if SV is found",
+                                             xbins=3, xmin=-0.5, xmax=2.5,
+                                             labels='sv_ntkv == -1:sv_ntkv == 1:sv_ntkv > 1') ]
+        self.Histograms += [ defineHistogram('jf_bool', type='TH1F', title="BtagFex Boolean of jf_dR",
+                                             xbins=2, xmin=-0.5, xmax=1.5,
+                                             labels='jf_dR == -1:jf_dR != -1') ]
 
 class TrigEFBtagFexValidationMonitoring(TrigBtagFexMonitoring):
     def __init__ (self, name="TrigEFBtagFexValidationMonitoring"):
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexConfig.py
index 6bb8457fa908b50d267b674d4de99ddc20e0873c..1e1fa2c6866149c74ea81cee15af09bc7e1ea581 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexConfig.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexConfig.py
@@ -1,18 +1,18 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 from TrigBjetHypo.TrigBjetHypoConf import TrigGSCFex
-#from TrigBjetHypo.TrigGSCFexTuning import *
+#from TrigBjetHypo.TrigGSCFexTuning import *   
 
 from AthenaCommon.Logging import logging
-#from AthenaCommon.SystemOfUnits import mm, GeV
+from AthenaCommon.SystemOfUnits import mm, GeV   #commented here
 
 from AthenaCommon.AppMgr import ToolSvc
-#from BTagging.BTaggingFlags import BTaggingFlags
-#from BTagging.BTaggingConfiguration import getConfiguration
-#BTagConfig = getConfiguration("Trig")
-#BTagConfig.PrefixxAODBaseName(False)
-#BTagConfig.PrefixVertexFinderxAODBaseName(False)
-#BTagConfigSetupStatus = BTagConfig.setupJetBTaggerTool(ToolSvc, "AntiKt4EMTopo", SetupScheme="Trig", TaggerList=BTaggingFlags.TriggerTaggers)
+from BTagging.BTaggingFlags import BTaggingFlags #commented here
+from BTagging.BTaggingConfiguration import getConfiguration #commented here
+BTagConfig = getConfiguration("Trig")   #commented here
+BTagConfig.PrefixxAODBaseName(False)   #commented here
+BTagConfig.PrefixVertexFinderxAODBaseName(False)   #commented here
+BTagConfigSetupStatus = BTagConfig.setupJetBTaggerTool(ToolSvc, "AntiKt4EMTopo", SetupScheme="Trig", TaggerList=BTaggingFlags.TriggerTaggers)   #commented here
 from JetRec.JetRecCalibrationFinder import jrcf
 JetConfigSetupStatus = True
 
@@ -68,16 +68,16 @@ class GSCFex (TrigGSCFex):
                 self.GSCCalibrationTool = jrcf.find("AntiKt", 0.4, "EMTopo", "ajg", "reco", "Kt4")
                 print self.GSCCalibrationTool
         # MONITORING
-        #from TrigBjetHypo.TrigGSCFexMonitoring import TrigEFGSCFexValidationMonitoring, TrigEFGSCFexOnlineMonitoring
-        #validation = TrigEFGSCFexValidationMonitoring()
-        #online     = TrigEFGSCFexOnlineMonitoring()    
+        from TrigBjetHypo.TrigGSCFexMonitoring import TrigEFGSCFexValidationMonitoring, TrigEFGSCFexOnlineMonitoring   #commented here
+        validation = TrigEFGSCFexValidationMonitoring()   #commented here
+        online     = TrigEFGSCFexOnlineMonitoring()       #commented here
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("TimeHistogramForTrigBjetHypo")
         time.TimerHistLimits = [0,2]
         
-        #self.AthenaMonTools = [ time, validation, online ]
-        self.AthenaMonTools = [ time  ]
+        self.AthenaMonTools = [ time, validation, online ]  #commented here
+        #self.AthenaMonTools = [ time  ]                    #uncommented here
 
 
 ###########################################
@@ -141,16 +141,16 @@ class GSCFexSplit (TrigGSCFex):
 
 
         # MONITORING
-        #from TrigBjetHypo.TrigGSCFexMonitoring import TrigEFGSCFexValidationMonitoring, TrigEFGSCFexOnlineMonitoring
-        #validation = TrigEFGSCFexValidationMonitoring()
-        #online     = TrigEFGSCFexOnlineMonitoring()    
+        from TrigBjetHypo.TrigGSCFexMonitoring import TrigEFGSCFexValidationMonitoring, TrigEFGSCFexOnlineMonitoring   #commented here
+        validation = TrigEFGSCFexValidationMonitoring()   #commented here
+        online     = TrigEFGSCFexOnlineMonitoring()       #commented here
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("TimeHistogramForTrigBjetHypo")
         time.TimerHistLimits = [0,2]
         
-        #self.AthenaMonTools = [ time, validation, online ]
-        self.AthenaMonTools = [ time ]
+        self.AthenaMonTools = [ time, validation, online ]   #commented here
+        #self.AthenaMonTools = [ time ]                      #uncommented here
 
 
 ###########################################
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMonitoring.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMonitoring.py
index 17bb203f21bc5df53d857eda118d118b0c25f429..d633baf2eb13d0b727d0effecfa7d97e8c62e2b1 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMonitoring.py
@@ -28,8 +28,16 @@ class TrigGSCFexMonitoring(TrigGenericMonitoringToolConfig):
         #                                     xbins=200, xmin=-50.0, xmax=50.0) ]
         #self.Histograms += [ defineHistogram('tag_MV2c20', type='TH1F', title="GSCFex MV2c20 Discriminant",
         #                                     xbins=200, xmin=-50.0, xmax=50.0) ]
-
-
+        self.Histograms += [ defineHistogram('gsc_ntrk', type='TH1I', title="GSCFex Number of tracks",
+                                             xbins=21, xmin=-0.5, xmax=30.5) ]
+        self.Histograms += [ defineHistogram('gsc_width', type='TH1F', title="GSCFex Track width",
+                                             xbins=200, xmin=-2.0, xmax=2.0) ]
+        self.Histograms += [ defineHistogram('gsc_ptsum', type='TH1F', title="GSCFex Sum of transverse momentum of tracks",
+                                             xbins=200, xmin=-100.0, xmax=600000.0) ]
+        self.Histograms += [ defineHistogram('gsc_ptdiff', type='TH1F', title="GSCFex PT difference between uncal jet and cal jets",
+                                             xbins=200, xmin=-100000.0, xmax=100000.0) ]
+        self.Histograms += [ defineHistogram('gsc_ptratio', type='TH1F', title="GSCFex PT ratio",
+                                             xbins=200, xmin=-1.0, xmax=1.0) ]
 
 class TrigEFGSCFexValidationMonitoring(TrigGSCFexMonitoring):
     def __init__ (self, name="TrigEFGSCFexValidationMonitoring"):
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx
index d81b5510cff4f5e203588ff02447ac247fa44d8b..c0e9cfdb95818d6bdf19defbc3997f5f567b4312 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypo.cxx
@@ -43,7 +43,8 @@ TrigBjetHypo::TrigBjetHypo(const std::string& name, ISvcLocator* pSvcLocator) :
   declareProperty ("MethodTag", m_methodTag  = ""   );
   declareProperty ("Instance",  m_instance          );
 
-  declareProperty ("UseBeamSpotFlag", m_useBeamSpotFlag = false);
+  declareProperty ("UseBeamSpotFlag",       m_useBeamSpotFlag = false);
+  declareProperty ("OverrideBeamSpotValid", m_overRideBeamSpotValid = false);
 
   declareMonitoredVariable("Method", m_monitorMethod);
   declareMonitoredVariable("CutCounter", m_cutCounter);
@@ -123,7 +124,7 @@ HLT::ErrorCode TrigBjetHypo::hltExecute(const HLT::TriggerElement* outputTE, boo
       beamSpotStatus = ((beamSpotBitMap & 0x4) == 0x4);  
       if (beamSpotStatus) beamSpotStatus = ((beamSpotBitMap & 0x3) == 0x3);
       
-      if (!beamSpotStatus) {
+      if (!beamSpotStatus && !m_overRideBeamSpotValid) {
 	
 	m_cutCounter=0;
 	pass = false;
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx
index 2144c94c20266e867f8dc70b9f798d96ccaa1e4f..9732a5e3d83a2c4616dc9c8e1accc8b4ad61d231 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFex.cxx
@@ -22,7 +22,7 @@
 #include "xAODBase/IParticle.h"
 
 #include "xAODJet/Jet.h"
-#include "xAODJet/JetContainer.h"
+ #include "xAODJet/JetContainer.h"
 
 #include "xAODTracking/TrackParticleContainer.h"
 
@@ -68,9 +68,15 @@ TrigBtagFex::TrigBtagFex(const std::string& name, ISvcLocator* pSvcLocator) :
 
   // Run-2 monitoring
 
-  declareMonitoredVariable("sv_mass", m_mon_sv_mass, AutoClear);
-  declareMonitoredVariable("sv_evtx", m_mon_sv_evtx, AutoClear);
-  declareMonitoredVariable("sv_nvtx", m_mon_sv_nvtx, AutoClear);
+  declareMonitoredVariable("sv1_mass", m_mon_sv_mass, AutoClear);
+  declareMonitoredVariable("sv1_evtx", m_mon_sv_evtx, AutoClear);
+  declareMonitoredVariable("sv1_nvtx", m_mon_sv_nvtx, AutoClear);
+  declareMonitoredVariable("sv1_ntkv", m_mon_sv_ntkv, AutoClear);
+  declareMonitoredVariable("sv1_sig3", m_mon_sv_sig3, AutoClear);
+  declareMonitoredVariable("sv1_Lxy",  m_mon_sv_Lxy,  AutoClear);
+  declareMonitoredVariable("sv1_L3d",  m_mon_sv_L3d,  AutoClear);
+  declareMonitoredVariable("sv1_dR",   m_mon_sv_dR,   AutoClear);
+
 
   declareMonitoredVariable("tag_IP2D",    m_mon_tag_IP2D,    AutoClear);
   declareMonitoredVariable("tag_IP3D",    m_mon_tag_IP3D,    AutoClear);
@@ -79,6 +85,25 @@ TrigBtagFex::TrigBtagFex(const std::string& name, ISvcLocator* pSvcLocator) :
   declareMonitoredVariable("tag_MV2c00",  m_mon_tag_MV2c00,  AutoClear);
   declareMonitoredVariable("tag_MV2c10",  m_mon_tag_MV2c10,  AutoClear);
   declareMonitoredVariable("tag_MV2c20",  m_mon_tag_MV2c20,  AutoClear);
+  declareMonitoredVariable("tag_IP2_c",   m_mon_tag_IP2_c,   AutoClear);
+  declareMonitoredVariable("tag_IP2_cu",  m_mon_tag_IP2_cu,  AutoClear);
+  declareMonitoredVariable("tag_IP3_c",   m_mon_tag_IP3_c,   AutoClear);
+  declareMonitoredVariable("tag_IP3_cu",  m_mon_tag_IP3_cu,  AutoClear);
+
+  //MV2 taggers variables
+  declareMonitoredVariable("jf_n2tv",   m_mon_jf_n2tv,   AutoClear);
+  declareMonitoredVariable("jf_ntrkv",  m_mon_jf_ntrkv,  AutoClear);
+  declareMonitoredVariable("jf_nvtx",   m_mon_jf_nvtx,   AutoClear);
+  declareMonitoredVariable("jf_nvtx1t", m_mon_jf_nvtx1t, AutoClear);
+  declareMonitoredVariable("jf_mass",   m_mon_jf_mass,   AutoClear);
+  declareMonitoredVariable("jf_efrc",   m_mon_jf_efrc,   AutoClear);
+  declareMonitoredVariable("jf_dR",     m_mon_jf_dR,     AutoClear);
+  declareMonitoredVariable("jf_sig3",   m_mon_jf_sig3,   AutoClear);
+
+  declareMonitoredVariable("jet_pt",    m_mon_jet_pt,    AutoClear);
+  declareMonitoredVariable("jet_eta",   m_mon_jet_eta,   AutoClear);
+  declareMonitoredVariable("sv_bool",   m_mon_sv_bool,   AutoClear);
+  declareMonitoredVariable("jf_bool",   m_mon_jf_bool,   AutoClear);
 
 }
 
@@ -331,18 +356,105 @@ HLT::ErrorCode TrigBtagFex::hltExecute(const HLT::TriggerElement* inputTE, HLT::
   }
 
   // Fill monitoring variables
-  trigBTagging->variable<float>("SV1", "masssvx",  m_mon_sv_mass);
-  trigBTagging->variable<float>("SV1", "efracsvx", m_mon_sv_evtx);
-  trigBTagging->variable<int>  ("SV1", "N2Tpair",  m_mon_sv_nvtx);
 
+  sv_mass_check = 0.0 ; 
+  
+  trigBTagging->variable<float>("SV1", "masssvx",  sv_mass_check);
+
+  if(sv_mass_check == -1 )     { m_mon_sv_bool = 0;}
+  else if(sv_mass_check == 0 ) { m_mon_sv_bool = 1;}
+  else{m_mon_sv_bool = 2; }  
+
+  sv_check = trigBTagging->auxdata<float>("SV1_Lxy");
+
+  if( sv_check != -100.0 ) 
+    {  
+      trigBTagging->variable<float>("SV1", "masssvx",  m_mon_sv_mass);
+      trigBTagging->variable<float>("SV1", "efracsvx", m_mon_sv_evtx);
+      trigBTagging->variable<int>  ("SV1", "N2Tpair",  m_mon_sv_nvtx);
+      trigBTagging->variable<int>  ("SV1", "NGTinSvx", m_mon_sv_ntkv);
+      trigBTagging->variable<float>("SV1", "normdist", m_mon_sv_sig3);
+      if(m_mon_sv_sig3 > 200) m_mon_sv_sig3 = 200;
+      m_mon_sv_Lxy = trigBTagging->auxdata<float>("SV1_Lxy");
+      if(m_mon_sv_Lxy > 100) m_mon_sv_Lxy = 100;
+      m_mon_sv_L3d = trigBTagging->auxdata<float>("SV1_L3d");
+      if(m_mon_sv_L3d > 100) m_mon_sv_L3d = 100;
+      m_mon_sv_dR  = trigBTagging->auxdata<float>("SV1_deltaR");
+      if(m_mon_sv_dR > 1) m_mon_sv_dR = 1;
+      m_mon_tag_SV1     = trigBTagging->SV1_loglikelihoodratio();
+    }
+  else
+    {
+      m_mon_sv_mass= -999; 
+      m_mon_sv_evtx= -999; 
+      m_mon_sv_nvtx= -999; 
+      m_mon_sv_ntkv= -999;
+      m_mon_sv_Lxy= -999;
+      m_mon_sv_L3d= -999;
+      m_mon_sv_sig3= -999;
+      m_mon_sv_dR= -999; 
+      m_mon_tag_SV1= -999;
+    } //set default values for jets that SV is not found
+
+  
+  //Check JetFitter algorithm
+  m_mon_jf_deta = -10.;
+  m_mon_jf_dphi = -10.;
+  trigBTagging->variable<float>  ("JetFitter", "deltaeta",  m_mon_jf_deta);
+  trigBTagging->variable<float>  ("JetFitter", "deltaphi",  m_mon_jf_dphi); 
+  jf_check = std::hypot( m_mon_jf_deta,m_mon_jf_dphi);
+  if( jf_check > 14 ){ jf_check = -1. ; }
+
+
+  if(jf_check == -1 ) { m_mon_jf_bool = 0;}
+  else{ m_mon_jf_bool = 1;}
+
+  if( jf_check != -1 )
+    {
+      trigBTagging->variable<int>  ("JetFitter", "N2Tpair",  m_mon_jf_n2tv);
+      if(m_mon_jf_n2tv > 20) m_mon_jf_n2tv = 20;
+      trigBTagging->variable<int>  ("JetFitter", "nTracksAtVtx",  m_mon_jf_ntrkv);
+      trigBTagging->variable<int>  ("JetFitter", "nVTX",  m_mon_jf_nvtx);
+      trigBTagging->variable<int>  ("JetFitter", "nSingleTracks",  m_mon_jf_nvtx1t);
+      trigBTagging->variable<float>  ("JetFitter", "mass",  m_mon_jf_mass);
+      if(m_mon_jf_mass > 9000) m_mon_jf_mass = 9000;
+      trigBTagging->variable<float>  ("JetFitter", "energyFraction",  m_mon_jf_efrc);
+   
+      m_mon_jf_dR = std::hypot( m_mon_jf_deta,m_mon_jf_dphi);
+      if( m_mon_jf_dR > 14 ){ m_mon_jf_dR = -1. ; }
+      trigBTagging->variable<float>  ("JetFitter", "significance3d",  m_mon_jf_sig3); 
+    }
+  else
+    {
+      m_mon_jf_n2tv= -999;
+      m_mon_jf_ntrkv= -999; 
+      m_mon_jf_nvtx= -999; 
+      m_mon_jf_nvtx1t= -999; 
+      m_mon_jf_mass= -999; 
+      m_mon_jf_efrc= -999; 
+      m_mon_jf_dR= -999; 
+      m_mon_jf_sig3= -999; 
+    } 
+
+  //Check IPxD/MV2 variables
   m_mon_tag_IP2D    = trigBTagging->IP2D_loglikelihoodratio();
   m_mon_tag_IP3D    = trigBTagging->IP3D_loglikelihoodratio();
-  m_mon_tag_SV1     = trigBTagging->SV1_loglikelihoodratio();
   m_mon_tag_IP3DSV1 = trigBTagging->SV1plusIP3D_discriminant();
+  m_mon_tag_MV2c00  = trigBTagging->auxdata<double>("MV2c00_discriminant");
+  m_mon_tag_MV2c10  = trigBTagging->auxdata<double>("MV2c10_discriminant");
+  m_mon_tag_MV2c20  = trigBTagging->auxdata<double>("MV2c20_discriminant");
+  if( trigBTagging->IP2D_pc() != 0 && trigBTagging->IP2D_pb() != 0 ) m_mon_tag_IP2_c   = log(( trigBTagging->IP2D_pb() )/( trigBTagging->IP2D_pc() ));
+  else m_mon_tag_IP2_c   = -999.;
+  if( trigBTagging->IP2D_pu() != 0 && trigBTagging->IP2D_pc() != 0 ) m_mon_tag_IP2_cu  = log(( trigBTagging->IP2D_pc() )/( trigBTagging->IP2D_pu() ));
+  else m_mon_tag_IP2_cu  = -999.;
+  if( trigBTagging->IP3D_pc() != 0 && trigBTagging->IP3D_pb() != 0 ) m_mon_tag_IP3_c   = log(( trigBTagging->IP3D_pb() )/( trigBTagging->IP3D_pc() ));
+  else m_mon_tag_IP3_c   = -999.;
+  if( trigBTagging->IP3D_pu() != 0 && trigBTagging->IP3D_pc() != 0 ) m_mon_tag_IP3_cu  = log(( trigBTagging->IP3D_pc() )/( trigBTagging->IP3D_pu() ));
+  else m_mon_tag_IP3_cu  = -999.;
+
+  m_mon_jet_pt  =  jet.pt()  ;
+  m_mon_jet_eta =  jet.eta() ;
 
-  m_mon_tag_MV2c00 = trigBTagging->auxdata<double>("MV2c00_discriminant");
-  m_mon_tag_MV2c10 = trigBTagging->auxdata<double>("MV2c10_discriminant");
-  m_mon_tag_MV2c20 = trigBTagging->auxdata<double>("MV2c20_discriminant");
 
   // Dump results 
   if(msgLvl() <= MSG::DEBUG)
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFex.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFex.cxx
index 8e269d77bde8be98f5489d3ced8e45031af524c4..cabe5db4a5cde92ae53c9895bd7c5d41fb529ff5 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFex.cxx
@@ -49,7 +49,11 @@ TrigGSCFex::TrigGSCFex(const std::string& name, ISvcLocator* pSvcLocator) :
 
   // Run-2 monitoring
   
-  //declareMonitoredVariable("sv_mass", m_mon_sv_mass, AutoClear);
+  declareMonitoredVariable("gsc_ntrk",    m_mon_gsc_ntrk,    AutoClear);
+  declareMonitoredVariable("gsc_width",   m_mon_gsc_width,   AutoClear);
+  declareMonitoredVariable("gsc_ptsum",   m_mon_gsc_ptsum,   AutoClear);
+  declareMonitoredVariable("gsc_ptdiff",  m_mon_gsc_ptdiff,  AutoClear);
+  declareMonitoredVariable("gsc_ptratio", m_mon_gsc_ptratio, AutoClear);
 
 
 }
@@ -219,7 +223,6 @@ HLT::ErrorCode TrigGSCFex::hltExecute(const HLT::TriggerElement* inputTE, HLT::T
 //	    << " phi: " << calJet->p4().Phi()
 //	    << " m: "   << calJet->p4().M()
 //	    << std::endl;
-
   
   xAOD::JetTrigAuxContainer trigJetTrigAuxContainer;
   xAOD::JetContainer* jc = new xAOD::JetContainer;
@@ -252,8 +255,13 @@ HLT::ErrorCode TrigGSCFex::hltExecute(const HLT::TriggerElement* inputTE, HLT::T
 
 
   // Fill monitoring variables
-  //trigBTagging->variable<float>("SV1", "masssvx",  m_mon_sv_mass);
-
+  m_mon_gsc_ntrk  = nTrk;
+  m_mon_gsc_width = width;
+  m_mon_gsc_ptsum = ptsum; 
+  m_mon_gsc_ptdiff = jet.p4().Pt() - jc->back()->p4().Pt(); 
+  if( jc->back()->p4().Pt() != 0 ) m_mon_gsc_ptratio = ( m_mon_gsc_ptdiff )/( jc->back()->p4().Pt() ) ; 
+  else m_mon_gsc_ptratio = -999.;
+  
   return HLT::OK;
 }
 
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkFexConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkFexConfig.py
index 359f5cac2b4657706525a0ea5b8426acf59a74c0..e20c62a6d83c99360f4530486b539ccd36f21394 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkFexConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkFexConfig.py
@@ -69,7 +69,7 @@ class TrigMultiTrkFex_trkPhi (TrigMultiTrkFexPy):
         self.nTrkCharge = 0
         self.nTrkMassMin = [840.]  
         self.nTrkMassMax = [1240.] 
-        self.ptTrkMin = [3750., 3750. ] # set minimal pt of tracks for Phi+Pi
+        self.ptTrkMin = [3600., 3600. ] # set minimal pt of tracks for Phi+Pi
         self.diTrkMassMin = []   # phi window
         self.diTrkMassMax = []
         self.diTrkCharge = -1
@@ -98,7 +98,7 @@ class TrigMultiTrkFex_trkPhiX (TrigMultiTrkFexPy):
         self.nTrk = 3
         self.trkMass = 105.6583745  # looking for di-muon resonances       
         self.nTrkCharge = 1
-        self.ptTrkMin = [3750., 3750., 1000. ] # set minimal pt of tracks for Phi+Pi
+        self.ptTrkMin = [3600., 3600., 1000. ] # set minimal pt of tracks for Phi+Pi
         self.diTrkMassMin = [840.]   # phi window
         self.diTrkMassMax = [1240.]
         self.diTrkCharge = 0
@@ -130,7 +130,7 @@ class TrigMultiTrkFex_trkPhiXTight (TrigMultiTrkFexPy):
         self.nTrkCharge = 1
         self.nTrkMassMin = [1500.]
         self.nTrkMassMax = [2500.] 
-        self.ptTrkMin = [3750., 3750., 1000. ] # set minimal pt of tracks for Phi+Pi
+        self.ptTrkMin = [3600., 3600., 1000. ] # set minimal pt of tracks for Phi+Pi
         self.diTrkMassMin = [840.]   # phi window
         self.diTrkMassMax = [1240.]
         self.diTrkCharge = 0
@@ -164,7 +164,7 @@ class TrigMultiTrkFex_trkTau (TrigMultiTrkFexPy):
         self.nTrkMassMin = [0.]
         self.nTrkMassMax = [2900.] # cut away J/psi
         self.nTrkCharge = -1
-        self.ptTrkMin = [3750., 1000. ] # set minimal pt of tracks for Phi+Pi
+        self.ptTrkMin = [3600., 3600. ] # set minimal pt of tracks for Phi+Pi
         self.diTrkMassMin = []   # no sub-resonances
         self.diTrkMassMax = []
         # muons are not matched to tracks, but still require to be present in TE
@@ -313,7 +313,7 @@ class TrigMultiTrkFex_DiMu (TrigMultiTrkFexPy):
         self.nTrkCharge = 0
         self.nTrkMassMin = [100.]
         self.nTrkMassMax = [15000.] 
-        self.ptTrkMin = [3750., 3750. ] # set minimal pt of tracks for 2mu passing L1
+        self.ptTrkMin = [3600., 3600. ] # set minimal pt of tracks for 2mu passing L1
         self.diTrkMassMin = []   # phi window
         self.diTrkMassMax = []
         self.diTrkCharge = -1
@@ -369,7 +369,7 @@ class TrigMultiTrkFex_Vtx2 (TrigMultiTrkFexPy):
         self.nTrkCharge = -1
         self.nTrkMassMin = [0.]  
         self.nTrkMassMax = [1e+8] # should be safe at LHC, no? 
-        self.ptTrkMin = [3750., 3750. ] # set minimal pt of tracks for 2mu passing L1
+        self.ptTrkMin = [3600., 3600. ] # set minimal pt of tracks for 2mu passing L1
         self.diTrkMassMin = []   # phi window
         self.diTrkMassMax = []
         self.diTrkCharge = -1
@@ -392,7 +392,7 @@ class TrigMultiTrkFex_Vtx3 (TrigMultiTrkFexPy):
     def __init__(self, name = "TrigMultiTrkFex_Vtx3"):
         super( TrigMultiTrkFex_Vtx3, self ).__init__( name )
         self.nTrk = 3
-        self.ptTrkMin = [3750., 3750., 3750. ] # set minimal pt of tracks for 3mu passing L1
+        self.ptTrkMin = [3600., 3600., 3600. ] # set minimal pt of tracks for 3mu passing L1
 
 #############################################################################
 class TrigMultiTrkFex_Jpsi (TrigMultiTrkFexPy):
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPidTools.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPidTools.py
index 052cd51236e3809d69a34e6026e49d8b3cad43b1..8fdf9edd0eee16dcf6c3abe32f532274638eb8bb 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPidTools.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPidTools.py
@@ -41,6 +41,7 @@ from ElectronPhotonSelectorTools.TrigEGammaPIDdefs import SelectionDefPhoton
 mlog = logging.getLogger ('TrigEgammaPidTools')
 # Path for versioned configuration
 from TriggerMenu.egamma.EgammaSliceFlags import EgammaSliceFlags
+EgammaSliceFlags.pidVersion.set_On()
 mlog.info("TrigEgammaPidTools version %s"%EgammaSliceFlags.pidVersion())
 ConfigFilePath = EgammaSliceFlags.pidVersion() 
 
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
index 15c1ed9480ce7bbf51a08ea1385a9d45628afc19..585b0353d20d97fd7c648969298edcda5c6560a6 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
@@ -39,7 +39,7 @@ class TrigL2PhotonHypoValidationMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1I', title="L2Photon Hypo Passed Cuts;Cut",
+        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1F', title="L2Photon Hypo Passed Cuts;Cut",
                                              xbins=10, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ]        
 
 
@@ -62,7 +62,7 @@ class TrigL2PhotonHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1I', title="L2Photon Hypo Passed Cuts;Cut",
+        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1F', title="L2Photon Hypo Passed Cuts;Cut",
                                              xbins=10, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ]   
             
       
@@ -101,7 +101,7 @@ class TrigL2PhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1I', title="L2Photon Hypo Passed Cuts;Cut",
+        self.Histograms += [ defineHistogram('CutCounter', 	type='TH1F', title="L2Photon Hypo Passed Cuts;Cut",
                                              xbins=10, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ]   
        
       
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloCalibFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloCalibFex.cxx
index ecce3662366cb5a085924d88646746eac1b689d4..41bf4fcdb10a0c1359415de189bc8483dc1d460a 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloCalibFex.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloCalibFex.cxx
@@ -212,6 +212,9 @@ HLT::ErrorCode TrigEFCaloCalibFex::hltExecute(const HLT::TriggerElement* inputTE
     
     for(const auto *clus : *clusContainer){
         
+	// To avoid clusters formed from cosmics or noise bursts
+        if ( (clus->eta() < -998.0) && (clus->phi() < -998.0) ) continue;
+
         if (!clus->inBarrel() && !clus->inEndcap() )
         {
             ATH_MSG_ERROR("Cluster neither in barrel nor in endcap, Skipping cluster");
diff --git a/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.cxx b/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.cxx
index 94bb8c4b7df75ce745b2eb327c54026ba3a817ab..af9d6a814dd6696a1b266d0324272503cbfd3e78 100644
--- a/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.cxx
@@ -1,17 +1,5 @@
 /*
   Copyright (C) 1995-2017 CERN for the benefit of the ATLAS collaboration
-  
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-  
-  http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
 */
 
 #include "TrigFTKAvailableHypo.h"
diff --git a/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.h b/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.h
index eed88f2a69ed747809f599b4bab00c3344d83ec8..e0f75798fda53b9378aa42c635c8ca579bb54205 100644
--- a/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.h
+++ b/Trigger/TrigHypothesis/TrigFTKHypo/src/TrigFTKAvailableHypo.h
@@ -1,17 +1,5 @@
 /*
   Copyright (C) 1995-2017 CERN for the benefit of the ATLAS collaboration
-  
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-  
-  http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
 */
 
 /** @class TrigFTKAvailableHypo                                                                                                            
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
index 7562d91ac3418e84dddd295e606a3a8d2e0687ee..c64bff932782c9d62b93a0bae9c3ff71383ed654 100755
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
+++ b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
@@ -6,7 +6,6 @@
 #include <string>
 #include <vector>
 #include <set>
-#include "GaudiKernel/Algorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
index c985850d21211f70c3cfb86ef2039904b84d4271..883d83b9714457e568f907cb62cd5eb656f2e46d 100755
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
@@ -14,7 +14,6 @@
 
 #include "RegionSelector/IRegSelSvc.h"
 #include "PathResolver/PathResolver.h"
-#include "GaudiKernel/ITHistSvc.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 #include "TrigSteering/Lvl1ItemsAndRoIs.h"
 #include "TrigT1Result/RoIBResult.h"
@@ -49,54 +48,54 @@ L1InfoHypo::~L1InfoHypo() {
 
 HLT::ErrorCode L1InfoHypo::hltInitialize() 
 {
-  msg() << MSG::DEBUG << "initialize()" << endreq;
+  ATH_MSG_DEBUG( "initialize()" );
   
-  msg() << MSG::INFO << "Parameters for L1InfoHypo:" << name() << endreq;
-  msg() << MSG::INFO << "AlwaysPass                  : " << mAlwaysPass                    << endreq;
-  msg() << MSG::INFO << "InvertSelection             : " << mInvertSelection               << endreq;
-  msg() << MSG::INFO << "L1ItemNames                 : " << mL1ItemNames                   << endreq;
-  msg() << MSG::INFO << "InvertL1ItemNameSelection   : " << mInvertL1ItemNameSelection     << endreq;
-  msg() << MSG::INFO << "TriggerTypeBitMask          : " << mTriggerTypeBitMask            << endreq;
-  msg() << MSG::INFO << "L1TriggerBitMask            : " << mL1TriggerBitMask              << endreq;
-  msg() << MSG::INFO << "TriggerTypeBit              : " << mTriggerTypeBit                << endreq;
-  msg() << MSG::INFO << "L1TriggerBit                : " << mL1TriggerBit                  << endreq;
-  msg() << MSG::INFO << "InvertBitMasksSelection     : " << mInvertBitMaskSelection        << endreq;
+  ATH_MSG_INFO( "Parameters for L1InfoHypo:" << name() );
+  ATH_MSG_INFO( "AlwaysPass                  : " << mAlwaysPass                    );
+  ATH_MSG_INFO( "InvertSelection             : " << mInvertSelection               );
+  ATH_MSG_INFO( "L1ItemNames                 : " << mL1ItemNames                   );
+  ATH_MSG_INFO( "InvertL1ItemNameSelection   : " << mInvertL1ItemNameSelection     );
+  ATH_MSG_INFO( "TriggerTypeBitMask          : " << mTriggerTypeBitMask            );
+  ATH_MSG_INFO( "L1TriggerBitMask            : " << mL1TriggerBitMask              );
+  ATH_MSG_INFO( "TriggerTypeBit              : " << mTriggerTypeBit                );
+  ATH_MSG_INFO( "L1TriggerBit                : " << mL1TriggerBit                  );
+  ATH_MSG_INFO( "InvertBitMasksSelection     : " << mInvertBitMaskSelection        );
 
 
   if ( mlvl1Tool.retrieve().isFailure()) 
     {
-      msg() << MSG::FATAL << "Unable to retrieve lvl1 result access tool: " << mlvl1Tool << endreq;
+      ATH_MSG_FATAL( "Unable to retrieve lvl1 result access tool: " << mlvl1Tool );
       return HLT::FATAL;
     }
 
   StatusCode sc = mlvl1Tool->updateConfig(true,true,true);
   if ( sc.isFailure() ) 
     {
-      (msg()) << MSG::FATAL << "Unable to configure tool!" << endreq;
+      ATH_MSG_FATAL( "Unable to configure tool!" );
       return HLT::FATAL;
     }
 
-  msg() << MSG::DEBUG << "initialize success" << endreq;
+  ATH_MSG_DEBUG( "initialize success" );
 
   return HLT::OK;
 }
 
 HLT::ErrorCode L1InfoHypo::hltBeginRun() 
 {
-  msg() << MSG::DEBUG << "beginRun"<<  endreq;
+  ATH_MSG_DEBUG( "beginRun");
 
   return HLT::OK;
 }
 
 HLT::ErrorCode L1InfoHypo::hltEndRun() 
 {
-  msg() << MSG::DEBUG << "endRun"<<  endreq;
+  ATH_MSG_DEBUG( "endRun");
   return HLT::OK;
 }
 
 HLT::ErrorCode L1InfoHypo::hltFinalize() 
 {
-  msg() << MSG::DEBUG << "finalize()" << endreq;
+  ATH_MSG_DEBUG( "finalize()" );
 
   return HLT::OK;
 }
@@ -107,8 +106,7 @@ HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool
   Pass=true;
   bool ItemPass=false;
 
-  int output_level = msgSvc()->outputLevel(name());
-  if (output_level <= MSG::VERBOSE) msg() << MSG::VERBOSE << "execL1InfoHypo"  << endreq;
+  ATH_MSG_VERBOSE( "execL1InfoHypo"  );
   const EventInfo* constEventInfo(0);
 
   if (mAlwaysPass) {Pass=true; return HLT::OK; };
@@ -117,8 +115,7 @@ HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool
 
   if(sc.isFailure())
     {
-      if(output_level <= MSG::FATAL)
-	msg() << MSG::FATAL << "Can't get EventInfo object"  << endreq;
+	ATH_MSG_FATAL( "Can't get EventInfo object"  );
       return StatusCode::FAILURE;
     }
   else
@@ -130,9 +127,7 @@ HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool
 	  
 	  if(sc.isFailure())
 	    {
-	      msg() << MSG::WARNING
-		  << "Unable to retrieve RoIBResult from storeGate!"
-		  << endreq;
+	      ATH_MSG_WARNING("Unable to retrieve RoIBResult from storeGate!");
 	      return HLT::NO_LVL1_RESULT;
 	    }
 	  const std::vector<const LVL1CTP::Lvl1Item*>& items = mlvl1Tool->createL1Items(*result);
@@ -147,14 +142,14 @@ HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool
 		  continue;
 	      }
 
-	      msg() << MSG::DEBUG << "Found active LVL1 item " << (*item)->name() << " ("
-		  << (*item)->hashId() << ")" << endreq;
+	      ATH_MSG_DEBUG( "Found active LVL1 item " << (*item)->name() << " ("
+		  << (*item)->hashId() << ")" );
 	      for (int unsigned i=0;i<mL1ItemNames.size();i++)
 		{
-		  msg() << MSG::DEBUG << "Comparing " << 
+		  ATH_MSG_DEBUG( "Comparing " << 
 		    (*item)->name() << " to [L1_]" <<
 		    mL1ItemNames[i] << " result: " << 
-		    ( ((*item)->name()==mL1ItemNames[i]) or ((*item)->name()=="L1_"+mL1ItemNames[i]) ) << endreq;
+		    ( ((*item)->name()==mL1ItemNames[i]) or ((*item)->name()=="L1_"+mL1ItemNames[i]) ) );
 		  ItemPass=ItemPass or ((*item)->name()==mL1ItemNames[i]) or ((*item)->name()=="L1_"+mL1ItemNames[i]);
 		};
 	    }
@@ -169,7 +164,7 @@ HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool
       TriggerInfo::number_type L1ID=tinfo->extendedLevel1ID();
       
       //printf("L1 Info: %x %x\n",L1TriggerType,L1ID);
-      msg() << MSG::DEBUG << "L1 Info: " << hex << L1TriggerType << " " << L1ID << endreq;
+      ATH_MSG_DEBUG("L1 Info: " << hex << L1TriggerType << " " << L1ID);
       bool PassBM=
 	((L1TriggerType & mTriggerTypeBitMask)==mTriggerTypeBit||(mTriggerTypeBitMask==0))&&
 	((L1ID          & mL1TriggerBitMask  )==mL1TriggerBit    ||(mL1TriggerBitMask  ==0));
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/TrigL2CaloRingerFex.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/TrigL2CaloRingerFex.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/TrigL2CaloRingerHypo.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/TrigL2CaloRingerHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerConstants.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerConstants.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerCutDefs.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerCutDefs.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoConfig.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoConfig.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoMonitoring.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoMonitoring.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigRingerPreprocessorDefs.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigRingerPreprocessorDefs.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/__init__.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/__init__.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
old mode 100755
new mode 100644
index 5fdfc84ac9977402d864edea484ff80afb0c72a3..36749950699f981333de6d5ecb5096b43b4dd82e
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
@@ -121,7 +121,7 @@ HLT::ErrorCode TrigL2CaloRingerFex::hltFinalize() {
 HLT::ErrorCode TrigL2CaloRingerFex::hltExecute(const HLT::TriggerElement* /*inputTE*/, HLT::TriggerElement* outputTE){
 
   // For now, this must be [avgmu, rnnOutputWithTansig, rnnOutputWithoutTansig] 
-  m_output=-99;
+  m_output=-999;
   std::vector<float> output;
 
   ///Retrieve rings pattern information
@@ -162,10 +162,14 @@ HLT::ErrorCode TrigL2CaloRingerFex::hltExecute(const HLT::TriggerElement* /*inpu
 
   // Fix eta range
   if(eta>2.50) eta=2.50;///fix for events out of the ranger
+  // Add avgmu!
+  output.push_back(avgmu);
+    
 
-
+  if(doTiming())  m_decisionTimer->start();
+  
   if(m_discriminators.size() > 0){
-    if(doTiming())  m_decisionTimer->start();
+      
     for(unsigned i=0; i<m_discriminators.size(); ++i){
       if(et > m_discriminators[i]->etmin() && et <= m_discriminators[i]->etmax()){
         if(eta > m_discriminators[i]->etamin() && eta <= m_discriminators[i]->etamax()){
@@ -176,25 +180,20 @@ HLT::ErrorCode TrigL2CaloRingerFex::hltExecute(const HLT::TriggerElement* /*inpu
       }///Et conditions
     }///Loop over discriminators
 
-    ///get shape
-    const std::vector<float> rings = ringerShape->rings();
-    ATH_MSG_DEBUG( "ringerShape->rings().size() is: " <<rings.size() );
- 
-    std::vector<float> refRings(rings.size());
-    refRings.assign(rings.begin(), rings.end());
-
     ATH_MSG_DEBUG( "Et = " << et << " GeV, |eta| = " << eta );
-
-    ///pre-processing ringer shape (default is Norm1...)
-    if(doTiming())  m_normTimer->start();
-    if(preproc)     preproc->ppExecute(refRings);
-    if(doTiming())  m_normTimer->stop();
-
-    ATH_MSG_DEBUG( "after preproc refRings.size() is: " <<rings.size() );
- 
     ///Apply the discriminator
     if(discr){
 
+      const std::vector<float> rings = ringerShape->rings();
+      std::vector<float> refRings(rings.size());
+      refRings.assign(rings.begin(), rings.end());
+
+      ///pre-processing ringer shape (default is Norm1...)
+      if(doTiming())  m_normTimer->start();
+      if(preproc)     preproc->ppExecute(refRings);
+      if(doTiming())  m_normTimer->stop();
+
+
       float eta_norm=0.0;
       float avgmu_norm=0.0;
 
@@ -214,16 +213,13 @@ HLT::ErrorCode TrigL2CaloRingerFex::hltExecute(const HLT::TriggerElement* /*inpu
       }
 
       m_output=discr->propagate(refRings);
-      output.push_back(avgmu);
       output.push_back(m_output);
       output.push_back(discr->getOutputBeforeTheActivationFunction());
-    }
-
+    }// has discr?
   }else{
     ATH_MSG_DEBUG( "There is no discriminator into this Fex." );
   }
 
-
   if(doTiming())  m_decisionTimer->stop();
 
   ATH_MSG_DEBUG( "Et = " << et << " GeV, |eta| = " << eta << " and rnnoutput = " << m_output );
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
old mode 100755
new mode 100644
index cca7d68954de02603c4a373b8ff858c333988481..75e312c17a35b54b1998c2b2f0a2bbb1a549acb5
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
@@ -78,13 +78,6 @@ HLT::ErrorCode TrigL2CaloRingerHypo::hltExecute(const HLT::TriggerElement* outpu
     return HLT::OK;
   }
 
-  // TODO: Maybe this will expanded for future...
-  // This was define as [avgmu, rnnOtput, rnnOutputWithoutTansig]
-  if(rnnOutput->rnnDecision().size() != 3){
-    ATH_MSG_DEBUG( "Event reproved because we can not retrieve the completed information from RnnOutput to run this hypo!" );
-    return HLT::OK;
-  }
-
   // Start to retrieve all information that I need...
   const xAOD::TrigEMCluster *emCluster = 0;
   const xAOD::TrigRingerRings *ringerShape = rnnOutput->ringer();
@@ -101,8 +94,6 @@ HLT::ErrorCode TrigL2CaloRingerHypo::hltExecute(const HLT::TriggerElement* outpu
 
   float eta     = std::fabs(emCluster->eta());
   float et      = emCluster->et()*1e-3;//GeV
-  float avgmu   = rnnOutput->rnnDecision().at(0);
-
   if(eta>2.50) eta=2.50;///fix for events out of the ranger
 
   ///Et threshold
@@ -111,7 +102,17 @@ HLT::ErrorCode TrigL2CaloRingerHypo::hltExecute(const HLT::TriggerElement* outpu
     return HLT::OK;
   }
 
+ 
   if(m_cutDefs.size() > 0){
+    // TODO: Maybe this will expanded for future...
+    // This was define as [avgmu, rnnOtput, rnnOutputWithoutTansig]
+    if(rnnOutput->rnnDecision().size() != 3){
+      ATH_MSG_INFO( "Event reproved because we can not retrieve the completed information from RnnOutput to run this hypo!" );
+      return HLT::OK;
+    }
+
+    float avgmu   = rnnOutput->rnnDecision().at(0);
+    
     ///Select the correct threshold for each eta/Et region
     for(unsigned i=0; i<m_cutDefs.size();++i){
       if((et  > m_cutDefs[i]->etmin()) && (et  <= m_cutDefs[i]->etmax())){
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/TrigMuonEFCombinerHypo.h b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/TrigMuonEFCombinerHypo.h
index 56bf3adb8848725b72ab99d2096d6b1db73eabfb..2d172559cc106236c7bdf52fbfd5fbffcb9f8c93 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/TrigMuonEFCombinerHypo.h
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/TrigMuonEFCombinerHypo.h
@@ -7,6 +7,7 @@
 
 #include <string>
 #include "TrigInterfaces/HypoAlgo.h"
+#include "LumiBlockComps/ILuminosityTool.h"
 
 class TriggerElement;
 
@@ -27,12 +28,15 @@ class TrigMuonEFCombinerHypo: public HLT::HypoAlgo {
   std::vector<float> m_ptThresholds;
   BooleanProperty m_acceptAll;
   BooleanProperty m_rejectCBmuons;
+  ToolHandle<ILuminosityTool> m_lumiTool;
 
   // Other members:   
   std::vector<float>::size_type m_bins;
   std::vector<float> m_fex_pt;
   std::vector<float> m_fex_eta;
   std::vector<float> m_fex_phi;
+  float m_fex_rate;
+  float m_fex_bcid;
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
index ea1ee85ae9d43accf4eef06a6548732a32fd294f..563c9e58db7a51f273a6276b216accef4a94c0c9 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
@@ -399,6 +399,12 @@ class TrigMuonEFCombinerHypoValidationMonitoring(TrigGenericMonitoringToolConfig
                                             xbins=100, xmin=-3.2, xmax=3.2) ]
         self.Histograms += [ defineHistogram('Phi', type='TH1F', title="Phi reconstruction from #TrigMuonEFCombinerHypo; Phi",
                                              xbins=100, xmin=-3.15, xmax=3.15) ]
+        self.Histograms += [ defineHistogram('BCID', type='TH1F', title="BCID from TrigMuonEFCombinerHypo; BCID",
+                                            xbins=3564, xmin=0, xmax=3563) ]
+        self.Histograms += [ defineHistogram('Rate', type='TH1F', title="Rate from TrigMuonEFCombinerHypo; Rate (Hz)",
+                                            xbins=100, xmin=0, xmax=500) ]
+        self.Histograms += [ defineHistogram('BCID, Rate', type='TProfile', title="Rate vs BCID from TrigMuonEFCombinerHypo; BCID; Rate (Hz)",
+                                             xbins=3564, xmin=0, xmax=3563) ]
 
 class TrigMuonEFCombinerHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="TrigMuonEFCombinerHypoOnlineMonitoring"):
@@ -407,6 +413,13 @@ class TrigMuonEFCombinerHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
 
         self.Histograms = [ defineHistogram('Pt', type='TH1F', title="P_{T} reconstruction from #TrigMuonEFCombinerHypo; P_{T} (GeV)",
                                             xbins=200, xmin=-100, xmax=100) ]
+        self.Histograms += [ defineHistogram('BCID', type='TH1F', title="BCID from TrigMuonEFCombinerHypo; BCID",
+                                            xbins=3564, xmin=0, xmax=3563) ]
+        self.Histograms += [ defineHistogram('Rate', type='TH1F', title="Rate from TrigMuonEFCombinerHypo; Rate (Hz)",
+                                            xbins=100, xmin=0, xmax=500) ]
+        self.Histograms += [ defineHistogram('BCID, Rate', type='TProfile', title="Rate vs BCID from TrigMuonEFCombinerHypo; BCID; Rate (Hz)",
+                                             xbins=3564, xmin=0, xmax=3563) ]
+
 
 
 
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/src/MuisoHypo.cxx b/Trigger/TrigHypothesis/TrigMuonHypo/src/MuisoHypo.cxx
index 2802e9c47dee954ba55d1b5fb0f965bdf311bc14..2d1d7ad9fb6db050ec0405431da7d78818a8a9df 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypo/src/MuisoHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/src/MuisoHypo.cxx
@@ -110,8 +110,9 @@ HLT::ErrorCode MuisoHypo::hltExecute(const HLT::TriggerElement* outputTE, bool&
 
    // Check that there is only one L2IsoMuon
    if (vectorOfMuons->size() != 1) {
-      msg() << MSG::ERROR << "Size of vector is " << vectorOfMuons->size() << endreq;
-      return HLT::ErrorCode(HLT::Action::CONTINUE, HLT::Reason::NAV_ERROR);
+     msg() << MSG::DEBUG << "Size of L2Iso muon vector is " << vectorOfMuons->size() << ", so isolation failed" << endreq;
+     pass = false;
+     return HLT::OK;
    }
 
    // Get first (and only) L2IsoMuon
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCombinerHypo.cxx b/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCombinerHypo.cxx
index 85ad9115cac1d08721969c4e0c125c23e8d58b27..9544f8030f0c14012616ed0c58ea340140662e9d 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCombinerHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCombinerHypo.cxx
@@ -6,12 +6,15 @@
 
 #include "xAODMuon/MuonContainer.h"
 #include "CLHEP/Units/SystemOfUnits.h"
+#include "xAODEventInfo/EventInfo.h"
 
 class ISvcLocator;
 
 TrigMuonEFCombinerHypo::TrigMuonEFCombinerHypo(const std::string & name, ISvcLocator* pSvcLocator):
-	HLT::HypoAlgo(name, pSvcLocator){
-	declareProperty("AcceptAll", m_acceptAll=true);
+  HLT::HypoAlgo(name, pSvcLocator),
+  m_lumiTool("LuminosityTool/LuminosityTool")
+{
+        declareProperty("AcceptAll", m_acceptAll=true);
 	declareProperty("RejectCBmuons", m_rejectCBmuons=false);
 	std::vector<float> def_bins;
 	def_bins.push_back(0);
@@ -20,9 +23,12 @@ TrigMuonEFCombinerHypo::TrigMuonEFCombinerHypo(const std::string & name, ISvcLoc
 	def_thrs.push_back(0.*CLHEP::GeV);
 	declareProperty("PtBins", m_ptBins=def_bins);
 	declareProperty("PtThresholds", m_ptThresholds=def_thrs);
+	declareProperty("LumiTool", m_lumiTool);
 	declareMonitoredStdContainer("Pt",  m_fex_pt);
 	declareMonitoredStdContainer("Eta", m_fex_eta);
 	declareMonitoredStdContainer("Phi", m_fex_phi);
+	declareMonitoredVariable("BCID", m_fex_bcid);
+	declareMonitoredVariable("Rate", m_fex_rate);
 
 	m_bins = 0;
 }
@@ -49,7 +55,12 @@ HLT::ErrorCode TrigMuonEFCombinerHypo::hltInitialize(){
 			                                               << " CLHEP::GeV" << endreq;
 		}
 	}
-
+	if(m_lumiTool.retrieve().isFailure()){
+	  msg() <<MSG::WARNING<<"Unable to retrieve luminosity tool"<<endreq;
+	}
+	else{
+	  msg()<<MSG::DEBUG<<"Sucessfully retrieved luminosty tool"<<endreq; 
+	}
 	msg() << MSG::INFO
 	<< "Initialization completed successfully"
 	<< endreq;
@@ -73,6 +84,8 @@ HLT::ErrorCode TrigMuonEFCombinerHypo::hltExecute(const HLT::TriggerElement* out
 	m_fex_pt.clear();
 	m_fex_eta.clear();
 	m_fex_phi.clear();
+	m_fex_rate=-1;
+	m_fex_bcid=-1;
 
 	if(m_acceptAll) {
 		pass = true;
@@ -150,5 +163,27 @@ HLT::ErrorCode TrigMuonEFCombinerHypo::hltExecute(const HLT::TriggerElement* out
 	}//loop on muons		     		
        
 	pass = result;
+
+	//Add some per bcid monitoring of rates to see if there are effects from RF detuning
+	const xAOD::EventInfo* pEvent(0);
+	if(store()->retrieve(pEvent).isFailure()){
+	  msg() << MSG::ERROR << "Cannot find xAODEventInfo object" << endreq;
+	  return HLT::ERROR;
+	}
+
+	double crosssection=1.0;
+	//cross sections are ~ constant vs luminosity - taken from run 311481 (and are approximate
+	// we only care how much the rates differ between bcids, so this should be enough).
+	if(m_ptThresholds[0]/CLHEP::GeV>3.5 && m_ptThresholds[0]/CLHEP::GeV<4.0) crosssection=65.;
+	if(m_ptThresholds[0]/CLHEP::GeV>5.5 && m_ptThresholds[0]/CLHEP::GeV<6.0) crosssection=55.;
+	if(m_ptThresholds[0]/CLHEP::GeV>13.0 && m_ptThresholds[0]/CLHEP::GeV<14.0) crosssection=45.;
+	if(m_ptThresholds[0]/CLHEP::GeV>25.0 && m_ptThresholds[0]/CLHEP::GeV<26.0) crosssection=30.;
+	if(pass==true){
+	  m_fex_bcid = pEvent->bcid();
+
+	  if(m_lumiTool){
+	    m_fex_rate = m_lumiTool->lbLuminosityPerBCID()*crosssection;
+	  }
+	}
 	return HLT::OK;
 }  
diff --git a/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/HLTTrackPreSelHypo.h b/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/HLTTrackPreSelHypo.h
index 5b7989e0b62cd8bc016eff0affc16f73283edf7b..b16de9647857e33d697c1fdf98a13372088a2160 100755
--- a/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/HLTTrackPreSelHypo.h
+++ b/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/HLTTrackPreSelHypo.h
@@ -68,6 +68,8 @@ class HLTTrackPreSelHypo : public HLT::HypoAlgo
   bool m_relax_highpt;
   double m_highpt_threshold;
 
+  bool m_mva_tracking;
+
   int  m_cutCounter;
   //Monitoring: number of tracks in core region
   int m_nTracksInCore;
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
index 68503ff4dcb63e7162e07184999a51e64ea92f68..80415b19fc90bcdf965f1ff1c2e2bbb9728c8596 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
@@ -2,11 +2,11 @@
 
 #Categories currently used by offline Egamma TO monitoring tool
 #Important to keep lists updated
-primary_single_ele = ['HLT_e24_lhtight_nod0','HLT_e26_lhtight_nod0','HLT_e60_lhmedium_nod0_L1EM24VHI','HLT_e140_lhloose_nod0_L1EM24VHI']
+primary_single_ele = ['HLT_e24_lhtight_nod0','HLT_e26_lhtight_nod0','HLT_e60_lhmedium_nod0_L1EM24VHI','HLT_e140_lhloose_nod0_L1EM24VHI','HLT_e15_lhloose_L1EM12','HLT_e17_lhloose_nod0']
 primary_single_ele_iso =['HLT_e24_lhtight_nod0_ivarloose','HLT_e26_lhtight_nod0_ivarloose','HLT_e28_lhtight_nod0_ivarloose']
 monitoring_Zee = ['HLT_e28_lhtight_nod0_e15_etcut_L1EM7_Zee']
 monitoring_Jpsiee = ['HLT_e5_lhtight_nod0_e4_etcut','HLT_e5_lhtight_nod0_e4_etcut_Jpsiee']
-primary_single_pho = ['HLT_g140_tight','HLT_g200_loose']
+primary_single_pho = ['HLT_g140_tight','HLT_g200_loose','g25_loose_L1EM15']
 
 # primary_single_ele = ['HLT_e24_lhtight_nod0','HLT_e26_lhtight_nod0','HLT_e60_lhmedium_nod0','HLT_e120_lhloose_nod0','HLT_e140_lhloose_nod0']
 # primary_single_ele_iso =['HLT_e24_lhtight_nod0_ivarloose','HLT_e26_lhtight_nod0_ivarloose','HLT_e28_lhtight_nod0_ivarloose']
@@ -47,7 +47,8 @@ plots_resolution = ["res_et","res_Rphi","res_Reta","res_Rhad","res_ptvarcone20",
 # Define triggers for tagging 
 monitoring_tags = ['HLT_e24_lhtight_nod0_ivarloose',
                    'HLT_e26_lhtight_nod0_ivarloose',
-                   'HLT_e28_lhtight_nod0_ivarloose']
+                   'HLT_e28_lhtight_nod0_ivarloose',
+                   'HLT_e15_lhloose_L1EM12']
 
 monitoring_jpsitags = [
     'HLT_e5_lhtight_nod0_e4_etcut',
@@ -74,8 +75,7 @@ monitoring_L1Calo = []
 commission_electron = ['HLT_e60_lhmedium_nod0_ringer_L1EM24VHI',
                        'HLT_e140_lhloose_nod0_ringer_L1EM24VHI'
                        ]
-monitoring_electron = ['HLT_e60_lhmedium_nod0_L1EM24VHI',
-                       'HLT_e140_lhloose_nod0_L1EM24VHI'
+monitoring_electron = ['HLT_e15_lhloose_nod0_L1EM12',
                        ]
 # monitoring_electron += commission_electron
 
@@ -88,21 +88,22 @@ commissionTP_electron = ['HLT_e17_lhvloose_nod0_ringer_L1EM15VHI',
                          'HLT_e26_lhtight_nod0_ivarloose_L1EM22VHIM',
                          'HLT_e28_lhtight_nod0_ivarloose_L1EM24VHIM',
                          ]
-monitoringTP_electron = ['HLT_e17_lhvloose_nod0_L1EM15VHI',
-                         'HLT_e28_lhtight_nod0_ivarloose',
-                         'HLT_e28_lhtight_nod0_noringer_ivarloose'
+monitoringTP_electron = ['HLT_e13_etcut_L1EM12',
+                         'HLT_e15_lhloose_L1EM12',
+                         'HLT_e17_lhloose_nod0',
                          ]
 # monitoringTP_electron += commissionTP_electron
 
 monitoringTP_Jpsiee = ["HLT_e5_lhtight_nod0"]    
 
-monitoring_photon = ['HLT_g25_medium_L1EM20VH',
-                     'HLT_g200_loose',
+monitoring_photon = ['HLT_g10_loose',
+                     'g23_etcut_L1EM15',
+                     'HLT_g25_loose_L1EM15',
                      ]
 #Add the Menu-Aware monitoring; maps a trigger to a category
-monitoring_mam = {'primary_single_ele_iso':'HLT_e28_lhtight_nod0_ivarloose',
-                  'primary_double_pho':'HLT_g25_medium_L1EM20VH',
-                  'primary_single_pho':'HLT_g200_loose',
+monitoring_mam = {'primary_single_ele_iso':'HLT_e15_lhloose_L1EM12',
+                  'primary_double_pho':'HLT_g10_loose',
+                  'primary_single_pho':'HLT_g25_loose_L1EM15',
                   'monitoring_Jpsiee' :'HLT_e5_lhtight_nod0'}
 
 # Cosmic items
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/share/TrigHLTMonCommon_jobOptions.py b/Trigger/TrigMonitoring/TrigHLTMonitoring/share/TrigHLTMonCommon_jobOptions.py
index 026a20bf6ae74f885a2053e281dc52784a586c2b..10b9f5d55c67368db9f4cb0d95d89271952d2c3a 100755
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/share/TrigHLTMonCommon_jobOptions.py
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/share/TrigHLTMonCommon_jobOptions.py
@@ -184,4 +184,4 @@ if hasattr(runArgs,"useDB"):
                 if prop == "TrigConfigTool":
                     log.info("Set TrigConfigTool %s",tool.getName())
                     tool.TrigConfigTool="TrigConf::xAODConfigTool"
-        
+
diff --git a/Trigger/TrigMonitoring/TrigIDTPMonitor/python/TrigIDTPMonitorMonitoring.py b/Trigger/TrigMonitoring/TrigIDTPMonitor/python/TrigIDTPMonitorMonitoring.py
index 05f0f17c8043f7cf568d46cb59051d58fd021fb0..bcd34119ab7d640c3322d16493a3359c082317f4 100644
--- a/Trigger/TrigMonitoring/TrigIDTPMonitor/python/TrigIDTPMonitorMonitoring.py
+++ b/Trigger/TrigMonitoring/TrigIDTPMonitor/python/TrigIDTPMonitorMonitoring.py
@@ -280,27 +280,27 @@ class TrigIDTPMonitorElectronMonitorBase(TrigGenericMonitoringToolConfig):
 
         #MONITORING THE IBL
         #Innermost detector hit efficiency profiles in bins of probe track (PT): eta and phi
-        self.Histograms += [ defineHistogram('PTeta, PTpixelFound', type='TProfile', title="Innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for Precision Tracker vs eta; eta [radians]",
+        self.Histograms += [ defineHistogram('PTeta, PTpixelFound', type='TProfile', title="Expected && Found hit (IBL) for Precision Tracker vs eta; eta [radians]",
                                              xbins=15, xmin=-3, xmax=3,
                                              ymin=-0.1, ymax=1.1) ]
-        self.Histograms += [ defineHistogram('PTphi, PTpixelFound', type='TProfile', title="Innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for Precision Tracker vs phi; phi [radians]",
-                                             xbins=9, xmin=-3.14, xmax=3.14,
+        self.Histograms += [ defineHistogram('PTphi, PTpixelFound', type='TProfile', title="Expected && Found hit (IBL) for Precision Tracker vs phi; phi [radians]",
+                                             xbins=14, xmin=-3.14, xmax=3.14,
                                              ymin=-0.1, ymax=1.1) ]
         #2D profile histogram of inner detector region
-        self.Histograms += [ defineHistogram('PTeta, PTphi, PTpixelFound', type='TProfile2D', title="Innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for region; eta; phi",
+        self.Histograms += [ defineHistogram('PTeta, PTphi, PTpixelFound', type='TProfile2D', title="Expected && Found hit (IBL) for region; eta; phi",
                                              xbins=10, xmin=-3, xmax=3,
-                                             ybins=10, ymin=-3.14, ymax=3.14, zmin=-0.1, zmax=1.1) ]
+                                             ybins=14, ymin=-3.14, ymax=3.14, zmin=-0.1, zmax=1.1) ]
         #Next to Innermost detector hit efficiency profiles in bins of probe track (PT): eta and phi
-        self.Histograms += [ defineHistogram('PTeta, PTpixelNextToFound', type='TProfile', title="Next to innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for Precision Tracker vs eta; eta [radians]",
+        self.Histograms += [ defineHistogram('PTeta, PTpixelNextToFound', type='TProfile', title="Next to innermost layer of detector - Expected && Found hit (L0) for Precision Tracker vs eta; eta [radians]",
                                              xbins=15, xmin=-3, xmax=3,
                                              ymin=-0.1, ymax=1.1) ]
-        self.Histograms += [ defineHistogram('PTphi, PTpixelNextToFound', type='TProfile', title="Next to innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for Precision Tracker vs phi; phi [radians]",
-                                             xbins=9, xmin=-3.14, xmax=3.14,
+        self.Histograms += [ defineHistogram('PTphi, PTpixelNextToFound', type='TProfile', title="Next to innermost layer of detector - Expected && Found hit (L0) for Precision Tracker vs phi; phi [radians]",
+                                             xbins=22, xmin=-3.14, xmax=3.14,
                                              ymin=-0.1, ymax=1.1) ]
         #2D profile histogram of inner detector region
-        self.Histograms += [ defineHistogram('PTeta, PTphi, PTpixelNextToFound', type='TProfile2D', title="Next to innermost layer of detector - Observed Tracks/Expected Tracks (pixel) for region; eta; phi",
+        self.Histograms += [ defineHistogram('PTeta, PTphi, PTpixelNextToFound', type='TProfile2D', title="Next to innermost layer of detector - Expected && Found hit (L0) for region; eta; phi",
                                              xbins=10, xmin=-3, xmax=3,
-                                             ybins=10, ymin=-3.14, ymax=3.14, zmin=-0.1, zmax=1.1) ]
+                                             ybins=22, ymin=-3.14, ymax=3.14, zmin=-0.1, zmax=1.1) ]
     
 
 class TrigIDTPMonitorElectronOnlineMonitor(TrigIDTPMonitorElectronMonitorBase):
diff --git a/Trigger/TrigMonitoring/TrigIDTPMonitor/src/TrigIDTPMonitorElectron.cxx b/Trigger/TrigMonitoring/TrigIDTPMonitor/src/TrigIDTPMonitorElectron.cxx
index 951f80e3b36347cf84d0d90638060635bdf4b2fa..b55808998a0b81138b5d2bc4d28d22462e0f4dd9 100644
--- a/Trigger/TrigMonitoring/TrigIDTPMonitor/src/TrigIDTPMonitorElectron.cxx
+++ b/Trigger/TrigMonitoring/TrigIDTPMonitor/src/TrigIDTPMonitorElectron.cxx
@@ -938,7 +938,7 @@ HLT::ErrorCode TrigIDTPMonitorElectron::hltExecute(const HLT::TriggerElement* in
     }
     y++;
   }
-  if(m_FTFfound){
+  if(m_FTFfound==0){
     ATH_MSG_DEBUG("FTF:::1)COMBINED CRITERIA: This candidate was found to be INEFFICIENT");
   }
   if(m_FTFfound==1){
@@ -951,7 +951,7 @@ HLT::ErrorCode TrigIDTPMonitorElectron::hltExecute(const HLT::TriggerElement* in
   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
 
   //END OF ALGORITHM
-  ATH_MSG_INFO( "Finishing TrigIDTPMonitorElectron" );
+  ATH_MSG_DEBUG( "Finishing TrigIDTPMonitorElectron" );
 
   return HLT::OK;
 }
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
index d41bb8bc99174862389527ef5089277bb1d17b1e..b5fa9c1cae84fa4d4a6a087da90a08a437918b99 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py
@@ -154,7 +154,8 @@ class TrigCorMonitor(TrigCorMoni):
     def target(self):
         return [ "Online", "Validation" ]
     
-TrigSteerMonitorToolList = [  TrigErrorMonitor(),
+TrigSteerMonitorToolList = [  TrigRateMoniConfig20s(),   # leave first(!) so it gets finalized first (ATDSUPPORT-223)
+                              TrigErrorMonitor(),
                               TrigErrorExpertMonitor(),
                               TrigRoIMoniConfigValidation(), TrigRoIMoniConfigOnline(),
                               TrigSignatureMoniConfigValidation(), TrigSignatureMoniConfigOnline(),
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.cxx
index 8b191f2f0d3baa68f6db79fc13c460529c258288..926a2d981368297da4f3c5dabd01ffa0d4f9c696 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.cxx
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.cxx
@@ -54,16 +54,12 @@
 const int ABORT_GAP_START = 3446;
 const int ABORT_GAP_END   = 3563;
 
-using namespace std;
-using namespace HLT;
-
 TrigRoIMoni::TrigRoIMoni(const std::string & type, const std::string & name,
                          const IInterface* parent)
   :  TrigMonitorToolBase(type, name, parent),
      m_trigConfigSvc("TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", name),
      m_gotL1Config(false),
      m_lvl1Tool("HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool",this),
-     m_trigLvl("HLT"),
      m_threshMultiMax(100)
    
 {
@@ -152,14 +148,10 @@ StatusCode TrigRoIMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewL
    // roi & threshold multiplicity hists
    m_etaphi_EM_all = new 
      TrigLBNHist<TH2I>(TH2I("AllRoIsEtaPhiEM", 
-                            ("phi vs eta for all L1 EM RoIs "+m_trigLvl).c_str(), 
+                            "phi vs eta for all L1 EM RoIs", 
                             51, -2.55, 2.55,
                             64,  -M_PI*(1.-1./64.), M_PI*(1.+1./64.)));
 
-   if ( expertHistograms.regHist((ITrigLBNHist*)m_etaphi_EM_all).isFailure()) {
-     ATH_MSG_WARNING("Cannot register " << m_etaphi_EM_all->GetName());
-   }
-
    // Fill bin limits with {-5,-3.1,-2.9,...,3.1,5}
    const int n_jbins = 34;
    double jbins[n_jbins];
@@ -169,45 +161,39 @@ StatusCode TrigRoIMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewL
 
    m_etaphi_J_all = new  
      TrigLBNHist<TH2I>(TH2I("AllRoIsEtaPhiJ", 
-                            ("phi vs eta for all L1 jet RoIs "+m_trigLvl).c_str(), 
+                            "phi vs eta for all L1 jet RoIs", 
                             n_jbins-1, jbins,
                             32,  -M_PI*(1.-1./32.), M_PI*(1.+1./32.)));
       
-   if ( expertHistograms.regHist((ITrigLBNHist*)m_etaphi_J_all).isFailure()) {
-     ATH_MSG_WARNING("Cannot register " << m_etaphi_J_all->GetName());
-   }
-      
    m_etaphi_JF_all = new 
      TrigLBNHist<TH2I>(TH2I("AllRoIsEtaPhiJF", 
-                            ("phi vs eta for all L1 forward jet RoIs "+m_trigLvl).c_str(),
+                            "phi vs eta for all L1 forward jet RoIs",
                             2, -5., 5.,
                             32,  -M_PI*(1.-1./32.), M_PI*(1.+1./32.)));
 
    m_etaphi_JF_all->GetXaxis()->SetBinLabel(1, "eta < -3.2");
    m_etaphi_JF_all->GetXaxis()->SetBinLabel(2, "eta > 3.2");
-   if ( expertHistograms.regHist((ITrigLBNHist*)m_etaphi_JF_all).isFailure()) {
-     ATH_MSG_WARNING("Cannot register " << m_etaphi_JF_all->GetName());
-   }
       
    m_etaphi_HA_all = new     
      TrigLBNHist<TH2I>(TH2I("AllRoIsEtaPhiHA", 
-                            ("phi vs eta for all L1 tau RoIs "+m_trigLvl).c_str(), 51, -2.55, 2.55,
+                            "phi vs eta for all L1 tau RoIs", 51, -2.55, 2.55,
                             64,  -M_PI*(1.-1./64.), M_PI*(1.+1./64.)));
             
-   if ( expertHistograms.regHist((ITrigLBNHist*)m_etaphi_HA_all).isFailure()) {
-     ATH_MSG_WARNING("Cannot register " << m_etaphi_HA_all->GetName());
-   }
-      
    m_etaphi_MU_all = new     
      TrigLBNHist<TH2I>(TH2I("AllRoIsEtaPhiMU", 
-                            ("phi vs eta for all L1 MU RoIs "+m_trigLvl).c_str(), 
+                            "phi vs eta for all L1 MU RoIs", 
                             50, -2.5, 2.5,
                             64,  -M_PI, M_PI));
 
-   if ( expertHistograms.regHist((ITrigLBNHist*)m_etaphi_MU_all).isFailure()) {
-     ATH_MSG_WARNING("Cannot register " << m_etaphi_MU_all->GetName());
-   }
 
+   TrigLBNHist<TH2I>* lbnhists[] = {m_etaphi_EM_all, m_etaphi_J_all, m_etaphi_JF_all,
+                                    m_etaphi_HA_all, m_etaphi_MU_all};
+
+   for (auto h : lbnhists) {
+     if ( expertHistograms.regHist((ITrigLBNHist*)h).isFailure())
+       ATH_MSG_WARNING("Cannot register " << h->GetName());
+   }
+     
    m_histoverflow = SetupOverflowHist(); 
    if ( m_histoverflow == 0 || expertHistograms.regHist(m_histoverflow).isFailure()) {
      ATH_MSG_WARNING("Either can't book or can't register RoIsOverflow");
@@ -265,58 +251,21 @@ StatusCode TrigRoIMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewL
   
    float etamin=-5.,etamax=5.;
   
-   std::string tmpstring("N Initial RoI in Event ");
-   tmpstring+=m_trigLvl;
-   TString htit(/*Form*/(tmpstring.c_str()));
-
-   m_histonroi =  new TH1F( "NInitialRoIsPerEvent",htit.Data(),50,-0.5,49.5);
-  
-   if ( expertHistograms.regHist(m_histonroi).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histonroi ->GetName());
-             
-   tmpstring="Updates of RoI positions with respect to L1 (phi) ";
-   tmpstring+=m_trigLvl;
-   htit=/*Form*/(tmpstring.c_str());
-
-   m_histodeta =  new TH1F( "RoIsDEta",htit.Data(),100,detamin,detamax);
- 
-   if ( expertHistograms.regHist(m_histodeta).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histodeta ->GetName());
+   m_histonroi =  new TH1F("NInitialRoIsPerEvent", "N Initial RoI in Event", 50, -0.5, 49.5);
+   m_histodeta =  new TH1F("RoIsDEta", "Updates of RoI positions with respect to L1 (eta)", 100, detamin, detamax); 
+   m_histodphi =  new TH1F("RoIsDPhi","Updates of RoI positions with respect to L1 (phi)", 32, dphimin, dphimax);
+   m_histoeta0 =  new TH1F("RoIsL1Eta","L1 RoIs eta", 25, etamin, etamax);
+   m_histophi0 =  new TH1F("RoIsL1Phi", "L1 RoIs phi", 32, phimin, phimax);
+   m_histo_eta0_phi0 =  new TH2F("RoIsL1PhiEta", "L1 RoIs phi vs eta", 25, etamin, etamax, 32, phimin, phimax);
   
-   tmpstring="Updates of RoI positions with respect to L1 (eta) ";
-   tmpstring+=m_trigLvl;
-   htit=/*Form*/(tmpstring.c_str());
+   TH1* hists[] = {m_histonroi, m_histodeta, m_histodphi, 
+                   m_histoeta0, m_histophi0, m_histo_eta0_phi0};
 
-   m_histodphi =  new TH1F( "RoIsDPhi",htit.Data(), 32,dphimin,dphimax);
-  
-   if ( expertHistograms.regHist(m_histodphi).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histodphi->GetName());
-  
-   tmpstring="L1 RoIs eta ";
-   tmpstring+=m_trigLvl;
-   htit=/*Form*/(tmpstring.c_str());
+   for (auto h : hists) {
+     if ( expertHistograms.regHist(h).isFailure())
+       ATH_MSG_WARNING("Cannot register " << h->GetName());
+   }
 
-   m_histoeta0 =  new TH1F( "RoIsL1Eta",htit.Data(), 25,etamin,etamax);
-  
-   if ( expertHistograms.regHist(m_histoeta0).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histoeta0->GetName());
-  
-   tmpstring="L1 RoIs phi ";
-   tmpstring+=m_trigLvl;
-   htit=/*Form*/(tmpstring.c_str());
-   m_histophi0 =  new TH1F( "RoIsL1Phi",htit.Data(), 32,phimin,phimax);
-  
-   if ( expertHistograms.regHist(m_histophi0).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histophi0->GetName());
-  
-   tmpstring="L1 RoIs phi vs eta ";
-   tmpstring+=m_trigLvl;
-   htit=/*Form*/(tmpstring.c_str());
-   m_histo_eta0_phi0 =  new TH2F( "RoIsL1PhiEta", htit.Data(), 25,etamin,etamax, 32,phimin,phimax);
-  
-   if ( expertHistograms.regHist(m_histo_eta0_phi0).isFailure())
-     ATH_MSG_WARNING("Cannot register " << m_histoPathexpert << m_histophi0->GetName());
-  
    return StatusCode::SUCCESS;
 }
 
@@ -687,7 +636,7 @@ void TrigRoIMoni::FillEtaPhiPlots()
   
   for (const HLT::JetEnergyRoI jetERoI : jetERoIs) {
     
-    if (jetERoI.type() == JetRoI || jetERoI.type() == ForwardJetRoI) {
+    if (jetERoI.type() == HLT::JetRoI || jetERoI.type() == HLT::ForwardJetRoI) {
 
       // Dummy configuration vector, only need coordinates, not thresholds
       std::vector<TrigConf::TriggerThreshold*> jetConfig;
@@ -697,8 +646,8 @@ void TrigRoIMoni::FillEtaPhiPlots()
       double eta = recRoI.eta();
       double phi = fixphi(recRoI.phi());
 
-      if (jetERoI.type() == JetRoI && m_etaphi_J_all)         m_etaphi_J_all->Fill(eta, phi);
-      if (jetERoI.type() == ForwardJetRoI && m_etaphi_JF_all) m_etaphi_JF_all->Fill(eta, phi);
+      if (jetERoI.type() == HLT::JetRoI && m_etaphi_J_all)         m_etaphi_J_all->Fill(eta, phi);
+      if (jetERoI.type() == HLT::ForwardJetRoI && m_etaphi_JF_all) m_etaphi_JF_all->Fill(eta, phi);
 
       m_histoeta0->Fill(eta);
       m_histophi0->Fill(phi);
diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.h b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.h
index 3364533aa4d9b130155c1e7b1abc0f96addb4842..716fa2e6d203a452d9e48c72f32b89bce3a417de 100644
--- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.h
+++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigRoIMoni.h
@@ -98,7 +98,6 @@ class TrigRoIMoni: public TrigMonitorToolBase {
   std::vector< unsigned int > m_configuredTETypes;
   std::map< unsigned int, unsigned int > m_labels; // TriggerElement ID -> bin
   std::map< std::string, std::pair<int, unsigned int> > m_thresholdNames; // Lvl1 threshhold --> histo bin/id
-  std::string m_trigLvl;
   unsigned int m_threshMultiMax;
   bool m_ignoreAbortGap;
 };
diff --git a/Trigger/TrigSteer/TrigInterfaces/src/FexAlgo.cxx b/Trigger/TrigSteer/TrigInterfaces/src/FexAlgo.cxx
index 1898177a61a39fc28d4e8f8a84c610c5156ce7e1..ced298f85c49e0837b374bfd9f26953e4adb7234 100755
--- a/Trigger/TrigSteer/TrigInterfaces/src/FexAlgo.cxx
+++ b/Trigger/TrigSteer/TrigInterfaces/src/FexAlgo.cxx
@@ -104,10 +104,10 @@ HLT::ErrorCode FexAlgo::plugin_acceptInputs(TEVec& inputTEs, bool& pass) {
 HLT::ErrorCode
 FexAlgo::processRobRequests(const std::vector< unsigned int >& inputs ) {
 
-  // FEX has exactly one input type
+  // FEX should normally have exactly one input type but some chains call this method with 0 inputs
   if (inputs.size() != 1) {
-    ATH_MSG_DEBUG ( "The size of the input to FexAlgo::processRobRequests(v<uint> input) is " << inputs.size() << ", needs to be 1! Returning ABORT CHAIN!");
-    return HLT::ErrorCode( Action::ABORT_CHAIN, Reason::BAD_JOB_SETUP );  
+    ATH_MSG_DEBUG ( "The size of the input to FexAlgo::processRobRequests(v<uint> input) is " << inputs.size() << ", should be 1! No ROBs for prefetching will be prepared");
+    return HLT::OK;
   }
 
   // get input TEs from Navigation
diff --git a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt
index e164edf04274fe51e692442d3d51efa867aa877e..b78c2db2807533947248237bc3a99091520c5735 100644
--- a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt
@@ -79,6 +79,15 @@ atlas_add_test( Signature_test
                 LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib
                 EXTRA_PATTERNS ".*" )
 
+
+atlas_add_test( SteeringChain_test
+                SOURCES
+                test/SteeringChain_test.cxx
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib
+                EXTRA_PATTERNS ".*" )
+
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py share/Lvl1Results.txt )
diff --git a/Trigger/TrigSteer/TrigSteering/TrigSteering/Lvl1ConsistencyChecker.h b/Trigger/TrigSteer/TrigSteering/TrigSteering/Lvl1ConsistencyChecker.h
index db56d3d14724e89a68149f9ef76d7a5446d668c2..54fb7f81027ad6871ddad3f97c0aa9899ce48249 100644
--- a/Trigger/TrigSteer/TrigSteering/TrigSteering/Lvl1ConsistencyChecker.h
+++ b/Trigger/TrigSteer/TrigSteering/TrigSteering/Lvl1ConsistencyChecker.h
@@ -64,7 +64,7 @@ public:
                        const std::vector<std::string>& ignoreThresholds);
 
 private:
-  bool m_printErrorMessages;
+  bool m_printWarnings;
   bool m_returnFailure;
   std::vector<std::string> m_thresholdsToCheck;
 
diff --git a/Trigger/TrigSteer/TrigSteering/TrigSteering/Sequence.h b/Trigger/TrigSteer/TrigSteering/TrigSteering/Sequence.h
index f41224b13c58dfd964b547f478c9a92c9fd413e8..9b3469593262290d24c6df6450c26d2fcaebe798 100755
--- a/Trigger/TrigSteer/TrigSteering/TrigSteering/Sequence.h
+++ b/Trigger/TrigSteer/TrigSteering/TrigSteering/Sequence.h
@@ -26,6 +26,7 @@
 #include "GaudiKernel/SmartIF.h"
 #include "AthenaBaseComps/AthService.h"
 #include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h" //used for ROS data access test
+#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
 
 class TrigTimer;
 
@@ -134,8 +135,8 @@ namespace HLT {
 
       TrigTimer *m_timer;
 
-      SmartIF <ITrigROBDataProviderSvc_RTT> m_trigROBDataProvider;  
-
+      ServiceHandle<IROBDataProviderSvc>      m_robDataProvider;        //!< ROB data provider (for ROB pre-fetching)
+      SmartIF <ITrigROBDataProviderSvc_RTT>   m_trigROBDataProviderRTT; //!< ROB data provider with extensions for RTT tests
    };
 }
 
diff --git a/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h b/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h
index eb1951e7c4d65d5acaaf46358fe6d55f53812a55..f34702da72352247f8fa4d59a3ba0aa4985461ca 100755
--- a/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h
+++ b/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h
@@ -39,7 +39,7 @@
 #include "TrigConfInterfaces/ITrigConfigSvc.h"
 
 #include "AthenaMonitoring/IMonitorToolBase.h"
-#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h"
+#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h"
 #include "GaudiKernel/SmartIF.h"
 #include "EventInfo/TriggerInfo.h"
 #include "AthenaKernel/Timeout.h"
@@ -228,7 +228,7 @@ namespace HLT {
       ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc;            //!< TrigConfiguration Service
       ServiceHandle<TrigConf::IL1TopoConfigSvc> m_l1topoConfigSvc;    //!< TrigConfiguration Service of L1Topo
       ServiceHandle<IROBDataProviderSvc>      m_robDataProvider;      //!< ROB data provider (for ROB pre-fetching)
-      SmartIF <ITrigROBDataProviderSvc_RTT>   m_trigROBDataProvider;  //!< Trig ROB data provider (for Event Building)
+      SmartIF <ITrigROBDataProviderSvc>       m_trigROBDataProvider;  //!< Trig ROB data provider (for Event Building)
 
 
       ToolHandle<Navigation> m_navigation;                //!< HLT Navigation, taking care of all TriggerElements and the links etc.
diff --git a/Trigger/TrigSteer/TrigSteering/python/TrigSteeringConfig.py b/Trigger/TrigSteer/TrigSteering/python/TrigSteeringConfig.py
index a87858f330f53a68fa02f9c4242d2c0e7902313c..f54a27b6552200004ac96396b8eca85c26ab379a 100755
--- a/Trigger/TrigSteer/TrigSteering/python/TrigSteeringConfig.py
+++ b/Trigger/TrigSteer/TrigSteering/python/TrigSteeringConfig.py
@@ -298,10 +298,8 @@ class TrigSteer_HLT( TrigSteer_baseClass ):
                     log.info( "added algorithm to the configuration: "+alg)
        
         try:
-            from TrigSteerMonitor.TrigSteerMonitorConfig import TrigSteerMonitorToolList,  TrigRateMoniConfig20s
-            TrigSteerMonitorToolList_HLT = [  TrigRateMoniConfig20s() ]
+            from TrigSteerMonitor.TrigSteerMonitorConfig import TrigSteerMonitorToolList
             self.MonTools += TrigSteerMonitorToolList
-            self.MonTools += TrigSteerMonitorToolList_HLT
         except Exception as e:
             log.warning("Exception while adding monitoring tools ('%s'). Will continue without them." % e)
 
diff --git a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
index 24909eb88870a7909b4a513d7a4f4694893f5980..bce8d59703764de2a069be991999067c8f99ec27 100755
--- a/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
+++ b/Trigger/TrigSteer/TrigSteering/share/pureSteering_jobOptions.py
@@ -2,7 +2,7 @@ from AthenaCommon.Logging import logging
 log = logging.getLogger( 'PureSteeringJob' )
 
 svcMgr.MessageSvc.Format = "% F%52W%S%7W%R%T %0W%M"
-svcMgr.MessageSvc.OutputLevel = DEBUG
+svcMgr.MessageSvc.OutputLevel = WARNING
 svcMgr.MessageSvc.defaultLimit = 0
 svcMgr.StoreGateSvc.Dump = True  #true will dump data store contents
 
@@ -31,6 +31,7 @@ if not "usePrescaleMenu" in dir(): usePrescaleMenu = False
 if not "useMultiSeedingMenu" in dir(): useMultiSeedingMenu = False
 if not "useMenuWithAcceptInput" in dir(): useMenuWithAcceptInput = False
 if not "useBusyEventSetup" in dir(): useBusyEventSetup = False
+if not "l1SeedingTest" in dir(): l1SeedingTest = False
 
 # Default L1 RoIs if not set otherwise below
 
@@ -103,6 +104,24 @@ EM15i,EM25i
 EM15i,EM25i
 """
 
+elif l1SeedingTest:
+    include("TrigSteering/pureSteering_l1Seeding_menu.py")
+    RoIs = "MU6, MU20\n"*7
+    # see for info about 
+    # 106 is ctp ID of L1_MU06 120 is for L1_MU20 and 121 for L1_MU21
+    #
+    ctpbits = "106:1,0 120:1,1\n" 
+    ctpbits += "106:1,1 120:0,0 121:1,1\n" # L1_MU21 active
+    ctpbits += "106:1,0 120:1,1 121:0,0\n"  # L1_MU20 acts ( the other is inactive )
+    ctpbits += "106:1,1 120:1,1 121:0,0\n"
+    ctpbits += "106:1,1 120:1,1 121:0,0\n"
+    ctpbits += "106:1,1 120:1,1 121:0,0\n"
+    ctpbits += "106:1,1 120:1,0 121:0,0\n" # L1_MU20 activated but prescaled
+
+    ctpfile=open("Lvl1CTPResults.txt", "w")
+    ctpfile.write(ctpbits)
+    ctpfile.close()
+
 else:
     include("TrigSteering/pureSteering_menu.py")
 
@@ -122,6 +141,9 @@ roifile.write("\n")
 roifile.close()
 
 
+
+
+
 ###    Setup  TrigConfigSvc      ###
 ####################################
 from TrigConfigSvc.TrigConfigSvcConfig import SetupTrigConfigSvc
@@ -173,8 +195,24 @@ if runMergedSteering:
         hltSteer.ResultBuilder.ErrorStreamTags = ["ABORT_CHAIN ALGO_ERROR GAUDI_EXCEPTION: hltexceptions physics", "ABORT_EVENT ALGO_ERROR TIMEOUT: hlttimeout debug"]
         hltSteer.softEventTimeout = 1 * Units.s
 
+    if l1SeedingTest:
+        from TrigSteering.TestingTrigSteeringConfig import TestingLvl1Converter
+        lvl1Converter = TestingLvl1Converter()
+        hltSteer += lvl1Converter        
+        hltSteer.LvlConverterTool = lvl1Converter
+        hltSteer.LvlConverterTool.useL1Calo = False
+        hltSteer.LvlConverterTool.useL1Muon = False
+        hltSteer.LvlConverterTool.useL1JetEnergy = False
+        hltSteer.LvlConverterTool.OutputLevel = DEBUG
+        from TrigFake.TrigFakeConf import FakeRoIB
+        fakeRoIB = FakeRoIB()
+        fakeRoIB.OutputLevel = DEBUG
+        fakeRoIB.InputFile="Lvl1CTPResults.txt"
+        job += fakeRoIB
+
     job += hltSteer
 
+
 else:
     ### L2 TopAlgorithm from configurable ###
     #########################################
diff --git a/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1Seeding_menu.py b/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1Seeding_menu.py
new file mode 100644
index 0000000000000000000000000000000000000000..f589db98ead57698ede4d5b0785a3cc889b17437
--- /dev/null
+++ b/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1Seeding_menu.py
@@ -0,0 +1,80 @@
+from TriggerMenu.TriggerConfigLVL1 import TriggerConfigLVL1            
+from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
+from TriggerMenu.l1.Lvl1MenuItems import LVL1MenuItem
+from TriggerMenu.l1.TriggerTypeDef import TT
+from TriggerMenu.l1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger
+from TriggerMenu.l1.Logic import Logic
+
+#
+# L1
+#
+l1menu = TriggerConfigLVL1(outputFile = 'l1menu.xml', menuName = 'menutest', topoMenu = None)
+LVL1MenuItem.l1configForRegistration = l1menu
+
+Lvl1Flags.thresholds = [ 'MU06', 'MU20' ]
+Lvl1Flags.items = [ 'L1_MU06', 'L1_MU20', 'L1_MU21' ]
+
+bgrp = Logic(Lvl1InternalTrigger('BGRP0')) & Logic(Lvl1InternalTrigger('BGRP1'))
+
+thr = l1menu.registerThr('MU06','MUON').addThrValue(6)
+LVL1MenuItem('L1_MU06').setLogic( ThrCondition(thr) & bgrp ).setTriggerType( TT.muon )
+
+thr = l1menu.registerThr('MU20','MUON').addThrValue(20)
+LVL1MenuItem('L1_MU20').setLogic( ThrCondition(thr) & bgrp ).setTriggerType( TT.muon )
+LVL1MenuItem('L1_MU21').setLogic( ThrCondition(thr) & bgrp ).setTriggerType( TT.muon )
+
+
+# fix CTP IDs
+l1menu.registeredItems['L1_MU06'].setCtpid( 106 )
+l1menu.registeredItems['L1_MU20'].setCtpid( 120 )
+l1menu.registeredItems['L1_MU21'].setCtpid( 121 )
+
+# overwrite menu
+l1menu.generateMenu()        
+l1menu.writeXML()
+
+
+
+
+
+from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
+from TriggerMenu.menu.HLTObjects import HLTChain
+menu = TriggerPythonConfig('pureSteering_menu.xml')
+
+# HLT
+# chain1 = HLTChain( chain_name='HLT_e25', chain_counter='1', lower_chain_name='L1_EM25i', level='HLT', prescale='1', pass_through='1')
+# chain1.addHLTSignature( 'em25i' ).addHLTSignature( 'em25i'' )
+# chain1.addTriggerTypeBit('4')
+# chain1.addStreamTag('electrons', prescale='1')
+# chain1.addStreamTag('IDCalibration', prescale='1', type='calibration')
+# chain1.addGroup('electrons')
+# menu.addHLTChain(chain1)
+
+chain = HLTChain( chain_name='HLT_mu6', chain_counter='1', lower_chain_name='L1_MU06', level='HLT', prescale='2', pass_through='0')
+chain.addTriggerTypeBit('4')
+chain.addStreamTag('muons', prescale='1')
+chain.addGroup('muons')
+menu.addHLTChain(chain)
+
+chain = HLTChain( chain_name='HLT_mu20', chain_counter='2', lower_chain_name='L1_MU20', level='HLT', prescale='2', pass_through='0')
+chain.addTriggerTypeBit('4')
+chain.addStreamTag('muons', prescale='1')
+chain.addGroup('muons')
+menu.addHLTChain(chain)
+
+chain = HLTChain( chain_name='HLT_mu21', chain_counter='3', lower_chain_name='L1_MU21', level='HLT', prescale='2', pass_through='0')
+chain.addTriggerTypeBit('4')
+chain.addStreamTag('muons', prescale='1')
+chain.addGroup('muons')
+menu.addHLTChain(chain)
+
+chain = HLTChain( chain_name='HLT_mu20_21', chain_counter='4', lower_chain_name='L1_MU20 L1_MU21', level='HLT', prescale='2', pass_through='0')
+chain.addTriggerTypeBit('4')
+chain.addStreamTag('muons', prescale='1')
+chain.addGroup('muons')
+menu.addHLTChain(chain)
+
+
+menu.writeConfigFiles();
+menu.dot(algs=True)
+
diff --git a/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1menu.py b/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1menu.py
index 9b6b0acbe9032efc16acf0f58add43780d1d7a8a..6d4feeda025d338bcb4425213c9fc6670789822e 100644
--- a/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1menu.py
+++ b/Trigger/TrigSteer/TrigSteering/share/pureSteering_l1menu.py
@@ -33,6 +33,8 @@ LVL1MenuItem('L1_2MU06').setLogic( ThrCondition(thr).x(2) & bgrp ).setTriggerTyp
 thr = l1menu.registerThr('MU20','MUON').addThrValue(20)
 LVL1MenuItem('L1_MU20').setLogic( ThrCondition(thr) & bgrp ).setTriggerType( TT.muon )
 
+
+
 thr = l1menu.registerThr('J200','JET').addThrValue(200)
 LVL1MenuItem('L1_J200').setLogic( ThrCondition(thr) & bgrp ).setTriggerType( TT.calo )
 
diff --git a/Trigger/TrigSteer/TrigSteering/src/Lvl1ConsistencyChecker.cxx b/Trigger/TrigSteer/TrigSteering/src/Lvl1ConsistencyChecker.cxx
index 36d3952af5c5e30efe6104b0feccf0858615b6ed..b95f5fb003949157db5020f783331a7a25512d11 100644
--- a/Trigger/TrigSteer/TrigSteering/src/Lvl1ConsistencyChecker.cxx
+++ b/Trigger/TrigSteer/TrigSteering/src/Lvl1ConsistencyChecker.cxx
@@ -40,7 +40,7 @@ Lvl1ConsistencyChecker::Lvl1ConsistencyChecker(const std::string& name, const st
                                                const IInterface* parent) 
   : AthAlgTool(name, type, parent)
 {
-  declareProperty("printErrorMessages", m_printErrorMessages=true, "print detailed error reports");
+  declareProperty("printWarnings", m_printWarnings=true, "print detailed error reports");
   declareProperty("returnFailure", m_returnFailure=false, "in case of inconsitency return FAILURE");
   declareProperty("maxTOBs", m_returnFailure=false, "in case of inconsitency return FAILURE");
   declareProperty("thresholdsToCheck", m_thresholdsToCheck, "trigger threshold types to check");
@@ -116,6 +116,7 @@ Lvl1ConsistencyChecker::check(const std::vector<const LVL1CTP::Lvl1Item*>& items
                               const std::vector<std::string>& ignoreThresholds)
 {
   std::vector<ThresholdId> errors;
+  HLT::SteeringInternalReason::Code failure = HLT::SteeringInternalReason::UNKNOWN;
 
   for ( const LVL1CTP::Lvl1Item* item : items ){
     if ( ! item->isPassedAfterVeto() ) // we do not need to check items which did not pass
@@ -141,21 +142,25 @@ Lvl1ConsistencyChecker::check(const std::vector<const LVL1CTP::Lvl1Item*>& items
           m_histAll->Fill(thr.second.name.c_str(), 1.0);
           // Fill all except ignored thresholds (e.g. overflows)
           if ( !contains(ignoreThresholds, thr.second.type) ) {
+            if (thr.second.type=="CALO")       failure = HLT::SteeringInternalReason::MISSING_CALO_ROI;
+            else if (thr.second.type=="MUON")  failure = HLT::SteeringInternalReason::MISSING_MUON_ROI;
+            else                               failure = HLT::SteeringInternalReason::MISSING_OTHER_ROI;
             m_hist->Fill(thr.second.name.c_str(), 1.0);
           }
         }
-        if (m_printErrorMessages ) {          // report problem for all items
+        if (m_printWarnings) {          // report problem for all items
           ATH_MSG_WARNING("Item " << cIt->second.name << " required: " 
                           << unsigned(thr.second.multiplicity) << " of: " << thr.second.name << " while got: " << found);
         }        
       }
     }
   }
-
-  if ( !errors.empty() && m_returnFailure) {
-    return HLT::ErrorCode(HLT::Action::ABORT_EVENT, HLT::Reason::MISSING_FEATURE, 
-                          HLT::SteeringInternalReason::NO_LVL1_ITEMS );
+  
+  if ( failure != HLT::SteeringInternalReason::UNKNOWN ) {
+    return HLT::ErrorCode(m_returnFailure ? HLT::Action::ABORT_EVENT : HLT::Action::CONTINUE, 
+                          HLT::Reason::MISSING_FEATURE, failure );
   }
+
   return HLT::OK;
 }
 
diff --git a/Trigger/TrigSteer/TrigSteering/src/Lvl1Converter.cxx b/Trigger/TrigSteer/TrigSteering/src/Lvl1Converter.cxx
index b1d4b882a8e5fe82b757019a67d5059f3d4c208f..e6165404553d3f4cac5b6618244d05fa70f1478a 100755
--- a/Trigger/TrigSteer/TrigSteering/src/Lvl1Converter.cxx
+++ b/Trigger/TrigSteer/TrigSteering/src/Lvl1Converter.cxx
@@ -536,49 +536,31 @@ ErrorCode Lvl1Converter::hltExecute(std::vector<HLT::SteeringChain*>& chainsToRu
 
    if(m_doTiming) m_totalTime->stop();
 
-   // Check for L1Calo overflows
-   std::bitset<3> overflow = m_lvl1Tool->lvl1EMTauJetOverflow(*result);
-   std::vector<std::string> ignore;
-   const char* thr[] = {"EM","TAU","JET"};
-   for (size_t i=0; i<overflow.size(); ++i) {
-     if (overflow[i]) {
-       ATH_MSG_WARNING("All " << thr[i] << " L1 thresholds were forced on due to overflow in TOB transmission to CMX");     
-       ignore.push_back(thr[i]);
-     }
-   }
-
-   // Consistency check
-   HLT::ErrorCode ecl1 = m_lvl1ConsistencyTool->check(items, m_config->getNavigation(), ignore);
-   if ( ecl1  != HLT::OK ) {
-      ATH_MSG_WARNING("Lvl1 decision inconsistent: "); 
-      return ecl1;
-   }
-
    // if this is calibration event we do not apply RoI count cuts (meansy any busy event is just OK)
    if ( ! m_lvl1Tool->isCalibrationEvent(*result) ) {
 
       // check the limits    
       bool isAboveLimit = false;
       if ( m_muonRoIsLimit && muonRoIsCount        > m_muonRoIsLimit) {
-         isAboveLimit = isAboveLimit || true;
+         isAboveLimit = true;
          ATH_MSG_DEBUG("Busy event, passes limits of the MUON rois counts per event: "
                        << muonRoIsCount << " > " << m_muonRoIsLimit);
       }
     
       if ( m_emtauRoIsLimit && emtauRoIsCount      > m_emtauRoIsLimit) {
-         isAboveLimit = isAboveLimit || true;
+         isAboveLimit = true;
          ATH_MSG_DEBUG("Busy event, passes limits of the EMTAU rois counts per event: "
                        << emtauRoIsCount << " > " << m_emtauRoIsLimit);
       }
       if (m_jetRoIsLimit && jetRoIsCount          > m_jetRoIsLimit) {
-         isAboveLimit = isAboveLimit || true;
+         isAboveLimit = true;
          ATH_MSG_DEBUG("Busy event, passes limits of the JET rois counts per event: "
                        << jetRoIsCount << " > " << m_jetRoIsLimit);
       }
 
       unsigned overallRoIsCount= muonRoIsCount + emtauRoIsCount + jetRoIsCount;
       if ( m_overallRoIsLimit && overallRoIsCount > m_overallRoIsLimit ) {
-         isAboveLimit = isAboveLimit || true;
+         isAboveLimit = true;
          ATH_MSG_DEBUG("Busy event, passes limits of the all types rois counts per event: "
                        << overallRoIsCount << " > " << m_overallRoIsLimit);
       }
@@ -589,6 +571,24 @@ ErrorCode Lvl1Converter::hltExecute(std::vector<HLT::SteeringChain*>& chainsToRu
       }
    }
 
+   // Check for L1Calo overflows
+   std::bitset<3> overflow = m_lvl1Tool->lvl1EMTauJetOverflow(*result);
+   std::vector<std::string> ignore;
+   const char* thr[] = {"EM","TAU","JET"};
+   for (size_t i=0; i<overflow.size(); ++i) {
+     if (overflow[i]) {
+       ATH_MSG_WARNING("All " << thr[i] << " L1 thresholds were forced on due to overflow in TOB transmission to CMX");     
+       ignore.push_back(thr[i]);
+     }
+   }
+
+   // Consistency check
+   HLT::ErrorCode ecl1 = m_lvl1ConsistencyTool->check(items, m_config->getNavigation(), ignore);
+   if ( ecl1  != HLT::OK ) {
+      ATH_MSG_WARNING("Lvl1 decision inconsistent");
+      return ecl1;
+   }
+
    return HLT::OK;
 }
 
diff --git a/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx b/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx
index aaac242b6b76a69f2c9f6fa1fa7a606ab0c61ad7..67538b0d11ac91a1596208c50a24bb63bef0b1f2 100755
--- a/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx
+++ b/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx
@@ -38,10 +38,6 @@
 #include "TrigConfHLTData/HLTTriggerElement.h"
 #include "GaudiKernel/AlgTool.h"
 
-#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc_RTT.h" //just for debug
-#include "TrigROBDataProviderSvc/ITrigROBDataProviderSvc.h" //just for debug
-#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
-
 using namespace HLT;
 
 
@@ -60,7 +56,8 @@ Sequence::Sequence(std::vector<unsigned int> inputTypes,
    m_prepRobReqAlreadyExecuted(false),
    m_prepRobReqErrorCode(HLT::OK),
    m_topoStartFromSequence(0),
-   m_timer(0)
+   m_timer(0),
+   m_robDataProvider("ROBDataProviderSvc/ROBDataProviderSvc","TrigSteer_HLT")
 {
    // add the timer
    if ( config->getDoTiming() ) {
@@ -93,12 +90,11 @@ Sequence::Sequence(std::vector<unsigned int> inputTypes,
    }
 
    // Get TrigROBDataProvider_RTT for data pre-fetch test 
-   ServiceHandle<IROBDataProviderSvc>   robDataProvider("ROBDataProviderSvc/ROBDataProviderSvc","TrigSteer_HLT");
-   if( robDataProvider.retrieve().isFailure() ) {
+   if( m_robDataProvider.retrieve().isFailure() ) {
       m_config->getMsgStream() << MSG::ERROR << "can't get ROBDataProviderSvc" << endmsg;
    } else{
-      m_trigROBDataProvider = SmartIF<ITrigROBDataProviderSvc_RTT>( &*robDataProvider );
-      if (m_trigROBDataProvider.isValid()) {
+      m_trigROBDataProviderRTT = SmartIF<ITrigROBDataProviderSvc_RTT>( &*m_robDataProvider );
+      if (m_trigROBDataProviderRTT.isValid()) {
          if (m_config && m_config->getMsgLvl() <= MSG::DEBUG)
             m_config->getMsgStream() << MSG::DEBUG << "A ROBDataProviderSvc implementing the trig interface ITrigROBDataProviderSvc_RTT was found."<< endmsg;
       }
@@ -362,7 +358,7 @@ HLT::ErrorCode Sequence::execute()
 HLT::ErrorCode Sequence::prepareRobRequests()
 {
   // this variable enables the monitor of the pre-fetching with the trigROBDataProviderSvc
-  bool do_prefetching_test = m_trigROBDataProvider.isValid() && m_trigROBDataProvider->isPrefetchingAtAlgoLevel();
+  bool do_prefetching_test = m_trigROBDataProviderRTT.isValid() && m_trigROBDataProviderRTT->isPrefetchingAtAlgoLevel();
 
   // in case this sequence was executed before
   if (m_prepRobReqAlreadyExecuted) {
@@ -486,10 +482,10 @@ HLT::ErrorCode Sequence::prepareRobRequests()
                                  << te_create_alg->name() << " " << HLT::strErrorCode( m_prepRobReqErrorCode ) <<  endmsg;
 
       //test of the pretching: fill the pre-fetching list 
-      if (do_prefetching_test){
+      if (do_prefetching_test && m_robDataProvider.isValid()){
 	std::string pref_name = alg->name() + "_pref";
 	if (m_config->getMsgLvl() <=MSG::INFO) m_config->getMsgStream() << MSG::INFO <<"Forcing trigROBDataProvider_RTT.addROBData: Algorithm "<< te_create_alg->name() <<" scheduled "<<m_config->robRequestInfo()->requestScheduledRobIDs().size() <<" ROBs"<<endmsg;
-	m_trigROBDataProvider->addROBData(m_config->robRequestInfo()->requestScheduledRobIDs(),pref_name);
+	m_robDataProvider->addROBData(m_config->robRequestInfo()->requestScheduledRobIDs(),pref_name);
       }
 
       // Check if event timeout was reached
diff --git a/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx b/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx
index 0cc4f72e9842b92a059736f8f188b995f5a6d221..bc4e1050d7cc8c5d767c6724ff71bd43fa854af4 100755
--- a/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx
+++ b/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx
@@ -800,6 +800,7 @@ void TrigSteer::runChains(bool secondPass) {
   bool eventPassed = false;
   int  step = 0; //just for debug: follow numeration of signature counters: starts from 1 (but currentStep in chains starts from 0)
   bool doEBbyChain = false;
+  bool isPhysicsEvent = false;
 
   if(m_config -> getSteeringOPILevel() > 0) {
     // Create new chain step OPI as before
@@ -887,8 +888,13 @@ void TrigSteer::runChains(bool secondPass) {
             ATH_MSG_DEBUG("Call EB at step " << step << " because chain needs it");
           else 
             ATH_MSG_DEBUG("Call EB at step " << step << " because the event is accepted");
-	  
-          issueEventBuildingRequest(step);
+
+	  // determine if the event is a "physics" event. Call only for these events full event building (not for calibration or monitoring)
+	  for (auto vec_it = ((*iterChain)->getStreamTags()).begin(); vec_it != ((*iterChain)->getStreamTags()).end(); ++vec_it) {
+	    if (vec_it->getType() == "physics") isPhysicsEvent = true;
+	  }
+
+	  if (isPhysicsEvent) issueEventBuildingRequest(step);
         }
       }
       if (m_auditChains) auditorSvc()->after(IAuditor::Execute,chainName);
@@ -901,7 +907,7 @@ void TrigSteer::runChains(bool secondPass) {
   // final call of EB at the end of steps (done here if strategyEB == 1)
   if (eventPassed){
     ATH_MSG_DEBUG("Call EB at step " << step << " at the end of steps processing because not done previously");
-    issueEventBuildingRequest(step);
+    if (isPhysicsEvent) issueEventBuildingRequest(step);
   }
 
   m_coreDumpSvc->setCoreDumpInfo("Current trigger chain","<NONE>");
diff --git a/Trigger/TrigSteer/TrigSteering/test/SteeringChain_test.cxx b/Trigger/TrigSteer/TrigSteering/test/SteeringChain_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..08b6113d95bdd5f49119a2ccec9c2079706c72ca
--- /dev/null
+++ b/Trigger/TrigSteer/TrigSteering/test/SteeringChain_test.cxx
@@ -0,0 +1,101 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <cassert>
+#include <iostream>
+
+#include "TrigSteering/Signature.h"
+#include "TrigSteering/Sequence.h"
+#include "TrigSteering/SteeringChain.h"
+#include "TrigSteering/PeriodicScaler.h"
+#include "TrigSteering/ISequenceProvider.h"
+#include "TrigSteering/IScalerSvc.h"
+#include "TrigInterfaces/AlgoConfig.h"
+
+#include "TestTools/initGaudi.h"
+#include "GaudiKernel/MsgStream.h"
+#include "AthenaKernel/getMessageSvc.h"
+
+
+using namespace HLT;
+class TestSequenceProvider : public ISequenceProvider {
+public:
+  HLT::Sequence* findSeqForOutputTeType( const unsigned int ) override {
+    return 0;
+  }
+};
+
+class TestScalerSvc : public IScalerSvc, public AthService {
+public:
+  TestScalerSvc( ISvcLocator* pSvc ) : AthService( "TestScalerSvc", pSvc ) {}
+  IScaler* get( const std::string& ) const {
+    return new PeriodicScaler;
+  } 
+private:
+};
+
+int main()
+{
+
+  // get Gaudi MsgService:
+  ISvcLocator* pSvcLoc;
+  if ( !Athena_test::initGaudi( pSvcLoc ) ) {
+    std::cerr << "problem loading Athena_test::initGaudi !!" << std::endl;
+    return 0;
+  }
+  assert( pSvcLoc );
+
+  MsgStream* log = new MsgStream( Athena::getMessageSvc(), "getMessageSvc_test" );
+  int logLvl = log->level();
+
+  // Create & set the config object, holding all common variables
+  HLT::AlgoConfig* config = new HLT::AlgoConfig();
+  config->setMsgStream( log );
+  config->setMsgLvl( logLvl );
+  const std::vector<TrigConf::HLTSignature*> noSteps;
+  TrigConf::HLTChain chainConf( "HLT_multiSeeded", 1, 0, "HLT", "L1_A L1_B", 0, noSteps );
+  chainConf.set_prescale( 10 );
+  chainConf.addStream( new TrigConf::HLTStreamTag("Main", "physics", true, 1.) );
+  chainConf.addStream( new TrigConf::HLTStreamTag("express", "express", true, 1.) );
+  chainConf.set_groupList( std::set<std::string>( {"grA", "grB"} ) );
+
+
+  TestSequenceProvider seqProvider;
+  TestScalerSvc scalerSvc( pSvcLoc );
+  HLT::SteeringChain steeringChain( &chainConf, &seqProvider, config, &scalerSvc );
+  std::cout << "After creation" << std::endl;
+  steeringChain.print(std::cout);
+  std::cout << std::endl;
+
+  std::cout << "reset:" << std::endl;
+  for ( int i = 0; i < 20; ++i ) {
+    steeringChain.reset();
+    steeringChain.setActive();
+
+    steeringChain.setPrescaleState();
+    steeringChain.print(std::cout);
+    std::cout << std::endl;  
+  }
+
+  std::cout << "reseetChain:" << std::endl;
+  for ( int i = 0; i < 20; ++i ) {
+    steeringChain.resetChain();
+    steeringChain.setActive();
+
+    steeringChain.setPrescaleState();
+    steeringChain.print(std::cout);
+    std::cout << std::endl;  
+  }
+
+  
+
+  
+  
+  delete log;
+  delete config;
+
+
+
+  return 0;
+}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
index 58f6de62f075e45f08dd0a4c2fa276ba92612728..4b775c09862f0acfc601732889984a46998c7de1 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
@@ -321,9 +321,8 @@ TopoSteering::executeSortingAlgorithm(TCS::SortingAlg *alg,
                                       TCS::InputConnector* inputConnector,
                                       TCS::TOBArray * & sortedOutput) {
                                            
-    //TRG_MSG_DEBUG
-    TRG_MSG_ALWAYS("  ... executing sorting alg '" << alg->fullname() << "'"
-                   <<(m_useBitwise?" (bitwise)":""));
+    TRG_MSG_DEBUG("  ... executing sorting alg '" << alg->fullname() << "'"
+                  <<(m_useBitwise?" (bitwise)":""));
 
    const InputTOBArray * input = inputConnector->outputData();
 
@@ -341,8 +340,7 @@ TopoSteering::executeDecisionAlgorithm(TCS::DecisionAlg *alg,
                                        const std::vector<TCS::TOBArray *> & output,
                                        TCS::Decision & decision) {
 
-   // TRG_MSG_INFO("  ... executing decision alg '" << alg->fullname() << "'");
-   TRG_MSG_ALWAYS("  ... executing decision alg '" << alg->fullname() << "'"
+    TRG_MSG_DEBUG("  ... executing decision alg '" << alg->fullname() << "'"
                   <<(m_useBitwise?" (bitwise)":""));
 
    if(inputConnectors.size()<1) {
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx
index 5664ebf167e7c757894e420b7317198c528a0ba9..7f56f4e86cf8d1e7cb82465cde163fe0ec0852d5 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx
@@ -84,7 +84,7 @@ L1TopoSimulation::L1TopoSimulation(const std::string &name, ISvcLocator *pSvcLoc
    declareProperty( "AthenaMonTools", m_monitors, "List of monitoring tools to be run with this instance, if incorrect then tool is silently skipped.");
    declareProperty( "MonHistBaseDir", m_histBaseDir = "L1TopoAlgorithms", "Base directory for monitoring histograms will be /EXPERT/<MonHistBaseDir>" );
    declareProperty( "EnableInputDump", m_enableInputDump, "Boolean to enable writing of input data for standalone running");
-   declareProperty( "UseBitwise", m_enableBitwise, "Boolean to enable the bitwise version of software algorithms");
+   declareProperty( "UseBitwise", m_enableBitwise=true, "Boolean to enable the bitwise version of software algorithms");
    declareProperty("FillHistoBasedOnHardware", m_fillHistogramsBasedOnHardwareDecision=true,
                    "Boolean to fill accept/reject histograms based on hdw; default based on sim");
    declareProperty( "InputDumpFile", m_inputDumpFile, "File name for dumping input data");
@@ -157,7 +157,8 @@ L1TopoSimulation::initialize() {
    }
 
    m_topoSteering->setUseBitwise(m_enableBitwise);
-   std::cout << "Calling m_topoSteering->setupFromConfiguration(*menu)" << endl;
+   ATH_MSG_INFO("Calling m_topoSteering->setUseBitwise("<<m_enableBitwise<<")");
+   ATH_MSG_INFO("Calling m_topoSteering->setupFromConfiguration(*menu)");
    try {
       m_topoSteering->setupFromConfiguration(*menu);
    }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h
index c96c262d9087931c1dc07c2cc7eca624a1274c30..2cf1cdeb14285675e9cc9b6fd5ac496d40513000 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h
@@ -84,7 +84,7 @@ namespace LVL1 {
       //! @}
 
       BooleanProperty m_enableInputDump { false }; // for enabling input dumping
-      BooleanProperty m_enableBitwise { false }; // for enabling bitwise algorithms
+      BooleanProperty m_enableBitwise { true }; // for enabling bitwise algorithms
       StringProperty  m_inputDumpFile { "inputdump.txt" }; // input dump file
       StringProperty  m_topoCTPLocation { "" }; ///< SG key of decision bits for CTP
       StringProperty  m_topoOverflowCTPLocation { "" }; ///< SG key of overflow bits for CTP
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx
index b9dad893ef7eee8133a876e03731231f3ea1aacd..a5c04a01c7f4cc67561002b9e43334a6d21ee7e4 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.cxx
@@ -139,12 +139,13 @@ MuonInputProvider::createMuonTOB(const MuCTPIL1TopoCandidate & roi) const {
     int etaTopo = roi.getieta();
     int phiTopo = roi.getiphi();
     if( phiTopo > 31 ) phiTopo -= 64;
-
-    TCS::MuonTOB muon( roi.getptValue(), 0, etaTopo, phiTopo, roi.getRoiID() );
+    unsigned int pt = topoMuonPtThreshold(roi);
+    const unsigned int iso = 0;
+    TCS::MuonTOB muon( pt, iso, etaTopo, phiTopo, roi.getRoiID() );
     muon.setEtaDouble( etaTopo );
     muon.setPhiDouble( phiTopo );
 
-   m_hPt->Fill(muon.Et());
+   m_hPt->Fill(pt);
    m_hEtaPhi->Fill(muon.eta(),muon.phi());
 
    return muon;
@@ -156,15 +157,16 @@ MuonInputProvider::createLateMuonTOB(const MuCTPIL1TopoCandidate & roi) const {
    float phi = roi.getphi();
    if(phi<-M_PI) phi+=2.0*M_PI;
    if(phi> M_PI) phi-=2.0*M_PI;
+   unsigned int pt = topoMuonPtThreshold(roi);
+   const unsigned int iso = 0;
+   ATH_MSG_DEBUG("Late Muon ROI (MuCTPiToTopo):bcid=1 thr pt = " << pt << " eta = " << roi.geteta() << " phi = " << phi << ", w   = " << MSG::hex << std::setw( 8 ) << roi.getRoiID() << MSG::dec);
 
-   ATH_MSG_DEBUG("Late Muon ROI (MuCTPiToTopo):bcid=1 thr pt = " << roi.getptThresholdID() << " eta = " << roi.geteta() << " phi = " << phi << ", w   = " << MSG::hex << std::setw( 8 ) << roi.getRoiID() << MSG::dec);
-
-   TCS::LateMuonTOB muon( roi.getptValue(), 0, int(10*roi.geteta()), int(10*phi), roi.getRoiID() );
+   TCS::LateMuonTOB muon( pt, iso, int(10*roi.geteta()), int(10*phi), roi.getRoiID() );
 
    muon.setEtaDouble( roi.geteta() );
    muon.setPhiDouble( phi );
 
-   m_hPt->Fill(muon.Et());
+   m_hPt->Fill(pt);
    m_hEtaPhi->Fill(muon.eta(),muon.phi());
 
    ATH_MSG_DEBUG("LateMuon created");
@@ -200,7 +202,7 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
       for( const ROIB::MuCTPIRoI & muonRoI : rois ) {
 
 	if( !( muonRoI.roIWord() & LVL1::CandidateVetoMask  )  )
-	  inputEvent.addMuon( MuonInputProvider::createMuonTOB( muonRoI.roIWord() ) );
+        inputEvent.addMuon(MuonInputProvider::createMuonTOB( muonRoI.roIWord() ));
     // overflow implemented only for reduced granularity encoding (see below)
 	else
 	  ATH_MSG_DEBUG(" Ignore Vetoed L1 Mu RoI " <<  muonRoI.roIWord() );
@@ -223,7 +225,7 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
 	  continue;
        
 	if( !( roiword & LVL1::CandidateVetoMask  )  )
-	  inputEvent.addMuon( MuonInputProvider::createMuonTOB( roiword ) );
+        inputEvent.addMuon(MuonInputProvider::createMuonTOB( roiword ));
 	else
 	  ATH_MSG_DEBUG(" Ignore Vetoed L1 Mu RoI " << roiword );
        
@@ -247,7 +249,7 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
       for(  std::vector<MuCTPIL1TopoCandidate>::const_iterator iMuCand = candList.begin(); iMuCand != candList.end(); iMuCand++)
 	{
 	  //MuonInputProvider::createMuonTOB( *iMuCand );
-	  inputEvent.addMuon( MuonInputProvider::createMuonTOB( *iMuCand ) );
+        inputEvent.addMuon(MuonInputProvider::createMuonTOB( *iMuCand ));
       if(iMuCand->moreThan2CandidatesOverflow()){
           inputEvent.setOverflowFromMuonInput(true);
           ATH_MSG_DEBUG("setOverflowFromMuonInput : true (MuCTPIL1TopoCandidate from SG)");
@@ -264,7 +266,7 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
       
             
       for( const MuCTPIL1TopoCandidate & cand : l1topo.getCandidates() ) {
-          inputEvent.addMuon( MuonInputProvider::createMuonTOB( cand ) );
+          inputEvent.addMuon(MuonInputProvider::createMuonTOB( cand ));
           if(cand.moreThan2CandidatesOverflow()){
               inputEvent.setOverflowFromMuonInput(true);
               ATH_MSG_DEBUG("setOverflowFromMuonInput : true (MuCTPIL1TopoCandidate from MuctpiSimTool)");
@@ -272,24 +274,47 @@ MuonInputProvider::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
       }
     }
     
-    //BC+1 ... this can only come from simulation, in data taking this is collected by the L1Topo at its input
-    // so no need to do anything else here
+    //BC+1
+    // first see if L1Muctpi simulation already ran and object is in storegate, if not
+    // call tool version of the L1MuctpiSimulation and create it on the fly
+    std::vector<MuCTPIL1TopoCandidate> candList;
     if( evtStore()->contains<LVL1::MuCTPIL1Topo>(m_MuCTPItoL1TopoLocation.toString()+std::to_string(1)) ) {
       LVL1::MuCTPIL1Topo* l1topoBC1  {nullptr};
       CHECK( evtStore()->retrieve( l1topoBC1,m_MuCTPItoL1TopoLocation.toString()+std::to_string(1)));
       ATH_MSG_DEBUG( "Contains L1Topo LateMuons L1Muctpi object from StoreGate!" );
       //      l1topoBC1->print();
-      
-      std::vector<MuCTPIL1TopoCandidate> candList = l1topoBC1->getCandidates();
-      for(  std::vector<MuCTPIL1TopoCandidate>::const_iterator iMuCand = candList.begin(); iMuCand != candList.end(); iMuCand++)
-	{
-	  //or would it be better to create muon and dynamic_cast?
-	  ATH_MSG_DEBUG("MuonInputProvider addLateMuon ");
-	  inputEvent.addLateMuon( MuonInputProvider::createLateMuonTOB( *iMuCand ) );	   
-	}
-     }  
+      candList = l1topoBC1->getCandidates();
+    }else{
+      ATH_MSG_DEBUG("Use MuCTPiToTopo granularity Muon ROIs: calculate from ROIs sent to ROS");
+      LVL1::MuCTPIL1Topo l1topoBC1;
+      int bcidOffset = 1;
+      CHECK(m_MuctpiSimTool->fillMuCTPIL1Topo(l1topoBC1, bcidOffset));
+      l1topoBC1.setBcidOffset(bcidOffset);
+      //l1topoBC1.print();
+      candList = l1topoBC1.getCandidates();
+    }  
+    
+    for(  std::vector<MuCTPIL1TopoCandidate>::const_iterator iMuCand = candList.begin(); iMuCand != candList.end(); iMuCand++)
+      {
+	//or would it be better to create muon and dynamic_cast?
+	ATH_MSG_DEBUG("MuonInputProvider addLateMuon ");
+	inputEvent.addLateMuon( MuonInputProvider::createLateMuonTOB( *iMuCand ) );	   
+      }
   }
+  
+  return StatusCode::SUCCESS;
+}
 
-
-   return StatusCode::SUCCESS;
+unsigned int MuonInputProvider::topoMuonPtThreshold(const MuCTPIL1TopoCandidate &mctpiCand) const
+{
+    unsigned int threshold = 0;
+    for(const TrigConf::TriggerThreshold* thr : m_MuonThresholds) {
+        if(static_cast< unsigned int >(thr->thresholdNumber()) == mctpiCand.getptL1TopoCode()) {
+            const int ieta = 0;
+            const int iphi = 0;
+            threshold = thr->triggerThresholdValue(ieta, iphi)->ptcut();
+            break;
+        }
+    }
+    return threshold;
 }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.h
index 193bd351273950be4376a6cfa2dc32fdeb518a63..823236b4ea2452fd6f2c2913230c98b4e6befcda 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProvider.h
@@ -54,6 +54,17 @@ namespace LVL1 {
       TCS::MuonTOB createMuonTOB(uint32_t roiword) const;
       TCS::MuonTOB createMuonTOB(const MuCTPIL1TopoCandidate & roi) const;
       TCS::LateMuonTOB createLateMuonTOB(const MuCTPIL1TopoCandidate & roi) const;
+      /**
+         @brief convert the 2-bit value from MuCTPIL1TopoCandidate::getptL1TopoCode() to an actual pt
+
+         The muon TOB encodes pt values in 2 bits.
+         A MuCTPIL1TopoCandidate provides the encoded 2-bit value with
+         the function getptL1TopoCode().
+         This function uses the information from the l1 trigger menu
+         configuration to convert the threshold to an actual pt value.
+         For more details, see ATR-16781.
+      */
+      unsigned int topoMuonPtThreshold(const MuCTPIL1TopoCandidate &mctpiCand) const;
 
       StringProperty m_roibLocation;
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
index de7e8d91fa9af86ce3d56839ffee0bacd638bc1d..c30a7b3a7ed7fbd07d1304527b38ee959027d765 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx
@@ -71,11 +71,11 @@ void TCS::KFLUT::fillLUT(){
     etalimits = {-0.10,0.10,0.30,0.50,0.70,0.90,1.10,1.30,1.50,1.70,1.90,2.10,2.33,2.55,2.80,3.42};
     etlimits = {8,16,32,64,128,1024};
 
-    vector<double> v0 {-0.12,-0.09,-0.09,-0.05,0.03,0.08,0.14,0.36,0.29,0.04,0.06,0.04,-0.02,-0.09,-0.18,-0.31};
-    vector<double> v1 {0.08,0.09,0.09,0.12,0.2,0.27,0.32,0.46,0.39,0.2,0.16,0.13,0.08,-0.09,-0.16,-0.39};
-    vector<double> v2 {0.11,0.11,0.12,0.13,0.18,0.21,0.25,0.38,0.28,0.15,0.11,0.1,0.12,-0.03,-0.09,-0.37}; 
-    vector<double> v3 {0.04,0.03,0.04,0.03,0.09,0.11,0.14,0.23,0.15,0.06,0.03,0.04,0.02,-0.05,-0.07,-0.4};
-    vector<double> v4 {-0.05,-0.07,-0.06,-0.07,0,0.01,0.01,0.12,0.02,-0.06,-0.05,-0.06,-0.05,-0.09,-0.12,-0.47};
+    vector<double> v0 {0.14,0.12,0.12,0.17,0.26,0.3,0.3,0.42,0.38,0.19,0.16,0.15,0.52,0.59,0.62,0.33};
+    vector<double> v1 {0.19,0.17,0.18,0.2,0.27,0.3,0.3,0.43,0.36,0.19,0.16,0.14,0.33,0.35,0.38,0.28};
+    vector<double> v2 {0.13,0.11,0.11,0.13,0.17,0.19,0.18,0.28,0.21,0.11,0.09,0.08,0.12,0.09,0.12,0.17};
+    vector<double> v3 {-0.01,-0.02,-0.02,-0.01,0.02,0.03,0.03,0.12,0.04,-0.04,-0.05,-0.06,-0.03,-0.06,-0.03,0.05};
+    vector<double> v4 {-0.12,-0.12,-0.12,-0.11,-0.08,-0.07,-0.08,-0.01,-0.08,-0.14,-0.14,-0.15,-0.13,-0.15,-0.12,-0.04};
 
     LUTKF.push_back(v0);
     LUTKF.push_back(v1);
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloFcal23Cells2RxMappingTool.h b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloFcal23Cells2RxMappingTool.h
index f031523932f2fe4a09681e7d571d9954e5190524..a7703d0f48e9fe1bd292d5084e373fa3a33d6aec 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloFcal23Cells2RxMappingTool.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloFcal23Cells2RxMappingTool.h
@@ -14,8 +14,8 @@
 // Mapping tool for Fcal 23 calo cells to receivers
 //
 
-#ifndef _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOFCAL23CELLS2RXMAPPINGTOOL_H_
-#define _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOFCAL23CELLS2RXMAPPINGTOOL_H_
+#ifndef TRIGT1CALOCALIBTOOLS_L1CALOFCAL23CELLS2RXMAPPINGTOOL_H
+#define TRIGT1CALOCALIBTOOLS_L1CALOFCAL23CELLS2RXMAPPINGTOOL_H
 
 #include <map>
 #include <vector>
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
index da473b1128c3372d8f455454c6f6a89347105ac8..07f021914b0787f88d9d2b564c947a0d260e9777 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
@@ -70,7 +70,7 @@ private:
 
   L1CaloCondSvc *m_condSvc;
   const CaloLVL1_ID *m_lvl1Helper;
-  const CaloIdManager *caloMgr;
+  const CaloIdManager *m_caloMgr;
   const LArOnlineID *m_LArOnlineHelper;
 
   CaloTriggerTowerService* m_ttService;
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloOfflineTriggerTowerTools.h b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloOfflineTriggerTowerTools.h
index db7115d51d6b605ed217d27ce2cf3b654696c526..26f251ae47896cde62a3dad92aa0f3792384d16d 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloOfflineTriggerTowerTools.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloOfflineTriggerTowerTools.h
@@ -11,8 +11,8 @@
 //  ***************************************************************************/
 
 
-#ifndef TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOOFFLINETRIGERTOWERTOOLS_H
-#define TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOOFFLINETRIGERTOWERTOOLS_H
+#ifndef TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOOFFLINETRIGGERTOWERTOOLS_H
+#define TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOOFFLINETRIGGERTOWERTOOLS_H
 
 #include "AsgTools/AsgTool.h"
 #include "GaudiKernel/ToolHandle.h"
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloPprPlotManager.h b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloPprPlotManager.h
index 92acb69f4708f1a7e7b3abd49e57477957760c04..a07fd445e94ec45addc0bcd8fcbac47884df8081 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloPprPlotManager.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloPprPlotManager.h
@@ -220,7 +220,7 @@ protected:
 
     std::map<unsigned int, TProfile*> m_map_offline_coolIDProfile_ValueVsLumi;
 
-    bool isOnline;
+    bool m_isOnline;
     bool m_firstRun;
     bool m_doRunHistograms;
     int m_ppmAdcMinValue;
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
index 35251b7d2f08a17a3f1316fc286a4268bf2e4cf2..d5af1c051594a66f5b799127b001e7379d95e5c2 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
@@ -10,7 +10,7 @@ namespace LVL1{
     asg::AsgTool( name ),
     m_condSvc(nullptr),
     m_lvl1Helper(nullptr),
-    caloMgr(nullptr),
+    m_caloMgr(nullptr),
     m_LArOnlineHelper(nullptr),
     m_ttService(nullptr),
     m_cells2tt("LVL1::L1CaloCells2TriggerTowers/L1CaloCells2TriggerTowers"),
@@ -30,14 +30,14 @@ namespace LVL1{
     sc = service("L1CaloCondSvc", m_condSvc);
     if(sc.isFailure()){ATH_MSG_ERROR( "Cannot access L1CaloCondSvc!" );return sc;}
 
-    sc = detStore()->retrieve(caloMgr) ;
+    sc = detStore()->retrieve(m_caloMgr) ;
     if(sc.isFailure()){ATH_MSG_ERROR( "Cannot access caloMgr");return sc;}
 
     sc = detStore()->retrieve(m_LArOnlineHelper,"LArOnlineID") ;
     if(sc.isFailure()){ATH_MSG_ERROR( "Cannot access LArOnlineID");return sc;}
     
     //Use the CaloIdManager to get a pointer to an instance of the CaloLVL1_ID helper
-    m_lvl1Helper = caloMgr->getLVL1_ID();
+    m_lvl1Helper = m_caloMgr->getLVL1_ID();
     if(!m_lvl1Helper) {
       ATH_MSG_ERROR( "Cannot access CaloLVL1_ID helper." );
       return StatusCode::FAILURE;
@@ -83,13 +83,13 @@ namespace LVL1{
     sc = m_ttTool->retrieveConditions();
     if(!sc.isSuccess()) {
       ATH_MSG_ERROR( "Cannot retrieve Conditions in L1TriggerTowerTool." );
-      return StatusCode::RECOVERABLE;
+      return false;
     }
 
     // init trigger tower to cell mapping - needed each event?
     if(!m_cells2tt->initCaloCellsTriggerTowers(caloCellContainer)) {
       ATH_MSG_ERROR( "Can not initialize L1CaloCells2TriggerTowers with CaloCellContainer "<< m_caloCellContainerName );
-      return StatusCode::RECOVERABLE;
+      return false;
     }
 
     Identifier TTid;
@@ -99,7 +99,7 @@ namespace LVL1{
 
     mapSum::iterator it_map;
 
-    LVL1::TriggerTower *tt;
+    const LVL1::TriggerTower *tt;
     TriggerTowerCollection::const_iterator p_itTT = triggerTowerCollection.begin();
     TriggerTowerCollection::const_iterator p_itTTEnd = triggerTowerCollection.end();
 
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx
index f9dd0121d7f1e99102bb320b4eb93c0541e8f9a9..5e7fafd37237bf2ad68cdcdb6e3fb1198125b868 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx
@@ -73,7 +73,7 @@ StatusCode L1CaloPprEtCorrelationPlotManager::getCaloCells()
     
     const CaloCellContainer* caloCellContainer = 0;
     
-    if (!isOnline){
+    if (!m_isOnline){
       
         sc = m_storeGate->retrieve(caloCellContainer, m_caloCellContainerName);
 	if ( sc.isFailure() || !caloCellContainer) {
@@ -157,7 +157,7 @@ void L1CaloPprEtCorrelationPlotManager::loadTools()
 {
     StatusCode sc;
     
-    if (isOnline) {
+    if (m_isOnline) {
         sc = m_caloTool.retrieve();
 	if ( sc.isFailure()) {
 	    *m_log<<MSG::WARNING<<"Unable to locate tool L1CaloMonitoringCaloTool" << endmsg;
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprFineTimePlotManager.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprFineTimePlotManager.cxx
index ce8b96984a167bd4e68c08b60a2e667e18e85ad6..a39ffe601f1297de5a8ef856ee05b8454985e67e 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprFineTimePlotManager.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprFineTimePlotManager.cxx
@@ -101,7 +101,7 @@ float L1CaloPprFineTimePlotManager::LArQuality(const xAOD::TriggerTower* trigTow
   
     Identifier id(0);
 
-    if(isOnline){
+    if(m_isOnline){
       id = m_ttToolOnline->identifier(trigTower->eta(), trigTower->phi(), layer); 
     }else{
       if(layer == 0) id = m_ttToolOffline->emID(trigTower->eta(),trigTower->phi());
@@ -229,7 +229,7 @@ void L1CaloPprFineTimePlotManager::loadTools()
 {
     StatusCode sc;
     
-    if (isOnline) {
+    if (m_isOnline) {
         sc = m_caloTool.retrieve();
 	if ( sc.isFailure()) {
 	    *m_log<<MSG::WARNING<<"Unable to locate tool L1CaloMonitoringCaloTool" << endmsg;
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprPlotManager.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprPlotManager.cxx
index 048278b7641d1cd1d55953a950b8ee64a63aa92f..1e305401848c98dd2d3e26a803d053863ee8f54d 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprPlotManager.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprPlotManager.cxx
@@ -73,7 +73,7 @@ L1CaloPprPlotManager::L1CaloPprPlotManager(ITHistSvc* histSvc,
     m_h_offline_had_etaPhiValueRMS(0),
     m_p_offline_em_valueVsRunNumber(0),
     m_p_offline_had_valueVsRunNumber(0),
-    isOnline(false),
+    m_isOnline(false),
     m_firstRun(true),
     m_doRunHistograms(doRunHistograms),
     m_ppmAdcMinValue(ADC_cut),
@@ -125,7 +125,7 @@ L1CaloPprPlotManager::L1CaloPprPlotManager(ManagedMonitorToolBase* aMonObj,
     m_h_offline_had_etaPhiValueRMS(0),
     m_p_offline_em_valueVsRunNumber(0),
     m_p_offline_had_valueVsRunNumber(0),
-    isOnline(true),
+    m_isOnline(true),
     m_firstRun(true),
     m_doRunHistograms(false),
     m_ppmAdcMinValue(ADC_cut),
@@ -158,7 +158,7 @@ void L1CaloPprPlotManager::Analyze(const EventInfo* evtInfo, const xAOD::Trigger
     m_currentRunNo = evtInfo->event_ID()->run_number();
     m_bunchCrossing = evtInfo->event_ID()->bunch_crossing_id();
 
-    if (!isOnline && m_doRunHistograms)
+    if (!m_isOnline && m_doRunHistograms)
     {
         if (m_firstRun)
         {
@@ -175,7 +175,7 @@ void L1CaloPprPlotManager::Analyze(const EventInfo* evtInfo, const xAOD::Trigger
             if (sc.isFailure()) {*m_log << MSG::FATAL << "Could not book Run Histograms" << endmsg;}
         }
     }
-    if (isOnline && this->isNewRun())
+    if (m_isOnline && this->isNewRun())
     {
         m_p_online_em_valueVsLumi = 0;
         m_p_online_had_valueVsLumi = 0;
@@ -194,7 +194,7 @@ void L1CaloPprPlotManager::Analyze(const EventInfo* evtInfo, const xAOD::Trigger
     //Check if the TriggerTowers are disabled or not before analysis
     if (!channelDisabled)
     {
-        if ( isOnline) {
+        if ( m_isOnline) {
             if ( trigTower->layer() == 0 ) { this->fillOnlineHistos(trigTower, coolID, Emlayer); }
             if ( trigTower->layer() == 1 ) { this->fillOnlineHistos(trigTower, coolID, Hadlayer); }
         }
@@ -687,7 +687,7 @@ void L1CaloPprPlotManager::fillDifferentialOfflineHistos(const xAOD::TriggerTowe
 StatusCode L1CaloPprPlotManager::MakeSummary()
 {
     StatusCode sc;
-    if ( !isOnline && m_doRunHistograms )
+    if ( !m_isOnline && m_doRunHistograms )
     {
         *m_log << MSG::INFO << "MakeSummary for " << m_monitoringName.data() << " plots" << endmsg;
         sc =  m_histoSvc->regHist(Form("/AANT/ADC/%s/run#%d/ppm_em_2d_profile_etaPhi_adc_%s",
diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/IMuctpiSimTool.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/IMuctpiSimTool.h
index aa5b68521b63ce1faf3b0bb1889b533f988f7739..b37990342d668eb2f05f86d4cc813b150e2e8cb9 100644
--- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/IMuctpiSimTool.h
+++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/IMuctpiSimTool.h
@@ -26,7 +26,7 @@ namespace LVL1MUCTPI {
       *  \param inputEvent reference to the inputEvent
       */
 
-     virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo & ) const = 0;
+     virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo &, int bcidOffset=0) const = 0;
 
   };
 
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
index 96cc88d22a96d9848d8fc026d36ac085bf8ccfcf..8309c1d7366f81d355ebd199b6186966a3580ce2 100644
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
+++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
@@ -403,7 +403,11 @@ namespace LVL1MUCTPI {
     m_theMuctpi->processData( &mergedInput );      
     // Save the output of the simulation
     CHECK( saveOutput() );
-      
+
+    uint32_t can;
+    std::vector< uint32_t > dataWord;
+    CHECK( updateMuCTPI_RDO(can, dataWord) );
+
     // check the other 4 possible BC offset values in case the input objects tells us there are
     // out of time candidates
 
@@ -418,9 +422,12 @@ namespace LVL1MUCTPI {
 	  m_theMuctpi->processData( &mergedInput, (*it));      
 	  // Save the output of the simulation
 	  CHECK( saveOutput( (*it) ) );	    
+	  uint32_t tmp_can; // this isn't used for anything!
+	  CHECK( updateMuCTPI_RDO(tmp_can, dataWord) );
 	}
       }
     }    
+    CHECK( saveOutput_MuCTPI_RDO(can, dataWord) );
 
     return StatusCode::SUCCESS;
   }
@@ -463,6 +470,11 @@ namespace LVL1MUCTPI {
     // Save the output of the simulation
     CHECK( saveOutput() );
 
+    uint32_t can;
+    std::vector< uint32_t > dataWord;
+    CHECK( updateMuCTPI_RDO(can, dataWord) );
+    CHECK( saveOutput_MuCTPI_RDO(can, dataWord) );
+
     return StatusCode::SUCCESS;
   }
 
@@ -493,6 +505,11 @@ namespace LVL1MUCTPI {
     // Save the output of the simulation
     CHECK( saveOutput() );
 
+    uint32_t can;
+    std::vector< uint32_t > dataWord;
+    CHECK( updateMuCTPI_RDO(can, dataWord) );
+    CHECK( saveOutput_MuCTPI_RDO(can, dataWord) );
+
     return StatusCode::SUCCESS;
   }
 
@@ -564,6 +581,58 @@ namespace LVL1MUCTPI {
     return StatusCode::SUCCESS;
   }
 
+  /**
+   *In order to handle multiple BCID per event, the RDO object needs to be saved only after
+   *all BCID offsets have been processed. This function will update the data word that will
+   *go to the RDO, but won't save the RDO to storegate yet.
+   */
+  StatusCode L1Muctpi::updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord)
+  {
+    const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData();
+    
+    const int HEADER_SIZE = 9;
+    const int STATUSandTAILER_SIZE = 2 + 3;
+    
+    // size check
+    // payload should contain at least 1 data (Candidate Multiplicity)
+    int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE;
+    if( payloadSize < 1 ) {
+      REPORT_ERROR( StatusCode::FAILURE )
+	<< "MIROD didn't provide correct DAQ data";
+      return StatusCode::FAILURE;
+    }
+    
+    // skip header part
+    std::list< unsigned int >::const_iterator itDAQ = daqData.begin();
+    for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) {
+      ++itDAQ;
+    }
+    
+    // candidate multiplicity
+    can = *itDAQ;
+    ++itDAQ;
+    
+    // data word
+    //std::vector< uint32_t > dataWord;
+    for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) {
+      dataWord.push_back( *itDAQ );
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  /**
+   *Here we save the actual RDO, after all BCID offsets have been processed
+   */
+  StatusCode L1Muctpi::saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord)
+  {
+    MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, dataWord );
+    CHECK( evtStore()->record( muCTPI_RDO, m_rdoOutputLocId ) );
+    ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: "
+		   << m_rdoOutputLocId );
+    return StatusCode::SUCCESS;
+  }
+
   /**
    * This function is used by all the different execute functions to save the output
    * of the MuCTPI simulation into various objects in StoreGate.
@@ -579,41 +648,43 @@ namespace LVL1MUCTPI {
                      << m_ctpOutputLocId );
 
       // create MuCTPI RDO
-      const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData();
-
-      const int HEADER_SIZE = 9;
-      const int STATUSandTAILER_SIZE = 2 + 3;
-
-      // size check
-      // payload should contain at least 1 data (Candidate Multiplicity)
-      int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE;
-      if( payloadSize < 1 ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "MIROD didn't provide correct DAQ data";
-	return StatusCode::FAILURE;
-      }
-
-      // skip header part
-      std::list< unsigned int >::const_iterator itDAQ = daqData.begin();
-      for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) {
-	++itDAQ;
-      }
-
-      // candidate multiplicity
-      const uint32_t can = *itDAQ;
-      ++itDAQ;
-
-      // data word
-      std::vector< uint32_t > dataWord;
-      for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) {
-	dataWord.push_back( *itDAQ );
-      }
+      // const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData();
+
+      // const int HEADER_SIZE = 9;
+      // const int STATUSandTAILER_SIZE = 2 + 3;
+
+      // // size check
+      // // payload should contain at least 1 data (Candidate Multiplicity)
+      // int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE;
+      // if( payloadSize < 1 ) {
+      // 	REPORT_ERROR( StatusCode::FAILURE )
+      // 	  << "MIROD didn't provide correct DAQ data";
+      // 	return StatusCode::FAILURE;
+      // }
+
+      // // skip header part
+      // std::list< unsigned int >::const_iterator itDAQ = daqData.begin();
+      // for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) {
+      // 	++itDAQ;
+      // }
+
+      // // candidate multiplicity
+      // const uint32_t can = *itDAQ;
+      // ++itDAQ;
+
+      // // data word
+      // std::vector< uint32_t > dataWord;
+      // for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) {
+      // 	dataWord.push_back( *itDAQ );
+      // }
 
       // create MuCTPI RDO
-      MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, dataWord );
-      CHECK( evtStore()->record( muCTPI_RDO, m_rdoOutputLocId ) );
-      ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: "
-                     << m_rdoOutputLocId );
+      // MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, dataWord );
+      // std::string rdoOutputLocId = m_rdoOutputLocId;
+      // if (bcidOffset) rdoOutputLocId = m_rdoOutputLocId+std::to_string(bcidOffset);
+      // CHECK( evtStore()->record( muCTPI_RDO, rdoOutputLocId ) );
+      // ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: "
+      //                << rdoOutputLocId );
 
       // store RoIB result in interface object and put to StoreGate
       std::list< unsigned int > resultForRoIB = m_theMuctpi->getRoIBData();
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
index bbf942c0ea4fc4b2e877a0289b41cb4c3c4300f2..eeb2ed4c795a61229823fcaa7175fcc0835efdc8 100644
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
+++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
@@ -79,6 +79,10 @@ namespace LVL1MUCTPI {
       StatusCode executeFromRDO();
       /// Validate the muon threshold configuration
       StatusCode validate( const std::vector< TrigConf::TriggerThreshold* >& thresholds ) const;
+      /// Update the data word for the RDO object
+      StatusCode updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord);
+      /// Save the MuCTPI RDO object
+      StatusCode saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord);
       /// Save the outputs of the simulation into StoreGate
       StatusCode saveOutput(int bcidOffset = 0);
 
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
index 7087bd7bc3f9e1bb1029eb9f951b618e2b698903..1309aa672f085444b4f4846ddb45f95afabbd219 100644
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
+++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
@@ -30,6 +30,8 @@
 
 // The output object of the simulation
 #include "TrigT1Result/MuCTPI_RDO.h"
+#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h"
+#include "TrigT1Result/MuCTPI_DataWord_Decoder.h"
 
 // Inlcudes for the MuCTPI simulation
 #include "../Algorithms/L1MuctpiTool.h"
@@ -370,63 +372,93 @@ namespace LVL1MUCTPI {
   // algorithm code what to execute. This is essetnially the execute from RDO variant
   // below without the saveOutput call, since we only want part of that routine.
 
-  StatusCode L1MuctpiTool::fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo& l1topoCandidates ) const {
+  StatusCode L1MuctpiTool::fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo& l1topoCandidates, int bcidOffset) const {
     ATH_MSG_DEBUG( "in fillMuCTPIL1Topo()" );
     
     // Retrieve the MuCTPIToRoIBSLink or RoIBResult object from storegate:
     const ROIB::RoIBResult* roibResult {nullptr};
     const L1MUINT::MuCTPIToRoIBSLink* muctpi_slink {nullptr};
+    const MuCTPI_RDO* muctpiRDO = {nullptr};
     
-    if( evtStore()->contains<L1MUINT::MuCTPIToRoIBSLink>( m_roiOutputLocId) ) {
-      CHECK( evtStore()->retrieve( muctpi_slink,  m_roiOutputLocId) );
-    } else if( evtStore()->contains<ROIB::RoIBResult>(m_roibLocation) ) {
-      CHECK( evtStore()->retrieve(roibResult, m_roibLocation) );
-    } else {
-      ATH_MSG_WARNING("Neither a MuCTPIToRoIBSLink with SG key '/Run/L1MuCTPItoRoIBLocation' nor a an RoIBResult were found in the event.");
-      return StatusCode::RECOVERABLE;
+    if(bcidOffset==0) {      
+      if( evtStore()->contains<L1MUINT::MuCTPIToRoIBSLink>( m_roiOutputLocId) ) {
+	CHECK( evtStore()->retrieve( muctpi_slink,  m_roiOutputLocId) );
+      } else if( evtStore()->contains<ROIB::RoIBResult>(m_roibLocation) ) {
+	CHECK( evtStore()->retrieve(roibResult, m_roibLocation) );
+      } else {
+	ATH_MSG_WARNING("Neither a MuCTPIToRoIBSLink with SG key '/Run/L1MuCTPItoRoIBLocation' nor a an RoIBResult were found in the event.");
+	return StatusCode::RECOVERABLE;
+      }
+    }else{
+      CHECK( evtStore()->retrieve( muctpiRDO, m_rdoLocId ) );
+      ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" );
     }
     
-    // Extract the RoIs into a vector:
-    std::vector< unsigned int > convertableRoIs;
-
-   if( roibResult ) {
-
-      const std::vector< ROIB::MuCTPIRoI >& rois = roibResult->muCTPIResult().roIVec();
-      ATH_MSG_DEBUG("Filling the input event from RoIBResult. Number of Muon ROIs: " << rois.size() );
-      for( const ROIB::MuCTPIRoI & muonRoI : rois ) {
-	   convertableRoIs.push_back(  muonRoI.roIWord() );
-      }
-   } else if( muctpi_slink ) {
-
-      ATH_MSG_DEBUG("Filling the input event. Number of Muon ROIs: " << muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Header::wordsPerHeader - ROIB::Trailer::wordsPerTrailer - 1);
-      unsigned int icnt = 0;
-      for ( unsigned int roiword : muctpi_slink->getMuCTPIToRoIBWords() ) {
-
-         ++icnt;
-         // skip header
-         if ( icnt <= ROIB::Header::wordsPerHeader + 1 )
-            continue;
-
-         // skip trailer
-         if ( icnt > ( muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Trailer::wordsPerTrailer ) )
-            continue;
-
-	 // fill RoI into vector
-	 convertableRoIs.push_back(roiword);
-      }
-   }
-
-    // Create the input to the MuCTPI:
+    // Convert output of MUCTPi to input
     LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-    CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) );
 
+    // if reading from ROS data
+    if(muctpiRDO) {
+      
+      //std::cout << "DataWord Decoding" << std::endl;
+      //for(auto dW : muctpiRDO->dataWord()) 
+      //MuCTPI_DataWord_Decoder(dW).dumpData(msg());
+      
+      // Get the BCID of the collision:
+      unsigned int bcid_next = ( ( muctpiRDO->candidateMultiplicity() >> 18 ) & 0x7 ) + bcidOffset;
+      if(bcid_next==8) bcid_next=0;
+      ATH_MSG_DEBUG("Filling the input event from MUCTPI_RDO for bcid = " << bcid_next);
+      
+      // Create the input to the MuCTPI for the +1 BC
+      CHECK( Converter::convertRDO( muctpiRDO->dataWord(), bcid_next, &convertedInput ) );
+      ATH_MSG_DEBUG("Input converted");
+     
+    }
+    // or from RoIB data
+    else{
+      
+      // Extract the RoIs into a vector:
+      std::vector< unsigned int > convertableRoIs;
+      
+      if( roibResult ) {
+	
+	const std::vector< ROIB::MuCTPIRoI >& rois = roibResult->muCTPIResult().roIVec();
+	ATH_MSG_DEBUG("Filling the input event from RoIBResult. Number of Muon ROIs: " << rois.size() );
+	for( const ROIB::MuCTPIRoI & muonRoI : rois ) {
+	  convertableRoIs.push_back(  muonRoI.roIWord() );
+	}
+      } else if( muctpi_slink ) {
+	
+	ATH_MSG_DEBUG("Filling the input event. Number of Muon ROIs: " << muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Header::wordsPerHeader - ROIB::Trailer::wordsPerTrailer - 1);
+	unsigned int icnt = 0;
+	for ( unsigned int roiword : muctpi_slink->getMuCTPIToRoIBWords() ) {
+	  
+	  ++icnt;
+	  // skip header
+	  if ( icnt <= ROIB::Header::wordsPerHeader + 1 )
+	    continue;
+	  
+	  // skip trailer
+	  if ( icnt > ( muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Trailer::wordsPerTrailer ) )
+	    continue;
+	  
+	  // fill RoI into vector
+	  convertableRoIs.push_back(roiword);
+	}
+      }
+      
+      // Create the input to the MuCTPI:
+      CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) );     
+    }
+    
     // process the input with the MuCTPI simulation
+    ATH_MSG_DEBUG("MUCTPI data processing...");
     m_theMuctpi->processData( &convertedInput );
-
+    
     // get outputs for L1Topo 
     ATH_MSG_DEBUG("Getting the output for L1Topo");
     l1topoCandidates = m_theMuctpi->getL1TopoData();
- 
+    
     return StatusCode::SUCCESS;
   }
 
@@ -763,8 +795,8 @@ namespace LVL1MUCTPI {
       CHECK( evtStore()->record( l1topo, m_l1topoOutputLocId ) );
       //      std::cout << "TW: central slice: offset: " <<  bcidOffset << "  location: " << m_l1topoOutputLocId << std::endl;
       //l1topo->print();
-   }
-    
+    }
+
     /// if we have a bcid offset, then just get the topo output and put it on storegate
     if (bcidOffset  != 0) {
       ATH_MSG_DEBUG("Getting the output for L1Topo for BCID slice");
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
index 21317b6dfd6d276b18a534005648eac80c59c975..1332abca989f6ceb6495216b58b682ad9335d551 100644
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
+++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
@@ -33,7 +33,7 @@ namespace LVL1MUCTPI {
 
       virtual StatusCode initialize() override;
 
-      virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo& ) const; 
+      virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo&, int bcidOffset=0) const; 
 
       virtual void handle(const Incident&);
 
diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/TrigT1ResultByteStream/RoIBResultByteStreamTool.icc b/Trigger/TrigT1/TrigT1ResultByteStream/TrigT1ResultByteStream/RoIBResultByteStreamTool.icc
index 8743a129adff4b67f22c832aad0517c9fcd85b86..e7aefb7de35abf011714357f361d5cda1ac7c3d5 100755
--- a/Trigger/TrigT1/TrigT1ResultByteStream/TrigT1ResultByteStream/RoIBResultByteStreamTool.icc
+++ b/Trigger/TrigT1/TrigT1ResultByteStream/TrigT1ResultByteStream/RoIBResultByteStreamTool.icc
@@ -9,9 +9,6 @@
 
 #include <exception>
 
-// Gaudi/Athena include(s):
-#include "GaudiKernel/MsgStream.h"
-
 // eformat include(s):
 #include "eformat/SourceIdentifier.h"
 
@@ -30,8 +27,7 @@ template< class ROBF >
 StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
                                               ROIB::RoIBResult*& result ) {
 
-  MsgStream log( msgSvc(), name() );
-  log << MSG::DEBUG << "executing convert() from ROBFragments to RDO" << endreq;
+  ATH_MSG_DEBUG("executing convert() from ROBFragments to RDO");
 
   /* Create all RDOs */
   ROIB::CTPResult cTPResult;
@@ -86,10 +82,12 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
     DataType status;
     rob.rod_status( status );
     uint32_t nstatus = rob.rod_nstatus();
-    log << MSG::VERBOSE << "Number of status words: " << nstatus << endreq;
-    for( uint32_t i = 0; i < nstatus; ++i, ++status ) {
-       log << MSG::VERBOSE << "   Status word: 0x" << MSG::hex << std::setw( 8 )
-           << std::setfill( '0' ) << *status << endreq;
+    ATH_MSG_VERBOSE("Number of status words: " << nstatus);
+    if (msgLvl(MSG::VERBOSE)) {
+      for( uint32_t i = 0; i < nstatus; ++i, ++status ) {
+        ATH_MSG_VERBOSE("   Status word: 0x" << MSG::hex << std::setw( 8 )
+            << std::setfill( '0' ) << *status);
+      }
     }
     rob.rod_status( status );
 
@@ -102,16 +100,16 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
        statInfo = static_cast< uint32_t >( *status );
     }
 
-    log << MSG::DEBUG << "ROB ID 0x" << MSG::hex << robId <<  " ROD ID 0x" 
+    ATH_MSG_DEBUG("ROB ID 0x" << MSG::hex << robId <<  " ROD ID 0x" 
         << rodId << MSG::dec << " ROB fragment size " 
-        << robFragSize << " ROD fragment size " << rodFragSize << endreq;
+        << robFragSize << " ROD fragment size " << rodFragSize);
 
     /* CTP ROB */
     eformat::helper::SourceIdentifier helpCTPID( eformat::TDAQ_CTP, m_ctpModuleID );
     eformat::helper::SourceIdentifier helpCTPID_II( eformat::TDAQ_CTP, 0 );
     
-    log << MSG::DEBUG << "Check ROD ID against CTP 0x" << MSG::hex 
-	<< helpCTPID.code() << MSG::dec << endreq;
+    ATH_MSG_DEBUG("Check ROD ID against CTP 0x" << MSG::hex 
+	<< helpCTPID.code() << MSG::dec);
     if( rodId == helpCTPID.code() || 
         // this is a hack to catch the early data with the old CTP
         // firmware, which assigns 0x770000 to both DAQ and LVL2 ROD
@@ -121,10 +119,10 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
         ( rodId == helpCTPID_II.code() && rodFragSize == 46 ) ) {
 
       if( rodId == helpCTPID_II.code() && rodFragSize == 46 ) {
-        log << MSG::DEBUG << "Take CTP ROD fragment with ID 0x" << MSG::hex << rodId << MSG::dec  << endreq;
+        ATH_MSG_DEBUG("Take CTP ROD fragment with ID 0x" << MSG::hex << rodId << MSG::dec );
       }
-      log << MSG::DEBUG << "   Found CTP ROB." << endreq;
-      log << MSG::VERBOSE << "   Dumping RoI Words:" << endreq;
+      ATH_MSG_DEBUG("   Found CTP ROB.");
+      ATH_MSG_VERBOSE("   Dumping RoI Words:");
 
       /* Celebrate finding the ROD */
       cTPFound = true;
@@ -135,14 +133,16 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       rob.rod_data( data );
       uint32_t ndata = rob.rod_ndata();
       std::vector< ROIB::CTPRoI > cTPContent;
+      cTPContent.reserve(ndata);
       for( uint32_t i = 0; i < ndata; ++i, ++data ) {
-        log << MSG::VERBOSE << "       0x" << MSG::hex << std::setw( 8 )
-            << static_cast< uint32_t >( *data ) << endreq;
+        ATH_MSG_VERBOSE("       0x" << MSG::hex << std::setw( 8 )
+            << static_cast< uint32_t >( *data ));
         ROIB::CTPRoI thisRoI( static_cast<uint32_t>( *data ) );
         cTPContent.push_back( thisRoI );
       }
       /* Create Trailer */
       std::vector< uint32_t > words;
+      words.reserve(5);
       words.push_back( errorStat );         // error status
       words.push_back( statInfo );          // status info
       words.push_back( 2 );                 // number of status words
@@ -164,8 +164,8 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
     eformat::helper::SourceIdentifier helpMuonID( eformat::TDAQ_MUON_CTP_INTERFACE, m_muCTPIModuleID );
     if( rodId == helpMuonID.code() ) {
 
-      log << MSG::DEBUG << "   Found MuCTPI ROB." << endreq;
-      log << MSG::VERBOSE << "   Dumping RoI Words:" << endreq;
+      ATH_MSG_DEBUG( "   Found MuCTPI ROB.");
+      ATH_MSG_VERBOSE( "   Dumping RoI Words:");
 
       /* Celebrate finding the ROB */
       muCTPIFound = true;
@@ -176,15 +176,17 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       rob.rod_data( data );
       uint32_t ndata = rob.rod_ndata();
       std::vector< ROIB::MuCTPIRoI > muCTPIContent;
+      muCTPIContent.reserve(ndata);
       for( uint32_t i = 0; i < ndata; ++i, ++data ) {
-        log << MSG::VERBOSE << "       0x" << MSG::hex << std::setw( 8 )
-            << static_cast< uint32_t >( *data ) << endreq;
+        ATH_MSG_VERBOSE("       0x" << MSG::hex << std::setw( 8 )
+            << static_cast< uint32_t >( *data ));
         ROIB::MuCTPIRoI thisRoI( static_cast< uint32_t >( *data ) );
         muCTPIContent.push_back( thisRoI );
       }
 
       /* Create trailer */
       std::vector< uint32_t > words;
+      words.reserve(5);
       words.push_back( errorStat );            // error status
       words.push_back( statInfo );             // status info
       words.push_back( 2 );                    // number of status words
@@ -202,8 +204,8 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
 	 eformat::helper::SourceIdentifier helpJetID_1( eformat::TDAQ_CALO_JET_PROC_ROI, m_jetModuleID[1] );
     if( rodId == helpJetID_0.code() || rodId == helpJetID_1.code() ) {
 
-      log << MSG::DEBUG << "   Found Jet/Energy ROB." << endreq;
-      log << MSG::VERBOSE << "   Dumping RoI Words:" << endreq;
+      ATH_MSG_DEBUG("   Found Jet/Energy ROB.");
+      ATH_MSG_VERBOSE("   Dumping RoI Words:");
 
       /* Create header */
       ROIB::Header jetEnergyHead( rodId, evtNum, formatVersion );
@@ -212,14 +214,16 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       rob.rod_data( data );
       uint32_t ndata = rob.rod_ndata();
       std::vector< ROIB::JetEnergyRoI > jetEnergyContent;
+      jetEnergyContent.reserve(ndata);
       for( uint32_t i = 0; i < ndata; ++i, ++data ) {
-        log << MSG::VERBOSE << "       0x" << MSG::hex << std::setw( 8 )
-            << static_cast< uint32_t >( *data ) << endreq;
+        ATH_MSG_VERBOSE("       0x" << MSG::hex << std::setw( 8 )
+            << static_cast< uint32_t >( *data ));
         ROIB::JetEnergyRoI thisRoI( static_cast< uint32_t >( *data ) );
         jetEnergyContent.push_back( thisRoI );
       }
       /* Create trailer */
       std::vector< uint32_t > words;
+      words.reserve(5);
       words.push_back( errorStat );               // error status
       words.push_back( statInfo );                // status info
       words.push_back( 2 );                       // number of status words
@@ -244,8 +248,8 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
     if( rodId == helpEMTauID_0.code() || rodId == helpEMTauID_1.code() ||
         rodId == helpEMTauID_2.code() || rodId == helpEMTauID_3.code() ) {
 
-      log << MSG::DEBUG << "   Found EM/Tau ROB." << endreq;
-      log << MSG::VERBOSE << "   Dumping RoI Words:" << endreq;
+      ATH_MSG_DEBUG("   Found EM/Tau ROB.");
+      ATH_MSG_VERBOSE("   Dumping RoI Words:");
 
       /* Create header */
       ROIB::Header eMTauHead( rodId, evtNum, formatVersion );
@@ -254,14 +258,16 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       rob.rod_data( data );
       uint32_t ndata = rob.rod_ndata();
       std::vector<ROIB::EMTauRoI> eMTauContent;
+      eMTauContent.reserve(ndata);
       for( uint32_t i = 0; i < ndata; ++i, ++data ) {
-        log << MSG::VERBOSE << "       0x" << MSG::hex << std::setw( 8 )
-            << static_cast< uint32_t >( *data ) << endreq;
+        ATH_MSG_VERBOSE("       0x" << MSG::hex << std::setw( 8 )
+            << static_cast< uint32_t >( *data ));
         ROIB::EMTauRoI thisRoI( static_cast<uint32_t>( *data ) );
         eMTauContent.push_back( thisRoI );
       }
       /* Create Trailer */
       std::vector< uint32_t > words;
+      words.reserve(5);
       words.push_back( errorStat );           // error status
       words.push_back( statInfo );            // status info
       words.push_back( 2 );                   // number of status words
@@ -303,19 +309,20 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       L1TopoRDO l1TopoContent;
       ATH_MSG_VERBOSE( "   Dumping RoI Words:" );
       std::vector<uint32_t> vDataWords;
+      vDataWords.reserve(ndata);
       for ( uint32_t i = 0; i < ndata; ++i, ++data ) {
-	vDataWords.push_back( static_cast<uint32_t>( *data ) );
-	ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setfill ('0') << std::setw( 8 )  << static_cast<uint32_t>( *data ) << MSG::dec);
+        vDataWords.push_back( static_cast<uint32_t>( *data ) );
+        ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setfill ('0') << std::setw( 8 )  << static_cast<uint32_t>( *data ) << MSG::dec);
       }
       l1TopoContent.setDataWords(vDataWords);
       l1TopoContent.setSourceID(rodId);
       /* Create Trailer */
       std::vector< uint32_t > words;
       // the two status words
+      words.reserve(5);
       words.push_back( errorStat );         // error status
       words.push_back( statInfo );          // status info
       l1TopoContent.setStatusWords(words);  // copy 2 status words to RDO
-      //
       words.push_back( 2 );                 // number of status words
       words.push_back( ndata );             // number of data words
       words.push_back( 1 );                 // status block position
@@ -352,33 +359,33 @@ StatusCode RoIBResultByteStreamTool::convert( const std::vector< ROBF >& robs,
       eMTauFound[ 0 ] && eMTauFound[ 1 ] && eMTauFound[ 2 ] && eMTauFound[ 3 ] ) {
 
     result = new ROIB::RoIBResult( muCTPIResult, cTPResult, jetEnergyResult, eMTauResult );
-    log << MSG::DEBUG << "All RoI Builder ROB fragments found" << endreq;
+    ATH_MSG_DEBUG("All RoI Builder ROB fragments found");
 
   } else if( cTPFound && jetEnergyFound[ 0 ] && jetEnergyFound[ 1 ] &&
              eMTauFound[ 0 ] && eMTauFound[ 1 ] && eMTauFound[ 2 ] && eMTauFound[ 3 ] ) {
 
     result = new ROIB::RoIBResult( cTPResult, eMTauResult, jetEnergyResult );
-    log << MSG::DEBUG << "MuCTPI ROB fragment not found, built RoIBResult object without it." << endreq;
+    ATH_MSG_DEBUG("MuCTPI ROB fragment not found, built RoIBResult object without it.");
 
   } else if( cTPFound && eMTauFound[ 0 ] && eMTauFound[ 1 ] &&
              eMTauFound[ 2 ] && eMTauFound[ 3 ] ) {
 
     result = new ROIB::RoIBResult( cTPResult, eMTauResult );
-    log << MSG::DEBUG << "MuCTPI and Jet/Energy fragments not found, built RoIBResult object without them." << endreq;
+    ATH_MSG_DEBUG("MuCTPI and Jet/Energy fragments not found, built RoIBResult object without them.");
 
   } else if( cTPFound && muCTPIFound ) {
 	  // jetEnergyResult and eMTauResult are empty
     result = new ROIB::RoIBResult( muCTPIResult, cTPResult, jetEnergyResult, eMTauResult );
-    log << MSG::DEBUG << "Calo fragments not found, built RoIBResult from CTPResult and MuCTPIResult only." << endreq;
+    ATH_MSG_DEBUG("Calo fragments not found, built RoIBResult from CTPResult and MuCTPIResult only.");
 
   } else if( cTPFound ) {
 
     result = new ROIB::RoIBResult( cTPResult );
-    log << MSG::DEBUG << "MuCTPI and calo fragments not found, built RoIBResult from CTPResult only." << endreq;
+    ATH_MSG_DEBUG("MuCTPI and calo fragments not found, built RoIBResult from CTPResult only.");
 
   } else {
     result = new ROIB::RoIBResult();
-    log << MSG::DEBUG << "No LVL1 fragments found, create empty RoIBResult." << endreq;
+    ATH_MSG_DEBUG("No LVL1 fragments found, create empty RoIBResult.");
   }
 
   if( l1TopoFound ){
diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx b/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx
index 8ec3ec32081e9eacf6fe1f0233e25897d1c66018..cfe4d626f0cb9158eb6b6113a0438346c1db504e 100755
--- a/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx
@@ -78,74 +78,72 @@ StatusCode RoIBResultByteStreamTool::initialize() {
     return sc;
   }
 
-  MsgStream log( msgSvc(), name() );
-
   //
   // Get ByteStreamAddressProviderSvc:
   //
   ServiceHandle< IProperty > p_ByteStreamAddressProviderSvc( "ByteStreamAddressProviderSvc", name() );
   sc = p_ByteStreamAddressProviderSvc.retrieve();
   if( sc.isFailure() ) {
-    log << MSG::ERROR << "Can't get ByteStreamAddressProviderSvc" << endreq;
+    ATH_MSG_ERROR("Can't get ByteStreamAddressProviderSvc");
     return sc;
   } else {
-    log << MSG::DEBUG << "Connected to " << p_ByteStreamAddressProviderSvc.name() << endreq;
+    ATH_MSG_DEBUG("Connected to " << p_ByteStreamAddressProviderSvc.name());
 
     UnsignedIntegerProperty ctpModuleID;
     ctpModuleID.setName("CTPModuleID");
     if (ctpModuleID.assign(p_ByteStreamAddressProviderSvc->getProperty("CTPModuleID"))) {
       m_ctpModuleID = ctpModuleID.value() ;
-      log << MSG::DEBUG << " ---> getProperty('CTPModuleID')             = " << ctpModuleID << endreq;
+      ATH_MSG_DEBUG(" ---> getProperty('CTPModuleID')             = " << ctpModuleID);
     } else {
-      log << MSG::WARNING << p_ByteStreamAddressProviderSvc.name() << "::getProperty('CTPModuleID') failed." << endreq;
+      ATH_MSG_WARNING(p_ByteStreamAddressProviderSvc.name() << "::getProperty('CTPModuleID') failed.");
     }
 
     UnsignedIntegerProperty muCTPIModuleID;
     muCTPIModuleID.setName("MuCTPIModuleID");
     if (muCTPIModuleID.assign(p_ByteStreamAddressProviderSvc->getProperty("MuCTPIModuleID"))) {
       m_muCTPIModuleID = muCTPIModuleID.value() ;
-      log << MSG::DEBUG << " ---> getProperty('MuCTPIModuleID')          = " << muCTPIModuleID << endreq;
+      ATH_MSG_DEBUG(" ---> getProperty('MuCTPIModuleID')          = " << muCTPIModuleID);
     } else {
-      log << MSG::WARNING << p_ByteStreamAddressProviderSvc.name() << "::getProperty('MuCTPIModuleID') failed." << endreq;
+      ATH_MSG_WARNING(p_ByteStreamAddressProviderSvc.name() << "::getProperty('MuCTPIModuleID') failed.");
     }
 
     UnsignedIntegerArrayProperty jetProcModuleID;
     jetProcModuleID.setName("JetProcModuleID");
     if (jetProcModuleID.assign(p_ByteStreamAddressProviderSvc->getProperty("JetProcModuleID"))) {
       m_jetModuleID = jetProcModuleID.value() ;
-      log << MSG::DEBUG << " ---> getProperty('JetProcModuleID')         = " << jetProcModuleID << endreq;
+      ATH_MSG_DEBUG(" ---> getProperty('JetProcModuleID')         = " << jetProcModuleID);
     } else {
-      log << MSG::WARNING << p_ByteStreamAddressProviderSvc.name() << "::getProperty('JetProcModuleID') failed." << endreq;
+      ATH_MSG_WARNING(p_ByteStreamAddressProviderSvc.name() << "::getProperty('JetProcModuleID') failed.");
     }
 
     UnsignedIntegerArrayProperty caloClusterProcModuleID;
     caloClusterProcModuleID.setName("CaloClusterProcModuleID");
     if (caloClusterProcModuleID.assign(p_ByteStreamAddressProviderSvc->getProperty("CaloClusterProcModuleID"))) {
       m_emModuleID = caloClusterProcModuleID.value() ;
-      log << MSG::DEBUG << " ---> getProperty('CaloClusterProcModuleID') = " << caloClusterProcModuleID << endreq;
+      ATH_MSG_DEBUG(" ---> getProperty('CaloClusterProcModuleID') = " << caloClusterProcModuleID);
     } else {
-      log << MSG::WARNING << p_ByteStreamAddressProviderSvc.name() << "::getProperty('CaloClusterProcModuleID') failed." << endreq;
+      ATH_MSG_WARNING(p_ByteStreamAddressProviderSvc.name() << "::getProperty('CaloClusterProcModuleID') failed.");
     }
 
     UnsignedIntegerArrayProperty l1TopoModuleID;
     l1TopoModuleID.setName("TopoProcModuleID");
     if (l1TopoModuleID.assign(p_ByteStreamAddressProviderSvc->getProperty("TopoProcModuleID"))) {
       m_l1TopoModuleID = l1TopoModuleID.value();
-      log << MSG::DEBUG << " ---> getProperty('TopoProcModuleID') = " << l1TopoModuleID << endreq;
+      ATH_MSG_DEBUG(" ---> getProperty('TopoProcModuleID') = " << l1TopoModuleID);
     } else {
-      log << MSG::WARNING << p_ByteStreamAddressProviderSvc.name() << "::getProperty('TopoProcModuleID') failed." << endreq;
+      ATH_MSG_WARNING(p_ByteStreamAddressProviderSvc.name() << "::getProperty('TopoProcModuleID') failed.");
     }
   }
 
-  log<<MSG::DEBUG << " -- Module IDs for: "<<endreq;
-  log<<MSG::DEBUG << "    CTP                                  = 0x" <<MSG::hex<< m_ctpModuleID <<MSG::dec<<endreq;
-  log<<MSG::DEBUG << "    muCTPi                               = 0x" <<MSG::hex<< m_muCTPIModuleID <<MSG::dec<<endreq;
-  log<<MSG::DEBUG << "    Calorimeter Cluster Processor RoI    = 0x" <<MSG::hex<< m_emModuleID[0]
-     << ", 0x" << m_emModuleID[1] << ", 0x" << m_emModuleID[2] << ", 0x" << m_emModuleID[3] <<MSG::dec<<endreq;
-  log<<MSG::DEBUG << "    Calorimeter Jet/Energy Processor RoI = 0x" <<MSG::hex<< m_jetModuleID[0]
-     << ", 0x" << m_jetModuleID[1] <<MSG::dec<<endreq;
+  ATH_MSG_DEBUG(" -- Module IDs for: ");
+  ATH_MSG_DEBUG("    CTP                                  = 0x" <<MSG::hex<< m_ctpModuleID <<MSG::dec);
+  ATH_MSG_DEBUG("    muCTPi                               = 0x" <<MSG::hex<< m_muCTPIModuleID <<MSG::dec);
+  ATH_MSG_DEBUG("    Calorimeter Cluster Processor RoI    = 0x" <<MSG::hex<< m_emModuleID[0]
+     << ", 0x" << m_emModuleID[1] << ", 0x" << m_emModuleID[2] << ", 0x" << m_emModuleID[3] <<MSG::dec);
+  ATH_MSG_DEBUG("    Calorimeter Jet/Energy Processor RoI = 0x" <<MSG::hex<< m_jetModuleID[0]
+     << ", 0x" << m_jetModuleID[1] <<MSG::dec);
 
-  //  log<<MSG::DEBUG << "    L1Topo                               = 0x" <<MSG::hex<< m_l1TopoModuleID[0]     << ", 0x" <<  m_l1TopoModuleID[1] <<MSG::dec<<endreq;
+  //  ATH_MSG_DEBUG("    L1Topo                               = 0x" <<MSG::hex<< m_l1TopoModuleID[0]     << ", 0x" <<  m_l1TopoModuleID[1] <<MSG::dec);
   std::ostringstream topoModulesString;
   for (unsigned int mid: m_l1TopoModuleID){ 
     topoModulesString << L1Topo::formatHex4(mid) << " ";
@@ -169,51 +167,49 @@ StatusCode RoIBResultByteStreamTool::finalize() {
  */
 StatusCode RoIBResultByteStreamTool::convert( ROIB::RoIBResult* result, RawEventWrite* re ) {
 
-  MsgStream log( msgSvc(), name() );
-
   // Clear the event assembler:
   m_fea.clear();
   // Reset lumi-block number to 1
   m_fea.setDetEvtType( 1 );
 
-  log << MSG::DEBUG << "executing convert() from RDO to ROBFragments" << endreq;
+  ATH_MSG_DEBUG("executing convert() from RDO to ROBFragments");
 
   // I use only this one pointer now to fill the RODs:
   FullEventAssembler< L1SrcIdMap >::RODDATA* theROD;
 
   /** CTP ROD */
-  log << MSG::VERBOSE << "   Dumping CTP RoI words:" << endreq;
+  ATH_MSG_VERBOSE("   Dumping CTP RoI words:");
   eformat::helper::SourceIdentifier helpCTPID( eformat::TDAQ_CTP, m_ctpModuleID );
   uint32_t rodIdCTP = helpCTPID.code();
   theROD = m_fea.getRodData( rodIdCTP );
   const std::vector< ROIB::CTPRoI >& CTPRoIVec = result->cTPResult().roIVec();
   for( std::vector< ROIB::CTPRoI >::const_iterator j = CTPRoIVec.begin(); j != CTPRoIVec.end(); ++j ) {
-    log << MSG::VERBOSE << "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() << endreq;
+    ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() );
     theROD->push_back( j->roIWord() );
   }
 
   /** Muon ROD */
-  log << MSG::VERBOSE << "   Dumping MuCTPI RoI words:" << endreq;
+  ATH_MSG_VERBOSE( "   Dumping MuCTPI RoI words:" );
   eformat::helper::SourceIdentifier helpMuonID( eformat::TDAQ_MUON_CTP_INTERFACE, m_muCTPIModuleID );
   uint32_t rodIdMuon = helpMuonID.code();
   theROD = m_fea.getRodData( rodIdMuon );
   const std::vector< ROIB::MuCTPIRoI >& MuCTPIRoIVec = result->muCTPIResult().roIVec();
   for( std::vector< ROIB::MuCTPIRoI >::const_iterator j = MuCTPIRoIVec.begin();
        j != MuCTPIRoIVec.end(); ++j ) {
-    log << MSG::VERBOSE << "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() << endreq;
+    ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() );
     theROD->push_back( j->roIWord() );
   }
 
   /** Jet/Energy ROD */
   const std::vector< ROIB::JetEnergyResult >& jetEnergyResultVector = result->jetEnergyResult();
   for( unsigned int slink = 0; slink < jetEnergyResultVector.size(); ++slink ) {
-    log << MSG::VERBOSE << "   Dumping Jet/Energy " << slink << " RoI words:" << endreq;
+    ATH_MSG_VERBOSE( "   Dumping Jet/Energy " << slink << " RoI words:" );
     eformat::helper::SourceIdentifier helpJetID( eformat::TDAQ_CALO_JET_PROC_ROI, m_jetModuleID[slink] );
     theROD = m_fea.getRodData( helpJetID.code() );
     const std::vector< ROIB::JetEnergyRoI >& JetEnergyRoIVec = jetEnergyResultVector[ slink ].roIVec();
     for( std::vector< ROIB::JetEnergyRoI >::const_iterator j = JetEnergyRoIVec.begin();
          j != JetEnergyRoIVec.end(); ++j ) {
-      log << MSG::VERBOSE << "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() << endreq;
+      ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() );
       theROD->push_back( j->roIWord() );
     }
   }
@@ -221,42 +217,43 @@ StatusCode RoIBResultByteStreamTool::convert( ROIB::RoIBResult* result, RawEvent
   /* EMTau RODs */
   const std::vector< ROIB::EMTauResult >& eMTauRDOResultVector = result->eMTauResult();
   for( unsigned int slink = 0; slink < eMTauRDOResultVector.size(); ++slink ) {
-    log << MSG::VERBOSE << "   Dumping EM/Tau " << slink << " RoI words:" << endreq;
+    ATH_MSG_VERBOSE( "   Dumping EM/Tau " << slink << " RoI words:" );
     eformat::helper::SourceIdentifier helpEMTauID( eformat::TDAQ_CALO_CLUSTER_PROC_ROI, m_emModuleID[slink]);
     theROD = m_fea.getRodData( helpEMTauID.code() );
     const std::vector< ROIB::EMTauRoI >& EMTauRoIVec = eMTauRDOResultVector[ slink ].roIVec();
     for( std::vector<ROIB::EMTauRoI>::const_iterator j = EMTauRoIVec.begin();
          j != EMTauRoIVec.end(); ++j ) {
-      log << MSG::VERBOSE << "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() << endreq;
+      ATH_MSG_VERBOSE( "     0x" << MSG::hex << std::setw( 8 ) << j->roIWord() );
       theROD->push_back( j->roIWord() );
     }
   }
 
   /** L1Topo ROD */
-  log << MSG::VERBOSE << "   Dumping L1Topo RoI words" << endreq;
+  ATH_MSG_VERBOSE( "   Dumping L1Topo RoI words" );
   const std::vector< ROIB::L1TopoResult >& l1TopoResultVector = result->l1TopoResult();
-  log << MSG::VERBOSE << "   Dumping L1Topo RoI words for " << l1TopoResultVector.size() << " RODs:" << endreq;
+  ATH_MSG_VERBOSE( "   Dumping L1Topo RoI words for " << l1TopoResultVector.size() << " RODs:" );
   unsigned int slink(0);
   for (auto & l1tr : l1TopoResultVector){
     uint32_t sourceID = l1tr.rdo().getSourceID(); // needs to be a 16-bit module ID
-    log << MSG::VERBOSE << "  for L1Topo source ID from RDO "  << L1Topo::formatHex8(sourceID) << endreq;
+    ATH_MSG_VERBOSE( "  for L1Topo source ID from RDO "  << L1Topo::formatHex8(sourceID) );
     if (sourceID == 0 && slink < m_l1TopoModuleID.size()){
       sourceID = eformat::helper::SourceIdentifier( eformat::TDAQ_CALO_TOPO_PROC, m_l1TopoModuleID.at(slink) ).code();
-      log << MSG::DEBUG << "  (source ID in L1TopoRDO was zero so using Property for slink " << slink << ": " << L1Topo::formatHex8(sourceID) << ")" << endreq;
+      ATH_MSG_DEBUG("  (source ID in L1TopoRDO was zero so using Property for slink " << slink << ": " << L1Topo::formatHex8(sourceID) << ")");
     } 
     else if (sourceID == 0){
       sourceID=eformat::helper::SourceIdentifier( eformat::TDAQ_CALO_TOPO_PROC, 0 ).code();
-      log << MSG::WARNING << "  (source ID in L1TopoRDO was zero, no properties available for slink counter " << slink << ", so as a fall back, constructed module 0 with source ID " << L1Topo::formatHex8(sourceID) << ")" << endreq;
+      ATH_MSG_WARNING("  (source ID in L1TopoRDO was zero, no properties available for slink counter " << slink << ", so as a fall back, constructed module 0 with source ID " << L1Topo::formatHex8(sourceID) << ")");
     }
     theROD = m_fea.getRodData( sourceID );
     for ( auto & word : l1tr.rdo().getDataWords()){
-      log << MSG::VERBOSE << "     " << MSG::hex << std::setw(8) << std::showbase << word << std::noshowbase << std::dec << endreq;
+      ATH_MSG_VERBOSE("     " << MSG::hex << std::setw(8) << std::showbase << word << std::noshowbase << std::dec);
       theROD->push_back(word);
     }
     ++slink;
   }
   /** now fill them into the RawEvent re */
-  log << MSG::DEBUG << "Now filling the event with the RoI Builder fragments" << endreq;
+  ATH_MSG_DEBUG("Now filling the event with the RoI Builder fragments");
+  MsgStream log( msgSvc(), name() );
   m_fea.fill( re, log );
 
   return StatusCode::SUCCESS;
diff --git a/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt b/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
index be0f9ae673930f2010193b3dbe9254f36fce7bb7..59ee2239d2defa47142ddbd5ec4a29aca560b433 100644
--- a/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
+++ b/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
@@ -19,7 +19,6 @@ find_package( CLHEP )
 # Component(s) in the package:
 atlas_add_library( IDScanZFinderLib
                    src/*.cxx
-                   src/components/*.cxx
                    PUBLIC_HEADERS IDScanZFinder
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
diff --git a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
index 7fb28bd00e86851003edc6ecbf26bda63aaa5eb0..f6edcff4710499a8a787a75229d16f1c9170c62d 100755
--- a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
+++ b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
@@ -164,25 +164,19 @@ StatusCode IDScanZFinder::finalize() {
 
 TrigVertexCollection* IDScanZFinder::findZ( const std::vector<const TrigSiSpacePoint *>& spVec, const IRoiDescriptor& roi)
 {
-  MsgStream athenaLog( msgSvc(), name() );
 
   TrigVertexCollection* output = new TrigVertexCollection;
   //  int outputLevel = msgSvc()->outputLevel( name() );
 
   std::vector<vertex>* vertices = findZInternal( spVec, roi);
-  //athenaLog << MSG::INFO << "RoI: " << *RoI << endreq;
-  //athenaLog << MSG::INFO << "RoI->phi0(): " << RoI->phi0() << endreq;
-
 
-  athenaLog << MSG::DEBUG << "roi: "    << roi << endreq;
-  athenaLog << MSG::DEBUG << "m_NumPhiSlices: " << m_NumPhiSlices << endreq;
+  ATH_MSG_DEBUG("roi: "    << roi);
+  ATH_MSG_DEBUG("m_NumPhiSlices: " << m_NumPhiSlices);
  
 
   if ( GetInternalStatus()==-1 ) { 
-    //    athenaLog << MSG::ERROR << "phi of spacepoint out of range!" << endreq;
-    //    athenaLog << MSG::ERROR << "Exiting ZFinder..." << endreq;
-    athenaLog << MSG::WARNING << "phi of spacepoint out of range! phi=" << GetReturnValue() << endreq;
-    athenaLog << MSG::WARNING << "Exiting ZFinder..." << endreq;
+    ATH_MSG_WARNING("phi of spacepoint out of range! phi=" << GetReturnValue());
+    ATH_MSG_WARNING("Exiting ZFinder...");
   }
 
   for ( unsigned int i=0 ; i<vertices->size() ; i++ ) { 
diff --git a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
index e0bbdc4c66a845d29c19ddbb75148b1e01e08b34..8f2f15a6ec2ab644eb04507708d140a96677482f 100755
--- a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
+++ b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
@@ -177,19 +177,18 @@ StatusCode TrigZFinder::finalize() {
 
 TrigVertexCollection* TrigZFinder::findZ( const std::vector<TrigSiSpacePointBase>& spVec, const IRoiDescriptor& roi)
 {
-  MsgStream athenaLog( msgSvc(), name() );
 
   TrigVertexCollection* output = new TrigVertexCollection;
 
   std::vector<vertex>* vertices = findZInternal( spVec, roi);
 
-  athenaLog << MSG::DEBUG << "roi: "    << roi << endmsg;
-  athenaLog << MSG::DEBUG << "m_NumPhiSlices: " << m_NumPhiSlices << endmsg;
+  ATH_MSG_DEBUG("roi: "    << roi);
+  ATH_MSG_DEBUG("m_NumPhiSlices: " << m_NumPhiSlices);
  
 
   if ( GetInternalStatus()==-1 ) { 
-    athenaLog << MSG::WARNING << "phi of spacepoint out of range! phi=" << GetReturnValue() << endmsg;
-    athenaLog << MSG::WARNING << "Exiting ZFinder..." << endmsg;
+    ATH_MSG_WARNING("phi of spacepoint out of range! phi=" << GetReturnValue());
+    ATH_MSG_WARNING("Exiting ZFinder...");
   }
 
   for ( unsigned int i=0 ; i<vertices->size() ; i++ ) { 
diff --git a/Trigger/TrigTools/TrigInDetConf/python/HypoAlgCfgble.py b/Trigger/TrigTools/TrigInDetConf/python/HypoAlgCfgble.py
index 6f93d113d5001f384df9480f4623381c1bd3ecbd..e19afc337da319c3a6f890866db562741257e6ab 100644
--- a/Trigger/TrigTools/TrigInDetConf/python/HypoAlgCfgble.py
+++ b/Trigger/TrigTools/TrigInDetConf/python/HypoAlgCfgble.py
@@ -1,16 +1,4 @@
 # Copyright (C) 1995-2017 CERN for the benefit of the ATLAS collaboration
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
 
 from TrigFTKHypo.TrigFTKHypoConf import TrigFTKAvailableHypo
 
diff --git a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetFTKSequence.py b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetFTKSequence.py
index b7298de908165880ed79cef4dc17130b733ba45c..8fad32587ff38fcfd522e5ce5e6f3a034faabfa6 100644
--- a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetFTKSequence.py
+++ b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetFTKSequence.py
@@ -14,7 +14,6 @@ class TrigInDetFTKSequence(TrigInDetSequence):
   def __init__(self,
                signatureName="Electron",
                signature="electron", 
-               #sequenceType="",
                sequenceFlavour=[""]):
 
     TrigInDetSequenceBase.__init__(self)
@@ -24,8 +23,11 @@ class TrigInDetFTKSequence(TrigInDetSequence):
     self.__sequenceFlavour__  = sequenceFlavour
     self.__step__ = [signature]
 
+    if type(sequenceFlavour)!=type(list()):
+      log.error("TrigInDetFTKSequence invoked with a non-list sequenceFlavour argument %s" )
+      
 
-    if self.__sequenceFlavour__ =="2step":
+    if "2step" in self.__sequenceFlavour__:
       if self.__signature__ == "tau":
         self.__step__ = ["tauCore","tauIso","tau"]; 
       elif self.__signature__ == "muon":
@@ -57,28 +59,24 @@ class TrigInDetFTKSequence(TrigInDetSequence):
     ftfname = "TrigFastTrackFinder_"+suffix;
     cnvname = "InDetTrigTrackingxAODCnv_%s_"+suffix;
 
+    #start filling sequences
 
-    algos = list()
-
+    algos = [("IDTrigRoiUpdater", roiupdater)]
+    algos += [("FTK_TrackMaker", "")]
+    algos += [("TrigFTKAvailable", "")]
 
-    #the first step can be FTK only vertexing
     if "FTKVtx" in sequenceFlavour:
       algos += [("TrigFTK_VxPrimary","")]
-
       fullseq.append(algos)
+      algos = list()
 
 
-    #always run FTF
-    algos = [("IDTrigRoiUpdater", roiupdater)]
-    algos += [("FTK_TrackMaker", "")]
-    algos += [("TrigFTKAvailable", "")]
     algos += [("TrigFastTrackFinder",ftfname),
               ("InDetTrigTrackingxAODCnv",cnvname),
               ]
     fullseq.append(algos)
 
 
-
     if "PT" in sequenceFlavour:
       algos = list()
 
diff --git a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py
index d3bf01890c8ee618fe5080b715220ca1f66d04ea..e370ae3545f8bbda145b47ba1c6370acf5e9f82e 100644
--- a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py
+++ b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py
@@ -173,7 +173,7 @@ class TrigInDetSequence(TrigInDetSequenceBase):
                signatureName="Electron",
                signature="electron", 
                sequenceType="IDTrig",
-               sequenceFlavour="Fast"):
+               sequenceFlavour=["Fast"]):
 
     TrigInDetSequenceBase.__init__(self)
     self.__signatureName__ = signatureName
@@ -182,7 +182,11 @@ class TrigInDetSequence(TrigInDetSequenceBase):
     self.__sequenceFlavour__  = sequenceFlavour
     self.__step__ = [signature]
 
-    if self.__sequenceFlavour__ =="2step":
+    if type(sequenceFlavour)!=type(list()):
+      log.error("TrigInDetSequence invoked with a non-list sequenceFlavour argument %s" )
+
+
+    if "2step" in self.__sequenceFlavour__:
       if self.__signature__ == "tau":
         self.__step__ = ["tauCore","tauIso","tau"]; 
       elif self.__signature__ == "muon":
@@ -206,7 +210,7 @@ class TrigInDetSequence(TrigInDetSequenceBase):
     cnvname = "InDetTrigTrackingxAODCnv_%s_FTF"
     cnvptname = ""
 
-    if sequenceFlavour=="2step":
+    if "2step" in self.__sequenceFlavour__:
       ftfname = "TrigFastTrackFinder_%sCore";  ftf2name = "TrigFastTrackFinder_%sIso"; 
       cnvname = "InDetTrigTrackingxAODCnv_%sCore_FTF";  cnv2name = "InDetTrigTrackingxAODCnv_%sIso_FTF";  
       roiupdater = "IDTrigRoiUpdater_%sCore_IDTrig";  roi2updater="IDTrigRoiUpdater_%sIso_IDTrig"
@@ -237,7 +241,7 @@ class TrigInDetSequence(TrigInDetSequenceBase):
         if vertexXAODCnvNeeded(): 
           algos += [("InDetTrigVertexxAODCnv","")]
 
-      if sequenceFlavour=="2step" and self.__signature__=="bjet":
+      if "2step" in self.__sequenceFlavour__ and self.__signature__=="bjet":
         algos += [("TrigVxPrimary","")]
         if vertexXAODCnvNeeded(): 
            algos += [("InDetTrigVertexxAODCnv","")]
@@ -245,7 +249,7 @@ class TrigInDetSequence(TrigInDetSequenceBase):
       fullseq.append(algos)
  
 
-      if sequenceFlavour=="2step":
+      if "2step" in self.__sequenceFlavour__:
         algos = [("IDTrigRoiUpdater", roi2updater)]
         algos += dataprep
         algos += [("TrigFastTrackFinder",ftf2name),
@@ -254,20 +258,23 @@ class TrigInDetSequence(TrigInDetSequenceBase):
         fullseq.append(algos)
 
 
-      if sequenceFlavour != "FTF":
+      if not ("FTF" in self.__sequenceFlavour__):
         algos = [("TrigAmbiguitySolver",""),
                  ("TRTDriftCircleMaker",""),
                  ("InDetTrigPRD_MultiTruthMaker",""), 
                  ("TRTTrackExtAlg",""),
                  ("TrigExtProcessor",""),
-                 #("InDetTrigTrackSlimmer",""),
                  ("InDetTrigTrackingxAODCnv",cnvptname),
                  ("InDetTrigDetailedTrackTruthMaker",""),
-                 #("TrigVxPrimary",""),
-                 #("InDetTrigParticleCreation",""),
-                 #("InDetTrigTrackParticleTruthMaker",""),
-                 #("InDetTrigVertexxAODCnv","")
                  ]
+        if 'noTRT' in self.__sequenceFlavour__:
+          algos = [("TrigAmbiguitySolver",""),
+                   ("InDetTrigPRD_MultiTruthMaker",""), 
+                   ("InDetTrigTrackingxAODCnv",cnvptname),
+                   ("InDetTrigDetailedTrackTruthMaker",""),
+                   ]
+
+
         if self.__signature__ != "bjet":
           algos += [("TrigVxPrimary","")]
           if vertexXAODCnvNeeded(): 
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h b/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
index c744a43427f4e2d3934f2e73ab75fca3fbe386a4..d1bd0872a7db94060eeea59dd7919c6fb672bd0a 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
@@ -469,11 +469,7 @@ private:
   void storeTriplets(INTERNAL_TRIPLET_BUFFER&);
 
   const TrigCombinatorialSettings& m_settings;
-  int m_maxSoaSize;
-  double m_maxOuterRadius;
-  //double m_minRadius, m_maxRadius, m_radBinWidth;
   double m_phiSliceWidth;
-  //int m_nMaxRadBin;
   double m_minDeltaRadius, m_maxDeltaRadius, m_zTol;
 
   L_PHI_STORAGE* m_pStore;
@@ -492,4 +488,4 @@ private:
   std::vector<int> m_innerMarkers, m_outerMarkers;
 } TRIG_TRACK_SEED_GENERATOR;
 
-#endif
+#endif // not TRIGINDETPATTRECOTOOLS_TRIGTRACKSEEDGENERATOR_H
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
index a6361ea6399f71f5e0b7e5e9ece0ea1c98877d85..d89edcb0227678f3aeb88482a047ce587c8dcfb7 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/src/TrigTrackSeedGenerator.cxx
@@ -16,10 +16,6 @@
 
 TrigTrackSeedGenerator::TrigTrackSeedGenerator(const TrigCombinatorialSettings& tcs) 
   : m_settings(tcs), 
-    m_maxSoaSize(1000),
-    m_maxOuterRadius(550.0), 
-    //  m_minRadius(10.0),
-    // m_maxRadius(600.0), 
     m_minDeltaRadius(10.0), 
     m_zTol(3.0), 
     m_pStore(NULL)
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_BeamspotSlice.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_BeamspotSlice.py
index 286535143adcb46fb4e2bb0d153bb3f1b4d72549..ba1f426d79bfe2e50be2e6dc6658d16057e8252c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_BeamspotSlice.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_RTT_topOptions_BeamspotSlice.py
@@ -48,12 +48,8 @@ include("TrigInDetValidation/TrigInDetValidation_RTT_Common.py")
 topSequence.TrigSteer_HLT.terminateAlgo.Prescale=1.
 
 if 'fastZFinder' in dir() and fastZFinder==True:
-  FTF = topSequence.TrigSteer_HLT.TrigFastTrackFinder_BeamSpot_IDTrig
-
-  # set fast ZFinder settings here
-  # from AthenaCommon.ConfigurableDb import getConfigurable
-  # zfinder = getConfigurable("TrigZFinder")
-  zfinder = FTF.trigZFinder
+  from AthenaCommon.AppMgr import ToolSvc
+  zfinder = ToolSvc.TrigZFinder
 
   zfinder.NumberOfPeaks = 4
   zfinder.TripletMode = 1
@@ -63,6 +59,5 @@ if 'fastZFinder' in dir() and fastZFinder==True:
   zfinder.MinVtxSignificance = 10
   zfinder.Percentile = 0.95
 
+  print 'zfinder settings modified by TrigInDetValidation_RTT_topOptions_BeamspotSlice.py'
   print zfinder
-
-
diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf b/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf
index 93a72ef8fbf97bdd5f5b976a07d1f89cf5b95256..a0f9c9a5146d342aca8b2992020c4370c2282a6a 100644
--- a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf
+++ b/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf
@@ -15,7 +15,7 @@ test 1
   name HelloWorldHLT
   doc HelloWorld in athenaHLT
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -n 10 -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py
+  athena_cmd athenaHLT.py -n 10 -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py
 
 test 2
   name HelloWorldHLT_run_stop_run
@@ -24,7 +24,7 @@ test 2
   checklog --config checklogTrigP1Test.conf --showexcludestats 
   customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root
   extra_failure_codes ROOTCOMP_MISMATCH  
-  athena_cmd athenaHLT.py -i -M --rewind -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py
+  athena_cmd athenaHLT.py -i -M --rewind -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py
 
 test 3
   name MTMonHistOH
@@ -63,7 +63,7 @@ test 13
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.reference
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.root
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.root 1 HLT
-  athena_cmd athenaHLT.py   -o HLT_physicsV7_rerunLVL1  -n 25 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py   -o HLT_physicsV7_rerunLVL1  -n 25 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 #  post_command save_to_refdir.sh HLT_physicsV7_rerunLVL1._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S
   post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference 
@@ -103,7 +103,7 @@ test 17
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.reference
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root 1 HLT
-  athena_cmd athenaHLT.py   -o HLT_physicsV6  -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data   -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py   -o HLT_physicsV6  -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data   -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 #  post_command save_to_refdir.sh HLT_physicsV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S  --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs
   post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference 
@@ -131,7 +131,7 @@ test 11
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.reference
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root 1 HLT
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root 
-  athena_cmd athenaHLT.py -o HLT_mcV5 -n 75  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV5=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
+  athena_cmd athenaHLT.py -o HLT_mcV5 -n 75  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV5=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
 #  post_command save_to_refdir.sh HLT_mcV5._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S
 
@@ -148,7 +148,7 @@ test 12
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.reference
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root 1 HLT
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root 
-  athena_cmd athenaHLT.py -o HLT_mcV6 -n 50  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
+  athena_cmd athenaHLT.py -o HLT_mcV6 -n 50  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
 #  post_command save_to_refdir.sh HLT_mcV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S
 
@@ -185,7 +185,7 @@ test 22
   fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1BS_standalone.reference
   rootcomp ../HLT_physicsV7/expert-monitoring.root expert-monitoring.root
   checkcount ../HLT_physicsV7/expert-monitoring.root 0 BOTH 
-  athena_cmd athena.py -c "BSRDOInput='root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data';testPhysicsV7=True;writeBS=True;rerunLVL1=True;doValidation=True;EvtMax=25" TriggerRelease/runHLT_standalone.py
+  athena_cmd athena.py -c "BSRDOInput='root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data';testPhysicsV7=True;writeBS=True;rerunLVL1=True;doValidation=True;EvtMax=25" TriggerRelease/runHLT_standalone.py
   post_command chainDump.py -n -S  --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs
 
 
@@ -376,7 +376,7 @@ test 61
   name HLT_physicsV7_menu
   doc Run athenaHLT on all events to create trigger configuration
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_EnhancedBias.merge.RAW._lb0150._SFO-2._0001.1 -o HLT_physicsV7_menu  -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_menu  -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 test 62
   name UploadMenuKeys
@@ -390,7 +390,7 @@ test 62
 test 63
   name HLT_physicsV7_rerun 
   doc Recreate trigger configuration and compare with configuration from HLT_physicsV7_menu
-  athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_EnhancedBias.merge.RAW._lb0150._SFO-2._0001.1 -o HLT_physicsV7_rerun -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_rerun -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 
 test 64
@@ -414,7 +414,7 @@ test 65
   rootcomp   ../HLT_physicsV7_menu/r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000000_part_athenaHLT_mon_HLT-Histogramming.root
   extra_failure_codes ROOTCOMP_MISMATCH  
   pre_condition test -e ../UploadMenuKeys/exportMenuKeys.sh
-  athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_EnhancedBias.merge.RAW._lb0150._SFO-2._0001.1  -oHLT_physicsV7_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}"
+  athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV7_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}"
   post_command chainDump.py -n -S
   post_test RunMsg check_msg_stat.py --showignored --config checkMsgStat_TrigP1Test.conf $logfile
 
@@ -426,7 +426,7 @@ test 66
   pre_condition test -e ../UploadMenuKeys/prescales.txt
   pre_command ln -sf ../UploadMenuKeys/prescales.txt
   pre_command get_files -jo testPrescaleChange_postconfig.py
-  athena_cmd source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -Z TrigP1Test.PrescaleChange -C 'include("testPrescaleChange_postconfig.py");fpeAuditor=True' -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00307126.physics_EnhancedBias.merge.RAW._lb0150._SFO-2._0001.1 -J TrigConf::HLTJobOptionsSvc --use-database "DBServer=TRIGGERDBATN:Instance=L2:DBSMKey=${smk}:DBHLTPSKey=${hltpsk}:DBLVL1PSKey=${l1psk}"
+  athena_cmd source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -Z TrigP1Test.PrescaleChange -C 'include("testPrescaleChange_postconfig.py");fpeAuditor=True' -f root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -J TrigConf::HLTJobOptionsSvc --use-database "DBServer=TRIGGERDBATN:Instance=L2:DBSMKey=${smk}:DBHLTPSKey=${hltpsk}:DBLVL1PSKey=${l1psk}"
 
 test 67
   name TriggerDBAccessTest
@@ -441,7 +441,7 @@ test 71
   name HLT_physicsV7_rerunLVL1_menu
   doc Run athenaHLT on all events to create trigger configuration
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -M -n 25  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_rerunLVL1_menu  -c 'doDBConfig=True;testPhysicsV7=True;rerunLVL1=True;trigBase="Default";enableCostForCAF=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -M -n 25  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_rerunLVL1_menu  -c 'doDBConfig=True;testPhysicsV7=True;rerunLVL1=True;trigBase="Default";enableCostForCAF=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 test 72
   name UploadMenuKeys_rerunLVL1
@@ -459,7 +459,7 @@ test 73
   rootcomp   ../HLT_physicsV7_rerunLVL1_menu/r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000000_part_athenaHLT_mon_HLT-Histogramming.root
   extra_failure_codes ROOTCOMP_MISMATCH  
   pre_condition test -e ../UploadMenuKeys_rerunLVL1/exportMenuKeys.sh
-  athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys_rerunLVL1/exportMenuKeys.sh; athenaHLT.py -M -n 25 -f  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV7_rerunLVL1_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}"
+  athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys_rerunLVL1/exportMenuKeys.sh; athenaHLT.py -M -n 25 -f  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV7_rerunLVL1_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}"
   post_command chainDump.py -n -S
   post_test RunMsg check_msg_stat.py --showignored --config checkMsgStat_TrigP1Test.conf $logfile
 
@@ -516,7 +516,7 @@ test 100
   customregtest regtest_multirun.sh atn_test.log
   customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root
   extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED  
-  athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 
 #############################################################################################
@@ -544,7 +544,7 @@ test 112
   customregtest regtest_multirun.sh atn_test.log 1 3
   customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000002_part_athenaHLT_mon_HLT-Histogramming.root
   extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED  
-  athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
   
 
 test 113
@@ -553,7 +553,7 @@ test 113
   filterlog filterREGTEST.py
   checklog --config checklogTrigP1Test.conf --showexcludestats
   # DO NOT change the number of events for this test
-  athena_cmd athenaHLT.py -Z TrigP1Test.BeamSpotUpdate -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;doValidation=True;BeamspotFromSqlite=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -Z TrigP1Test.BeamSpotUpdate -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;doValidation=True;BeamspotFromSqlite=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 test 114
   name HLT_physicsV6_nocache
@@ -598,13 +598,13 @@ test 130
   name HLT_mcV6_caf
   doc athenaHLT on data with MC_pp_V6 menu for caf reprocessing  
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data  -oHLT_mcV6_caf  -c 'testMCV6=True;caf=True;trigBase="Default";doDBConfig=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data  -oHLT_mcV6_caf  -c 'testMCV6=True;caf=True;trigBase="Default";doDBConfig=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 test 131
   name HLT_physicsV6_caf
   doc athenaHLT on data with Physics_pp_V6 menu for caf reprocessing  
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV6_caf  -c 'testPhysicsV6=True;caf=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV6_caf  -c 'testPhysicsV6=True;caf=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 
 test 132
   name PrepareMenuKeys_physicsV6_caf
@@ -668,7 +668,7 @@ test 160
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.reference
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root 1 L2
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root
-  athena_cmd athenaHLT.py -o HLT_HIV3 -n 25 -f  '/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_hi.00287270.physics_HardProbes.daq.RAW._lb0122._SFO-1._0001.data' -c 'testHIV3=True;rerunLVL1=False;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -o HLT_HIV3 -n 25 -f  '/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_hi.00287270.physics_HardProbes.daq.RAW._lb0122._SFO-1._0001.data' -c 'testHIV3=True;rerunLVL1=False;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import GeometryFlags;GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py
 #  post_command save_to_refdir.sh HLT_HIV3._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S
 
@@ -703,7 +703,7 @@ test 164
   name AthenaTrigBS_L2EFMerging
   doc testing trigger results w/wo merging L2/EF, based on AthenaTrigRDO with run_standalone.py
   joboptions testAthenaL2EFMerging.py
-  athena_args -c 'EvtMax=15; testPhysicsV7=True; BSRDOInput="root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data"' 
+  athena_args -c 'EvtMax=15; testPhysicsV7=True; BSRDOInput="root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data"' 
   #athena_args -c 'doHLT=True; useCONDBR2=False; setGlobalTag="COMCOND-HLTP-004-03-VAL-01"; setDetDescr="ATLAS-R1-2012-02-01-00"; EvtMax=15; testPhysicsV6=True; BSRDOInput="root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data"'
   checklog --config checklogTriggerTest.conf --showexcludestats
   checkmerge expert-monitoring.root /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigBS_L2EFMerging.root 0 
@@ -718,7 +718,7 @@ test 170
   doc athenaHLT on data with Physics_pp_v6 menu, test output of DataScouting containers 
   filterlog filterREGTEST.py
   checklog --config checklogTrigP1Test.conf --showexcludestats
-  athena_cmd athenaHLT.py -n50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o ds_test_data_out -c 'testJet=True;testMuon=True;testPhysicsV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py -n50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o ds_test_data_out -c 'testJet=True;testMuon=True;testPhysicsV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
   post_command trigbs_dumpHltDsData.py -v1 ds_test_data_out._0001.data >> atn_test.log
 
 ################################################################################
@@ -733,7 +733,7 @@ test 180
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.reference
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.root 1 HLT
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.root 
-  athena_cmd athenaHLT.py -o HLT_mcV7 -n 50  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
+  athena_cmd athenaHLT.py -o HLT_mcV7 -n 50  -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py 
   post_command chainDump.py -n -S
 
 test 181
@@ -744,7 +744,7 @@ test 181
   fullregtest REGTEST  /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.reference
   rootcomp   /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.root
   checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.root 1 HLT
-  athena_cmd athenaHLT.py   -o HLT_physicsV7  -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data   -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
+  athena_cmd athenaHLT.py   -o HLT_physicsV7  -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data   -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py
 #  post_command save_to_refdir.sh HLT_physicsV7._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest
   post_command chainDump.py -n -S  --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs
   post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference 
diff --git a/Trigger/TrigValidation/TrigP1Test/share/testAthenaP1ESD_TrigDecTool.py b/Trigger/TrigValidation/TrigP1Test/share/testAthenaP1ESD_TrigDecTool.py
index 11f924c150bb9f9a2b93cb3075086c447eb67f8f..04367fd068d702d5b6824eca9651f395bfe1d5c4 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/testAthenaP1ESD_TrigDecTool.py
+++ b/Trigger/TrigValidation/TrigP1Test/share/testAthenaP1ESD_TrigDecTool.py
@@ -89,6 +89,7 @@ TrigDecChecker.MonitoredChains=[]
 from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
 tdt = Trig__TrigDecisionTool("TrigDecisionTool")
 ToolSvc += tdt
+ToolSvc.TrigDecisionTool.TrigConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"
 
 
 from TrigEDMConfig.TriggerEDM import EDMLibraries
diff --git a/Trigger/TrigValidation/TrigP1Test/share/testCheckKeys.sh b/Trigger/TrigValidation/TrigP1Test/share/testCheckKeys.sh
index d14d6edd70cc96e21632a56a4c143dd482919f50..64f6a587537d598aad45b3df4e54655d85d375fb 100755
--- a/Trigger/TrigValidation/TrigP1Test/share/testCheckKeys.sh
+++ b/Trigger/TrigValidation/TrigP1Test/share/testCheckKeys.sh
@@ -3,23 +3,17 @@
 echo 'Testing duplicate key upload'
 if [ $# -ge 1 ]; then
    type=$1
-   echo "Trying to upload Menu generated with tests with "${type}"_menu and "${type}"_rerun in name" 
+   echo "Compare upload of Menus generated with tests with "${type}"_menu and "${type}"_rerun in name" 
 else
    type=""
 fi
 
 #setup the TT
-get_files -data -symlink TrigDb.jar
-get_files -data -symlink TriggerTool.jar
-export JAVA_VER="1.8.0"
-source /afs/cern.ch/sw/lcg/external/Java/bin/setup.sh
-export _JAVA_OPTIONS="-Xms256m -Xmx1048m"
+export _JAVA_OPTIONS="-Xms512m -Xmx1048m"
 export DBConn="TRIGGERDBATN"
 
-export TDAQ_VERSION="tdaq-07-01-00"
-export TDAQ_RELEASE_BASE=/afs/cern.ch/atlas/project/tdaq/prod
-export TDAQ_DB_PATH=/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/installed/share/data:/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/installed/databases:/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/databases
-source $TDAQ_RELEASE_BASE/../cmake/cmake_tdaq/bin/cm_setup.sh $TDAQ_VERSION
+export PATH=$PATH:$TDAQ_JAVA_HOME/bin
+
 export TNS_ADMIN=/afs/cern.ch/atlas/offline/external/oracle/latest/admin
 
 ##get the right pattern to load Lvl1 xml file
@@ -44,28 +38,37 @@ l1menu=`find .  -name LVL1config_${stump}.xml`
 get_files -xmls -copy L1Topoconfig_"${stump}".xml 
 l1topo=`find .  -name L1Topoconfig_${stump}.xml`
 
-#prepare files for first key: l2 and ef menus are the same (full menu)
-hltmenu1=`find ../"${type}"_menu/ -name outputHLTconfig_\*.xml`
-
+# removing first upload from this test to reduce impact of atn walltime limitation (ATR-13768)
+# - depending on implementation in ART may want to be done explicitly here
+### #prepare files for first key: l2 and ef menus are the same (full menu)
+### hltmenu1=`find ../"${type}"_menu/ -name outputHLTconfig_\*.xml`
 
-# copy the setup files to the local directory to have tests independent of each other
-cp ../"${type}"_menu/ef_Default_setup.txt ../"${type}"_menu/ef_Default_setup_setup.txt .
-ConvertHLTSetup_txt2xml.py ef_Default_setup.txt ef_Default_setup_setup.txt > convertHLT1
-hlt__setup1=ef_Default_setup.xml
+# removing first upload from this test to reduce impact of atn walltime limitation (ATR-13768)
+# - Needs restoring if diff of setup files is re-enabled at the end of the test
+# - depending on implementation in ART may want to be done explicitly here
+### # copy the setup files to the local directory to have tests independent of each other
+### cp ../"${type}"_menu/ef_Default_setup.txt ../"${type}"_menu/ef_Default_setup_setup.txt .
+### ConvertHLTSetup_txt2xml.py ef_Default_setup.txt ef_Default_setup_setup.txt > convertHLT1
+### hlt__setup1=ef_Default_setup.xml
 
 # get dtd file for L1 menu
 get_files -xmls LVL1config.dtd
 
+# removing first upload from this test to reduce impact of atn walltime limitation (ATR-13768)
+# - depending on implementation in ART may want to be done explicitly here
+### #upload the first key
+### echo "upload the first key"
+### 
+### cmd1="/afs/cern.ch/user/a/attrgcnf/public/TriggerTool/cmake/run_TriggerTool_MenuExperts.sh -up -release 'AthenaP1' --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu1 --hlt_setup $hlt__setup1 --name 'AthenaP1Test' -l INFO --dbConn $DBConn -w_n 60 -w_t 60 "
+### 
+### echo $cmd1
+### eval $cmd1 &> uploadSMK1.log
 
-#upload the first key
-echo "upload the first key"
-
-#cmd1="java -Duser.timezone=CET -cp \"*:$TDAQ_CLASSPATH\" triggertool.TriggerTool -up -release 'P1HLT' --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu1 --hlt_setup $hlt__setup1 --name 'P1HLTtest' -l INFO --dbConn $DBConn -w_n 60 -w_t 60 "
-
-
-echo $cmd1
-eval $cmd1 &> uploadSMK1.log
-
+# with the first upload removed obtain the files from the test UploadMenuKeys
+echo "copy output from UploadMenuKeys test"
+cp ../UploadMenuKeys/uploadSMK.log uploadSMK1.log
+cp ../UploadMenuKeys/MenusKeys.txt .
+# now continue as if had done the first upload
 
 if [ ! -f MenusKeys.txt ]
 then
@@ -91,13 +94,11 @@ hlt__setup2=ef_Default_setup_rerun.xml
 #upload the second key
 echo "upload the second key"
 
-cmd2="java -Duser.timezone=CET -cp \"*:$TDAQ_CLASSPATH\" triggertool.TriggerTool -up -release 'P1HLT' --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu2 --hlt_setup $hlt__setup2 --name 'P1HLTtest' -l INFO --dbConn $DBConn -w_n 60 -w_t 60 "
+cmd2="/afs/cern.ch/user/a/attrgcnf/public/TriggerTool/cmake/run_TriggerTool_MenuExperts.sh -up -release 'AthenaP1' --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu2 --hlt_setup $hlt__setup2 --name 'AthenaP1Test' -l INFO --dbConn $DBConn -w_n 60 -w_t 60 "
 
 echo $cmd2 "&> uploadSMK2.log"
 eval $cmd2 &> uploadSMK2.log
 
-
-
 if [ ! -f MenusKeys.txt ]
 then
     echo '... ERROR Upload of key 2 failed'
@@ -109,16 +110,19 @@ fi
 
 mv MenusKeys.txt MenusKeys2.txt
 
+#now compare the results from the two uploads
+
 smk1=`grep SM MenusKeys1.txt | cut -f8 -d" "| cut -f1 -d":"`
 smk2=`grep SM MenusKeys2.txt | cut -f8 -d" "| cut -f1 -d":"`
 
+#file to save triggerTool diff output
 smkDiffFile=diff_smk_${smk1}_${smk2}.xml
 
-echo "diff key 1 vs key 2"
-#java -jar TriggerTool.jar -diff -smk1 $smk1 -smk2 $smk2 -name "P1HLTtest" -dbConn $DBConn -xml $smkDiffFile -w_n 50 -w_t 60
-echo "java  -Duser.timezone=CET -cp \"*:$TDAQ_CLASSPATH\" triggertool.TriggerTool -diff -smk1 $smk1 -smk2 $smk2 -name "P1HLTtest" -dbConn $DBConn -xml diff_smk_${smk1}_${smk2}.xml -w_n 50 -w_t 60"
-java -Duser.timezone=CET -cp "*:$TDAQ_CLASSPATH" triggertool.TriggerTool -diff -smk1 $smk1 -smk2 $smk2 -name "P1HLTtest" -dbConn $DBConn -xml diff_smk_${smk1}_${smk2}.xml -w_n 50 -w_t 60
+echo "use TriggerTool to diff key "${smk1}" vs key "${smk2}""
+cmd3="/afs/cern.ch/user/a/attrgcnf/public/TriggerTool/cmake/run_TriggerTool_MenuExperts.sh -diff -smk1 $smk1 -smk2 $smk2 -name 'AthenaP1Test' -dbConn $DBConn -xml $smkDiffFile -w_n 50 -w_t 60"
 
+echo $cmd3 "&> uploadSMK3.log"
+eval $cmd3 &> uploadSMK3.log
 
 
 ### # to be reworked:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/testUploadMenuKeys.sh b/Trigger/TrigValidation/TrigP1Test/share/testUploadMenuKeys.sh
index e268564fdc7633bbecd4ef4412d16b78b7027d5f..f3e726d815ce831ce39899d8d6b9ebeff5a4393b 100755
--- a/Trigger/TrigValidation/TrigP1Test/share/testUploadMenuKeys.sh
+++ b/Trigger/TrigValidation/TrigP1Test/share/testUploadMenuKeys.sh
@@ -3,23 +3,17 @@
 echo 'Testing SMKey upload'
 if [ $# -ge 1 ]; then
    type=$1
-   echo 'Trying to upload Menu generated  with test "${type}"_menu' 
+   echo "Trying to upload Menu generated  with test "${type}"_menu" 
 else
    type=""
 fi
 
 #setup the TT
-get_files -data -symlink TrigDb.jar
-get_files -data -symlink TriggerTool.jar
-export JAVA_VER="1.8.0"
-source /afs/cern.ch/sw/lcg/external/Java/bin/setup.sh
 export _JAVA_OPTIONS="-Xms512m -Xmx1048m"
 export DBConn="TRIGGERDBATN"
 
-export TDAQ_VERSION="tdaq-07-01-00"
-export TDAQ_RELEASE_BASE=/afs/cern.ch/atlas/project/tdaq/prod
-export TDAQ_DB_PATH=/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/installed/share/data:/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/installed/databases:/afs/cern.ch/atlas/project/tdaq/prod/tdaq/$TDAQ_VERSION/databases
-source $TDAQ_RELEASE_BASE/../cmake/cmake_tdaq/bin/cm_setup.sh $TDAQ_VERSION
+export PATH=$PATH:$TDAQ_JAVA_HOME/bin
+
 export TNS_ADMIN=/afs/cern.ch/atlas/offline/external/oracle/latest/admin
 
 ##get the right pattern to load LVl1 xml file
@@ -54,8 +48,6 @@ get_files -xmls -copy LVL1config_"${stump}".xml
 l1menu=`find .  -name LVL1config_${stump}.xml` 
 
 #get the L1 Topo configuration
-
-
 get_files -xmls -copy L1Topoconfig_"${stump}".xml 
 l1topo=`find . -name L1Topoconfig_${stump}.xml` 
 
@@ -83,13 +75,13 @@ get_files -xmls LVL1config.dtd
 
 
 
-p1_rel="P1HLT"
+p1_rel="AthenaP1"
 if [ $NICOS_ATLAS_RELEASE ]
 then
     p1_rel=$NICOS_ATLAS_RELEASE
 fi
 
-nightly="P1HLTTest"
+nightly="AthenaP1Test"
 if [ $NICOS_NIGHTLY_NAME ]
 then
     nightly="$NICOS_NIGHTLY_NAME"
@@ -106,7 +98,8 @@ rundate=`date +%F" "%H:%M" "`
 
 # Upload SMK
 
-cmd="java -Duser.timezone=CET -cp \"*:$TDAQ_CLASSPATH\"  triggertool.TriggerTool -up -release $p1_rel --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu1 --hlt_setup $hlt__setup1 --name 'P1HLTtest'  -l INFO --SMcomment \"${rundate}${nightly}_${rel}\" --dbConn $DBConn -w_n 50 -w_t 60"
+cmd="/afs/cern.ch/user/a/attrgcnf/public/TriggerTool/cmake/run_TriggerTool_MenuExperts.sh -up -release $p1_rel --l1_menu $l1menu --topo_menu $l1topo -hlt $hltmenu1 --hlt_setup $hlt__setup1 --name 'AthenaP1Test' -l INFO --SMcomment \"${rundate}${nightly}_${rel}\" --dbConn $DBConn -w_n 50 -w_t 60"
+
 echo $cmd "&> uploadSMK.log"
 eval $cmd &> uploadSMK.log
 
@@ -149,7 +142,7 @@ echo "Generating RuleBook_HLTPS_Physics${lumi}.xml by running\ncnvXML.py --ps_na
 cnvXML.py --ps_name=Physics${lumi} --ps_xml=prescales${lumi}.xml
 
 # Upload
-java -jar TriggerTool.jar -dbConn $DBConn -psup RuleBook_HLTPS_Physics${lumi}.xml -smk $smk -w_n 50 -w_t 60 &> uploadPSK.log
+afs/cern.ch/user/a/attrgcnf/public/TriggerTool/cmake/run_TriggerTool_MenuExperts.sh -dbConn $DBConn -psup RuleBook_HLTPS_Physics${lumi}.xml -smk $smk -w_n 50 -w_t 60 &> uploadPSK.log
 hltpsk2=`grep 'HLT Prescale set saved with id' uploadPSK.log | sed 's#.*: \([0-9]*\)\.#\1#'`
 if [ -z "$hltpsk2" ]; then
     echo "ERROR Upload of prescale key failed"
diff --git a/Trigger/TrigValidation/TrigP1Test/share/trigp1test_athenaHLT.py b/Trigger/TrigValidation/TrigP1Test/share/trigp1test_athenaHLT.py
index dbf94c9143344e17f8debbf80f62dafc7959e923..7d5125476a6d1799410d335935b42145882222b8 100755
--- a/Trigger/TrigValidation/TrigP1Test/share/trigp1test_athenaHLT.py
+++ b/Trigger/TrigValidation/TrigP1Test/share/trigp1test_athenaHLT.py
@@ -3,7 +3,7 @@
 
 from glob import glob
 from fnmatch import fnmatch
-from subprocess import Popen, PIPE, STDOUT, call
+from subprocess import Popen, PIPE, STDOUT, check_call
  
 #EOS walking Code courtesy of James Robinson
 def get_file_list( DATAPATH ) :
@@ -22,7 +22,9 @@ def get_file_list( DATAPATH ) :
           eos_ls = Popen( args = cmd, bufsize = 1, shell = False, stdout = PIPE, stderr = STDOUT )
           while eos_ls.poll() is None :
             line = eos_ls.stdout.readline()
-            if line : subdirectories.append( line.replace('\n','') )
+            if line : 
+              if not 'INFO: ' in line:
+                subdirectories.append( line.replace('\n','') )
           for subdirectory in subdirectories :
             if fnmatch( subdirectory, directory ) :
               new_paths.append( path+'/'+subdirectory )
@@ -54,8 +56,9 @@ def main():
   print subset 
 
   trigCmd = "athenaHLT.py -f \"" + str(subset) + "\" -c \"" + opts.modifiers + "\" TriggerRelease/runHLT_standalone.py"
-  call("echo " + trigCmd, shell=True)
-  call(trigCmd, shell=True)
+  trigCmdEsc = trigCmd.replace("\\","\\\\").replace("\"","\\\"")#For output to echo
+  check_call("echo \"" + trigCmdEsc + "\"", shell=True)#Call echo rather than print so that it completes first
+  check_call(trigCmd, shell=True)
 
 if __name__ == "__main__":
   main()
diff --git a/Trigger/TrigValidation/TrigP1Test/test/TrigP1Test_TestConfiguration.xml b/Trigger/TrigValidation/TrigP1Test/test/TrigP1Test_TestConfiguration.xml
index 465b7b940ae320b69cd093f4d282d4e08861a9fe..d356a88f3ebbeae28782400efef3be9126101a27 100644
--- a/Trigger/TrigValidation/TrigP1Test/test/TrigP1Test_TestConfiguration.xml
+++ b/Trigger/TrigValidation/TrigP1Test/test/TrigP1Test_TestConfiguration.xml
@@ -195,6 +195,16 @@
                 <returnValue>0</returnValue> 
             </expectations> 
         </TEST> 
+
+        <TEST name="HLT_physicsV7_FTK" type="script" suite="TP1phys2"> 
+            <options_atn>trigtest.pl --cleardir --test HLT_physicsV7_FTK --rundir HLT_physicsV7_FTK --conf TrigP1Test.conf</options_atn> 
+            <timelimit>20</timelimit> 
+            <expectations> 
+                <errorMessage>FAILURE </errorMessage> 
+                <returnValue>0</returnValue> 
+            </expectations> 
+        </TEST> 
+
         
         <TEST name="HLT_physicsV7_ALFAMon" type="script" suite="TP1phys2"> 
             <options_atn>trigtest.pl --cleardir --test HLT_physicsV7_ALFAMon --rundir HLT_physicsV7_ALFAMon --conf TrigP1Test.conf</options_atn> 
@@ -292,7 +302,7 @@
         
         <TEST name="UploadMenuKeys" type="script" suite="TP1menu">
             <options_atn>trigtest.pl --cleardir  --test UploadMenuKeys --rundir UploadMenuKeys --conf TrigP1Test.conf</options_atn>
-            <timelimit>40</timelimit>
+            <timelimit>120</timelimit>
             <platform>opt</platform>
             <nightly_exclude> MIG LCG EXP CMAKE 22 20.99 </nightly_exclude>
             <!--<mailto>joerg.stelzer@cern.ch</mailto>-->    
@@ -352,10 +362,11 @@
         
         <TEST name="UploadMenuKeys_rerunLVL1" type="script" suite="TP1menuRL1">
             <options_atn>trigtest.pl --cleardir  --test UploadMenuKeys_rerunLVL1 --rundir UploadMenuKeys_rerunLVL1 --conf TrigP1Test.conf</options_atn>
-            <timelimit>59</timelimit>
+            <timelimit>120</timelimit>
             <!--<mailto>joerg.stelzer@cern.ch</mailto>-->    
             <platform>opt</platform>
             <nightly_exclude> MIG LCG EXP CMAKE 22 20.99 </nightly_exclude>
+            <prerequisite>TP1menu</prerequisite>
             <expectations>
                 <errorMessage>FAILURE </errorMessage>
                 <returnValue>0</returnValue>
@@ -367,6 +378,7 @@
             <timelimit>59</timelimit>
             <platform>opt</platform>
             <nightly_exclude> MIG LCG EXP CMAKE 22 20.99 </nightly_exclude>
+            <prerequisite>TP1menu</prerequisite>
             <expectations>
                 <errorMessage>FAILURE </errorMessage>
                 <returnValue>0</returnValue>
@@ -579,11 +591,19 @@
                 </doc>
                 <jobTransformJobName>athenaHLT_on_data_leakCheck</jobTransformJobName>
                 <jobTransformCmd>
-                    export LD_PRELOAD=/afs/cern.ch/sw/lcg/external/libunwind/5c2cade/$CMTCONFIG/lib/libunwind.so; 
+                    export LD_PRELOAD=/cvmfs/sft.cern.ch/lcg/releases/libunwind/5c2cade-76996/$CMTCONFIG/lib/libunwind.so; 
                     athenaHLT.py --stdcmalloc --leak-check-execute  -o HLT_physicsV7  -n 25 -f '/eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW._lb0628._SFO-1._0001.1' -c "setMenu='Physics_pp_v7_tight_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');HLTOutputLevel=WARNING;doValidation=True" TrigP1Test/runHLT_standaloneRTT_leakCheck.py
                 </jobTransformCmd>
                 <group>AtlasHLTChainTest</group>
                 <queue>long</queue>
+		<testToRemove>
+                    <jobGroupName>RTT:Top</jobGroupName>
+                    <testidentifier>CheckFileRunner0</testidentifier>
+                </testToRemove>
+		<testToRemove>
+                    <jobGroupName>Athena</jobGroupName>
+                    <testidentifier>PerfMonRunner</testidentifier>
+                </testToRemove>
             </jobTransform>
             
             <jobTransform userJobId="athenaHLT_LatestRun_MCV7">
@@ -596,6 +616,11 @@
                 </jobTransformCmd>
                 <group>AtlasHLTChainTest</group>
                 <queue>long</queue>
+		<testToRemove>
+                    <jobGroupName>RTT:Top</jobGroupName>
+                    <testidentifier>CheckFileRunner0</testidentifier>
+                </testToRemove>
+
             </jobTransform>
             
             <jobTransform userJobId="athenaHLT_CostMonitoring_PhysicsV7">
@@ -604,10 +629,19 @@
                 </doc>
                 <jobTransformJobName>athenaHLT_CostMonitoring_PhysicsV7</jobTransformJobName>
                 <jobTransformCmd>
-                    athenaHLT.py -f '/eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW._lb0628._SFO-1._0001.1' -c "setMenu='Physics_pp_v7_tight_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True" TriggerRelease/runHLT_standalone.py
+                    athenaHLT.py -f '/eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1' -c "setMenu='Physics_pp_v7_unprescaled_only_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True" TriggerRelease/runHLT_standalone.py
                 </jobTransformCmd>
                 <group>AtlasHLTChainTest</group>
                 <queue>long</queue>
+		<testToRemove>
+                    <jobGroupName>RTT:Top</jobGroupName>
+                    <testidentifier>CheckFileRunner0</testidentifier>
+                </testToRemove>
+		<testToRemove>
+                    <jobGroupName>Athena</jobGroupName>
+                    <testidentifier>PerfMonRunner</testidentifier>
+                </testToRemove>
+
             </jobTransform>
             
         </jobList>
@@ -710,7 +744,7 @@
                     <jobGroupName>RTT:Top</jobGroupName>
                     <testidentifier>PerfMonDozer0</testidentifier>
                 </testToRemove>
-                
+
             </jobGroup>
 
         </jobGroups>
diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_prescaled_grid.sh b/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_prescaled_grid.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ef60621824bebc65edb167594d775101584a8f8d
--- /dev/null
+++ b/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_prescaled_grid.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# art-description: Physics pp v7 menu with athenaHLT over EnhancedBias data with prescales read in from the rulebook
+# art-type: grid
+
+echo 'ART Grid test with Physics_pp_v7 PSed menu'
+
+if ! [ -x "$(command -v athenaHLT.py)" ]; then
+  echo 'Invalid - not a P1 environment.' >&2
+  exit 0
+fi
+
+ART_dir=${PWD}
+echo 'ART_dir: '${ART_dir}
+
+MENU='Physics_pp_v7'
+echo 'Menu:' ${MENU}
+
+export ATLAS_LOCAL_ROOT_BASE="/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase"
+source $ATLAS_LOCAL_ROOT_BASE/packageSetups/localSetup.sh git
+#TODO: at the moment working on RB master
+git clone https://:@gitlab.cern.ch:8443/atlas-trigger-menu/TrigMenuRulebook.git
+#git clone /afs/cern.ch/user/t/tamartin/public/TrigMenuRulebook/
+RB_dir=${PWD}/TrigMenuRulebook
+echo 'RB_dir: '${RB_dir}
+
+
+echo 'getting L1 and L1Topo xml files'
+#get the L1 file 
+get_files -xmls -copy LVL1config_${MENU}.xml
+l1menu=`find .  -name LVL1config_${MENU}.xml` 
+#get the L1 Topo configuration
+get_files -xmls -copy L1Topoconfig_${MENU}.xml 
+l1topo=`find . -name L1Topoconfig_${MENU}.xml` 
+
+# generate only hlt xml for RB without DB access
+echo "Generating menu"
+athena.py  -c "TriggerMenuSetup='${MENU}'" TriggerMenuXML/runHLT_forXMLgeneration.py
+hltmenu=`find . -name outputHLTconfig.xml`
+
+echo 'l1menu: '${l1menu}
+echo 'l1topo: '${l1topo}
+echo 'hltmenu: '${hltmenu}
+
+cd ${RB_dir}/scripts
+
+rm -f l1.xml hlt.xml
+ln -s ${ART_dir}/${l1menu}   l1.xml
+ln -s ${ART_dir}/${hltmenu}   hlt.xml
+
+#TODO: configure RB properly, which lumi point?
+sed -i -e 's/ignoreErrors = False/ignoreErrors = True/g' runOptions.py
+./runRuleBook.py 20000
+
+cd ${ART_dir}
+
+hltPS=`find  TrigMenuRulebook/scripts -name "RuleBook_HLTPS_${MENU}_*.xml"`
+l1PS=`find  TrigMenuRulebook/scripts -name "RuleBook_LV1PS_${MENU}_*.xml"`
+
+echo "hltPS: "${hltPS}
+echo "l1PS: "${l1PS}
+
+#TODO: what to do with missing chains?
+python ${RB_dir}/scripts/apply_PS.py ${l1menu} ${l1PS} PSed_LVL1_${MENU}.xml
+python ${RB_dir}/scripts/apply_PS.py ${hltmenu} ${hltPS} PSed_HLT_${MENU}.xml
+
+athenaHLT.py -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1' -c 'setMenu="'${MENU}'";setLVL1XML="PSed_LVL1_'${MENU}'.xml"; setHLTXML="PSed_HLT_'${MENU}'.xml";rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True' TriggerRelease/runHLT_standalone.py
+export ATH_EXIT=$?
+
+chainDump.py -S --rootFile=expert-monitoring.root
+
+return $ATH_EXIT
\ No newline at end of file
diff --git a/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf b/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf
index f4e68aa8990dd5ec848dca7921eb13222d4a106f..f443ef174421fa133bf36ae7cbfb11efd8a40811 100644
--- a/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf
+++ b/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf
@@ -107,6 +107,7 @@ test 26
   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
diff --git a/Trigger/TrigValidation/TriggerTest/test/TriggerTest_TestConfiguration.xml b/Trigger/TrigValidation/TriggerTest/test/TriggerTest_TestConfiguration.xml
index 1e76c155434faaecbe7d8bf06e1e259043a83a49..74e493f68644a731be0ae894ac1cbdb68d7807dd 100755
--- a/Trigger/TrigValidation/TriggerTest/test/TriggerTest_TestConfiguration.xml
+++ b/Trigger/TrigValidation/TriggerTest/test/TriggerTest_TestConfiguration.xml
@@ -76,16 +76,6 @@
                 <returnValue>0</returnValue>
             </expectations>
         </TEST>
-        
-        <TEST name="AthenaTrigRDO_MC_pp_v6_no_prescale_toxAOD_FTK" type="script" suite="tt_25">
-            <options_atn>trigtest.pl --test AthenaTrigRDO_MC_pp_v6_no_prescale_toxAOD_FTK --run AthenaTrigRDO_MC_pp_v6_no_prescale_toxAOD_FTK --conf TriggerTest.conf</options_atn>
-            <timelimit>60</timelimit>
-            <author>Trigger Validation</author>
-            <expectations>
-                <errorMessage>FAILURE </errorMessage>
-                <returnValue>0</returnValue>
-            </expectations>
-        </TEST>
 
         <TEST name="AthenaTrigRDO_MC_pp_v7" type="script" suite="tt_26">
             <options_atn>trigtest.pl --test AthenaTrigRDO_MC_pp_v7 --run AthenaTrigRDO_MC_pp_v7 --conf TriggerTest.conf</options_atn>
diff --git a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh
index 4d46749af3c4362123d1b10cb40511314270dc4e..fa775bd490ea967b99174cc5a1573ea3015b1760 100755
--- a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh
+++ b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh
@@ -20,6 +20,7 @@ fi
 
 echo "Running checklog"
 timeout 1m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} | tee checklog.log
+
 echo "art-result: ${PIPESTATUS[0]} CheckLog"
 
 # this is RTT and will need some moving
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index 65ec9999f0bfa2ab742278975c929b140eb53846..584543b79fedf6b84f5a22a07b6e52ed53909d36 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -366,7 +366,7 @@ class OnlineCondTag(JobProperty):
     """ Default (online) HLT conditions tag """
     statusOn=True
     allowedType=['str']
-    StoredValue='CONDBR2-HLTP-2016-01'
+    StoredValue='CONDBR2-HLTP-2017-03'
 
 _flags.append(OnlineCondTag)
 
@@ -374,7 +374,7 @@ class OnlineGeoTag(JobProperty):
     """ Default (online) HLT geometry tag """
     statusOn=True
     allowedType=['str']
-    StoredValue='ATLAS-R2-2015-04-00-00'
+    StoredValue='ATLAS-R2-2016-01-00-01'
     
 _flags.append(OnlineGeoTag)
 
@@ -1043,7 +1043,11 @@ class triggerMenuSetup(JobProperty):
         'MC_HI_v4', 'MC_HI_v4_tight_mc_prescale',
 
         'MC_pp_v6','Physics_pp_v6','MC_pp_v6_no_prescale', 'MC_pp_v6_tight_mc_prescale', 'MC_pp_v6_tightperf_mc_prescale', 'MC_pp_v6_loose_mc_prescale','Physics_pp_v6_tight_physics_prescale',
-        'MC_pp_v7','Physics_pp_v7','MC_pp_v7_no_prescale', 'MC_pp_v7_tight_mc_prescale', 'MC_pp_v7_tightperf_mc_prescale', 'MC_pp_v7_loose_mc_prescale','Physics_pp_v7_tight_physics_prescale',
+        'MC_pp_v7','Physics_pp_v7','MC_pp_v7_no_prescale', 'MC_pp_v7_tight_mc_prescale', 'MC_pp_v7_tightperf_mc_prescale', 'MC_pp_v7_loose_mc_prescale','Physics_pp_v7_tight_physics_prescale','Physics_pp_v7_unprescaled_only_physics_prescale',
+
+        # -----------------------------------------------------------------
+        # Upgrade
+        'MC_PhaseII',
         ]
 
     _default_menu='MC_pp_v7_tight_mc_prescale'
diff --git a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt
index 065e931142a661cdceca1bc7be39ab2d2019a817..9134646a8bf34061cc499c1132c28fbb0384997a 100644
--- a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt
@@ -8,7 +8,7 @@ atlas_subdir( TriggerMenu )
 # Install files from the package:
 atlas_install_python_modules( python/*.py python/menu python/l1
 python/l1menu python/l1topo python/l1topomenu python/egamma
-python/muon python/jet python/bjet python/met python/tau
+python/muon python/jet python/bjet python/met python/tau python/afp
 python/minbias python/heavyion python/bphysics python/calibcosmicmon
 python/test python/combined python/commonUtils )
 atlas_install_joboptions( share/*.py )
@@ -17,10 +17,14 @@ atlas_install_xmls( data/*.dtd data/*.xml )
 
 atlas_add_test( generateMenu SCRIPT scripts/testMenu.sh 
                 PROPERTIES TIMEOUT 500 
-                POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf generateMenu.log"
+                POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf generateMenu.log" 
               )
 
 atlas_add_test ( pyflakesMenu
    SCRIPT scripts/pyflakesMenu.sh
    ENVIRONMENT "PYPATH=${CMAKE_CURRENT_SOURCE_DIR}/python ${CMAKE_CURRENT_SOURCE_DIR}/share ${CMAKE_CURRENT_SOURCE_DIR}/scripts"
 )
+
+atlas_add_test ( checkL1Menu SCRIPT scripts/checkL1Menu.sh
+   POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf checkL1Menu.log"
+)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigL1Topo.py b/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigL1Topo.py
index 6b830341ef5aa9aece406564db5b87401815e75b..1653b8d67fed072d8d4fb96026f38d1c7ed051cb 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigL1Topo.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigL1Topo.py
@@ -1,8 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from sys import settrace
-
-from l1topo.TopoAlgos import TopoAlgo
 from l1topo.L1TopoMenu import L1TopoMenu
 from l1topo.L1TopoFlags import L1TopoFlags
 
@@ -18,7 +15,6 @@ class TriggerConfigL1Topo:
         outputFile: if no input file is specified the topo menu will be generated and written to outputFile
         menuName: ignored now
         """
-        current = self
         from TriggerJobOpts.TriggerFlags import TriggerFlags
 
         self.menuName = TriggerConfigL1Topo.getMenuBaseName(TriggerFlags.triggerMenuSetup())
@@ -51,7 +47,7 @@ class TriggerConfigL1Topo:
     @staticmethod
     def getMenuBaseName(menuName):
         import re 
-        pattern = re.compile('_v\d+|DC14')
+        pattern = re.compile('_v\d+|DC14+|_PhaseII')
         patternPos = pattern.search(menuName)
         if patternPos:
             menuName=menuName[:patternPos.end()]
@@ -128,7 +124,6 @@ class TriggerConfigL1Topo:
         """
 
         menuName = TriggerConfigL1Topo.getMenuBaseName(menuName)
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
         menumodule = __import__('l1topomenu.Menu_%s' % menuName, globals(), locals(), ['defineMenu'], -1)
         menumodule.defineMenu()
         log.info("%s menu contains %i algos." % ( menuName, len(L1TopoFlags.algos()) )) 
@@ -152,11 +147,7 @@ class TriggerConfigL1Topo:
         Always to be called after defineMenu()
         """
         
-        from AthenaCommon.Logging import logging
-        log = logging.getLogger('L1Topo.generateMenu')
-
         # add the algos to the menu
-        undefined_alg = False 
         for topooutput in L1TopoFlags.algos():
             topooutput.algo = self.getRegisteredAlgo(topooutput.algoname)
             if topooutput.algo is None:
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigLVL1.py b/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigLVL1.py
index de27314421fd9201f181e508abb12c4c1029b3ee..fa4b380b06f7e2ccc074503b30a82a0d32847f0c 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigLVL1.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/TriggerConfigLVL1.py
@@ -268,7 +268,9 @@ class TriggerConfigLVL1:
                 item.setTriggerType( item.trigger_type | TT.phys )
             # assign ctp IDs to items that don't have one
             if item.ctpid == -1:
-                item.setCtpid( available_ctpids.pop() )
+                the_id = available_ctpids.pop()
+                log.warning('LVL1 item %s is being assigned ctpid=%d' % (item.name,  the_id ))
+                item.setCtpid( the_id )
             # add the items into the menu
             self.menu.addItem( item )
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPDef.py b/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPDef.py
new file mode 100644
index 0000000000000000000000000000000000000000..53b9ad95c5d97bca3e3953162375e613caae619e
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPDef.py
@@ -0,0 +1,182 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+""" AFP slice signatures """
+
+__author__  = "L. Zivkovic, C.Bernius"
+__version__ = "" 
+__doc__="Implementation of AFP slice in new TM framework "
+##########################################################
+
+from TriggerMenu.menu.HltConfig import L2EFChainDef
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenu.afp.AFPDef")
+
+
+from TriggerMenu.menu import DictFromChainName
+
+# Jet imports
+from TriggerMenu.jet.JetDef import generateHLTChainDef
+
+# AFP imports
+from TrigAFPReco.TrigAFPRecoConfig import AFPSiTrkReco
+from TrigAFPHypo.TrigAFPJetAllTEConfig import AFPJetAllTE
+
+#############################################################################
+class L2EFChain_afp(L2EFChainDef):
+     
+    def __init__(self, chainDict):
+        
+        self.L2sequenceList   = []
+        self.EFsequenceList   = []
+        self.L2signatureList  = []
+        self.EFsignatureList  = []
+        self.TErenamingDict   = []
+
+        self.chainPart = chainDict['chainParts']
+        
+        self.chainL1Item = chainDict['L1item']        
+        self.chainPartL1Item = self.chainPart['L1item']
+        
+        self.chainCounter = chainDict['chainCounter']       
+        self.L2Name = 'L2_'+self.chainPart['chainPartName']
+        self.EFName = 'EF_'+self.chainPart['chainPartName']
+        #self.mult = int(self.chainPart['multiplicity'])
+        self.chainName = chainDict['chainName']
+        self.chainPartName = self.chainPart['chainPartName']
+
+        self.L2InputL1Item = self.chainPartL1Item or self.chainL1Item
+        if self.L2InputL1Item:
+            self.L2InputTE = ''
+
+        # Actually configure chains
+        self.createChains()
+
+        L2EFChainDef.__init__(self, self.chainName, self.L2Name, self.chainCounter, self.chainL1Item, self.EFName, self.chainCounter, self.L2InputTE)
+
+    def defineSequences(self):
+
+        for sequence in self.L2sequenceList:
+            self.addL2Sequence(*sequence)
+
+        for sequence in self.EFsequenceList:
+            self.addEFSequence(*sequence)
+                
+    def defineSignatures(self):
+       
+        for signature in self.L2signatureList:
+            self.addL2Signature(*signature)
+
+        for signature in self.EFsignatureList:
+            self.addEFSignature(*signature)
+
+    def defineTErenaming(self):
+        self.TErenamingMap = self.TErenamingDict
+
+
+    def addJetsToTrigger(self):
+        """Adds jet trigger elements to sequence and returns TE with jets.
+
+        This method adds all algorithms needed to reconstruct jets and
+        all trigger elements that are needed. It returns the last
+        trigger element in the chain which contains reconstructed
+        jets.
+
+        @return trigger element with jets
+        """
+
+        #----------------------------------------------------
+        # Obtaining the needed jet TEs from the jet code
+        #----------------------------------------------------
+
+        jetCalib    = self.chainPart['jetCalib']
+        calibration = self.chainPart['calib']
+    
+        chain = ['j0_{0}_{1}'.format(calibration, jetCalib), '', [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]
+        
+        theDictFromChainName = DictFromChainName.DictFromChainName()
+        jetChainDict = theDictFromChainName.getChainDict(chain)
+        
+        jetChainDict['chainCounter'] = 9151
+        jetChainDef = generateHLTChainDef(jetChainDict)
+        
+        #obtaining DummyUnseededAllTEAlgo/RoiCreator 
+        input0=jetChainDef.sequenceList[0]['input']
+        output0 =jetChainDef.sequenceList[0]['output']
+        algo0 =jetChainDef.sequenceList[0]['algorithm']
+        self.EFsequenceList +=[[ input0,algo0,  output0 ]]
+        self.EFsignatureList +=[[ [output0] ]]
+        
+        #obtaing TrigCaloCellMaker/FS 
+        input1=jetChainDef.sequenceList[1]['input']
+        output1 =jetChainDef.sequenceList[1]['output']
+        algo1 =jetChainDef.sequenceList[1]['algorithm']
+        self.EFsequenceList +=[[ input1,algo1,  output1 ]]
+        self.EFsignatureList +=[[ [output1] ]]
+        
+        #obtaining TrigCaloClusterMaker
+        input2=jetChainDef.sequenceList[2]['input']
+        output2 =jetChainDef.sequenceList[2]['output']
+        algo2 =jetChainDef.sequenceList[2]['algorithm']
+        self.EFsequenceList +=[[ input2,algo2,  output2 ]]
+        self.EFsignatureList +=[[ [output2] ]]
+        
+        #obtaining TrigHLTEnergyDensity
+        input3=jetChainDef.sequenceList[3]['input']
+        output3 =jetChainDef.sequenceList[3]['output']
+        algo3 =jetChainDef.sequenceList[3]['algorithm']
+        self.EFsequenceList +=[[ input3,algo3,  output3 ]]
+        self.EFsignatureList +=[[ [output3] ]]
+        
+        #obtaining TrigHLTJetRecFromCluster
+        input4=jetChainDef.sequenceList[4]['input']
+        output4 =jetChainDef.sequenceList[4]['output']
+        algo4 =jetChainDef.sequenceList[4]['algorithm']
+        self.EFsequenceList +=[[ input4,algo4,  output4 ]]
+        self.EFsignatureList +=[[ [output4] ]]
+        #---End of obtaining jet TEs------------------------------
+
+        return output4
+
+    def addAFPTracksToTrigger (self, inputTE):
+        """Adds TrigAFPSiTrkReco FEX algorithm, which reconstructs AFP tracks to the sequence.
+
+        The method returns output trigger element, but it should not
+        be used, because the AFP tracks are saved to StoreGate.
+
+        @param inputTE:  input trigger element, can be anything, because it is not used, but cannot be empty string
+        """
+        
+        outputTE='EF__afpSiTrkReco'
+        self.EFsequenceList += [[ inputTE, [AFPSiTrkReco()], outputTE ]]
+        self.EFsignatureList += [[ [outputTE ] ]]
+
+        return outputTE
+   
+
+    def addExclusiveJetAllTEToTrigger (self, inputTE):
+        """Adds TrigAFPJetAllTE, which makes vertex selection, to the sequence.
+
+        It compares proton position in AFP reconstructed using jets
+        and tracks from AFP.
+
+        @param inputTE: trigger element with jets
+
+        @return outputTE: output trigger element - currently empty
+        """
+
+        outputTE = 'EF_afpJetAllTE'
+        self.EFsequenceList += [[ inputTE, [AFPJetAllTE()], outputTE ]]
+        self.EFsignatureList += [[ [outputTE ] ]]
+
+        return outputTE
+
+    def createChains(self):
+        """craetes the chains based on trigger name.
+        """
+
+        if 'jetexc' == self.chainPart['extra']:
+            jetTE = self.addJetsToTrigger()
+            self.addAFPTracksToTrigger (jetTE)
+            self.addExclusiveJetAllTEToTrigger (jetTE)
+
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPSliceFlags.py
new file mode 100755
index 0000000000000000000000000000000000000000..16e23c7be1a2944a8f127573c171248af1ac3d7c
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/afp/AFPSliceFlags.py
@@ -0,0 +1,41 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+""" AFP slice specific flags  """
+
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
+#from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+
+# create container
+__author__  = 'L. Zivkovic'
+__version__="$Revision: 1.0 $"
+__doc__="AFP slice specific flags  "
+
+
+_flags = []
+class signatures(JobProperty):
+    """ signatures in AFP slice """
+    statusOn=True
+    allowedTypes=['list']
+    StoredValue   = []
+
+_flags.append(signatures)
+
+
+class AFPSlice(JobPropertyContainer, CommonSliceHelper):
+    """ AFP Slice Flags """
+
+from TriggerJobOpts.TriggerFlags import TriggerFlags
+TriggerFlags.add_Container(AFPSlice)
+
+# add add common slice flags
+TriggerFlags.AFPSlice.import_JobProperties('TriggerMenu.menu.CommonSliceFlags')
+
+for flag in _flags:
+    TriggerFlags.AFPSlice.add_JobProperty(flag)
+del _flags
+
+# make an alias
+AFPSliceFlags = TriggerFlags.AFPSlice
+
+#  LocalWords:  allowedTypes
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/afp/__init__.py b/Trigger/TriggerCommon/TriggerMenu/python/afp/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..74583d364ec2ca794156596c7254d9b234a940c6
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/afp/__init__.py
@@ -0,0 +1,2 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/afp/generateAFPChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/afp/generateAFPChainDefs.py
new file mode 100755
index 0000000000000000000000000000000000000000..87bad429d6f87806c69efb1e37cc5e712b57ccf9
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/afp/generateAFPChainDefs.py
@@ -0,0 +1,49 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+##########################################################################################
+##########################################################################################
+__doc__=""
+__version__="Implementation of AFP Slice signatures"
+
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+
+
+from TriggerMenu.afp.AFPDef import L2EFChain_afp
+
+#from TriggerJobOpts.TriggerFlags import TriggerFlags
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
+
+AFP = []
+
+##########################################################################################
+##########################################################################################
+
+
+
+def generateChainDefs(chainDict):          
+
+    listOfChainDicts = splitChainDict(chainDict)
+    listOfChainDefs = []
+    
+    for subChainDict in listOfChainDicts:      
+        AFP = L2EFChain_afp(subChainDict)
+        
+        listOfChainDefs += [AFP.generateHLTChainDef()]
+
+
+        
+    if len(listOfChainDefs)>1:
+        listOfChainDefs = [mergeChainDefs(listOfChainDefs)]
+    else:
+        listOfChainDefs = [listOfChainDefs[0]]
+    
+    listOfChainDefs.reverse()
+    
+    return listOfChainDefs
+
+
+##########################################################
+
+
+    
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/bjet/BjetSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/bjet/BjetSliceFlags.py
index 4059f44615581d9e1dec56fd88031215bb659ebf..0fd4d560ebf41d5e55d72aec43192ff1118a7e05 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/bjet/BjetSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/bjet/BjetSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Bjet slice specific flags  """
 
-from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'T. Bold'
 __version__="$Revision: 1.31 $"
@@ -22,7 +22,6 @@ _flags.append(signatures)
 
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class BjetSlice(JobPropertyContainer, CommonSliceHelper):
     """ Bjet Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py
index 9c6ab1ba4dbcf61fc249e495f51289f517f42ac3..d9b1c3dab1381554a689cfeeba84de6be5aa7e24 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py
@@ -221,20 +221,15 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
     #--------------------
 
     # tracking
-#    from TrigInDetConf.TrigInDetSequence import TrigInDetSequence # new
-#    [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() # new
     if 'FTKVtx' in chainParts['bTracking']:
         [trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig").getSequence() # new
         [ftkvtx, trkftk] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx"]).getSequence() # new
-        ftkvtx[0].getVertexContainer=True
     elif 'FTKRefit' in chainParts['bTracking']:
         [ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","refit","PT"]).getSequence() # new
-        ftkvtx[0].getVertexContainer=True
     elif 'FTK' in chainParts['bTracking']:
         [ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","PT"]).getSequence() # new
-        ftkvtx[0].getVertexContainer=True
     else:
-        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() # new
+        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() # new
 
     # for b-tagging
     theBjetTracks = trkftf+trkprec
@@ -344,7 +339,7 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
         #print 'muon thr for antimatch:' + str(muonthr) 
         muonTE      = "EF_SuperEF_mu{0}_MU{1}".format(muonthr,muonthr)
         jetEtHypoTE = jetEtHypoTE+'_antimatchmu{0}'.format(muonthr)
-        gscEtHypoTE = "HLT_"+gscthresh+ftk+"_eta"+"_jsplit"+"_"+tracking+'_antimatchmu{0}'.format(muonthr)
+        #gscEtHypoTE = "HLT_"+gscthresh+ftk+"_eta"+"_jsplit"+"_"+tracking+'_antimatchmu{0}'.format(muonthr)
         jetHypoTE   = jetHypoTE+'_antimatchmu{0}'.format(muonthr)
         jetTrackTE  = jetTrackTE +'_antimatchmu{0}'.format(muonthr)
 
@@ -440,7 +435,7 @@ def myBjetConfig1(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=1):
     else                         : ef_ethypo_startseq = getBjetEtHypoInstance("EF","StartSequence","35GeV")
 
     # tracking
-    [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() 
+    [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() 
     ef_bjet_tracks = trkftf+trkprec
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/bphysics/generateBPhysicsChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/bphysics/generateBPhysicsChainDefs.py
index ffd242d1e15550e6433ab2a4df04fe4f2a98f707..7ce2e8b0efe64645e2bc6b002ef9034ca7525541 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/bphysics/generateBPhysicsChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/bphysics/generateBPhysicsChainDefs.py
@@ -13,7 +13,6 @@ log = logging.getLogger(__name__)
 from TriggerMenu.menu.MenuUtils import setupTopoStartFrom
 from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
 
-
 log.bphysTrigWarning = True
 
 
@@ -95,8 +94,10 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True, doL2MultiTrack = False)
         theChainDef = bBmumuxTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStartFrom, doL2MultiTrack)
     elif ('Trkloose' in topoAlgs):
         theChainDef = bMuTrack(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStartFrom)
+    elif ('TrkPEBmon' in topoAlgs):
+        theChainDef = bMuTrackPEB(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStartFrom, False)
     elif ('TrkPEB' in topoAlgs):
-        theChainDef = bMuTrackPEB(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStartFrom)
+        theChainDef = bMuTrackPEB(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStartFrom, True)
     elif (ntopos ==1) & (topoAlgs[0] in SameConfigTopos):
         theChainDef = bSingleOptionTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, doL2MultiTrack)
     else:
@@ -118,6 +119,7 @@ def getBphysThresholds(chainDict) :
             mult_without_noL1 = mult_without_noL1 + int(part['multiplicity'])
 
     for dictpart in chainDict['chainParts']:
+        #if 'noL1' in  dictpart['extra'] : continue
         if 'mu' in dictpart['trigType']:
             for x in range(0,int(dictpart['multiplicity'])):
                 if dictpart['threshold']!='0':
@@ -125,9 +127,9 @@ def getBphysThresholds(chainDict) :
                     thr= dthr * 1000.  # in MeV; 
                     #lower to match EF muon threshols
                     if dthr < 9.5 :
-                        thr = thr - 250. 
+                        thr = thr - 350.
                     elif dthr < 11.5 :
-                        thr = thr - 500. 
+                        thr = thr - 550. 
                     elif dthr < 21.5  :
                         thr = thr - 750.                         
                     else :
@@ -153,19 +155,16 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         L2TEname = "L2_" + TEname+'_'+mtopo+'_tsf_'+chainDict['L1item']
         topo2StartFrom = L2TEname
 
-    chainParts = chainDict['chainParts']
-
     fexNameExt,trkmuons, mult, mult_without_noL1  = getBphysThresholds(chainDict)
     L2Fex = None
     L2Hypo = None
     
-    from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu,TrigMultiTrkFex_DiMu_noCut,TrigMultiTrkFex_DiMu_noVtx_noOS,TrigMultiTrkFex_DiMu_noVtx_noM_SS 
-    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut,EFMultiMuHypo_DiMu_noVtx,EFMultiMuHypo_DiMu,EFMultiMuHypo_BMeson,EFMultiMuHypo_Jpsi,EFMultiMuHypo_Upsi,EFMultiMuHypo_2700,EFMultiMuHypo_DiMu2700
     if (mtopo == 'bJpsi'):
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
             from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Jpsi
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :
@@ -185,7 +184,8 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
             if doL2MultiTrack :
                 from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
                 from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-                L2Fex = TrigMultiTrkFex_DiMu()
+                L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+                L2Fex.setTrackThresholds( trkmuons )
                 L2Hypo = EFMultiMuHypo_DiMu("L2MultiMuTrkHypo_DiMu")
                 L2Hypo.bphysCollectionKey = "MultiTrkFex"
             else :
@@ -203,7 +203,8 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
             if doL2MultiTrack :
                 from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
                 from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-                L2Fex = TrigMultiTrkFex_DiMu()
+                L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+                L2Fex.setTrackThresholds( trkmuons )
                 L2Hypo = EFMultiMuHypo_DiMu("L2MultiMuTrkHypo_DiMu")
                 L2Hypo.bphysCollectionKey = "MultiTrkFex"
             else :
@@ -219,8 +220,9 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
 
     elif (mtopo =='bDimu2700'):
         from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
-        from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-        L2Fex = TrigMultiTrkFex_DiMu()
+        from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_2700
+        L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+        L2Fex.setTrackThresholds( trkmuons )
         L2Hypo = EFMultiMuHypo_2700("L2MultiMuHypo_bTau")
 
         from TrigBphysHypo.TrigEFMultiMuFexConfig import EFMultiMuFex_DiMu
@@ -251,12 +253,13 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
 
     elif (mtopo == 'bNocut'):
 
-        from TrigBphysHypo.TrigMultiTrkFexConfig import  TrigMultiTrkFex_DiMu_noCut
-        from TrigBphysHypo.TrigBphysMuonCounterConfig import  TrigBphysMuonCounter_bNmu
+        from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu_noCut
         from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut
+        from TrigBphysHypo.TrigBphysMuonCounterConfig import  TrigBphysMuonCounter_bNmu
         # at level 2 just check that there is at least 2 tracks. One could cut this more down with multiplicity cut for 3mu_bNocut
         # but because of 3mu_bJpsi items we will not gain anything
-        L2Fex = TrigMultiTrkFex_DiMu_noCut()
+        L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+        L2Fex.setTrackThresholds( trkmuons )
         L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
         L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
@@ -270,11 +273,13 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Vtx20
         # at level 2 just check that there is at least 2 tracks. One could cut this more down with multiplicity cut for 3mu_bNocut
         # but because of 3mu_bJpsi items we will not gain anything
-        L2Fex = TrigMultiTrkFex_Vtx2()
+        L2Fex = TrigMultiTrkFex_Vtx2("TrigMultiTrkFex_Vtx2"+fexNameExt)
+        L2Fex.setTrackThresholds( trkmuons )
         L2Hypo = EFMultiMuHypo_Vtx20("EFMultiMuHypo_Vtx20")
         L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
-        EFFex = TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+        EFFex = None #TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+        #EFFex.setEFMuonThresholds( trkmuons )
         EFHypo = None
 
     elif (mtopo == 'bVertex3'):
@@ -284,11 +289,13 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Vtx20
         # at level 2 just check that there is at least 2 tracks. One could cut this more down with multiplicity cut for 3mu_bNocut
         # but because of 3mu_bJpsi items we will not gain anything
-        L2Fex = TrigMultiTrkFex_Vtx3()
+        L2Fex = TrigMultiTrkFex_Vtx3("TrigMultiTrkFex_Vtx3"+fexNameExt)
+        L2Fex.setTrackThresholds( trkmuons )
         L2Hypo = EFMultiMuHypo_Vtx20("EFMultiMuHypo_Vtx20")
         L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
-        EFFex = TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+        EFFex = None #TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+        #EFFex.setEFMuonThresholds( trkmuons )       
         EFHypo = None
 
     elif (mtopo == 'bTau'):
@@ -302,7 +309,8 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_trkTau
             from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-            L2Fex = TrigMultiTrkFex_trkTau()
+            L2Fex = TrigMultiTrkFex_trkTau("TrigMultiTrkFex_trkTau"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_2700("L2MultiMuHypo_bTau")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :  # in 2016 there was no L2 part
@@ -389,8 +397,9 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
     elif (mtopo == 'bUpsi'):
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
-            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-            L2Fex = TrigMultiTrkFex_DiMu()
+            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Upsi
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )            
             L2Hypo = EFMultiMuHypo_Upsi("L2MultiMuTrkHypo_Upsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else:
@@ -408,7 +417,8 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
             from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_BMeson
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_BMeson("L2MultiMuTrkHypo_BMeson")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :
@@ -424,8 +434,9 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
     elif (mtopo == 'bJpsimumu'):
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
-            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-            L2Fex = TrigMultiTrkFex_DiMu()
+            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Jpsi
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :
@@ -442,8 +453,9 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
     elif (mtopo == 'bUpsimumu'):
         if doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
-            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
-            L2Fex = TrigMultiTrkFex_DiMu()
+            from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Upsi
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Upsi("L2MultiMuTrkHypo_Upsi")
         else :
             from TrigBphysHypo.TrigL2BMuMuFexConfig import L2BMuMuFex_Upsi
@@ -470,19 +482,50 @@ def bSingleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoStart
         log.error('Bphysics Chain %s can not be constructed, the given topo algs are not known: %s  ' %(chainDict['chainName'], mtopo ))
 
     # OI make sure that L2Fex is not running, when only 1 muon and therefore only 1 ID RoI is processed at L2
-    if  L2Fex != None and mult_without_noL1 > 1 :
-        theChainDef.addSequence([L2Fex, L2Hypo], inputTEsL2, L2TEname, topo_start_from = topoStartFrom)
-        theChainDef.addSignatureL2([L2TEname])
+    if  L2Fex != None :
+        if mult_without_noL1 == mult :  # no noL1 parts
+            theChainDef.addSequence([L2Fex, L2Hypo], inputTEsL2, L2TEname, topo_start_from = topoStartFrom)
+            theChainDef.addSignatureL2([L2TEname])
+        else :  # insert this after Hypo that goes after EF ID
+            position = -1
+            for signature in theChainDef.signatureList:
+                if signature['listOfTriggerElements'][0].startswith( "EF_FStracksMuon" ) or signature['listOfTriggerElements'][0].startswith( "EF_NStrkMu" ) :
+                    if position == -1 :
+                        position = signature['signature_counter']
+                    else : 
+                        position = min(position, signature['signature_counter'])
+            if position > -1 :
+                locInputTEs = theChainDef.signatureList[position]['listOfTriggerElements']
+                locTEname = "EF_mTrk_" + TEname+'_'+mtopo+'_'+chainDict['L1item']
+                theChainDef.addSequence([L2Fex, L2Hypo], locInputTEs, locTEname, topo_start_from = None)
+                theChainDef.insertSignature(position+1, [locTEname])
+            else :
+                log.error('Bphysics Chain %s  unknown noL1 configuration, please check!! ' %(chainDict['chainName'] ))
+                
     else :
         # that is to make sure that L1 topo seed is not give to EF-only chains..
         topo2StartFrom = None
 
-    if EFHypo != None :
-        theChainDef.addSequence([EFFex, EFHypo],inputTEsEF, EFTEname, topo_start_from=topo2StartFrom)
-    else :
-        theChainDef.addSequence([EFFex],inputTEsEF, EFTEname, topo_start_from=topo2StartFrom)
-    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname])    
- 
+    # add step that counts EF muons above required thresholds
+    from TrigBphysHypo.TrigBphysMuonCounterConfig import  TrigBphysMuonCounter_bNmu
+    EFFexMu = TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+    EFFexMu.setEFMuonThresholds( trkmuons )
+    theChainDef.addSequence([EFFexMu],inputTEsEF, EFTEname+"_MuCounter", topo_start_from=topo2StartFrom)
+    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname+"_MuCounter"])    
+
+
+    # Here we need to use inputs from Muon sequence and not from TrigBphysMuonCounter_bNmu..
+    if EFFex != None :
+        if EFHypo != None :        
+            theChainDef.addSequence([EFFex, EFHypo],inputTEsEF, EFTEname, topo_start_from=topo2StartFrom)
+        else :
+            theChainDef.addSequence([EFFex],inputTEsEF, EFTEname, topo_start_from=topo2StartFrom)
+        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname])    
+
+
+
+
+    
     if 'idperf' in chainDict['chainName']:
       from TrigIDTPMonitor.TrigIDTPMonitorConfig import IDTPMonitor                                                                          
       IDTP = IDTPMonitor()
@@ -517,7 +560,7 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
         #from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
         #from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu
     from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu,TrigMultiTrkFex_DiMu_noCut,TrigMultiTrkFex_DiMu_noVtx_noOS,TrigMultiTrkFex_DiMu_noVtx_noM_SS
-    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut,EFMultiMuHypo_DiMu_noVtx,EFMultiMuHypo_DiMu,EFMultiMuHypo_BMeson,EFMultiMuHypo_Jpsi,EFMultiMuHypo_Upsi,EFMultiMuHypo_2700,EFMultiMuHypo_BMeson 
+    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut,EFMultiMuHypo_DiMu_noVtx,EFMultiMuHypo_DiMu,EFMultiMuHypo_BMeson,EFMultiMuHypo_Jpsi,EFMultiMuHypo_Upsi,EFMultiMuHypo_2700
 
     if ('7invm9' in topoAlgs) & ('noos' in topoAlgs) & ('novtx' not in topoAlgs):
         #if not doL2MultiTrack :
@@ -692,9 +735,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
         mult = 0
         for part in chainParts :
             mult = mult + int(part['multiplicity'])
-        from TrigBphysHypo.TrigEFMultiMuFexConfig import EFMultiMuFex_Tau
-        from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_2700
         from TrigBphysHypo.TrigEFMultiMuFexConfig import EFMultiMuFex_Tau2
+        from TrigBphysHypo.TrigEFMultiMuFexConfig import EFMultiMuFex_Tau3
 
         L2Fex = None
         L2Hypo = None
@@ -717,7 +759,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu_passL2() 
             L2Hypo = L2BMuMuHypo_DiMu_passL2()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noCut()
+            L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_DiMu_noOS()
@@ -729,7 +772,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu_noOS() 
             L2Hypo = L2BMuMuHypo_DiMu_noVtx()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noVtx_noOS()
+            L2Fex = TrigMultiTrkFex_DiMu_noVtx_noOS("TrigMultiTrkFex_DiMu_noVtx_noOS"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noVtx("L2MultiMuTrkHypo_noVtx")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         from TrigBphysHypo.TrigEFBMuMuFexConfig  import EFBMuMuFex_DiMu_noOS
@@ -745,7 +789,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu_noinvm_SS() 
             L2Hypo = L2BMuMuHypo_DiMu_noinvm_noVtx()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noVtx_noM_SS()
+            L2Fex = TrigMultiTrkFex_DiMu_noVtx_noM_SS("TrigMultiTrkFex_DiMu_noVtx_noM_SS"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_DiMu_noinvm_SS()
@@ -768,7 +813,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu_passL2() 
             L2Hypo = L2BMuMuHypo_DiMu_passL2()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noCut()
+            L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_DiMu()
@@ -787,7 +833,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_Jpsi_passL2()
             L2Hypo = L2BMuMuHypo_Jpsi_passL2()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noCut()
+            L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_Jpsi()
@@ -806,7 +853,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu_passL2()
             L2Hypo = L2BMuMuHypo_DiMu_passL2()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu_noCut()
+            L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_noCut")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_B()
@@ -820,7 +868,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu() 
             L2Hypo = L2BMuMuHypo_DiMu()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu("L2MultiMuTrkHypo_DiMu")
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
@@ -835,7 +884,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_Jpsi()
             L2Hypo = L2BMuMuHypo_Jpsi()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_passEF()
@@ -850,7 +900,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_Jpsi()
             L2Hypo = L2BMuMuHypo_Jpsi()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_Jpsi()
@@ -864,7 +915,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu()
             L2Hypo = L2BMuMuHypo_DiMu()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu("L2MultiMuTrkHypo_DiMu")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
@@ -879,7 +931,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_B()
             L2Hypo = L2BMuMuHypo_B()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_BMeson("L2MultiMuTrkHypo_BMeson")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_B()
@@ -893,7 +946,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_Upsi()
             L2Hypo = L2BMuMuHypo_Upsi()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Upsi("L2MultiMuTrkHypo_Upsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
 
@@ -909,7 +963,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_Jpsi()
             L2Hypo = L2BMuMuHypo_Jpsi()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_Jpsi()
@@ -923,7 +978,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_DiMu()
             L2Hypo = L2BMuMuHypo_DiMu()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu("L2MultiMuTrkHypo_DiMu") 
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_DiMu()
@@ -933,7 +989,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
         from TrigBphysHypo.TrigL2BMuMuHypoConfig import L2BMuMuHypo_DiMu
         from TrigBphysHypo.TrigEFBMuMuFexConfig import EFBMuMuFex_DiMu
         from TrigBphysHypo.TrigEFBMuMuHypoConfig import EFBMuMuHypo_DiMu2700_Lxy0
-        L2Fex = TrigMultiTrkFex_DiMu()
+        L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+        L2Fex.setTrackThresholds( trkmuons )
         L2Hypo = EFMultiMuHypo_2700("L2MultiMuHypo_bTau")
         L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_DiMu()
@@ -947,7 +1004,8 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
             L2Fex  = L2BMuMuFex_B()
             L2Hypo = L2BMuMuHypo_B()
         else :
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_BMeson("L2MultiMuTrkHypo_BMeson")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         EFFex  = EFBMuMuFex_B()
@@ -965,12 +1023,36 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
     else:
         log.error('Bphysics Chain %s can not be constructed, the given topo algs are not known: %s  ' %(chainDict['chainName'], topoAlgs ))
 
-    if L2Fex != None :
-        theChainDef.addSequence([L2Fex, L2Hypo],inputTEsL2,L2TEname, topo_start_from = topoStartFrom)
-        theChainDef.addSignatureL2([L2TEname])
-    else :
-        topo2StartFrom = None
- 
+    # OI make sure that L2Fex is not running, when only 1 muon and therefore only 1 ID RoI is processed at L2
+    if  L2Fex != None :
+        if mult_without_noL1 == mult :  # no noL1 parts
+            theChainDef.addSequence([L2Fex, L2Hypo], inputTEsL2, L2TEname, topo_start_from = topoStartFrom)
+            theChainDef.addSignatureL2([L2TEname])
+        else :  # insert this after Hypo that goes after EF ID
+            position = -1
+            for signature in theChainDef.signatureList:
+                if signature['listOfTriggerElements'][0].startswith( "EF_FStracksMuon" ) or signature['listOfTriggerElements'][0].startswith( "EF_NStrkMu" ) :
+                    if position == -1 :
+                        position = signature['signature_counter']
+                    else : 
+                        position = min(position, signature['signature_counter'])
+            if position > -1 :
+                locInputTEs = theChainDef.signatureList[position]['listOfTriggerElements']
+                locTEname = "EF_mTrk_" + TEname+'_'+mtopo+'_'+chainDict['L1item']
+                theChainDef.addSequence([L2Fex, L2Hypo], locInputTEs, locTEname, topo_start_from = None)
+                theChainDef.insertSignature(position+1, [locTEname])
+            else :
+                log.error('Bphysics Chain %s  unknown noL1 configuration, please check!! ' %(chainDict['chainName'] ))
+
+    if not ('noEFbph' in topoAlgs) :
+        from TrigBphysHypo.TrigBphysMuonCounterConfig import  TrigBphysMuonCounter_bNmu
+        fexNameExt,trkmuons,mult, mult_without_noL1  = getBphysThresholds(chainDict)
+        EFFexMu = TrigBphysMuonCounter_bNmu("TrigBphysMuonCounter"+fexNameExt, trkmuons)
+        EFFexMu.setEFMuonThresholds( trkmuons )
+        theChainDef.addSequence([EFFexMu],inputTEsEF, EFTEname+"_MuCounter", topo_start_from=topo2StartFrom)
+        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname+"_MuCounter"])    
+
+    # here we have to use inputs from Muon sequence and not TrigBphysMuonCounter_bNmu
     theChainDef.addSequence([EFFex, EFHypo],inputTEsEF, EFTEname, topo_start_from = topo2StartFrom)
     theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname])       
 
@@ -979,15 +1061,18 @@ def bMultipleOptionTopos(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoSta
 
 ###################################################################################
 ###################################################################################
-def bMuTrackPEB(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom):
+def bMuTrackPEB(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, doPEB):
 
-    EFChainName = "EF_" + chainDict['chainName']
     topoAlgs = chainDict["topo"]
 
     mtopo = topoAlgs[0]
     TEname = findL2teBaseName(chainDict['chainName'],topoAlgs)
-    L2TEname = "L2_" + TEname+'_'+mtopo+'_'+chainDict['L1item']
+    if "lowpt" in chainDict['chainName'] :
+        L2TEname = "L2_" + TEname+'_'+mtopo+'_lowpt_'+chainDict['L1item']
+    else :
+        L2TEname = "L2_" + TEname+'_'+mtopo+'_'+chainDict['L1item']
 
+    
     #--- 1: L2 first add large cone before duing superEF
     #[trkfast, trkprec] = TrigInDetSequence("Bphysics", "bphysics", "IDTrig").getSequence()
     [trkfast, trkprec] = TrigInDetSequence("BphysHighPt", "bphysHighPt", "IDTrig").getSequence()
@@ -1009,24 +1094,38 @@ def bMuTrackPEB(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom):
 
     #--- 2: then add L2 multi trk fex+hypo for Jpsi
         
+    fexNameExt,trkmuons, mult, mult_without_noL1  = getBphysThresholds(chainDict)
+
+    if len( trkmuons) == 1 :
+        if "lowpt" in chainDict['chainName'] :
+            trkmuons.append(2000)
+            fexNameExt = fexNameExt + "_"+str(2)
+        else :
+            trkmuons.append(3500)
+            fexNameExt = fexNameExt + "_"+str(4)
+    else :
+         log.error('Bphysics Chain %s can not be constructed, more than 2 muons are requested ' %(chainDict['chainName']))
+            
     from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_Jpsi
-    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Jpsi
-    L2Fex = TrigMultiTrkFex_Jpsi()
+    L2Fex = TrigMultiTrkFex_Jpsi("TrigMultiTrkFex_TrkPEB"+fexNameExt)
+    L2Fex.setTrackThresholds( trkmuons )
     #L2Fex.trackCollectionKey = "InDetTrigTrackingxAODCnv_Bphysics_IDTrig"
+
+    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Jpsi
     L2Hypo = EFMultiMuHypo_Jpsi("L2MultiMuTrkHypo_Jpsi")
     L2Hypo.bphysCollectionKey = "MultiTrkFex"
     theChainDef.addSequence([L2Fex, L2Hypo], L2outTEsprec , L2TEname+"MultiTrk")
     theChainDef.addSignatureL2([L2TEname+"MultiTrk"])
 
-    
-    #---- 3 : last step - setup PEB
-    from TrigDetCalib.TrigDetCalibConfig import TrigCheckForMuons_peb075
-    bphysROBWriter = TrigCheckForMuons_peb075("bphysROBWriter_peb075")
+    if doPEB:
+        #---- 3 : last step - setup PEB
+        from TrigDetCalib.TrigDetCalibConfig import TrigCheckForMuons_peb075
+        bphysROBWriter = TrigCheckForMuons_peb075("bphysROBWriter_peb075")
 
-    EFTEname = "EF_" + chainDict['chainName']+"_1"
-    inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements']
-    theChainDef.addSequence([bphysROBWriter],inputTEsEF, EFTEname)
-    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname])
+        EFTEname = "EF_" + chainDict['chainName']+"_1"
+        inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements']
+        theChainDef.addSequence([bphysROBWriter],inputTEsEF, EFTEname)
+        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFTEname]+inputTEsEF)
 
     return theChainDef
 
@@ -1085,7 +1184,8 @@ def bMuTrack(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom):
         theChainDef.addSequence(trkfast,EFinputTE, EFoutputTEfast)
 
     theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, EFoutTEsfast)
-
+        
+    
     EFTEcount = 0; EFoutTEsprec = [];
     for EFinputTE in inputTEsEF:
         EFTEcount = EFTEcount + 1
@@ -1117,13 +1217,16 @@ def bBmumuxTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, d
     L2TEname = "L2_" + TEname+myTopoString+'_'+chainDict['L1item']
     EFTEname = "EF_" + chainDict['chainName']
 
+    fexNameExt,trkmuons, mult, mult_without_noL1  = getBphysThresholds(chainDict)
+
+    
     topo2StartFrom = None
     if topoStartFrom:
         L2TEname = "L2_" + TEname+myTopoString+'_tsf_'+chainDict['L1item']
         topo2StartFrom = L2TEname
 
-    from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu,TrigMultiTrkFex_DiMu_noCut,TrigMultiTrkFex_DiMu_noVtx_noOS,TrigMultiTrkFex_DiMu_noVtx_noM_SS 
-    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut,EFMultiMuHypo_DiMu_noVtx,EFMultiMuHypo_DiMu,EFMultiMuHypo_BMeson,EFMultiMuHypo_Jpsi,EFMultiMuHypo_Upsi,EFMultiMuHypo_2700, EFMultiMuHypo_Bmumux
+    from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu_noCut
+    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_DiMu_noCut
     # replace L2 Te (and EF tsf) with bBmumuxv2 naming
     # same underlying sequence is used
     # Warning if ever switch to v3 implementation -- this should be changed / tested 
@@ -1150,7 +1253,7 @@ def bBmumuxTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, d
         
     if 'Ftk' in topoAlgs:
         from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-        trkftk = TrigInDetFTKSequence("BeamSpot", "beamSpot", "").getSequence()
+        trkftk = TrigInDetFTKSequence("BeamSpot", "beamSpot", [""]).getSequence()
     else:
         from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
         [trkfast, trkprec] = TrigInDetSequence("Bphysics", "bphysics", "IDTrig").getSequence()
@@ -1231,15 +1334,14 @@ def bBmumuxTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, d
         EFFex = EFBMuMuFex_Jpsi()
         EFHypo = EFBMuMuHypo_Jpsi()
        
-
-    from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Bmumux
     # Use simple di-muon fex/hypo for L2
     # Note - may need to change oppsign and vtx requirements
     # noL2 option to skip dimuon selection at L2
 
     if 'noL2' in topoAlgs:
         if doL2MultiTrack :
-            L2Fex = TrigMultiTrkFex_DiMu_noCut()
+            L2Fex = TrigMultiTrkFex_DiMu_noCut("TrigMultiTrkFex_DiMu_noCut"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_DiMu_noCut("L2MultiMuTrkHypo_DiMu_noCut")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :
@@ -1258,7 +1360,8 @@ def bBmumuxTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, d
         if  doL2MultiTrack :
             from TrigBphysHypo.TrigMultiTrkFexConfig import TrigMultiTrkFex_DiMu
             from TrigBphysHypo.TrigEFMultiMuHypoConfig import EFMultiMuHypo_Bmumux
-            L2Fex = TrigMultiTrkFex_DiMu()
+            L2Fex = TrigMultiTrkFex_DiMu("TrigMultiTrkFex_DiMu"+fexNameExt)
+            L2Fex.setTrackThresholds( trkmuons )
             L2Hypo = EFMultiMuHypo_Bmumux("EFMultiMuHypo_Bmumux")  
             L2Hypo.bphysCollectionKey = "MultiTrkFex"
         else :
@@ -1306,7 +1409,6 @@ def bBmumuxTopos(theChainDef,chainDict, inputTEsL2, inputTEsEF, topoStartFrom, d
         trkFTK=[dummyAlgo]+trkftk[0]
         EFTEcount = 0; EFoutputTEsftk = [];
         for EFinputTE in inputTEsEF:
-            EFoutputTEdummy = EFinputTE+'_dummy'
             EFTEcount = EFTEcount + 1
             EFoutputTEftk = EFinputTE+'_ftk'+str(EFTEcount)
             EFoutputTEsftk.append(EFoutputTEftk)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py
index 46ef70225b15f1b9d4772e22df350390356cccdc..7ebb8428457a12e0b19e76fbf7c263288d3028e4 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py
@@ -7,9 +7,7 @@
 __author__  = 'M.Backes, C.Bernius'
 __version__=""
 __doc__="Implementation of beamspot chains "
-from TriggerMenu.menu.HltConfig import *
-from AthenaCommon.Include import include
-from AthenaCommon.SystemOfUnits import GeV
+from TriggerMenu.menu.HltConfig import L2EFChainDef,mergeRemovingOverlap
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
@@ -112,7 +110,6 @@ class L2EFChain_Beamspot(L2EFChainDef):
         TrigL2SiTrackFinder_Config = __import__('TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config', fromlist=[""])      
         my_trk_alg = getattr(TrigL2SiTrackFinder_Config, "TrigL2SiTrackFinder_BeamSpotB") 
         trk_alg = [my_trk_alg()] 
-        teaddition = 'L2StarB'
         
      elif ('trkfast' in self.l2IDAlg):
         if 'trkFS' in self.chainPart['addInfo'] :
@@ -128,8 +125,7 @@ class L2EFChain_Beamspot(L2EFChainDef):
            mlog.error('Cannot assemble chain %s - only configured for trkFS,allTE and activeTE' % (self.chainPartName))
 
         from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-        [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence()
-        teaddition = 'trkfast'
+        [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
         
      elif ('FTK' in self.l2IDAlg):
         if 'trkFS' in self.chainPart['addInfo'] :
@@ -152,16 +148,15 @@ class L2EFChain_Beamspot(L2EFChainDef):
            
         if 'idperf' in self.chainPart['addInfo']:
            from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-           [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence()           
+           [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
            from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-           [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "mon").getSequence()
+           [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", ["mon"]).getSequence()
         elif 'mon' in self.chainPart['addInfo']:
            from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "mon").getSequence()
+           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", ["mon"]).getSequence()
         else:   
            from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "").getSequence()
-        teaddition = 'trkFTK'
+           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", [""]).getSequence()
 
      elif ('FTKRefit' in self.l2IDAlg):
         if 'trkFS' in self.chainPart['addInfo'] :
@@ -183,13 +178,12 @@ class L2EFChain_Beamspot(L2EFChainDef):
 
         if 'idperf' in self.chainPart['addInfo']:
            from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-           [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence()
+           [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
            from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-           [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "refit").getSequence()
+           [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", ["refit"]).getSequence()
         else: 
            from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
-           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "refit").getSequence()
-           teaddition = 'trkFTKRefit'
+           [trk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", ["refit"]).getSequence()
 
      else:
         mlog.error('Cannot assemble chain %s - only configured for L2StarB' % (self.chainPartName))        
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotSliceFlags.py
index 1ca3e335e1f6da74284550de571af0ec3c7289d5..b0c0cf97dc4cb7427a68853e28782068363b4365 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotSliceFlags.py
@@ -2,7 +2,7 @@
 
 """ Beamspot slice specific flags  """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = ''
@@ -20,7 +20,6 @@ _flags.append(signatures)
 
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class BeamspotSlice(JobPropertyContainer, CommonSliceHelper):
     """ Beamspot Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py
index 4a2c7eb12cfbbb8f1806954d1a3b12daa4acc231..46f152ba3faf48d8ce31ad4cfa95555a24860ee0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py
@@ -137,7 +137,12 @@ class L2EFChain_CalibTemplate(L2EFChainDef):
         self.setupZDCPEBChains()
       elif 'calibAFP' in self.chainPart['purpose']:
         self.setupAFPCalibrationChains()
-        
+      elif 'rpcpeb' in self.chainPart['purpose']:
+        self.setupRPCCalibrationChains()
+      elif 'idpsl1' in self.chainPart['purpose']:
+        self.setupIDPSCalibrationChains()
+      elif 'larpebcalib' in self.chainPart['purpose']:
+        self.setupLArPEBCalibCalibrationChains()
       else:
          log.error('Chain %s could not be assembled' % (self.chainPartName))
          return False      
@@ -206,7 +211,15 @@ class L2EFChain_CalibTemplate(L2EFChainDef):
       self.AlgList = []
       self.signatureCounterOffset = 14
 
-      from TrigDetCalib.TrigDetCalibConfig import *
+      from TrigDetCalib.TrigDetCalibConfig import (CheckForTracks_Trk9_Central,
+                                                   CheckForTracks_Trk16_Central,
+                                                   CheckForTracks_Trk29_Central,
+                                                   CheckForTracks_Trk9_Fwd,
+                                                   CheckForTracks_Trk16_Fwd,
+                                                   CheckForTracks_Trk29_Fwd,
+                                                   CheckForTracks_Trk9_Central_Beamspot,
+                                                   CheckForTracks_Trk9_Fwd_Beamspot) 
+
       trkAlgDict = {
          'idcalib_trk9_central'  : CheckForTracks_Trk9_Central('CheckForTracks_Trk9_Central'),
          'idcalib_trk16_central' : CheckForTracks_Trk16_Central('CheckForTracks_Trk16_Central'),
@@ -220,6 +233,8 @@ class L2EFChain_CalibTemplate(L2EFChainDef):
          'idcalib_trk9_fwd_L1J10_VTE200'  : CheckForTracks_Trk9_Fwd_Beamspot('CheckForTracks_Trk9_Fwd_Beamspot_2'),
          'idcalib_trk9_central_bs'  : CheckForTracks_Trk9_Central_Beamspot('CheckForTracks_Trk9_Central_Beamspot_1'),
          'idcalib_trk9_fwd_bs'  : CheckForTracks_Trk9_Fwd_Beamspot('CheckForTracks_Trk9_Fwd_Beamspot_1'),
+         'idcalib_trk9_central_L1MBTS_1_VTE70'  : CheckForTracks_Trk9_Central_Beamspot('CheckForTracks_Trk9_Central_Beamspot_1'),
+         'idcalib_trk9_fwd_L1MBTS_1_VTE70'  : CheckForTracks_Trk9_Fwd_Beamspot('CheckForTracks_Trk9_Fwd_Beamspot_1'),
 
          }
       for name, alg in trkAlgDict.items():
@@ -290,6 +305,47 @@ class L2EFChain_CalibTemplate(L2EFChainDef):
        }
 
 
+   ###########################################################################
+   # RPC Calibration chains
+   ###########################################################################
+   def setupRPCCalibrationChains(self):
+     
+     from TrigDetCalib.TrigDetCalibConfig import TrigSubDetListWriter
+     
+     l2_RPCSubDetListWriter = TrigSubDetListWriter("RPCSubDetListWriter")
+     l2_RPCSubDetListWriter.SubdetId = ['TDAQ_MUON', 'TDAQ_CTP', 'TDAQ_HLT', 'RPC']
+
+     l2_RPCSubDetListWriter.MaxRoIsPerEvent=1
+     
+     self.robWriter = [l2_RPCSubDetListWriter]            
+     self.L2sequenceList += [['', self.robWriter, 'L2_']]
+     
+     self.L2signatureList += [[['L2_']]]
+     self.TErenamingDict = {
+       'L2_':     'L2_l1RPCcalib',
+       }
+  
+   ###########################################################################
+   # IDprescaledL1 Calibration chains
+   ###########################################################################
+   def setupIDPSCalibrationChains(self):
+
+     from TrigDetCalib.TrigDetCalibConfig import TrigSubDetListWriter
+
+     l2_IDPSSubDetListWriter = TrigSubDetListWriter("IDPSSubDetListWriter")
+     l2_IDPSSubDetListWriter.SubdetId = ['TDAQ_CTP','TDAQ_HLT','InnerDetector']
+
+     l2_IDPSSubDetListWriter.MaxRoIsPerEvent=1
+
+     self.robWriter = [l2_IDPSSubDetListWriter]
+     self.L2sequenceList += [['', self.robWriter, 'L2_']]
+
+     self.L2signatureList += [[['L2_']]]
+     self.TErenamingDict = {
+       'L2_':     'L2_l1IDPScalib',
+       }
+
+
    ###########################################################################
    # AFP Calibration chains
    ###########################################################################
@@ -451,4 +507,15 @@ class L2EFChain_CalibTemplate(L2EFChainDef):
      self.L2sequenceList += [['', self.robWriter, 'L2_zdc']]     
      self.L2signatureList += [[['L2_zdc']]]
 
+######################################################################
+   def setupLArPEBCalibCalibrationChains(self):
+     from TrigDetCalib.TrigDetCalibConfig import TrigSubDetListWriter
+     larpebSubDetListWriter = TrigSubDetListWriter("LArPEBSubDetListWriter")
+     larpebSubDetListWriter.SubdetId = ['TDAQ_CTP','LAr']
+
+     larpebSubDetListWriter.MaxRoIsPerEvent=1
 
+     self.robWriter = [larpebSubDetListWriter]
+     self.L2sequenceList += [['', self.robWriter, 'L2_larpeb']]
+     self.L2signatureList += [[['L2_larpeb']]]
+ 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibSliceFlags.py
index 83c891a7e2f1c8bc306cc570dc56378c5ee8073b..207dc9e01f1a0768141426d5ff74d41fbde42a43 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibSliceFlags.py
@@ -2,7 +2,7 @@
 
 """ Calib slice specific flags  """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = ''
@@ -27,7 +27,6 @@ _flags.append(signatures)
 
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class CalibSlice(JobPropertyContainer, CommonSliceHelper):
     """ Calib Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CosmicSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CosmicSliceFlags.py
index 290ecfe56d3d9d682f1f7c4de04c8655c24d43b5..9ef28d4035a71a39e33c02c857e220603d0aa477 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CosmicSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CosmicSliceFlags.py
@@ -2,7 +2,7 @@
 
 """ Cosmics slice specific flags  """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'A. Cerri, after X. Wu example'
@@ -455,7 +455,6 @@ class EFPayload(JobProperty):
 _flags.append(EFPayload)
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class CosmicSlice(JobPropertyContainer, CommonSliceHelper):
     """ Cosmic Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasDefs.py
index 2d2ba4535b203bb00161834c63204c48c9d08cc0..472c8b69495e54aa4011d94c1d656ab3c4bd930d 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasDefs.py
@@ -9,8 +9,7 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger('TriggerMenu.calibcosmon.EnhancedBiasDef')
 
-from TriggerMenu.menu.HltConfig import *
-from TriggerJobOpts.TriggerFlags  import TriggerFlags
+from TriggerMenu.menu.HltConfig import L2EFChainDef
 
 #########################################################################
 
@@ -18,32 +17,23 @@ from TriggerJobOpts.TriggerFlags  import TriggerFlags
 l1_seeds ={ 
     
     # Low threshold prescaled L1 items - slected at HLT based on TBP bit from L1 in random-seeded events        
-    'low'  : ['L1_MU6', 'L1_EM10VH', 
-              'L1_J30.0ETA49_2J20.0ETA49', 'L1_TAU12',
-              'L1_MU4_J12', 'L1_2EM7',
-              'L1_2MU4', 'L1_XS30', 
-              'L1_J15', 'L1_ZB'],
+    'low'  : ['L1_2EM7', 'L1_EM10VH', 'L1_EM12_2EM3', 'L1_J20.31ETA49', 'L1_J30', 
+              'L1_J30.0ETA49_2J20.0ETA49', 'L1_MU10', 'L1_MU4_J12', 'L1_TAU20', 'L1_ZB'],
 
     # High(er) threshold prescaled L1 items - slected at HLT based on TBP bit from L1 in random-seeded events 
-    'high' : ['L1_3J15','L1_EM18VH',
-              'L1_EM20VHI',  'L1_2EM10VH', 
-              'L1_J50', 'L1_TAU30',
-              'L1_MU15','L1_TAU20_2TAU12', 
-              'L1_XE35', 'L1_MU6_2MU4',
-              'L1_MU6_J20', 'L1_EM7_MU10',
-              'L1_EM15VH_3EM7', 'L1_2EM15',
-              'L1_EM15I_MU4', 'L1_2MU6',
-              'L1_TAU20_2TAU12_XE35', 
-              'L1_DR-TAU20ITAU12I', 'L1_DY-BOX-2MU6', # Topo
-              'L1_DY-DR-2MU4', # Topo
-              'L1_2MU4-B', 'L1_BTAG-MU4J15', # Topo
-              'L1_MJJ-100', 'L1_J4-MATCH', # Topo
-              'L1_HT190-J15.ETA21', #Topo,
-              'L1_2MU4_J20_XE30_DPHI-J20s2XE30',  # 2017
-              'L1_MU4_J20_XE30_DPHI-J20s2XE30', # 2017
-              'L1_J40_XE50_DPHI-J20s2XE50', # 2017
-              'L1_2MU4_J40_XE20', # 2017
-              'L1_MU4_J50_XE40'] # 2017
+    'high' : ['L1_2EM10VH', 'L1_2EM15', 'L1_2MU4', 'L1_2MU4-B', 'L1_2MU4-BO', 
+              'L1_2MU6', 'L1_2MU6-B', 'L1_2MU6-BO', 
+              'L1_3EM3_J40_XE50_DPHI-J20s2XE50', 'L1_3J15', 
+              'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6', 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', 
+              'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4', 
+              'L1_BTAG-MU4J15', 'L1_DR-TAU20ITAU12I', 'L1_DY-BOX-2MU6', 'L1_DY-DR-2MU4', 
+              'L1_EM15I_MU4', 'L1_EM15VHI_2TAU12IM_J25_3J12', 'L1_EM15VH_3EM7', 
+              'L1_EM15_XS30', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM7_MU10', 'L1_HT190-J15.ETA21', 
+              'L1_J4-MATCH', 'L1_J40.0ETA25_2J15.31ETA49', 'L1_J50', 
+              'L1_LFV-MU6', 'L1_MJJ-400', 'L1_MU10_2MU6', 'L1_MU10_TAU12IM', 'L1_MU10_TAU12IM_J25_2J12', 
+              'L1_MU6_2MU4', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 
+              'L1_TAU20IM_2TAU12IM_J25_2J20_3J12', 'L1_TAU20IM_2TAU12IM_XE35', 
+              'L1_TAU20_2TAU12', 'L1_TAU20_2TAU12_XE35', 'L1_TAU40', 'L1_XE35']
 
     }
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasSliceFlags.py
index 483ed5f06d1cb5688882dfdfb0f4bd037da3d603..040580d7ade861eaf19246ac278d97127ea05d32 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/EnhancedBiasSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ EnhancedBias slice specific flags  """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'P. Bell, after A. Cerri'
 __version__="$Revision: 0.1 $"
@@ -27,7 +27,6 @@ class signatures(JobProperty):
 _flags.append(signatures)
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class EnhancedBiasSlice(JobPropertyContainer, CommonSliceHelper):
     """ EnhancedBias Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py
index 7d7ebab44e4cfa217f867b69088b42d3b3bd37e0..cc47f702b200bc4c9dd3f7ce89b4011d465b41c1 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py
@@ -243,9 +243,9 @@ class L2EFChain_Monitoring(L2EFChainDef):
 
         try:
             from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_FullScanBC
-            theTrigL2SiTrackFInder_FullScanBC = TrigL2SiTrackFinder_FullScanBC()
+            theTrigL2SiTrackFinder_FullScanBC = TrigL2SiTrackFinder_FullScanBC()
         except:
-            theTrigL2SiTrackFInder_FullScanBC = None
+            theTrigL2SiTrackFinder_FullScanBC = None
 
 
             
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorSliceFlags.py
index b2306550065967e184db1ad2434dbf23c55de866..fd5ec2030f385af89dfba5d7168b3c296b65bd18 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Flags for monitoring chains """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 _flags = [] 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/StreamingSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/StreamingSliceFlags.py
index a9c49d9d218f061395f529d78d79bf88533b93be..839a7bb66df8afa9f1babfb534daf339c3a4f383 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/StreamingSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/StreamingSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Streaming slice specific flags  """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'P. Bell, after A. Cerri'
 __version__="$Revision: 0.1 $"
@@ -27,7 +27,6 @@ class signatures(JobProperty):
 _flags.append(signatures)
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class StreamingSlice(JobPropertyContainer, CommonSliceHelper):
     """ Streaming Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateBeamspotChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateBeamspotChainDefs.py
index 57b1252ec61888af572f94e66bf237883bfb3d88..eee1078f5d492e921c314a6a709741bdc7823153 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateBeamspotChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateBeamspotChainDefs.py
@@ -9,14 +9,13 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 mlog = logging.getLogger("TriggerMenu.calibcosmic.generateBeamspotChainDefs")
 
-from TriggerMenu.calibcosmicmon.BeamspotDef import *
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.calibcosmicmon.BeamspotDef import L2EFChain_Beamspot
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCalibChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCalibChainDefs.py
index 826a3bbd4887f3724787452ee598aabeedf854d1..3e077f6ca0c35ae1929cec85ade2fc541851ab8c 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCalibChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCalibChainDefs.py
@@ -9,17 +9,14 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 mlog = logging.getLogger("TriggerMenu.calibcosmic.generateCalibChainDefs")
 
-from TriggerMenu.calibcosmicmon.CalibDef import *
-
-#from TriggerJobOpts.TriggerFlags import TriggerFlags
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.calibcosmicmon.CalibDef import L2EFChain_CalibTemplate
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCosmicChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCosmicChainDefs.py
index c37c51858feb8bb63807a42610b38702939d7331..e8abb9ba4abf9a4e384e60f9c9a1f2d4eefb5f8d 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCosmicChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateCosmicChainDefs.py
@@ -9,17 +9,14 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 
 
-from TriggerMenu.calibcosmicmon.CosmicDef import *
-
-#from TriggerJobOpts.TriggerFlags import TriggerFlags
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.calibcosmicmon.CosmicDef import L2EFChain_CosmicTemplate
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 CosmicChains = []
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateEnhancedBiasChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateEnhancedBiasChainDefs.py
index 013456f565d1beae5673bc0ac6d9dd7690dfb64e..b27dd29f88c69bad3a677feaa818ee0b8e1d85db 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateEnhancedBiasChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateEnhancedBiasChainDefs.py
@@ -9,14 +9,12 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 mlog = logging.getLogger("TriggerMenu.calibcosmic.generateEnhancedBiasChainDefs")
 
-from TriggerMenu.calibcosmicmon.EnhancedBiasDefs import *
-from TriggerMenu.menu.MenuUtils import *
-
+from TriggerMenu.calibcosmicmon.EnhancedBiasDefs import L2EFChain_EnhancedBiasTemplate
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateMonitoringChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateMonitoringChainDefs.py
index 5cdb754ef8eade59160f16abb6d66193ba8049b7..3d1b91b4a7bed3fdb1028aa73d1f4ce725c2b7dd 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateMonitoringChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateMonitoringChainDefs.py
@@ -9,14 +9,13 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger(__name__)
 
-from TriggerMenu.calibcosmicmon.MonitorDef import *
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.calibcosmicmon.MonitorDef import L2EFChain_Monitoring
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateStreamingChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateStreamingChainDefs.py
index dda53d9b52ea0d8fb08c467cb7cf7b0fa574fcf3..a5cd0af5b0ffe440877df44f7f0609f37aa1972a 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateStreamingChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/generateStreamingChainDefs.py
@@ -9,14 +9,13 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 mlog = logging.getLogger("TriggerMenu.calibcosmic.generateStreamingChainDefs")
 
-from TriggerMenu.calibcosmicmon.StreamingDef import *
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.calibcosmicmon.StreamingDef import L2EFChain_SeededStreamerTemplate
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
     
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/combined/CombinedSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/combined/CombinedSliceFlags.py
index 51de8a007afe7f763a9a702cdfb1827dab8c965e..ecd5ae223fce99e9f1739ed4d0d2af466fca8191 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/combined/CombinedSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/combined/CombinedSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Combined slices specific flags  """
 
-from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'T. Bold, B. Demirkoz'
 __version__="$Revision: 1.53 $"
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/combined/generateCombinedChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/combined/generateCombinedChainDefs.py
index f5f9cc3540896e33e0afeffc5f9613e21cdb6c0a..058d2bf069d127f0443db5e8850c39efc30bf414 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/combined/generateCombinedChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/combined/generateCombinedChainDefs.py
@@ -448,11 +448,8 @@ def _addMatching(theChainDef,chainDicts,listOfChainDefs):
     from TrigBjetHypo.TrigLeptonJetMatchAllTEConfig  import LeptonJetMatchAllTE
  
     dzmatching = False
-    drmatching = False
     for topo in chainDicts[0]['topo']:
-        if "dz" in topo: dzmatching = True
-        if "dr" in topo: drmatching = True
- 
+        if "dz" in topo: dzmatching = True 
  
     # obtain deltaR for Hypo configuration
     deltaR = -1
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py b/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py
index fcbbd68174a5607d92010ed4fceb36cf569415e8..478347280954715bbaa563473a1074ff80f52ef6 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py
@@ -15,15 +15,13 @@ sys.stderr = f
 try:
     from TriggerMenu.commonUtils.LeptonIsoEDConfig import TrigHLTEnergyDensityCentral, TrigHLTEnergyDensityForward
 
-    from TrigGenericAlgs.TrigGenericAlgsConf import (PESA__DummyCombineAlgo,
-                                                     PESA__DummyUnseededAllTEAlgo as DummyAlgo)
+    from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyAlgo
     
     from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_jet_fullcalo,
                                             TrigCaloClusterMaker_topo)
 
     from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_eGamma,
-                                            TrigCaloTowerMaker_eGamma,
-                                            TrigCaloCellMaker_eGamma_cells)
+                                            TrigCaloTowerMaker_eGamma)
     from TrigEgammaRec.TrigEgammaToolFactories import TrigCaloClusterMaker_slw
     
     # import BadImportWillFail
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaCleanMonitoring.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaCleanMonitoring.py
index 53faf515724c4f03760d78694bcb67d95483385e..c160f3cc9b7bb171f6ee2fe2e85aba537d914778 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaCleanMonitoring.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaCleanMonitoring.py
@@ -44,6 +44,11 @@ EgammaChainsToKeepMonitoring={
 "g35_loose",
 "g35_medium",
 "g200_loose_L1EM24VHIM",
+#ringer items
+"e28_lhtight_nod0_ringer_ivarloose",
+"e17_lhvloose_nod0_ringer_L1EM15VHI",
+"e60_lhmedium_nod0_ringer_L1EM24VHI",
+"e140_lhloose_nod0_ringer_L1EM24VHI",
 # Support triggers
 "e10_etcut_L1EM7",
 "e15_etcut_L1EM7",
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py
index 384775714c172ab8721df5ce06df705844830443..a5066a5fcaeb568f8611046f4b26299eee04e67e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py
@@ -76,6 +76,7 @@ from TrigEgammaHypo.TrigEFCaloCalibFexConfig import (TrigEFCaloCalibFex_Electron
 
 from TrigMultiVarHypo.TrigL2CaloRingerHypoConfig import (TrigL2CaloRingerFexHypo_e_ID,
                                                          TrigL2CaloRingerFexHypo_e_NoCut,
+                                                         TrigL2CaloRingerFexHypo_g_NoCut,
                                                          TrigL2CaloRingerFexHypo_e_EtCut,
                                                          TrigL2CaloRingerFexHypo_g_EtCut)
 
@@ -138,7 +139,6 @@ def update_map(seq):
 
 # Class to hold all possible Fex configurables
 # Can contain both sequences and single instances
-
 class EgammaFexBuilder(object):
     """
     Summary:
@@ -554,14 +554,18 @@ class EgammaHypoBuilder(object):
             if(tt == 'e'):
                 fex,hypo = TrigL2CaloRingerFexHypo_e_NoCut(thr)
             if(tt == 'g'):
-                fex,hypo = TrigL2CaloRingerFexHypo_e_NoCut(thr)
+                fex,hypo = TrigL2CaloRingerFexHypo_g_NoCut(thr)
         elif self._properties['etcut']:
             if(tt == 'e'):
                 fex,hypo = TrigL2CaloRingerFexHypo_e_EtCut(thr)
             if(tt == 'g'):
                 fex,hypo = TrigL2CaloRingerFexHypo_g_EtCut(thr)
         elif idinfo:
-            fex, hypo = TrigL2CaloRingerFexHypo_e_ID(thr,idinfo,tt)
+            if(tt == 'e'):
+                fex, hypo = TrigL2CaloRingerFexHypo_e_ID(thr,idinfo,tt)
+            if(tt == 'g'):
+                # For now, there is no photon ringer tuning. 
+                fex, hypo = TrigL2CaloRingerFexHypo_g_NoCut(thr)
         else:
             log.error('Cannot configure ringer')
         seq = [fex,hypo]
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py
index 186e645ebaa2770bae9b694fd4abcd68fdb1ba71..74ffac2101b78008fc5aad951c369cf6c94221e0 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py
@@ -57,7 +57,7 @@ class doRinger(JobProperty):
     '''apply ringer selection for Electron chains'''
     statusOn=True
     allowedTypes=['bool']
-    StoredValue=False
+    StoredValue=True
 
 _flags.append(doRinger) 
 
@@ -65,7 +65,7 @@ class ringerVersion (JobProperty):
     """ Version ringer tunes """
     statusOn=True
     allowedTypes=['str']
-    StoreValues='RingerSelectorTools/TrigL2_20170505_v6'
+    StoredValue='RingerSelectorTools/TrigL2_20170505_v6'
 
 _flags.append(ringerVersion)
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py
index e2d0e81284edde8a2656ea269445ba67ff41d22e..338ee5a20829430192679fe7e2c9a2e29ac103f1 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py
@@ -129,7 +129,10 @@ class L2EFChain_e(L2EFChainDef):
         thr = self.chainPart['threshold']
         log.debug("Apply ringer %s",self._ringer_selection)
 
-        if TriggerFlags.EgammaSlice.doRinger:
+        if 'noringer' in self.chainPart['addInfo']:
+          log.debug('No Ringer selection used. Disable the ringer for this chain.')
+          self._ringer_selection=False
+        elif TriggerFlags.EgammaSlice.doRinger:
             log.debug('Ringer selection applied for all chains above 15 GeV %s',thr)
             if 'merged' in self.chainPart['IDinfo']:
                 self._ringer_selection=False
@@ -144,6 +147,7 @@ class L2EFChain_e(L2EFChainDef):
                 self._ringer_selection=True
             else:
                 self._ringer_selection=False
+        
         log.debug("Apply ringer is set %s",self._ringer_selection)
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py
deleted file mode 100644
index a72dc417b2153fe972aa4a386af6e64eff901077..0000000000000000000000000000000000000000
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py
+++ /dev/null
@@ -1,998 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-""" Electron trigger slice signatures  """
-
-__author__  = 'Moritz Backes & Catrin Bernius'
-__version__=""
-__doc__="Implementation of Electron Signature"
-
-from AthenaCommon.Logging import logging
-logging.getLogger().info("Importing %s",__name__)
-log = logging.getLogger("TriggerMenu.egamma.ElectronDef")
-
-from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap
-
-##########################################################################################
-#
-# Import and create fexes and hypos
-# Move global imports to class methods
-# Leave commented for now
-########################################################################################## 
-#from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma, T2CaloEgamma_SwSeed, T2CaloEgamma_SwSeed_NoCut
-#from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_SwCluster, T2CaloEgamma_Ringer, T2CaloEgamma_cells
-from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_cells
-#from TrigL2MissingET.TrigL2MissingETConfig import L2CaloMissingET_Fex
-
-#theT2CaloEgamma_eGamma            = T2CaloEgamma_eGamma()
-#theT2CaloEgamma_SwSeed            = T2CaloEgamma_SwSeed()
-#theT2CaloEgamma_SwSeed_NoCut      = T2CaloEgamma_SwSeed_NoCut()
-#theT2CaloEgamma_SwCluster         = T2CaloEgamma_SwCluster()
-#theT2CaloEgamma_Ringer            = T2CaloEgamma_Ringer()
-#theL2CaloMissingET_Fex            = L2CaloMissingET_Fex() 
-theT2CaloEgamma_cells_e           = T2CaloEgamma_cells("T2CaloEgamma_cells")
-
-#from TrigIDSCAN.TrigIDSCAN_Config import TrigIDSCAN_eGamma
-#from TrigSiTrack.TrigSiTrack_Config import TrigSiTrack_eGamma, TrigSiTrack_eGamma_robust
-#from TrigL2TRTSegFinder.TrigTRTSegFinder_Config import TrigTRTSegFinder_eGamma
-
-#theTrigIDSCAN_eGamma              = TrigIDSCAN_eGamma()
-#theTrigSiTrack_eGamma             = TrigSiTrack_eGamma()
-#theTrigSiTrack_eGamma_robust      = TrigSiTrack_eGamma_robust()
-#theTrigTRTSegFinder_eGamma        = TrigTRTSegFinder_eGamma()
-
-#from TrigEgammaHypo.TrigL2CaloHypoConfig     import *
-#from TrigEgammaHypo.TrigL2ElectronFexConfig  import *
-#from TrigEgammaHypo.TrigL2ElectronHypoConfig import *
-#from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralHypoConfig_e10
-#from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralHypoConfig_e5
-#from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralHypoConfig_e5_NoCut
-#from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralFexConfig_e5
-#from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralFexConfig_e10
-
-#from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma,   TrigCaloCellMaker_eGamma_cells,  TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw
-#theTrigCaloCellMaker_eGamma      = TrigCaloCellMaker_eGamma()
-#theTrigCaloTowerMaker_eGamma     = TrigCaloTowerMaker_eGamma()
-#theTrigCaloClusterMaker_slw      = TrigCaloClusterMaker_slw()
-
-#from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma_cells
-#theTrigCaloCellMaker_eGamma_cells= TrigCaloCellMaker_eGamma_cells()
-
-from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-[trkfast, trkprec] = TrigInDetSequence("Electron", "electron", "IDTrig").getSequence()
-
-from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-[theFastTrackFinderxAOD]                  = TrigInDetSequence("Electron","electron","FastxAOD").getSequence()
-[theL2StarxAOD]                           = TrigInDetSequence("Electron","electron","L2StarxAOD").getSequence()
-
-#theTrigEFIDOutsideInTRTOnly_Electron    = TrigEFIDSequence("Electron","electron","TRTOnly").getSequence()
-#theTrigEFIDCombined_Electron            = TrigEFIDCombined("Electron","photon", "Combined").getSequence()
-from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_eGamma as TrigFastTrackFinder_Electron
-theTrigFastTrackFinder_Electron = TrigFastTrackFinder_Electron()
-
-#from TrigEgammaHypo.TrigEFTrackHypoConfig    import *
-#from TrigEgammaHypo.TrigEFElectronHypoConfig import *
-#from TrigEgammaRec.TrigEgammaRecConfig       import *
-#theTrigEgammaRec_eGamma                  = TrigEgammaRec_eGamma()
-
-
-from TrigGenericAlgs.TrigGenericAlgsConf import PrescaleAlgo
-terminateAlgo = PrescaleAlgo('terminateAlgo')
-
-##########################################################################################
-#
-# L2 & EF Chain configuration helper classes
-#
-##########################################################################################
-
-class L2EFChain_e(L2EFChainDef):
-   
-    def __init__(self, chainDict):
-
-        self.L2sequenceList   = []
-        self.EFsequenceList   = []
-        self.L2signatureList  = []
-        self.EFsignatureList  = []
-        self.TErenamingDict   = []
-    
-        self.chainPart = chainDict['chainParts']
-
-        self.chainL1Item = chainDict['L1item']        
-        self.chainPartL1Item = self.chainPart['L1item']
-
-        self.chainCounter = chainDict['chainCounter']       
-        self.L2Name = 'L2_'+self.chainPart['chainPartName']
-        self.EFName = 'EF_'+self.chainPart['chainPartName']
-        self.mult = int(self.chainPart['multiplicity'])
-        self.chainName = chainDict['chainName']
-        self.chainPartName = self.chainPart['chainPartName']
-        self.chainPartNameNoMult = self.chainPartName[1:] if self.mult > 1 else self.chainPartName
-        self.chainPartNameNoMult += "_"+self.chainL1Item
-
-        
-        self.L2InputTE = self.chainPartL1Item or self.chainL1Item
-        # 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
-
-                
-        # eXXvh_ID type chains:
-        
-        if self.chainPart['trkInfo']=='idperf': #True:# self.chainPart['IDinfo'] \
-           #and not self.chainPart['isoInfo'] \
-           #and not self.chainPart['FSinfo'] \
-           #and not self.chainPart['recoAlg'] \
-           #and not self.chainPart['hypoInfo'] \
-           #and not self.chainPart['trkInfo'] \
-           #and not self.chainPart['reccalibInfo']:
-          self.setup_eXXvh_idperf()
-        elif self.chainPart['L2IDAlg']:
-           self.setup_eXXvh_ID()
-        else:
-           self.setup_eXXvh_ID_run2()
-            
-        L2EFChainDef.__init__(self, self.chainName, self.L2Name, self.chainCounter, self.chainL1Item, self.EFName, self.chainCounter, self.L2InputTE)
-        
-
-    def defineSequences(self):
-
-        for sequence in self.L2sequenceList:
-            self.addL2Sequence(*sequence)
-
-        for sequence in self.EFsequenceList:
-            self.addEFSequence(*sequence)
-                
-    def defineSignatures(self):
-       
-        for signature in self.L2signatureList:
-            self.addL2Signature(*signature)
-
-        for signature in self.EFsignatureList:
-            self.addEFSignature(*signature)
-
-    def defineTErenaming(self):
-        self.TErenamingMap = self.TErenamingDict
-
-
-
-
-############################### DEFINE GROUPS OF CHAINS HERE ##############################
-
-
-    def setup_eXXvh_ID(self):
-        threshold = self.chainPart['threshold']
-        IDinfo = self.chainPart['IDinfo']
-        isoInfo = self.chainPart['isoInfo']
-        addInfo = self.chainPart['addInfo']
-        trkInfo = self.chainPart['trkInfo']
-        L2IDAlg = self.chainPart['L2IDAlg']
-        
-        log.info('setup_eXXvh_ID')
-        log.info('threshold: %s',threshold)
-        log.info('isoInfo: %s',isoInfo)
-        log.info('IDinfo: %s',IDinfo)
-        log.info('addInfo: %s',addInfo)
-        log.info('trkInfo: %s',trkInfo)
-       
-        # common imports required for EtCut and Electron ID chains
-        # L2 Calo FEX
-        from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma
-        theT2CaloEgamma_eGamma            = T2CaloEgamma_eGamma()
-        
-        # L2 Tracking FEX
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaA
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaB
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaC
-        
-        # L2 Elecgtron FEX
-        from TrigEgammaHypo.TrigL2ElectronFexConfig  import L2ElectronFex_L2StarA
-        from TrigEgammaHypo.TrigL2ElectronFexConfig  import L2ElectronFex_L2StarB
-        from TrigEgammaHypo.TrigL2ElectronFexConfig  import L2ElectronFex_L2StarC
-        # Depends on L2 Strategy
-        log.info('L2IDAlg: %s', self.chainPart['L2IDAlg'])
-        if self.chainPart['L2IDAlg']: 
-            if L2IDAlg == 'L2StarA': 
-                theL2TrackingFex = TrigL2SiTrackFinder_eGammaA()
-                theL2ElectronFex = L2ElectronFex_L2StarA()
-            elif L2IDAlg == 'L2StarB': 
-                theL2TrackingFex = TrigL2SiTrackFinder_eGammaB()
-                theL2ElectronFex = L2ElectronFex_L2StarB()
-            elif L2IDAlg == 'L2StarC': 
-                theL2TrackingFex = TrigL2SiTrackFinder_eGammaC()
-                theL2ElectronFex = L2ElectronFex_L2StarC()
-            else:
-                log.info('Incorrect L2IDAlg')
-        # Default
-        else:
-            log.info('Use default L2StarA tracking')
-            theL2TrackingFex = TrigL2SiTrackFinder_eGammaA()
-            theL2ElectronFex = L2ElectronFex_L2StarA()
- 
-        
-
-        # EF Calo
-        from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw
-        theTrigCaloCellMaker_eGamma      = TrigCaloCellMaker_eGamma()
-        theTrigCaloTowerMaker_eGamma     = TrigCaloTowerMaker_eGamma()
-        theTrigCaloClusterMaker_slw      = TrigCaloClusterMaker_slw()
-        
-        # EF Tracking
-        from InDetTrigRecExample.EFInDetConfig import TrigEFIDInsideOut_Electron
-        theEFElectronIDFex           = TrigEFIDInsideOut_Electron("Electron").getSequence()
-        
-        # EF Electron FEX
-        from TrigEgammaRec.TrigEgammaRecConfig       import TrigEgammaRec_eGamma
-        theTrigEgammaRec_eGamma                  = TrigEgammaRec_eGamma()
-        #print 'ESETUP', self.chainPart
-        # these can be made more configurable later (according to tracking algorithms etc...)
-        if 'etcut' in self.chainPart['addInfo']:
-
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_EtCut
-            theL2CaloHypo      = L2CaloHypo_NoCut("L2CaloHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theL2ElectronHypo  = L2ElectronHypo_e_NoCut("L2ElectronHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theEFTrackHypo     = EFTrackHypo_e_NoCut("EFTrackHypo_e"+str(threshold)+"_NoCut",threshold) 
-            theEFElectronHypo  = TrigEFElectronHypo_e_EtCut("TrigEFElectronHypo_e"+str(threshold)+"_EtCut",threshold)
-            
-        elif 'perf' in self.chainPart['addInfo']:
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_NoCut
-            theL2CaloHypo      = L2CaloHypo_NoCut("L2CaloHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theL2ElectronHypo  = L2ElectronHypo_e_NoCut("L2ElectronHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theEFTrackHypo     = EFTrackHypo_e_NoCut("EFTrackHypo_e"+str(threshold)+"_NoCut",threshold) 
-            # EF Electron
-            theEFElectronHypo  = TrigEFElectronHypo_e_NoCut("TrigEFElectronHypo_e"+str(threshold)+"_NoCut",threshold)
-        
-        elif self.chainPart['IDinfo']:
-            algoSuffix = "e%s_%s()" % (str(threshold),IDinfo)
-            log.info('chain suffix: %s', algoSuffix)
-            #if 'mvt' in algoSuffix: 
-            #    algoSuffix = algoSuffix.replace('mvt','')
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_e_ID
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_ID
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_ID_L2TrkAlg
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_ID
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_Iso
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e
-            
-            # L2 Calo
-            theL2CaloHypo = L2CaloHypo_e_ID("TrigL2CaloHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-            
-            # L2 Electron
-            if self.chainPart['L2IDAlg']:
-                theL2ElectronHypo  = L2ElectronHypo_e_ID_L2TrkAlg("TrigL2ElectronHypo_e"+str(threshold)+"_"+str(IDinfo)+"_"+str(L2IDAlg),threshold,IDinfo,L2IDAlg)
-            else:
-                theL2ElectronHypo  = L2ElectronHypo_e_ID("TrigL2ElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-            
-            # EF Track
-            theEFTrackHypo     = EFTrackHypo_e("EFTrackHypo_e"+str(threshold)+"_"+str(IDinfo),threshold)
-            
-            # EF Electron
-            if self.chainPart['isoInfo']:
-                theEFElectronHypo  = TrigEFElectronHypo_e_Iso("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo)+"_"+str(isoInfo),threshold,IDinfo,isoInfo)
-            else: 
-                theEFElectronHypo  = TrigEFElectronHypo_e_ID("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-        else:
-            algoSuffix = "e%s_%s()" % (str(threshold),IDinfo)
-            log.error('Chain %s could not be assembled', self.chainPartName)
-            log.erro('chain suffix: %s', algoSuffix)
-            return False
-        
-        ########### Sequences ###########
-        
-        self.L2sequenceList += [[self.L2InputTE, 
-                                 [theT2CaloEgamma_eGamma, theL2CaloHypo], 
-                                 'L2_e_step1']]
-        
-        self.L2sequenceList += [[['L2_e_step1'],    
-                                 [theL2TrackingFex]+theL2StarxAOD, 
-                                 'L2_e_step2']]
-        
-        self.L2sequenceList += [[['L2_e_step2'], 
-                                 [theL2ElectronFex, theL2ElectronHypo], 
-                                 'L2_e_step3']]
-        
-        self.EFsequenceList += [[['L2_e_step3'], 
-                                 [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-                                 'EF_e_step1']]
-        
-        self.EFsequenceList += [[['EF_e_step1'], 
-                                 theEFElectronIDFex+[ theEFTrackHypo],
-                                 'EF_e_step2']]
-        
-        self.EFsequenceList += [[['EF_e_step2'], 
-                                 [theTrigEgammaRec_eGamma, theEFElectronHypo], 
-                                 'EF_e_step3']]
-
-        ########### Signatures ###########
-
-        self.L2signatureList += [ [['L2_e_step1']*self.mult] ]
-        self.L2signatureList += [ [['L2_e_step2']*self.mult] ]
-        self.L2signatureList += [ [['L2_e_step3']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step1']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step2']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step3']*self.mult] ]
-
-        ########### TE renaming ###########
-
-        self.TErenamingDict = {
-            'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'),
-            'L2_e_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'id'),
-            'L2_e_step3': mergeRemovingOverlap('L2_', self.chainPartNameNoMult),
-            'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calo'),
-            'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'id'),
-            'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult),
-            }
-
-
-    def setup_eXXvh_idperf(self):
-
-        threshold = self.chainPart['threshold']
-        IDinfo = self.chainPart['IDinfo']
-        isoInfo = self.chainPart['isoInfo']
-        run1 = self.chainPart['trkInfo']
-       
-        log.info('setup_eXXvh_idperf')
-        log.info('threshold: %s',threshold)
-        log.info('isoInfo: %s',isoInfo)
-        log.info('IDinfo: %s',IDinfo)
-        log.info('trkInfo: %s',run1)
-        
-        # L2 Tracking FEX
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaA
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaB
-        from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaC
-        theTrigL2SiTrackFinder_eGammaA=TrigL2SiTrackFinder_eGammaA()
-        theTrigL2SiTrackFinder_eGammaB=TrigL2SiTrackFinder_eGammaB()
-        theTrigL2SiTrackFinder_eGammaC=TrigL2SiTrackFinder_eGammaC()
-        # EF Calo
-        from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma_cells
-        #theTrigCaloCellMaker_eGamma_cells= TrigCaloCellMaker_eGamma_cells()
-        from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw
-        theTrigCaloCellMaker_eGamma      = TrigCaloCellMaker_eGamma()
-        theTrigCaloTowerMaker_eGamma     = TrigCaloTowerMaker_eGamma()
-        theTrigCaloClusterMaker_slw      = TrigCaloClusterMaker_slw()
-        
-        # EF Tracking
-        from InDetTrigRecExample.EFInDetConfig import TrigEFIDInsideOut_Electron
-        theEFElectronIDFex           = TrigEFIDInsideOut_Electron("Electron").getSequence()
-
-        # EF Electron FEX
-        from TrigEgammaRec.TrigEgammaRecConfig       import TrigEgammaRec_eGamma
-        theTrigEgammaRec_eGamma                  = TrigEgammaRec_eGamma()
-        #print 'ESETUP', self.chainPart
-        # these can be made more configurable later (according to tracking algorithms etc...)
-        
-        if 'etcut' in self.chainPart['addInfo']:
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_EtCut
-            theL2CaloHypo      = L2CaloHypo_NoCut("L2CaloHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theEFElectronHypo  = TrigEFElectronHypo_e_EtCut("TrigEFElectronHypo_e"+str(threshold)+"_EtCut",threshold)
-        elif self.chainPart['IDinfo']:
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_e_ID
-            theL2CaloHypo = L2CaloHypo_e_ID("TrigL2CaloHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_ID_CaloOnly
-            theEFElectronHypo  = \
-                TrigEFElectronHypo_e_ID_CaloOnly("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo)+"_CaloOnly",threshold,IDinfo)
-
-
-        ########### Sequences ###########
-        trkseq = trkfast+trkprec
-
-        #calo thresholds here?
-        self.L2sequenceList += [[self.L2InputTE, 
-                                 [theT2CaloEgamma_cells_e, theL2CaloHypo], 
-                                 'L2_e_step1']]
-        
-        self.EFsequenceList += [[['L2_e_step1'], 
-                                 [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-                                 'EF_e_step1']]
-        
-        if 'L2Star' in self.chainPart['addInfo']:
-            self.EFsequenceList += [[['EF_e_step1'], 
-                                     [theTrigL2SiTrackFinder_eGammaA]+theL2StarxAOD+
-                                     [theTrigL2SiTrackFinder_eGammaB]+theL2StarxAOD+
-                                     [theTrigL2SiTrackFinder_eGammaC]+theL2StarxAOD+theEFElectronIDFex,
-                                     'EF_e_step2']]
-        else:
-            self.EFsequenceList += [[['EF_e_step1'], 
-                                     trkseq,
-                                     'EF_e_step2']]
-        
-        self.EFsequenceList += [[['EF_e_step2'], 
-                                 [theTrigEgammaRec_eGamma, theEFElectronHypo], 
-                                 'EF_e_step3']]
-
-        ########### Signatures ###########
-
-        self.L2signatureList += [ [['L2_e_step1']*self.mult] ]
-        #self.L2signatureList += [ [['L2_e_step2']*self.mult] ]
-        #self.L2signatureList += [ [['L2_e_step3']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step1']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step2']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step3']*self.mult] ]
-
-        ########### TE renaming ###########
-
-        self.TErenamingDict = {
-            'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'),
-            'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'cl'),
-            'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'trk'),
-            'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult),
-            }
-
-
-    def setup_eXXvh_ID_run2(self):
-        threshold = self.chainPart['threshold']
-        IDinfo = self.chainPart['IDinfo']
-        isoInfo = self.chainPart['isoInfo']
-        trkInfo = self.chainPart['trkInfo']
-      
-        log.info('setup_eXXvh_ID_run2')
-        log.info('threshold: %s',threshold)
-        log.info('isoInfo: %s',isoInfo)
-        log.info('IDinfo: %s',IDinfo)
-        log.info('trkInfo: %s',trkInfo)
-       
-        # common imports required for EtCut and Electron ID chains
-        # L2 Calo FEX
-        from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma
-        theT2CaloEgamma_eGamma            = T2CaloEgamma_eGamma()
-        
-        # L2 Elecgtron FEX
-        from TrigEgammaHypo.TrigL2ElectronFexConfig  import L2ElectronFex_1
-        # Depends on L2 Strategy
-        theL2ElectronFex = L2ElectronFex_1()
- 
-        # EF Calo
-        from TrigCaloRec.TrigCaloRecConfig import  TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw
-        theTrigCaloCellMaker_eGamma      = TrigCaloCellMaker_eGamma()
-        theTrigCaloTowerMaker_eGamma     = TrigCaloTowerMaker_eGamma()
-        theTrigCaloClusterMaker_slw      = TrigCaloClusterMaker_slw()
-        
-        # EF Tracking
-        theEFElectronIDFex           = theTrigEFIDInsideOutMerged_Electron
-        # EF Electron FEX
-        from TrigEgammaRec.TrigEgammaRecConfig       import TrigEgammaRec_eGamma
-        theTrigEgammaRec_eGamma                  = TrigEgammaRec_eGamma()
-        #print 'ESETUP', self.chainPart
-        # these can be made more configurable later (according to tracking algorithms etc...)
-        if 'etcut' in self.chainPart['addInfo']:
-
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_EtCut
-            theL2CaloHypo      = L2CaloHypo_NoCut("L2CaloHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theL2ElectronHypo  = L2ElectronHypo_e_NoCut("L2ElectronHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theEFTrackHypo     = EFTrackHypo_e_NoCut("EFTrackHypo_e"+str(threshold)+"_NoCut",threshold) 
-            theEFElectronHypo  = TrigEFElectronHypo_e_EtCut("TrigEFElectronHypo_e"+str(threshold)+"_EtCut",threshold)
-        elif 'perf' in self.chainPart['addInfo']:
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e_NoCut
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_NoCut
-            theL2CaloHypo      = L2CaloHypo_NoCut("L2CaloHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theL2ElectronHypo  = L2ElectronHypo_e_NoCut("L2ElectronHypo_e"+str(threshold)+"_NoCut",threshold ) 
-            theEFTrackHypo     = EFTrackHypo_e_NoCut("EFTrackHypo_e"+str(threshold)+"_NoCut",threshold) 
-            # EF Electron
-            theEFElectronHypo  = TrigEFElectronHypo_e_NoCut("TrigEFElectronHypo_e"+str(threshold)+"_NoCut",threshold)
-
-        elif self.chainPart['IDinfo']:
-            algoSuffix = "e%s_%s()" % (str(threshold),IDinfo)
-            log.info('chain suffix: %s', algoSuffix)
-            #if 'mvt' in algoSuffix: 
-            #    algoSuffix = algoSuffix.replace('mvt','')
-            from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_e_ID
-            from TrigEgammaHypo.TrigL2ElectronHypoConfig import L2ElectronHypo_e_ID
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_ID
-            from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_Iso
-            from TrigEgammaHypo.TrigEFTrackHypoConfig import EFTrackHypo_e
-            
-            # L2 Calo
-            theL2CaloHypo = L2CaloHypo_e_ID("TrigL2CaloHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-            
-            # L2 Electron
-            theL2ElectronHypo  = L2ElectronHypo_e_ID("TrigL2ElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-            
-            # EF Track
-            theEFTrackHypo     = EFTrackHypo_e("EFTrackHypo_e"+str(threshold)+"_"+str(IDinfo),threshold)
-            
-            # EF Electron
-            if self.chainPart['isoInfo']:
-                theEFElectronHypo  = TrigEFElectronHypo_e_Iso("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo)+"_"+str(isoInfo),threshold,IDinfo,isoInfo)
-            else: 
-                theEFElectronHypo  = TrigEFElectronHypo_e_ID("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo)
-        else:
-            algoSuffix = "e%s_%s()" % (str(threshold),IDinfo)
-            log.error('Chain %s could not be assembled', self.chainPartName)
-            log.erro('chain suffix: %s', algoSuffix)
-            return False
-        
-        ########### Sequences ###########
-        
-        trkcomb1st = list(theTrigEFIDDataPrep_Electron)
-        trkcomb1st.append(theTrigFastTrackFinder_Electron)
-        trkcomb1st += theFastTrackFinderxAOD
-        trkcombfull = list(trkcomb1st)
-        trkcombfull += theTrigEFIDInsideOutMerged_Electron
-
-        self.L2sequenceList += [[self.L2InputTE, 
-                                 [theT2CaloEgamma_eGamma, theL2CaloHypo], 
-                                 'L2_e_step1']]
-        
-        self.L2sequenceList += [[['L2_e_step1'],    
-                                 trkfast, 
-                                 'L2_e_step2']]
-        
-        self.L2sequenceList += [[['L2_e_step2'], 
-                                 [theL2ElectronFex, theL2ElectronHypo], 
-                                 'L2_e_step3']]
-        
-        self.EFsequenceList += [[['L2_e_step3'], 
-                                 [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-                                 'EF_e_step1']]
-        
-        self.EFsequenceList += [[['EF_e_step1'], 
-                                 theEFElectronIDFex+[ theEFTrackHypo],
-                                 #trkfast+trkprec+[ theEFTrackHypo],
-                                 'EF_e_step2']]
-        
-        self.EFsequenceList += [[['EF_e_step2'], 
-                                 [theTrigEgammaRec_eGamma, theEFElectronHypo], 
-                                 'EF_e_step3']]
-
-        ########### Signatures ###########
-
-        self.L2signatureList += [ [['L2_e_step1']*self.mult] ]
-        self.L2signatureList += [ [['L2_e_step2']*self.mult] ]
-        self.L2signatureList += [ [['L2_e_step3']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step1']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step2']*self.mult] ]
-        self.EFsignatureList += [ [['EF_e_step3']*self.mult] ]
-
-        ########### TE renaming ###########
-
-        self.TErenamingDict = {
-            'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'),
-            'L2_e_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'id'),
-            'L2_e_step3': mergeRemovingOverlap('L2_', self.chainPartNameNoMult),
-            'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calo'),
-            'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'id'),
-            'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult),
-            }
-
-# class L2EFChain_e_NoIDTrkCut(L2EFChain_e):
-
-#     def defineSequences(self, config):
-#         ###### L2 ######
-#         # Step 1: Calo Fex and Hypo
-#         self.addL2Sequence(self.inputTEs,
-#                            [theT2CaloEgamma_cells_e, config.L2Config.TrigL2CaloHypo_1],
-#                            'L2_e_step1')
-        
-#         # Step 2: ID Fex
-#         #append "_R1" to IDTrkNoCut chains running IDScan and SiTrack
-#         if '_R1' in self.sig_id:
-#             self.addL2Sequence(['L2_e_step1'],
-#                                [theTrigL2SiTrackFinder_eGammaA,
-#                                 theTrigL2SiTrackFinder_eGammaB,
-#                                 theTrigL2SiTrackFinder_eGammaC,
-#                                 theTrigL2SiTrackFinder_eGammaBC,
-#                                 theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma, theTrigTRTSegFinder_eGamma,
-#                                 ],
-#                                'L2_e_step2')
-            
-#         elif 'L2Star' in self.sig_id:
-#             self.addL2Sequence(['L2_e_step1'],
-#                                [theTrigL2SiTrackFinder_eGammaA, theTrigL2SiTrackFinder_eGammaB, theTrigL2SiTrackFinder_eGammaC],
-#                                'L2_e_step2')
-
-#         else:
-#             #remove IDScan and SiTrack from IDTrkNoCut chains
-#             self.addL2Sequence(['L2_e_step1'],
-#                                [theTrigL2SiTrackFinder_eGammaA,
-#                                 theTrigL2SiTrackFinder_eGammaB,
-#                                 theTrigL2SiTrackFinder_eGammaC,
-#                                 theTrigL2SiTrackFinder_eGammaBC,
-#                                 theTrigTRTSegFinder_eGamma,
-#                                 ],
-#                                'L2_e_step2')
-        
-#         # Step 3: ID-Calo Fex and Hypo
-#         if 'L2Star' in self.sig_id:
-#             self.addL2Sequence(['L2_e_step2'], [config.L2Config.TrigL2ElectronFex_1], 'L2_e_step3')
-#         else:
-#             self.addL2Sequence(['L2_e_step2'],
-#                                [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1],
-#                                'L2_e_step3')
-            
-        
-#         ###### EF ######
-#         # Step 1: Calo Fex
-#         self.addEFSequence('L2_e_step3', 
-#                            [theTrigCaloCellMaker_eGamma_cells, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw],
-#                            'EF_e_step1')
-#         # Step 2: ID Fex and Hypo
-#         self.addEFSequence('EF_e_step1', theTrigEFIDInsideOut_Electron, 'EF_e_step2')
-#         self.addEFSequence('EF_e_step2', theTrigEFIDOutsideInTRTOnly_Electron, 'EF_e_step3')
-#         # Step 3: ID-Calo Fex and Hypo
-#         self.addEFSequence('EF_e_step3', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1],
-#                            'EF_e_step4')
-
-
-#     def defineSignatures(self):
-#         self.addL2Signature(['L2_e_step1']*self.mult)
-#         self.addL2Signature(['L2_e_step2']*self.mult)
-#         self.addL2Signature(['L2_e_step3']*self.mult)
-#         self.addEFSignature(['EF_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step2']*self.mult)
-#         self.addEFSignature(['EF_e_step3']*self.mult)
-#         self.addEFSignature(['EF_e_step4']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id_noMult+'cl'),
-#             'L2_e_step2': mergeRemovingOverlap('L2_', self.sig_id_noMult+'id'),
-#             'L2_e_step3': mergeRemovingOverlap('L2_', self.sig_id_noMult),
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id_noMult+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id_noMult+'id1'),
-#             'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id_noMult+'id2'),
-#             'EF_e_step4': mergeRemovingOverlap('EF_', self.sig_id_noMult),
-#             }
-
-
-
-
-
-# class L2EFChain_e_L2Star(L2EFChain_e):
-#     def defineSequences(self, config):
-
-#         lastpart = self.getlastpart(self.sig_id)
-
-#         if   lastpart == 'L2StarA':
-#             myTrigL2SiTrackFinder_eGamma_1 = theTrigL2SiTrackFinder_eGammaA
-#             myl2electronfex = L2ElectronFex_L2StarA()
-#         elif lastpart == 'L2StarB':
-#             myTrigL2SiTrackFinder_eGamma_1 = theTrigL2SiTrackFinder_eGammaB
-#             myl2electronfex = L2ElectronFex_L2StarB()
-#         elif lastpart == 'L2StarC':
-#             myTrigL2SiTrackFinder_eGamma_1 = theTrigL2SiTrackFinder_eGammaC
-#             myl2electronfex = L2ElectronFex_L2StarC()
-#         else:
-#             myTrigL2SiTrackFinder_eGamma_1 = theTrigL2SiTrackFinder_eGammaA
-#             myl2electronfex = L2ElectronFex_L2StarA()
-
-
-#         l2electronhypo = TrigL2ElectronHypo('L2ElectronHypo_'+self.sig_id)
-
-#         ###### L2 ######
-#         if ('etcut_L2Star' in self.sig_id):
-#             self.addL2Sequence(self.inputTEs,[theT2CaloEgamma_eGamma], 'L2_e_step1')
-#             self.addL2Sequence(['L2_e_step1'], [myTrigL2SiTrackFinder_eGamma_1], 'L2_e_step2')
-#             self.addL2Sequence(['L2_e_step2'], [myl2electronfex],  'L2_e_step3')            
-#         else:
-#             self.addL2Sequence(self.inputTEs,
-#                                [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1],
-#                                'L2_e_step1')
-#             self.addL2Sequence(['L2_e_step1'], [myTrigL2SiTrackFinder_eGamma_1], 'L2_e_step2')
-#             self.addL2Sequence(['L2_e_step2'], [myl2electronfex, l2electronhypo], 'L2_e_step3')
-
-
-#         ###### EF ######
-#         self.addEFSequence('L2_e_step3', 
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw],
-#                            'EF_e_step1')
-
-#         if ('etcut_L2Star' in self.sig_id):
-#             self.addEFSequence('EF_e_step1', theTrigEFIDInsideOut_Electron, 'EF_e_step2')
-#             self.addEFSequence('EF_e_step2', [theTrigEgammaRec_eGamma], 'EF_e_step3')
-#         else:
-#             self.addEFSequence('EF_e_step1', 
-#                                theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1],
-#                                'EF_e_step2')
-#             self.addEFSequence('EF_e_step2', 
-#                                [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1],
-#                                'EF_e_step3')
-        
-
-
-# ############################################# Savannah #101482 1)
-# class L2EFChain_e_noL2ID(L2EFChain_e): 
-#     def defineSequences(self, config): 
-#         self.addL2Sequence(self.inputTEs, 
-#                            [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], 
-#                            'L2_e_step1')
-#         self.addEFSequence('L2_e_step1', 
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-#                            'EF_e_step1') 
-#         self.addEFSequence('EF_e_step1', 
-#                            theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], 
-#                            'EF_e_step2') 
-#         self.addEFSequence('EF_e_step2', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], 
-#                            'EF_e_step3') 
-        
-#     def defineSignatures(self):
-#         self.addL2Signature(['L2_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step2']*self.mult)
-#         self.addEFSignature(['EF_e_step3']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id_noMult),
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id_noMult+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id_noMult+'id'),
-#             'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id_noMult),
-#             }
-
-
-# ############################################# Savannah #101482 2)
-# class L2EFChain_e_noL2IDnoEFID(L2EFChain_e): 
-#     def defineSequences(self, config): 
-#         # L2 ######
-#         # Step 1: Calo Fex and Hypo 
-#         self.addL2Sequence(self.inputTEs, 
-#                            [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], 
-#                            'L2_e_step1')
-
-#         # EF ###### 
-#         # Step 1: Calo Fex 
-#         self.addEFSequence('L2_e_step1', 
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-#                            'EF_e_step1') 
-
-#         # Step 3: ID-Calo Fex and Hypo 
-#         self.addEFSequence('EF_e_step1', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], 
-#                            'EF_e_step2') 
-        
-#     def defineSignatures(self):
-#         self.addL2Signature(['L2_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step2']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id_noMult),
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id_noMult+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id_noMult),
-#             }
-
-# ############################################# Savannah #101482 3)
-# class L2EFChain_e_noL2IDnoEF(L2EFChain_e): 
-
-#     def defineSequences(self, config): 
-#         self.addL2Sequence(self.inputTEs, 
-#                            [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], 
-#                            'L2_e_step1')
-             
-#     def defineSignatures(self):
-#         self.addL2Signature(['L2_e_step1']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id_noMult),
-#             }
-
-# ############################################# Savannah #101482 4)
-# class L2EFChain_e_noL2noEFID(L2EFChain_e): 
-
-#     def defineSequences(self, config):       
-#         self.addEFSequence(self.inputTEs, 
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-#                            'EF_e_step1') 
-#         self.addEFSequence('EF_e_step1', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], 
-#                            'EF_e_step2') 
-        
-#     def defineSignatures(self):
-#         self.addEFSignature(['EF_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step2']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id_noMult+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id_noMult),
-#             }
-
-# ############################################# Savannah #101482 5)
-# class L2EFChain_e_noL2(L2EFChain_e): 
-
-#     def defineSequences(self, config): 
-#         self.addEFSequence(self.inputTEs, 
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], 
-#                            'EF_e_step1') 
-#         self.addEFSequence('EF_e_step1', 
-#                            theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], 
-#                            'EF_e_step2') 
-#         self.addEFSequence('EF_e_step2', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], 
-#                            'EF_e_step3')
-        
-#     def defineSignatures(self):
-#         self.addEFSignature(['EF_e_step1']*self.mult)
-#         self.addEFSignature(['EF_e_step2']*self.mult)
-#         self.addEFSignature(['EF_e_step3']*self.mult)
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id_noMult+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id_noMult+'id'),
-#             'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id_noMult),
-#             }
-
-
-
-##########################################################################################
-#
-# Helper class for writing python code, eg HLT to L1 maps
-#
-##########################################################################################
-class ElectronCodeHelper:
-    def __init__(self):
-        
-        global Electrons
-
-        iwidth = int(0)
-        for echain in Electrons:
-            if iwidth < len(echain.l2chain.sig_id):
-                iwidth = len(echain.l2chain.sig_id) 
-            
-        for echain in Electrons:
-            l2name = '\''+echain.l2chain.sig_id.rstrip()+'\''
-            l1name = '\''+echain.l2chain.lower_chain_name.rstrip()+'\''
-            lempty = ''
-            for istep in range(len(echain.l2chain.sig_id), iwidth):
-                lempty += ' '
-            
-        for echain in Electrons:
-            if echain.l2chain.lower_chain_name not in l1map:
-                l1map[echain.l2chain.lower_chain_name] = echain.l2chain.inputTEs
-
-
-##########################################################################################
-#
-# Exception class
-#
-##########################################################################################
-class EgammaMapError(Exception):
-    def __init__(self, value):
-        self.value = value
-    def __str__(self):
-        return repr(self.value)
-
-
-##########################################################################################
-#
-# Get list of L1 thresholds (L2 input TEs) for L1 item
-#
-##########################################################################################
-# def getEM_InTEFromItemConfig(item):
-    
-#     log = logging.getLogger( "EgammaSliceFlags" )
-#     tpc = TriggerPythonConfig.currentTriggerConfig()
-
-#     if item not in tpc.allItems.keys():
-#         raise EgammaMapError('L1 item is not among all keys: '+item)
-
-#     resItem = tpc.allItems[item]
-#     resTEs  = resItem.thresholdNames()
-
-#     log.info('Found TEs for item: '+item+str(resTEs))
-#     return resTEs
-
-
-
-
-###############################
-## not in v4 menu
-###############################
-
-# class L2EFChain_e_NoIDTrkCut_IDT(L2EFChain_e):
-
-#     def defineSequences(self, config):
-#         ###### L2 ######
-#         # Step 1: Calo Fex and Hypo
-#         self.addL2Sequence(self.inputTEs,
-#                            [theT2CaloEgamma_cells_e, config.L2Config.TrigL2CaloHypo_1],
-#                            'L2_e_step1')
-        
-#         #remove IDScan and SiTrakck from IDTrkNoCut chains
-#         self.addL2Sequence(['L2_e_step1'],
-#                            [theTrigL2SiTrackFinder_eGammaA,
-#                             theTrigL2SiTrackFinder_eGammaB,
-#                             theTrigL2SiTrackFinder_eGammaC,
-#                             theTrigL2SiTrackFinder_eGammaBC,
-#                             theTrigTRTSegFinder_eGamma,
-#                             ],
-#                            'L2_e_step2')
-        
-#         # Step 3: ID-Calo Fex and Hypo
-#         self.addL2Sequence(['L2_e_step2'],
-#                            [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1],
-#                            'L2_e_step3')
-                
-#         ###### EF ######
-#         # Step 1: Calo Fex
-#         self.addEFSequence('L2_e_step3', 
-#                            [theTrigCaloCellMaker_eGamma_cells, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw],
-#                            'EF_e_step1')
-
-#         # Step 3: ID Fex and Hypo
-#         self.addEFSequence('EF_e_step1', theTrigEFIDInsideOut_Electron, 'EF_e_step2')
-#         self.addEFSequence('EF_e_step2', theTrigEFIDOutsideInTRTOnly_Electron, 'EF_e_step3')
-
-#         # Step 4: IDMerged Fex
-#         try:
-#             from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_Electron
-#             theTrigFastTrackFinder_Electron = TrigFastTrackFinder_Electron()
-#         except:
-#             theTrigFastTrackFinder_Electron = None
-       
-  
-#         trkseq = theTrigEFIDInsideOut_Electron_MergedDP.getSequence()
-#         trkseq.append(theTrigFastTrackFinder_Electron)
-#         theTrigEFIDInsideOutMerged_Electron = TrigEFIDSequence("Electron","electron","InsideOutMerged")
-#         trkseq += theTrigEFIDInsideOutMerged_Electron.getSequence(),
-#         self.addEFSequence('EF_e_step3',
-#                            trkseq,
-#                            'EF_e_step4')
-        
-#         # Step 3: ID-Calo Fex and Hypo
-#         self.addEFSequence('EF_e_step4', 
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1],
-#                            'EF_e_step5')
-
-#     def defineSignatures(self):
-#         self.addL2Signature(['L2_e_step1'])
-#         self.addL2Signature(['L2_e_step2'])
-#         self.addL2Signature(['L2_e_step3'])
-#         self.addEFSignature(['EF_e_step1'])
-#         self.addEFSignature(['EF_e_step2'])
-#         self.addEFSignature(['EF_e_step3'])
-#         self.addEFSignature(['EF_e_step4'])
-#         self.addEFSignature(['EF_e_step5'])
-
-#     def defineTErenaming(self):
-#         self.TErenamingMap = {
-#             'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id+'cl'),
-#             'L2_e_step2': mergeRemovingOverlap('L2_', self.sig_id+'id'),
-#             'L2_e_step3': mergeRemovingOverlap('L2_', self.sig_id),
-#             'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id+'calo'),
-#             'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'id1'),
-#             'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id+'id2'),
-#             'EF_e_step4': mergeRemovingOverlap('EF_', self.sig_id+'idt'),
-#             'EF_e_step5': mergeRemovingOverlap('EF_', self.sig_id),
-#             }
-
-
-# class L2EFChain_e_TRT_Ringer(L2EFChain_e):
-
-#     def defineSequences(self, config):
-#         self.addL2Sequence(self.inputTEs,
-#                            [theT2CaloEgamma_Ringer, config.L2Config.TrigL2CaloHypo_1],
-#                            'L2_e_step1')
-#         self.addL2Sequence(['L2_e_step1'],
-#                            [theTrigTRTSegFinder_eGamma],
-#                            'L2_e_step2')
-#         self.addL2Sequence(['L2_e_step2'],
-#                            [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1],
-#                            'L2_e_step3')
-#         self.addEFSequence('L2_e_step3',
-#                            [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw],
-#                            'EF_e_step1')    
-#         self.addEFSequence('EF_e_step1',    
-#                            theTrigEFIDOutsideInTRTOnly_Electron + [config.EFConfig.TrigEFTrackHypo_1],
-#                            'EF_e_step2')
-#         self.addEFSequence('EF_e_step2',
-#                            [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1],
-#                            'EF_e_step3')
-        
-        
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py
index 73690202fbf42d87829ea41ba836993221cabba7..235d5b79366b924279108e9949476a71e6c856a4 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py
@@ -9,14 +9,7 @@ from AthenaCommon.Logging import logging
 log = logging.getLogger( 'TriggerMenu.egamma.generateElectronChainDefs' )
 log.info("Importing %s",__name__)
 
-import traceback
-
 from TriggerMenu.egamma.ElectronDef import L2EFChain_e as L2EFChain_e
-try:
-    from TriggerMenu.egamma.ElectronDefIdTest import L2EFChain_e as L2EFChain_e_IdTest
-except:
-    log.error('generateElectronChainDefs: Problems when importing ElectronDefIdTest.')
-    log.info(traceback.print_exc())
 
 #from TriggerJobOpts.TriggerFlags import TriggerFlags
 from TriggerMenu.menu.MenuUtils import splitChainDict, mergeChainDefs, setupTopoStartFrom
@@ -34,10 +27,7 @@ def generateChainDefs(chainDict):
     for subChainDict in listOfChainDicts:
         electron_seq = EgammaSequence(subChainDict)
         log.debug('Egamma Sequence: %s', electron_seq)
-        if "IdTest" in subChainDict["chainParts"]["addInfo"]:
-            Electron = L2EFChain_e_IdTest(subChainDict)
-        else:
-            Electron = L2EFChain_e(subChainDict,electron_seq)
+        Electron = L2EFChain_e(subChainDict,electron_seq)
             
         listOfChainDefs += [Electron.generateHLTChainDef()]
     if len(listOfChainDefs)>1:
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py
index 6fb3825c5c27085dfc6550309b5a68edc7de7473..8cfea7bda432142dae70ea6ff5105f933956e8e3 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py
@@ -46,14 +46,19 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True):
         if signature['listOfTriggerElements'][0][0:2] == "L2":
             maxL2SignatureIndex = max(maxL2SignatureIndex,signatureIndex)
     
-    inputTEsL2 = theChainDef.signatureList[maxL2SignatureIndex]['listOfTriggerElements']
-      
     inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements']
 
-    L2ChainName = "L2_" + chainDict['chainName']
     EFChainName = "EF_" + chainDict['chainName']
     
-    if "Jpsiee" in chainDict["topo"]:
+    if 'dPhi15' in chainDict['topo']:
+        EFChainName = 'EF_2g_OvlRem_dPhi15'
+        from TrigGenericAlgs.TrigGenericAlgsConfig import OverlapRemovalConfig
+        OverlapRemoval_algo = OverlapRemovalConfig('OvlRem', MinPhiDist = 1.5, MinEtaDist = 0)
+    
+        theChainDef.addSequence([OverlapRemoval_algo],inputTEsEF,EFChainName)
+        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFChainName])
+
+    elif "Jpsiee" in chainDict["topo"]:
 
         from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFex_Jpsi, TrigEFDielectronMassHypo_Jpsi
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonDef.py
index 9ae2fbfcaf2e82636cf688a18c390381c91aa593..b89c2548b7ec0efd461d91c24d259068adeca923 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonDef.py
@@ -316,7 +316,6 @@ class L2EFChain_HI(L2EFChainDef):
 
     def setup_hi_ultraperipheral_gap(self):
         from TrigCaloRec.TrigCaloRecConf import TrigL1BSTowerMaker
-        from TrigCaloRec.TrigCaloRecConfig import TrigL1BSTowerHypoConfig
         from TrigCaloRec.TrigCaloRecConf import TrigL1FCALTTSumFex
         theL1BS = TrigL1BSTowerMaker()
         theL1BSFex = TrigL1FCALTTSumFex('TrigL1FCALTTSumFex')
@@ -326,7 +325,6 @@ class L2EFChain_HI(L2EFChainDef):
         
         # L2 sel (TT) is used when The chain is sither L2Fgap* or Fgap*, and not used when EFGap, similarily for EF (cells) part
         gap  = self.chainPart['gap']
-        useEF = not ('L2Fgap' in self.chainPart['gap'])
 
         #        theSptrkMaker = 
         #        theSptrkHypo = 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonSliceFlags.py
index 4ed1991034cdac9c0f540db26171fb19187ec7f2..98e12e1a0535ec096d4cd1bb09b4060923b35d56 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/HeavyIonSliceFlags.py
@@ -2,10 +2,8 @@
 
 """ HeavyIon slice specific flags  """
 
-from AthenaCommon.Logging import logging
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
-from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'R. Kwee, B. Demirkoz, T.Bold, T.Kohno, W. H. Bell'
 __version__="$Revision: 1.18 $"
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/generateHeavyIonChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/generateHeavyIonChainDefs.py
index c002a31e82dd3f7a48b75eb1c263961fe49687d7..465c922ef0479308fa6a80b5d19894d24e5375f4 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/heavyion/generateHeavyIonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/heavyion/generateHeavyIonChainDefs.py
@@ -3,14 +3,14 @@
 ##########################################################################################
 ##########################################################################################
 __doc__=""
-__version__="Implementation of min bias signatures"
+__version__="Implementation of heavy ion signatures"
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 
 
-from TriggerMenu.heavyion.HeavyIonDef import *
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.heavyion.HeavyIonDef import L2EFChain_HI
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 
 HeavyIon = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
index b37236979b39b29307de43b1f600bb90a7cfeea2..87e2d53af8947da26e6bb4ea150e1956e7830403 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
@@ -138,7 +138,7 @@ class AlgFactory(object):
         """Instantiate a python object for TrigHLTJetRec that will
         use TriggerTower objcts as as input."""
 
-        merge_param_str = str(self.fex_params.merge_param).zfill(2)
+        #merge_param_str = str(self.fex_params.merge_param).zfill(2)
     
         factory = 'TrigHLTJetRecFromTriggerTower'
         # add factory to instance label to facilitate log file searches
@@ -175,7 +175,7 @@ class AlgFactory(object):
         factory = 'TrigHLTJetRecFromCluster'
         # add factory to instance label to facilitate log file searches
         trkstr = self.menu_data.trkopt
-        if 'ftk' in self.menu_data.trkopt:
+        if 'ftk' in trkstr:
             name = '"%s_%s%s"' %(factory, self.fex_params.fex_label, trkstr)	
             outputcollectionlabel = "'%s%s'" % (self.fex_params.fex_label, trkstr)
         else:
@@ -228,13 +228,20 @@ class AlgFactory(object):
 
         factory = 'TrigHLTTrackMomentHelpers'
 
-        name = '"%s"' % factory
+        trkstr = self.menu_data.trkopt
+        
+        name = '"%s_%s"' % ( factory, trkstr )
+        
+        tvassocsgkey = 'HLT_'+trkstr+'_JetTrackVtxAssoc'
+        tracksgkey = 'HLT_'+trkstr+'_InDetTrackParticles'
+        primvtxsgkey = 'HLT_'+trkstr+'_PrimaryVertices'
         
         kwds = {
             'name': name,  # instance label
-            'tvassocSGkey': "'HLT_FTK_JetTrackVtxAssoc'",
-            'trackSGkey': "'HLT_FTK_InDetTrackParticles'",
-            'primVtxSGkey': "'HLT_FTK_PrimaryVertices'",
+            'trkopt' : "'%s'" % trkstr,
+            'tvassocSGkey': "'%s'" % tvassocsgkey,
+            'trackSGkey': "'%s'" % tracksgkey,
+            'primVtxSGkey': "'%s'" % primvtxsgkey,
         }
 
         return [Alg(factory, (), kwds)]
@@ -309,10 +316,10 @@ class AlgFactory(object):
         # name = '"%s_%s"' % (algType, self.chain_name_esc)
         hypo = self.menu_data.hypo_params
 
-        eta_mins = [ja.eta_min for ja in hypo.jet_attributes]
-        eta_maxs = [ja.eta_max for ja in hypo.jet_attributes]
-        EtThresholds = [ja.threshold * GeV for ja in hypo.jet_attributes]
-        asymmetrics = [ja.asymmetricEta for ja in hypo.jet_attributes]
+        eta_mins = [jatt.eta_min for jatt in hypo.jet_attributes]
+        eta_maxs = [jatt.eta_max for jatt in hypo.jet_attributes]
+        EtThresholds = [jatt.threshold * GeV for jatt in hypo.jet_attributes]
+        asymmetrics = [jatt.asymmetricEta for jatt in hypo.jet_attributes]
         
         kargs = {
             'name': name,
@@ -463,10 +470,6 @@ class AlgFactory(object):
     def superRoIMaker(self):
         factory = 'SeededAlgo'
 
-        params = {'UseRoiSizes':False,
-                  'EtaHalfWidth':0.5,
-                  'PhiHalfWidth':0.5}
-
         name = '"SeededAlgo_%s"' % self.seed
 
         options = {'name': name,
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/ChainConfigMaker.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/ChainConfigMaker.py
index b2e5d4ab7df0f3599bb4c3b08dcc23a7deaa1f1e..913a2421a43eeffabf5fe9bf57888600272e5517 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/ChainConfigMaker.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/ChainConfigMaker.py
@@ -24,17 +24,17 @@ def _check_smc(smc_min, smc_max):
         return 'min smc > max smc'
 
     try:
-        test = float(smc_min)  # float('INF'), float('-INF') work...
+        float(smc_min)  # float('INF'), float('-INF') work...
     except:
         return 'min smc does not convert to float'
 
     try:
-        test = float(smc_max)  # float('INF'), float('-INF') work...
+        float(smc_max)  # float('INF'), float('-INF') work...
     except:
         return 'max smc does not convert to float'
 
 
-    if not  float(smc_min) <= float(smc_max):
+    if not float(smc_min) <= float(smc_max):
         return 'min smc > max smc'
 
     return ''
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
index e4d3b7bb7e8c156db6aedd47a8946a9da6515de8..f02aaee7ee168f9f6016cfd708abc85b3f3db372 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef.py
@@ -4,7 +4,6 @@
 validity and repackage before forwarding ot to the ChainDef generating
 code."""
 import os
-import re
 import copy
 import sys
 import getopt
@@ -169,8 +168,6 @@ def _make_chaindef(from_central, instantiator):
     # rearrange the input data to produce chain_config
     chain_config = chainConfigMaker(from_central)
 
-    chain_name = chain_config.chain_name
-
     alg_factory = AlgFactory(chain_config)
     seq_builder = JetSequencesBuilder(alg_factory, chain_config)
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test.py
index 18c5b71d50c70991f0e83f4db4554eb9f3174861..abe6d4de8cc1deed4393f453d70b8c89368a75fa 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test.py
@@ -1,11 +1,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import sys
-import os
-from cStringIO import StringIO
 import copy
 import unittest
-from mock import MagicMock
 from JetDef import generateHLTChainDef, usage
 
 from ChainConfigMaker import JetAttributes
@@ -35,7 +31,7 @@ class TestJetDef(unittest.TestCase):
 
     def _test_3(self):
         'run exerciser function'
-        run_test()
+        #run_test()
 
     def test_4(self):
         'test error handling: missing entry in input dict'
@@ -252,7 +248,7 @@ class TestJetDef(unittest.TestCase):
              'topoStartFrom': False,
              'topoThreshold': None}
         
-        chain_def = generateHLTChainDef(d)
+        generateHLTChainDef(d)
         
 
 if __name__ == '__main__':
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test2.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test2.py
index 6dc50c1a2727f9610e1fa341b08750072bddb483..4fafd48898bf4cb79f9cc7b491e6373f5ec5e53f 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test2.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetDef_test2.py
@@ -1,18 +1,9 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import sys
 import os
-from cStringIO import StringIO
-import copy
 import unittest
-from mock import MagicMock
-from JetDef import generateHLTChainDef, usage
 from test_functions import run_test_dicts
 
-from ChainConfigMaker import JetAttributes
-
-from MC_pp_V5_dicts import MC_pp_V5_dicts
-
 class TestJetDef2(unittest.TestCase):
 
     def setUp(self):
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
index f02b6e18da1110c53291def53e3c393fd338afb7..7f1836805bab3653e2aa6ca43d8b308cdbdb3dac 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
@@ -308,6 +308,7 @@ class JetSequencesBuilder(object):
             ftksequence_list = TrigInDetFTKSequence("FullScan", "fullScan", sequenceFlavour=["FTKVtx"]).getSequence()
         elif ftkopt == 'ftkrefit':
             ftksequence_list = TrigInDetFTKSequence("FullScan", "fullScan", sequenceFlavour=["FTKVtx", "refit"]).getSequence()
+            alias = 'ftkrefittracking'
         ftkalgo_list = []
 
         for seq in ftksequence_list:
@@ -360,7 +361,7 @@ class JetSequencesBuilder(object):
 
         menu_data = self.chain_config.menu_data
         fex_params = menu_data.fex_params
-        cluster_params = menu_data.cluster_params
+        #cluster_params = menu_data.cluster_params
 
         alias = 'hijetrec_%s' % fex_params.fex_label
 
@@ -372,7 +373,7 @@ class JetSequencesBuilder(object):
 
         menu_data = self.chain_config.menu_data
         fex_params = menu_data.fex_params
-        cluster_params = menu_data.cluster_params
+        #cluster_params = menu_data.cluster_params
 
         # set jes label according to whether the JES corrections will
         # be done by JetRecTool
@@ -450,18 +451,16 @@ class JetSequencesBuilder(object):
         if f is None:
             msg = '%s._make_jh: unknown hypotype %s' % (
                 self.__class__.__name__, hypo.hypo_type)
-    
+            raise RuntimeError(msg)
+
         return AlgList(f(), alias)
 
 
     def make_jh_ht(self):
         """Create an alg_list for 2015 JetRec hypo sequence"""
 
-        menu_data = self.chain_config.menu_data
-        hypo = menu_data.hypo_params
         f = self.alg_factory.hlthypo2_ht
 
-        hypo = menu_data.hypo_params
         alias = 'hthypo_%s' % self.chain_name_esc
 
         return AlgList(f(), alias)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder_test.py
index 8802520d295fb39ff6d5a78321e1ae44529d4330..d91510c90c0035c895af291695fc07b81a51162e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder_test.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import unittest
-from mock import MagicMock, Mock
+from mock import MagicMock
 
 from JetSequencesBuilder import (AlgList,
                                  JetSequencesBuilder)
@@ -74,7 +74,8 @@ class TestJetSequencesBuilder(unittest.TestCase):
     def _test_2(self):
         'test that legal MenuData objects combinatations'
 
-        self.router.make_alglists(chain_config)
+        #2017-05-22 commenting out because chain_config is undefined and causes an error with flake8 unit testing
+        #self.router.make_alglists(chain_config)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSliceFlags.py
index 6bd0c474e1fe3f7334f3dd70bb6349de7ae6e55b..feb09f82c5ab295bdf83193d257a4d70f1727608 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Jet slice specific flags  """
 
-from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'T. Bold'
 __version__="$Revision: 1.31 $"
@@ -22,7 +22,6 @@ _flags.append(signatures)
 
 
 # create container
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 class JetSlice(JobPropertyContainer, CommonSliceHelper):
     """ Jet Slice Flags """
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/Sequence_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/Sequence_test.py
index d92d9f299e500cf7022ccd9ed644a381ddd5270c..b0538b83325f500f5ae55d0a808166df7c6c52d5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/Sequence_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/Sequence_test.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import unittest
-from mock import MagicMock, Mock
 
 from Sequence import Sequence
 
@@ -24,7 +23,7 @@ class TestSequence(unittest.TestCase):
     def test_0(self):
 
         # excercise __str__
-        s = str(self.sequence)
+        #s = str(self.sequence)
 
         instantiator = Instantiator()
         self.sequence.instantiateAlgs(instantiator)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/StdOutController.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/StdOutController.py
index 7bff782e700a8deeb7059646680d669485355052..afba5eb47515bb0c9585c38058b7ddef29a2a76a 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/StdOutController.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/StdOutController.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import sys
-import os
 
 """Switch stdout on, off"""
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/cluster_factory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/cluster_factory.py
index a4a4fc2fa181acffb5937b0ea55b5a30f379742d..ae69c41d973c4988f3e8210fdec75dd587d38925 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/cluster_factory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/cluster_factory.py
@@ -1,7 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from collections import defaultdict
-
 
 def cluster_factory(doLC):
     # no choice yet
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/fexargs_factory_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/fexargs_factory_test.py
index 95dbfac67f3a1dc7c9f4099e3e4c28d429408c90..dc76fcb301d197f34b38d14fcec32fe9b8e507fe 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/fexargs_factory_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/fexargs_factory_test.py
@@ -4,7 +4,6 @@
 INCOMPLETE
 """
 
-import copy
 import unittest
 from mock import MagicMock
 from fexargs_factory import fexargs_factory
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/fexparams_factory_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/fexparams_factory_test.py
index 1862862fccf4376a1abd43b50c83a0d388b6395f..62ff809f333713e07e0fc0bac0b4c863a2a5350a 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/fexparams_factory_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/fexparams_factory_test.py
@@ -4,7 +4,6 @@
 INCOMPLETE
 """
 
-import copy
 import unittest
 from mock import MagicMock
 from fexparams_factory import fexparams_factory
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py
index 4ec6e1b5d890fb7dbdd63a71f97c125c2a7804ac..d60a770f1283e9a8daedd2e990d1676bd65c5820 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py
@@ -13,12 +13,12 @@ from AthenaCommon.SystemOfUnits import GeV
 
 from TriggerMenu.jet.JetDef import generateHLTChainDef
 
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.menu.MenuUtils import splitChainDict
 
 from JetDef import dump_chaindef
 from exc2string import exc2string2
 from TriggerMenu.menu.ChainDef import ErrorChainDef
-import os, inspect
+import os
 
 from TriggerMenu.commonUtils.makeCaloSequences import getFullScanCaloSequences
 # TrigEFHLTJetMassDEta_Config = __import__("TrigHLTJetHypo.TrigEFHLTJetMassDEtaConfig",fromlist=[""])
@@ -80,15 +80,7 @@ def _addTopoInfo(theChainDef,chainDict, topoAlgs, doAtL2AndEF=True):
     
     inputTEsL2 = theChainDef.signatureList[maxL2SignatureIndex]['listOfTriggerElements'] 
     inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements']
-
-    L2ChainName = "L2_" + chainDict['chainName']
-    EFChainName = "EF_" + chainDict['chainName']
-    HLTChainName = "HLT_" + chainDict['chainName']   
-    #topoAlgs = chainDict["topo"]
-
-    listOfChainDicts = splitChainDict(chainDict)
-    listOfChainDefs = []
-
+ 
     if ('muvtx' in topoAlgs):
        # import pdb;pdb.set_trace()
         theChainDef = generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoAlgs)
@@ -117,7 +109,7 @@ def generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF,
 
     # tracking
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-    [trkcore,trkiso,trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkcore,trkiso,trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
 
     # muon cluster 
     from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import MuonClusterConfig
@@ -140,7 +132,6 @@ def generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF,
     TE_muonClusters = HLTChainName+'_muonClusters'
     TEmuonIsoB = HLTChainName+'_muIsoB'
     TEmuonClusterFex = HLTChainName+'_muClusFex'
-    TEmuonClusterHypo = HLTChainName+'_muClusHypo'
 
     # make clusters, then test if they pass the hypo
     theChainDef.addSequence([fexes_l2_MuonCluster,hypos_l2_MuonCluster], l1item, TE_muonClusters)
@@ -176,7 +167,7 @@ def generateCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, to
 
     # tracking
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-    [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence()
+    [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence()
 
     # calo-ratio
     from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import getCaloRatioHypoInstance
@@ -238,7 +229,7 @@ def generateReversedCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputT
 
     # tracking
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-    [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence()
+    [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence()
 
     # reversed calo-ratio
     from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import getCaloRatioHypoInstance
@@ -312,6 +303,7 @@ def addDetaInvmTopo(theChainDef,chainDicts,inputTEsL2, inputTEsEF,topoAlgs):
     
     logJet.debug("Configuration of EFHLTJetMassDeta hypo for chain %s: Hypo %s, AlgoName: %s " %(chainDicts['chainName'],hypo,algoName))
     # import pdb;pdb.set_trace()
+    TrigEFHLTJetMassDEta_Config = None
     try:
         detamjjet_hypo = getattr(TrigEFHLTJetMassDEta_Config,hypo ) 
     except:  
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory.py
index 1bc9501c5d17e363cb13927196479d7c56359df3..d52e1680c2d7944e883995a9008677df180178e1 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory.py
@@ -1,8 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 from collections import defaultdict
-from eta_string_conversions import eta_string_to_floats
-
 
 def hypo_factory(key, args):
 
@@ -243,7 +241,7 @@ class TLAHypo(TLABase):
 
     def __init__(self, ddict):
         TLABase.__init__(self, ddict)
-        hypo_type = 'tla'
+        self.hypo_type = 'tla'
         
 
 class HLThypo2_tla(TLABase):
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory_test.py
index ab6080a3346f3b92a7cf181c6b2cb606b5a11606..281156bb311f2add82b6cd82f98baecfe41170d3 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/hypo_factory_test.py
@@ -1,10 +1,8 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import copy
 import unittest
 from mock import MagicMock
 from hypo_factory import (hypo_factory,
-                          HypoAlg,
                           JetStandardHypo,
                           JetSingleEtaRegionHypo,
                           JetMaximumBipartiteHypo,
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefAlgToString_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefAlgToString_test.py
index 3a1e2dee3ef9d6e10eb2cfb9d676936b3af898ee..924e3c14556b92e5bce52de96ef42b0f9bd3d3e5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefAlgToString_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefAlgToString_test.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import unittest
-from mock import MagicMock, Mock
 from AlgFactory import Alg
 from jetDefAlgToString import JetDefAlgToStringInstantiator
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
index 14596a42d2f4df9fc5db7a15cf0364cf27275920..a17c3b9771593d0065fb1e2c087ab4d3559e28a7 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator.py
@@ -10,11 +10,8 @@ from exc2string import exc2string2
 
 #from TriggerJobOpts.TriggerFlags import TriggerFlags
 
-from TrigGenericAlgs.TrigGenericAlgsConf import \
-    PESA__DummyUnseededAllTEAlgo as DummyAlgo
-
-from TrigGenericAlgs.TrigGenericAlgsConf import \
-    PESA__SeededSuperRoiAllTEAlgo as SeededAlgo
+from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyAlgo   # noqa: F401
+from TrigGenericAlgs.TrigGenericAlgsConf import PESA__SeededSuperRoiAllTEAlgo as SeededAlgo # noqa: F401
 
 # from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX
 
@@ -25,44 +22,44 @@ from TrigGenericAlgs.TrigGenericAlgsConf import \
 #                                           TrigCaloClusterMaker_topo,
 #                                           TrigLArNoisyROAlgConfig)
 
-from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_jet_fullcalo,
-                                           TrigCaloCellMaker_jet_super,
-                                           TrigCaloClusterMaker_topo)
-
-from TrigCaloRec.TrigCaloRecConf import (TrigL1BSTowerMaker,)
-
-from TrigHLTJetRec.TrigHLTJetRecConf import TrigHLTRoIDiagnostics
-
-from TrigHLTJetRec.TrigHLTJetRecConfig import (TrigHLTJetDiagnostics_named,
-                                               TrigHLTJetRecFromCluster,
-                                               TrigHLTJetRecFromJet,
-                                               TrigHLTJetRecGroomer,
-                                               TrigHLTJetRecFromTriggerTower,
-                                               TrigHLTClusterDiagnostics_named,
-                                               TrigHLTCellDiagnostics_named,
-                                               TrigHLTHypoDiagnostics_named,
-                                               TrigHLTJetDebug,
-                                               TrigHLTEnergyDensity,
-                                               TrigHLTSoftKiller,
-                                               TrigHLTJetDSSelector,
-                                               TrigHLTTrackMomentHelpers,)
-
-from TrigHLTJetHypo.TrigHLTJetHypoConfig import (TrigHLTJetHypo2,
-                                                 TrigHLTJetHypo_DijetMassDEta,
-                                                 TrigHLTJetHypo_EtaEt,
-                                                 TrigHLTJetHypo_HT,
-                                                 TrigHLTJetHypo_TLA,
-                                                 TrigHLTJetHypo_SMC,
+from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_jet_fullcalo, # noqa: F401
+                                           TrigCaloCellMaker_jet_super,    # noqa: F401
+                                           TrigCaloClusterMaker_topo)      # noqa: F401
+
+from TrigCaloRec.TrigCaloRecConf import (TrigL1BSTowerMaker,)     # noqa: F401
+
+from TrigHLTJetRec.TrigHLTJetRecConf import TrigHLTRoIDiagnostics # noqa: F401
+
+from TrigHLTJetRec.TrigHLTJetRecConfig import (TrigHLTJetDiagnostics_named,     # noqa: F401
+                                               TrigHLTJetRecFromCluster,        # noqa: F401
+                                               TrigHLTJetRecFromJet,            # noqa: F401
+                                               TrigHLTJetRecGroomer,            # noqa: F401
+                                               TrigHLTJetRecFromTriggerTower,   # noqa: F401
+                                               TrigHLTClusterDiagnostics_named, # noqa: F401
+                                               TrigHLTCellDiagnostics_named,    # noqa: F401
+                                               TrigHLTHypoDiagnostics_named,    # noqa: F401
+                                               TrigHLTJetDebug,                 # noqa: F401
+                                               TrigHLTEnergyDensity,            # noqa: F401
+                                               TrigHLTSoftKiller,               # noqa: F401
+                                               TrigHLTJetDSSelector,            # noqa: F401
+                                               TrigHLTTrackMomentHelpers,)      # noqa: F401
+
+from TrigHLTJetHypo.TrigHLTJetHypoConfig import (TrigHLTJetHypo2,              # noqa: F401
+                                                 TrigHLTJetHypo_DijetMassDEta, # noqa: F401
+                                                 TrigHLTJetHypo_EtaEt,         # noqa: F401
+                                                 TrigHLTJetHypo_HT,            # noqa: F401
+                                                 TrigHLTJetHypo_TLA,           # noqa: F401
+                                                 TrigHLTJetHypo_SMC,           # noqa: F401
                                                  )
 
-from TrigDetCalib.TrigDetCalibConf import ScoutingStreamWriter
+from TrigDetCalib.TrigDetCalibConf import ScoutingStreamWriter    # noqa: F401
 
-from TrigHIRec.TrigHICaloRec import (TrigCaloTowerMaker_hijet,
-                                     TrigHIClusterMaker_hijet,
-                                     TrigHIEventShapeMaker_hijet,
+from TrigHIRec.TrigHICaloRec import (TrigCaloTowerMaker_hijet,    # noqa: F401
+                                     TrigHIClusterMaker_hijet,    # noqa: F401
+                                     TrigHIEventShapeMaker_hijet, # noqa: F401
                                     )
                                     
-from TrigHIRec.TrigHLTHIJetRecConfig import TrigHLTHIJetRecFromHICluster
+from TrigHIRec.TrigHLTHIJetRecConfig import TrigHLTHIJetRecFromHICluster  # noqa: F401
 
 abomination_to_keep_config_weakvalue_dict_intact = []
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator_test.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator_test.py
index ae3f07e40b095f7998f21458b0b9e61568ff8ae1..0dff12d9cc35208573fc2e0696998cb413f5b26a 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator_test.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/jetDefInstantiator_test.py
@@ -1,6 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import copy
 import unittest
 from mock import MagicMock
 from jetDefInstantiator import Instantiator
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/test_functions.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/test_functions.py
index b4d042bf58f734948f069f9d67a6d24c069a975c..67307deabc9c2f5270e3e2b1cab35007da34e704 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/test_functions.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/test_functions.py
@@ -8,8 +8,6 @@ import importlib
 
 from generateJetChainDefs import  generateChainDefs
 from exc2string import exc2string2 
-from AthenaCommon.Include import include
-from AthenaCommon.OldStyleConfig import  Service
 
 def _generate(d, silent):
 
@@ -37,16 +35,16 @@ def run_triggerMenuXML_dicts(silent,
              ' to write to disk' % (len(dicts))
     print m
 
-    devnull = open(os.devnull, 'w')
-    old_out = sys.stdout
-    old_err = sys.stderr
+    #devnull = open(os.devnull, 'w')
+    #old_out = sys.stdout
+    #old_err = sys.stderr
     
     result = []
     ndicts = 0
-    toSkip = (
-        'j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_EMPTY',
-        'j30_jes_PS_llp_L1TAU8_UNPAIRED_ISO',
-        )
+    #toSkip = (
+    #    'j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_EMPTY',
+    #    'j30_jes_PS_llp_L1TAU8_UNPAIRED_ISO',
+    #    )
     for d in dicts:
         # if d['chainName'] in toSkip or '_PS_' in d['chainName']:
         #    print d['chainName']
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/BunchGroupSet.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/BunchGroupSet.py
index 2836d05cd649888e2e5d50fdcd97f5154b07db1a..43e00921ff0b61e906475faaca7d4f9e7e7be0f0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/BunchGroupSet.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/BunchGroupSet.py
@@ -1,7 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from copy import deepcopy
-
 from Limits import Limits
 from Lvl1Flags import Lvl1Flags
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Cabling.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Cabling.py
index 282e615f20b9bc7b81ebbcbabf592f79c1b7bad8..831f7a6d361939a043737bfc14a994f849bdc1f3 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Cabling.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Cabling.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from Limits import Limits
+from Limits import Limits # noqa: F401
 from AthenaCommon.Logging import logging
 log = logging.getLogger("Cabling")
 log.setLevel(logging.INFO)
@@ -146,7 +146,7 @@ class Cabling:
     @staticmethod
     def calcBitnum(thrtype):
         # get the widths for the threshold types is defined in L1Common
-        exec("nbits = Limits.%s_bitnum" % thrtype)
+        nbits = getattr(Limits,'%s_bitnum' % thrtype)
         return nbits
 
 
@@ -264,8 +264,7 @@ class InputCable:
         """
         Gets the cable assignment from L1Common
         """
-        exec("cable = Limits.%s_cable" % thrtype)
-        
+        cable = getattr(Limits,'%s_cable' % thrtype)
         # we change the format for run 2, the tuple now contains also the bit multiplicity, as it is not constant per type
         infosize = (len(cable)-1)/cable[0]
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Limits.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Limits.py
index 38da63573d2789d490952cdca9c2255c59989878..d5edaa71200587abd087b212025c8ba7fe61ef07 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Limits.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Limits.py
@@ -50,13 +50,13 @@ class Limits:
     @staticmethod
     def getCTPdataformat(version):
         module = __import__('CTPfragment.CTPdataformat_v%i' % version, globals(), locals(), ['CTPdataformat_v%i' % version], -1)
-        exec("CTPdataformat = module.CTPdataformat_v%i" % version)
+        CTPdataformat = getattr(module,'CTPdataformat_v%i' % version)
         return CTPdataformat
 
     @staticmethod
     def getL1Common(version):
         module = __import__('L1Common.L1Common_v%i' % version, globals(), locals(), ['L1Common_v%i' % version], -1)
-        exec("L1Common = module.L1Common_v%i" % version)
+        L1Common = getattr(module,'L1Common_v%i' % version)
         return L1Common
 
     @staticmethod
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Logic.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Logic.py
index ce8e6f034e606b675223d11764d2a769c0c2979d..33f3f152a449dcd2e59b6e4383d1c609d582f0b5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Logic.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Logic.py
@@ -2,7 +2,7 @@
 
 __all__ = ['Logic', 'Not']
 
-from copy import copy,deepcopy
+from copy import copy
 
 from Lvl1MenuUtil import log
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Flags.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Flags.py
index 80fdc158b1a2a214c8d73c63028e73491a31a656..d79e5bd0abe26c68c6d1665856fcb134ee494098 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Flags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Flags.py
@@ -4,8 +4,7 @@
 Lvl1 specific flags
 """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from AthenaCommon.Logging import logging
 from Limits import Limits
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Menu.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Menu.py
index 22361ed88a3a8efce62825001b66a438bdff2a6f..c512d276fb0e648b287eee69b667b4401263aba0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Menu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Menu.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from Lvl1Thresholds import LVL1Thresholds, LVL1Threshold, ThresholdValue
-from Lvl1MenuItems import LVL1MenuItems, LVL1MenuItem
+from Lvl1Thresholds import LVL1Thresholds
+from Lvl1MenuItems import LVL1MenuItems
 from Lvl1MonCounters import Lvl1MonCounters
 from CaloInfo import CaloInfo
 from MuctpiInfo import MuctpiInfo
@@ -128,7 +128,6 @@ class Lvl1Menu:
         All other checks should be implemented in TrigConfStorage/src/CheckConsistency.cxx
         This method is only for quick solutions but should be intermediate
         """
-        from Lvl1Flags import Lvl1Flags
 
         success = True
         
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuItems.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuItems.py
index 1678d4c0c0493352e4d2e97d5dd19f28524932c1..74e2dd53a55a3e3c6de2449e0320c740453b69cb 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuItems.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuItems.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from PrescaleHelper import getCutFromPrescale, getPrescaleFromCut, maxPrescaleCut
+from PrescaleHelper import getCutFromPrescale, getPrescaleFromCut
 from Lvl1MenuUtil import oldStyle
 
 from AthenaCommon.Logging import logging
@@ -171,7 +171,6 @@ class PrescaleHandler(object):
         self.items = menuitems
         self.itemsByPartition = {}
 
-        from Lvl1Flags import Lvl1Flags
         for item in menuitems:
             self.itemsByPartition.setdefault(item.partition,[]).append(item)
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuUtil.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuUtil.py
index 857b4a7b32a4fe0fdbc3803cce0959d7b47f7996..66fadaf367d1f9a9105a981cc57f3bcbf5ba98a5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuUtil.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1MenuUtil.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-__all__ = ['log', 'idgen', 'binstr', 'get_smk_psk_Name', 'applyLVL1Prescale', 'oldStyle']
+__all__ = ['log', 'idgen', 'binstr', 'get_smk_psk_Name', 'oldStyle']
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger("TriggerConfigL1")
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Thresholds.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Thresholds.py
index 4d0cd678b6acbbf0847c4379a6cb1a6acb530e86..0937b945ba2238367c0b7421a06e29d8e46f2834 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Thresholds.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/Lvl1Thresholds.py
@@ -3,7 +3,6 @@
 from Limits import CaloLimits as CL
 IsolationOff = CL.IsolationOff
 
-from Lvl1MenuUtil import log
 from copy import deepcopy
 
 class ThresholdValue:
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/TriggerTypeDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/TriggerTypeDef.py
index 8732502202b8502db65119a2306d2d90a65f29d4..2fdfe268bdba15e22412261c4d5526a42c62b7a8 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/TriggerTypeDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/TriggerTypeDef.py
@@ -1,8 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-
 class TT:
     """
     Trigger type logic
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1/XMLMenuReader.py b/Trigger/TriggerCommon/TriggerMenu/python/l1/XMLMenuReader.py
index 0d7e538daac132f7b87f68f7e0c932e862c18304..ac13db2527a87a6b0ad4315f8b75e90fdcbf9bc5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1/XMLMenuReader.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1/XMLMenuReader.py
@@ -8,7 +8,7 @@ from PrescaleHelper import getCutFromPrescale
 from Logic import Logic
 from Lvl1Condition import Lvl1InternalTrigger, ThrCondition
 from CaloInfo import MinimumTOBPt
-from Lvl1MonCounters import Lvl1MonCounters, Lvl1CtpinCounter, Lvl1CtpmonCounter
+from Lvl1MonCounters import Lvl1CtpinCounter, Lvl1CtpmonCounter
 
 
 from AthenaCommon.Logging import logging
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
index acbcbe3006287573b0e5d3a8859e1e9fc47b9d36..f1c7fe5a3de2548e4376cf8bf70eb6448a79103e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
@@ -9,12 +9,6 @@ class CaloDef:
 
         
         from TriggerMenu.l1.CaloInfo import MinimumTOBPt, CaloInfo
-        from TriggerMenu.l1.Limits import CaloLimits, Limits
-        from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
-
-
-        run1 = Lvl1Flags.CTPVersion()<=3
-
 
         caloInfo = tc.menu.CaloInfo
         menuName = tc.menuName
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
index 91165ad228e29af88bf5fd1d1aa71e49b764fdc5..d524e7557685bc25a654c7a8218aee28577aec5d 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
@@ -4,7 +4,6 @@
 
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
-import re
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('TriggerMenu.Lvl1.py')
@@ -12,10 +11,9 @@ log = logging.getLogger('TriggerMenu.Lvl1.py')
 # The trigger types
 from TriggerMenu.l1.TriggerTypeDef import TT
 from TriggerMenu.l1.Limits import Limits
-from TriggerMenu.l1.Logic import Logic,Not
+from TriggerMenu.l1.Logic import Logic,Not # noqa: F401
 from TriggerMenu.l1.Lvl1MenuItems import LVL1MenuItem
-from TriggerMenu.l1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger
-
+from TriggerMenu.l1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger  # noqa: F401
 
 class ItemDef:
     """
@@ -45,1062 +43,1091 @@ class ItemDef:
         LVL1MenuItem.l1configForRegistration = tm  # from now on all new LVL1MenuItems are registered to tm
 
         # Setting up bunch group and BPTX conditions
-        physcond            = BGRP0 & BGRP1
-        calibcond           = BGRP0 & BGRP2
-        cosmiccond          = BGRP0 & BGRP3
-        unpaired_isocond    = BGRP0 & BGRP4 # unpaired isolated (satellite bunches)
-        unpaired_nonisocond = BGRP0 & BGRP5 # unpaired non-isolated (parasitic bunches)
-        firstempty          = BGRP0 & BGRP6
-        unpairedRcond       = BGRP0 & BGRP7 # unpaired beams 1 oR beam 2
-        bgrp7cond           = BGRP0 & BGRP7 # No unpaired anymore
-        bgrp9cond           = BGRP0 & BGRP9 
-        bgrp11cond          = BGRP0 & BGRP11 
-        bgrp12cond          = BGRP0 & BGRP12
-        alfacalib           = BGRP0 & BGRP10
-        abortgap            = BGRP0 & BGRP8
+        physcond            = BGRP0 & BGRP1                                                  # noqa: F821
+        calibcond           = BGRP0 & BGRP2                                                  # noqa: F821
+        cosmiccond          = BGRP0 & BGRP3                                                  # noqa: F821
+        unpaired_isocond    = BGRP0 & BGRP4 # unpaired isolated (satellite bunches)          # noqa: F821
+        unpaired_nonisocond = BGRP0 & BGRP5 # unpaired non-isolated (parasitic bunches)      # noqa: F821
+        firstempty          = BGRP0 & BGRP6                                                  # noqa: F821
+        unpairedRcond       = BGRP0 & BGRP7 # unpaired beams 1 or beam 2                     # noqa: F821
+        bgrp7cond           = BGRP0 & BGRP7 # No unpaired anymore                            # noqa: F821       
+        bgrp9cond           = BGRP0 & BGRP9                                                  # noqa: F821
+        bgrp11cond          = BGRP0 & BGRP11                                                 # noqa: F821
+        bgrp12cond          = BGRP0 & BGRP12                                                 # noqa: F821
+        bgrp13cond          = BGRP0 & BGRP13 #UNPAIREDB1                                     # noqa: F821
+        bgrp14cond          = BGRP0 & BGRP14 #UNPAIREDB2                                     # noqa: F821
+        alfacalib           = BGRP0 & BGRP10                                                 # noqa: F821
+        abortgap            = BGRP0 & BGRP8                                                  # noqa: F821
         
         # partition 1
-        bgrpcond1           = BGRP0 & BGRP11
-        calibcond1          = BGRP0 & BGRP12
+        #bgrpcond1           = BGRP0 & BGRP11                                                 # noqa: F821
+        #calibcond1          = BGRP0 & BGRP12                                                 # noqa: F821
 
         # partition 2
-        bgrpcond2           = BGRP0 & BGRP14
+        #bgrpcond2           = BGRP0 & BGRP14                                                 # noqa: F821
 
 
         LVL1MenuItem.currentPartition = 1
 
 
         # E/gamma ctpid=[0:0x1f]
-        LVL1MenuItem('L1_EM3'       ).setLogic( EM3        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3HI'     ).setLogic( EM3HI      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM4'       ).setLogic( EM4        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5'       ).setLogic( EM5        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7'       ).setLogic( EM7        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM10'      ).setLogic( EM10       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM24VHI'   ).setLogic( EM24VHI    & physcond).setTriggerType( TT.calo)
-        LVL1MenuItem('L1_EM8'       ).setLogic( EM8        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM8I'      ).setLogic( EM8I       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM12'      ).setLogic( EM12       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM14'      ).setLogic( EM14       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15'      ).setLogic( EM15       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_BGRP7').setLogic( EM15       & bgrp7cond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15I'     ).setLogic( EM15 & EM8I      & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM3'       ).setLogic( EM3        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM3HI'     ).setLogic( EM3HI      & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM4'       ).setLogic( EM4        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM5'       ).setLogic( EM5        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM7'       ).setLogic( EM7        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM10'      ).setLogic( EM10       & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM24VHI'   ).setLogic( EM24VHI    & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM8'       ).setLogic( EM8        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM8I'      ).setLogic( EM8I       & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM12'      ).setLogic( EM12       & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM14'      ).setLogic( EM14       & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15'      ).setLogic( EM15       & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15_BGRP7').setLogic( EM15       & bgrp7cond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15I'     ).setLogic( EM15 & EM8I      & physcond).setTriggerType( TT.calo )     # noqa: F821
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM15VHI'    ).setLogic( EM15VHI      & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM22VHIM'   ).setLogic( EM22VHIM      & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM24VHIM'   ).setLogic( EM24VHIM      & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15VHI'    ).setLogic( EM15VHI      & physcond).setTriggerType( TT.calo )     # noqa: F821
+           LVL1MenuItem('L1_EM22VHIM'   ).setLogic( EM22VHIM      & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM24VHIM'   ).setLogic( EM24VHIM      & physcond).setTriggerType( TT.calo )    # noqa: F821
         else:
-           LVL1MenuItem('L1_EM15HI'    ).setLogic( EM15HI      & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM26VHI'   ).setLogic( EM26VHI    & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM18VH'    ).setLogic( EM18VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM16'      ).setLogic( EM16       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM8VH'     ).setLogic( EM8VH      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM10VH'    ).setLogic( EM10VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20A'     ).setLogic( EM20A      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20C'     ).setLogic( EM20C      & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15HI'    ).setLogic( EM15HI      & physcond).setTriggerType( TT.calo )       # noqa: F821
+           LVL1MenuItem('L1_EM26VHI'   ).setLogic( EM26VHI    & physcond).setTriggerType( TT.calo )        # noqa: F821
+           LVL1MenuItem('L1_EM18VH'    ).setLogic( EM18VH     & physcond).setTriggerType( TT.calo )        # noqa: F821
+        LVL1MenuItem('L1_EM16'      ).setLogic( EM16       & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM8VH'     ).setLogic( EM8VH      & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM10VH'    ).setLogic( EM10VH     & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM20A'     ).setLogic( EM20A      & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM20C'     ).setLogic( EM20C      & physcond).setTriggerType( TT.calo )           # noqa: F821
         if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM13VH'    ).setLogic( EM13VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH'    ).setLogic( EM15VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18'      ).setLogic( EM18       & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM13VH'    ).setLogic( EM13VH     & physcond).setTriggerType( TT.calo )        # noqa: F821
+        LVL1MenuItem('L1_EM15VH'    ).setLogic( EM15VH     & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM18'      ).setLogic( EM18       & physcond).setTriggerType( TT.calo )           # noqa: F821
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM18VHI'    ).setLogic( EM18VHI     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20'      ).setLogic( EM20       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VH'    ).setLogic( EM20VH     & physcond).setTriggerType( TT.calo )  
-        LVL1MenuItem('L1_EM20VHI'   ).setLogic( EM20VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
-        LVL1MenuItem('L1_EM22'      ).setLogic( EM22       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM22VHI'   ).setLogic( EM22VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
-        LVL1MenuItem('L1_EM50V'     ).setLogic( EM50V      & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM18VHI'    ).setLogic( EM18VHI     & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_EM20'      ).setLogic( EM20       & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM20VH'    ).setLogic( EM20VH     & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM20VHI'   ).setLogic( EM20VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined # noqa: F821
+        LVL1MenuItem('L1_EM22'      ).setLogic( EM22       & physcond).setTriggerType( TT.calo )           # noqa: F821
+        LVL1MenuItem('L1_EM22VHI'   ).setLogic( EM22VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined # noqa: F821
+        LVL1MenuItem('L1_EM50V'     ).setLogic( EM50V      & physcond).setTriggerType( TT.calo )           # noqa: F821
 
 
 
         # 2xEM, 3xEM
-        LVL1MenuItem('L1_2EM3'           ).setLogic( EM3.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM5'           ).setLogic( EM5.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM7'           ).setLogic( EM7.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM10'          ).setLogic( EM10.x(2)            & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM10VH'        ).setLogic( EM10VH.x(2)          & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_2EM3'           ).setLogic( EM3.x(2)             & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_2EM5'           ).setLogic( EM5.x(2)             & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_2EM7'           ).setLogic( EM7.x(2)             & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_2EM10'          ).setLogic( EM10.x(2)            & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_2EM10VH'        ).setLogic( EM10VH.x(2)          & physcond).setTriggerType( TT.calo )     # noqa: F821
         if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_2EM13VH'        ).setLogic( EM13VH.x(2)          & physcond).setTriggerType( TT.calo )                
-           LVL1MenuItem('L1_2EM18VH'        ).setLogic( EM18VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM15'          ).setLogic( EM15.x(2)            & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM15VH'        ).setLogic( EM15VH.x(2)          & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_2EM13VH'        ).setLogic( EM13VH.x(2)          & physcond).setTriggerType( TT.calo )  # noqa: F821              
+           LVL1MenuItem('L1_2EM18VH'        ).setLogic( EM18VH.x(2)          & physcond).setTriggerType( TT.calo )  # noqa: F821
+        LVL1MenuItem('L1_2EM15'          ).setLogic( EM15.x(2)            & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_2EM15VH'        ).setLogic( EM15VH.x(2)          & physcond).setTriggerType( TT.calo )     # noqa: F821
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_2EM15VHI'    ).setLogic( EM15VHI.x(2)      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM20VH'        ).setLogic( EM20VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_2EM3'       ).setLogic( EM7 & EM3.x(2)       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM12_2EM3'      ).setLogic( EM12 & EM3.x(2)      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VH_2EM7'    ).setLogic( EM20VH & EM7.x(2)    & physcond).setTriggerType( TT.calo )        
+           LVL1MenuItem('L1_2EM15VHI'    ).setLogic( EM15VHI.x(2)      & physcond).setTriggerType( TT.calo )        # noqa: F821
+        LVL1MenuItem('L1_2EM20VH'        ).setLogic( EM20VH.x(2)          & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_EM7_2EM3'       ).setLogic( EM7 & EM3.x(2)       & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_EM12_2EM3'      ).setLogic( EM12 & EM3.x(2)      & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_EM20VH_2EM7'    ).setLogic( EM20VH & EM7.x(2)    & physcond).setTriggerType( TT.calo )     # noqa: F821   
 
-        LVL1MenuItem('L1_EM20VH_3EM10VH' ).setLogic( EM20VH & EM10VH.x(3)    & physcond).setTriggerType( TT.calo )        
-        LVL1MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( EM20VH & EM10VH.x(2) & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )        
+        LVL1MenuItem('L1_EM20VH_3EM10VH' ).setLogic( EM20VH & EM10VH.x(3)    & physcond).setTriggerType( TT.calo )                        # noqa: F821
+        LVL1MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( EM20VH & EM10VH.x(2) & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )    # noqa: F821    
 
         # 4xEM
-        LVL1MenuItem('L1_EM15VH_3EM7'         ).setLogic( EM15VH & EM7.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_3EM8VH'       ).setLogic( EM15VH & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_3EM10VH'      ).setLogic( EM15VH & EM10VH.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2EM10VH_3EM7' ).setLogic( EM15VH & EM10VH.x(2) & EM7.x(3)     & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VH_3EM7'         ).setLogic( EM15VH & EM7.x(3)    & physcond).setTriggerType( TT.calo )       # noqa: F821
+        LVL1MenuItem('L1_EM15VH_3EM8VH'       ).setLogic( EM15VH & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_EM15VH_3EM10VH'      ).setLogic( EM15VH & EM10VH.x(3)    & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_2EM10VH_3EM7' ).setLogic( EM15VH & EM10VH.x(2) & EM7.x(3)     & physcond).setTriggerType( TT.calo )    # noqa: F821
         if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM18VH_3EM8VH'       ).setLogic( EM18VH & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM18VH_2EM10VH_3EM7' ).setLogic( EM18VH & EM10VH.x(2) & EM7.x(3)     & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM18VH_3EM8VH'       ).setLogic( EM18VH & EM8VH.x(3)    & physcond).setTriggerType( TT.calo )  # noqa: F821
+           LVL1MenuItem('L1_EM18VH_2EM10VH_3EM7' ).setLogic( EM18VH & EM10VH.x(2) & EM7.x(3)     & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         # EM and jet
-        LVL1MenuItem('L1_JJ15.23ETA49' ).setLogic( JJ1523ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15.23ETA49' ).setLogic( J1523ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15.24ETA49' ).setLogic( J1524ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15.31ETA49' ).setLogic( J1531ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.28ETA31' ).setLogic( J2028ETA31 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.31ETA49' ).setLogic( J2031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.31ETA49' ).setLogic( J3031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40.0ETA25' ).setLogic( J400ETA25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50.31ETA49' ).setLogic( J5031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J70.31ETA49' ).setLogic( J7031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100.31ETA49' ).setLogic( J10031ETA49 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J15.0ETA25'  ).setLogic( J150ETA25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.0ETA28'  ).setLogic( J200ETA28 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25.0ETA23'  ).setLogic( J250ETA23 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J35.0ETA23'  ).setLogic( J350ETA23 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.0ETA49'  ).setLogic( J200ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49'  ).setLogic( J300ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25.0ETA23_2J15.31ETA49'  ).setLogic( J250ETA23 & J1531ETA49.x(2) & physcond).setTriggerType(TT.calo)
-        
-
-
-
-
-
-
-
-
-
+        LVL1MenuItem('L1_JJ15.23ETA49' ).setLogic( JJ1523ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J15.23ETA49' ).setLogic( J1523ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J15.24ETA49' ).setLogic( J1524ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J15.31ETA49' ).setLogic( J1531ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J20.28ETA31' ).setLogic( J2028ETA31 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J20.31ETA49' ).setLogic( J2031ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J30.31ETA49' ).setLogic( J3031ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J40.0ETA25' ).setLogic( J400ETA25 & physcond).setTriggerType(TT.calo)        # noqa: F821
+        LVL1MenuItem('L1_J50.31ETA49' ).setLogic( J5031ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J70.31ETA49' ).setLogic( J7031ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_J100.31ETA49' ).setLogic( J10031ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J15.0ETA25'  ).setLogic( J150ETA25 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20.0ETA28'  ).setLogic( J200ETA28 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J25.0ETA23'  ).setLogic( J250ETA23 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J35.0ETA23'  ).setLogic( J350ETA23 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20.0ETA49'  ).setLogic( J200ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.0ETA49'  ).setLogic( J300ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J25.0ETA23_2J15.31ETA49'  ).setLogic( J250ETA23 & J1531ETA49.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
+       
+        LVL1MenuItem('L1_2EM3_VTE70').setLogic( EM3.x(2) & Not(TE70) & physcond).setTriggerType(TT.calo) # noqa: F821        
+ 
         # HI
-        LVL1MenuItem('L1_EM3_NZ'         ).setLogic( EM3      & Not(ZDC_AND) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM3_NZ'        ).setLogic( EM3.x(2) & Not(ZDC_AND) & physcond).setTriggerType( TT.calo )   
+        LVL1MenuItem('L1_EM3_NZ'         ).setLogic( EM3      & Not(ZDC_AND) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_2EM3_NZ'        ).setLogic( EM3.x(2) & Not(ZDC_AND) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_EM3_NL'         ).setLogic( EM3      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM3_NL'        ).setLogic( EM3.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM3_NL'         ).setLogic( EM3      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_2EM3_NL'        ).setLogic( EM3.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_EM3_MV'         ).setLogic( EM3      & Not(MBTS_A & MBTS_C) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_MV_VTE50'   ).setLogic( EM3      & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType( TT.calo ) 
+        LVL1MenuItem('L1_EM3_MV'         ).setLogic( EM3      & Not(MBTS_A & MBTS_C) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM3_MV_VTE50'   ).setLogic( EM3      & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType( TT.calo ) # noqa: F821
 
-        LVL1MenuItem('L1_EM3_TE50'       ).setLogic( EM3      & TE50 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_VTE50'      ).setLogic( EM3      & Not(TE50) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM3_TE50'       ).setLogic( EM3      & TE50 & physcond).setTriggerType( TT.calo )         # noqa: F821
+        LVL1MenuItem('L1_EM3_VTE50'      ).setLogic( EM3      & Not(TE50) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_EM3_UNPAIRED_ISO'   ).setLogic(EM3 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_UNPAIRED_NONISO').setLogic(EM3 & unpaired_nonisocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_EMPTY'          ).setLogic(EM3 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_FIRSTEMPTY'     ).setLogic(EM3 & firstempty).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM3_UNPAIRED_ISO'   ).setLogic(EM3 & unpaired_isocond).setTriggerType( TT.calo )       # noqa: F821
+        LVL1MenuItem('L1_EM3_UNPAIRED_NONISO').setLogic(EM3 & unpaired_nonisocond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM3_EMPTY'          ).setLogic(EM3 & cosmiccond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM3_FIRSTEMPTY'     ).setLogic(EM3 & firstempty).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_EM5_EMPTY'          ).setLogic(EM5 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_UNPAIRED_ISO'   ).setLogic(EM5 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_UNPAIRED_NONISO').setLogic(EM5 & unpaired_nonisocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_FIRSTEMPTY'     ).setLogic(EM5 & firstempty).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM5_EMPTY'          ).setLogic(EM5 & cosmiccond).setTriggerType( TT.calo )          # noqa: F821
+        LVL1MenuItem('L1_EM5_UNPAIRED_ISO'   ).setLogic(EM5 & unpaired_isocond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM5_UNPAIRED_NONISO').setLogic(EM5 & unpaired_nonisocond).setTriggerType( TT.calo ) # noqa: F821
+        LVL1MenuItem('L1_EM5_FIRSTEMPTY'     ).setLogic(EM5 & firstempty).setTriggerType( TT.calo )          # noqa: F821
 
-        LVL1MenuItem('L1_EM7_EMPTY'          ).setLogic(EM7 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_UNPAIRED_ISO'   ).setLogic(EM7 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_UNPAIRED_NONISO').setLogic(EM7 & unpaired_nonisocond).setTriggerType( TT.calo ) 
-        LVL1MenuItem('L1_EM7_FIRSTEMPTY'     ).setLogic(EM7 & firstempty).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM7_EMPTY'          ).setLogic(EM7 & cosmiccond).setTriggerType( TT.calo )          # noqa: F821
+        LVL1MenuItem('L1_EM7_UNPAIRED_ISO'   ).setLogic(EM7 & unpaired_isocond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM7_UNPAIRED_NONISO').setLogic(EM7 & unpaired_nonisocond).setTriggerType( TT.calo ) # noqa: F821
+        LVL1MenuItem('L1_EM7_FIRSTEMPTY'     ).setLogic(EM7 & firstempty).setTriggerType( TT.calo )          # noqa: F821
 
-        LVL1MenuItem('L1_EM20VH_FIRSTEMPTY'    ).setLogic( EM20VH & firstempty).setTriggerType( TT.calo )  
-        LVL1MenuItem('L1_EM22VHI_FIRSTEMPTY'    ).setLogic( EM22VHI & firstempty).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM20VH_FIRSTEMPTY'    ).setLogic( EM20VH & firstempty).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM22VHI_FIRSTEMPTY'    ).setLogic( EM22VHI & firstempty).setTriggerType( TT.calo )  # noqa: F821
 
-        LVL1MenuItem('L1_J10_VTE100'      ).setLogic( J10      & Not(TE100) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_J10_VTE200'      ).setLogic( J10      & Not(TE200) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_J10_VTE300'      ).setLogic( J10      & Not(TE300) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_J10_VTE100'      ).setLogic( J10      & Not(TE100) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_J10_VTE200'      ).setLogic( J10      & Not(TE200) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_J10_VTE300'      ).setLogic( J10      & Not(TE300) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TE5_VTE200'      ).setLogic( TE5      & Not(TE200) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TE5_VTE200'      ).setLogic( TE5      & Not(TE200) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
 
         # MUON ctpid=[0x20;0x2f]
-        LVL1MenuItem('L1_MU0'  ).setLogic( MU0  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4'  ).setLogic( MU4  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6'  ).setLogic( MU6  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10' ).setLogic( MU10 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU11' ).setLogic( MU11 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU15' ).setLogic( MU15 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU20' ).setLogic( MU20 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU21' ).setLogic( MU21 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU0'  ).setLogic( MU0  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4'  ).setLogic( MU4  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6'  ).setLogic( MU6  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU10' ).setLogic( MU10 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU11' ).setLogic( MU11 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU15' ).setLogic( MU15 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU20' ).setLogic( MU20 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU21' ).setLogic( MU21 & physcond).setTriggerType(TT.muon)    # noqa: F821
 
         # 2xMU, 3xMU, 4xMU
-        LVL1MenuItem('L1_2MU0'     ).setLogic( MU0.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4'     ).setLogic( MU4.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU6'     ).setLogic( MU6.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU10'    ).setLogic( MU10.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU11'    ).setLogic( MU11.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU20'    ).setLogic( MU20.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_MU10' ).setLogic( MU4 & MU10      & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_MU4' ).setLogic( MU6 & MU4      & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10_2MU6').setLogic( MU10 & MU6.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU11_2MU6').setLogic( MU11 & MU6.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10_2MU4').setLogic( MU10 & MU4.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_3MU4'     ).setLogic( MU4.x(3)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_4MU4'     ).setLogic( MU4.x(4)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_2MU4' ).setLogic( MU6 & MU4.x(2)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_3MU4' ).setLogic( MU6 & MU4.x(3)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU6_3MU4' ).setLogic( MU6.x(2) & MU4.x(3)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_3MU6'     ).setLogic( MU6.x(3)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_MU6' ).setLogic( MU0.x(2) & MU6  & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_2MU20_OVERLAY').setLogic( MU20.x(2)   & physcond).setTriggerType(TT.zerobs)
+        LVL1MenuItem('L1_2MU0'     ).setLogic( MU0.x(2)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU4'     ).setLogic( MU4.x(2)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU6'     ).setLogic( MU6.x(2)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU10'    ).setLogic( MU10.x(2)       & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU11'    ).setLogic( MU11.x(2)       & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU20'    ).setLogic( MU20.x(2)       & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_MU10' ).setLogic( MU4 & MU10      & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_MU4' ).setLogic( MU6 & MU4      & physcond).setTriggerType(TT.muon)      # noqa: F821
+        LVL1MenuItem('L1_MU10_2MU6').setLogic( MU10 & MU6.x(2) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU11_2MU6').setLogic( MU11 & MU6.x(2) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU10_2MU4').setLogic( MU10 & MU4.x(2) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_3MU4'     ).setLogic( MU4.x(3)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_4MU4'     ).setLogic( MU4.x(4)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_2MU4' ).setLogic( MU6 & MU4.x(2)  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_3MU4' ).setLogic( MU6 & MU4.x(3)  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_3MU4' ).setLogic( MU6.x(2) & MU4.x(3)  & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_3MU6'     ).setLogic( MU6.x(3)        & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU0_MU6' ).setLogic( MU0.x(2) & MU6  & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_2MU20_OVERLAY').setLogic( MU20.x(2)   & physcond).setTriggerType(TT.zerobs)    # noqa: F821
 
         # HI
-        LVL1MenuItem('L1_MU0_NZ'   ).setLogic( MU0      & Not(ZDC_AND) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_NZ'  ).setLogic( MU0.x(2) & Not(ZDC_AND) & physcond).setTriggerType(TT.muon)   
+        LVL1MenuItem('L1_MU0_NZ'   ).setLogic( MU0      & Not(ZDC_AND) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU0_NZ'  ).setLogic( MU0.x(2) & Not(ZDC_AND) & physcond).setTriggerType(TT.muon)    # noqa: F821   
 
-        LVL1MenuItem('L1_MU0_NL'   ).setLogic( MU0      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_NL'  ).setLogic( MU0.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.muon)                  
+        LVL1MenuItem('L1_MU0_NL'   ).setLogic( MU0      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU0_NL'  ).setLogic( MU0.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.muon)    # noqa: F821                 
                             
-        LVL1MenuItem('L1_MU0_MV'   ).setLogic( MU0      & Not(MBTS_A & MBTS_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_MV'  ).setLogic( MU0.x(2) & Not(MBTS_A & MBTS_C) & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU0_MV'   ).setLogic( MU0      & Not(MBTS_A & MBTS_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU0_MV'  ).setLogic( MU0.x(2) & Not(MBTS_A & MBTS_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
         
-        LVL1MenuItem('L1_MU4_VTE10').setLogic( MU4      & Not(TE10) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10').setLogic( MU4.x(2)      & Not(TE10) & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU4_VTE10').setLogic( MU4      & Not(TE10) & physcond).setTriggerType(TT.muon)          # noqa: F821
+        LVL1MenuItem('L1_2MU4_VTE10').setLogic( MU4.x(2)      & Not(TE10) & physcond).setTriggerType(TT.muon)    # noqa: F821
         
-        LVL1MenuItem('L1_MU0_TE50' ).setLogic( MU0      & TE50 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU0_TE50' ).setLogic( MU0      & TE50 & physcond).setTriggerType(TT.muon)    # noqa: F821
 
 
-        LVL1MenuItem('L1_MU4_TE50' ).setLogic( MU4      & TE50 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE70' ).setLogic( MU4      & TE70 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE90' ).setLogic( MU4      & TE90 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE120' ).setLogic( MU4     & TE120 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE160' ).setLogic( MU4     & TE160 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU4_TE10' ).setLogic( MU4      & TE10 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE40' ).setLogic( MU4      & TE40 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE50' ).setLogic( MU4      & TE50 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE70' ).setLogic( MU4      & TE70 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE90' ).setLogic( MU4      & TE90 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE120' ).setLogic( MU4     & TE120 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE160' ).setLogic( MU4     & TE160 & physcond).setTriggerType(TT.muon)    # noqa: F821
         
-        LVL1MenuItem('L1_MU4_TE10.0ETA24' ).setLogic( MU4      & TE100ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE15.0ETA24' ).setLogic( MU4      & TE150ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE20.0ETA24' ).setLogic( MU4      & TE200ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE25.0ETA24' ).setLogic( MU4      & TE250ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE30.0ETA24' ).setLogic( MU4     & TE300ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE35.0ETA24' ).setLogic( MU4      & TE350ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE40.0ETA24' ).setLogic( MU4      & TE400ETA24 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU4_TE10.0ETA24' ).setLogic( MU4      & TE100ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE15.0ETA24' ).setLogic( MU4      & TE150ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE20.0ETA24' ).setLogic( MU4      & TE200ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE25.0ETA24' ).setLogic( MU4      & TE250ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE30.0ETA24' ).setLogic( MU4     & TE300ETA24 & physcond).setTriggerType(TT.muon)     # noqa: F821
+        LVL1MenuItem('L1_MU4_TE35.0ETA24' ).setLogic( MU4      & TE350ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE40.0ETA24' ).setLogic( MU4      & TE400ETA24 & physcond).setTriggerType(TT.muon)    # noqa: F821
         
-        LVL1MenuItem('L1_MU0_VTE50').setLogic( MU0      & Not(TE50) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VTE50').setLogic( MU4      & Not(TE50) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU0_MV_VTE50').setLogic( MU0 & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_MV_VTE50').setLogic( MU4 & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU0_UNPAIRED_ISO'   ).setLogic(MU0 & unpaired_isocond   ).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_UNPAIRED_NONISO').setLogic(MU0 & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_EMPTY'          ).setLogic(MU0 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_FIRSTEMPTY'     ).setLogic(MU0 & firstempty).setTriggerType( TT.muon )
-
-        LVL1MenuItem('L1_MU4_UNPAIRED_ISO'   ).setLogic(MU4 & unpaired_isocond   ).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_UNPAIRED_NONISO').setLogic(MU4 & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_EMPTY'          ).setLogic(MU4 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU6_EMPTY'          ).setLogic(MU6 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_FIRSTEMPTY'     ).setLogic(MU4 & firstempty).setTriggerType( TT.muon )
-
-        LVL1MenuItem('L1_MU6_FIRSTEMPTY'     ).setLogic(MU4  & firstempty).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_MU10_EMPTY'         ).setLogic(MU10 & cosmiccond).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_MU11_EMPTY'         ).setLogic(MU11 & cosmiccond).setTriggerType( TT.muon ) 
+        LVL1MenuItem('L1_MU0_VTE50').setLogic( MU0      & Not(TE50) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_VTE50').setLogic( MU4      & Not(TE50) & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_MU0_MV_VTE50').setLogic( MU0 & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_MV_VTE50').setLogic( MU4 & Not(MBTS_A & MBTS_C) & Not(TE50) & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_MU0_UNPAIRED_ISO'   ).setLogic(MU0 & unpaired_isocond   ).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU0_UNPAIRED_NONISO').setLogic(MU0 & unpaired_nonisocond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU0_EMPTY'          ).setLogic(MU0 & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU0_FIRSTEMPTY'     ).setLogic(MU0 & firstempty).setTriggerType( TT.muon )    # noqa: F821
+
+        LVL1MenuItem('L1_MU4_UNPAIRED_ISO'   ).setLogic(MU4 & unpaired_isocond   ).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU4_UNPAIRED_NONISO').setLogic(MU4 & unpaired_nonisocond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU4_EMPTY'          ).setLogic(MU4 & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU6_EMPTY'          ).setLogic(MU6 & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU4_FIRSTEMPTY'     ).setLogic(MU4 & firstempty).setTriggerType( TT.muon )    # noqa: F821
+
+        LVL1MenuItem('L1_MU6_FIRSTEMPTY'     ).setLogic(MU4  & firstempty).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU10_EMPTY'         ).setLogic(MU10 & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_MU11_EMPTY'         ).setLogic(MU11 & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
         
-        LVL1MenuItem('L1_2MU0_EMPTY'         ).setLogic(MU0.x(2) & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU4_EMPTY'         ).setLogic(MU4.x(2) & cosmiccond).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_2MU6_UNPAIRED_ISO'  ).setLogic(MU6.x(2) & unpaired_isocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_UNPAIRED_NONISO').setLogic(MU6.x(2) & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_EMPTY'         ).setLogic(MU6.x(2) & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_FIRSTEMPTY'    ).setLogic(MU6.x(2) & firstempty).setTriggerType( TT.muon )
+        LVL1MenuItem('L1_2MU0_EMPTY'         ).setLogic(MU0.x(2) & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_2MU4_EMPTY'         ).setLogic(MU4.x(2) & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_2MU6_UNPAIRED_ISO'  ).setLogic(MU6.x(2) & unpaired_isocond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_2MU6_UNPAIRED_NONISO').setLogic(MU6.x(2) & unpaired_nonisocond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_2MU6_EMPTY'         ).setLogic(MU6.x(2) & cosmiccond).setTriggerType( TT.muon )    # noqa: F821
+        LVL1MenuItem('L1_2MU6_FIRSTEMPTY'    ).setLogic(MU6.x(2) & firstempty).setTriggerType( TT.muon )    # noqa: F821
 
-        LVL1MenuItem('L1_MU20_FIRSTEMPTY' ).setLogic( MU20 & firstempty).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU21_FIRSTEMPTY' ).setLogic( MU21 & firstempty).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU20_FIRSTEMPTY' ).setLogic( MU20 & firstempty).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU21_FIRSTEMPTY' ).setLogic( MU21 & firstempty).setTriggerType(TT.muon)    # noqa: F821
 
         #FTK items
-        LVL1MenuItem('L1_MU6_FTK').setLogic( MU6  & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_MU15_FTK').setLogic( MU15  & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_MU20_FTK').setLogic( MU20  & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_MU21_FTK').setLogic( MU21  & physcond).setTriggerType(TT.ftk)
+        LVL1MenuItem('L1_MU6_FTK').setLogic( MU6  & physcond).setTriggerType(TT.ftk)               # noqa: F821
+        LVL1MenuItem('L1_MU15_FTK').setLogic( MU15  & physcond).setTriggerType(TT.ftk)             # noqa: F821
+        LVL1MenuItem('L1_MU20_FTK').setLogic( MU20  & physcond).setTriggerType(TT.ftk)             # noqa: F821
+        LVL1MenuItem('L1_MU21_FTK').setLogic( MU21  & physcond).setTriggerType(TT.ftk)             # noqa: F821
             
         # EM and MU
-        LVL1MenuItem('L1_EM6_MU10'   ).setLogic( EM6        & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU10'   ).setLogic( EM7        & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU15'   ).setLogic( EM7        & MU15     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM8VH_MU15' ).setLogic( EM8VH      & MU15     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU20'   ).setLogic( EM7        & MU20     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM8VH_MU20' ).setLogic( EM8VH      & MU20     & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_EM7_MU11' ).setLogic( EM7        & MU11     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM8_MU10'   ).setLogic( EM8        & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM8I_MU10'  ).setLogic( EM8I       & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15I_MU4'   ).setLogic( EM15  & EM8I     & MU4      & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15VH_MU10').setLogic( EM15VH     & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM3_MU20'   ).setLogic( EM3        & MU20     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2EM8VH_MU10').setLogic( EM8VH.x(2) & MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15VH_2EM8VH_MU6').setLogic( EM15VH & EM8VH.x(2) &  MU6 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_EM6_MU10'   ).setLogic( EM6        & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM7_MU10'   ).setLogic( EM7        & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM7_MU15'   ).setLogic( EM7        & MU15     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM8VH_MU15' ).setLogic( EM8VH      & MU15     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM7_MU20'   ).setLogic( EM7        & MU20     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM8VH_MU20' ).setLogic( EM8VH      & MU20     & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_EM7_MU11' ).setLogic( EM7        & MU11     & physcond).setTriggerType(TT.muon)      # noqa: F821
+        LVL1MenuItem('L1_EM8_MU10'   ).setLogic( EM8        & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM8I_MU10'  ).setLogic( EM8I       & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM15I_MU4'   ).setLogic( EM15  & EM8I     & MU4      & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_MU10').setLogic( EM15VH     & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM3_MU20'   ).setLogic( EM3        & MU20     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2EM8VH_MU10').setLogic( EM8VH.x(2) & MU10     & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_2EM8VH_MU6').setLogic( EM15VH & EM8VH.x(2) &  MU6 & physcond).setTriggerType(TT.muon)    # noqa: F821
 
         # TAU ctpid=[0x40:0x4f]
-        LVL1MenuItem('L1_TAU6'  ).setLogic( HA6   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8'  ).setLogic( HA8   & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU6'  ).setLogic( HA6   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU8'  ).setLogic( HA8   & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        #LVL1MenuItem('L1_TAU10IM').setLogic( HA10IM  & physcond).setTriggerType( TT.calo )
+        #LVL1MenuItem('L1_TAU10IM').setLogic( HA10IM  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU12' ).setLogic( HA12  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU12' ).setLogic( HA12  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU12IL').setLogic( HA12IL & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12IM').setLogic( HA12IM & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12IT').setLogic( HA12IT & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I').setLogic( HA12I & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU12IL').setLogic( HA12IL & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12IM').setLogic( HA12IM & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12IT').setLogic( HA12IT & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12I').setLogic( HA12I & physcond).setTriggerType( TT.calo )      # noqa: F821
 
-        LVL1MenuItem('L1_TAU15' ).setLogic( HA15  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU15' ).setLogic( HA15  & physcond).setTriggerType( TT.calo )      # noqa: F821
 
-        LVL1MenuItem('L1_TAU20' ).setLogic( HA20  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL' ).setLogic( HA20IL  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM' ).setLogic( HA20IM  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IT' ).setLogic( HA20IT  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20' ).setLogic( HA20  & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU20IL' ).setLogic( HA20IL  & physcond).setTriggerType( TT.calo )  # noqa: F821
+        LVL1MenuItem('L1_TAU20IM' ).setLogic( HA20IM  & physcond).setTriggerType( TT.calo )  # noqa: F821
+        LVL1MenuItem('L1_TAU20IT' ).setLogic( HA20IT  & physcond).setTriggerType( TT.calo )  # noqa: F821
         
-        LVL1MenuItem('L1_TAU20A' ).setLogic( HA20A  & physcond).setTriggerType( TT.calo ) 
-        LVL1MenuItem('L1_TAU20C' ).setLogic( HA20C  & physcond).setTriggerType( TT.calo ) 
+        LVL1MenuItem('L1_TAU20A' ).setLogic( HA20A  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20C' ).setLogic( HA20C  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU25' ).setLogic( HA25  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU25' ).setLogic( HA25  & physcond).setTriggerType( TT.calo )      # noqa: F821
         if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_TAU25IT' ).setLogic( HA25IT  & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_TAU25IT' ).setLogic( HA25IT  & physcond).setTriggerType( TT.calo )    # noqa: F821
         else:
-           LVL1MenuItem('L1_TAU25IM' ).setLogic( HA25IM  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU30' ).setLogic( HA30  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40' ).setLogic( HA40  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU60' ).setLogic( HA60  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU100' ).setLogic( HA100  & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_TAU25IM' ).setLogic( HA25IM  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU30' ).setLogic( HA30  & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU40' ).setLogic( HA40  & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU60' ).setLogic( HA60  & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU100' ).setLogic( HA100  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( HA8   & unpaired_isocond ).setTriggerType( TT.calo ) 
+        LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( HA8   & unpaired_isocond ).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU8_UNPAIRED_NONISO').setLogic( HA8   & unpaired_nonisocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8_EMPTY'          ).setLogic( HA8   & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8_FIRSTEMPTY'     ).setLogic( HA8   & firstempty ).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU8_UNPAIRED_NONISO').setLogic( HA8   & unpaired_nonisocond ).setTriggerType( TT.calo ) # noqa: F821
+        LVL1MenuItem('L1_TAU8_EMPTY'          ).setLogic( HA8   & cosmiccond ).setTriggerType( TT.calo )          # noqa: F821
+        LVL1MenuItem('L1_TAU8_FIRSTEMPTY'     ).setLogic( HA8   & firstempty ).setTriggerType( TT.calo )          # noqa: F821
 
-        LVL1MenuItem('L1_TAU12_UNPAIRED_ISO').setLogic( HA12   & unpaired_isocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_UNPAIRED_NONISO').setLogic( HA12   & unpaired_nonisocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_EMPTY'          ).setLogic( HA12  & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_FIRSTEMPTY'     ).setLogic( HA12   & firstempty ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU30_EMPTY'          ).setLogic( HA30   & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU30_UNPAIRED_ISO').setLogic( HA30  & unpaired_isocond ).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU12_UNPAIRED_ISO').setLogic( HA12   & unpaired_isocond ).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12_UNPAIRED_NONISO').setLogic( HA12   & unpaired_nonisocond ).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12_EMPTY'          ).setLogic( HA12  & cosmiccond ).setTriggerType( TT.calo )        # noqa: F821
+        LVL1MenuItem('L1_TAU12_FIRSTEMPTY'     ).setLogic( HA12   & firstempty ).setTriggerType( TT.calo )       # noqa: F821
+        LVL1MenuItem('L1_TAU30_EMPTY'          ).setLogic( HA30   & cosmiccond ).setTriggerType( TT.calo )       # noqa: F821
+        LVL1MenuItem('L1_TAU30_UNPAIRED_ISO').setLogic( HA30  & unpaired_isocond ).setTriggerType( TT.calo )     # noqa: F821
 
 
         # 3xTAU
-        LVL1MenuItem('L1_TAU20_2TAU12'  ).setLogic( HA20 & HA12.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12I' ).setLogic( HA20 & HA12I.x(2) &  physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_2TAU20IM' ).setLogic( HA40 & HA20IM.x(2) &  physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM' ).setLogic( HA20IM & HA12IM.x(2) &  physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20_2TAU12'  ).setLogic( HA20 & HA12.x(2)  & physcond).setTriggerType( TT.calo )          # noqa: F821
+        LVL1MenuItem('L1_TAU20_2TAU12I' ).setLogic( HA20 & HA12I.x(2) &  physcond).setTriggerType( TT.calo )         # noqa: F821
+        LVL1MenuItem('L1_TAU40_2TAU20IM' ).setLogic( HA40 & HA20IM.x(2) &  physcond).setTriggerType( TT.calo )       # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM' ).setLogic( HA20IM & HA12IM.x(2) &  physcond).setTriggerType( TT.calo )   # noqa: F821
 
         # mixed tau
-        LVL1MenuItem('L1_EM15VH_2TAU12'                ).setLogic( EM15VH  & HA12.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2TAU12IL'              ).setLogic( EM15VH  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU12'                  ).setLogic( EM15    & HA12.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU20'                  ).setLogic( EM15    & HA20.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2TAU20'                ).setLogic( EM15VH  & HA20.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_TAU40_2TAU15'            ).setLogic( EM15    & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU12_J25_2J15_3J12'    ).setLogic( EM15  & HA12.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VH_2TAU12'                ).setLogic( EM15VH  & HA12.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_2TAU12IL'              ).setLogic( EM15VH  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15_2TAU12'                  ).setLogic( EM15    & HA12.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15_2TAU20'                  ).setLogic( EM15    & HA20.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_2TAU20'                ).setLogic( EM15VH  & HA20.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15_TAU40_2TAU15'            ).setLogic( EM15    & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15_2TAU12_J25_2J15_3J12'    ).setLogic( EM15  & HA12.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM15VHI_2TAU12'                ).setLogic( EM15VHI  & HA12.x(2)          & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IL'              ).setLogic( EM15VHI  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IM'              ).setLogic( EM15VHI  & HA12IM.x(2)        & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_TAU40_2TAU15'          ).setLogic( EM15VHI  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12I_J25_2J15_3J12'  ).setLogic( EM15VHI  & HA12I.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IM_J25_3J12'  ).setLogic( EM15VHI  & HA12IM.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IL_J25_3J12'  ).setLogic( EM15VHI  & HA12IL.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12_J25_3J12'  ).setLogic( EM15VHI  & HA12.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IM_4J12'  ).setLogic( EM15VHI  & HA12IM.x(2) & J12.x(4) & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15VHI_2TAU12'                ).setLogic( EM15VHI  & HA12.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IL'              ).setLogic( EM15VHI  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IM'              ).setLogic( EM15VHI  & HA12IM.x(2)        & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_TAU40_2TAU15'          ).setLogic( EM15VHI  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12I_J25_2J15_3J12'  ).setLogic( EM15VHI  & HA12I.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IM_J25_3J12'  ).setLogic( EM15VHI  & HA12IM.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IL_J25_3J12'  ).setLogic( EM15VHI  & HA12IL.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12_J25_3J12'  ).setLogic( EM15VHI  & HA12.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IM_4J12'  ).setLogic( EM15VHI  & HA12IM.x(2) & J12.x(4) & physcond).setTriggerType( TT.calo )    # noqa: F821
         else:
-           LVL1MenuItem('L1_EM15HI_2TAU12'                ).setLogic( EM15HI  & HA12.x(2)          & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IL'              ).setLogic( EM15HI  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IM'              ).setLogic( EM15HI  & HA12IM.x(2)        & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_TAU40_2TAU15'          ).setLogic( EM15HI  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12I_J25_2J15_3J12'  ).setLogic( EM15HI  & HA12I.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IM_J25_3J12'  ).setLogic( EM15HI  & HA12IM.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IL_J25_3J12'  ).setLogic( EM15HI  & HA12IL.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12_J25_3J12'  ).setLogic( EM15HI  & HA12.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_MU10_TAU12'       ).setLogic( MU10  & HA12          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12I'      ).setLogic( MU10  & HA12I         & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM'     ).setLogic( MU10  & HA12IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20'       ).setLogic( MU10  & HA20          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20IM'     ).setLogic( MU10  & HA20IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU11_TAU20IM'     ).setLogic( MU11  & HA20IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20IM_J25_2J20'     ).setLogic( MU10  & HA20IM   & J25 & J20.x(2) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20I'       ).setLogic( MU10  & HA20I        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU20_TAU12IM').setLogic( MU20 & HA12IM & physcond).setTriggerType( TT.calo)        
-        LVL1MenuItem('L1_TAU12I_MU10_J25'  ).setLogic( HA12I & MU10 & J25    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I_MU10_J25_2J12'  ).setLogic( HA12I & MU10 & J25 & J12.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12_J25_2J12' ).setLogic( MU10 & HA12 & J25 & J12.x(2)     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_J25_2J12' ).setLogic( MU10 & HA12IM & J25 & J12.x(2)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IL_J25_2J12' ).setLogic( MU10 & HA12IL & J25 & J12.x(2)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I_MU10_J20.31ETA49' ).setLogic( HA12I & MU10 & J2031ETA49    & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15HI_2TAU12'                ).setLogic( EM15HI  & HA12.x(2)          & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IL'              ).setLogic( EM15HI  & HA12IL.x(2)        & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IM'              ).setLogic( EM15HI  & HA12IM.x(2)        & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_TAU40_2TAU15'          ).setLogic( EM15HI  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12I_J25_2J15_3J12'  ).setLogic( EM15HI  & HA12I.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IM_J25_3J12'  ).setLogic( EM15HI  & HA12IM.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IL_J25_3J12'  ).setLogic( EM15HI  & HA12IL.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12_J25_3J12'  ).setLogic( EM15HI  & HA12.x(2)  & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+
+        LVL1MenuItem('L1_MU10_TAU12'       ).setLogic( MU10  & HA12          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12I'      ).setLogic( MU10  & HA12I         & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IM'     ).setLogic( MU10  & HA12IM        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU20'       ).setLogic( MU10  & HA20          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU20IM'     ).setLogic( MU10  & HA20IM        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU11_TAU20IM'     ).setLogic( MU11  & HA20IM        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU20IM_J25_2J20'     ).setLogic( MU10  & HA20IM   & J25 & J20.x(2) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU20I'       ).setLogic( MU10  & HA20I        & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU20_TAU12IM').setLogic( MU20 & HA12IM & physcond).setTriggerType( TT.calo)                  # noqa: F821
+        LVL1MenuItem('L1_TAU12I_MU10_J25'  ).setLogic( HA12I & MU10 & J25    & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12I_MU10_J25_2J12'  ).setLogic( HA12I & MU10 & J25 & J12.x(2)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12_J25_2J12' ).setLogic( MU10 & HA12 & J25 & J12.x(2)     & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IM_J25_2J12' ).setLogic( MU10 & HA12IM & J25 & J12.x(2)    & physcond).setTriggerType( TT.calo ) # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IL_J25_2J12' ).setLogic( MU10 & HA12IL & J25 & J12.x(2)    & physcond).setTriggerType( TT.calo ) # noqa: F821
+        LVL1MenuItem('L1_TAU12I_MU10_J20.31ETA49' ).setLogic( HA12I & MU10 & J2031ETA49    & physcond).setTriggerType( TT.calo )    # noqa: F821
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_MU10_TAU12IM_3J12' ).setLogic( MU10 & HA12IM & J12.x(3)    & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_MU10_TAU12IM_3J12' ).setLogic( MU10 & HA12IM & J12.x(3)    & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU20_2TAU12I_J25_2J15_3J12'   ).setLogic( HA20 & HA12I.x(2)     & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'   ).setLogic( HA20 & HA12.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12').setLogic( HA20IM & HA12IM.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL_2TAU12IL_J25_2J20_3J12').setLogic( HA20IL & HA12IL.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20_2TAU12I_J25_2J15_3J12'   ).setLogic( HA20 & HA12I.x(2)     & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'   ).setLogic( HA20 & HA12.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )         # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12').setLogic( HA20IM & HA12IM.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20IL_2TAU12IL_J25_2J20_3J12').setLogic( HA20IL & HA12IL.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_TAU25IT_2TAU12IT_2J25_3J12').setLogic( HA25IT & HA12IT.x(2)     & J25.x(2)  & J12.x(3) & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_TAU25IT_2TAU12IT_2J25_3J12').setLogic( HA25IT & HA12IT.x(2)     & J25.x(2)  & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
         else:
-           LVL1MenuItem('L1_TAU25IM_2TAU20IM_2J25_3J20').setLogic( HA25IM & HA20IM.x(2)     & J25.x(2)  & J20.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12').setLogic( HA20IM & HA12IM.x(2)  & J12.x(4) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_TAU60_2TAU40').setLogic( HA60 & HA40.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2TAU12I_TAU20_J25_2J15_3J12'  ).setLogic( HA12I.x(2)   & HA20  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( HA20    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2J20_XE50'            ).setLogic( HA20IM   & J20.x(2)   & XE50 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2J20_XE45'            ).setLogic( HA20IM    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU25_2J20_XE45'              ).setLogic( HA25      & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( HA20    & HA12.x(2)  & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE35'        ).setLogic( HA20IM  & HA12IM.x(2)  & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL_2TAU12IL_XE35'        ).setLogic( HA20IL  & HA12IL.x(2)  & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IT_2TAU12IT_XE35'        ).setLogic( HA20IT  & HA12IT.x(2)  & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE40'        ).setLogic( HA20IM  & HA12IM.x(2)  & XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_2TAU12IM_XE40'        ).setLogic( HA40  & HA12IM.x(2)  & XE40 & physcond).setTriggerType( TT.calo )   
-        LVL1MenuItem('L1_EM20VHI_TAU20IM_2TAU20_J25_3J20'          ).setLogic( EM20VHI  &  HA20IM  &  HA20.x(2) &  J25  & J20.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12I_XE35'             ).setLogic( MU10    & HA12I      & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12_XE35'              ).setLogic( MU10    & HA12       & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IL_XE35'            ).setLogic( MU10    & HA12IL     & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_XE35'            ).setLogic( MU10    & HA12IM     & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IT_XE35'            ).setLogic( MU10    & HA12IT     & XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_XE40'            ).setLogic( MU10    & HA12IM     & XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20I_2TAU12I_XE35'          ).setLogic( HA20I   & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )
+            LVL1MenuItem('L1_TAU25IM_2TAU12IM_J25_3J12'  ).setLogic( HA25IM & HA12IM.x(2) & J25 & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+            LVL1MenuItem('L1_TAU25IM_2TAU20IM_2J25_3J20').setLogic( HA25IM & HA20IM.x(2)     & J25.x(2)  & J20.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+            LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12').setLogic( HA20IM & HA12IM.x(2)  & J12.x(4) & physcond).setTriggerType( TT.calo )    # noqa: F821
+            LVL1MenuItem('L1_TAU60_2TAU40').setLogic( HA60 & HA40.x(2)  & physcond).setTriggerType( TT.calo )                            # noqa: F821
+        LVL1MenuItem('L1_2TAU12I_TAU20_J25_2J15_3J12'  ).setLogic( HA12I.x(2)   & HA20  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+#######
+        LVL1MenuItem('L1_2TAU20IM_3J20'  ).setLogic(  HA20IM.x(2) & J20.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_2TAU20IM_J25_3J20'  ).setLogic(  HA20IM.x(2) & J25 & J20.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+
+######
+
+        LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( HA20    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2J20_XE50'            ).setLogic( HA20IM   & J20.x(2)   & XE50 & physcond).setTriggerType( TT.calo )     # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2J20_XE45'            ).setLogic( HA20IM    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU25_2J20_XE45'              ).setLogic( HA25      & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( HA20    & HA12.x(2)  & XE35 & physcond).setTriggerType( TT.calo )      # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE35'        ).setLogic( HA20IM  & HA12IM.x(2)  & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20IL_2TAU12IL_XE35'        ).setLogic( HA20IL  & HA12IL.x(2)  & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20IT_2TAU12IT_XE35'        ).setLogic( HA20IT  & HA12IT.x(2)  & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE40'        ).setLogic( HA20IM  & HA12IM.x(2)  & XE40 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU40_2TAU12IM_XE40'        ).setLogic( HA40  & HA12IM.x(2)  & XE40 & physcond).setTriggerType( TT.calo )        # noqa: F821
+        LVL1MenuItem('L1_EM20VHI_TAU20IM_2TAU20_J25_3J20'          ).setLogic( EM20VHI  &  HA20IM  &  HA20.x(2) &  J25  & J20.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12I_XE35'             ).setLogic( MU10    & HA12I      & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12_XE35'              ).setLogic( MU10    & HA12       & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IL_XE35'            ).setLogic( MU10    & HA12IL     & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IM_XE35'            ).setLogic( MU10    & HA12IM     & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IT_XE35'            ).setLogic( MU10    & HA12IT     & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12IM_XE40'            ).setLogic( MU10    & HA12IM     & XE40 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20I_2TAU12I_XE35'          ).setLogic( HA20I   & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15'          ).setLogic( EM15VHI  &  HA20IM  &  HA15.x(2) &  J25  & J20.x(2) & J15.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12I_XE35'          ).setLogic( EM15VHI  & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IM_XE35'         ).setLogic( EM15VHI  & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12IL_XE35'         ).setLogic( EM15VHI  & HA12IL.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15VHI_2TAU12_XE35'         ).setLogic( EM15VHI  & HA12.x(2) & XE35 & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15'          ).setLogic( EM15VHI  &  HA20IM  &  HA15.x(2) &  J25  & J20.x(2) & J15.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12I_XE35'          ).setLogic( EM15VHI  & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )     # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IM_XE35'         ).setLogic( EM15VHI  & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12IL_XE35'         ).setLogic( EM15VHI  & HA12IL.x(2) & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15VHI_2TAU12_XE35'         ).setLogic( EM15VHI  & HA12.x(2) & XE35 & physcond).setTriggerType( TT.calo )        # noqa: F821
         else:
-           LVL1MenuItem('L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15'          ).setLogic( EM15HI  &  HA20IM  &  HA15.x(2) &  J25  & J20.x(2) & J15.x(3) & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12I_XE35'          ).setLogic( EM15HI  & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IM_XE35'         ).setLogic( EM15HI  & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12IL_XE35'         ).setLogic( EM15HI  & HA12IL.x(2) & XE35 & physcond).setTriggerType( TT.calo )
-           LVL1MenuItem('L1_EM15HI_2TAU12_XE35'         ).setLogic( EM15HI  & HA12.x(2) & XE35 & physcond).setTriggerType( TT.calo )
+           LVL1MenuItem('L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15'          ).setLogic( EM15HI  &  HA20IM  &  HA15.x(2) &  J25  & J20.x(2) & J15.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12I_XE35'          ).setLogic( EM15HI  & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo )     # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IM_XE35'         ).setLogic( EM15HI  & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12IL_XE35'         ).setLogic( EM15HI  & HA12IL.x(2) & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
+           LVL1MenuItem('L1_EM15HI_2TAU12_XE35'         ).setLogic( EM15HI  & HA12.x(2) & XE35 & physcond).setTriggerType( TT.calo )        # noqa: F821
 
         #FTK items
-        LVL1MenuItem('L1_TAU12IM_FTK').setLogic( HA12IM & physcond).setTriggerType( TT.ftk)
-        LVL1MenuItem('L1_TAU20IM_FTK').setLogic( HA20IM & physcond).setTriggerType( TT.ftk)
-        if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup():
-           LVL1MenuItem('L1_MU20_TAU12IM_FTK').setLogic( MU20 & HA12IM & physcond).setTriggerType( TT.ftk)
-        else:
-           LVL1MenuItem('L1_MU21_TAU12IM_FTK').setLogic( (MU20 | MU21) & HA12IM & physcond).setTriggerType( TT.ftk)
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12_FTK').setLogic( HA20IM & HA12IM.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.ftk )
-        LVL1MenuItem('L1_DR-TAU20ITAU12I-J25_FTK').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond).setTriggerType(TT.ftk)
+        LVL1MenuItem('L1_TAU12IM_FTK').setLogic( HA12IM & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_FTK').setLogic( HA20IM & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_MU20_TAU12IM_FTK').setLogic( MU20 & HA12IM & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12_FTK').setLogic( HA20IM & HA12IM.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_DR-TAU20ITAU12I-J25_FTK').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond).setTriggerType(TT.ftk)    # noqa: F821
 
 
 
 
         # JET ctpid=[0x60:0x7f]
-        LVL1MenuItem('L1_J5'   ).setLogic( J5   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10'   ).setLogic( J10  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12'   ).setLogic( J12  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15'   ).setLogic( J15  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20'   ).setLogic( J20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25'   ).setLogic( J25  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30'   ).setLogic( J30  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J35'   ).setLogic( J35  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40'   ).setLogic( J40  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50'   ).setLogic( J50  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J60'   ).setLogic( J60  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75'   ).setLogic( J75  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75A'  ).setLogic( J75A & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75C'  ).setLogic( J75C & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J85'   ).setLogic( J85  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100'  ).setLogic( J100 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J120'  ).setLogic( J120 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J150'  ).setLogic( J150 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J175'  ).setLogic( J175 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J250'  ).setLogic( J250 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J400'  ).setLogic( J400 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J10.31ETA49').setLogic( J1031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J20.31ETA49').setLogic( J2031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J30.31ETA49').setLogic( J3031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J50.31ETA49').setLogic( J5031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75.31ETA49').setLogic( J7531ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J100.31ETA49').setLogic( J10031ETA49 & physcond).setTriggerType(TT.calo)
-
-
-        LVL1MenuItem('L1_J10_UNPAIRED_ISO'   ).setLogic( J10 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_UNPAIRED_NONISO').setLogic( J10 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_EMPTY').setLogic( J10 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_FIRSTEMPTY').setLogic( J10 & firstempty ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J12_UNPAIRED_ISO'   ).setLogic( J12 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_UNPAIRED_NONISO').setLogic( J12 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_EMPTY').setLogic( J12 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_FIRSTEMPTY').setLogic( J12 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_ABORTGAPNOTCALIB').setLogic( J12 & abortgap ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J50_UNPAIRED_ISO'   ).setLogic( J50 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50_UNPAIRED_NONISO').setLogic( J50 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50_ABORTGAPNOTCALIB').setLogic( J50 & abortgap ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J12_BGRP12').setLogic( J12 & bgrp12cond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.31ETA49_BGRP12').setLogic( J3031ETA49 & bgrp12cond ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J30_EMPTY').setLogic( J30 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_UNPAIRED').setLogic( J30 & unpairedRcond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_FIRSTEMPTY').setLogic( J30 & firstempty ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J10.31ETA49_EMPTY').setLogic( J1031ETA49 & cosmiccond ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J15.31ETA49_UNPAIRED_ISO' ).setLogic( J1531ETA49 & unpaired_isocond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J30.31ETA49_EMPTY').setLogic( J3031ETA49 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.31ETA49_FIRSTEMPTY').setLogic( J3031ETA49 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.31ETA49_UNPAIRED_ISO'   ).setLogic( J3031ETA49 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.31ETA49_UNPAIRED_NONISO'   ).setLogic( J3031ETA49 & unpaired_nonisocond   ).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J5'   ).setLogic( J5   & physcond).setTriggerType(TT.calo)     # noqa: F821
+        LVL1MenuItem('L1_J10'   ).setLogic( J10  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J12'   ).setLogic( J12  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J15'   ).setLogic( J15  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20'   ).setLogic( J20  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J25'   ).setLogic( J25  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30'   ).setLogic( J30  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J35'   ).setLogic( J35  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40'   ).setLogic( J40  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J50'   ).setLogic( J50  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J60'   ).setLogic( J60  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75'   ).setLogic( J75  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75A'  ).setLogic( J75A & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75C'  ).setLogic( J75C & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J85'   ).setLogic( J85  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J100'  ).setLogic( J100 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J120'  ).setLogic( J120 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J150'  ).setLogic( J150 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J175'  ).setLogic( J175 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J250'  ).setLogic( J250 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J400'  ).setLogic( J400 & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J10.31ETA49').setLogic( J1031ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        #LVL1MenuItem('L1_J20.31ETA49').setLogic( J2031ETA49 & physcond).setTriggerType(TT.calo)     # noqa: F821
+        #LVL1MenuItem('L1_J30.31ETA49').setLogic( J3031ETA49 & physcond).setTriggerType(TT.calo)     # noqa: F821
+        #LVL1MenuItem('L1_J50.31ETA49').setLogic( J5031ETA49 & physcond).setTriggerType(TT.calo)     # noqa: F821
+        LVL1MenuItem('L1_J75.31ETA49').setLogic( J7531ETA49 & physcond).setTriggerType(TT.calo)      # noqa: F821
+        #LVL1MenuItem('L1_J100.31ETA49').setLogic( J10031ETA49 & physcond).setTriggerType(TT.calo)   # noqa: F821
+
+
+        LVL1MenuItem('L1_J10_UNPAIRED_ISO'   ).setLogic( J10 & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_UNPAIRED_NONISO').setLogic( J10 & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_EMPTY').setLogic( J10 & cosmiccond ).setTriggerType(TT.calo)         # noqa: F821
+        LVL1MenuItem('L1_J10_FIRSTEMPTY').setLogic( J10 & firstempty ).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J12_UNPAIRED_ISO'   ).setLogic( J12 & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J12_UNPAIRED_NONISO').setLogic( J12 & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J12_EMPTY').setLogic( J12 & cosmiccond ).setTriggerType(TT.calo)             # noqa: F821
+        LVL1MenuItem('L1_J12_FIRSTEMPTY').setLogic( J12 & firstempty ).setTriggerType(TT.calo)        # noqa: F821
+        LVL1MenuItem('L1_J12_ABORTGAPNOTCALIB').setLogic( J12 & abortgap ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J12_UNPAIREDB1').setLogic( J12 & bgrp13cond  ).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J50_UNPAIRED_ISO'   ).setLogic( J50 & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J50_UNPAIRED_NONISO').setLogic( J50 & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J50_ABORTGAPNOTCALIB').setLogic( J50 & abortgap ).setTriggerType(TT.calo)             # noqa: F821
+
+        LVL1MenuItem('L1_J12_BGRP12').setLogic( J12 & bgrp12cond ).setTriggerType(TT.calo)                   # noqa: F821
+        LVL1MenuItem('L1_J30.31ETA49_BGRP12').setLogic( J3031ETA49 & bgrp12cond ).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J30_EMPTY').setLogic( J30 & cosmiccond ).setTriggerType(TT.calo)          # noqa: F821
+        LVL1MenuItem('L1_J30_UNPAIRED').setLogic( J30 & unpairedRcond ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_FIRSTEMPTY').setLogic( J30 & firstempty ).setTriggerType(TT.calo)     # noqa: F821
+
+        LVL1MenuItem('L1_J10.31ETA49_EMPTY').setLogic( J1031ETA49 & cosmiccond ).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J15.31ETA49_UNPAIRED_ISO' ).setLogic( J1531ETA49 & unpaired_isocond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J30.31ETA49_EMPTY').setLogic( J3031ETA49 & cosmiccond ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.31ETA49_FIRSTEMPTY').setLogic( J3031ETA49 & firstempty ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.31ETA49_UNPAIRED_ISO'   ).setLogic( J3031ETA49 & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.31ETA49_UNPAIRED_NONISO'   ).setLogic( J3031ETA49 & unpaired_nonisocond   ).setTriggerType(TT.calo)    # noqa: F821
 
         
-        LVL1MenuItem('L1_J100_FIRSTEMPTY').setLogic( J100 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100.31ETA49_FIRSTEMPTY' ).setLogic( J10031ETA49 & firstempty ).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J100_FIRSTEMPTY').setLogic( J100 & firstempty ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J100.31ETA49_FIRSTEMPTY' ).setLogic( J10031ETA49 & firstempty ).setTriggerType(TT.calo)    # noqa: F821
 
         # multi jet
-        LVL1MenuItem('L1_2J25.31ETA49'  ).setLogic( J2531ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15'   ).setLogic( J15.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15_J15.31ETA49' ).setLogic( J15 & J1531ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20_J20.31ETA49' ).setLogic( J20 & J2031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J10'   ).setLogic( J10.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J15'   ).setLogic( J15.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J20'   ).setLogic( J20.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J40'   ).setLogic( J40.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J50'   ).setLogic( J50.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J75'   ).setLogic( J75.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J10'   ).setLogic( J10.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J15'   ).setLogic( J15.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J20'   ).setLogic( J20.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J20.0ETA49').setLogic( J200ETA49.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J30'   ).setLogic( J30.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_6J15'   ).setLogic( J15.x(6)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_3J20' ).setLogic( J75 & J20.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J85_3J30' ).setLogic( J85 & J30.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49_2J20.0ETA49' ).setLogic( J300ETA49 & J200ETA49.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15.0ETA25_2J15.31ETA49' ).setLogic( J150ETA25 & J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40.0ETA25_2J15.31ETA49' ).setLogic( J400ETA25 & J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40.0ETA25_2J25_J20.31ETA49' ).setLogic( J400ETA25 & J25.x(2) & J2031ETA49   & physcond).setTriggerType(TT.calo) 
-        LVL1MenuItem('L1_J40.0ETA25_2J30_J20.31ETA49' ).setLogic( J400ETA25 & J30.x(2) & J2031ETA49   & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_4J17.0ETA22' ).setLogic( J170ETA22.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J25.0ETA23' ).setLogic( J250ETA23.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J35.0ETA23' ).setLogic( J350ETA23.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J15.0ETA25' ).setLogic( J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J15.0ETA25' ).setLogic( J150ETA25.x(4) & physcond).setTriggerType(TT.calo) 
-        LVL1MenuItem('L1_5J15.0ETA25' ).setLogic( J150ETA25.x(5) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2J25.31ETA49'  ).setLogic( J2531ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J15'   ).setLogic( J15.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J15_J15.31ETA49' ).setLogic( J15 & J1531ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20_J20.31ETA49' ).setLogic( J20 & J2031ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J10'   ).setLogic( J10.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J15'   ).setLogic( J15.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J20'   ).setLogic( J20.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J40'   ).setLogic( J40.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J50'   ).setLogic( J50.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J75'   ).setLogic( J75.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J10'   ).setLogic( J10.x(4)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J15'   ).setLogic( J15.x(4)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J20'   ).setLogic( J20.x(4)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J20.0ETA49').setLogic( J200ETA49.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J30'   ).setLogic( J30.x(4)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_6J15'   ).setLogic( J15.x(6)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75_3J20' ).setLogic( J75 & J20.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J85_3J30' ).setLogic( J85 & J30.x(3)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.0ETA49_2J20.0ETA49' ).setLogic( J300ETA49 & J200ETA49.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J15.0ETA25_2J15.31ETA49' ).setLogic( J150ETA25 & J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40.0ETA25_2J15.31ETA49' ).setLogic( J400ETA25 & J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40.0ETA25_2J25_J20.31ETA49' ).setLogic( J400ETA25 & J25.x(2) & J2031ETA49   & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40.0ETA25_2J30_J20.31ETA49' ).setLogic( J400ETA25 & J30.x(2) & J2031ETA49   & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_4J17.0ETA22' ).setLogic( J170ETA22.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J25.0ETA23' ).setLogic( J250ETA23.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J35.0ETA23' ).setLogic( J350ETA23.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J15.0ETA25' ).setLogic( J150ETA25.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J15.0ETA25' ).setLogic( J150ETA25.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_5J15.0ETA25' ).setLogic( J150ETA25.x(5) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         #FTK items
-        LVL1MenuItem('L1_4J15_FTK'   ).setLogic( J15.x(4)    & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_4J15.0ETA25_FTK' ).setLogic( J150ETA25.x(4) & physcond).setTriggerType(TT.ftk) 
-        LVL1MenuItem('L1_J100_FTK'  ).setLogic( J100 & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_J15_FTK'   ).setLogic( J15  & physcond).setTriggerType(TT.ftk)
-        LVL1MenuItem('L1_J40_FTK'   ).setLogic( J40  & physcond).setTriggerType(TT.ftk)
+        LVL1MenuItem('L1_4J20_FTK'   ).setLogic( J20.x(4)    & physcond).setTriggerType(TT.ftk)         # noqa: F821
+        LVL1MenuItem('L1_4J15.0ETA25_FTK' ).setLogic( J150ETA25.x(4) & physcond).setTriggerType(TT.ftk) # noqa: F821
+        LVL1MenuItem('L1_J100_FTK'  ).setLogic( J100 & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_J15_FTK'   ).setLogic( J15  & physcond).setTriggerType(TT.ftk)    # noqa: F821
+        LVL1MenuItem('L1_J40_FTK'   ).setLogic( J40  & physcond).setTriggerType(TT.ftk)    # noqa: F821
 
-#        LVL1MenuItem('L1_ZB_J20').setLogic(ZB_EM15 & J20 & physcond).setTriggerType(TT.zerobs)
+#        LVL1MenuItem('L1_ZB_J20').setLogic(ZB_EM15 & J20 & physcond).setTriggerType(TT.zerobs)    # noqa: F821
         if (('Physics_HI_v3' in TriggerFlags.triggerMenuSetup()) or ('MC_HI_v3' in TriggerFlags.triggerMenuSetup()) or ('Physics_HI_v4' in TriggerFlags.triggerMenuSetup()) or ('MC_HI_v4' in TriggerFlags.triggerMenuSetup())):
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_J75 & physcond).setTriggerType(TT.zerobs)
+            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_J75 & physcond).setTriggerType(TT.zerobs) # noqa: F821
         else:
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM15 & physcond).setTriggerType(TT.zerobs)
+            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM15 & physcond).setTriggerType(TT.zerobs)# noqa: F821
 
 
         # combined jet - xe
         #LVL1MenuItem('L1_J40_XE50').setLogic( J75 & XE40 & physcond).setTriggerType(TT.calo)#CB ERROR???
-        LVL1MenuItem('L1_J40_XE50').setLogic( J40 & XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40.0ETA25_XE50').setLogic( J400ETA25 & XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_XE40').setLogic( J75 & XE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_XE50').setLogic( J75 & XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_XE55').setLogic( J15.x(2) & XE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J40_XE45').setLogic( J40.x(2) & XE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J50_XE40').setLogic( J50.x(2) & XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40_XE60').setLogic( J40 & XE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49_XE50').setLogic( J300ETA49 & XE50 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_3J15.0ETA25_XE40').setLogic( J150ETA25.x(3) & XE40 & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J40_XE50').setLogic( J40 & XE50 & physcond).setTriggerType(TT.calo)                 # noqa: F821
+        LVL1MenuItem('L1_J40.0ETA25_XE50').setLogic( J400ETA25 & XE50 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75_XE40').setLogic( J75 & XE40 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75_XE50').setLogic( J75 & XE50 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J15_XE55').setLogic( J15.x(2) & XE55 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J40_XE45').setLogic( J40.x(2) & XE45 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J50_XE40').setLogic( J50.x(2) & XE50 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40_XE60').setLogic( J40 & XE60 & physcond).setTriggerType(TT.calo)          # noqa: F821
+        LVL1MenuItem('L1_J30.0ETA49_XE50').setLogic( J300ETA49 & XE50 & physcond).setTriggerType(TT.calo)          # noqa: F821
+
+        LVL1MenuItem('L1_3J15.0ETA25_XE40').setLogic( J150ETA25.x(3) & XE40 & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         # combined em - jet
-        LVL1MenuItem('L1_EM15VH_JJ15.23ETA49' ).setLogic( EM15VH  & JJ1523ETA49  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_EM15VH_JJ15.23ETA49' ).setLogic( EM15VH  & JJ1523ETA49  & physcond).setTriggerType(TT.calo)    # noqa: F821
         if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-            LVL1MenuItem('L1_EM18VHI_3J20' ).setLogic( EM18VHI  & J20.x(3)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_EM20VH_3J20' ).setLogic( EM20VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)
+            LVL1MenuItem('L1_EM18VHI_3J20' ).setLogic( EM18VHI  & J20.x(3)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_EM20VH_3J20' ).setLogic( EM20VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)      # noqa: F821
         else:
-            LVL1MenuItem('L1_EM13VH_3J20' ).setLogic( EM13VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)
+            LVL1MenuItem('L1_EM13VH_3J20' ).setLogic( EM13VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)      # noqa: F821
             ### ATR-15524
-            LVL1MenuItem('L1_EM18VH_3J20' ).setLogic( EM18VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)
+            LVL1MenuItem('L1_EM18VH_3J20' ).setLogic( EM18VH  & J20.x(3)  & physcond).setTriggerType(TT.calo)      # noqa: F821
 
         # combined mu - jet
-        LVL1MenuItem('L1_MU4_J12'   ).setLogic( MU4 & J12    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J20'   ).setLogic( MU6 & J20    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J30.0ETA49_2J20.0ETA49').setLogic( MU6 & J300ETA49 & J200ETA49.x(2) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J40'   ).setLogic( MU6 & J40    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J75'   ).setLogic( MU6 & J75    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_3J15'  ).setLogic( MU4 & J15.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_3J20'  ).setLogic( MU4 & J20.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J30'   ).setLogic( MU4 & J30    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J50'   ).setLogic( MU4 & J50    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_3J20'  ).setLogic( MU10 & J20.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_2J20'  ).setLogic( MU10 & J20.x(2)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_2J15_J20'  ).setLogic( MU10 & J15.x(2) & J20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J50_XE40'   ).setLogic( MU4 & J50 & XE40  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2MU4_J40_XE20'  ).setLogic( MU4.x(2) & J40 & XE20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU20_J40'  ).setLogic( MU20 & J40 & physcond).setTriggerType(TT.calo) ## ATR-14377
-        LVL1MenuItem('L1_MU20_XE30' ).setLogic( MU20 & XE30 & physcond) ## ATR-14377
+        LVL1MenuItem('L1_MU4_J12'   ).setLogic( MU4 & J12    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU6_J20'   ).setLogic( MU6 & J20    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU6_J30.0ETA49_2J20.0ETA49').setLogic( MU6 & J300ETA49 & J200ETA49.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU6_J40'   ).setLogic( MU6 & J40    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU6_J75'   ).setLogic( MU6 & J75    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU4_3J15'  ).setLogic( MU4 & J15.x(3)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU4_3J20'  ).setLogic( MU4 & J20.x(3)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J30'   ).setLogic( MU4 & J30    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU4_J50'   ).setLogic( MU4 & J50    & physcond).setTriggerType(TT.calo)       # noqa: F821
+        LVL1MenuItem('L1_MU10_3J20'  ).setLogic( MU10 & J20.x(3)  & physcond).setTriggerType(TT.calo)  # noqa: F821
+        LVL1MenuItem('L1_MU10_2J20'  ).setLogic( MU10 & J20.x(2)  & physcond).setTriggerType(TT.calo)  # noqa: F821
+        LVL1MenuItem('L1_MU10_2J15_J20'  ).setLogic( MU10 & J15.x(2) & J20  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J50_XE40'   ).setLogic( MU4 & J50 & XE40  & physcond).setTriggerType(TT.calo)         # noqa: F821
+        LVL1MenuItem('L1_2MU4_J40_XE20'  ).setLogic( MU4.x(2) & J40 & XE20  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU20_J40'  ).setLogic( MU20 & J40 & physcond).setTriggerType(TT.calo) ## ATR-14377 # noqa: F821
+        LVL1MenuItem('L1_MU20_XE30' ).setLogic( MU20 & XE30 & physcond) ## ATR-14377                        # noqa: F821
         # HI
-        LVL1MenuItem('L1_J15_NZ' ).setLogic( J15      & Not(ZDC_AND) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_NZ').setLogic( J15.x(2) & Not(ZDC_AND) & physcond).setTriggerType(TT.calo)   
+        LVL1MenuItem('L1_J15_NZ' ).setLogic( J15      & Not(ZDC_AND) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J15_NZ').setLogic( J15.x(2) & Not(ZDC_AND) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
-        LVL1MenuItem('L1_J15_NL' ).setLogic( J15      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_NL').setLogic( J15.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J15_NL' ).setLogic( J15      & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J15_NL').setLogic( J15.x(2) & Not(LUCID_A) & Not(LUCID_C) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         # XE
-        LVL1MenuItem('L1_XE35').setLogic( XE35 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40').setLogic( XE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE45').setLogic( XE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50').setLogic( XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE55').setLogic( XE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE60').setLogic( XE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE70').setLogic( XE70 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE80').setLogic( XE80 & physcond).setTriggerType(TT.calo)
-
-
-        LVL1MenuItem('L1_XE10').setLogic( XE10 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE20').setLogic( XE20 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE25').setLogic( XE25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE30').setLogic( XE30 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE65').setLogic( XE65 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE75').setLogic( XE75 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE150').setLogic( XE150 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE300').setLogic( XE300 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE35_BGRP7').setLogic( XE35 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40_BGRP7').setLogic( XE40 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE45_BGRP7').setLogic( XE45 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50_BGRP7').setLogic( XE50 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE55_BGRP7').setLogic( XE55 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE60_BGRP7').setLogic( XE60 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE70_BGRP7').setLogic( XE70 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE80_BGRP7').setLogic( XE80 & bgrp7cond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XE35').setLogic( XE35 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE40').setLogic( XE40 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE45').setLogic( XE45 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE50').setLogic( XE50 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE55').setLogic( XE55 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE60').setLogic( XE60 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE70').setLogic( XE70 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE80').setLogic( XE80 & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+
+        LVL1MenuItem('L1_XE10').setLogic( XE10 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE20').setLogic( XE20 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE25').setLogic( XE25 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE30').setLogic( XE30 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE65').setLogic( XE65 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE75').setLogic( XE75 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE150').setLogic( XE150 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE300').setLogic( XE300 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE35_BGRP7').setLogic( XE35 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE40_BGRP7').setLogic( XE40 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE45_BGRP7').setLogic( XE45 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE50_BGRP7').setLogic( XE50 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE55_BGRP7').setLogic( XE55 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE60_BGRP7').setLogic( XE60 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE70_BGRP7').setLogic( XE70 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE80_BGRP7').setLogic( XE80 & bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
         # XS
-        LVL1MenuItem('L1_XS20').setLogic( XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS30').setLogic( XS30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS40').setLogic( XS40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS45').setLogic( XS45.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS50').setLogic( XS50.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS55').setLogic( XS55.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS60').setLogic( XS60.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS65').setLogic( XS65.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM10_XS20').setLogic( EM10 & XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM12_XS20').setLogic( EM12 & XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM15_XS30').setLogic( EM15 & XS30.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XS20').setLogic( XS20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS30').setLogic( XS30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS40').setLogic( XS40.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS45').setLogic( XS45.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS50').setLogic( XS50.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS55').setLogic( XS55.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS60').setLogic( XS60.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS65').setLogic( XS65.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_EM10_XS20').setLogic( EM10 & XS20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_EM12_XS20').setLogic( EM12 & XS20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_EM15_XS30').setLogic( EM15 & XS30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         # TE
-        LVL1MenuItem('L1_TE0' ).setLogic( TE0  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3' ).setLogic( TE3  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5' ).setLogic( TE5  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10').setLogic( TE10 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE15').setLogic( TE15 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE20').setLogic( TE20 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE25').setLogic( TE25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE30').setLogic( TE30 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE40').setLogic( TE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE45').setLogic( TE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE50').setLogic( TE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE55').setLogic( TE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE60').setLogic( TE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE65').setLogic( TE65 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE70').setLogic( TE70 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE90').setLogic( TE90 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE100').setLogic( TE100 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE120').setLogic( TE120 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE140').setLogic( TE140 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE160').setLogic( TE160 & physcond).setTriggerType(TT.calo)        
-        LVL1MenuItem('L1_TE200').setLogic( TE200 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE280').setLogic( TE280 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE300').setLogic( TE300 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE360').setLogic( TE360 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE2000').setLogic( TE2000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE4000').setLogic( TE4000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10000').setLogic( TE10000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE12000').setLogic( TE12000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE14000').setLogic( TE14000 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_TE0.0ETA24').setLogic( TE00ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3.0ETA24').setLogic( TE30ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5.0ETA24').setLogic( TE50ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10.0ETA24').setLogic( TE100ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE15.0ETA24').setLogic( TE150ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE20.0ETA24').setLogic( TE200ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE25.0ETA24').setLogic( TE250ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE30.0ETA24').setLogic( TE300ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE35.0ETA24').setLogic( TE350ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE40.0ETA24').setLogic( TE400ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE45.0ETA24').setLogic( TE450ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE50.0ETA24').setLogic( TE500ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE55.0ETA24').setLogic( TE550ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE60.0ETA24').setLogic( TE600ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE65.0ETA24').setLogic( TE650ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE70.0ETA24').setLogic( TE700ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE80.0ETA24').setLogic( TE800ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE110.0ETA24').setLogic( TE1100ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE150.0ETA24').setLogic( TE1500ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE180.0ETA24').setLogic( TE1800ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE2000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE6500.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE8000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE9000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TE0' ).setLogic( TE0  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE2' ).setLogic( TE2  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE3' ).setLogic( TE3  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE4' ).setLogic( TE4  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE5' ).setLogic( TE5  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE10').setLogic( TE10 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE15').setLogic( TE15 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE20').setLogic( TE20 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE25').setLogic( TE25 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE30').setLogic( TE30 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE40').setLogic( TE40 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE45').setLogic( TE45 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE50').setLogic( TE50 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE55').setLogic( TE55 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE60').setLogic( TE60 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE65').setLogic( TE65 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE70').setLogic( TE70 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE90').setLogic( TE90 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE100').setLogic( TE100 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE120').setLogic( TE120 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE140').setLogic( TE140 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE160').setLogic( TE160 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE200').setLogic( TE200 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE280').setLogic( TE280 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE300').setLogic( TE300 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE360').setLogic( TE360 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE2000').setLogic( TE2000 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE4000').setLogic( TE4000 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE10000').setLogic( TE10000 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE12000').setLogic( TE12000 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE14000').setLogic( TE14000 & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_TE0.0ETA24').setLogic( TE00ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE3.0ETA24').setLogic( TE30ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE5.0ETA24').setLogic( TE50ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE10.0ETA24').setLogic( TE100ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE15.0ETA24').setLogic( TE150ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE20.0ETA24').setLogic( TE200ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE25.0ETA24').setLogic( TE250ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE30.0ETA24').setLogic( TE300ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE35.0ETA24').setLogic( TE350ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE40.0ETA24').setLogic( TE400ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE45.0ETA24').setLogic( TE450ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE50.0ETA24').setLogic( TE500ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE55.0ETA24').setLogic( TE550ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE60.0ETA24').setLogic( TE600ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE65.0ETA24').setLogic( TE650ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE70.0ETA24').setLogic( TE700ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE80.0ETA24').setLogic( TE800ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE110.0ETA24').setLogic( TE1100ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE150.0ETA24').setLogic( TE1500ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE180.0ETA24').setLogic( TE1800ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE2000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE5000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE6500.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE8000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE9000.0ETA24').setLogic( TE20000ETA24 & physcond).setTriggerType(TT.calo)    # noqa: F821
 
   # HI items
-        LVL1MenuItem('L1_TE500.0ETA49').setLogic( TE5000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE1500.0ETA49').setLogic( TE15000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3000.0ETA49').setLogic( TE30000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3500.0ETA49').setLogic( TE35000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5000.0ETA49').setLogic( TE50000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE6500.0ETA49').setLogic( TE65000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE8000.0ETA49').setLogic( TE80000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE9000.0ETA49').setLogic( TE90000ETA49 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_TE500.0ETA49_OVERLAY').setLogic( TE5000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE1500.0ETA49_OVERLAY').setLogic( TE15000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE3000.0ETA49_OVERLAY').setLogic( TE30000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE3500.0ETA49_OVERLAY').setLogic( TE35000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE5000.0ETA49_OVERLAY').setLogic( TE50000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE6500.0ETA49_OVERLAY').setLogic( TE65000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE8000.0ETA49_OVERLAY').setLogic( TE80000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE9000.0ETA49_OVERLAY').setLogic( TE90000ETA49 & physcond).setTriggerType(TT.zerobs)
-
-        LVL1MenuItem('L1_TE5_NZ').setLogic( TE5 & Not(ZDC_AND) & physcond).setTriggerType(TT.calo) 
+        LVL1MenuItem('L1_TE500.0ETA49').setLogic( TE5000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE1500.0ETA49').setLogic( TE15000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE3000.0ETA49').setLogic( TE30000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE3500.0ETA49').setLogic( TE35000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE5000.0ETA49').setLogic( TE50000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE6500.0ETA49').setLogic( TE65000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE8000.0ETA49').setLogic( TE80000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE9000.0ETA49').setLogic( TE90000ETA49 & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_TE500.0ETA49_OVERLAY').setLogic( TE5000ETA49 & physcond).setTriggerType(TT.zerobs)   # noqa: F821
+        LVL1MenuItem('L1_TE1500.0ETA49_OVERLAY').setLogic( TE15000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE3000.0ETA49_OVERLAY').setLogic( TE30000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE3500.0ETA49_OVERLAY').setLogic( TE35000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE5000.0ETA49_OVERLAY').setLogic( TE50000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE6500.0ETA49_OVERLAY').setLogic( TE65000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE8000.0ETA49_OVERLAY').setLogic( TE80000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_TE9000.0ETA49_OVERLAY').setLogic( TE90000ETA49 & physcond).setTriggerType(TT.zerobs) # noqa: F821
+        
+        LVL1MenuItem('L1_VTE2' ).setLogic( Not(TE2)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_VTE3' ).setLogic( Not(TE3)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_VTE4' ).setLogic( Not(TE4)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_VTE5' ).setLogic( Not(TE5)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_VTE10').setLogic( Not(TE10) & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_TE5_NZ').setLogic( TE5 & Not(ZDC_AND) & physcond).setTriggerType(TT.calo) # noqa: F821
         
         # MBTS
-        MBTS_1   = MBTS_A | MBTS_C
-        MBTS_2   = (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_A) & (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_C)
-        MBTS_1_1 = MBTS_A & MBTS_C
-        MBTS_2_2 = MBTS_A.x(2) & MBTS_C.x(2)
-        MBTS_2_A = MBTS_A.x(2)
-        MBTS_2_C = MBTS_C.x(2)
-        MBTS_3_3 = MBTS_A.x(3) & MBTS_C.x(3)
-        MBTS_4_4 = MBTS_A.x(4) & MBTS_C.x(4)
-        MBTS_4_A = MBTS_A.x(4)
-        MBTS_4_C = MBTS_C.x(4)
-
-
-        LVL1MenuItem('L1_MBTS_1'             ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_OVERLAY'     ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_MBTS_2'             ).setLogic( MBTS_2   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1'           ).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_OVERLAY'     ).setLogic( MBTS_1_1   & physcond ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_MBTS_2_2'           ).setLogic( MBTS_2_2 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_A'           ).setLogic( MBTS_2_A & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_C'           ).setLogic( MBTS_2_C & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3'           ).setLogic( MBTS_3_3 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4'           ).setLogic( MBTS_4_4 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A'           ).setLogic( MBTS_4_A & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C'           ).setLogic( MBTS_4_C & physcond ).setTriggerType(TT.minb)
-
-
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_ISO'  ).setLogic( MBTS_1   & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_ISO'  ).setLogic( MBTS_2   & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_UNPAIRED_ISO').setLogic( MBTS_1_1 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_UNPAIRED_ISO').setLogic( MBTS_2_2 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_UNPAIRED_ISO').setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4_UNPAIRED_ISO').setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_NONISO').setLogic( MBTS_1 & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_NONISO').setLogic( MBTS_2 & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A_UNPAIRED_ISO' ).setLogic( MBTS_4_A & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C_UNPAIRED_ISO' ).setLogic( MBTS_4_C & unpaired_isocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_EMPTY'       ).setLogic( MBTS_1   & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_EMPTY'       ).setLogic( MBTS_2   & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_EMPTY'     ).setLogic( MBTS_1_1 & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_EMPTY'     ).setLogic( MBTS_2_2 & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_EMPTY'     ).setLogic( MBTS_3_3 & cosmiccond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_1_VTE50'     ).setLogic( MBTS_1_1  & Not(TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_VTE50'     ).setLogic( MBTS_2_2  & Not(TE50) & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTSA0' ).setLogic( MBTS_A0 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA1' ).setLogic( MBTS_A1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA2' ).setLogic( MBTS_A2 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA3' ).setLogic( MBTS_A3 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA4' ).setLogic( MBTS_A4 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA5' ).setLogic( MBTS_A5 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA6' ).setLogic( MBTS_A6 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA7' ).setLogic( MBTS_A7 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA8' ).setLogic( MBTS_A8 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA10').setLogic( MBTS_A10 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA12').setLogic( MBTS_A12 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA14').setLogic( MBTS_A14 & physcond).setTriggerType(TT.minb)
+        MBTS_1   = MBTS_A | MBTS_C                                                                 # noqa: F821
+        MBTS_2   = (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_A) & (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_C)     # noqa: F821
+        MBTS_1_1 = MBTS_A & MBTS_C                                                                 # noqa: F821
+        MBTS_2_2 = MBTS_A.x(2) & MBTS_C.x(2)                                                       # noqa: F821
+        MBTS_2_A = MBTS_A.x(2)                                                                     # noqa: F821
+        MBTS_2_C = MBTS_C.x(2)                                                                     # noqa: F821
+        MBTS_3_3 = MBTS_A.x(3) & MBTS_C.x(3)                                                       # noqa: F821
+        MBTS_4_4 = MBTS_A.x(4) & MBTS_C.x(4)                                                       # noqa: F821
+        MBTS_4_A = MBTS_A.x(4)                                                                     # noqa: F821
+        MBTS_4_C = MBTS_C.x(4)                                                                     # noqa: F821
+
+
+        LVL1MenuItem('L1_MBTS_1'             ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_OVERLAY'     ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.zerobs)  # noqa: F821
+        LVL1MenuItem('L1_MBTS_2'             ).setLogic( MBTS_2   & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1'           ).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_OVERLAY'     ).setLogic( MBTS_1_1   & physcond ).setTriggerType(TT.zerobs) # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2'           ).setLogic( MBTS_2_2 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_A'           ).setLogic( MBTS_2_A & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C'           ).setLogic( MBTS_2_C & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3'           ).setLogic( MBTS_3_3 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_4'           ).setLogic( MBTS_4_4 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_A'           ).setLogic( MBTS_4_A & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_C'           ).setLogic( MBTS_4_C & physcond ).setTriggerType(TT.minb)    # noqa: F821
+
+
+        LVL1MenuItem('L1_MBTS_1_UNPAIRED_ISO'  ).setLogic( MBTS_1   & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_UNPAIRED_ISO'  ).setLogic( MBTS_2   & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_UNPAIRED_ISO').setLogic( MBTS_1_1 & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2_UNPAIRED_ISO').setLogic( MBTS_2_2 & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3_UNPAIRED_ISO').setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_4_UNPAIRED_ISO').setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_UNPAIRED_NONISO').setLogic( MBTS_1 & unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_UNPAIRED_NONISO').setLogic( MBTS_2 & unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_A_UNPAIRED_ISO' ).setLogic( MBTS_4_A & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_C_UNPAIRED_ISO' ).setLogic( MBTS_4_C & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1_EMPTY'       ).setLogic( MBTS_1   & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_EMPTY'       ).setLogic( MBTS_2   & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_EMPTY'     ).setLogic( MBTS_1_1 & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2_EMPTY'     ).setLogic( MBTS_2_2 & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3_EMPTY'     ).setLogic( MBTS_3_3 & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1_1_VTE50'     ).setLogic( MBTS_1_1  & Not(TE50) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2_VTE50'     ).setLogic( MBTS_2_2  & Not(TE50) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        
+        LVL1MenuItem('L1_MBTS_1_VTE2'     ).setLogic( MBTS_1  & Not(TE2) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_VTE3'     ).setLogic( MBTS_1  & Not(TE3) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_VTE4'     ).setLogic( MBTS_1  & Not(TE4) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_VTE5'     ).setLogic( MBTS_1  & Not(TE5) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_VTE10'     ).setLogic( MBTS_1  & Not(TE10) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_VTE70'     ).setLogic( MBTS_1  & Not(TE70) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        
+        LVL1MenuItem('L1_MBTS_2_VTE2'     ).setLogic( MBTS_2  & Not(TE2) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_VTE3'     ).setLogic( MBTS_2  & Not(TE3) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_VTE4'     ).setLogic( MBTS_2  & Not(TE4) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_VTE5'     ).setLogic( MBTS_2  & Not(TE5) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_VTE10'     ).setLogic( MBTS_2  & Not(TE10) & physcond).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTSA0' ).setLogic( MBTS_A0 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA1' ).setLogic( MBTS_A1 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA2' ).setLogic( MBTS_A2 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA3' ).setLogic( MBTS_A3 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA4' ).setLogic( MBTS_A4 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA5' ).setLogic( MBTS_A5 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA6' ).setLogic( MBTS_A6 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA7' ).setLogic( MBTS_A7 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA8' ).setLogic( MBTS_A8 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA10').setLogic( MBTS_A10 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA12').setLogic( MBTS_A12 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA14').setLogic( MBTS_A14 & physcond).setTriggerType(TT.minb)    # noqa: F821
         # L1_MBTSA/C 9, 11, 13, 15 are removed in Run 2
 
-        LVL1MenuItem('L1_MBTSC0' ).setLogic( MBTS_C0 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC1' ).setLogic( MBTS_C1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC2' ).setLogic( MBTS_C2 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC3' ).setLogic( MBTS_C3 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC4' ).setLogic( MBTS_C4 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC5' ).setLogic( MBTS_C5 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC6' ).setLogic( MBTS_C6 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC7' ).setLogic( MBTS_C7 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC8' ).setLogic( MBTS_C8 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC10').setLogic( MBTS_C10 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC12').setLogic( MBTS_C12 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC14').setLogic( MBTS_C14 & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_MBTSC0' ).setLogic( MBTS_C0 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC1' ).setLogic( MBTS_C1 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC2' ).setLogic( MBTS_C2 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC3' ).setLogic( MBTS_C3 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC4' ).setLogic( MBTS_C4 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC5' ).setLogic( MBTS_C5 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC6' ).setLogic( MBTS_C6 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC7' ).setLogic( MBTS_C7 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC8' ).setLogic( MBTS_C8 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC10').setLogic( MBTS_C10 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC12').setLogic( MBTS_C12 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC14').setLogic( MBTS_C14 & physcond).setTriggerType(TT.minb)    # noqa: F821
         
-        LVL1MenuItem('L1_MBTS_1_BGRP9'    ).setLogic( MBTS_1 & bgrp9cond ).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBTS_1_1_BGRP9'  ).setLogic( MBTS_1_1 & bgrp9cond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_BGRP9'    ).setLogic( MBTS_2 & bgrp9cond ).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_MBTS_1_BGRP9'    ).setLogic( MBTS_1 & bgrp9cond ).setTriggerType(TT.minb)      # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_BGRP9'  ).setLogic( MBTS_1_1 & bgrp9cond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_BGRP9'    ).setLogic( MBTS_2 & bgrp9cond ).setTriggerType(TT.minb)      # noqa: F821
         
-        LVL1MenuItem('L1_MBTS_1_BGRP11'   ).setLogic( MBTS_1 & bgrp11cond ).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBTS_1_1_BGRP11' ).setLogic( MBTS_1_1 & bgrp11cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_BGRP11'   ).setLogic( MBTS_2 & bgrp11cond ).setTriggerType(TT.minb) 
+        LVL1MenuItem('L1_MBTS_1_BGRP11'   ).setLogic( MBTS_1 & bgrp11cond ).setTriggerType(TT.minb)     # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_BGRP11' ).setLogic( MBTS_1_1 & bgrp11cond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_BGRP11'   ).setLogic( MBTS_2 & bgrp11cond ).setTriggerType(TT.minb)     # noqa: F821
 
 
         # ZDC
-        ZDC_A_C = ZDC_A & ZDC_C
-        VZDC_A_C = Not(ZDC_A) & Not(ZDC_C)
-        LVL1MenuItem('L1_ZDC'               ).setLogic((ZDC_A | ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A'             ).setLogic( ZDC_A & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C'             ).setLogic( ZDC_C & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND'           ).setLogic( ZDC_AND & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_ZDC_A_C'           ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_A_C_OVERLAY'   ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_A_OVERLAY'   ).setLogic( ZDC_A & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_C_OVERLAY'   ).setLogic( ZDC_C & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_A_C_VTE50_OVERLAY'     ).setLogic( ZDC_A_C & Not(TE50) & physcond).setTriggerType(TT.zerobs)     
-        LVL1MenuItem('L1_TE5_OVERLAY'   ).setLogic( TE5 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE10_OVERLAY'   ).setLogic( TE10 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE20_OVERLAY'   ).setLogic( TE20 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE50_OVERLAY'   ).setLogic( TE50 & physcond).setTriggerType(TT.zerobs)
-
-        LVL1MenuItem('L1_ZDC_VTE200'        ).setLogic((ZDC_A | ZDC_C) & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_VTE50'     ).setLogic( ZDC_AND & Not(TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_VTE50'     ).setLogic( ZDC_A_C & Not(TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_TE50'      ).setLogic( ZDC_A_C & TE50 & physcond).setTriggerType(TT.minb)
+        ZDC_A_C = ZDC_A & ZDC_C                     # noqa: F821
+        VZDC_A_C = Not(ZDC_A) & Not(ZDC_C)          # noqa: F821
+        LVL1MenuItem('L1_ZDC'               ).setLogic((ZDC_A | ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A'             ).setLogic( ZDC_A & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C'             ).setLogic( ZDC_C & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_AND'           ).setLogic( ZDC_AND & physcond).setTriggerType(TT.minb)  # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C'           ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.minb)  # noqa: F821
+
+        LVL1MenuItem('L1_ZDC_A_C_OVERLAY'   ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_OVERLAY'   ).setLogic( ZDC_A & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_OVERLAY'   ).setLogic( ZDC_C & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_VTE50_OVERLAY'     ).setLogic( ZDC_A_C & Not(TE50) & physcond).setTriggerType(TT.zerobs)  # noqa: F821 
+        LVL1MenuItem('L1_TE5_OVERLAY'   ).setLogic( TE5 & physcond).setTriggerType(TT.zerobs)      # noqa: F821
+        LVL1MenuItem('L1_TE10_OVERLAY'   ).setLogic( TE10 & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_TE20_OVERLAY'   ).setLogic( TE20 & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_TE50_OVERLAY'   ).setLogic( TE50 & physcond).setTriggerType(TT.zerobs)    # noqa: F821
+
+        LVL1MenuItem('L1_ZDC_VTE200'        ).setLogic((ZDC_A | ZDC_C) & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_AND_VTE50'     ).setLogic( ZDC_AND & Not(TE50) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_VTE50'     ).setLogic( ZDC_A_C & Not(TE50) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_TE50'      ).setLogic( ZDC_A_C & TE50 & physcond).setTriggerType(TT.minb)    # noqa: F821
         
-        LVL1MenuItem('L1_ZDC_A_VTE20'      ).setLogic( ZDC_A & Not(TE20) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VTE20'      ).setLogic( ZDC_C & Not(TE20) & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_A_VTE20'      ).setLogic( ZDC_A & Not(TE20) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_VTE20'      ).setLogic( ZDC_C & Not(TE20) & physcond).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_A_C_VTE200'           ).setLogic( ZDC_A_C & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_TE5_VTE200'       ).setLogic( ZDC_A_C & TE5 & Not(TE200) & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_A_C_VTE200'           ).setLogic( ZDC_A_C & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_TE5_VTE200'       ).setLogic( ZDC_A_C & TE5 & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_MBTS_1'        ).setLogic((ZDC_A | ZDC_C) & MBTS_1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2'        ).setLogic((ZDC_A | ZDC_C) & MBTS_2 & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_MBTS_1'        ).setLogic((ZDC_A | ZDC_C) & MBTS_1 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_2'        ).setLogic((ZDC_A | ZDC_C) & MBTS_2 & physcond).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_MBTS_1_1'      ).setLogic((ZDC_A | ZDC_C) & MBTS_1_1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2_2'      ).setLogic((ZDC_A | ZDC_C) & MBTS_2_2 & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_MBTS_1_1'      ).setLogic((ZDC_A | ZDC_C) & MBTS_1_1 & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_2_2'      ).setLogic((ZDC_A | ZDC_C) & MBTS_2_2 & physcond).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_EMPTY'           ).setLogic( (ZDC_A | ZDC_C) & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_EMPTY'           ).setLogic( ZDC_A & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_EMPTY'           ).setLogic( ZDC_C & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_ISO'    ).setLogic( (ZDC_A | ZDC_C) & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_NONISO' ).setLogic( (ZDC_A | ZDC_C) & unpaired_nonisocond ).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_EMPTY'           ).setLogic( (ZDC_A | ZDC_C) & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_EMPTY'           ).setLogic( ZDC_A & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_EMPTY'           ).setLogic( ZDC_C & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_UNPAIRED_ISO'    ).setLogic( (ZDC_A | ZDC_C) & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_UNPAIRED_NONISO' ).setLogic( (ZDC_A | ZDC_C) & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_AND_EMPTY'           ).setLogic( ZDC_AND & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_ISO'    ).setLogic( ZDC_AND & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_NONISO' ).setLogic( ZDC_AND & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_UNPAIRED_NONISO' ).setLogic( ZDC_A & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_UNPAIRED_NONISO' ).setLogic( ZDC_C & unpaired_nonisocond ).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_AND_EMPTY'           ).setLogic( ZDC_AND & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_ISO'    ).setLogic( ZDC_AND & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_NONISO' ).setLogic( ZDC_AND & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_UNPAIRED_NONISO' ).setLogic( ZDC_A & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_UNPAIRED_NONISO' ).setLogic( ZDC_C & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_A_C_EMPTY'           ).setLogic( ZDC_A_C & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_ISO'    ).setLogic( ZDC_A_C & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_NONISO' ).setLogic( ZDC_A_C & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_UNPAIRED_ISO'    ).setLogic( ZDC_A & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_UNPAIRED_ISO'    ).setLogic( ZDC_C & unpaired_isocond ).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_A_C_EMPTY'           ).setLogic( ZDC_A_C & cosmiccond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_ISO'    ).setLogic( ZDC_A_C & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_NONISO' ).setLogic( ZDC_A_C & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_UNPAIRED_ISO'    ).setLogic( ZDC_A & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_UNPAIRED_ISO'    ).setLogic( ZDC_C & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_ZDC_A_C_BGRP9'      ).setLogic( ZDC_A_C & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_BGRP9'      ).setLogic( ZDC_A & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_BGRP9'      ).setLogic( ZDC_C & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_BGRP11'     ).setLogic( ZDC_A_C & bgrp11cond & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_A_C_BGRP9'      ).setLogic( ZDC_A_C & bgrp9cond & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_BGRP9'      ).setLogic( ZDC_A & bgrp9cond & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_BGRP9'      ).setLogic( ZDC_C & bgrp9cond & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_BGRP11'     ).setLogic( ZDC_A_C & bgrp11cond & physcond).setTriggerType(TT.minb)    # noqa: F821
 
   # ATR-12470
-        ZDC_XOR = (ZDC_A & Not(ZDC_C)) | (ZDC_C & Not(ZDC_A))        
-        LVL1MenuItem('L1_ZDC_A_VZDC_C'      ).setLogic(ZDC_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VZDC_A'      ).setLogic(ZDC_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_VZDC_C_VTE200'      ).setLogic(ZDC_A & Not(ZDC_C) & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VZDC_A_VTE200'      ).setLogic(ZDC_C & Not(ZDC_A) & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR'           ).setLogic(ZDC_XOR  & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_TE5_VTE200'           ).setLogic(ZDC_XOR  & TE5 & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_TRT_VTE200'           ).setLogic(ZDC_XOR  & NIMTRT & Not(TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_VTE200'               ).setLogic(ZDC_XOR  & Not(TE200) & physcond).setTriggerType(TT.minb)
+        ZDC_XOR = (ZDC_A & Not(ZDC_C)) | (ZDC_C & Not(ZDC_A))            # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_VZDC_C'      ).setLogic(ZDC_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_VZDC_A'      ).setLogic(ZDC_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_VZDC_C_VTE200'      ).setLogic(ZDC_A & Not(ZDC_C) & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_VZDC_A_VTE200'      ).setLogic(ZDC_C & Not(ZDC_A) & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_XOR'           ).setLogic(ZDC_XOR  & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_XOR_TE5_VTE200'           ).setLogic(ZDC_XOR  & TE5 & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_XOR_TRT_VTE200'           ).setLogic(ZDC_XOR  & NIMTRT & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_XOR_VTE200'               ).setLogic(ZDC_XOR  & Not(TE200) & physcond).setTriggerType(TT.minb)    # noqa: F821
 
         # ATR-14967
-        LVL1MenuItem('L1_EM3_VZDC_A'               ).setLogic( EM3 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM3_VZDC_C'               ).setLogic( EM3 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_2EM3_VZDC_A'               ).setLogic( EM3.x(2) & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_2EM3_VZDC_C'               ).setLogic( EM3.x(2) & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM5_VZDC_A'               ).setLogic( EM5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM5_VZDC_C'               ).setLogic( EM5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE5_VZDC_A'               ).setLogic( TE5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE5_VZDC_C'               ).setLogic( TE5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE10_VZDC_A'               ).setLogic( TE10 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE10_VZDC_C'               ).setLogic( TE10 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE20_VZDC_A'               ).setLogic( TE20 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE20_VZDC_C'               ).setLogic( TE20 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_VTE10_VZDC_A'               ).setLogic( Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_VTE10_VZDC_C'               ).setLogic( Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J5_VZDC_A'               ).setLogic( J5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J5_VZDC_C'               ).setLogic( J5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J10_VZDC_A'               ).setLogic( J10 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J10_VZDC_C'               ).setLogic( J10 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J15_VZDC_A'               ).setLogic( J15 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J15_VZDC_C'               ).setLogic( J15 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J20_VZDC_A'               ).setLogic( J20 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J20_VZDC_C'               ).setLogic( J20 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MU4_VZDC_A'               ).setLogic( MU4 & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VZDC_C'               ).setLogic( MU4 & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VZDC_A'               ).setLogic( MU4.x(2) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VZDC_C'               ).setLogic( MU4.x(2) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU4_VTE10_VZDC_A').setLogic( MU4      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VTE10_VZDC_C').setLogic( MU4      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10_VZDC_A').setLogic( MU4.x(2)      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10_VZDC_C').setLogic( MU4.x(2)      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU4_VZDC_A_C'               ).setLogic( MU4 & VZDC_A_C & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_A'               ).setLogic( MU6 & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_C'               ).setLogic( MU6 & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VTE10_VZDC_A').setLogic( MU6      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VTE10_VZDC_C').setLogic( MU6      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_A_C'               ).setLogic( MU6 & VZDC_A_C & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_RD0_FILLED_VZDC_A'               ).setLogic( RNDM0 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_RD0_FILLED_VZDC_C'               ).setLogic( RNDM0 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C_VZDC_A'               ).setLogic( MBTS_4_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A_VZDC_C'               ).setLogic( MBTS_4_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_C_VZDC_A'               ).setLogic( MBTS_2_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)	
-        LVL1MenuItem('L1_MBTS_2_A_VZDC_C'               ).setLogic( MBTS_2_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_EM3_VZDC_A'               ).setLogic( EM3 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_EM3_VZDC_C'               ).setLogic( EM3 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_2EM3_VZDC_A'               ).setLogic( EM3.x(2) & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_2EM3_VZDC_C'               ).setLogic( EM3.x(2) & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_EM5_VZDC_A'               ).setLogic( EM5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_EM5_VZDC_C'               ).setLogic( EM5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE5_VZDC_A'               ).setLogic( TE5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE5_VZDC_C'               ).setLogic( TE5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE10_VZDC_A'               ).setLogic( TE10 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE10_VZDC_C'               ).setLogic( TE10 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE20_VZDC_A'               ).setLogic( TE20 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_TE20_VZDC_C'               ).setLogic( TE20 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_VTE10_VZDC_A'               ).setLogic( Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_VTE10_VZDC_C'               ).setLogic( Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J5_VZDC_A'               ).setLogic( J5 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J5_VZDC_C'               ).setLogic( J5 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J10_VZDC_A'               ).setLogic( J10 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J10_VZDC_C'               ).setLogic( J10 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J15_VZDC_A'               ).setLogic( J15 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J15_VZDC_C'               ).setLogic( J15 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J20_VZDC_A'               ).setLogic( J20 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J20_VZDC_C'               ).setLogic( J20 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MU4_VZDC_A'               ).setLogic( MU4 & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_VZDC_C'               ).setLogic( MU4 & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_VZDC_A'               ).setLogic( MU4.x(2) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_VZDC_C'               ).setLogic( MU4.x(2) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_MU4_VTE10_VZDC_A').setLogic( MU4      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU4_VTE10_VZDC_C').setLogic( MU4      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_VTE10_VZDC_A').setLogic( MU4.x(2)      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_VTE10_VZDC_C').setLogic( MU4.x(2)      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+
+        LVL1MenuItem('L1_MU4_VZDC_A_C'               ).setLogic( MU4 & VZDC_A_C & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_VZDC_A'               ).setLogic( MU6 & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_VZDC_C'               ).setLogic( MU6 & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_VTE10_VZDC_A').setLogic( MU6      & Not(TE10) & Not(ZDC_A) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_VTE10_VZDC_C').setLogic( MU6      & Not(TE10) & Not(ZDC_C) & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_MU6_VZDC_A_C'               ).setLogic( MU6 & VZDC_A_C & physcond).setTriggerType(TT.muon)    # noqa: F821
+        LVL1MenuItem('L1_RD0_FILLED_VZDC_A'               ).setLogic( RNDM0 & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_RD0_FILLED_VZDC_C'               ).setLogic( RNDM0 & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_C_VZDC_A'               ).setLogic( MBTS_4_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_A_VZDC_C'               ).setLogic( MBTS_4_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C_VZDC_A'               ).setLogic( MBTS_2_C & Not(ZDC_A) & physcond).setTriggerType(TT.minb)	 # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_A_VZDC_C'               ).setLogic( MBTS_2_A & Not(ZDC_C) & physcond).setTriggerType(TT.minb)    # noqa: F821
 
 
 
 
         # VDM
-        LVL1MenuItem('L1_ZDC_A_C_BGRP7'     ).setLogic( ZDC_A_C & bgrp7cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_BGRP7'       ).setLogic( (LUCID_A | LUCID_C) & bgrp7cond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC_A_C_BGRP7'     ).setLogic( ZDC_A_C & bgrp7cond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_BGRP7'       ).setLogic( (LUCID_A | LUCID_C) & bgrp7cond).setTriggerType(TT.minb)    # noqa: F821
         
         # LUCID
-        #LVL1MenuItem('L1_LUCID_COMM'      ).setLogic( LUCID_COMM        & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A'           ).setLogic( LUCID_A             & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_C'           ).setLogic( LUCID_C             & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C',        ).setLogic( LUCID_A & LUCID_C   & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID'             ).setLogic((LUCID_A | LUCID_C)  & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM'        ).setLogic( LUCID_COMM          & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM_EMPTY'  ).setLogic( LUCID_COMM          & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_EMPTY'       ).setLogic((LUCID_A | LUCID_C)  & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_EMPTY'   ).setLogic( LUCID_A & LUCID_C   & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_UNPAIRED_ISO').setLogic((LUCID_A | LUCID_C)  & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM_UNPAIRED_ISO' ).setLogic( LUCID_COMM        & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_ISO'  ).setLogic( LUCID_A & LUCID_C & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_NONISO').setLogic(LUCID_A & LUCID_C & unpaired_nonisocond).setTriggerType(TT.minb)
-        
+        #LVL1MenuItem('L1_LUCID_COMM'      ).setLogic( LUCID_COMM        & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A'           ).setLogic( LUCID_A             & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_C'           ).setLogic( LUCID_C             & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C',        ).setLogic( LUCID_A & LUCID_C   & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID'             ).setLogic((LUCID_A | LUCID_C)  & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_COMM'        ).setLogic( LUCID_COMM          & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_COMM_EMPTY'  ).setLogic( LUCID_COMM          & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_EMPTY'       ).setLogic((LUCID_A | LUCID_C)  & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C_EMPTY'   ).setLogic( LUCID_A & LUCID_C   & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_UNPAIRED_ISO').setLogic((LUCID_A | LUCID_C)  & unpaired_isocond).setTriggerType(TT.minb)           # noqa: F821
+        LVL1MenuItem('L1_LUCID_COMM_UNPAIRED_ISO' ).setLogic( LUCID_COMM        & unpaired_isocond ).setTriggerType(TT.minb)      # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_ISO'  ).setLogic( LUCID_A & LUCID_C & unpaired_isocond).setTriggerType(TT.minb)       # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_NONISO').setLogic(LUCID_A & LUCID_C & unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_LUCID_BGRP9').setLogic( (LUCID_A | LUCID_C) & bgrp9cond).setTriggerType(TT.minb) # noqa: F821
+        LVL1MenuItem('L1_LUCID_BGRP11').setLogic( (LUCID_A | LUCID_C) & bgrp11cond).setTriggerType(TT.minb) # noqa: F821
+
         # BCM
-        LVL1MenuItem('L1_BCM_Wide'                   ).setLogic( BCM_Wide & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_BGRP0'             ).setLogic( BCM_Wide & BGRP0 ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_EMPTY'             ).setLogic( BCM_Wide & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_ISO'      ).setLogic( BCM_Wide & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_NONISO'   ).setLogic( BCM_Wide & unpaired_nonisocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_BCM_HT_BGRP0'               ).setLogic( BCM_Comb.x(7) & BGRP0).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_AC_CA_BGRP0'            ).setLogic((BCM_AtoC|BCM_CtoA) & BGRP0).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_ISO'     ).setLogic((BCM_AtoC|BCM_CtoA)&unpaired_isocond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_BCM_AC_UNPAIRED_ISO'     ).setLogic( BCM_AtoC & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_UNPAIRED_ISO'     ).setLogic( BCM_CtoA & unpaired_isocond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_BCM_Wide'                   ).setLogic( BCM_Wide & physcond ).setTriggerType(TT.minb)               # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_BGRP0'             ).setLogic( BCM_Wide & BGRP0 ).setTriggerType(TT.minb)                  # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_EMPTY'             ).setLogic( BCM_Wide & cosmiccond ).setTriggerType(TT.minb)             # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_ISO'      ).setLogic( BCM_Wide & unpaired_isocond ).setTriggerType(TT.minb)       # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_NONISO'   ).setLogic( BCM_Wide & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_BCM_HT_BGRP0'               ).setLogic( BCM_Comb.x(7) & BGRP0).setTriggerType(TT.minb)                  # noqa: F821
+        LVL1MenuItem('L1_BCM_AC_CA_BGRP0'            ).setLogic((BCM_AtoC|BCM_CtoA) & BGRP0).setTriggerType(TT.minb)             # noqa: F821
+        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_ISO'     ).setLogic((BCM_AtoC|BCM_CtoA)&unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_BCM_AC_UNPAIRED_ISO'     ).setLogic( BCM_AtoC & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_CA_UNPAIRED_ISO'     ).setLogic( BCM_CtoA & unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
         
-        LVL1MenuItem('L1_BCM_AC_UNPAIRED_NONISO'     ).setLogic( BCM_AtoC & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_UNPAIRED_NONISO'     ).setLogic( BCM_CtoA & unpaired_nonisocond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_BCM_AC_UNPAIRED_NONISO'     ).setLogic( BCM_AtoC & unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_CA_UNPAIRED_NONISO'     ).setLogic( BCM_CtoA & unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
         
-        LVL1MenuItem('L1_BCM_AC_ABORTGAPNOTCALIB'     ).setLogic( BCM_AtoC & abortgap).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_ABORTGAPNOTCALIB'     ).setLogic( BCM_CtoA & abortgap).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_ABORTGAPNOTCALIB'   ).setLogic( BCM_Wide & abortgap).setTriggerType(TT.minb)        
+        LVL1MenuItem('L1_BCM_AC_ABORTGAPNOTCALIB'     ).setLogic( BCM_AtoC & abortgap).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_CA_ABORTGAPNOTCALIB'     ).setLogic( BCM_CtoA & abortgap).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_ABORTGAPNOTCALIB'   ).setLogic( BCM_Wide & abortgap).setTriggerType(TT.minb)    # noqa: F821
 
-        LVL1MenuItem('L1_BCM_AC_CALIB'     ).setLogic( BCM_AtoC & calibcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_CALIB'     ).setLogic( BCM_CtoA & calibcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_CALIB'   ).setLogic( BCM_Wide & calibcond).setTriggerType(TT.minb)        
+        LVL1MenuItem('L1_BCM_AC_CALIB'     ).setLogic( BCM_AtoC & calibcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_CA_CALIB'     ).setLogic( BCM_CtoA & calibcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_CALIB'   ).setLogic( BCM_Wide & calibcond).setTriggerType(TT.minb)    # noqa: F821        
+
+        LVL1MenuItem('L1_BCM_AC_UNPAIREDB1'  ).setLogic( BCM_AtoC & bgrp13cond).setTriggerType(TT.minb)    # noqa: F821
 
 
 
         # RANDOM
-        LVL1MenuItem('L1_RD0_FILLED'         ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_FILLED_OVERLAY' ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_RD0_EMPTY'          ).setLogic( RNDM0 & cosmiccond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_UNPAIRED_ISO'   ).setLogic( RNDM0 & unpaired_isocond   ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_FIRSTEMPTY'     ).setLogic( RNDM0 & firstempty         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_BGRP9'          ).setLogic( RNDM0 & bgrp9cond          ).setTriggerType(TT.rand) 
-        LVL1MenuItem('L1_RD0_BGRP11'         ).setLogic( RNDM0 & bgrp11cond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_ABORTGAPNOTCALIB').setLogic( RNDM0 & abortgap          ).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_RD0_FILLED'         ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_FILLED_OVERLAY' ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.zerobs)  # noqa: F821
+        LVL1MenuItem('L1_RD0_EMPTY'          ).setLogic( RNDM0 & cosmiccond         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_UNPAIRED_ISO'   ).setLogic( RNDM0 & unpaired_isocond   ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_FIRSTEMPTY'     ).setLogic( RNDM0 & firstempty         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_BGRP9'          ).setLogic( RNDM0 & bgrp9cond          ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_BGRP10'         ).setLogic( RNDM0 & alfacalib          ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_BGRP11'         ).setLogic( RNDM0 & bgrp11cond         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_ABORTGAPNOTCALIB').setLogic( RNDM0 & abortgap          ).setTriggerType(TT.rand)    # noqa: F821
 
         
 
-        LVL1MenuItem('L1_RD1_FILLED'         ).setLogic( RNDM1 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD1_EMPTY'          ).setLogic( RNDM1 & cosmiccond         ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_RD1_BGRP10'         ).setLogic( RNDM1 & alfacalib          ).setTriggerType(TT.zerobs)
+        LVL1MenuItem('L1_RD1_FILLED'         ).setLogic( RNDM1 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD1_EMPTY'          ).setLogic( RNDM1 & cosmiccond         ).setTriggerType(TT.zerobs)  # noqa: F821
+        LVL1MenuItem('L1_RD1_BGRP10'         ).setLogic( RNDM1 & alfacalib          ).setTriggerType(TT.zerobs)  # noqa: F821
 
-        LVL1MenuItem('L1_RD2_FILLED'         ).setLogic( RNDM2 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_EMPTY'          ).setLogic( RNDM2 & cosmiccond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_BGRP11'         ).setLogic( RNDM2 & bgrp11cond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_BGRP12'         ).setLogic( RNDM2 & bgrp12cond         ).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_RD2_FILLED'         ).setLogic( RNDM2 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD2_EMPTY'          ).setLogic( RNDM2 & cosmiccond         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD2_BGRP11'         ).setLogic( RNDM2 & bgrp11cond         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD2_BGRP12'         ).setLogic( RNDM2 & bgrp12cond         ).setTriggerType(TT.rand)    # noqa: F821
 
-        LVL1MenuItem('L1_RD3_FILLED'         ).setLogic( RNDM3 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD3_EMPTY'          ).setLogic( RNDM3 & cosmiccond         ).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_RD3_FILLED'         ).setLogic( RNDM3 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD3_EMPTY'          ).setLogic( RNDM3 & cosmiccond         ).setTriggerType(TT.rand)    # noqa: F821
 
         # BGRP
-        LVL1MenuItem('L1_BGRP0').setLogic( RNDM0 & BGRP0 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP1').setLogic( RNDM0 & BGRP0 & BGRP1 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP7').setLogic( RNDM0 & BGRP0 & BGRP7 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP9').setLogic( RNDM0 & BGRP0 & BGRP9 ).setTriggerType(TT.rand)  #fixed in ATR-14201
+        LVL1MenuItem('L1_BGRP0').setLogic( RNDM0 & BGRP0 ).setTriggerType(TT.rand)            # noqa: F821
+        LVL1MenuItem('L1_BGRP1').setLogic( RNDM0 & BGRP0 & BGRP1 ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP7').setLogic( RNDM0 & BGRP0 & BGRP7 ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP9').setLogic( RNDM0 & BGRP0 & BGRP9 ).setTriggerType(TT.rand)  #fixed in ATR-14201  # noqa: F821
 
-        LVL1MenuItem('L1_BPTX0_BGRP0', ctpid=0xf1).setLogic(BPTX0 & BGRP0).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BPTX1_BGRP0', ctpid=0xf2).setLogic(BPTX1 & BGRP0).setTriggerType(TT.rand)   
+        LVL1MenuItem('L1_BPTX0_BGRP0', ctpid=0xf1).setLogic(BPTX0 & BGRP0).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BPTX1_BGRP0', ctpid=0xf2).setLogic(BPTX1 & BGRP0).setTriggerType(TT.rand)    # noqa: F821
         
         # lumi measurements
-        LVL1MenuItem('L1_MLZ_A').setLogic( (MBTS_A|ZDC_A|LUCID_A) & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MLZ_C').setLogic( (MBTS_C|ZDC_C|LUCID_C) & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBLZ' ).setLogic( ( (MBTS_A|ZDC_A|LUCID_A) & (MBTS_C|ZDC_C|LUCID_C) | BCM_Wide) & physcond ).setTriggerType(TT.minb)  
+        LVL1MenuItem('L1_MLZ_A').setLogic( (MBTS_A|ZDC_A|LUCID_A) & physcond).setTriggerType(TT.minb)  # noqa: F821
+        LVL1MenuItem('L1_MLZ_C').setLogic( (MBTS_C|ZDC_C|LUCID_C) & physcond).setTriggerType(TT.minb)  # noqa: F821
+        LVL1MenuItem('L1_MBLZ' ).setLogic( ( (MBTS_A|ZDC_A|LUCID_A) & (MBTS_C|ZDC_C|LUCID_C) | BCM_Wide) & physcond ).setTriggerType(TT.minb)   # noqa: F821
 
-        LVL1MenuItem('L1_CALREQ0', ctpid=0x1fd).setLogic( CAL0 & calibcond).setTriggerType(TT.calreq0) 
-        LVL1MenuItem('L1_CALREQ1', ctpid=0x1fe).setLogic( CAL1 & calibcond).setTriggerType(TT.calreq1)
-        LVL1MenuItem('L1_CALREQ2', ctpid=0x1ff).setLogic( CAL2 & calibcond).setTriggerType(TT.calreq2)   
+        LVL1MenuItem('L1_CALREQ0', ctpid=0x1fd).setLogic( CAL0 & calibcond).setTriggerType(TT.calreq0) # noqa: F821 
+        LVL1MenuItem('L1_CALREQ1', ctpid=0x1fe).setLogic( CAL1 & calibcond).setTriggerType(TT.calreq1) # noqa: F821
+        LVL1MenuItem('L1_CALREQ2', ctpid=0x1ff).setLogic( CAL2 & calibcond).setTriggerType(TT.calreq2) # noqa: F821   
 
         # TRT
-        LVL1MenuItem('L1_TRT'       , ctpid=0x4e).setLogic(NIMTRT & BGRP0).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_TRT_FILLED').setLogic(NIMTRT & physcond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_TRT_EMPTY' ).setLogic(NIMTRT & cosmiccond).setTriggerType(TT.nim)
+        LVL1MenuItem('L1_TRT'       , ctpid=0x4e).setLogic(NIMTRT & BGRP0).setTriggerType(TT.nim) # noqa: F821
+        LVL1MenuItem('L1_TRT_FILLED').setLogic(NIMTRT & physcond).setTriggerType(TT.nim)          # noqa: F821
+        LVL1MenuItem('L1_TRT_EMPTY' ).setLogic(NIMTRT & cosmiccond).setTriggerType(TT.nim)        # noqa: F821
 
         # TGC
-        LVL1MenuItem('L1_TGC_BURST').setLogic(NIMTGC & BGRP0).setTriggerType(TT.nim)
-        # LVL1MenuItem('L1_TGC_BURST_EMPTY').setLogic(NIMTGC & cosmiccond).setTriggerType(TT.nim)
+        LVL1MenuItem('L1_TGC_BURST').setLogic(NIMTGC & BGRP0).setTriggerType(TT.nim)                 # noqa: F821
+        # LVL1MenuItem('L1_TGC_BURST_EMPTY').setLogic(NIMTGC & cosmiccond).setTriggerType(TT.nim)     # noqa: F821
 
 
         # LHCF
-        LVL1MenuItem('L1_LHCF').setLogic( NIMLHCF & physcond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_LHCF_UNPAIRED_ISO').setLogic( NIMLHCF & unpaired_isocond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_LHCF_EMPTY').setLogic( NIMLHCF & cosmiccond).setTriggerType(TT.nim)
+        LVL1MenuItem('L1_LHCF').setLogic( NIMLHCF & physcond).setTriggerType(TT.nim)                       # noqa: F821
+        LVL1MenuItem('L1_LHCF_UNPAIRED_ISO').setLogic( NIMLHCF & unpaired_isocond).setTriggerType(TT.nim)  # noqa: F821
+        LVL1MenuItem('L1_LHCF_EMPTY').setLogic( NIMLHCF & cosmiccond).setTriggerType(TT.nim)               # noqa: F821
         
         # ALFA 
 
         # LUT 22 (12 Outputs)
         # ALFA LUT output #1-8 are the single thresholds
-        ALFA_ANY_A    = ALFA_B7L1U | ALFA_B7L1L | ALFA_A7L1U | ALFA_A7L1L  #  9
-        ALFA_ANY_C    = ALFA_A7R1U | ALFA_A7R1L | ALFA_B7R1U | ALFA_B7R1L  # 10
-        ALFA_ANY_U    = ALFA_B7L1U | ALFA_A7L1U | ALFA_A7R1U | ALFA_B7R1U  # 11
-        ALFA_ANY_L    = ALFA_A7R1L | ALFA_B7R1L | ALFA_B7L1L | ALFA_A7L1L  # 12
+        ALFA_ANY_A    = ALFA_B7L1U | ALFA_B7L1L | ALFA_A7L1U | ALFA_A7L1L  #  9     # noqa: F821
+        ALFA_ANY_C    = ALFA_A7R1U | ALFA_A7R1L | ALFA_B7R1U | ALFA_B7R1L  # 10     # noqa: F821
+        ALFA_ANY_U    = ALFA_B7L1U | ALFA_A7L1U | ALFA_A7R1U | ALFA_B7R1U  # 11     # noqa: F821
+        ALFA_ANY_L    = ALFA_A7R1L | ALFA_B7R1L | ALFA_B7L1L | ALFA_A7L1L  # 12     # noqa: F821
 
         # LUT 23 (12 Outputs)
-        ALFA_LU       = ALFA2_A7L1U | ALFA2_B7L1U #  0
-        ALFA_RL       = ALFA2_A7R1L | ALFA2_B7R1L #  1
-        ALFA_LL       = ALFA2_B7L1L | ALFA2_A7L1L #  2
-        ALFA_RU       = ALFA2_A7R1U | ALFA2_B7R1U #  3
+        ALFA_LU       = ALFA2_A7L1U | ALFA2_B7L1U #  0     # noqa: F821
+        ALFA_RL       = ALFA2_A7R1L | ALFA2_B7R1L #  1     # noqa: F821
+        ALFA_LL       = ALFA2_B7L1L | ALFA2_A7L1L #  2     # noqa: F821
+        ALFA_RU       = ALFA2_A7R1U | ALFA2_B7R1U #  3     # noqa: F821
 
-        ALFA_A_UL_AA  = ALFA2_A7L1L | ALFA2_A7L1U #  4
-        ALFA_A_UL_AB  = ALFA2_A7L1U | ALFA2_B7L1L #  5
-        ALFA_A_UL_BA  = ALFA2_A7L1L | ALFA2_B7L1U #  6
-        ALFA_A_UL_BB  = ALFA2_B7L1L | ALFA2_B7L1U #  7
+        ALFA_A_UL_AA  = ALFA2_A7L1L | ALFA2_A7L1U #  4     # noqa: F821
+        ALFA_A_UL_AB  = ALFA2_A7L1U | ALFA2_B7L1L #  5     # noqa: F821
+        ALFA_A_UL_BA  = ALFA2_A7L1L | ALFA2_B7L1U #  6     # noqa: F821
+        ALFA_A_UL_BB  = ALFA2_B7L1L | ALFA2_B7L1U #  7     # noqa: F821
 
-        ALFA_C_UL_AA  = ALFA2_A7R1L | ALFA2_A7R1U #  8
-        ALFA_C_UL_AB  = ALFA2_A7R1U | ALFA2_B7R1L #  9
-        ALFA_C_UL_BA  = ALFA2_A7R1L | ALFA2_B7R1U # 10
-        ALFA_C_UL_BB  = ALFA2_B7R1L | ALFA2_B7R1U # 11
+        ALFA_C_UL_AA  = ALFA2_A7R1L | ALFA2_A7R1U #  8     # noqa: F821
+        ALFA_C_UL_AB  = ALFA2_A7R1U | ALFA2_B7R1L #  9     # noqa: F821
+        ALFA_C_UL_BA  = ALFA2_A7R1L | ALFA2_B7R1U # 10     # noqa: F821
+        ALFA_C_UL_BB  = ALFA2_B7R1L | ALFA2_B7R1U # 11     # noqa: F821
 
         # LUT 24 (9 Outputs)
-        ALFA_ANY          = ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L # 0
-        NOT_ALFA_ANY_A    = Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L)  #  1-4
-        NOT_ALFA_ANY_C    = Not(ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)  #  5-8
+        ALFA_ANY          = ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L # 0      # noqa: F821
+        #NOT_ALFA_ANY_A    = Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L)  #  1-4     # noqa: F821
+        #NOT_ALFA_ANY_C    = Not(ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)  #  5-8     # noqa: F821
 
         # LUT 25 (4 outputs)
-        ALFA_AE1          = ALFA4_B7L1U | ALFA4_A7L1U | ALFA4_B7L1L | ALFA4_A7L1L
-        ALFA_AE2          = ALFA4_B7L1U | ALFA4_A7L1U | ALFA4_A7R1L | ALFA4_B7R1L
-        ALFA_AE3          = ALFA4_A7R1U | ALFA4_B7R1U | ALFA4_B7L1L | ALFA4_A7L1L
-        ALFA_AE4          = ALFA4_A7R1U | ALFA4_B7R1U | ALFA4_A7R1L | ALFA4_B7R1L
+        ALFA_AE1          = ALFA4_B7L1U | ALFA4_A7L1U | ALFA4_B7L1L | ALFA4_A7L1L     # noqa: F821
+        ALFA_AE2          = ALFA4_B7L1U | ALFA4_A7L1U | ALFA4_A7R1L | ALFA4_B7R1L     # noqa: F821
+        ALFA_AE3          = ALFA4_A7R1U | ALFA4_B7R1U | ALFA4_B7L1L | ALFA4_A7L1L     # noqa: F821
+        ALFA_AE4          = ALFA4_A7R1U | ALFA4_B7R1U | ALFA4_A7R1L | ALFA4_B7R1L     # noqa: F821
 
 
         # further simplification (in CAM)
@@ -1111,7 +1138,7 @@ class ItemDef:
         ALFA_ANTI_ELASTIC = ALFA_AE1 & ALFA_AE2 & ALFA_AE3 & ALFA_AE4
 
 
-        MBTS_INNER = (MBTS_A0 | MBTS_A1 |  MBTS_A2 | MBTS_A3 | MBTS_A4 | MBTS_A5 | MBTS_A6 | MBTS_A7 | MBTS_C0 | MBTS_C1 | MBTS_C2 | MBTS_C3 | MBTS_C4 | MBTS_C5 | MBTS_C6 | MBTS_C7)         
+        MBTS_INNER = (MBTS_A0 | MBTS_A1 |  MBTS_A2 | MBTS_A3 | MBTS_A4 | MBTS_A5 | MBTS_A6 | MBTS_A7 | MBTS_C0 | MBTS_C1 | MBTS_C2 | MBTS_C3 | MBTS_C4 | MBTS_C5 | MBTS_C6 | MBTS_C7)              # noqa: F821
 
         ## AFP and ALFA
         #AFP_C =  ((AFP_FSC | AFP_NSC) |  (AFP_FSC & AFP_NSC ))
@@ -1126,231 +1153,231 @@ class ItemDef:
         #AFP 
         #new naming convention ATR-15881 AFP_C = AFP_NSC && AFP_FSC_SIT,  AFP_C_SPECTOF = AFP_FSC_TOF
         if not '_v6' in TriggerFlags.triggerMenuSetup():
-            AFP_A = (AFP_NSA & AFP_FSA_SIT)
-            AFP_C = (AFP_NSC & AFP_FSC_SIT)
-            AFP_A_AND_C_SPECTOF = (AFP_FSA_TOF & AFP_FSC_TOF)
-
-            LVL1MenuItem('L1_AFP_A_BGRP0').setLogic( AFP_A & BGRP0)
-            LVL1MenuItem('L1_AFP_A_SPECTOF_BGRP0').setLogic( AFP_FSA_TOF & BGRP0)
-            LVL1MenuItem('L1_AFP_C_BGRP0').setLogic( AFP_C & BGRP0)
-            LVL1MenuItem('L1_AFP_C_SPECTOF_BGRP0').setLogic( AFP_FSC_TOF & BGRP0)
-            LVL1MenuItem('L1_AFP_NSA_BGRP0').setLogic( AFP_NSA & BGRP0)
-            LVL1MenuItem('L1_AFP_NSC_BGRP0').setLogic( AFP_NSC & BGRP0)
-            LVL1MenuItem('L1_AFP_FSA_SIT_BGRP0').setLogic( AFP_FSA_SIT & BGRP0)
-            LVL1MenuItem('L1_AFP_FSC_SIT_BGRP0').setLogic( AFP_FSC_SIT & BGRP0)
-
-            LVL1MenuItem('L1_AFP_A_OR_C_UNPAIRED_ISO').setLogic( (AFP_A | AFP_C)  & unpaired_isocond )
-            LVL1MenuItem('L1_AFP_A_OR_C_UNPAIRED_NONISO').setLogic( (AFP_A | AFP_C)  & unpaired_nonisocond )
-
-            LVL1MenuItem('L1_AFP_A_OR_C_EMPTY').setLogic( (AFP_A | AFP_C) & cosmiccond)
-            LVL1MenuItem('L1_AFP_A_OR_C_FIRSTEMPTY').setLogic( (AFP_A | AFP_C) & firstempty)
+            AFP_A = (AFP_NSA & AFP_FSA_SIT)     # noqa: F821
+            AFP_C = (AFP_NSC & AFP_FSC_SIT)     # noqa: F821
+            AFP_A_AND_C_SPECTOF = (AFP_FSA_TOF & AFP_FSC_TOF)     # noqa: F821
+
+            LVL1MenuItem('L1_AFP_A_BGRP0').setLogic( AFP_A & BGRP0)                 # noqa: F821
+            LVL1MenuItem('L1_AFP_A_SPECTOF_BGRP0').setLogic( AFP_FSA_TOF & BGRP0)   # noqa: F821
+            LVL1MenuItem('L1_AFP_C_BGRP0').setLogic( AFP_C & BGRP0)                 # noqa: F821
+            LVL1MenuItem('L1_AFP_C_SPECTOF_BGRP0').setLogic( AFP_FSC_TOF & BGRP0)   # noqa: F821
+            LVL1MenuItem('L1_AFP_NSA_BGRP0').setLogic( AFP_NSA & BGRP0)             # noqa: F821
+            LVL1MenuItem('L1_AFP_NSC_BGRP0').setLogic( AFP_NSC & BGRP0)             # noqa: F821
+            LVL1MenuItem('L1_AFP_FSA_SIT_BGRP0').setLogic( AFP_FSA_SIT & BGRP0)     # noqa: F821
+            LVL1MenuItem('L1_AFP_FSC_SIT_BGRP0').setLogic( AFP_FSC_SIT & BGRP0)     # noqa: F821
+
+            LVL1MenuItem('L1_AFP_A_OR_C_UNPAIRED_ISO').setLogic( (AFP_A | AFP_C)  & unpaired_isocond )           # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C_UNPAIRED_NONISO').setLogic( (AFP_A | AFP_C)  & unpaired_nonisocond )     # noqa: F821
+
+            LVL1MenuItem('L1_AFP_A_OR_C_EMPTY').setLogic( (AFP_A | AFP_C) & cosmiccond)          # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C_FIRSTEMPTY').setLogic( (AFP_A | AFP_C) & firstempty)     # noqa: F821
             
-            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF').setLogic( AFP_A_AND_C_SPECTOF & physcond )
-
-            LVL1MenuItem('L1_AFP_A_AND_C').setLogic( AFP_A & AFP_C & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C').setLogic( (AFP_A | AFP_C) & physcond )
-            LVL1MenuItem('L1_AFP_A').setLogic( AFP_A & physcond )
-            LVL1MenuItem('L1_AFP_C').setLogic( AFP_C & physcond )
-
-            LVL1MenuItem('L1_AFP_A_AND_C_MBTS_2').setLogic( AFP_A & AFP_C & MBTS_2 & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C_MBTS_2').setLogic( (AFP_A | AFP_C) & MBTS_2 & physcond )
-
-            LVL1MenuItem('L1_AFP_A_AND_C_J12').setLogic( AFP_A & AFP_C & J12 & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C_J12').setLogic( (AFP_A | AFP_C) & J12 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_EM3').setLogic( AFP_A & AFP_C & EM3 & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C_EM3').setLogic( (AFP_A | AFP_C) & EM3 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_MU4').setLogic( AFP_A & AFP_C & MU4 & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C_MU4').setLogic( (AFP_A | AFP_C) & MU4 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_TE5').setLogic( AFP_A & AFP_C & TE5 & physcond )
-            LVL1MenuItem('L1_AFP_A_OR_C_TE5').setLogic( (AFP_A | AFP_C) & TE5 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_J50').setLogic( AFP_A & AFP_C & J50 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J50').setLogic( AFP_A_AND_C_SPECTOF & J50 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_J75').setLogic( AFP_A & AFP_C & J75 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J75').setLogic( AFP_A_AND_C_SPECTOF & J75 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_J100').setLogic( AFP_A & AFP_C & J100 & physcond )
-            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J100').setLogic( AFP_A_AND_C_SPECTOF & J100 & physcond )
+            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF').setLogic( AFP_A_AND_C_SPECTOF & physcond )    # noqa: F821 
+
+            LVL1MenuItem('L1_AFP_A_AND_C').setLogic( AFP_A & AFP_C & physcond )                  # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C').setLogic( (AFP_A | AFP_C) & physcond )                 # noqa: F821
+            LVL1MenuItem('L1_AFP_A').setLogic( AFP_A & physcond )                                # noqa: F821
+            LVL1MenuItem('L1_AFP_C').setLogic( AFP_C & physcond )                                # noqa: F821
+
+            LVL1MenuItem('L1_AFP_A_AND_C_MBTS_2').setLogic( AFP_A & AFP_C & MBTS_2 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C_MBTS_2').setLogic( (AFP_A | AFP_C) & MBTS_2 & physcond ) # noqa: F821
+
+            LVL1MenuItem('L1_AFP_A_AND_C_J12').setLogic( AFP_A & AFP_C & J12 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C_J12').setLogic( (AFP_A | AFP_C) & J12 & physcond ) # noqa: F821
+            LVL1MenuItem('L1_EM3_AFP_A_AND_C').setLogic( AFP_A & AFP_C & EM3 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_EM3_AFP_A_OR_C').setLogic( (AFP_A | AFP_C) & EM3 & physcond ) # noqa: F821
+            LVL1MenuItem('L1_MU4_AFP_A_AND_C').setLogic( AFP_A & AFP_C & MU4 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_MU4_AFP_A_OR_C').setLogic( (AFP_A | AFP_C) & MU4 & physcond ) # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_TE5').setLogic( AFP_A & AFP_C & TE5 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_A_OR_C_TE5').setLogic( (AFP_A | AFP_C) & TE5 & physcond ) # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_J50').setLogic( AFP_A & AFP_C & J50 & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J50').setLogic( AFP_A_AND_C_SPECTOF & J50 & physcond )   # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_J75').setLogic( AFP_A & AFP_C & J75 & physcond )                 # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J75').setLogic( AFP_A_AND_C_SPECTOF & J75 & physcond )   # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_J100').setLogic( AFP_A & AFP_C & J100 & physcond )               # noqa: F821
+            LVL1MenuItem('L1_AFP_A_AND_C_SPECTOF_J100').setLogic( AFP_A_AND_C_SPECTOF & J100 & physcond ) # noqa: F821
 
         else:    
-            LVL1MenuItem('L1_AFP_NSC').setLogic( AFP_NSC & physcond )
-            LVL1MenuItem('L1_AFP_FSC').setLogic( AFP_FSC & physcond )
-            LVL1MenuItem('L1_AFP_C_ANY').setLogic( ( AFP_FSC | AFP_NSC) & physcond )
-            LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_ISO').setLogic( ( AFP_FSC | AFP_NSC) & unpaired_isocond)
-            LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_NONISO').setLogic( ( AFP_FSC | AFP_NSC) & unpaired_nonisocond)
-            LVL1MenuItem('L1_AFP_C_ANY_EMPTY').setLogic( ( AFP_FSC | AFP_NSC) & cosmiccond)
-            LVL1MenuItem('L1_AFP_C_ANY_FIRSTEMPTY').setLogic( ( AFP_FSC | AFP_NSC) & firstempty)
-            LVL1MenuItem('L1_AFP_C_AND').setLogic( ( AFP_FSC & AFP_NSC) & physcond )
+            LVL1MenuItem('L1_AFP_NSC').setLogic( AFP_NSC & physcond ) # noqa: F821
+            LVL1MenuItem('L1_AFP_FSC').setLogic( AFP_FSC & physcond ) # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY').setLogic( ( AFP_FSC | AFP_NSC) & physcond ) # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_ISO').setLogic( ( AFP_FSC | AFP_NSC) & unpaired_isocond)       # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_NONISO').setLogic( ( AFP_FSC | AFP_NSC) & unpaired_nonisocond) # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY_EMPTY').setLogic( ( AFP_FSC | AFP_NSC) & cosmiccond) # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY_FIRSTEMPTY').setLogic( ( AFP_FSC | AFP_NSC) & firstempty) # noqa: F821
+            LVL1MenuItem('L1_AFP_C_AND').setLogic( ( AFP_FSC & AFP_NSC) & physcond ) # noqa: F821
 
 
 
-            AFP_C =  (AFP_FSC & AFP_NSC)
+            AFP_C =  (AFP_FSC & AFP_NSC) # noqa: F821
 
-            LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic(AFP_C  & MBTS_A & physcond )
-            LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic(AFP_C  & ZDC_C & physcond )
-            LVL1MenuItem('L1_AFP_C_J12').setLogic(AFP_C  & J12 & physcond )
-            LVL1MenuItem('L1_AFP_C_EM3').setLogic(AFP_C  & EM3 & physcond )
-            LVL1MenuItem('L1_AFP_C_MU4').setLogic(AFP_C  & MU4 & physcond )
-            LVL1MenuItem('L1_AFP_C_TE5').setLogic(AFP_C  & TE5 & physcond )
-            LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic(AFP_C  &  ALFA_C & physcond )
-            LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic(AFP_C  &  ALFA_A & physcond )
-            LVL1MenuItem('L1_AFP_C_ANY_MBTS_A').setLogic( (AFP_FSC | AFP_NSC) & MBTS_A & physcond )
+            LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic(AFP_C  & MBTS_A & physcond )   # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic(AFP_C  & ZDC_C & physcond )     # noqa: F821
+            LVL1MenuItem('L1_AFP_C_J12').setLogic(AFP_C  & J12 & physcond )         # noqa: F821
+            LVL1MenuItem('L1_AFP_C_EM3').setLogic(AFP_C  & EM3 & physcond )         # noqa: F821
+            LVL1MenuItem('L1_AFP_C_MU4').setLogic(AFP_C  & MU4 & physcond )         # noqa: F821
+            LVL1MenuItem('L1_AFP_C_TE5').setLogic(AFP_C  & TE5 & physcond )         # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic(AFP_C  &  ALFA_C & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic(AFP_C  &  ALFA_A & physcond )  # noqa: F821
+            LVL1MenuItem('L1_AFP_C_ANY_MBTS_A').setLogic( (AFP_FSC | AFP_NSC) & MBTS_A & physcond )         # noqa: F821
 
 
 
 
         ## ALFA Single items
-        LVL1MenuItem('L1_ALFA_B7L1U').setLogic(ALFA_B7L1U & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7L1L').setLogic(ALFA_B7L1L & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1U').setLogic(ALFA_A7L1U & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1L').setLogic(ALFA_A7L1L & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1U').setLogic(ALFA_A7R1U & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1L').setLogic(ALFA_A7R1L & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1U').setLogic(ALFA_B7R1U & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1L').setLogic(ALFA_B7R1L & BGRP0).setTriggerType(TT.alfa)
-
-
-        LVL1MenuItem('L1_ALFA_ELAST1').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1L & ALFA_B7R1L &
-                                                 Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_B7R1U)
-                                                 & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_B7L1U').setLogic(ALFA_B7L1U & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1L').setLogic(ALFA_B7L1L & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1U').setLogic(ALFA_A7L1U & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1L').setLogic(ALFA_A7L1L & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1U').setLogic(ALFA_A7R1U & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1L').setLogic(ALFA_A7R1L & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1U').setLogic(ALFA_B7R1U & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1L').setLogic(ALFA_B7R1L & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+
+
+        LVL1MenuItem('L1_ALFA_ELAST1').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1L & ALFA_B7R1L &                 # noqa: F821
+                                                 Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_B7R1U)          # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_ELAST2').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1U & ALFA_B7R1U &
-                                                 Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1L | ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ELAST2').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1U & ALFA_B7R1U &                 # noqa: F821
+                                                 Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1L | ALFA3_B7R1L)          # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_ELAST11').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1L & ALFA_B7R1L    & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST12').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1U & ALFA_B7R1U    & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST13').setLogic( ALFA_LU & (ALFA_A7R1L & ALFA_B7R1L)                  & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST14').setLogic( (ALFA_B7L1U & ALFA_A7L1U) & ALFA_RL & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST15').setLogic( ALFA_LU & ALFA_RL & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST15_Calib').setLogic( ALFA_LU & ALFA_RL &  alfacalib).setTriggerType(TT.alfa) ## CHECK
-        LVL1MenuItem('L1_ALFA_ELAST16').setLogic( ALFA_LL & (ALFA_A7R1U & ALFA_B7R1U) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST17').setLogic((ALFA_B7L1L & ALFA_A7L1L) & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST18').setLogic( ALFA_LL & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST18_Calib').setLogic( ALFA_LL & ALFA_RU & alfacalib).setTriggerType(TT.alfa)
-
-
-        LVL1MenuItem('L1_ALFA_SDIFF1').setLogic( ALFA_B7L1U & ALFA_A7L1U &
-                                                 Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ELAST11').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1L & ALFA_B7R1L    & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST12').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1U & ALFA_B7R1U    & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST13').setLogic( ALFA_LU & (ALFA_A7R1L & ALFA_B7R1L)                  & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST14').setLogic( (ALFA_B7L1U & ALFA_A7L1U) & ALFA_RL & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST15').setLogic( ALFA_LU & ALFA_RL & physcond).setTriggerType(TT.alfa)                      # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST15_Calib').setLogic( ALFA_LU & ALFA_RL &  alfacalib).setTriggerType(TT.alfa) ## CHECK     # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST16').setLogic( ALFA_LL & (ALFA_A7R1U & ALFA_B7R1U) & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST17').setLogic((ALFA_B7L1L & ALFA_A7L1L) & ALFA_RU & physcond).setTriggerType(TT.alfa)     # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST18').setLogic( ALFA_LL & ALFA_RU & physcond).setTriggerType(TT.alfa)                      # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST18_Calib').setLogic( ALFA_LL & ALFA_RU & alfacalib).setTriggerType(TT.alfa)               # noqa: F821
+
+
+        LVL1MenuItem('L1_ALFA_SDIFF1').setLogic( ALFA_B7L1U & ALFA_A7L1U &                                                                      # noqa: F821
+                                                 Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)         # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_SDIFF2').setLogic( ALFA_A7R1L & ALFA_B7R1L &
-                                                 Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_B7R1U)
-                                                 & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_SDIFF2').setLogic( ALFA_A7R1L & ALFA_B7R1L &                                                                      # noqa: F821
+                                                 Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1U | ALFA3_B7R1U)         # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
          
-        LVL1MenuItem('L1_ALFA_SDIFF3').setLogic( ALFA_B7L1L & ALFA_A7L1L &
-                                                 Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_SDIFF3').setLogic( ALFA_B7L1L & ALFA_A7L1L &                                                                      # noqa: F821
+                                                 Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1U | ALFA3_A7R1L | ALFA3_B7R1U | ALFA3_B7R1L)         # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
          
-        LVL1MenuItem('L1_ALFA_SDIFF4').setLogic( ALFA_A7R1U & ALFA_B7R1U &
-                                                 Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1L | ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SDIFF5').setLogic( ALFA_B7L1U & ALFA_A7L1U &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF6').setLogic( ALFA_A7R1L & ALFA_B7R1L &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF7').setLogic( ALFA_B7L1L & ALFA_A7L1L &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF8').setLogic( ALFA_A7R1U & ALFA_B7R1U &  physcond).setTriggerType(TT.alfa) 
+        LVL1MenuItem('L1_ALFA_SDIFF4').setLogic( ALFA_A7R1U & ALFA_B7R1U &                                                                      # noqa: F821
+                                                 Not(ALFA3_B7L1U | ALFA3_B7L1L | ALFA3_A7L1U | ALFA3_A7L1L | ALFA3_A7R1L | ALFA3_B7R1L)         # noqa: F821
+                                                 & physcond).setTriggerType(TT.alfa)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_SDIFF5').setLogic( ALFA_B7L1U & ALFA_A7L1U &  physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF6').setLogic( ALFA_A7R1L & ALFA_B7R1L &  physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF7').setLogic( ALFA_B7L1L & ALFA_A7L1L &  physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF8').setLogic( ALFA_A7R1U & ALFA_B7R1U &  physcond).setTriggerType(TT.alfa)    # noqa: F821
                                                            
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C').setLogic( MBTS_A & ALFA_C  & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A').setLogic( MBTS_C & ALFA_A & physcond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_1_ALFA_ANY').setLogic( MBTS_1 & ALFA_ANY  & physcond).setTriggerType(TT.alfa) ##should be called L1_MBTS_1_ALFA_ANY                          
+        LVL1MenuItem('L1_MBTS_1_A_ALFA_C').setLogic( MBTS_A & ALFA_C  & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_C_ALFA_A').setLogic( MBTS_C & ALFA_A & physcond).setTriggerType(TT.alfa)     # noqa: F821  
+        LVL1MenuItem('L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_ALFA_ANY').setLogic( MBTS_1 & ALFA_ANY  & physcond).setTriggerType(TT.alfa) ##should be called L1_MBTS_1_ALFA_ANY   # noqa: F821                     
 
         ## check definition of MBTS_2
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C').setLogic( MBTS_A.x(2) & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A').setLogic( MBTS_C.x(2) & ALFA_A & physcond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(2) & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(2) & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_2_ALFA').setLogic( MBTS_2 & ALFA_ANY & physcond).setTriggerType(TT.alfa)              
+        LVL1MenuItem('L1_MBTS_2_A_ALFA_C').setLogic( MBTS_A.x(2) & ALFA_C & physcond).setTriggerType(TT.alfa)                       # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C_ALFA_A').setLogic( MBTS_C.x(2) & ALFA_A & physcond).setTriggerType(TT.alfa)                       # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(2) & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa)  # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(2) & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)  # noqa: F821 
+        LVL1MenuItem('L1_MBTS_2_ALFA').setLogic( MBTS_2 & ALFA_ANY & physcond).setTriggerType(TT.alfa)                              # noqa: F821
         
-        LVL1MenuItem('L1_LUCID_A_ALFA_C').setLogic( LUCID_A & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_C_ALFA_A').setLogic( LUCID_C & ALFA_A & physcond).setTriggerType(TT.alfa)     
-        LVL1MenuItem('L1_LUCID_A_ALFA_C_UNPAIRED_ISO').setLogic( LUCID_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_C_ALFA_A_UNPAIRED_ISO').setLogic( LUCID_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_ALFA').setLogic( (LUCID_A | LUCID_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa) 
+        LVL1MenuItem('L1_LUCID_A_ALFA_C').setLogic( LUCID_A & ALFA_C & physcond).setTriggerType(TT.alfa)                         # noqa: F821
+        LVL1MenuItem('L1_LUCID_C_ALFA_A').setLogic( LUCID_C & ALFA_A & physcond).setTriggerType(TT.alfa)                         # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_ALFA_C_UNPAIRED_ISO').setLogic( LUCID_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_C_ALFA_A_UNPAIRED_ISO').setLogic( LUCID_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_ALFA').setLogic( (LUCID_A | LUCID_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa)               # noqa: F821
         
-        #LVL1MenuItem('L1_ZDC_A_ALFA_C').setLogic( ZDC_A  & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        #LVL1MenuItem('L1_ZDC_C_ALFA_A').setLogic( ZDC_C  & ALFA_A & physcond).setTriggerType(TT.alfa)     
-        #LVL1MenuItem('L1_ZDC_ALFA').setLogic( (ZDC_A | ZDC_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa) 
+        #LVL1MenuItem('L1_ZDC_A_ALFA_C').setLogic( ZDC_A  & ALFA_C & physcond).setTriggerType(TT.alfa)           # noqa: F821
+        #LVL1MenuItem('L1_ZDC_C_ALFA_A').setLogic( ZDC_C  & ALFA_A & physcond).setTriggerType(TT.alfa)           # noqa: F821
+        #LVL1MenuItem('L1_ZDC_ALFA').setLogic( (ZDC_A | ZDC_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_EM3_ALFA_ANY'             ).setLogic( EM3 & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_ANY_UNPAIRED_ISO').setLogic( EM3 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_ANY_VETO_MBTS' ).setLogic( EM3 & ALFA_ANY  & Not(MBTS_INNER) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_EINE'          ).setLogic( EM3 & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_EINE_VETO_MBTS').setLogic( EM3 & ALFA_EINE & Not(MBTS_INNER) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A'             ).setLogic( EM3 & MBTS_A & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C'             ).setLogic( EM3 & MBTS_C & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO').setLogic( EM3 & MBTS_A & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO').setLogic( EM3 & MBTS_A & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_EM3_ALFA_ANY'             ).setLogic( EM3 & ALFA_ANY & physcond).setTriggerType(TT.alfa)                          # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_ANY_UNPAIRED_ISO').setLogic( EM3 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)                  # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_ANY_VETO_MBTS' ).setLogic( EM3 & ALFA_ANY  & Not(MBTS_INNER) & physcond).setTriggerType(TT.alfa)         # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_EINE'          ).setLogic( EM3 & ALFA_EINE & physcond).setTriggerType(TT.alfa)                           # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_EINE_VETO_MBTS').setLogic( EM3 & ALFA_EINE & Not(MBTS_INNER) & physcond).setTriggerType(TT.alfa)         # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_A'             ).setLogic( EM3 & MBTS_A & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)            # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_C'             ).setLogic( EM3 & MBTS_C & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)            # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO').setLogic( EM3 & MBTS_A & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO').setLogic( EM3 & MBTS_A & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_J12_ALFA_ANY'             ).setLogic( J12 & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_J12_ALFA_ANY_UNPAIRED_ISO').setLogic( J12 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_J12_ALFA_ANY'             ).setLogic( J12 & ALFA_ANY & physcond).setTriggerType(TT.alfa)            # noqa: F821
+        LVL1MenuItem('L1_J12_ALFA_ANY_UNPAIRED_ISO').setLogic( J12 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
 
-        LVL1MenuItem('L1_TE5_ALFA_ANY'             ).setLogic( TE5 & ALFA_ANY  & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TE5_ALFA_ANY_UNPAIRED_ISO').setLogic( TE5 & ALFA_ANY  & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TE5_ALFA_EINE'            ).setLogic( TE5 & ALFA_EINE & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_TE5_ALFA_ANY'             ).setLogic( TE5 & ALFA_ANY  & physcond).setTriggerType(TT.alfa)            # noqa: F821
+        LVL1MenuItem('L1_TE5_ALFA_ANY_UNPAIRED_ISO').setLogic( TE5 & ALFA_ANY  & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_TE5_ALFA_EINE'            ).setLogic( TE5 & ALFA_EINE & physcond).setTriggerType(TT.alfa)            # noqa: F821
         
-        LVL1MenuItem('L1_TRT_ALFA_ANY'             ).setLogic( NIMTRT & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TRT_ALFA_ANY_UNPAIRED_ISO').setLogic( NIMTRT & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_TRT_ALFA_ANY'             ).setLogic( NIMTRT & ALFA_ANY & physcond).setTriggerType(TT.alfa)          # noqa: F821
+        LVL1MenuItem('L1_TRT_ALFA_ANY_UNPAIRED_ISO').setLogic( NIMTRT & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)  # noqa: F821
                    
-        LVL1MenuItem('L1_TRT_ALFA_ANY_VETO_MBTS'           ).setLogic( NIMTRT & Not(MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_TRT_ALFA_ANY_VETO_MBTS'           ).setLogic( NIMTRT & Not(MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)    # noqa: F821
 
-        LVL1MenuItem('L1_TRT_ALFA_EINE'                    ).setLogic( NIMTRT & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TRT_ALFA_EINE_VETO_MBTS'          ).setLogic( NIMTRT & Not(MBTS_INNER) & ALFA_EINE & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_TRT_ALFA_EINE'                    ).setLogic( NIMTRT & ALFA_EINE & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_TRT_ALFA_EINE_VETO_MBTS'          ).setLogic( NIMTRT & Not(MBTS_INNER) & ALFA_EINE & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_ELASTIC_VETO_MBTS'                  ).setLogic( Not(MBTS_INNER) & ALFA_ELASTIC & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELASTIC_UNPAIRED_ISO'               ).setLogic( ALFA_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ELASTIC_VETO_MBTS'                  ).setLogic( Not(MBTS_INNER) & ALFA_ELASTIC & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELASTIC_UNPAIRED_ISO'               ).setLogic( ALFA_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
 
-        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_VETO_MBTS'             ).setLogic( Not(MBTS_INNER) & ALFA_ANTI_ELASTIC & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO').setLogic( ALFA_ANTI_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_VETO_MBTS'             ).setLogic( Not(MBTS_INNER) & ALFA_ANTI_ELASTIC & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO').setLogic( ALFA_ANTI_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
 
-        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS'                      ).setLogic( Not(MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS_UNPAIRED_ISO'         ).setLogic( Not(MBTS_INNER) & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS'                      ).setLogic( Not(MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS_UNPAIRED_ISO'         ).setLogic( Not(MBTS_INNER) & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
                 
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_A'             ).setLogic( NIMLHCF & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_C'             ).setLogic( NIMLHCF & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO').setLogic( NIMLHCF & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO').setLogic( NIMLHCF & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_LHCF_ALFA_ANY_A'             ).setLogic( NIMLHCF & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_LHCF_ALFA_ANY_C'             ).setLogic( NIMLHCF & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO').setLogic( NIMLHCF & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO').setLogic( NIMLHCF & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_BGT' ).setLogic(RNDM3 & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_BGT_UNPAIRED_ISO' ).setLogic(RNDM3 & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_BGT_BGRP10').setLogic(RNDM3 & alfacalib).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SHOWSYST5').setLogic( (ALFA_ANY_A & ALFA_ANY_C) & physcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SYST9' ).setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1U & ALFA_B7R1U & Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1L | ALFA3_B7R1L) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST10').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1L & ALFA_B7R1L & Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1U | ALFA3_B7R1U) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST11').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1U & ALFA_B7R1U & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST12').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1L & ALFA_B7R1L & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST17').setLogic( ALFA_LU & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST18').setLogic( ALFA_LL & ALFA_RL & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_BGT' ).setLogic(RNDM3 & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_BGT_UNPAIRED_ISO' ).setLogic(RNDM3 & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_BGT_BGRP10').setLogic(RNDM3 & alfacalib).setTriggerType(TT.alfa)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_SHOWSYST5').setLogic( (ALFA_ANY_A & ALFA_ANY_C) & physcond).setTriggerType(TT.alfa)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_SYST9' ).setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1U & ALFA_B7R1U & Not(ALFA3_B7L1L | ALFA3_A7L1L | ALFA3_A7R1L | ALFA3_B7R1L) & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST10').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1L & ALFA_B7R1L & Not(ALFA3_B7L1U | ALFA3_A7L1U | ALFA3_A7R1U | ALFA3_B7R1U) & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST11').setLogic( ALFA_B7L1U & ALFA_A7L1U & ALFA_A7R1U & ALFA_B7R1U & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST12').setLogic( ALFA_B7L1L & ALFA_A7L1L & ALFA_A7R1L & ALFA_B7R1L & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST17').setLogic( ALFA_LU & ALFA_RU & physcond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST18').setLogic( ALFA_LL & ALFA_RL & physcond).setTriggerType(TT.alfa)    # noqa: F821
        
-        LVL1MenuItem('L1_ALFA_ANY').setLogic(ALFA_ANY & physcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ANY').setLogic(ALFA_ANY & physcond).setTriggerType(TT.alfa)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_ANY_EMPTY').setLogic(ALFA_ANY & cosmiccond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_FIRSTEMPTY').setLogic(ALFA_ANY & firstempty).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_ISO').setLogic(ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_NONISO').setLogic(ALFA_ANY & unpaired_nonisocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_BGRP10').setLogic(ALFA_ANY & alfacalib).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_ABORTGAPNOTCALIB').setLogic( ALFA_ANY & abortgap).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_CALIB').setLogic( ALFA_ANY & calibcond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ANY_EMPTY').setLogic(ALFA_ANY & cosmiccond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_FIRSTEMPTY').setLogic(ALFA_ANY & firstempty).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_ISO').setLogic(ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_NONISO').setLogic(ALFA_ANY & unpaired_nonisocond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_BGRP10').setLogic(ALFA_ANY & alfacalib).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_ABORTGAPNOTCALIB').setLogic( ALFA_ANY & abortgap).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_CALIB').setLogic( ALFA_ANY & calibcond).setTriggerType(TT.alfa)    # noqa: F821
 
-        LVL1MenuItem('L1_ALFA_ANY_A_EMPTY').setLogic(ALFA_ANY_A & cosmiccond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_C_EMPTY').setLogic(ALFA_ANY_C & cosmiccond).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_ANY_A_EMPTY').setLogic(ALFA_ANY_A & cosmiccond).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_C_EMPTY').setLogic(ALFA_ANY_C & cosmiccond).setTriggerType(TT.alfa)    # noqa: F821
 
         ## ALFA _OD items (LUT 26, 12 Outputs)
-        LVL1MenuItem('L1_ALFA_B7L1U_OD').setLogic(ALFA_B7L1U_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7L1L_OD').setLogic(ALFA_B7L1L_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1U_OD').setLogic(ALFA_A7L1U_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1L_OD').setLogic(ALFA_A7L1L_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1U_OD').setLogic(ALFA_A7R1U_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1L_OD').setLogic(ALFA_A7R1L_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1U_OD').setLogic(ALFA_B7R1U_OD & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1L_OD').setLogic(ALFA_B7R1L_OD & BGRP0).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_B7L1_OD').setLogic( (ALFA_B7L1U_OD & ALFA_B7L1L_OD) & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1_OD').setLogic( (ALFA_A7L1U_OD & ALFA_A7L1L_OD) & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1_OD').setLogic( (ALFA_B7R1U_OD & ALFA_B7R1L_OD) & BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1_OD').setLogic( (ALFA_A7R1U_OD & ALFA_A7R1L_OD) & BGRP0).setTriggerType(TT.alfa)
+        LVL1MenuItem('L1_ALFA_B7L1U_OD').setLogic(ALFA_B7L1U_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1L_OD').setLogic(ALFA_B7L1L_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1U_OD').setLogic(ALFA_A7L1U_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1L_OD').setLogic(ALFA_A7L1L_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1U_OD').setLogic(ALFA_A7R1U_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1L_OD').setLogic(ALFA_A7R1L_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1U_OD').setLogic(ALFA_B7R1U_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1L_OD').setLogic(ALFA_B7R1L_OD & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_B7L1_OD').setLogic( (ALFA_B7L1U_OD & ALFA_B7L1L_OD) & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1_OD').setLogic( (ALFA_A7L1U_OD & ALFA_A7L1L_OD) & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1_OD').setLogic( (ALFA_B7R1U_OD & ALFA_B7R1L_OD) & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1_OD').setLogic( (ALFA_A7R1U_OD & ALFA_A7R1L_OD) & BGRP0).setTriggerType(TT.alfa)    # noqa: F821
 
         #if (('Physics_HI_v3' not in TriggerFlags.triggerMenuSetup()) and ('MC_HI_v3' not in TriggerFlags.triggerMenuSetup())):
             # Topo items (keep them all together)
@@ -1360,173 +1387,173 @@ class ItemDef:
             try:
 
                     # M8 menu
-                    #LVL1MenuItem('L1_MJJ-4').setLogic( TOPO_4INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-3').setLogic( TOPO_3INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-2').setLogic( TOPO_2INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-1').setLogic( TOPO_1INVM9999_AJ0s6_AJ0s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-4').setLogic( TOPO_4INVM9999_AJ0s6_AJ0s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-3').setLogic( TOPO_3INVM9999_AJ0s6_AJ0s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-2').setLogic( TOPO_2INVM9999_AJ0s6_AJ0s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-1').setLogic( TOPO_1INVM9999_AJ0s6_AJ0s6 & physcond)    # noqa: F821
 
-                    #LVL1MenuItem('L1_HT200-J20s5.ETA49').setLogic( TOPO_HT200_AJ20s5ETA49 & physcond)
-                    #LVL1MenuItem('L1_HT190-J20s5.ETA49').setLogic( TOPO_HT190_AJ20s5ETA49 & physcond)
-                    #LVL1MenuItem('L1_HT1-J0.ETA49').setLogic( TOPO_HT1_AJ0allETA49 & physcond)
+                    #LVL1MenuItem('L1_HT200-J20s5.ETA49').setLogic( TOPO_HT200_AJ20s5ETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_HT190-J20s5.ETA49').setLogic( TOPO_HT190_AJ20s5ETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_HT1-J0.ETA49').setLogic( TOPO_HT1_AJ0allETA49 & physcond)    # noqa: F821
 
-                    # LVL1MenuItem('L1_JPSI-1M5-EM6').setLogic( TOPO_1INVM5_EM6s2_EMall & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EMs').setLogic( TOPO_1INVM5_EMs2_EMs & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EM6s').setLogic( TOPO_1INVM5_EM6s2_EMs & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EM12s').setLogic( TOPO_1INVM5_EM12s2_EMs & physcond)
+                    # LVL1MenuItem('L1_JPSI-1M5-EM6').setLogic( TOPO_1INVM5_EM6s2_EMall & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_JPSI-1M5-EMs').setLogic( TOPO_1INVM5_EMs2_EMs & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_JPSI-1M5-EM6s').setLogic( TOPO_1INVM5_EM6s2_EMs & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_JPSI-1M5-EM12s').setLogic( TOPO_1INVM5_EM12s2_EMs & physcond)    # noqa: F821
 
                     ### NOT WORKING due to acceptaed number of bits in TOPO1
-                    LVL1MenuItem("L1_2MU4-BO"     ).setLogic( TOPO_MULT_CMU4ab.x(2) & physcond)
-                    LVL1MenuItem("L1_2MU6-BO"     ).setLogic( TOPO_MULT_CMU6ab.x(2) & physcond)
-                    LVL1MenuItem("L1_MU6MU4-BO").setLogic( TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond)
+                    LVL1MenuItem("L1_2MU4-BO"     ).setLogic( TOPO_MULT_CMU4ab.x(2) & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_2MU6-BO"     ).setLogic( TOPO_MULT_CMU6ab.x(2) & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_MU6MU4-BO").setLogic( TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond)    # noqa: F821
 
                     # B-jet
-                    LVL1MenuItem('L1_BTAG-MU4J15').setLogic( TOPO_0DR04_MU4ab_CJ15ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU4J30').setLogic( TOPO_0DR04_MU4ab_CJ30ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU6J20').setLogic( TOPO_0DR04_MU6ab_CJ20ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU6J25').setLogic( TOPO_0DR04_MU6ab_CJ25ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU4J20').setLogic( TOPO_0DR04_MU4ab_CJ20ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU4J15').setLogic( J15.x(3) & TOPO_0DR04_MU4ab_CJ15ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU4J30').setLogic( J15.x(3) & TOPO_0DR04_MU4ab_CJ30ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU6J25').setLogic( J15.x(3) & TOPO_0DR04_MU6ab_CJ25ab & physcond)
-                    LVL1MenuItem('L1_3J20_BTAG-MU4J20').setLogic( J20.x(3) & TOPO_0DR04_MU4ab_CJ20ab & physcond)
-                    #LVL1MenuItem('L1_3J20_BTAG-MU4J30').setLogic( J20.x(3) & TOPO_0DR04_MU4ab_CJ30ab & physcond)
-                    #LVL1MenuItem('L1_3J20_BTAG-MU6J25').setLogic( J20.x(3) & TOPO_0DR04_MU6ab_CJ25ab & physcond)
+                    LVL1MenuItem('L1_BTAG-MU4J15').setLogic( TOPO_0DR04_MU4ab_CJ15ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BTAG-MU4J30').setLogic( TOPO_0DR04_MU4ab_CJ30ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BTAG-MU6J20').setLogic( TOPO_0DR04_MU6ab_CJ20ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BTAG-MU6J25').setLogic( TOPO_0DR04_MU6ab_CJ25ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BTAG-MU4J20').setLogic( TOPO_0DR04_MU4ab_CJ20ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J15_BTAG-MU4J15').setLogic( J15.x(3) & TOPO_0DR04_MU4ab_CJ15ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J15_BTAG-MU4J30').setLogic( J15.x(3) & TOPO_0DR04_MU4ab_CJ30ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J15_BTAG-MU6J25').setLogic( J15.x(3) & TOPO_0DR04_MU6ab_CJ25ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J20_BTAG-MU4J20').setLogic( J20.x(3) & TOPO_0DR04_MU4ab_CJ20ab & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_3J20_BTAG-MU4J30').setLogic( J20.x(3) & TOPO_0DR04_MU4ab_CJ30ab & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_3J20_BTAG-MU6J25').setLogic( J20.x(3) & TOPO_0DR04_MU6ab_CJ25ab & physcond)    # noqa: F821
 
                     # ZH
-                    LVL1MenuItem('L1_DPHI-AJ20s2XE50'  ).setLogic( TOPO_10MINDPHI_AJ20s2_XE50    & physcond)
+                    LVL1MenuItem('L1_DPHI-AJ20s2XE50'  ).setLogic( TOPO_10MINDPHI_AJ20s2_XE50    & physcond)    # noqa: F821
 
-                    #LVL1MenuItem('L1_J40_DPHI-Js2XE50'  ).setLogic( J40 & TOPO_10MINDPHI_Js2_XE50    & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20s2XE50').setLogic( J40 & TOPO_10MINDPHI_J20s2_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20s2XE30').setLogic( J40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_2MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & EM3.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_3EM3_J40_XE50_DPHI-J20s2XE50').setLogic( EM3.x(3) & J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50  & physcond)
+                    #LVL1MenuItem('L1_J40_DPHI-Js2XE50'  ).setLogic( J40 & TOPO_10MINDPHI_Js2_XE50    & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J40_DPHI-J20s2XE50').setLogic( J40 & TOPO_10MINDPHI_J20s2_XE50  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J40_DPHI-J20s2XE30').setLogic( J40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_2MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & EM3.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3EM3_J40_XE50_DPHI-J20s2XE50').setLogic( EM3.x(3) & J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50  & physcond)    # noqa: F821
 
 
-                    LVL1MenuItem('L1_J40_XE50_DPHI-J20s2XE50').setLogic( J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20XE50'  ).setLogic( J40 & TOPO_10MINDPHI_J20ab_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-CJ20XE50' ).setLogic( J40 & TOPO_10MINDPHI_CJ20ab_XE50 & physcond) 
+                    LVL1MenuItem('L1_J40_XE50_DPHI-J20s2XE50').setLogic( J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J40_DPHI-J20XE50'  ).setLogic( J40 & TOPO_10MINDPHI_J20ab_XE50  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J40_DPHI-CJ20XE50' ).setLogic( J40 & TOPO_10MINDPHI_CJ20ab_XE50 & physcond)    # noqa: F821
 
                     #ATR-15243 Higgsino
-                    LVL1MenuItem('L1_2MU4_J40_XE50'  ).setLogic( MU4.x(2) & J40 & XE50  & physcond).setTriggerType(TT.calo)
-                    LVL1MenuItem('L1_2MU4_J20_XE40_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_2MU4_J20_XE50_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE50 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
+                    LVL1MenuItem('L1_2MU4_J40_XE50'  ).setLogic( MU4.x(2) & J40 & XE50  & physcond).setTriggerType(TT.calo)    # noqa: F821
+                    LVL1MenuItem('L1_2MU4_J20_XE40_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_2MU4_J20_XE50_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE50 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_MU4_J30_XE40_DPHI-J20s2XE30').setLogic( MU4 & J30 & XE40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_J50_XE50_DPHI-J20s2XE30').setLogic( MU4 & J50 & XE50 & TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_XE60'  ).setLogic( MU4 & XE60  & physcond).setTriggerType(TT.calo)
-                    LVL1MenuItem('L1_2MU4_XE60'  ).setLogic( MU4.x(2) & XE60  & physcond).setTriggerType(TT.calo)
+                    LVL1MenuItem('L1_MU4_J30_XE40_DPHI-J20s2XE30').setLogic( MU4 & J30 & XE40 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU4_J50_XE50_DPHI-J20s2XE30').setLogic( MU4 & J50 & XE50 & TOPO_10MINDPHI_J20s2_XE30  & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU4_XE60'  ).setLogic( MU4 & XE60  & physcond).setTriggerType(TT.calo)          # noqa: F821
+                    LVL1MenuItem('L1_2MU4_XE60'  ).setLogic( MU4.x(2) & XE60  & physcond).setTriggerType(TT.calo)    # noqa: F821
 
                     # HT
-                    #LVL1MenuItem('L1_HT0-J0.ETA49'     ).setLogic( TOPO_HT0_AJ0allETA49    & physcond)
-                    LVL1MenuItem('L1_HT190-J15.ETA21'  ).setLogic( TOPO_HT190_AJ15allETA21 & physcond)
-                    LVL1MenuItem('L1_HT190-J15s5.ETA21').setLogic( TOPO_HT190_J15s5ETA21   & physcond)
-                    LVL1MenuItem('L1_HT150-J20.ETA31'  ).setLogic( TOPO_HT150_AJ20allETA31 & physcond)
-                    LVL1MenuItem('L1_HT150-J20s5.ETA31').setLogic( TOPO_HT150_J20s5ETA31   & physcond)
+                    #LVL1MenuItem('L1_HT0-J0.ETA49'     ).setLogic( TOPO_HT0_AJ0allETA49    & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT190-J15.ETA21'  ).setLogic( TOPO_HT190_AJ15allETA21 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT190-J15s5.ETA21').setLogic( TOPO_HT190_J15s5ETA21   & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT150-J20.ETA31'  ).setLogic( TOPO_HT150_AJ20allETA31 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT150-J20s5.ETA31').setLogic( TOPO_HT150_J20s5ETA31   & physcond)    # noqa: F821
 
 
-                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400').setLogic( TOPO_HT150_J20s5ETA31 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)# new
-                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400-CF').setLogic( TOPO_HT150_J20s5ETA31 & TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond) #new 
+                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400').setLogic( TOPO_HT150_J20s5ETA31 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)                    # noqa: F821
+                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400-CF').setLogic( TOPO_HT150_J20s5ETA31 & TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond)     # noqa: F821
                     # Jpsi T&P
-                    LVL1MenuItem("L1_JPSI-1M5"     ).setLogic( TOPO_1INVM5_EMs1_EMs6   & physcond)
-                    LVL1MenuItem("L1_JPSI-1M5-EM7" ).setLogic( TOPO_1INVM5_EM7s1_EMs6  & physcond)
-                    LVL1MenuItem("L1_JPSI-1M5-EM12").setLogic( TOPO_1INVM5_EM12s1_EMs6 & physcond)
+                    LVL1MenuItem("L1_JPSI-1M5"     ).setLogic( TOPO_1INVM5_EMs1_EMs6   & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_JPSI-1M5-EM7" ).setLogic( TOPO_1INVM5_EM7s1_EMs6  & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_JPSI-1M5-EM12").setLogic( TOPO_1INVM5_EM12s1_EMs6 & physcond)    # noqa: F821
 
                     # # W T&P
                     # if not '_v6' in TriggerFlags.triggerMenuSetup():
-                    #     LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( TOPO_05MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( TOPO_10MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( TOPO_15MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-10DPHI-EMXE-0"  ).setLogic( TOPO_10MINDPHI_EM10s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( TOPO_15MINDPHI_EM10s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( TOPO_05MINDPHI_EM15s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    #     LVL1MenuItem("L1_W-08RO-XEHT-0"    ).setLogic( TOPO_08RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    #     LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
-                    #     LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( TOPO_HT20_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25").setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT30").setLogic( TOPO_30MT_EM10s6_XE0 & EM10 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS30 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS20 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60"           ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS60 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30"           ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE"                ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)
+                    #     LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( TOPO_05MINDPHI_AJj20s6_XE0 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( TOPO_10MINDPHI_AJj20s6_XE0 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( TOPO_15MINDPHI_AJj20s6_XE0 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-10DPHI-EMXE-0"  ).setLogic( TOPO_10MINDPHI_EM10s6_XE0  & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( TOPO_15MINDPHI_EM10s6_XE0  & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( TOPO_05MINDPHI_EM15s6_XE0  & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-08RO-XEHT-0"    ).setLogic( TOPO_08RATIO_XE0_HT0_AJj15allETA49   & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( TOPO_HT20_AJj15allETA49 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT25").setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT30").setLogic( TOPO_30MT_EM10s6_XE0 & EM10 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS30 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS20 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60"           ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS60 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30"           ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond)    # noqa: F821
+                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE"                ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
                     #else:
-                    LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( TOPO_05MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( TOPO_10MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( TOPO_15MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( TOPO_05MINDPHI_EM12s6_XE0  & physcond)
-
-                    LVL1MenuItem("L1_W-05DPHI-EM15XE-1"  ).setLogic( TOPO_05MINDPHI_EM15s6_XE0  & physcond)
-
-                    LVL1MenuItem("L1_W-15DPHI-EM15XE-1"  ).setLogic( TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EMXE-1"  ).setLogic( TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-                    LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
-                    LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( TOPO_HT20_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & TOPO_05RATIO_XE0_SUM0_EM10s1_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25").setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & physcond)
-                    #LVL1MenuItem("L1_EM12_W-MT30").setLogic( TOPO_30MT_EM12s6_XE0 & EM12 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond)
-
-                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS40 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & physcond)
-
-                    LVL1MenuItem("L1_EM15VH_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM15VH & XS60 & physcond)
-                    LVL1MenuItem("L1_EM20VH_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM20VH & XS60 & physcond)
-                    LVL1MenuItem("L1_EM22VHI_W-MT35_XS40").setLogic( TOPO_35MT_EM15s6_XE0 & EM22VHI & XS40 & physcond)
+                    LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( TOPO_05MINDPHI_AJj10s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( TOPO_10MINDPHI_AJj10s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( TOPO_15MINDPHI_AJj10s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( TOPO_05MINDPHI_EM12s6_XE0  & physcond)    # noqa: F821
+
+                    LVL1MenuItem("L1_W-05DPHI-EM15XE-1"  ).setLogic( TOPO_05MINDPHI_EM15s6_XE0  & physcond)  # noqa: F821
+
+                    LVL1MenuItem("L1_W-15DPHI-EM15XE-1"  ).setLogic( TOPO_15MINDPHI_EM15s6_XE0  & physcond)  # noqa: F821
+                    LVL1MenuItem("L1_W-15DPHI-EMXE-1"  ).setLogic( TOPO_15MINDPHI_EM12s6_XE0  & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( TOPO_HT20_AJj15allETA49 & physcond)                 # noqa: F821
+                    LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)   # noqa: F821
+                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & TOPO_05RATIO_XE0_SUM0_EM10s1_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT25").setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_EM12_W-MT30").setLogic( TOPO_30MT_EM12s6_XE0 & EM12 & physcond)   # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond)    # noqa: F821
+
+                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS40 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & physcond)    # noqa: F821
+
+                    LVL1MenuItem("L1_EM15VH_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM15VH & XS60 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM20VH_W-MT35_XS60").setLogic( TOPO_35MT_EM15s6_XE0 & EM20VH & XS60 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM22VHI_W-MT35_XS40").setLogic( TOPO_35MT_EM15s6_XE0 & EM22VHI & XS40 & physcond)  # noqa: F821
 
 
                     
-                    LVL1MenuItem("L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE"            ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS40 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35").setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & physcond)                    
-                    LVL1MenuItem("L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_XS50").setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS50 & physcond)
-                    LVL1MenuItem("L1_EM10VH_W-MT35_XS50").setLogic( TOPO_35MT_EM12s6_XE0 & EM10VH & XS50 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EM15XE-0"  ).setLogic( TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS40 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE"            ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS30 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE"  ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)
+                    LVL1MenuItem("L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE"            ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS40 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM12s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT35").setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & physcond)      # noqa: F821   
+                    LVL1MenuItem("L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM12s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT35_XS50").setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS50 & physcond)        # noqa: F821
+                    LVL1MenuItem("L1_EM10VH_W-MT35_XS50").setLogic( TOPO_35MT_EM12s6_XE0 & EM10VH & XS50 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-15DPHI-EM15XE-0"  ).setLogic( TOPO_15MINDPHI_EM15s6_XE0  & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS60 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & XS40 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM15s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( TOPO_15MINDPHI_EM12s6_XE0  & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE"            ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & XS30 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE"  ).setLogic( TOPO_35MT_EM12s6_XE0 & EM12 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)    # noqa: F821
                     # Old
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0"   ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & XS30 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & XS20 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-
-
-                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30"         ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE"              ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-
-                    #LVL1MenuItem("L1_W-10DPHI-JXE-0").setLogic( TOPO_10MINDPHI_AJj15s2_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-JXE-1").setLogic( TOPO_20MINDPHI_AJjs6_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-JXE-0").setLogic( TOPO_20MINDPHI_AJj15s2_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-10DPHI-EMXE-0").setLogic( TOPO_10MINDPHI_EM6s1_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-EMXE-1").setLogic( TOPO_20MINDPHI_EM9s6_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-EMXE-0").setLogic( TOPO_20MINDPHI_EM6s1_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-05RO-XEHT-0").setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-08RO-XEHT-1").setLogic( TOPO_08RATIO_XE0_HT0_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-40RO2-XEHT-0").setLogic( TOPO_40RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-90RO2-XEHT-1").setLogic( TOPO_90RATIO2_XE0_HT0_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-HT20-JJ0.ETA49").setLogic( TOPO_HT20_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & TOPO_05RATIO_XE0_SUM0_EM9s1_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT20").setLogic( TOPO_20MT_EM6s6_XE0 & EM3 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT30").setLogic( TOPO_30MT_EM6s6_XE0 & EM3 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT40").setLogic( TOPO_40MT_EM6s6_XE0 & EM3 & physcond)
+                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0"   ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & XS30 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & XS20 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & TOPO_15MINDPHI_AJj10s6_XE0 & TOPO_15MINDPHI_EM12s6_XE0 & physcond)           # noqa: F821
+
+
+                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30"         ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond)    # noqa: F821
+                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE"              ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond)           # noqa: F821
+
+                    #LVL1MenuItem("L1_W-10DPHI-JXE-0").setLogic( TOPO_10MINDPHI_AJj15s2_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-20DPHI-JXE-1").setLogic( TOPO_20MINDPHI_AJjs6_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-20DPHI-JXE-0").setLogic( TOPO_20MINDPHI_AJj15s2_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-10DPHI-EMXE-0").setLogic( TOPO_10MINDPHI_EM6s1_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-20DPHI-EMXE-1").setLogic( TOPO_20MINDPHI_EM9s6_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-20DPHI-EMXE-0").setLogic( TOPO_20MINDPHI_EM6s1_XE0 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-05RO-XEHT-0").setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-08RO-XEHT-1").setLogic( TOPO_08RATIO_XE0_HT0_AJj0allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-40RO2-XEHT-0").setLogic( TOPO_40RATIO2_XE0_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-90RO2-XEHT-1").setLogic( TOPO_90RATIO2_XE0_HT0_AJj0allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-HT20-JJ0.ETA49").setLogic( TOPO_HT20_AJj0allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-NOMATCH").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & TOPO_05RATIO_XE0_SUM0_EM9s1_HT0_AJj15allETA49 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_EM3_W-MT20").setLogic( TOPO_20MT_EM6s6_XE0 & EM3 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_EM3_W-MT30").setLogic( TOPO_30MT_EM6s6_XE0 & EM3 & physcond)    # noqa: F821
+                    #LVL1MenuItem("L1_EM3_W-MT40").setLogic( TOPO_40MT_EM6s6_XE0 & EM3 & physcond)    # noqa: F821
 
                     # Bphysics triggers
     #                 if not '_v6' in TriggerFlags.triggerMenuSetup():
@@ -1543,188 +1570,190 @@ class ItemDef:
     #                     LVL1MenuItem("L1_BPH-DR-2MU6_BPH-4M8-2MU6").setLogic( TOPO_2DR15_2MU6ab & TOPO_4INVM8_2MU6ab & physcond)            
 
                     ##Combined L1Top 
-                    LVL1MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( TOPO_0DR28_MU10ab_TAU12abi &  TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_MU10_TAU12I-J25').setLogic( MU10 &  TOPO_1DISAMB_TAU12abi_J25ab & physcond)
+                    LVL1MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( TOPO_0DR28_MU10ab_TAU12abi &  TOPO_1DISAMB_TAU12abi_J25ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU10_TAU12I-J25').setLogic( MU10 &  TOPO_1DISAMB_TAU12abi_J25ab & physcond)    # noqa: F821
                     #LVL1MenuItem('L1_XE35_EM15-TAU12I').setLogic( XE35 &  TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
                     #LVL1MenuItem('L1_XE40_EM15-TAU12I').setLogic( XE40 &  TOPO_DISAMB_EM15abhi_TAU12abiOB & physcond)  
-                    #LVL1MenuItem('L1_XE45_TAU20-J20').setLogic( XE45 & TOPO_1DISAMB_TAU20ab_J20ab & physcond)
-                    LVL1MenuItem('L1_J25_2J20_3J12_DR-TAU20ITAU12I').setLogic( J25 & J20.x(2) & J12.x(3) &  TOPO_0DR28_TAU20abi_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_XE45_TAU20-J20').setLogic( XE45 & TOPO_1DISAMB_TAU20ab_J20ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J25_2J20_3J12_DR-TAU20ITAU12I').setLogic( J25 & J20.x(2) & J12.x(3) &  TOPO_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
                     #LVL1MenuItem('L1_J25_3J12_EM15-TAU12I').setLogic( J25 & J12.x(3) &  TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
-                    LVL1MenuItem('L1_J25_2J12_DR-MU10TAU12I').setLogic( J25 & J12.x(2) &  TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    LVL1MenuItem('L1_J25_2J20_3J12_BOX-TAU20ITAU12I').setLogic( J25 & J20.x(2) & J12.x(3) & TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
+                    LVL1MenuItem('L1_J25_2J12_DR-MU10TAU12I').setLogic( J25 & J12.x(2) &  TOPO_0DR28_MU10ab_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J25_2J20_3J12_BOX-TAU20ITAU12I').setLogic( J25 & J20.x(2) & J12.x(3) & TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_MU6_MJJ-200').setLogic( MU6 & TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-300').setLogic( MU6 & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-400').setLogic( MU6 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-500').setLogic( MU6 & TOPO_500INVM9999_AJ30s6_AJ20s6 & physcond) 
+                    LVL1MenuItem('L1_MU6_MJJ-200').setLogic( MU6 & TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU6_MJJ-300').setLogic( MU6 & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU6_MJJ-400').setLogic( MU6 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MU6_MJJ-500').setLogic( MU6 & TOPO_500INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-400').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-700').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-800').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-900').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
+                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-400').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-700').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-800').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-900').setLogic( J30 & J20.x(2) & J200ETA49.x(4) & TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-400').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-700').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-800').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-900').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
+                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-400').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-700').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-800').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-900').setLogic( J20.x(3) & J200ETA49.x(4) & TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_XE35_MJJ-200').setLogic( XE35 & TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
+                    LVL1MenuItem('L1_XE35_MJJ-200').setLogic( XE35 & TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
                     
                     ### ATR-15062
                     if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup():
-                       LVL1MenuItem('L1_EM18VHI_MJJ-300').setLogic( EM18VHI & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
+                       LVL1MenuItem('L1_EM18VHI_MJJ-300').setLogic( EM18VHI & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
                     else:
-                       LVL1MenuItem('L1_EM18VH_MJJ-300').setLogic( EM18VH & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
+                       LVL1MenuItem('L1_EM18VH_MJJ-300').setLogic( EM18VH & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
                     # CTP items for L1Topo streamers
-                    #LVL1MenuItem('L1_DPhi_AJsAJs').setLogic( TOPO_DPhi_AJsAJs & physcond)
-                    #LVL1MenuItem('L1_DPhi_EMsTAUs').setLogic( TOPO_DPhi_EMsTAUs & physcond)
-                    #LVL1MenuItem('L1_DEta_AJabAJab').setLogic( TOPO_DEta_AJabAJab & physcond)
-                    #LVL1MenuItem('L1_DEta_EMabTAUab').setLogic( TOPO_DEta_EMabTAUab & physcond)
+                    #LVL1MenuItem('L1_DPhi_AJsAJs').setLogic( TOPO_DPhi_AJsAJs & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_DPhi_EMsTAUs').setLogic( TOPO_DPhi_EMsTAUs & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_DEta_AJabAJab').setLogic( TOPO_DEta_AJabAJab & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_DEta_EMabTAUab').setLogic( TOPO_DEta_EMabTAUab & physcond)    # noqa: F821
     #                 if not '_v6' in TriggerFlags.triggerMenuSetup():
     # #SX
-    #                     LVL1MenuItem('L1_BPH-2M-2MU4-B').setLogic( TOPO_2INVM999_CMU4ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-2MU4-BO').setLogic( TOPO_2INVM999_2CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4').setLogic( TOPO_2INVM999_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-B').setLogic( TOPO_2INVM999_ONEBARREL_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-BO').setLogic( TOPO_2INVM999_CMU6ab_CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-B').setLogic( TOPO_4INVM8_CMU4ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-BO').setLogic( TOPO_4INVM8_2CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4').setLogic( TOPO_4INVM8_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-B').setLogic( TOPO_4INVM8_ONEBARREL_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-BO').setLogic( TOPO_4INVM8_CMU6ab_CMU4ab & physcond)
-
-                    LVL1MenuItem('L1_DY-DR-2MU4').setLogic( TOPO_2DR99_2MU4ab & physcond)
-                    LVL1MenuItem('L1_DY-BOX-MU6MU4').setLogic( TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & physcond)
-                    LVL1MenuItem('L1_DY-BOX-2MU6').setLogic( TOPO_5DETA99_5DPHI99_2MU6ab & physcond)
+    #                     LVL1MenuItem('L1_BPH-2M-2MU4-B').setLogic( TOPO_2INVM999_CMU4ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-2M-2MU4-BO').setLogic( TOPO_2INVM999_2CMU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4').setLogic( TOPO_2INVM999_MU6ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-B').setLogic( TOPO_2INVM999_ONEBARREL_MU6ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-BO').setLogic( TOPO_2INVM999_CMU6ab_CMU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-B').setLogic( TOPO_4INVM8_CMU4ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-BO').setLogic( TOPO_4INVM8_2CMU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4').setLogic( TOPO_4INVM8_MU6ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-B').setLogic( TOPO_4INVM8_ONEBARREL_MU6ab_MU4ab & physcond)    # noqa: F821
+    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-BO').setLogic( TOPO_4INVM8_CMU6ab_CMU4ab & physcond)    # noqa: F821
+
+                    LVL1MenuItem('L1_DY-DR-2MU4').setLogic( TOPO_2DR99_2MU4ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DY-BOX-MU6MU4').setLogic( TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DY-BOX-2MU6').setLogic( TOPO_5DETA99_5DPHI99_2MU6ab & physcond)    # noqa: F821
      
-                    LVL1MenuItem('L1_LFV-MU6').setLogic( TOPO_0DR15_2MU6ab & physcond)
-                    LVL1MenuItem('L1_LFV-MU').setLogic( TOPO_0DR10_MU10ab_MU6ab & physcond)
-                    if not '_v7' in TriggerFlags.triggerMenuSetup():
-                        LVL1MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_0DPHI03_EM8abi_MU10ab & physcond)
+                    LVL1MenuItem('L1_LFV-MU6').setLogic( TOPO_0DR15_2MU6ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_LFV-MU').setLogic( TOPO_0DR10_MU10ab_MU6ab & physcond)    # noqa: F821
+                    if not '_v7' in TriggerFlags.triggerMenuSetup() and not '_PhaseII' in TriggerFlags.triggerMenuSetup():
+                        LVL1MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_0DPHI03_EM8abi_MU10ab & physcond)    # noqa: F821
                     else:
-                        LVL1MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_EM8abi_MU10ab & TOPO_0DPHI03_EM8abi_MU10ab & physcond) #ATR-14282
-                    if not '_v7' in TriggerFlags.triggerMenuSetup():
-                        LVL1MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_0DPHI03_EM15abi_MUab & physcond)
+                        LVL1MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_EM8abi_MU10ab & TOPO_0DPHI03_EM8abi_MU10ab & physcond) #ATR-14282     # noqa: F821
+                    if not '_v7' in TriggerFlags.triggerMenuSetup() and not '_PhaseII' in TriggerFlags.triggerMenuSetup():
+                        LVL1MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_0DPHI03_EM15abi_MUab & physcond)    # noqa: F821
                     else:
-                        LVL1MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_EM15abi_MUab & TOPO_0DPHI03_EM15abi_MUab & physcond) #ATR-14282
-                    LVL1MenuItem('L1_DPHI-J20s2XE50').setLogic( TOPO_10MINDPHI_J20s2_XE50 & physcond)
-                    LVL1MenuItem('L1_DPHI-J20XE50').setLogic( TOPO_10MINDPHI_J20ab_XE50 & physcond)
-                    LVL1MenuItem('L1_DPHI-CJ20XE50').setLogic( TOPO_10MINDPHI_CJ20ab_XE50 & physcond)
-
-                    LVL1MenuItem('L1_MJJ-900').setLogic( TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-800').setLogic( TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-700').setLogic( TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-400').setLogic( TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-350').setLogic( TOPO_350INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-300').setLogic( TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-200').setLogic( TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-100').setLogic( TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond)
-
-                    #LVL1MenuItem('L1_MJJ-350-0').setLogic( TOPO_350INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-300-0').setLogic( TOPO_300INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-250-0').setLogic( TOPO_250INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-200-0').setLogic( TOPO_200INVM9999_J30s6_J20s6 & physcond)
-                    LVL1MenuItem('L1_HT150-JJ15.ETA49').setLogic( TOPO_HT150_AJj15allETA49 & physcond)
-                    LVL1MenuItem('L1_HT150-JJ15.ETA49_MJJ-400').setLogic( TOPO_HT150_AJj15allETA49 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
+                        LVL1MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_EM15abi_MUab & TOPO_0DPHI03_EM15abi_MUab & physcond) #ATR-14282       # noqa: F821
+                    LVL1MenuItem('L1_DPHI-J20s2XE50').setLogic( TOPO_10MINDPHI_J20s2_XE50 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DPHI-J20XE50').setLogic( TOPO_10MINDPHI_J20ab_XE50 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DPHI-CJ20XE50').setLogic( TOPO_10MINDPHI_CJ20ab_XE50 & physcond)    # noqa: F821
+
+                    LVL1MenuItem('L1_MJJ-900').setLogic( TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-800').setLogic( TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-700').setLogic( TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-400').setLogic( TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-350').setLogic( TOPO_350INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-300').setLogic( TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-200').setLogic( TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-100').setLogic( TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+
+                    #LVL1MenuItem('L1_MJJ-350-0').setLogic( TOPO_350INVM9999_J30s6_J20s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-300-0').setLogic( TOPO_300INVM9999_J30s6_J20s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-250-0').setLogic( TOPO_250INVM9999_J30s6_J20s6 & physcond)    # noqa: F821
+                    #LVL1MenuItem('L1_MJJ-200-0').setLogic( TOPO_200INVM9999_J30s6_J20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT150-JJ15.ETA49').setLogic( TOPO_HT150_AJj15allETA49 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_HT150-JJ15.ETA49_MJJ-400').setLogic( TOPO_HT150_AJj15allETA49 & TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
 
                     
-                    LVL1MenuItem('L1_J4-MATCH').setLogic( TOPO_0MATCH_4AJ20ETA31_4AJj15ETA31 & physcond)
+                    LVL1MenuItem('L1_J4-MATCH').setLogic( TOPO_0MATCH_4AJ20ETA31_4AJj15ETA31 & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_LLP-RO').setLogic( TOPO_100RATIO_0MATCH_TAU30si2_EMall & physcond)
+                    LVL1MenuItem('L1_LLP-RO').setLogic( TOPO_100RATIO_0MATCH_TAU30si2_EMall & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_LLP-NOMATCH').setLogic( TOPO_NOT_0MATCH_TAU30si2_EMall & physcond)
-                    LVL1MenuItem('L1_DR-MU10TAU12I').setLogic( TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    LVL1MenuItem('L1_TAU12I-J25').setLogic( TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_EM15TAU12I-J25').setLogic( TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond)
+                    LVL1MenuItem('L1_LLP-NOMATCH').setLogic( TOPO_NOT_0MATCH_TAU30si2_EMall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR-MU10TAU12I').setLogic( TOPO_0DR28_MU10ab_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_TAU12I-J25').setLogic( TOPO_1DISAMB_TAU12abi_J25ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_EM15TAU12I-J25').setLogic( TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_DR-EM15TAU12I').setLogic( TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond)
-                    LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)
-                    LVL1MenuItem('L1_TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_DR25-TAU20ITAU12I').setLogic( TOPO_0DR25_TAU20abi_TAU12abi & physcond)
+                    LVL1MenuItem('L1_DR-EM15TAU12I').setLogic( TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR25-TAU20ITAU12I').setLogic( TOPO_0DR25_TAU20abi_TAU12abi & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_30M-EM20ITAU12').setLogic( TOPO_DISAMB_30INVM_EM20his2_TAU12ab & physcond)
-                    LVL1MenuItem('L1_MJJ-400-CF').setLogic( TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond)
-                    LVL1MenuItem('L1_DR-TAU20ITAU12I').setLogic( TOPO_0DR28_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_BOX-TAU20ITAU12I').setLogic( TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond)
+                    LVL1MenuItem('L1_30M-EM20ITAU12').setLogic( TOPO_DISAMB_30INVM_EM20his2_TAU12ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-400-CF').setLogic( TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR-TAU20ITAU12I').setLogic( TOPO_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BOX-TAU20ITAU12I').setLogic( TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_LAR-EM').setLogic( TOPO_LAR_EM50s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897)
-                    LVL1MenuItem('L1_LAR-J').setLogic( TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo )  # LAr demo (ATR-11897)
+                    LVL1MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_LAR-EM').setLogic( TOPO_LAR_EM50s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897)     # noqa: F821
+                    LVL1MenuItem('L1_LAR-J').setLogic( TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo )  # LAr demo (ATR-11897)     # noqa: F821
                     # if not '_v6' in TriggerFlags.triggerMenuSetup():
-                    #     LVL1MenuItem('L1_BPH-DR-2MU4-B').setLogic( TOPO_2DR15_CMU4ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-2MU4-BO').setLogic( TOPO_2DR15_2CMU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4').setLogic( TOPO_2DR15_MU6ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-B').setLogic( TOPO_2DR15_ONEBARREL_MU6ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-BO').setLogic( TOPO_2DR15_CMU6ab_CMU4ab & physcond)
+                    #     LVL1MenuItem('L1_BPH-DR-2MU4-B').setLogic( TOPO_2DR15_CMU4ab_MU4ab & physcond)    # noqa: F821
+                    #     LVL1MenuItem('L1_BPH-DR-2MU4-BO').setLogic( TOPO_2DR15_2CMU4ab & physcond)    # noqa: F821
+                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4').setLogic( TOPO_2DR15_MU6ab_MU4ab & physcond)    # noqa: F821
+                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-B').setLogic( TOPO_2DR15_ONEBARREL_MU6ab_MU4ab & physcond)    # noqa: F821
+                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-BO').setLogic( TOPO_2DR15_CMU6ab_CMU4ab & physcond)    # noqa: F821
                     #     LVL1MenuItem("L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B").setLogic( TOPO_2DR15_CMU4ab_MU4ab & TOPO_2INVM999_CMU4ab_MU4ab & physcond)            
                     #     LVL1MenuItem("L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B").setLogic( TOPO_2DR15_CMU4ab_MU4ab & TOPO_4INVM8_CMU4ab_MU4ab & physcond)            
                     #     LVL1MenuItem("L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO").setLogic( TOPO_2DR15_2CMU4ab & TOPO_2INVM999_2CMU4ab & physcond)            
                     #     LVL1MenuItem("L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO").setLogic( TOPO_2DR15_2CMU4ab & TOPO_4INVM8_2CMU4ab & physcond)     
                         
-                    LVL1MenuItem('L1_KF-XE40').setLogic( TOPO_KF_XE40_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE50').setLogic( TOPO_KF_XE50_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE55').setLogic( TOPO_KF_XE55_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE60').setLogic( TOPO_KF_XE60_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE65').setLogic( TOPO_KF_XE65_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE75').setLogic( TOPO_KF_XE75_AJall & physcond)
+                    LVL1MenuItem('L1_KF-XE40').setLogic( TOPO_KF_XE40_AJall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_KF-XE50').setLogic( TOPO_KF_XE50_AJall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_KF-XE55').setLogic( TOPO_KF_XE55_AJall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_KF-XE60').setLogic( TOPO_KF_XE60_AJall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_KF-XE65').setLogic( TOPO_KF_XE65_AJall & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_KF-XE75').setLogic( TOPO_KF_XE75_AJall & physcond)    # noqa: F821
     #SX ATR-12789
 
                    # if  '_v6' in TriggerFlags.triggerMenuSetup():
     # nominal L1-topo items
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4_BPH-0DR34-2MU4'    ).setLogic( TOPO_1INVM19_2MU4ab & TOPO_0DR34_2MU4ab & physcond)           # 50% for Bs,J/psi,Upsi
+                    #LVL1MenuItem('L1_BPH-1M19-2MU4_BPH-0DR34-2MU4'    ).setLogic( TOPO_1INVM19_2MU4ab & TOPO_0DR34_2MU4ab & physcond)           # 50% for Bs,J/psi,Upsi     # noqa: F821
              
-                    LVL1MenuItem('L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM8_2MU4ab & TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM9_2MU4ab & TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi
-                    LVL1MenuItem('L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM8_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM9_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)
+                    LVL1MenuItem('L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM8_2MU4ab & TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi    # noqa: F821
+                    LVL1MenuItem('L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM9_2MU4ab & TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi    # noqa: F821
+                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi        # noqa: F821
+                    LVL1MenuItem('L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM8_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi    # noqa: F821
+                    LVL1MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM9_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)    # noqa: F821
   
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & physcond) # 86% for Upsi
-                    LVL1MenuItem('L1_BPH-2M9-2MU6_BPH-2DR15-2MU6'     ).setLogic( TOPO_2INVM9_2MU6ab & TOPO_2DR15_2MU6ab & physcond)            # 96% for Bs,J/psi
+                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & physcond) # 86% for Upsi        # noqa: F821
+                    LVL1MenuItem('L1_BPH-2M9-2MU6_BPH-2DR15-2MU6'     ).setLogic( TOPO_2INVM9_2MU6ab & TOPO_2DR15_2MU6ab & physcond)            # 96% for Bs,J/psi    # noqa: F821
      
-                    LVL1MenuItem('L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'    ).setLogic( TOPO_8INVM15_2MU6ab & TOPO_0DR22_2MU6ab & physcond)           # 96% for Upsi
+                    LVL1MenuItem('L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'    ).setLogic( TOPO_8INVM15_2MU6ab & TOPO_0DR22_2MU6ab & physcond)           # 96% for Upsi        # noqa: F821
 
 # Barrel and BarrelOnly items w/o topo selection
-#                    LVL1MenuItem('L1_CMU6_2CMU4').setLogic( TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond) # MU6_2MU4_BarrelOnly
-                    LVL1MenuItem('L1_2MU4-B'    ).setLogic( MU4.x(2) & TOPO_MULT_CMU4ab & physcond)              # 2MU4_Barrel
-                    LVL1MenuItem('L1_2MU6-B'    ).setLogic( MU6.x(2) & TOPO_MULT_CMU6ab & physcond)              # 2MU6_Barrel
-                    LVL1MenuItem('L1_MU6_2MU4-B').setLogic( MU6 & MU4.x(2) & TOPO_MULT_CMU4ab & physcond)        # MU6_2MU4_Barrel,     already in the menu
+#                    LVL1MenuItem('L1_CMU6_2CMU4').setLogic( TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond) # MU6_2MU4_BarrelOnly     # noqa: F821
+                    LVL1MenuItem('L1_2MU4-B'    ).setLogic( MU4.x(2) & TOPO_MULT_CMU4ab & physcond)              # 2MU4_Barrel              # noqa: F821
+                    LVL1MenuItem('L1_2MU6-B'    ).setLogic( MU6.x(2) & TOPO_MULT_CMU6ab & physcond)              # 2MU6_Barrel              # noqa: F821
+                    LVL1MenuItem('L1_MU6_2MU4-B').setLogic( MU6 & MU4.x(2) & TOPO_MULT_CMU4ab & physcond)        # MU6_2MU4_Barrel,         # noqa: F821
 
 # Barrel and BarrelOnly variants of L1Topo items
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'    ).setLogic( TOPO_1INVM19_CMU4ab_MU4ab & TOPO_0DR34_2MU4ab & physcond)               # 50% for Bs,J/psi,Upsi + OneBarrel
+                    #LVL1MenuItem('L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'    ).setLogic( TOPO_1INVM19_CMU4ab_MU4ab & TOPO_0DR34_2MU4ab & physcond)               # 50% for Bs,J/psi,Upsi + OneBarrel     # noqa: F821
 
-                    LVL1MenuItem('L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM8_CMU4ab_MU4ab & TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel
+                    LVL1MenuItem('L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'     ).setLogic( TOPO_2INVM8_CMU4ab_MU4ab & TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel           # noqa: F821
 
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2MU4ab & TOPO_MULT_CMU4ab & physcond) # 78% for Upsi + OneBarrel 
-#                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_CMU4ab_MU4ab & physcond)               # 78% for Upsi + OneBarrel
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   ).setLogic( TOPO_1INVM19_2CMU4ab & TOPO_0DR34_2MU4ab & physcond)                    # 50% for Bs,J/psi,Upsi + BarrelOnly
+                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2MU4ab & TOPO_MULT_CMU4ab & physcond) # 78% for Upsi + OneBarrel                # noqa: F821
+#                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_CMU4ab_MU4ab & physcond)               # 78% for Upsi + OneBarrel              # noqa: F821
+                    #LVL1MenuItem('L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   ).setLogic( TOPO_1INVM19_2CMU4ab & TOPO_0DR34_2MU4ab & physcond)                    # 50% for Bs,J/psi,Upsi + BarrelOnly    # noqa: F821
 
-                        #LVL1MenuItem('L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'    ).setLogic( TOPO_2INVM8_2CMU4ab & TOPO_0DR15_2MU4ab & physcond)                     # 78% for Bs,J/psi + BarrelOnly
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'   ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly
-                    LVL1MenuItem('L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi + OneBarrel
+                        #LVL1MenuItem('L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'    ).setLogic( TOPO_2INVM8_2CMU4ab & TOPO_0DR15_2MU4ab & physcond)                     # 78% for Bs,J/psi + BarrelOnly     # noqa: F821
+                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'   ).setLogic( TOPO_7INVM15_2MU4ab & TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly              # noqa: F821
+                    LVL1MenuItem('L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' ).setLogic( TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi + OneBarrel           # noqa: F821
 
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & TOPO_MULT_CMU4ab & physcond)
+                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & TOPO_MULT_CMU4ab & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond)
+                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO').setLogic( TOPO_8INVM15_MU6ab_MU4ab & TOPO_0DR22_MU6ab_MU4ab & TOPO_MULT_CMU4ab.x(2) & TOPO_MULT_CMU6ab & physcond)    # noqa: F821
 
 
-                    LVL1MenuItem('L1_BPH-2M8-2MU4'       ).setLogic( TOPO_2INVM8_2MU4ab & physcond)                 # backup 71% for Bs,J/psi
-                    #LVL1MenuItem('L1_BPH-2M9-2MU4'       ).setLogic( TOPO_2INVM9_2MU4ab & physcond)
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4'    ).setLogic( TOPO_8INVM15_MU6ab_MU4ab & physcond)           # backup 71% for Upsi
-                    LVL1MenuItem('L1_BPH-8M15-2MU6'      ).setLogic( TOPO_8INVM15_2MU6ab & physcond)                # backup 95% for Upsi
+                    LVL1MenuItem('L1_BPH-2M8-2MU4'       ).setLogic( TOPO_2INVM8_2MU4ab & physcond)                 # backup 71% for Bs,J/psi      # noqa: F821
+                    #LVL1MenuItem('L1_BPH-2M9-2MU4'       ).setLogic( TOPO_2INVM9_2MU4ab & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_BPH-8M15-MU6MU4'    ).setLogic( TOPO_8INVM15_MU6ab_MU4ab & physcond)           # backup 71% for Upsi     # noqa: F821
+                    LVL1MenuItem('L1_BPH-8M15-2MU6'      ).setLogic( TOPO_8INVM15_2MU6ab & physcond)                # backup 95% for Upsi     # noqa: F821
     #SX end ATR-12789
 
-                    LVL1MenuItem('L1_LATE-MU10_XE50').setLogic( TOPO_LATE_MU10s1 & XE50 & physcond) 
-                    LVL1MenuItem('L1_LATE-MU10_J50').setLogic(  TOPO_LATE_MU10s1 & J50 & physcond)  
-                    if '_v7' in TriggerFlags.triggerMenuSetup():
-                      LVL1MenuItem('L1_SC111-CJ15').setLogic(  TOPO_SC111_CJ15abETA26 & physcond)
-                      LVL1MenuItem('L1_SC85-CJ15').setLogic(  TOPO_SC85_CJ15abETA26 & physcond)
+                    LVL1MenuItem('L1_LATE-MU10_XE50').setLogic( TOPO_LATE_MU10s1 & XE50 & physcond)  # noqa: F821
+                    LVL1MenuItem('L1_LATE-MU10_XE40').setLogic( TOPO_LATE_MU10s1 & XE40 & physcond)  # noqa: F821
+                    LVL1MenuItem('L1_LATE-MU10_J50').setLogic(  TOPO_LATE_MU10s1 & J50 & physcond)   # noqa: F821
+                    if '_v7' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup():
+                      LVL1MenuItem('L1_SC111-CJ15').setLogic(  TOPO_SC111_CJ15abETA26 & physcond)    # noqa: F821
+                      LVL1MenuItem('L1_SC85-CJ15').setLogic(  TOPO_SC85_CJ15abETA26 & physcond)      # noqa: F821
+
                     else:
-                      LVL1MenuItem('L1_SC111').setLogic(  TOPO_SC111_CJ15abETA26 & physcond)
-                      LVL1MenuItem('L1_SC85').setLogic(  TOPO_SC85_CJ15abETA26 & physcond)
+                      LVL1MenuItem('L1_SC111').setLogic(  TOPO_SC111_CJ15abETA26 & physcond)         # noqa: F821
+                      LVL1MenuItem('L1_SC85').setLogic(  TOPO_SC85_CJ15abETA26 & physcond)           # noqa: F821
 
-                    LVL1MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( HA60 & TOPO_0DR28_TAU20abi_TAU12abi & physcond)
+                    LVL1MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( HA60 & TOPO_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
 
             except Exception, ex:
                     print "Creation of L1Topo item failed, will abort! Exception is : " , ex
@@ -1740,13 +1769,16 @@ class ItemDef:
         # Partition 2
         LVL1MenuItem.currentPartition = 2
 
-        LVL1MenuItem('L1_RD2_BGRP14'         ).setLogic( RNDM2 & BGRP0 & BGRP14             ).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_RD2_BGRP14'         ).setLogic( RNDM2 & BGRP0 & BGRP14             ).setTriggerType(TT.rand)    # noqa: F821
+				#UNPAIREDB2 is BGRP14, needs to go in partition 2
+        LVL1MenuItem('L1_BCM_CA_UNPAIREDB2'  ).setLogic( BCM_CtoA & bgrp14cond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_J12_UNPAIREDB2').setLogic( J12 & bgrp14cond).setTriggerType(TT.calo)    # noqa: F821
 
 
         # Partition 3
         LVL1MenuItem.currentPartition = 3
         
-        LVL1MenuItem('L1_RD3_BGRP15'         ).setLogic( RNDM3 & BGRP0 & BGRP15             ).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_RD3_BGRP15'         ).setLogic( RNDM3 & BGRP0 & BGRP15             ).setTriggerType(TT.rand)    # noqa: F821
                       
 
         # reset to partition 1
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDefRun1.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDefRun1.py
index cac1430d237de36a164bd39447a643f3016c6200..4b4a70c7e0dc63d2406d604677f34c2ffaf61c2e 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDefRun1.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDefRun1.py
@@ -4,7 +4,6 @@
 
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
-import re
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('TriggerMenu.Lvl1.py')
@@ -13,12 +12,8 @@ log = logging.getLogger('TriggerMenu.Lvl1.py')
 # The trigger types
 from TriggerMenu.l1.TriggerTypeDefRun1 import TT
 from TriggerMenu.l1.Limits import Limits
-from TriggerMenu.l1.Logic import Logic,Not
+from TriggerMenu.l1.Logic import Not
 from TriggerMenu.l1.Lvl1MenuItems import LVL1MenuItem
-from TriggerMenu.l1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger
-
-
-
 
 class ItemDef:
     def __init__(self):
@@ -55,15 +50,15 @@ class ItemDef:
         LVL1MenuItem.l1configForRegistration = tm  # from now on all new LVL1MenuItems are registered to tm
 
         # Setting up bunch group and BPTX conditions
-        bgrpcond            = BGRP0 & BGRP1
-        physcond            = BGRP0 & BGRP1
-        calibcond           = BGRP0 & BGRP2
-        cosmiccond          = BGRP0 & BGRP3
-        unpaired_isocond    = BGRP0 & BGRP4 # unpaired isolated (satellite bunches)
-        unpaired_nonisocond = BGRP0 & BGRP5 # unpaired non-isolated (parasitic bunches)
-        firstempty          = BGRP0 & BGRP6
-        unpairedRcond       = BGRP0 & BGRP7 # unpaired beams 1 oR beam 2
-        bgrp7cond           = BGRP0 & BGRP7 # No unpaired anymore
+        bgrpcond            = BGRP0 & BGRP1                                                 # noqa: F821
+        physcond            = BGRP0 & BGRP1                                                 # noqa: F821
+        calibcond           = BGRP0 & BGRP2                                                 # noqa: F821
+        cosmiccond          = BGRP0 & BGRP3                                                 # noqa: F821
+        unpaired_isocond    = BGRP0 & BGRP4 # unpaired isolated (satellite bunches)         # noqa: F821
+        unpaired_nonisocond = BGRP0 & BGRP5 # unpaired non-isolated (parasitic bunches)     # noqa: F821
+        firstempty          = BGRP0 & BGRP6                                                 # noqa: F821
+        unpairedRcond       = BGRP0 & BGRP7 # unpaired beams 1 oR beam 2                    # noqa: F821
+        bgrp7cond           = BGRP0 & BGRP7 # No unpaired anymore                           # noqa: F821
 
 
         LVL1MenuItem.currentPartition = 1
@@ -72,263 +67,263 @@ class ItemDef:
 
         emTT = TT.calo | TT.caloem
         
-        LVL1MenuItem('L1_EM3',    ctpid=0x1 ).setLogic( EM3.x(1)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM4',    ctpid=0x54).setLogic( EM4.x(1)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM5',    ctpid=-1  ).setLogic( EM5.x(1)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM6',    ctpid=-1  ).setLogic( EM6.x(1)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM7',    ctpid=0x1 ).setLogic( EM7.x(1)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM7V',   ctpid=-1  ).setLogic( EM7V.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM8VH',  ctpid=-1  ).setLogic( EM8VH.x(1)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM10',   ctpid=0x2 ).setLogic( EM10.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM10VH', ctpid=-1  ).setLogic( EM10VH.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM12',   ctpid=0x2 ).setLogic( EM12.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM14',   ctpid=0x5 ).setLogic( EM14.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM14VH', ctpid=-1  ).setLogic( EM14VH.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM15V',  ctpid=-1  ).setLogic( EM15V.x(1)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM15VH', ctpid=-1  ).setLogic( EM15VH.x(1) & physcond).setTriggerType( emTT ) 
-        LVL1MenuItem('L1_EM16',   ctpid=0x5 ).setLogic( EM16.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM16VH', ctpid=-1  ).setLogic( EM16VH.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM16V',  ctpid=-1  ).setLogic( EM16V.x(1)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM18VH', ctpid=-1  ).setLogic( EM18VH.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM20V',  ctpid=-1  ).setLogic( EM20V.x(1)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM24VHI', ctpid=-1  ).setLogic( EM24VHI.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM30',   ctpid=0x8 ).setLogic( EM30.x(1)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM50',   ctpid=0x8 ).setLogic( EM50.x(1)   & physcond).setTriggerType( emTT )
+        LVL1MenuItem('L1_EM3',    ctpid=0x1 ).setLogic( EM3.x(1)    & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM4',    ctpid=0x54).setLogic( EM4.x(1)    & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM5',    ctpid=-1  ).setLogic( EM5.x(1)    & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM6',    ctpid=-1  ).setLogic( EM6.x(1)    & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM7',    ctpid=0x1 ).setLogic( EM7.x(1)    & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM7V',   ctpid=-1  ).setLogic( EM7V.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM8VH',  ctpid=-1  ).setLogic( EM8VH.x(1)  & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM10',   ctpid=0x2 ).setLogic( EM10.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM10VH', ctpid=-1  ).setLogic( EM10VH.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM12',   ctpid=0x2 ).setLogic( EM12.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM14',   ctpid=0x5 ).setLogic( EM14.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM14VH', ctpid=-1  ).setLogic( EM14VH.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM15V',  ctpid=-1  ).setLogic( EM15V.x(1)  & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM15VH', ctpid=-1  ).setLogic( EM15VH.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM16',   ctpid=0x5 ).setLogic( EM16.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM16VH', ctpid=-1  ).setLogic( EM16VH.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM16V',  ctpid=-1  ).setLogic( EM16V.x(1)  & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM18VH', ctpid=-1  ).setLogic( EM18VH.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM20V',  ctpid=-1  ).setLogic( EM20V.x(1)  & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM24VHI', ctpid=-1  ).setLogic( EM24VHI.x(1) & physcond).setTriggerType( emTT )  # noqa: F821
+        LVL1MenuItem('L1_EM30',   ctpid=0x8 ).setLogic( EM30.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM50',   ctpid=0x8 ).setLogic( EM50.x(1)   & physcond).setTriggerType( emTT )    # noqa: F821
 
 
         # special bgrp
-        LVL1MenuItem('L1_EM30_BGRP7',  ctpid=-1).setLogic( EM30.x(1) & bgrp7cond ).setTriggerType( emTT )
+        LVL1MenuItem('L1_EM30_BGRP7',  ctpid=-1).setLogic( EM30.x(1) & bgrp7cond ).setTriggerType( emTT ) # noqa: F821
         
         # 2xEM
-        LVL1MenuItem('L1_2EM3',    ctpid=0xa ).setLogic( EM3.x(2)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM5',    ctpid=0xb ).setLogic( EM5.x(2)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM6',    ctpid=-1  ).setLogic( EM6.x(2)    & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM8VH',  ctpid=-1  ).setLogic( EM8VH.x(2)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM10VH', ctpid=-1  ).setLogic( EM10VH.x(2) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM12',   ctpid=0xf ).setLogic( EM12.x(2)   & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM15V',  ctpid=-1 ).setLogic( EM15V.x(2)  & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM15VH', ctpid=0xf ).setLogic( EM15VH.x(2) & physcond).setTriggerType( emTT )
+        LVL1MenuItem('L1_2EM3',    ctpid=0xa ).setLogic( EM3.x(2)    & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM5',    ctpid=0xb ).setLogic( EM5.x(2)    & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM6',    ctpid=-1  ).setLogic( EM6.x(2)    & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM8VH',  ctpid=-1  ).setLogic( EM8VH.x(2)  & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM10VH', ctpid=-1  ).setLogic( EM10VH.x(2) & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM12',   ctpid=0xf ).setLogic( EM12.x(2)   & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM15V',  ctpid=-1 ).setLogic( EM15V.x(2)  & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_2EM15VH', ctpid=0xf ).setLogic( EM15VH.x(2) & physcond).setTriggerType( emTT )   # noqa: F821
 
 
 
         # 3xEM
-        LVL1MenuItem('L1_2EM3_EM6'   ).setLogic( EM3.x(2)& EM6.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM7V_2EM3'   ).setLogic(EM7V.x(1)& EM3.x(2) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM3_EM12'  ).setLogic( EM3.x(2)& EM12.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM6_EM16VH').setLogic( EM6.x(2)& EM16VH.x(1) & physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_3EM6',  ctpid=-1  ).setLogic( EM6.x(3)  & physcond).setTriggerType(TT.phys).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM15VH_3EM7V'  ).setLogic( EM15VH.x(1) & EM7V.x(3) & physcond).setTriggerType( emTT )
+        LVL1MenuItem('L1_2EM3_EM6'   ).setLogic( EM3.x(2)& EM6.x(1) & physcond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM7V_2EM3'   ).setLogic(EM7V.x(1)& EM3.x(2) & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM3_EM12'  ).setLogic( EM3.x(2)& EM12.x(1) & physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM6_EM16VH').setLogic( EM6.x(2)& EM16VH.x(1) & physcond).setTriggerType( emTT ) # noqa: F821
+        LVL1MenuItem('L1_3EM6',  ctpid=-1  ).setLogic( EM6.x(3)  & physcond).setTriggerType(TT.phys).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_EM15VH_3EM7V'  ).setLogic( EM15VH.x(1) & EM7V.x(3) & physcond).setTriggerType( emTT )   # noqa: F821
 
         # 4xEM
-        LVL1MenuItem('L1_3EM6_EM14VH').setLogic( EM6.x(3) & EM14VH.x(1)& physcond).setTriggerType( emTT )
-        LVL1MenuItem('L1_2EM12_EM16V').setLogic( EM12.x(2)& EM16V.x(1) & physcond).setTriggerType( emTT )
+        LVL1MenuItem('L1_3EM6_EM14VH').setLogic( EM6.x(3) & EM14VH.x(1)& physcond).setTriggerType( emTT )   # noqa: F821
+        LVL1MenuItem('L1_2EM12_EM16V').setLogic( EM12.x(2)& EM16V.x(1) & physcond).setTriggerType( emTT )   # noqa: F821
 
         
         # MUON ctpid=[0x20;0x2f]
 
-        LVL1MenuItem('L1_MU0',  ctpid=0x20).setLogic( MU0.x(1)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4',  ctpid=-1  ).setLogic( MU4.x(1)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU6',  ctpid=0x21).setLogic( MU6.x(1)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU10', ctpid=0x22).setLogic( MU10.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU11', ctpid=0x23).setLogic( MU11.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU15', ctpid=-1  ).setLogic( MU15.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU20', ctpid=0x24).setLogic( MU20.x(1) & physcond).setTriggerType(TT.rpcin)
+        LVL1MenuItem('L1_MU0',  ctpid=0x20).setLogic( MU0.x(1)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4',  ctpid=-1  ).setLogic( MU4.x(1)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU6',  ctpid=0x21).setLogic( MU6.x(1)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU10', ctpid=0x22).setLogic( MU10.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU11', ctpid=0x23).setLogic( MU11.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU15', ctpid=-1  ).setLogic( MU15.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU20', ctpid=0x24).setLogic( MU20.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
 
         # 2xMU, 3xMU, 4xMU
-        LVL1MenuItem('L1_2MU0',  ctpid=0x26).setLogic( MU0.x(2)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU4',  ctpid=-1  ).setLogic( MU4.x(2)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU6',  ctpid=0x27).setLogic( MU6.x(2)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU10', ctpid=0x28).setLogic( MU10.x(2) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU11', ctpid=0x28).setLogic( MU11.x(2) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU20', ctpid=0x2a).setLogic( MU20.x(2) & physcond)
-        LVL1MenuItem('L1_3MU4',  ctpid=-1  ).setLogic( MU4.x(3)  & physcond)
-        LVL1MenuItem('L1_3MU6',  ctpid=0x2b).setLogic( MU6.x(3)  & physcond)
-        LVL1MenuItem('L1_2MU4_MU6'         ).setLogic( MU4.x(2) & MU6.x(1)  & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU6_MU10'        ).setLogic( MU6.x(2) & MU10.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_3MU4_MU6'         ).setLogic( MU4.x(3) & MU6.x(1)  & physcond).setTriggerType(TT.rpcin)
-
-        LVL1MenuItem('L1_2MU4_XE40', ctpid=-1  ).setLogic( MU4.x(2) &  XE40.x(1)  & physcond).setTriggerType(TT.calo|TT.rpcin)
-        LVL1MenuItem('L1_2MU4_XE30', ctpid=-1  ).setLogic( MU4.x(2) &  XE30.x(1) & physcond).setTriggerType(TT.calo|TT.rpcin)
+        LVL1MenuItem('L1_2MU0',  ctpid=0x26).setLogic( MU0.x(2)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4',  ctpid=-1  ).setLogic( MU4.x(2)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6',  ctpid=0x27).setLogic( MU6.x(2)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU10', ctpid=0x28).setLogic( MU10.x(2) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU11', ctpid=0x28).setLogic( MU11.x(2) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU20', ctpid=0x2a).setLogic( MU20.x(2) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_3MU4',  ctpid=-1  ).setLogic( MU4.x(3)  & physcond)    # noqa: F821
+        LVL1MenuItem('L1_3MU6',  ctpid=0x2b).setLogic( MU6.x(3)  & physcond)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_MU6'         ).setLogic( MU4.x(2) & MU6.x(1)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_MU10'        ).setLogic( MU6.x(2) & MU10.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_3MU4_MU6'         ).setLogic( MU4.x(3) & MU6.x(1)  & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+
+        LVL1MenuItem('L1_2MU4_XE40', ctpid=-1  ).setLogic( MU4.x(2) &  XE40.x(1)  & physcond).setTriggerType(TT.calo|TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_XE30', ctpid=-1  ).setLogic( MU4.x(2) &  XE30.x(1) & physcond).setTriggerType(TT.calo|TT.rpcin)    # noqa: F821
 
         # barrel 
-        LVL1MenuItem('L1_MUB'            ).setLogic( NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MUE'            ).setLogic( NIM_MUE.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU4_BARRELONLY').setLogic( ( MU4.x(2) & Not(NIM_MUE.x(1)) |  MU4.x(3)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU4_MU6_BARREL').setLogic( MU4.x(2) & NIM_MUB.x(1) & MU6.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU4_BARREL'    ).setLogic( MU4.x(2) & NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU6_BARRELONLY').setLogic( (MU6.x(2)&Not(NIM_MUE.x(1))| MU6.x(3)) & physcond).setTriggerType(TT.rpcin)        
-        LVL1MenuItem('L1_2MU6_BARREL'    ).setLogic( MU6.x(2) & NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)
+        LVL1MenuItem('L1_MUB'            ).setLogic( NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MUE'            ).setLogic( NIM_MUE.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_BARRELONLY').setLogic( ( MU4.x(2) & Not(NIM_MUE.x(1)) |  MU4.x(3)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_MU6_BARREL').setLogic( MU4.x(2) & NIM_MUB.x(1) & MU6.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_BARREL'    ).setLogic( MU4.x(2) & NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_BARRELONLY').setLogic( (MU6.x(2)&Not(NIM_MUE.x(1))| MU6.x(3)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_BARREL'    ).setLogic( MU6.x(2) & NIM_MUB.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
         
 
 
         # TAU ctpid=[0x40:0x4f]
 
         # 1xTAU
-        LVL1MenuItem('L1_TAU3',   ctpid=0x40).setLogic( HA3.x(1)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU6',   ctpid=-1  ).setLogic( HA6.x(1)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8',   ctpid=0x43).setLogic( HA8.x(1)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU11',  ctpid=0x44).setLogic( HA11.x(1)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU11I', ctpid=0x44).setLogic( HA11I.x(1) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12',  ctpid=-1  ).setLogic( HA12.x(1)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU15',  ctpid=-1  ).setLogic( HA15.x(1)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU15I'            ).setLogic( HA15I.x(1) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20',  ctpid=0x46).setLogic( HA20.x(1)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40',  ctpid=0x49).setLogic( HA40.x(1)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU60',  ctpid=-1  ).setLogic( HA60.x(1)  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU3',   ctpid=0x40).setLogic( HA3.x(1)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU6',   ctpid=-1  ).setLogic( HA6.x(1)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU8',   ctpid=0x43).setLogic( HA8.x(1)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU11',  ctpid=0x44).setLogic( HA11.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU11I', ctpid=0x44).setLogic( HA11I.x(1) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU12',  ctpid=-1  ).setLogic( HA12.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU15',  ctpid=-1  ).setLogic( HA15.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU15I'            ).setLogic( HA15I.x(1) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20',  ctpid=0x46).setLogic( HA20.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU40',  ctpid=0x49).setLogic( HA40.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU60',  ctpid=-1  ).setLogic( HA60.x(1)  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         # 2xTAU
-        LVL1MenuItem('L1_2TAU11', ctpid=0x4c ).setLogic( HA11.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2TAU11I'            ).setLogic( HA11I.x(2) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2TAU15'             ).setLogic( HA15.x(2)  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_2TAU11', ctpid=0x4c ).setLogic( HA11.x(2)  & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_2TAU11I'            ).setLogic( HA11I.x(2) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_2TAU15'             ).setLogic( HA15.x(2)  & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         # mixed tau
-        LVL1MenuItem('L1_EM15VH_TAU40_2TAU15'          ).setLogic( EM15VH  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2TAU12_J25_2J15_3J12'  ).setLogic( EM15VH  & HA12.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VH_TAU40_2TAU15'          ).setLogic( EM15VH  & HA40 & HA15.x(2)   & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_2TAU12_J25_2J15_3J12'  ).setLogic( EM15VH  & HA12.x(2)  & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_MU10_TAU20'       ).setLogic( MU10  & HA20          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12_J25_2J12' ).setLogic( MU10 & HA12 & J25 & J12.x(2) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_MU10_TAU20'       ).setLogic( MU10  & HA20          & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_MU10_TAU12_J25_2J12' ).setLogic( MU10 & HA12 & J25 & J12.x(2) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
-        LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'   ).setLogic( HA20 & HA12.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( HA20    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( HA20    & HA12.x(2)  & XE35 & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'   ).setLogic( HA20 & HA12.x(2)     & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( HA20    & J20.x(2)   & XE45 & physcond).setTriggerType( TT.calo )    # noqa: F821
+        LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( HA20    & HA12.x(2)  & XE35 & physcond).setTriggerType( TT.calo )    # noqa: F821
 
         # EMPTY
-        LVL1MenuItem('L1_2TAU20'    ).setLogic( HA20.x(2) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2TAU20'    ).setLogic( HA20.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
 
         # JET ctpid=[0x60:0x7f]
 
-        LVL1MenuItem('L1_J5',      ctpid=0x60).setLogic( J5.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J5_win6', ctpid=0x60).setLogic( J5_win6.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10',     ctpid=0x61).setLogic( J10.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15'                ).setLogic( J15.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J18',     ctpid=0x62).setLogic( J18.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20',     ctpid=-1  ).setLogic( J20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30'                ).setLogic( J30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40'                ).setLogic( J40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50'                ).setLogic( J50.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75'                ).setLogic( J75.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100',    ctpid=-1  ).setLogic( J100.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J350',    ctpid=-1  ).setLogic( J350.x(1) & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J15.ETA24', ctpid=-1).setLogic(J15ETA24.x(1) & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J15.23ETA49' ).setLogic( (JF1523ETA49  | JB1523ETA49  ) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.32ETA49' ).setLogic( (JF2032ETA49  | JB2032ETA49  ) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25.32ETA49' ).setLogic( (JF2532ETA49  | JB2532ETA49  ) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100.32ETA49').setLogic( (JF10032ETA49 | JB10032ETA49 ) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J5',      ctpid=0x60).setLogic( J5.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J5_win6', ctpid=0x60).setLogic( J5_win6.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10',     ctpid=0x61).setLogic( J10.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J15'                ).setLogic( J15.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J18',     ctpid=0x62).setLogic( J18.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20',     ctpid=-1  ).setLogic( J20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30'                ).setLogic( J30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J40'                ).setLogic( J40.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J50'                ).setLogic( J50.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J75'                ).setLogic( J75.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J100',    ctpid=-1  ).setLogic( J100.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J350',    ctpid=-1  ).setLogic( J350.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J15.ETA24', ctpid=-1).setLogic(J15ETA24.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+
+        LVL1MenuItem('L1_J15.23ETA49' ).setLogic( (JF1523ETA49  | JB1523ETA49  ) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J20.32ETA49' ).setLogic( (JF2032ETA49  | JB2032ETA49  ) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J25.32ETA49' ).setLogic( (JF2532ETA49  | JB2532ETA49  ) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J100.32ETA49').setLogic( (JF10032ETA49 | JB10032ETA49 ) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # pPb
-        LVL1MenuItem('L1_J5_TE90',  ctpid=0x60).setLogic( J5.x(1)& TE90.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J5_TE90', ctpid=0x60).setLogic( J5.x(2)& TE90.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J5_TE90',  ctpid=0x60).setLogic( J5.x(1)& TE90.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J5_TE90', ctpid=0x60).setLogic( J5.x(2)& TE90.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # Multi-jet
-        LVL1MenuItem('L1_2J5', ctpid=0x68 ).setLogic( J5.x(2)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J10'            ).setLogic( J10.x(2) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J10', ctpid=0x7f).setLogic( J10.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J15'            ).setLogic( J15.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J50', ctpid=0x7f).setLogic( J50.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J75', ctpid=-1  ).setLogic( J75.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J20', ctpid=-1  ).setLogic( J20.x(3) & physcond).setTriggerType(TT.calo) # new jet threshold
-        LVL1MenuItem('L1_4J10', ctpid=0x6e).setLogic( J10.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J15'            ).setLogic( J15.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J20', ctpid=-1  ).setLogic( J20.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_5J10', ctpid=-1  ).setLogic( J10.x(5) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_5J15'            ).setLogic( J15.x(5) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_5J20', ctpid=-1  ).setLogic( J20.x(5) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_6J10', ctpid=-1  ).setLogic( J10.x(6) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2J5', ctpid=0x68 ).setLogic( J5.x(2)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J10'            ).setLogic( J10.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J10', ctpid=0x7f).setLogic( J10.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J15'            ).setLogic( J15.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J50', ctpid=0x7f).setLogic( J50.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J75', ctpid=-1  ).setLogic( J75.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_3J20', ctpid=-1  ).setLogic( J20.x(3) & physcond).setTriggerType(TT.calo) # new jet threshold  # noqa: F821
+        LVL1MenuItem('L1_4J10', ctpid=0x6e).setLogic( J10.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J15'            ).setLogic( J15.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_4J20', ctpid=-1  ).setLogic( J20.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_5J10', ctpid=-1  ).setLogic( J10.x(5) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_5J15'            ).setLogic( J15.x(5) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_5J20', ctpid=-1  ).setLogic( J20.x(5) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_6J10', ctpid=-1  ).setLogic( J10.x(6) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
-        LVL1MenuItem('L1_3J15.ETA24' ).setLogic( J15ETA24.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_5J15.ETA24' ).setLogic( J15ETA24.x(5) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_3J15.ETA24' ).setLogic( J15ETA24.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_5J15.ETA24' ).setLogic( J15ETA24.x(5) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
 
         #example zero bias seeded by single jet
-        #item_zb_j10  = LVL1MenuItem('L1_ZB_J10',  ctpid=240).setLogic(thr_zb_j10.x(1) & physcond).setTriggerType(TT.calo)
+        #item_zb_j10  = LVL1MenuItem('L1_ZB_J10',  ctpid=240).setLogic(thr_zb_j10.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         #example zero bias seeded by di jet
-        #item_zb_2j10 = LVL1MenuItem('L1_ZB_2J10', ctpid=241).setLogic(thr_zb_2j10.x(1) & physcond).setTriggerType(TT.calo)
+        #item_zb_2j10 = LVL1MenuItem('L1_ZB_2J10', ctpid=241).setLogic(thr_zb_2j10.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         #zb item for v3 menu, seeded by mbts a
 
         if ('pp_v4' in TriggerFlags.triggerMenuSetup() or 'LS1_v1' in TriggerFlags.triggerMenuSetup()) :
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM12.x(1) & physcond).setTriggerType(TT.zerobs)
+            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM12.x(1) & physcond).setTriggerType(TT.zerobs)    # noqa: F821
         elif  'DC14' in TriggerFlags.triggerMenuSetup():
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM15V.x(1) & physcond).setTriggerType(TT.zerobs)
+            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM15V.x(1) & physcond).setTriggerType(TT.zerobs)    # noqa: F821
         else:
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM14.x(1) & physcond).setTriggerType(TT.zerobs)
+            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_EM14.x(1) & physcond).setTriggerType(TT.zerobs)    # noqa: F821
 
 
             
         # - Add/remap new L1 thresholds:
         #   J20->J15, J40->J30, J70->J55, J100->J75, J130->J95, J150->J115
-        LVL1MenuItem('L1_4J30'    ).setLogic( J30.x(4) & physcond)
-        LVL1MenuItem('L1_3J15_J50').setLogic( J15.x(3) & J50.x(1) & physcond)
-        LVL1MenuItem('L1_J30_FJ30').setLogic( J30.x(1) & ( JF30.x(1) | JB30.x(1) ) & physcond)
-        LVL1MenuItem('L1_J50_FJ50').setLogic( J50.x(1) & ( JF50.x(1) | JB50.x(1) ) & physcond)
+        LVL1MenuItem('L1_4J30'    ).setLogic( J30.x(4) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_3J15_J50').setLogic( J15.x(3) & J50.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J30_FJ30').setLogic( J30.x(1) & ( JF30.x(1) | JB30.x(1) ) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J50_FJ50').setLogic( J50.x(1) & ( JF50.x(1) | JB50.x(1) ) & physcond)    # noqa: F821
 
 
 
         # FJ
         #pPb items
         
-        LVL1MenuItem('L1_FJ0',   ctpid=0x7b).setLogic(( JF0.x(1) | JB0.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ0_A', ctpid=0x7b).setLogic(( JF0.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ0_C', ctpid=0x7b).setLogic(( JB0.x(1)) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_FJ0',   ctpid=0x7b).setLogic(( JF0.x(1) | JB0.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ0_A', ctpid=0x7b).setLogic(( JF0.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ0_C', ctpid=0x7b).setLogic(( JB0.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         #pp items
-        LVL1MenuItem('L1_FJ5', ctpid=0x7b).setLogic(( JF5.x(1) |  JB5.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ10').setLogic(( JF10.x(1) |  JB10.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ15').setLogic(( JF15.x(1) |  JB15.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ30').setLogic(( JF30.x(1) |  JB30.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ50').setLogic(( JF50.x(1) |  JB50.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ75').setLogic(( JF75.x(1) |  JB75.x(1)) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_FJ5', ctpid=0x7b).setLogic(( JF5.x(1) |  JB5.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ10').setLogic(( JF10.x(1) |  JB10.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ15').setLogic(( JF15.x(1) |  JB15.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ30').setLogic(( JF30.x(1) |  JB30.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ50').setLogic(( JF50.x(1) |  JB50.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ75').setLogic(( JF75.x(1) |  JB75.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # 2xFJ
-        LVL1MenuItem('L1_2FJ15').setLogic( JF15.x(1) &  JB15.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2FJ30', ctpid=0x7d).setLogic( JF30.x(1) &  JB30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2FJ50', ctpid=0x7b).setLogic( JF50.x(1) &  JB50.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2FJ15').setLogic( JF15.x(1) &  JB15.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2FJ30', ctpid=0x7d).setLogic( JF30.x(1) &  JB30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2FJ50', ctpid=0x7b).setLogic( JF50.x(1) &  JB50.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         
         # Diffractive
 
-        LVL1MenuItem('L1_MU0_TE50'    ).setLogic( MU0.x(1) & TE50.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_TE50'    ).setLogic( MU4.x(1) & TE50.x(1) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_EM3_2J5'     ).setLogic( EM3.x(1) & J5.x(2)   & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_MU0_TE50'    ).setLogic( MU0.x(1) & TE50.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_TE50'    ).setLogic( MU4.x(1) & TE50.x(1) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_EM3_2J5'     ).setLogic( EM3.x(1) & J5.x(2)   & physcond).setTriggerType(TT.calo)    # noqa: F821
 
-        LVL1MenuItem('L1_MU0_VTE50'   ).setLogic( MU0.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU0_VTE20'   ).setLogic( MU0.x(1) & Not(TE20.x(1)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_VTE50'   ).setLogic( MU4.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_EM3_VTE50'   ).setLogic( EM3.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM3_VTE20'   ).setLogic( EM3.x(1) & Not(TE20.x(1)) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_MU0_VTE50'   ).setLogic( MU0.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU0_VTE20'   ).setLogic( MU0.x(1) & Not(TE20.x(1)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_VTE50'   ).setLogic( MU4.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_EM3_VTE50'   ).setLogic( EM3.x(1) & Not(TE50.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_EM3_VTE20'   ).setLogic( EM3.x(1) & Not(TE20.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
-        LVL1MenuItem('L1_MU0_MV_VTE50').setLogic( MU0.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_MV_VTE50').setLogic( MU4.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_EM3_MV_VTE50').setLogic( EM3.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_MU0_MV_VTE50').setLogic( MU0.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_MV_VTE50').setLogic( MU4.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_EM3_MV_VTE50').setLogic( EM3.x(1) & Not(MBTS_A.x(1)& MBTS_C.x(1)) & Not(TE50.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
 
         # Items for EMPTY
         # EM
-        LVL1MenuItem('L1_EM3_EMPTY',   ctpid=-1).setLogic( EM3.x(1)   & cosmiccond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM5_EMPTY',   ctpid=-1).setLogic( EM5.x(1)   & cosmiccond).setTriggerType( emTT )
-        LVL1MenuItem('L1_EM6_EMPTY',   ctpid=-1).setLogic( EM6.x(1)   & cosmiccond).setTriggerType( emTT )
+        LVL1MenuItem('L1_EM3_EMPTY',   ctpid=-1).setLogic( EM3.x(1)   & cosmiccond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM5_EMPTY',   ctpid=-1).setLogic( EM5.x(1)   & cosmiccond).setTriggerType( emTT )    # noqa: F821
+        LVL1MenuItem('L1_EM6_EMPTY',   ctpid=-1).setLogic( EM6.x(1)   & cosmiccond).setTriggerType( emTT )    # noqa: F821
         # Muon
-        LVL1MenuItem('L1_MU0_EMPTY'      ).setLogic( MU0.x(1)  & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MU4_EMPTY'      ).setLogic( MU4.x(1)  & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MU10_EMPTY'     ).setLogic( MU10.x(1) & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_2MU6_EMPTY'     ).setLogic( MU6.x(2)  & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_2MU0_EMPTY'     ).setLogic( MU0.x(2)  & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_2MU4_EMPTY'     ).setLogic( MU4.x(2)  & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MU11_EMPTY'     ).setLogic( MU11.x(1) & cosmiccond).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_MU0_EMPTY'      ).setLogic( MU0.x(1)  & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MU4_EMPTY'      ).setLogic( MU4.x(1)  & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MU10_EMPTY'     ).setLogic( MU10.x(1) & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_EMPTY'     ).setLogic( MU6.x(2)  & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_2MU0_EMPTY'     ).setLogic( MU0.x(2)  & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_EMPTY'     ).setLogic( MU4.x(2)  & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MU11_EMPTY'     ).setLogic( MU11.x(1) & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
         # Tau
-        LVL1MenuItem('L1_TAU8_EMPTY').setLogic( HA8.x(1) & cosmiccond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TAU8_EMPTY').setLogic( HA8.x(1) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
         # Jet
-        LVL1MenuItem('L1_J5_EMPTY' ).setLogic( J5.x(1)  & cosmiccond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_EMPTY').setLogic( J10.x(1) & cosmiccond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_EMPTY').setLogic( J30.x(1) & cosmiccond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J5_EMPTY' ).setLogic( J5.x(1)  & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_EMPTY').setLogic( J10.x(1) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_EMPTY').setLogic( J30.x(1) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
         # Forward Jet
-        LVL1MenuItem('L1_FJ5_EMPTY' ).setLogic( ( JF5.x(1) |  JB5.x(1)) & cosmiccond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ0_EMPTY' ).setLogic( ( JF0.x(1) |  JB0.x(1)) & cosmiccond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ30_EMPTY').setLogic( (JF30.x(1) | JB30.x(1)) & cosmiccond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_FJ5_EMPTY' ).setLogic( ( JF5.x(1) |  JB5.x(1)) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ0_EMPTY' ).setLogic( ( JF0.x(1) |  JB0.x(1)) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ30_EMPTY').setLogic( (JF30.x(1) | JB30.x(1)) & cosmiccond).setTriggerType(TT.calo)    # noqa: F821
         # combined
-        LVL1MenuItem('L1_MU4_J15_EMPTY'  ).setLogic( MU4.x(1)  &  J15.x(1) & cosmiccond).setTriggerType(TT.rpcout)        
+        LVL1MenuItem('L1_MU4_J15_EMPTY'  ).setLogic( MU4.x(1)  &  J15.x(1) & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
 
 
                 
@@ -336,537 +331,537 @@ class ItemDef:
         # Items for EMPTY, UNPAIRED1, UNPAIRED2 and UNPAIRED
 
         # Jet
-        LVL1MenuItem('L1_J5_UNPAIRED_ISO'     ).setLogic( J5.x(1)  & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J5_UNPAIRED_NONISO'  ).setLogic( J5.x(1)  & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J5_FIRSTEMPTY'       ).setLogic( J5.x(1)  & firstempty         ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_UNPAIRED_ISO'    ).setLogic( J10.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_UNPAIRED_NONISO' ).setLogic( J10.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_FIRSTEMPTY'      ).setLogic( J10.x(1) & firstempty         ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_UNPAIRED'        ).setLogic( J30.x(1) & unpairedRcond      ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_UNPAIRED_ISO'    ).setLogic( J30.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_UNPAIRED_NONISO' ).setLogic( J30.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_FIRSTEMPTY'      ).setLogic( J30.x(1) & firstempty         ).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J5_UNPAIRED_ISO'     ).setLogic( J5.x(1)  & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J5_UNPAIRED_NONISO'  ).setLogic( J5.x(1)  & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J5_FIRSTEMPTY'       ).setLogic( J5.x(1)  & firstempty         ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_UNPAIRED_ISO'    ).setLogic( J10.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_UNPAIRED_NONISO' ).setLogic( J10.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J10_FIRSTEMPTY'      ).setLogic( J10.x(1) & firstempty         ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_UNPAIRED'        ).setLogic( J30.x(1) & unpairedRcond      ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_UNPAIRED_ISO'    ).setLogic( J30.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_UNPAIRED_NONISO' ).setLogic( J30.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30_FIRSTEMPTY'      ).setLogic( J30.x(1) & firstempty         ).setTriggerType(TT.calo)    # noqa: F821
         # Forward jet
-        LVL1MenuItem('L1_FJ10_UNPAIRED_NONISO').setLogic( ( JF10.x(1) |  JB10.x(1)) & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ0_UNPAIRED_ISO'    ).setLogic( ( JF0.x(1)  |  JB0.x(1) ) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ5_UNPAIRED_ISO'    ).setLogic( ( JF5.x(1)  |  JB5.x(1) ) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ30_UNPAIRED_ISO'   ).setLogic( ( JF30.x(1) |  JB30.x(1)) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_FJ30_FIRSTEMPTY'     ).setLogic( ( JF30.x(1) |  JB30.x(1)) & firstempty         ).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_FJ10_UNPAIRED_NONISO').setLogic( ( JF10.x(1) |  JB10.x(1)) & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ0_UNPAIRED_ISO'    ).setLogic( ( JF0.x(1)  |  JB0.x(1) ) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ5_UNPAIRED_ISO'    ).setLogic( ( JF5.x(1)  |  JB5.x(1) ) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ30_UNPAIRED_ISO'   ).setLogic( ( JF30.x(1) |  JB30.x(1)) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_FJ30_FIRSTEMPTY'     ).setLogic( ( JF30.x(1) |  JB30.x(1)) & firstempty         ).setTriggerType(TT.calo)    # noqa: F821
         # Tau
-        LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( HA8.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TAU8_UNPAIRED_NONISO').setLogic( HA8.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TAU8_FIRSTEMPTY'     ).setLogic( HA8.x(1) & firstempty         ).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( HA8.x(1) & unpaired_isocond   ).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TAU8_UNPAIRED_NONISO').setLogic( HA8.x(1) & unpaired_nonisocond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TAU8_FIRSTEMPTY'     ).setLogic( HA8.x(1) & firstempty         ).setTriggerType(TT.calo)    # noqa: F821
         # EM
-        LVL1MenuItem('L1_EM3_UNPAIRED_ISO'    ).setLogic( EM3.x(1) & unpaired_isocond   ).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM3_UNPAIRED_NONISO' ).setLogic( EM3.x(1) & unpaired_nonisocond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM3_FIRSTEMPTY'      ).setLogic( EM3.x(1) & firstempty         ).setTriggerType(TT.calo|TT.caloem)
+        LVL1MenuItem('L1_EM3_UNPAIRED_ISO'    ).setLogic( EM3.x(1) & unpaired_isocond   ).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM3_UNPAIRED_NONISO' ).setLogic( EM3.x(1) & unpaired_nonisocond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM3_FIRSTEMPTY'      ).setLogic( EM3.x(1) & firstempty         ).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
         # Muon
-        LVL1MenuItem('L1_MU0_UNPAIRED_ISO'    ).setLogic( MU0.x(1)  & unpaired_isocond   ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_UNPAIRED_ISO'    ).setLogic( MU4.x(1)  & unpaired_isocond   ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU10_UNPAIRED_ISO'   ).setLogic( MU10.x(1) & unpaired_isocond   ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU0_UNPAIRED_NONISO' ).setLogic( MU0.x(1)  & unpaired_nonisocond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_UNPAIRED_NONISO' ).setLogic( MU4.x(1)  & unpaired_nonisocond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU0_FIRSTEMPTY'      ).setLogic( MU0.x(1)  & firstempty         ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU4_FIRSTEMPTY'      ).setLogic( MU4.x(1)  & firstempty         ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU6_FIRSTEMPTY'      ).setLogic( MU6.x(1)  & firstempty         ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU10_FIRSTEMPTY'     ).setLogic( MU10.x(1) & firstempty         ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_MU20_FIRSTEMPTY'     ).setLogic( MU20.x(1) & firstempty         ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_2MU6_UNPAIRED_ISO'   ).setLogic( MU6.x(2)  & unpaired_isocond   ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU6_UNPAIRED_NONISO').setLogic( MU6.x(2)  & unpaired_nonisocond).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU4_FIRSTEMPTY'     ).setLogic( MU4.x(2)  & firstempty         ).setTriggerType(TT.rpcin)
-        LVL1MenuItem('L1_2MU6_FIRSTEMPTY'     ).setLogic( MU6.x(2)  & firstempty         ).setTriggerType(TT.rpcin)        
+        LVL1MenuItem('L1_MU0_UNPAIRED_ISO'    ).setLogic( MU0.x(1)  & unpaired_isocond   ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_UNPAIRED_ISO'    ).setLogic( MU4.x(1)  & unpaired_isocond   ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU10_UNPAIRED_ISO'   ).setLogic( MU10.x(1) & unpaired_isocond   ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU0_UNPAIRED_NONISO' ).setLogic( MU0.x(1)  & unpaired_nonisocond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_UNPAIRED_NONISO' ).setLogic( MU4.x(1)  & unpaired_nonisocond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU0_FIRSTEMPTY'      ).setLogic( MU0.x(1)  & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU4_FIRSTEMPTY'      ).setLogic( MU4.x(1)  & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU6_FIRSTEMPTY'      ).setLogic( MU6.x(1)  & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU10_FIRSTEMPTY'     ).setLogic( MU10.x(1) & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_MU20_FIRSTEMPTY'     ).setLogic( MU20.x(1) & firstempty         ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_UNPAIRED_ISO'   ).setLogic( MU6.x(2)  & unpaired_isocond   ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_UNPAIRED_NONISO').setLogic( MU6.x(2)  & unpaired_nonisocond).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_FIRSTEMPTY'     ).setLogic( MU4.x(2)  & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
+        LVL1MenuItem('L1_2MU6_FIRSTEMPTY'     ).setLogic( MU6.x(2)  & firstempty         ).setTriggerType(TT.rpcin)    # noqa: F821
         # combined
-        LVL1MenuItem('L1_MU4_J15_UNPAIRED_ISO').setLogic( MU4.x(1) & J15.x(1) & unpaired_isocond).setTriggerType(TT.rpcin)
+        LVL1MenuItem('L1_MU4_J15_UNPAIRED_ISO').setLogic( MU4.x(1) & J15.x(1) & unpaired_isocond).setTriggerType(TT.rpcin)    # noqa: F821
 
         #Combined JET+MET
-        LVL1MenuItem('L1_J40_XE50').setLogic( (J40.x(1) & XE50.x(1)) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J40_XE50').setLogic( (J40.x(1) & XE50.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         # XE ctpid=[0x80:0x9f]
-        LVL1MenuItem('L1_XE20', ctpid=0x81).setLogic( XE20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE25', ctpid=0x82).setLogic( XE25.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE30', ctpid=0x83).setLogic( XE30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40', ctpid=0x84).setLogic( XE40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50', ctpid=0x85).setLogic( XE50.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE70', ctpid=0x86).setLogic( XE70.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XE20', ctpid=0x81).setLogic( XE20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE25', ctpid=0x82).setLogic( XE25.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE30', ctpid=0x83).setLogic( XE30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE40', ctpid=0x84).setLogic( XE40.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE50', ctpid=0x85).setLogic( XE50.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE70', ctpid=0x86).setLogic( XE70.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
-        LVL1MenuItem('L1_XE35_BGRP7').setLogic( XE35.x(1)&bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40_BGRP7').setLogic( XE40.x(1)&bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50_BGRP7').setLogic( XE50.x(1)&bgrp7cond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XE35_BGRP7').setLogic( XE35.x(1)&bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE40_BGRP7').setLogic( XE40.x(1)&bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE50_BGRP7').setLogic( XE50.x(1)&bgrp7cond).setTriggerType(TT.calo)    # noqa: F821
 
         #pPb items        
-        LVL1MenuItem('L1_TE10').setLogic( TE10.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE20').setLogic( TE20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE30').setLogic( TE30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE40').setLogic( TE40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE35').setLogic( TE35.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TE10').setLogic( TE10.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE20').setLogic( TE20.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE30').setLogic( TE30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE40').setLogic( TE40.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE35').setLogic( TE35.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # Other TE items for L=10^32 and 10^33
-        LVL1MenuItem('L1_TE800', ctpid=0x8f).setLogic( TE800.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TE800', ctpid=0x8f).setLogic( TE800.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
 
-        # items for HI p+Pb (forward TE)
+        # items for HI p+Pb (forward TE)    # noqa: F821
         if 'HI_v2' in TriggerFlags.triggerMenuSetup():
-            LVL1MenuItem('L1_TE0'  ).setLogic( TE0.x(1)   & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE20' ).setLogic( TE20.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE50' ).setLogic( TE50.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE65' ).setLogic( TE65.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE90' ).setLogic( TE90.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE100').setLogic( TE100.x(1) & physcond).setTriggerType(TT.calo)
+            LVL1MenuItem('L1_TE0'  ).setLogic( TE0.x(1)   & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE20' ).setLogic( TE20.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE50' ).setLogic( TE50.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE65' ).setLogic( TE65.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE90' ).setLogic( TE90.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE100').setLogic( TE100.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         else:
-            LVL1MenuItem('L1_TE0'  ).setLogic( TE0.x(1)   & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE50' ).setLogic( TE50.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE65' ).setLogic( TE65.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE90' ).setLogic( TE90.x(1)  & physcond).setTriggerType(TT.calo)
-            LVL1MenuItem('L1_TE100').setLogic( TE100.x(1) & physcond).setTriggerType(TT.calo)
+            LVL1MenuItem('L1_TE0'  ).setLogic( TE0.x(1)   & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE50' ).setLogic( TE50.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE65' ).setLogic( TE65.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE90' ).setLogic( TE90.x(1)  & physcond).setTriggerType(TT.calo)    # noqa: F821
+            LVL1MenuItem('L1_TE100').setLogic( TE100.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
             
 
-        LVL1MenuItem('L1_XS30').setLogic( XS30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS45').setLogic( XS45.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS50').setLogic( XS50.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS55').setLogic( XS55.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS60').setLogic( XS60.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS65').setLogic( XS65.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XS30').setLogic( XS30.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS45').setLogic( XS45.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS50').setLogic( XS50.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS55').setLogic( XS55.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS60').setLogic( XS60.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XS65').setLogic( XS65.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
-        LVL1MenuItem('L1_JE140'            ).setLogic( JE140.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_JE200', ctpid=0x92).setLogic( JE200.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_JE350', ctpid=0x94).setLogic( JE350.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_JE500', ctpid=0x96).setLogic( JE500.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_JE140'            ).setLogic( JE140.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_JE200', ctpid=0x92).setLogic( JE200.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_JE350', ctpid=0x94).setLogic( JE350.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_JE500', ctpid=0x96).setLogic( JE500.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # Transient items
-        LVL1MenuItem('L1_XE35').setLogic( XE35.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE60').setLogic( XE60.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_XE35').setLogic( XE35.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_XE60').setLogic( XE60.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
-        LVL1MenuItem('L1_TE300').setLogic( TE300.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE500').setLogic( TE500.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE700').setLogic( TE700.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TE300').setLogic( TE300.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE500').setLogic( TE500.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TE700').setLogic( TE700.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
         
         # Combined items [0xa0:0xff], [0x30:0x3f],
 
         # EM + (XE, MU, TAU)
-        LVL1MenuItem('L1_EM10VH_XE20').setLogic( EM10VH.x(1)& XE20.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM10VH_XE30').setLogic( EM10VH.x(1)& XE30.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM10VH_XE35').setLogic( EM10VH.x(1)& XE35.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)        
-
-
-        LVL1MenuItem('L1_EM3_MU6', ctpid=0xbd).setLogic( MU6.x(1)& EM3.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM6_2MU6'   ).setLogic( MU6.x(2)& EM6.x(1) & physcond)
-        LVL1MenuItem('L1_EM10VH_MU6' ).setLogic( EM10VH.x(1)& MU6.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM15VH_MU10').setLogic( EM15VH.x(1)& MU10.x(1)& physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM16VH_MU4' ).setLogic( EM16VH.x(1)& MU4.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_2EM8VH_MU10' ).setLogic( EM8VH.x(2)& MU10.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM8VH_2MU6' ).setLogic( EM8VH.x(1)& MU6.x(2) & physcond).setTriggerType(TT.calo|TT.caloem)
-
-
-        LVL1MenuItem('L1_2EM6_MU6'   ).setLogic( EM6.x(2)& MU6.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_MU6'    ).setLogic( EM6.x(1)& MU6.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_MU10'   ).setLogic( EM6.x(1)& MU10.x(1) & physcond)
-        LVL1MenuItem('L1_EM12_XE20'  ).setLogic( EM12.x(1)& XE20.x(1) & physcond)
-        LVL1MenuItem('L1_EM16V_XE20' ).setLogic( EM16V.x(1)& XE20.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_XS45'   ).setLogic( EM6.x(1)& XS45.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_XS50'   ).setLogic( EM6.x(1)& XS50.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_XS55'   ).setLogic( EM6.x(1)& XS55.x(1) & physcond)
-        LVL1MenuItem('L1_EM6_XS60'   ).setLogic( EM6.x(1)& XS60.x(1) & physcond)
-        LVL1MenuItem('L1_EM16V_XS45' ).setLogic( EM16V.x(1)& XS45.x(1) & physcond)
-        LVL1MenuItem('L1_EM12_XS45'  ).setLogic( EM12.x(1)& XS45.x(1) & physcond)
-        LVL1MenuItem('L1_EM12_XS30'  ).setLogic( EM12.x(1)& XS30.x(1) & physcond)
-        LVL1MenuItem('L1_EM12_4J10'  ).setLogic( EM12.x(1)& J10.x(4) & physcond)
-        LVL1MenuItem('L1_EM15VH_J15.23ETA49' ).setLogic( EM15VH&  (JF1523ETA49.x(1)  | JB1523ETA49.x(1)  ) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_EM10VH_XE20').setLogic( EM10VH.x(1)& XE20.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM10VH_XE30').setLogic( EM10VH.x(1)& XE30.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM10VH_XE35').setLogic( EM10VH.x(1)& XE35.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+
+
+        LVL1MenuItem('L1_EM3_MU6', ctpid=0xbd).setLogic( MU6.x(1)& EM3.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM6_2MU6'   ).setLogic( MU6.x(2)& EM6.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM10VH_MU6' ).setLogic( EM10VH.x(1)& MU6.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_MU10').setLogic( EM15VH.x(1)& MU10.x(1)& physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM16VH_MU4' ).setLogic( EM16VH.x(1)& MU4.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_2EM8VH_MU10' ).setLogic( EM8VH.x(2)& MU10.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM8VH_2MU6' ).setLogic( EM8VH.x(1)& MU6.x(2) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+
+
+        LVL1MenuItem('L1_2EM6_MU6'   ).setLogic( EM6.x(2)& MU6.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_MU6'    ).setLogic( EM6.x(1)& MU6.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_MU10'   ).setLogic( EM6.x(1)& MU10.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM12_XE20'  ).setLogic( EM12.x(1)& XE20.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM16V_XE20' ).setLogic( EM16V.x(1)& XE20.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_XS45'   ).setLogic( EM6.x(1)& XS45.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_XS50'   ).setLogic( EM6.x(1)& XS50.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_XS55'   ).setLogic( EM6.x(1)& XS55.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM6_XS60'   ).setLogic( EM6.x(1)& XS60.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM16V_XS45' ).setLogic( EM16V.x(1)& XS45.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM12_XS45'  ).setLogic( EM12.x(1)& XS45.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM12_XS30'  ).setLogic( EM12.x(1)& XS30.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM12_4J10'  ).setLogic( EM12.x(1)& J10.x(4) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_EM15VH_J15.23ETA49' ).setLogic( EM15VH&  (JF1523ETA49.x(1)  | JB1523ETA49.x(1)  ) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
 
         # TAU + EM
-        LVL1MenuItem('L1_2TAU11I_EM14VH').setLogic( HA11I.x(2)& EM14VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_2TAU11_TAU20_EM14VH').setLogic( HA11.x(2)& HA20.x(1)& EM14VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_2TAU11_TAU20_EM10VH').setLogic( HA11.x(2)& HA20.x(1)& EM10VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_2TAU11_TAU15', ctpid=0x0).setLogic( HA11.x(2)& HA15.x(1) & physcond).setTriggerType(TT.calo)          
-        LVL1MenuItem('L1_2TAU11I_TAU15', ctpid=0x0).setLogic( HA11I.x(2)& HA15.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2TAU11_EM10VH').setLogic( HA11.x(2)& EM10VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
+        LVL1MenuItem('L1_2TAU11I_EM14VH').setLogic( HA11I.x(2)& EM14VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_2TAU11_TAU20_EM14VH').setLogic( HA11.x(2)& HA20.x(1)& EM14VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_2TAU11_TAU20_EM10VH').setLogic( HA11.x(2)& HA20.x(1)& EM10VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_2TAU11_TAU15', ctpid=0x0).setLogic( HA11.x(2)& HA15.x(1) & physcond).setTriggerType(TT.calo)      # noqa: F821
+        LVL1MenuItem('L1_2TAU11I_TAU15', ctpid=0x0).setLogic( HA11I.x(2)& HA15.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2TAU11_EM10VH').setLogic( HA11.x(2)& EM10VH.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
 
         
-        LVL1MenuItem('L1_MU4_J50').setLogic( MU4.x(1)& J50.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)
-        LVL1MenuItem('L1_MU4_J10').setLogic( MU4.x(1)& J10.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)
+        LVL1MenuItem('L1_MU4_J50').setLogic( MU4.x(1)& J50.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J10').setLogic( MU4.x(1)& J10.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)    # noqa: F821
  
         # - Add/remap new L1 thresholds:
         #   J20->J15, J40->J30, J70->J55, J100->J75, J130->J95, J150->J115
-        LVL1MenuItem('L1_MU4_J15').setLogic( MU4.x(1)& J15.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)
-        LVL1MenuItem('L1_MU4_J30').setLogic( MU4.x(1)& J30.x(1) & physcond)
-        LVL1MenuItem('L1_MU4_J75').setLogic( MU4.x(1)& J75.x(1) & physcond) 
+        LVL1MenuItem('L1_MU4_J15').setLogic( MU4.x(1)& J15.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J30').setLogic( MU4.x(1)& J30.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J75').setLogic( MU4.x(1)& J75.x(1) & physcond)    # noqa: F821
 
-        LVL1MenuItem('L1_MU4_J20_XE20').setLogic( MU4.x(1)& J20.x(1)& XE20.x(1) & physcond)
-        LVL1MenuItem('L1_MU4_J20_XE35').setLogic( MU4.x(1)& J20.x(1)& XE35.x(1) & physcond)
+        LVL1MenuItem('L1_MU4_J20_XE20').setLogic( MU4.x(1)& J20.x(1)& XE20.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_MU4_J20_XE35').setLogic( MU4.x(1)& J20.x(1)& XE35.x(1) & physcond)    # noqa: F821
 
-        LVL1MenuItem('L1_MU6_J15').setLogic( MU6.x(1)& J15.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)
-        LVL1MenuItem('L1_MU6_2J20').setLogic( MU6.x(1)& J20.x(2) & physcond).setTriggerType(TT.rpcin|TT.calo)
-        LVL1MenuItem('L1_2MU4_EM3', ctpid=0xbd).setLogic( MU4.x(2)& EM3.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)
-        LVL1MenuItem('L1_2MU4_2EM3', ctpid=0xbd).setLogic( MU4.x(2)& EM3.x(2) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)
+        LVL1MenuItem('L1_MU6_J15').setLogic( MU6.x(1)& J15.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_MU6_2J20').setLogic( MU6.x(1)& J20.x(2) & physcond).setTriggerType(TT.rpcin|TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_EM3', ctpid=0xbd).setLogic( MU4.x(2)& EM3.x(1) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_2MU4_2EM3', ctpid=0xbd).setLogic( MU4.x(2)& EM3.x(2) & physcond).setTriggerType(TT.rpcin|TT.calo|TT.caloem)    # noqa: F821
 
-        LVL1MenuItem('L1_MU10_XE20').setLogic( MU10.x(1)& XE20.x(1) & physcond)
-        LVL1MenuItem('L1_MU10_XE25').setLogic( MU10.x(1)& XE25.x(1) & physcond)
-        LVL1MenuItem('L1_MU10_J20').setLogic( MU10.x(1) & J20.x(1) & physcond) # new jet threshold
+        LVL1MenuItem('L1_MU10_XE20').setLogic( MU10.x(1)& XE20.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_MU10_XE25').setLogic( MU10.x(1)& XE25.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_MU10_J20').setLogic( MU10.x(1) & J20.x(1) & physcond) # new jet threshold   # noqa: F821
 
         # TAU + MU
-        LVL1MenuItem('L1_TAU8_MU10'             ).setLogic( HA8.x(1)  & MU10.x(1) & physcond)
-        LVL1MenuItem('L1_TAU11_MU10', ctpid=0xc7).setLogic( HA11.x(1) & MU10.x(1) & physcond)
-        LVL1MenuItem('L1_2J30_XE20'             ).setLogic( J30.x(2)  & XE20.x(1) & physcond) # new jet threshold
+        LVL1MenuItem('L1_TAU8_MU10'             ).setLogic( HA8.x(1)  & MU10.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_TAU11_MU10', ctpid=0xc7).setLogic( HA11.x(1) & MU10.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_2J30_XE20'             ).setLogic( J30.x(2)  & XE20.x(1) & physcond) # new jet threshold    # noqa: F821
 
         # TAU + XE
-        LVL1MenuItem('L1_TAU15_XE35'     ).setLogic( HA15.x(1)  & XE35.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TAU15_XE40'     ).setLogic( HA15.x(1)  & XE40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TAU15I_XE35'    ).setLogic( HA15I.x(1) & XE35.x(1) & physcond)
-        LVL1MenuItem('L1_TAU15I_XE40'    ).setLogic( HA15I.x(1) & XE40.x(1) & physcond)
-        LVL1MenuItem('L1_TAU20_XE40'     ).setLogic( HA20.x(1)  & XE40.x(1) & physcond)
-        LVL1MenuItem('L1_TAU20_XE35'     ).setLogic( HA20.x(1)  & XE35.x(1) & physcond)
-        LVL1MenuItem('L1_TAU15_XS35'     ).setLogic( HA15.x(1)  & XS35.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TAU15_XE25_3J15').setLogic( HA15.x(1)  & XE25.x(1) & J15.x(3) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_TAU15_XE35'     ).setLogic( HA15.x(1)  & XE35.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TAU15_XE40'     ).setLogic( HA15.x(1)  & XE40.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TAU15I_XE35'    ).setLogic( HA15I.x(1) & XE35.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_TAU15I_XE40'    ).setLogic( HA15I.x(1) & XE40.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_TAU20_XE40'     ).setLogic( HA20.x(1)  & XE40.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_TAU20_XE35'     ).setLogic( HA20.x(1)  & XE35.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_TAU15_XS35'     ).setLogic( HA15.x(1)  & XS35.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_TAU15_XE25_3J15').setLogic( HA15.x(1)  & XE25.x(1) & J15.x(3) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # VBF request
         
-        LVL1MenuItem('L1_2TAU8_TAU15_FJ15'         ).setLogic( HA8.x(2) & HA15.x(1)  & ( JF15.x(1) | JB15.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2TAU8_TAU15_J15CF'        ).setLogic( HA8.x(2) & HA15.x(1)  & J15CF.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2TAU8_TAU11I_EM10VH_FJ15' ).setLogic( HA8.x(2) & HA11I.x(1) & EM10VH.x(1)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2TAU8_TAU11I_EM10VH_J15CF').setLogic( HA8.x(2) & HA11I.x(1) & EM10VH.x(1)& J15CF.x(1) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2TAU8_TAU15_FJ15'         ).setLogic( HA8.x(2) & HA15.x(1)  & ( JF15.x(1) | JB15.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2TAU8_TAU15_J15CF'        ).setLogic( HA8.x(2) & HA15.x(1)  & J15CF.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2TAU8_TAU11I_EM10VH_FJ15' ).setLogic( HA8.x(2) & HA11I.x(1) & EM10VH.x(1)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2TAU8_TAU11I_EM10VH_J15CF').setLogic( HA8.x(2) & HA11I.x(1) & EM10VH.x(1)& J15CF.x(1) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
                
-        LVL1MenuItem('L1_EM14VH_FJ15' ).setLogic( EM14VH.x(1)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo|TT.caloem)
-        LVL1MenuItem('L1_EM14VH_J15CF').setLogic( EM14VH.x(1)& J15CF.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)
+        LVL1MenuItem('L1_EM14VH_FJ15' ).setLogic( EM14VH.x(1)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
+        LVL1MenuItem('L1_EM14VH_J15CF').setLogic( EM14VH.x(1)& J15CF.x(1) & physcond).setTriggerType(TT.calo|TT.caloem)    # noqa: F821
 
-        LVL1MenuItem('L1_MU10_FJ15').setLogic(  MU10.x(1) & ( JF15.x(1) | JB15.x(1)) & physcond)
-        LVL1MenuItem('L1_MU10_J15CF').setLogic( MU10.x(1)& J15CF.x(1) & physcond)
+        LVL1MenuItem('L1_MU10_FJ15').setLogic(  MU10.x(1) & ( JF15.x(1) | JB15.x(1)) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_MU10_J15CF').setLogic( MU10.x(1)& J15CF.x(1) & physcond)    # noqa: F821
 
-        LVL1MenuItem('L1_3J15_FJ15').setLogic( J15.x(3)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_2FJ15').setLogic( J15.x(2)&( JF15.x(1)& JB15.x(1)) & physcond).setTriggerType(TT.calo)              
+        LVL1MenuItem('L1_3J15_FJ15').setLogic( J15.x(3)&( JF15.x(1)| JB15.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_2J15_2FJ15').setLogic( J15.x(2)&( JF15.x(1)& JB15.x(1)) & physcond).setTriggerType(TT.calo)    # noqa: F821
 
         # Transient items
         # L1_TAU6_2JT4_JT35  (or whatever soft thresholds they have. JT4 must have 
         # softer cuts than TAU06 and JT35 - please get in touch with us if it is not 
-        # the case - we will need to rethink it then)
-
-        LVL1MenuItem('L1_J50_XE30').setLogic( J50.x(1)&  XE30.x(1) & physcond)
-        LVL1MenuItem('L1_J50_XE35').setLogic( J50.x(1)&  XE35.x(1) & physcond)
-        LVL1MenuItem('L1_J50_XE40').setLogic( J50.x(1)&  XE40.x(1) & physcond)
-        LVL1MenuItem('L1_J30_XE35').setLogic( J30.x(1)& XE35.x(1) & physcond)
-        LVL1MenuItem('L1_J30_XE40').setLogic( J30.x(1)& XE40.x(1) & physcond)
-        LVL1MenuItem('L1_J30_XE50').setLogic( J30.x(1)& XE50.x(1) & physcond)
-        LVL1MenuItem('L1_2J20_XE20').setLogic( J20.x(2)&  XE20.x(1) & physcond)
+        # the case - we will need to rethink it then)    # noqa: F821
+
+        LVL1MenuItem('L1_J50_XE30').setLogic( J50.x(1)&  XE30.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J50_XE35').setLogic( J50.x(1)&  XE35.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J50_XE40').setLogic( J50.x(1)&  XE40.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J30_XE35').setLogic( J30.x(1)& XE35.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J30_XE40').setLogic( J30.x(1)& XE40.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_J30_XE50').setLogic( J30.x(1)& XE50.x(1) & physcond)    # noqa: F821
+        LVL1MenuItem('L1_2J20_XE20').setLogic( J20.x(2)&  XE20.x(1) & physcond)    # noqa: F821
         
 
         # MBTS
-        MBTS_1   = MBTS_A.x(1) | MBTS_C.x(1)
-        MBTS_2   = (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_A.x(1)) & (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_C.x(1))
-        MBTS_1_1 = MBTS_A.x(1) & MBTS_C.x(1)
-        MBTS_2_2 = MBTS_A.x(2) & MBTS_C.x(2)
-        MBTS_3_3 = MBTS_A.x(3) & MBTS_C.x(3)
-        MBTS_4_4 = MBTS_A.x(4) & MBTS_C.x(4)
-
-        LVL1MenuItem('L1_MBTS_1',           ctpid=0xe2).setLogic( MBTS_1   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2',           ctpid=0xe3).setLogic( MBTS_2   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_OVERLAY', ctpid=0xe4).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_MBTS_1_1',         ctpid=0xe4).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2'                    ).setLogic( MBTS_2_2 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3'                    ).setLogic( MBTS_3_3 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4',         ctpid=0xe1).setLogic( MBTS_4_4 & physcond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_EMPTY'  ).setLogic( MBTS_1   & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_EMPTY'  ).setLogic( MBTS_2   & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_EMPTY').setLogic( MBTS_1_1 & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_EMPTY').setLogic( MBTS_2_2 & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_EMPTY').setLogic( MBTS_3_3 & cosmiccond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_ISO'   ).setLogic( MBTS_1 & unpaired_isocond    ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_NONISO').setLogic( MBTS_1 & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_ISO'   ).setLogic( MBTS_2 & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_NONISO').setLogic( MBTS_2 & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_BGRP7'          ).setLogic( MBTS_2 & bgrp7cond           ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_UNPAIRED_ISO' ).setLogic( MBTS_1_1 & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_UNPAIRED_ISO' ).setLogic( MBTS_2_2 & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_UNPAIRED_ISO' ).setLogic( MBTS_3_3 & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4_UNPAIRED_ISO' ).setLogic( MBTS_4_4 & unpaired_isocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTSA0' ).setLogic( MBTS_A0.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA1' ).setLogic( MBTS_A1.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA2' ).setLogic( MBTS_A2.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA3' ).setLogic( MBTS_A3.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA4' ).setLogic( MBTS_A4.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA5' ).setLogic( MBTS_A5.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA6' ).setLogic( MBTS_A6.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA7' ).setLogic( MBTS_A7.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA8' ).setLogic( MBTS_A8.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA9' ).setLogic( MBTS_A9.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA10').setLogic( MBTS_A10.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA11').setLogic( MBTS_A11.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA12').setLogic( MBTS_A12.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA13').setLogic( MBTS_A13.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA14').setLogic( MBTS_A14.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA15').setLogic( MBTS_A15.x(1) & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTSC0' ).setLogic( MBTS_C0.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC1' ).setLogic( MBTS_C1.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC2' ).setLogic( MBTS_C2.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC3' ).setLogic( MBTS_C3.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC4' ).setLogic( MBTS_C4.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC5' ).setLogic( MBTS_C5.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC6' ).setLogic( MBTS_C6.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC7' ).setLogic( MBTS_C7.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC8' ).setLogic( MBTS_C8.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC9' ).setLogic( MBTS_C9.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC10').setLogic( MBTS_C10.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC11').setLogic( MBTS_C11.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC12').setLogic( MBTS_C12.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC13').setLogic( MBTS_C13.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC14').setLogic( MBTS_C14.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC15').setLogic( MBTS_C15.x(1) & physcond).setTriggerType(TT.minb)
+        MBTS_1   = MBTS_A.x(1) | MBTS_C.x(1)    # noqa: F821
+        MBTS_2   = (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_A.x(1)) & (MBTS_A.x(2) | MBTS_C.x(2) | MBTS_C.x(1))    # noqa: F821
+        MBTS_1_1 = MBTS_A.x(1) & MBTS_C.x(1)    # noqa: F821
+        MBTS_2_2 = MBTS_A.x(2) & MBTS_C.x(2)    # noqa: F821
+        MBTS_3_3 = MBTS_A.x(3) & MBTS_C.x(3)    # noqa: F821
+        MBTS_4_4 = MBTS_A.x(4) & MBTS_C.x(4)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1',           ctpid=0xe2).setLogic( MBTS_1   & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2',           ctpid=0xe3).setLogic( MBTS_2   & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_OVERLAY', ctpid=0xe4).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.zerobs)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1',         ctpid=0xe4).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2'                    ).setLogic( MBTS_2_2 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3'                    ).setLogic( MBTS_3_3 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_4',         ctpid=0xe1).setLogic( MBTS_4_4 & physcond ).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1_EMPTY'  ).setLogic( MBTS_1   & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_EMPTY'  ).setLogic( MBTS_2   & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_EMPTY').setLogic( MBTS_1_1 & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2_EMPTY').setLogic( MBTS_2_2 & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3_EMPTY').setLogic( MBTS_3_3 & cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1_UNPAIRED_ISO'   ).setLogic( MBTS_1 & unpaired_isocond    ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_UNPAIRED_NONISO').setLogic( MBTS_1 & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_UNPAIRED_ISO'   ).setLogic( MBTS_2 & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_UNPAIRED_NONISO').setLogic( MBTS_2 & unpaired_nonisocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_BGRP7'          ).setLogic( MBTS_2 & bgrp7cond           ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_1_UNPAIRED_ISO' ).setLogic( MBTS_1_1 & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_2_UNPAIRED_ISO' ).setLogic( MBTS_2_2 & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_3_3_UNPAIRED_ISO' ).setLogic( MBTS_3_3 & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_4_4_UNPAIRED_ISO' ).setLogic( MBTS_4_4 & unpaired_isocond ).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTSA0' ).setLogic( MBTS_A0.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA1' ).setLogic( MBTS_A1.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA2' ).setLogic( MBTS_A2.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA3' ).setLogic( MBTS_A3.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA4' ).setLogic( MBTS_A4.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA5' ).setLogic( MBTS_A5.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA6' ).setLogic( MBTS_A6.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA7' ).setLogic( MBTS_A7.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA8' ).setLogic( MBTS_A8.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA9' ).setLogic( MBTS_A9.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA10').setLogic( MBTS_A10.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA11').setLogic( MBTS_A11.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA12').setLogic( MBTS_A12.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA13').setLogic( MBTS_A13.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA14').setLogic( MBTS_A14.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSA15').setLogic( MBTS_A15.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTSC0' ).setLogic( MBTS_C0.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC1' ).setLogic( MBTS_C1.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC2' ).setLogic( MBTS_C2.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC3' ).setLogic( MBTS_C3.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC4' ).setLogic( MBTS_C4.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC5' ).setLogic( MBTS_C5.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC6' ).setLogic( MBTS_C6.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC7' ).setLogic( MBTS_C7.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC8' ).setLogic( MBTS_C8.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC9' ).setLogic( MBTS_C9.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC10').setLogic( MBTS_C10.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC11').setLogic( MBTS_C11.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC12').setLogic( MBTS_C12.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC13').setLogic( MBTS_C13.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC14').setLogic( MBTS_C14.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_MBTSC15').setLogic( MBTS_C15.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
         
 
         # ZDC
         
-        LVL1MenuItem('L1_ZDC'                     ).setLogic((ZDC_A.x(1)|ZDC_C.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_EMPTY'               ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_ISO'        ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_NONISO'     ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)                
-        LVL1MenuItem('L1_ZDC_A_C'                 ).setLogic(ZDC_A.x(1)&ZDC_C.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_EMPTY'           ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_ISO'    ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_NONISO' ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A'                   ).setLogic(ZDC_A.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C'                   ).setLogic(ZDC_C.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND'                 ).setLogic(ZDC_AND.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_VTE20'             ).setLogic(ZDC_A.x(1)&Not( TE20.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VTE20'             ).setLogic(ZDC_C.x(1)&Not( TE20.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_BGRP7'             ).setLogic(ZDC_A.x(1)&bgrp7cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_BGRP7'             ).setLogic(ZDC_C.x(1)&bgrp7cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_1'              ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(1)| MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2'              ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&\
-                                                             ( MBTS_A.x(2)| MBTS_C.x(2)| MBTS_A.x(1))\
-                                                             &( MBTS_A.x(2)| MBTS_C.x(2)| MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_1_1'            ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(1)& MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2_2'            ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(2)& MBTS_C.x(2)) & physcond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_ZDC'                     ).setLogic((ZDC_A.x(1)|ZDC_C.x(1)) & physcond).setTriggerType(TT.minb)                                # noqa: F821
+        LVL1MenuItem('L1_ZDC_EMPTY'               ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&cosmiccond).setTriggerType(TT.minb)                                # noqa: F821
+        LVL1MenuItem('L1_ZDC_UNPAIRED_ISO'        ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&unpaired_isocond).setTriggerType(TT.minb)                          # noqa: F821
+        LVL1MenuItem('L1_ZDC_UNPAIRED_NONISO'     ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)                       # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C'                 ).setLogic(ZDC_A.x(1)&ZDC_C.x(1) & physcond).setTriggerType(TT.minb)                                  # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_EMPTY'           ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&cosmiccond).setTriggerType(TT.minb)                                  # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_ISO'    ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&unpaired_isocond).setTriggerType(TT.minb)                            # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_NONISO' ).setLogic(ZDC_A.x(1)&ZDC_C.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)                         # noqa: F821
+        LVL1MenuItem('L1_ZDC_A'                   ).setLogic(ZDC_A.x(1) & physcond).setTriggerType(TT.minb)                                             # noqa: F821
+        LVL1MenuItem('L1_ZDC_C'                   ).setLogic(ZDC_C.x(1) & physcond).setTriggerType(TT.minb)                                             # noqa: F821
+        LVL1MenuItem('L1_ZDC_AND'                 ).setLogic(ZDC_AND.x(1) & physcond).setTriggerType(TT.minb)                                           # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_VTE20'             ).setLogic(ZDC_A.x(1)&Not( TE20.x(1)) & physcond).setTriggerType(TT.minb)                             # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_VTE20'             ).setLogic(ZDC_C.x(1)&Not( TE20.x(1)) & physcond).setTriggerType(TT.minb)                             # noqa: F821
+        LVL1MenuItem('L1_ZDC_A_BGRP7'             ).setLogic(ZDC_A.x(1)&bgrp7cond).setTriggerType(TT.minb)                                              # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_BGRP7'             ).setLogic(ZDC_C.x(1)&bgrp7cond).setTriggerType(TT.minb)                                              # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_1'              ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(1)| MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_2'              ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&\                                                                  # noqa: F821
+                                                             ( MBTS_A.x(2)| MBTS_C.x(2)| MBTS_A.x(1))\                                                  # noqa: F821
+                                                             &( MBTS_A.x(2)| MBTS_C.x(2)| MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)              # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_1_1'            ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(1)& MBTS_C.x(1)) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_MBTS_2_2'            ).setLogic((ZDC_A.x(1)|ZDC_C.x(1))&( MBTS_A.x(2)& MBTS_C.x(2)) & physcond).setTriggerType(TT.minb)    # noqa: F821
 
 
         # BCM
 
-        LVL1MenuItem('L1_BCM_AC_CA_BGRP0',ctpid=0xe6 ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&BGRP0).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_ISO'     ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_NONISO'  ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_HT_BGRP0',   ctpid=0xf8 ).setLogic( BCM_Comb.x(7)&BGRP0).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_BGRP0', ctpid=0xe8 ).setLogic( BCM_Wide.x(1)&BGRP0).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_EMPTY'             ).setLogic( BCM_Wide.x(1)&cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_ISO'      ).setLogic( BCM_Wide.x(1)&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_NONISO'   ).setLogic( BCM_Wide.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_BCM_AC_CA_BGRP0',ctpid=0xe6 ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&BGRP0).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_ISO'     ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_NONISO'  ).setLogic((BCM_AtoC.x(1)|BCM_CtoA.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_HT_BGRP0',   ctpid=0xf8 ).setLogic( BCM_Comb.x(7)&BGRP0).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_BGRP0', ctpid=0xe8 ).setLogic( BCM_Wide.x(1)&BGRP0).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_EMPTY'             ).setLogic( BCM_Wide.x(1)&cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_ISO'      ).setLogic( BCM_Wide.x(1)&unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_NONISO'   ).setLogic( BCM_Wide.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
 
 
         # LUCID
         
-        LVL1MenuItem('L1_LUCID_C',     ctpid=0xed  ).setLogic( LUCID_C.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A',     ctpid=0xec  ).setLogic( LUCID_A.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C',   ctpid=0xee  ).setLogic( LUCID_A.x(1)&LUCID_C.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID',       ctpid=0xf5  ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1)) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_BGRP7'              ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&bgrp7cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM'               ).setLogic( NIMDIR5.x(1) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_EMPTY'          ).setLogic( LUCID_A.x(1)&LUCID_C.x(1)&cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_EMPTY'              ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_UNPAIRED_ISO'       ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_UNPAIRED_NONISO'    ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM_EMPTY'         ).setLogic( NIMDIR5.x(1)&cosmiccond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_LUCID_C',     ctpid=0xed  ).setLogic( LUCID_C.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A',     ctpid=0xec  ).setLogic( LUCID_A.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C',   ctpid=0xee  ).setLogic( LUCID_A.x(1)&LUCID_C.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID',       ctpid=0xf5  ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1)) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_BGRP7'              ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&bgrp7cond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_COMM'               ).setLogic( NIMDIR5.x(1) & physcond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C_EMPTY'          ).setLogic( LUCID_A.x(1)&LUCID_C.x(1)&cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_EMPTY'              ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&cosmiccond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_UNPAIRED_ISO'       ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_UNPAIRED_NONISO'    ).setLogic( (LUCID_A.x(1)|LUCID_C.x(1))&unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_COMM_EMPTY'         ).setLogic( NIMDIR5.x(1)&cosmiccond).setTriggerType(TT.minb)    # noqa: F821
         LVL1MenuItem('L1_LUCID_COMM_UNPAIRED_ISO'  ).setLogic( NIMDIR5.x(1)&unpaired_isocond).setTriggerType(TT.minb)        
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_ISO'   ).setLogic( LUCID_A.x(1)&LUCID_C.x(1)&unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_NONISO').setLogic( LUCID_A.x(1)&LUCID_C.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)
+        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_ISO'   ).setLogic( LUCID_A.x(1)&LUCID_C.x(1)&unpaired_isocond).setTriggerType(TT.minb)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_NONISO').setLogic( LUCID_A.x(1)&LUCID_C.x(1)&unpaired_nonisocond).setTriggerType(TT.minb)    # noqa: F821
 
 
         # RANDOM
 
-        LVL1MenuItem('L1_RD0_FILLED'         ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_EMPTY'          ).setLogic( RNDM0 & cosmiccond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_FIRSTEMPTY'     ).setLogic( RNDM0 & firstempty         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_UNPAIRED_ISO'   ).setLogic( RNDM0 & unpaired_isocond   ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_UNPAIRED_NONISO').setLogic( RNDM0 & unpaired_nonisocond).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD1_FILLED'         ).setLogic( RNDM1 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD1_EMPTY'          ).setLogic( RNDM1 & cosmiccond         ).setTriggerType(TT.zerobs)
+        LVL1MenuItem('L1_RD0_FILLED'         ).setLogic( RNDM0 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_EMPTY'          ).setLogic( RNDM0 & cosmiccond         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_FIRSTEMPTY'     ).setLogic( RNDM0 & firstempty         ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_UNPAIRED_ISO'   ).setLogic( RNDM0 & unpaired_isocond   ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD0_UNPAIRED_NONISO').setLogic( RNDM0 & unpaired_nonisocond).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD1_FILLED'         ).setLogic( RNDM1 & physcond           ).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_RD1_EMPTY'          ).setLogic( RNDM1 & cosmiccond         ).setTriggerType(TT.zerobs)    # noqa: F821
 
         
         # Bunch groups
 
-        LVL1MenuItem('L1_BGRP1').setLogic(BGRP0 & BGRP1).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP7').setLogic(BGRP0 & BGRP7).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP1_ALFA_BGT').setLogic(BGRP0 & BGRP1).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP4_ALFA_BGT').setLogic(BGRP0 & BGRP4).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP7_ALFA_BGT').setLogic(BGRP0 & BGRP7).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BPTX0_BGRP0', ctpid=0xf1).setLogic(BPTX0.x(1)&BGRP0).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BPTX1_BGRP0', ctpid=0xf2).setLogic(BPTX1.x(1)&BGRP0).setTriggerType(TT.rand)
+        LVL1MenuItem('L1_BGRP1').setLogic(BGRP0 & BGRP1).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP7').setLogic(BGRP0 & BGRP7).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP1_ALFA_BGT').setLogic(BGRP0 & BGRP1).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP4_ALFA_BGT').setLogic(BGRP0 & BGRP4).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BGRP7_ALFA_BGT').setLogic(BGRP0 & BGRP7).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BPTX0_BGRP0', ctpid=0xf1).setLogic(BPTX0.x(1)&BGRP0).setTriggerType(TT.rand)    # noqa: F821
+        LVL1MenuItem('L1_BPTX1_BGRP0', ctpid=0xf2).setLogic(BPTX1.x(1)&BGRP0).setTriggerType(TT.rand)    # noqa: F821
         
 
         # Direct inputs [0x50:0x5f]
         #LVL1MenuItem('L1_LHCF',  ctpid=-1).setLogic( (NIMDIR36.x(1) & physcond)).setTriggerType(TT.minb)        
-        LVL1MenuItem('L1_LHCF',  ctpid=-1).setLogic( (NIMDIR36.x(1) & physcond))
+        LVL1MenuItem('L1_LHCF',  ctpid=-1).setLogic( (NIMDIR36.x(1) & physcond))    # noqa: F821
 
 
 
-        LVL1MenuItem('L1_ALFA_EMPTY').setLogic( NIM_ALFA_LOG.x(1) & cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_BGRP7').setLogic( NIM_ALFA_LOG.x(1) & bgrp7cond).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_EMPTY').setLogic( NIM_ALFA_LOG.x(1) & cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_BGRP7').setLogic( NIM_ALFA_LOG.x(1) & bgrp7cond).setTriggerType(TT.rpcout)    # noqa: F821
 
-        LVL1MenuItem('L1_ALFA_EMPTY_OD', ctpid=-1).setLogic( NIM_ALFA_LOG_OD.x(1)&cosmiccond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_BGRP7_OD', ctpid=-1).setLogic( NIM_ALFA_LOG_OD.x(1)&bgrp7cond).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_EMPTY_OD', ctpid=-1).setLogic( NIM_ALFA_LOG_OD.x(1)&cosmiccond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_BGRP7_OD', ctpid=-1).setLogic( NIM_ALFA_LOG_OD.x(1)&bgrp7cond).setTriggerType(TT.rpcout)    # noqa: F821
 
 
-        LVL1MenuItem('L1_TRT', ctpid=0x4e).setLogic(NIMDIR25.x(1)&BGRP0).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_TRT', ctpid=0x4e).setLogic(NIMDIR25.x(1)&BGRP0).setTriggerType(TT.rpcout)    # noqa: F821
 
-        LVL1MenuItem('L1_L1A_Mon', ctpid=0x4f).setLogic(NIMDIR26.x(1)&BGRP0).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_L1A_Mon', ctpid=0x4f).setLogic(NIMDIR26.x(1)&BGRP0).setTriggerType(TT.rpcout)    # noqa: F821
         
-        LVL1MenuItem('L1_CALREQ0', ctpid=0xfd).setLogic( NIM28.x(1) & calibcond).setTriggerType(TT.calreq0)
-        LVL1MenuItem('L1_CALREQ1', ctpid=0xfe).setLogic( NIM29.x(1) & calibcond).setTriggerType(TT.calreq1)
-        LVL1MenuItem('L1_CALREQ2', ctpid=0xff).setLogic( NIM30.x(1) & calibcond).setTriggerType(TT.calreq2)
+        LVL1MenuItem('L1_CALREQ0', ctpid=0xfd).setLogic( NIM28.x(1) & calibcond).setTriggerType(TT.calreq0)    # noqa: F821
+        LVL1MenuItem('L1_CALREQ1', ctpid=0xfe).setLogic( NIM29.x(1) & calibcond).setTriggerType(TT.calreq1)    # noqa: F821
+        LVL1MenuItem('L1_CALREQ2', ctpid=0xff).setLogic( NIM30.x(1) & calibcond).setTriggerType(TT.calreq2)    # noqa: F821
 
 
-        LVL1MenuItem('L1_NIM_S8C2B21').setLogic(NIMDIR6.x(1) & bgrpcond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_NIM_S8C2B22').setLogic(NIMDIR7.x(1) & bgrpcond).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_NIM_S8C2B23').setLogic(NIMDIR8.x(1) & bgrpcond).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_NIM_S8C2B21').setLogic(NIMDIR6.x(1) & bgrpcond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_NIM_S8C2B22').setLogic(NIMDIR7.x(1) & bgrpcond).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_NIM_S8C2B23').setLogic(NIMDIR8.x(1) & bgrpcond).setTriggerType(TT.rpcout)    # noqa: F821
 
         
 
 
         # Alfa items
-        ARL = NIM_A7R1L.x(1)
-        ARU = NIM_A7R1U.x(1)
-        ALL = NIM_A7L1L.x(1)
-        ALU = NIM_A7L1U.x(1)
-        BRL = NIM_B7R1L.x(1)
-        BRU = NIM_B7R1U.x(1)
-        BLL = NIM_B7L1L.x(1)
-        BLU = NIM_B7L1U.x(1)
+        ARL = NIM_A7R1L.x(1)    # noqa: F821
+        ARU = NIM_A7R1U.x(1)    # noqa: F821
+        ALL = NIM_A7L1L.x(1)    # noqa: F821
+        ALU = NIM_A7L1U.x(1)    # noqa: F821
+        BRL = NIM_B7R1L.x(1)    # noqa: F821
+        BRU = NIM_B7R1U.x(1)    # noqa: F821
+        BLL = NIM_B7L1L.x(1)    # noqa: F821
+        BLU = NIM_B7L1U.x(1)    # noqa: F821
 
         # Elastics1 and 2
-        LVL1MenuItem('L1_ALFA_ELAST1').setLogic( BLU & ALU & ARL & BRL & Not( BLL | ALL | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST2').setLogic( BLL & ALL & ARU & BRU & Not( BLU | ALU | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_ELAST1').setLogic( BLU & ALU & ARL & BRL & Not( BLL | ALL | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST2').setLogic( BLL & ALL & ARU & BRU & Not( BLU | ALU | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Elastics 11 - Elastics 18
-        LVL1MenuItem('L1_ALFA_ELAST11').setLogic( BLU & ALU & ARL & BRL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST12').setLogic( BLL & ALL & ARU & BRU & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST13').setLogic( ( BLU | ALU ) & ( ARL & BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST14').setLogic( ( BLU & ALU ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST15').setLogic( ( BLU | ALU ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST16').setLogic( ( BLL | ALL ) & ( ARU & BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST17').setLogic( ( BLL & ALL ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ELAST18').setLogic( ( BLL | ALL ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_ELAST11').setLogic( BLU & ALU & ARL & BRL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST12').setLogic( BLL & ALL & ARU & BRU & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST13').setLogic( ( BLU | ALU ) & ( ARL & BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST14').setLogic( ( BLU & ALU ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST15').setLogic( ( BLU | ALU ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST16').setLogic( ( BLL | ALL ) & ( ARU & BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST17').setLogic( ( BLL & ALL ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ELAST18').setLogic( ( BLL | ALL ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Single_Diffraction 1 - 8
-        LVL1MenuItem('L1_ALFA_SDIFF1').setLogic( BLU & ALU & Not( BLL | ALL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF2').setLogic( ARL & BRL & Not( BLU | BLL | ALU | ALL | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF3').setLogic( BLL & ALL & Not( BLU | ALU | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF4').setLogic( ARU & BRU & Not( BLU | BLL | ALU | ALL | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SDIFF1').setLogic( BLU & ALU & Not( BLL | ALL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF2').setLogic( ARL & BRL & Not( BLU | BLL | ALU | ALL | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF3').setLogic( BLL & ALL & Not( BLU | ALU | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF4').setLogic( ARU & BRU & Not( BLU | BLL | ALU | ALL | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
-        LVL1MenuItem('L1_ALFA_SDIFF5').setLogic( BLU & ALU & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF6').setLogic( ARL & BRL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF7').setLogic( BLL & ALL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SDIFF8').setLogic( ARU & BRU & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SDIFF5').setLogic( BLU & ALU & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF6').setLogic( ARL & BRL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF7').setLogic( BLL & ALL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SDIFF8').setLogic( ARU & BRU & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Big_showers 1 - 4
-        LVL1MenuItem('L1_ALFA_SHOW1').setLogic( BLU & BLL & ALU & ALL & Not( ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOW2').setLogic( ARU & ARL & BRU & BRL & Not( BLU | BLL | ALU | ALL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOW3').setLogic( BLU & BLL & ALU & ALL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOW4').setLogic( ARU & ARL & BRU & BRL & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SHOW1').setLogic( BLU & BLL & ALU & ALL & Not( ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOW2').setLogic( ARU & ARL & BRU & BRL & Not( BLU | BLL | ALU | ALL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOW3').setLogic( BLU & BLL & ALU & ALL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOW4').setLogic( ARU & ARL & BRU & BRL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Systematics 1 - 4
-        LVL1MenuItem('L1_ALFA_SYST1').setLogic( BLU & BLL & Not( ALU | ALL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST2').setLogic( ALU & ALL & Not( BLU | BLL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST3').setLogic( ARU & ARL & Not( BLU | BLL | ALU | ALL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST4').setLogic( BRU & BRL & Not( BLU | BLL | ALU | ALL | ARU | ARL ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SYST1').setLogic( BLU & BLL & Not( ALU | ALL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST2').setLogic( ALU & ALL & Not( BLU | BLL | ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST3').setLogic( ARU & ARL & Not( BLU | BLL | ALU | ALL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST4').setLogic( BRU & BRL & Not( BLU | BLL | ALU | ALL | ARU | ARL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Big_showers_Systematics 1 - 5
-        LVL1MenuItem('L1_ALFA_SHOWSYST1').setLogic( BLU & BLL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOWSYST2').setLogic( ALU & ALL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOWSYST3').setLogic( ARU & ARL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOWSYST4').setLogic( BRU & BRL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SHOWSYST5').setLogic( ( BLU | BLL | ALU | ALL ) & ( ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SHOWSYST1').setLogic( BLU & BLL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOWSYST2').setLogic( ALU & ALL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOWSYST3').setLogic( ARU & ARL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOWSYST4').setLogic( BRU & BRL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SHOWSYST5').setLogic( ( BLU | BLL | ALU | ALL ) & ( ARU | ARL | BRU | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # Systematics 9 - 12, 17, 18
-        LVL1MenuItem('L1_ALFA_SYST9' ).setLogic( BLU & ALU & ARU & BRU & Not( BLL | ALL | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST10').setLogic( BLL & ALL & ARL & BRL & Not( BLU | ALU | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST11').setLogic( BLU & ALU & ARU & BRU & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST12').setLogic( BLL & ALL & ARL & BRL & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST17').setLogic( ( BLU | ALU ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_SYST18').setLogic( ( BLL | ALL ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_SYST9' ).setLogic( BLU & ALU & ARU & BRU & Not( BLL | ALL | ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST10').setLogic( BLL & ALL & ARL & BRL & Not( BLU | ALU | ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST11').setLogic( BLU & ALU & ARU & BRU & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST12').setLogic( BLL & ALL & ARL & BRL & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST17').setLogic( ( BLU | ALU ) & ( ARU | BRU ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_SYST18').setLogic( ( BLL | ALL ) & ( ARL | BRL ) & physcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # ANY_ALFA = Minimum_Bias : B7L1U or B7L1L or A7L1U or A7L1L or A7R1U or A7R1L or B7R1U or B7R1L
         ANY_ALFA = BLU | BLL | ALU | ALL | ARU | ARL | BRU | BRL
-        LVL1MenuItem('L1_ALFA_ANY'                ).setLogic( ANY_ALFA & physcond            ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ANY_EMPTY'          ).setLogic( ANY_ALFA & cosmiccond          ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ANY_FIRSTEMPTY'     ).setLogic( ANY_ALFA & firstempty          ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_ISO'   ).setLogic( ANY_ALFA & unpaired_isocond    ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_NONISO').setLogic( ANY_ALFA & unpaired_nonisocond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_ANY'                ).setLogic( ANY_ALFA & physcond            ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_EMPTY'          ).setLogic( ANY_ALFA & cosmiccond          ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_FIRSTEMPTY'     ).setLogic( ANY_ALFA & firstempty          ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_ISO'   ).setLogic( ANY_ALFA & unpaired_isocond    ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_NONISO').setLogic( ANY_ALFA & unpaired_nonisocond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         #---------------------------------
         # new ALFA items for 2012 running:
         #---------------------------------
-        ARL_OD = NIM_A7R1L_OD.x(1)
-        ARU_OD = NIM_A7R1U_OD.x(1)
-        ALL_OD = NIM_A7L1L_OD.x(1)
-        ALU_OD = NIM_A7L1U_OD.x(1)
-        BRL_OD = NIM_B7R1L_OD.x(1)
-        BRU_OD = NIM_B7R1U_OD.x(1)
-        BLL_OD = NIM_B7L1L_OD.x(1)
-        BLU_OD = NIM_B7L1U_OD.x(1)
-
-        LVL1MenuItem('L1_ALFA_A7L1U').setLogic( ALU & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7L1L').setLogic( ALL & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7R1U').setLogic( ARU & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7R1L').setLogic( ARL & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7L1U').setLogic( BLU & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7L1L').setLogic( BLL & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7R1U').setLogic( BRU & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7R1L').setLogic( BRL & BGRP0 ).setTriggerType(TT.rpcout)
-
-        LVL1MenuItem('L1_ALFA_A7L1U_OD').setLogic( ALU_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7L1L_OD').setLogic( ALL_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7L1U_OD').setLogic( BLU_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7L1L_OD').setLogic( BLL_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7R1U_OD').setLogic( ARU_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7R1L_OD').setLogic( ARL_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7R1U_OD').setLogic( BRU_OD & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7R1L_OD').setLogic( BRL_OD & BGRP0 ).setTriggerType(TT.rpcout)
-
-        LVL1MenuItem('L1_ALFA_B7L1_OD').setLogic( ( BLU_OD & BLL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7L1_OD').setLogic( ( ALU_OD & ALL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_A7R1_OD').setLogic( ( ARU_OD & ARL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B7R1_OD').setLogic( ( BRU_OD & BRL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)
+        ARL_OD = NIM_A7R1L_OD.x(1)    # noqa: F821
+        ARU_OD = NIM_A7R1U_OD.x(1)    # noqa: F821
+        ALL_OD = NIM_A7L1L_OD.x(1)    # noqa: F821
+        ALU_OD = NIM_A7L1U_OD.x(1)    # noqa: F821
+        BRL_OD = NIM_B7R1L_OD.x(1)    # noqa: F821
+        BRU_OD = NIM_B7R1U_OD.x(1)    # noqa: F821
+        BLL_OD = NIM_B7L1L_OD.x(1)    # noqa: F821
+        BLU_OD = NIM_B7L1U_OD.x(1)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_A7L1U').setLogic( ALU & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1L').setLogic( ALL & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1U').setLogic( ARU & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1L').setLogic( ARL & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1U').setLogic( BLU & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1L').setLogic( BLL & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1U').setLogic( BRU & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1L').setLogic( BRL & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_A7L1U_OD').setLogic( ALU_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1L_OD').setLogic( ALL_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1U_OD').setLogic( BLU_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7L1L_OD').setLogic( BLL_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1U_OD').setLogic( ARU_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1L_OD').setLogic( ARL_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1U_OD').setLogic( BRU_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1L_OD').setLogic( BRL_OD & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+
+        LVL1MenuItem('L1_ALFA_B7L1_OD').setLogic( ( BLU_OD & BLL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7L1_OD').setLogic( ( ALU_OD & ALL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_A7R1_OD').setLogic( ( ARU_OD & ARL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B7R1_OD').setLogic( ( BRU_OD & BRL_OD ) & BGRP0 ).setTriggerType(TT.rpcout)    # noqa: F821
         
-        LVL1MenuItem('L1_ALFA_B1_EMPTY').setLogic( ( BLU | BLL | ALU | ALL ) & cosmiccond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ALFA_B2_EMPTY').setLogic( ( ARU | ARL | BRU | BRL ) & cosmiccond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ALFA_B1_EMPTY').setLogic( ( BLU | BLL | ALU | ALL ) & cosmiccond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ALFA_B2_EMPTY').setLogic( ( ARU | ARL | BRU | BRL ) & cosmiccond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # ALFA and MBTS 
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C').setLogic( MBTS_A.x(2) & (( ARU & BRU ) | ( ARL & BRL )) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A').setLogic( MBTS_C.x(2) & (( ALU & BLU ) | ( ALL & BLL )) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_2_ALFA').setLogic( MBTS_2 & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)
-
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(2) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(2) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_2_ALFA_UNPAIRED_ISO'    ).setLogic( MBTS_2 & ANY_ALFA & unpaired_isocond ).setTriggerType(TT.rpcout)
-
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C').setLogic( MBTS_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A').setLogic( MBTS_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_MBTS_2_A_ALFA_C').setLogic( MBTS_A.x(2) & (( ARU & BRU ) | ( ARL & BRL )) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C_ALFA_A').setLogic( MBTS_C.x(2) & (( ALU & BLU ) | ( ALL & BLL )) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_ALFA').setLogic( MBTS_2 & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(2) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(2) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_2_ALFA_UNPAIRED_ISO'    ).setLogic( MBTS_2 & ANY_ALFA & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+
+        LVL1MenuItem('L1_MBTS_1_A_ALFA_C').setLogic( MBTS_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_C_ALFA_A').setLogic( MBTS_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO').setLogic( MBTS_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO').setLogic( MBTS_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
             
         # ALFA and LUCID 
-        LVL1MenuItem('L1_LUCID_A_ALFA_C').setLogic( LUCID_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_LUCID_C_ALFA_A').setLogic( LUCID_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_LUCID_A_ALFA_C_UNPAIRED_ISO').setLogic( LUCID_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_LUCID_C_ALFA_A_UNPAIRED_ISO').setLogic( LUCID_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_LUCID_ALFA').setLogic( (LUCID_A.x(1) | LUCID_C.x(1)) & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_LUCID_A_ALFA_C').setLogic( LUCID_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_C_ALFA_A').setLogic( LUCID_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_A_ALFA_C_UNPAIRED_ISO').setLogic( LUCID_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_C_ALFA_A_UNPAIRED_ISO').setLogic( LUCID_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & unpaired_isocond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_LUCID_ALFA').setLogic( (LUCID_A.x(1) | LUCID_C.x(1)) & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # ALFA and ZDC
-        LVL1MenuItem('L1_ZDC_A_ALFA_C').setLogic( ZDC_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ZDC_C_ALFA_A').setLogic( ZDC_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)
-        LVL1MenuItem('L1_ZDC_ALFA').setLogic( (ZDC_A.x(1) | ZDC_C.x(1)) & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)
+        LVL1MenuItem('L1_ZDC_A_ALFA_C').setLogic( ZDC_A.x(1) & ((ARU & BRU) | (ARL & BRL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_C_ALFA_A').setLogic( ZDC_C.x(1) & ((ALU & BLU) | (ALL & BLL)) & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_ZDC_ALFA').setLogic( (ZDC_A.x(1) | ZDC_C.x(1)) & ANY_ALFA & bgrpcond ).setTriggerType(TT.rpcout)    # noqa: F821
 
         # new combined ALFA items for 2012 running
-        LVL1MenuItem('L1_EM3_ALFA_ANY'   ).setLogic( EM3.x(1) & ANY_ALFA & physcond ).setTriggerType( TT.calo | TT.caloem | TT.rpcout)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A').setLogic( EM3.x(1) & MBTS_A.x(1) & ((BRU & ARU) | (BRL & ARL)) & physcond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C').setLogic( EM3.x(1) & MBTS_C.x(1) & ((BLU & ALU) | (BLL & ALL)) & physcond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)
+        LVL1MenuItem('L1_EM3_ALFA_ANY'   ).setLogic( EM3.x(1) & ANY_ALFA & physcond ).setTriggerType( TT.calo | TT.caloem | TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_A').setLogic( EM3.x(1) & MBTS_A.x(1) & ((BRU & ARU) | (BRL & ARL)) & physcond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_C').setLogic( EM3.x(1) & MBTS_C.x(1) & ((BLU & ALU) | (BLL & ALL)) & physcond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)    # noqa: F821
         
-        LVL1MenuItem('L1_EM3_ALFA_ANY_UNPAIRED_ISO'   ).setLogic( EM3.x(1) & ANY_ALFA & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.rpcout)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO').setLogic( EM3.x(1) & MBTS_C.x(1) & ((BLU & ALU) | (BLL & ALL)) & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO').setLogic( EM3.x(1) & MBTS_A.x(1) & ((BRU & ARU) | (BRL & ARL)) & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)
+        LVL1MenuItem('L1_EM3_ALFA_ANY_UNPAIRED_ISO'   ).setLogic( EM3.x(1) & ANY_ALFA & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO').setLogic( EM3.x(1) & MBTS_C.x(1) & ((BLU & ALU) | (BLL & ALL)) & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)    # noqa: F821
+        LVL1MenuItem('L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO').setLogic( EM3.x(1) & MBTS_A.x(1) & ((BRU & ARU) | (BRL & ARL)) & unpaired_isocond).setTriggerType( TT.calo | TT.caloem | TT.minb | TT.rpcout)    # noqa: F821
 
 
-        LVL1MenuItem('L1_TOPO_DPHI', ctpid=300).setLogic( TOPO_DPHI.x(1) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TOPO_DPHI', ctpid=300).setLogic( TOPO_DPHI.x(1) & physcond).setTriggerType( TT.calo )    # noqa: F821
 
 
         # =======================================================
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_PhaseII.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_PhaseII.py
new file mode 100644
index 0000000000000000000000000000000000000000..300da8e1a9fab40b423d8701ef19d33671b5e3cf
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_PhaseII.py
@@ -0,0 +1,73 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenu.l1menu.Menu_MC_PhaseII' )
+
+
+def defineMenu():
+    """
+    Use MC_pp_v7 L1 menu for this
+    """
+    
+    import Menu_MC_pp_v7
+    from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
+
+
+    Menu_MC_pp_v7.defineMenu()
+
+    Lvl1Flags.thresholds += [
+        ]
+
+    Lvl1Flags.items += [
+        # for running high rate tests in secondary CTP partitions
+        'L1_RD2_BGRP14', 'L1_RD3_BGRP15',
+        ]
+
+   #Make sure these triggers don't get assigned random CTPIDs
+    Lvl1Flags.CtpIdMap().update({
+        'L1_RD2_BGRP14' : 463,
+        'L1_RD3_BGRP15' : 464,
+    })
+
+    #---------------------------------
+    # L1menu in MCppV5 is basis 
+    # BeamSplashes: adapt some thresholds and items
+    #---------------------------------
+    Lvl1Flags.ThresholdMap = {
+        }
+
+    Lvl1Flags.ItemMap = {
+        }
+    
+    #----------------------------------------------
+    def remapThresholds():
+        threshToRemove = []
+        for index, thresholdName in enumerate(Lvl1Flags.thresholds()):
+            if thresholdName in Lvl1Flags.ThresholdMap():
+                if (Lvl1Flags.ThresholdMap()[thresholdName] != ''):
+                    Lvl1Flags.thresholds()[index] = Lvl1Flags.ThresholdMap()[thresholdName]
+                else:
+                    threshToRemove.append(index)
+
+        for t in reversed(threshToRemove):
+            del Lvl1Flags.thresholds()[t]
+    #----------------------------------------------
+                    
+    remapThresholds()
+
+    #----------------------------------------------
+    def remapItems():  
+        itemsToRemove = []
+        for itemIndex, itemName in enumerate(Lvl1Flags.items()):
+            if (itemName in Lvl1Flags.ItemMap()):
+                if (Lvl1Flags.ItemMap()[itemName] != ''):
+                    Lvl1Flags.items()[itemIndex] = Lvl1Flags.ItemMap()[itemName]                                                
+                else: 
+                    itemsToRemove.append(itemIndex)
+
+        for i in reversed(itemsToRemove):
+            del Lvl1Flags.items()[i]
+    #----------------------------------------------
+                                           
+    remapItems()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
index 3b87c5ab364a809a31141df107c7662fee024770..1cb6ef6b8371bb690be09d3c26fc3f71c3861ed0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
@@ -1,4 +1,18 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#
+# Run this file in order to print out the empty slots
+
+def print_available():
+    from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
+    defineMenu()
+    available = []
+    for i in range(512):
+      if i==463 or  i==464: continue #reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15
+      if i>=509 and i<=511: continue #reserved for CALREQ
+      if not i in Lvl1Flags.CtpIdMap().values(): available.append(str(i))
+    available.sort()
+    print "There are %d available CTP IDs:"%len(available),",".join(available)
+    print "IDs >= 472 go in partition 2, IDs >= 492 go in partition 3"
 
 def defineMenu():
     """
@@ -90,7 +104,8 @@ def defineMenu():
         # 8 x TE
         #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
         #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
+        'TE5', 'TE10', 'TE20', 'TE30', 'TE40', 'TE50', 'TE60', 'TE70',
+        #'TE2', 'TE3', 'TE4', 'TE5', 'TE10', 'TE20', 'TE30', 'TE70',
 
         # 8 x XE (for standard XE)
         #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
@@ -381,10 +396,10 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
          'L1_MU20_FIRSTEMPTY','L1_MU21_FIRSTEMPTY',
 
-        
+        'L1_2EM3_VTE70', 
         
         # multi lepton
-        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
+        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7",
 	"L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
         "L1_EM7_MU10",
         "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
@@ -419,9 +434,12 @@ def defineMenu():
         "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
         "L1_TAU20IM_2TAU12IM_4J12",
         "L1_TAU25IM_2TAU20IM_2J25_3J20", 
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
         'L1_DR-MU10TAU12I_TAU12I-J25', 
         "L1_MU10_TAU12I-J25",
+        "L1_2TAU20IM_3J20",
+        "L1_2TAU20IM_J25_3J20",
+        "L1_TAU25IM_2TAU12IM_J25_3J12",
+
 
 
         # combined tau - xe
@@ -439,7 +457,6 @@ def defineMenu():
 #        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
-        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
@@ -452,11 +469,10 @@ def defineMenu():
         #'L1_EM18VH_3J20',
 
         # combined mu - jet
-        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
+        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
 #ATR-13743        'L1_MU4_J30',
         #'L1_MU4_J50',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
-        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
 
@@ -468,6 +484,7 @@ def defineMenu():
         "L1_J20.28ETA31",
         #'L1_J40.0ETA25', 
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
+        "L1_J12_UNPAIREDB1", "L1_J12_UNPAIREDB2", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
@@ -479,7 +496,7 @@ def defineMenu():
         # multi jet
 
         "L1_J20_J20.31ETA49",
-        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
+        "L1_3J15", "L1_3J40",  "L1_3J50", "L1_4J15", "L1_4J20",
         "L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
@@ -503,7 +520,7 @@ def defineMenu():
         "L1_5J15.0ETA25", 
         
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50",
 
         #'L1_2J40_XE45',
         "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
@@ -511,34 +528,47 @@ def defineMenu():
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
+        'L1_XE10', 'L1_XE30', 'L1_XE300',
         
         #XS
-        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
         #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
         #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
-        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
+        "L1_TE5", "L1_TE10", "L1_TE20", "L1_TE30", "L1_TE40", "L1_TE50", "L1_TE60", "L1_TE70",
+        #"L1_TE2",        "L1_TE3",   "L1_TE4",  "L1_TE5",        "L1_TE10",        "L1_TE20",        "L1_TE30",      "L1_TE70",
 
         #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
         #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
-        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
+        #"L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
+        #"L1_VTE2",        "L1_VTE3",   "L1_VTE4",  "L1_VTE5",        "L1_VTE10",
+
+        #VTE + MBTS
+        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
+        
+        #TE + MU
+        "L1_MU4_TE10", "L1_MU4_TE40", "L1_MU4_TE50",
 
         # MBTS
         "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
         "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
         "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
         "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
-#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
-#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
-#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
-#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
-#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
-#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
+         'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
+         'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
+         'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
+         'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
+         'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
+         'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
         # beam splashes
         "L1_MBTS_4_A", "L1_MBTS_4_C",
+        
+        #Overlay
+#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
+        
+        #BeamSpot
+#        "L1_MBTS_1_VTE70",
 
         #BGRP9
         'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
@@ -552,13 +582,16 @@ def defineMenu():
         "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
         "L1_RD3_FILLED","L1_RD3_EMPTY",
         'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
+        'L1_RD0_BGRP9', 'L1_RD0_BGRP10', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
 
         #LUCID
         'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
         'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
+        'L1_LUCID_BGRP9','L1_LUCID_BGRP11',
+        
+
         # ZDC
         'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
         'L1_ZDC_AND', # FTHR
@@ -590,6 +623,7 @@ def defineMenu():
         # BCM
         'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
+        'L1_BCM_AC_UNPAIREDB1','L1_BCM_CA_UNPAIREDB2',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
@@ -606,12 +640,12 @@ def defineMenu():
         'L1_AFP_A_AND_C','L1_AFP_A_OR_C', 'L1_AFP_A', 'L1_AFP_C',
         'L1_AFP_A_AND_C_MBTS_2','L1_AFP_A_OR_C_MBTS_2',
         'L1_AFP_A_AND_C_J12','L1_AFP_A_OR_C_J12',
-        'L1_AFP_A_AND_C_EM3','L1_AFP_A_OR_C_EM3',
-        'L1_AFP_A_AND_C_MU4','L1_AFP_A_OR_C_MU4',
+        'L1_EM3_AFP_A_AND_C','L1_EM3_AFP_A_OR_C',
+        'L1_MU4_AFP_A_AND_C','L1_MU4_AFP_A_OR_C',
         'L1_AFP_A_AND_C_TE5','L1_AFP_A_OR_C_TE5',
-        'L1_AFP_A_AND_C_J50','L1_AFP_A_AND_C_SPECTOF_J50',
-        'L1_AFP_A_AND_C_J75','L1_AFP_A_AND_C_SPECTOF_J75',
-        'L1_AFP_A_AND_C_J100','L1_AFP_A_AND_C_SPECTOF_J100',
+        'L1_AFP_A_AND_C_SPECTOF_J50',
+        'L1_AFP_A_AND_C_SPECTOF_J75',
+        'L1_AFP_A_AND_C_SPECTOF_J100',
 
 
         #--------------------------------
@@ -619,7 +653,7 @@ def defineMenu():
         #--------------------------------
 
         # B-jet
-        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
+        'L1_BTAG-MU4J15', 'L1_BTAG-MU6J20',
         #'L1_BTAG-MU4J20',
         'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
         #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
@@ -635,7 +669,7 @@ def defineMenu():
         'L1_2MU4_J40_XE50',
         'L1_2MU4_J20_XE40_DPHI-J20s2XE30','L1_2MU4_J20_XE50_DPHI-J20s2XE30',
         'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
-        'L1_MU4_XE60','L1_2MU4_XE60',
+        'L1_MU4_XE60',
 
         # HT
         'L1_HT190-J15.ETA21',
@@ -648,7 +682,7 @@ def defineMenu():
         
         # Jpsi T&P
         'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
+        'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
         
         # W T&P
 #        'L1_W-05DPHI-JXE-0',
@@ -667,22 +701,8 @@ def defineMenu():
         'L1_EM12_W-MT25',
 #        'L1_EM12_W-MT35',
         'L1_EM15_W-MT35',
-        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
         'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
         'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM12_W-MT35_XS50',
-        'L1_EM15_W-MT35_XS60',
-        'L1_EM10VH_W-MT35_XS50',
-        'L1_EM15VH_W-MT35_XS60',
-        'L1_EM20VH_W-MT35_XS60',
-        'L1_EM22VHI_W-MT35_XS40',
         # Old
         'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
         'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
@@ -732,7 +752,6 @@ def defineMenu():
 #SX        'L1_BPH-4M8-MU6MU4-B',        
 #SX        'L1_BPH-4M8-MU6MU4-BO',
         'L1_DY-DR-2MU4',
-        'L1_EM15VH_2EM8VH_MU6',
         #'L1_DY-BOX-MU6MU4',
         'L1_DY-BOX-2MU6',
         'L1_LFV-MU',
@@ -743,13 +762,8 @@ def defineMenu():
         'L1_J40_XE50_DPHI-J20s2XE50',
         'L1_DPHI-J20XE50',
         'L1_DPHI-CJ20XE50',
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
-        'L1_MJJ-900',
         'L1_MJJ-800',
-        'L1_MJJ-700',
         'L1_MJJ-400',
         #'L1_MJJ-350',
 #        'L1_MJJ-300',
@@ -767,7 +781,6 @@ def defineMenu():
         'L1_DR-EM15TAU12I-J25',    
         'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
-        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
 
         'L1_DR25-TAU20ITAU12I',
@@ -785,10 +798,7 @@ def defineMenu():
 
 #new bhysics
         #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
         'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
         'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
         'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
@@ -796,40 +806,27 @@ def defineMenu():
         'L1_2MU4-B',
         'L1_2MU6-B' ,
         #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
         #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
         #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B',
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
         'L1_MU6_2MU4-B',
 
-        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
         'L1_BPH-8M15-MU6MU4',
         'L1_BPH-8M15-2MU6',
         
         # combined L1Topo for VBF
         'L1_MU6_MJJ-200',
-        'L1_MU6_MJJ-300',
-        'L1_MU6_MJJ-400',
-        'L1_MU6_MJJ-500',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
         'L1_3J20_4J20.0ETA49_MJJ-400',
         'L1_3J20_4J20.0ETA49_MJJ-700',
         'L1_3J20_4J20.0ETA49_MJJ-800',
         'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        'L1_XE35_MJJ-200',
    
         ### ATR-15062
         'L1_EM18VHI_MJJ-300',
 
-        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
@@ -893,10 +890,10 @@ def defineMenu():
         'L1_MU21_FTK',
         'L1_TAU12IM_FTK', 
         'L1_TAU20IM_FTK',
-        'L1_MU21_TAU12IM_FTK', 
+        'L1_MU20_TAU12IM_FTK', 
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12_FTK',
         'L1_DR-TAU20ITAU12I-J25_FTK',
-        'L1_4J15_FTK',
+        'L1_4J20_FTK',
         'L1_4J15.0ETA25_FTK',
         'L1_J15_FTK',
         'L1_J40_FTK',
@@ -905,13 +902,13 @@ def defineMenu():
         ]
     
 
-    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
-    #Free slot [ATR-14858], 16-08-16
-    #[82,143,377,378,379,406,409,416,480]
-
-    
+#CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
+#Free CTP IDs (2017-09-01) are: 475-478, 
+# 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (in MC_Physics_pp_v7)
+# 509-511 are reserved for CALREQ
 
     Lvl1Flags.CtpIdMap = {
+
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
@@ -998,10 +995,13 @@ def defineMenu():
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
 
+        'L1_2TAU20IM_3J20' : 486, 
+        'L1_2TAU20IM_J25_3J20' : 479, 
+        'L1_TAU25IM_2TAU12IM_J25_3J12' : 481,
+
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
         'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
         'L1_TAU20IM_2TAU12IM_4J12' : 408,
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
         'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
         'L1_MU10_TAU12I-J25' : 73,
         'L1_TAU20IM_2J20_XE45' : 74,
@@ -1011,15 +1011,11 @@ def defineMenu():
         'L1_MU10_TAU12IM_XE35' : 81,
 #        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
 #        'L1_EM15VH_JJ15.23ETA49' : 86,
-        'L1_MU4_J12' : 87,
-        'L1_MU4_J50_XE40' : 330,
         'L1_MU6_J20' : 88,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_2MU4_J40_XE20' : 331,
         'L1_MU20_J40'  : 428,
         'L1_MU20_XE30' : 433,
         'L1_J12' : 91,
@@ -1048,6 +1044,8 @@ def defineMenu():
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
         'L1_J12_UNPAIRED_NONISO' : 114,
+        'L1_J12_UNPAIREDB1' : 443,
+        'L1_J12_UNPAIREDB2' : 476,
         'L1_J12_ABORTGAPNOTCALIB' : 115,
         'L1_J15.31ETA49_UNPAIRED_ISO' : 75,
         'L1_J30_EMPTY' : 116,
@@ -1061,9 +1059,7 @@ def defineMenu():
 
         'L1_J20_J20.31ETA49' : 125,
         'L1_3J15' : 126,
-        'L1_3J20' : 127,
         'L1_3J40' : 128,
-        'L1_3J15.0ETA25' : 129,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
@@ -1077,22 +1073,14 @@ def defineMenu():
         'L1_J30.0ETA49_2J20.0ETA49' : 137,
 
        
-        'L1_TE10' : 138,
-        'L1_TE15' : 82,
-        'L1_TE25' : 143,
-
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
         #'L1_J75_XE40' : 143,
-        'L1_J75_XE50' : 133,
 
         'L1_XE10': 68,
         #'L1_XE25': 82,
         'L1_XE30': 85,
-        'L1_XE65': 108,
-        'L1_XE75': 134,
-        'L1_XE150': 156,
         'L1_XE300': 187,
         
         'L1_XE35' : 144,
@@ -1103,18 +1091,24 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XS20' : 152,
-        'L1_XS30' : 153,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
 
-        'L1_TE30' : 157,
-        'L1_TE40' : 158,
-        'L1_TE70' : 159,
-        'L1_TE30.0ETA24' : 160,
+        'L1_TE5' : 157,
+        'L1_TE10' : 158,
+        'L1_TE20' : 159,
+        'L1_TE30' : 138,
+        'L1_TE40' : 82,
+        'L1_TE50' : 143,
+        'L1_TE60' : 160,
+        'L1_TE70' : 152,
+
+
+#        'L1_MBTS_1_VTE2' : 160,
         'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
         'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
         'L1_BCM_AC_UNPAIRED_ISO' : 163,
+        'L1_BCM_AC_UNPAIREDB1' : 447,
         'L1_MBTS_1_EMPTY' : 164,
         'L1_MBTS_1_UNPAIRED_ISO' : 165,
         'L1_MBTS_2_EMPTY' : 166,
@@ -1135,34 +1129,33 @@ def defineMenu():
 	'L1_TAU40_2TAU20IM' : 254,
         'L1_TAU60_2TAU40' : 458,
         'L1_MU10_2J15_J20' : 255,
-# freeing some CTPIDs  
-#        'L1_MBTSA0' : 170,
-#        'L1_MBTSA1' : 171,
-#        'L1_MBTSA2' : 172,
-#        'L1_MBTSA3' : 173,
-#        'L1_MBTSA4' : 174,
-#        'L1_MBTSA5' : 175,
-#        'L1_MBTSA6' : 176,
-#        'L1_MBTSA7' : 177,
-#        'L1_MBTSA8' : 178,
-#        'L1_MBTSA10' : 179,
-#        'L1_MBTSA12' : 180,
-#        'L1_MBTSA14' : 181,
-#        'L1_MBTSC0' : 182,
-#        'L1_MBTSC1' : 183,
-#        'L1_MBTSC2' : 184,
-#        'L1_MBTSC3' : 185,
-#        'L1_MBTSC4' : 186,
-#        'L1_MBTSC5' : 187,
-#        'L1_MBTSC6' : 188,
-#        'L1_MBTSC7' : 189,
-#        'L1_MBTSC8' : 190,
-#        'L1_MBTSC10' : 191,
-#        'L1_MBTSC12' : 192,
-#        'L1_MBTSC14' : 193,
+# freeing some CTPIDs  (used for the Xe pilot run)
+         'L1_MBTSA0' : 134,
+         'L1_MBTSA1' : 445,
+         'L1_MBTSA2' : 153,
+         'L1_MBTSA3' : 156,
+         'L1_MBTSA4' : 178,
+         'L1_MBTSA5' : 239,
+         'L1_MBTSA6' : 244,
+         'L1_MBTSA7' : 265,
+         'L1_MBTSA8' : 274,
+         'L1_MBTSA10' : 284,
+         'L1_MBTSA12' : 287,
+         'L1_MBTSA14' : 289,
+         'L1_MBTSC0' : 296,
+         'L1_MBTSC1' : 297,
+         'L1_MBTSC2' : 298,
+         'L1_MBTSC3' : 306,
+         'L1_MBTSC4' : 307,
+         'L1_MBTSC5' : 310,
+         'L1_MBTSC6' : 311,
+         'L1_MBTSC7' : 331,
+         'L1_MBTSC8' : 359,
+         'L1_MBTSC10' : 360,
+         'L1_MBTSC12' : 361,
+         'L1_MBTSC14' : 435,
 
         
-        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
         'L1_BPH-8M15-MU6MU4' : 179,
         'L1_BPH-8M15-2MU6' : 180,
         'L1_J15.0ETA25_2J15.31ETA49': 305 , 
@@ -1170,7 +1163,7 @@ def defineMenu():
         'L1_J40.0ETA25_2J15.31ETA49' : 181,
         'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
 
-        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
+        "L1_J40.0ETA25_2J30_J20.31ETA49": 465, 
 
         "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
         "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
@@ -1207,17 +1200,14 @@ def defineMenu():
         'L1_AFP_A_OR_C_MBTS_2': 317,
         'L1_AFP_A_AND_C_J12': 379,
         'L1_AFP_A_OR_C_J12': 436,
-        'L1_AFP_A_AND_C_EM3': 437,
-        'L1_AFP_A_OR_C_EM3': 438,
-        'L1_AFP_A_AND_C_MU4': 439,
-        'L1_AFP_A_OR_C_MU4': 440,
+        'L1_EM3_AFP_A_AND_C': 437,
+        'L1_EM3_AFP_A_OR_C': 438,
+        'L1_MU4_AFP_A_AND_C': 439,
+        'L1_MU4_AFP_A_OR_C': 440,
         'L1_AFP_A_AND_C_TE5': 441,
         'L1_AFP_A_OR_C_TE5': 442,
-        'L1_AFP_A_AND_C_J50': 443,
         'L1_AFP_A_AND_C_SPECTOF_J50': 444,
-        'L1_AFP_A_AND_C_J75': 445,
         'L1_AFP_A_AND_C_SPECTOF_J75': 446,
-        'L1_AFP_A_AND_C_J100': 447,
         'L1_AFP_A_AND_C_SPECTOF_J100': 457,
        
 #        'L1_EM8I' : 183,
@@ -1242,6 +1232,7 @@ def defineMenu():
         'L1_RD3_EMPTY' : 208,
         'L1_RD0_FIRSTEMPTY' : 209,
         'L1_RD0_BGRP9' : 210,
+        'L1_RD0_BGRP10' : 473,
         'L1_RD0_BGRP11' : 211,
         'L1_LUCID' : 212,
         'L1_LUCID_EMPTY' : 213,
@@ -1264,6 +1255,7 @@ def defineMenu():
         
       
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
+        'L1_BCM_CA_UNPAIREDB2' : 475,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
         'L1_BCM_AC_ABORTGAPNOTCALIB' : 232,
@@ -1273,12 +1265,10 @@ def defineMenu():
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
         'L1_BTAG-MU4J15' : 238,
-        'L1_BTAG-MU4J30' : 239,
         'L1_ZB' : 240,
         'L1_BPTX0_BGRP0' : 241,
         'L1_BPTX1_BGRP0' : 242,
         'L1_BTAG-MU6J20' : 243,
-        'L1_BTAG-MU6J25' : 244,
 #        'L1_BTAG-MU4J20' : 245,
         'L1_3J15_BTAG-MU4J15' : 246,
         'L1_3J15_BTAG-MU4J30' : 247,
@@ -1290,10 +1280,7 @@ def defineMenu():
         'L1_J40_XE50_DPHI-J20s2XE50': 245,
         'L1_J40_DPHI-J20XE50' : 252,
         'L1_J40_DPHI-CJ20XE50' : 253,
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
 
         'L1_2MU4_J40_XE50' : 449,
         'L1_2MU4_J20_XE40_DPHI-J20s2XE30' : 450,
@@ -1301,7 +1288,6 @@ def defineMenu():
         'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
         'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
         'L1_MU4_XE60' : 454,
-        'L1_2MU4_XE60' : 455,
 
 #SX
 #        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
@@ -1317,7 +1303,6 @@ def defineMenu():
         'L1_JPSI-1M5' : 262,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
-        'L1_KF-XE40' : 265,
         'L1_KF-XE50' : 266,
         'L1_KF-XE55' : 267,
         'L1_KF-XE60' : 268,
@@ -1335,16 +1320,18 @@ def defineMenu():
         'L1_W-HT20-JJ15.ETA49' : 281,
         'L1_W-NOMATCH' : 282,
         #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
-        'L1_EM10_W-MT25' : 284,
+
+        'L1_EM12_W-MT25' : 50,
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE' : 139,
+        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE' : 250,
+
         'L1_EM15_W-MT35' : 286,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 293,
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 294,
+
+        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 322,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30' : 344,
+        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE' : 384,
 #SX
 #        'L1_BPH-DR-2MU4' : 295,
 #        'L1_BPH-2M-2MU4' : 296,
@@ -1369,9 +1356,6 @@ def defineMenu():
 
 #SX adding
         #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
         'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
         'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
@@ -1379,12 +1363,8 @@ def defineMenu():
         'L1_2MU4-B' : 303,
         'L1_2MU6-B'  : 304,
         #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
         #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
         #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B' : 487,
         'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
 
@@ -1398,7 +1378,6 @@ def defineMenu():
 
 
         'L1_DY-DR-2MU4' : 315,
-        'L1_EM15VH_2EM8VH_MU6' : 316,
         #'L1_DY-BOX-MU6MU4' : 317,
         'L1_DY-BOX-2MU6' : 318,
         'L1_LFV-MU' : 319,
@@ -1408,9 +1387,7 @@ def defineMenu():
         'L1_DPHI-J20s2XE50' : 323,
         'L1_DPHI-J20XE50' : 324,
         'L1_DPHI-CJ20XE50' : 325,
-        'L1_MJJ-900' : 326,
         'L1_MJJ-800' : 327,
-        'L1_MJJ-700' : 328,
         'L1_MJJ-400' : 329,
         #'L1_MJJ-350' : 330,
 #        'L1_MJJ-300' : 331,
@@ -1426,7 +1403,6 @@ def defineMenu():
         'L1_DR-EM15TAU12I-J25' : 346,
         'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
-        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
 
         'L1_DR25-TAU20ITAU12I' : 337,
@@ -1439,6 +1415,7 @@ def defineMenu():
         'L1_LAR-J' : 352,
         'L1_DR-EM15TAU12I' : 353,        
         'L1_LATE-MU10_XE50': 354,
+        'L1_LATE-MU10_XE40': 466,
         'L1_LATE-MU10_J50' : 355,
         'L1_SC111-CJ15' : 356,
         'L1_SC85-CJ15' : 357,
@@ -1449,27 +1426,19 @@ def defineMenu():
 #        'L1_BPH-DR-MU6MU4-B' : 356,
 #        'L1_BPH-DR-MU6MU4-BO' : 357,
         'L1_MU6_MJJ-200' : 358,
-        'L1_MU6_MJJ-300' : 359,
-        'L1_MU6_MJJ-400' : 360,
-        'L1_MU6_MJJ-500' : 361,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400' : 362,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700' : 363,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800' : 364,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900' : 365,
         'L1_3J20_4J20.0ETA49_MJJ-400' : 366,
         'L1_3J20_4J20.0ETA49_MJJ-700' : 367,
         'L1_3J20_4J20.0ETA49_MJJ-800' : 368,
         'L1_3J20_4J20.0ETA49_MJJ-900' : 369,
-        'L1_XE35_MJJ-200' : 370,
         'L1_EM7_FIRSTEMPTY': 371, 
         'L1_RD0_ABORTGAPNOTCALIB':372,
         'L1_3J25.0ETA23' : 373,
         'L1_3J35.0ETA23' : 425,
-        'L1_TE20' : 374,
-        'L1_TE10.0ETA24' : 375,
-        'L1_TE15.ETA24' : 416,
-        'L1_TE20.0ETA24' : 376,
-        'L1_TE25.0ETA24' : 409,
+#        'L1_TE4' : 374,
+##         'L1_VTE3' : 375,
+##         'L1_VTE4' : 48,
+##         'L1_VTE5' : 376,
+##         'L1_VTE10' : 409,
         #'L1_XS40' : 377,
         #'L1_XS50' : 378,
         #'L1_XS60' : 379,
@@ -1477,7 +1446,7 @@ def defineMenu():
         'L1_J30.31ETA49_BGRP12' : 381,
         'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_4J20.0ETA49' : 383,
-        'L1_HT150-JJ15.ETA49_MJJ400' : 384,
+        'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
 
         ### ATR-15062
         'L1_EM18VHI_MJJ-300' : 385,
@@ -1496,8 +1465,6 @@ def defineMenu():
         'L1_EM24VHI'           : 392,
         'L1_LHCF_UNPAIRED_ISO' : 393,
         'L1_LHCF_EMPTY' : 394,
-        'L1_EM15VH_2EM10VH_3EM7': 395,
-        'L1_EM15VH_3EM8VH': 396, 
         'L1_EM8I_MU10'  : 399,
         "L1_EM24VHIM"    :402,
         "L1_EM15VHI"    :423,
@@ -1507,10 +1474,10 @@ def defineMenu():
         "L1_2MU6_3MU4" :404,
         "L1_BGRP9"     :405,
         #'L1_TE50'       :406,
-        'L1_TE5'       :407,
+        #'L1_TE2'       :407,
         #'L1_TE60'      :408,
         #'L1_TE50.0ETA24':409,
-        'L1_TE5.0ETA24':410, 
+#        'L1_VTE2':410, 
         'L1_EM20VH_FIRSTEMPTY':411, 
         'L1_EM22VHI_FIRSTEMPTY':412, 
         'L1_MU20_FIRSTEMPTY':413, 
@@ -1518,14 +1485,36 @@ def defineMenu():
         'L1_J100_FIRSTEMPTY':414, 
         'L1_J100.31ETA49_FIRSTEMPTY':415, 
         #'L1_TE60.0ETA24':416, 
-        'L1_TE70.0ETA24':417, 
-        'L1_TE40.0ETA24':418, 
+#        'L1_MBTS_1_VTE4':417, 
+#        'L1_MBTS_1_VTE3':418,
+        
+##         'L1_MBTS_1_VTE5':77, 
+##         'L1_MBTS_1_VTE10':79,
+##         'L1_MBTS_2_VTE2':80, 
+##         'L1_MBTS_2_VTE3':108,
+##         'L1_MBTS_2_VTE4':124, 
+##         'L1_MBTS_2_VTE5':127,
+##         'L1_MBTS_2_VTE10':129,  
+
+        'L1_2EM3_VTE70' : 474,
+        
+#        'L1_MBTS_1_VTE70' : 477,
 
         # 3 x ZDC
         'L1_ZDC_A':419,
         'L1_ZDC_C':420,
         'L1_ZDC_AND':421, 
         'L1_ZDC_A_C':422, 
+        'L1_MU4_TE10':470,
+        'L1_MU4_TE40':108,
+        'L1_MU4_TE50':124,
+
+        'L1_LUCID_BGRP9' : 471,
+        'L1_LUCID_BGRP11' : 472,
+        
+        #Overlay
+#        'L1_MBTS_1_OVERLAY' : 445,
+#        'L1_TE20_OVERLAY' : 455,
         
 #ATR-13743        'L1_ALFA_ELAST1'  : 424,
 #        'L1_ALFA_ELAST2'  : 425,
@@ -1610,12 +1599,12 @@ def defineMenu():
         'L1_TAU20IM_FTK'                       : 86,
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12_FTK': 502,
         'L1_DR-TAU20ITAU12I-J25_FTK'           : 503,
-        'L1_4J15_FTK'                          : 504,
+        'L1_4J20_FTK'                          : 504,
         'L1_4J15.0ETA25_FTK'                   : 505,
         'L1_J15_FTK'                           : 506,
         'L1_J40_FTK'                           : 507,
         'L1_J100_FTK'                          : 508,           
-        'L1_MU21_TAU12IM_FTK'                  : 498,
+        'L1_MU20_TAU12IM_FTK'                  : 498,
 #        'L1_ALFA_B7L1U_OD' : 497,
 #        'L1_ALFA_B7L1L_OD' : 498,
 #        'L1_ALFA_A7L1U_OD' : 499,
@@ -1634,3 +1623,4 @@ def defineMenu():
 
     Lvl1Flags.prescales = {}
 
+if __name__ == "__main__": print_available()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v3.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v3.py
index 33181f5f3c0eed08abe7ae1d262626477b7f8dff..068da495a3c1ebeccc8715acc95828165328c6ae 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v3.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v3.py
@@ -591,16 +591,13 @@ def defineMenu():
         'L1_BCM_Wide_EMPTY' : 107,
         'L1_BCM_Wide_UNPAIRED_ISO' : 108,
         'L1_L1_BCM_Wide_UNPAIRED_NONISO' : 109,
-        'L1_J10_UNPAIRED_ISO' : 110,
-        'L1_J10_UNPAIRED_NONISO' : 111,
         
         'L1_LUCID_UNPAIRED_ISO' : 113,
         #'L1_TAU8_FIRSTEMPTY' : 114,
         'L1_TAU8_UNPAIRED_ISO' : 115,
         'L1_TAU8_UNPAIRED_NONISO' : 116,
         'L1_ZDC_A_C_UNPAIRED_ISO' : 117,
-        'L1_ZDC_UNPAIRED_ISO' : 118,
-        'L1_ZDC_UNPAIRED_NONISO' : 119,
+
         'L1_MBTSA0' : 120,
         'L1_MBTSA1' : 122,
         'L1_FJ0' : 123,
@@ -609,7 +606,6 @@ def defineMenu():
         'L1_BCM_Wide_UNPAIRED_NONISO' : 126,
         'L1_EM7_UNPAIRED_ISO' : 127,
         'L1_EM7_UNPAIRED_NONISO' : 128,
-        'L1_J10_FIRSTEMPTY' : 129,
         'L1_J30_FIRSTEMPTY' : 130,
         'L1_MBTSA2' : 131,
         'L1_TE5' : 132,
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v4.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v4.py
index d994309a0d86320c75d102e57d49e9fa035eff0a..23b215ff8e32ff1355aecd9a49d49748adeb2945 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v4.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_HI_v4.py
@@ -948,16 +948,12 @@ def defineMenu():
         'L1_BCM_Wide_EMPTY' : 107,
         'L1_BCM_Wide_UNPAIRED_ISO' : 108,
         'L1_L1_BCM_Wide_UNPAIRED_NONISO' : 109,
-        'L1_J10_UNPAIRED_ISO' : 110,
-        'L1_J10_UNPAIRED_NONISO' : 111,
         
         'L1_LUCID_UNPAIRED_ISO' : 113,
         'L1_TAU8_FIRSTEMPTY' : 114,
         'L1_TAU8_UNPAIRED_ISO' : 115,
         'L1_TAU8_UNPAIRED_NONISO' : 116,
         'L1_ZDC_A_C_UNPAIRED_ISO' : 117,
-        'L1_ZDC_UNPAIRED_ISO' : 118,
-        'L1_ZDC_UNPAIRED_NONISO' : 119,
         'L1_MBTSA0' : 120,
         'L1_MBTSA1' : 122,
         #'L1_FJ0' : 123,
@@ -966,7 +962,6 @@ def defineMenu():
         'L1_BCM_Wide_UNPAIRED_NONISO' : 126,
         'L1_EM7_UNPAIRED_ISO' : 127,
         'L1_EM7_UNPAIRED_NONISO' : 128,
-        'L1_J10_FIRSTEMPTY' : 129,
         'L1_J30_FIRSTEMPTY' : 130,
         'L1_MBTSA2' : 131,
         'L1_TE5' : 132,
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_pp_v7.py
index 9fe28f7810caa3eedfa7f5620d450c8cb51cd197..41bfad92d48a90c20867fca6af72fbd688384ca2 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_Physics_pp_v7.py
@@ -12,7 +12,6 @@ def defineMenu():
     
     import Menu_MC_pp_v7
     from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 
     Menu_MC_pp_v7.defineMenu()
@@ -25,6 +24,11 @@ def defineMenu():
         'L1_RD2_BGRP14', 'L1_RD3_BGRP15',
         ]
 
+   #Make sure these triggers don't get assigned random CTPIDs
+    Lvl1Flags.CtpIdMap().update({
+        'L1_RD2_BGRP14' : 463,
+        'L1_RD3_BGRP15' : 464,
+    })
 
     #---------------------------------
     # L1menu in MCppV5 is basis 
@@ -32,31 +36,6 @@ def defineMenu():
     #---------------------------------
     Lvl1Flags.ThresholdMap = {
 
-#        '15MINDPHI-EM15s6-XE0':'',
-#        '35MT-EM12s6-XE0':'',
-#        'DISAMB-0DR28-EM15his2-TAU12abi':'',
-#        'LATE-MU10s1':'',        
-#        'SC111-CJ15ab.ETA26':'',
-#        'SC85-CJ15ab.ETA26':'',
-#        '10MINDPHI-AJ20s2-XE50': '',
-
-#        '2INVM9-2MU4ab': '', 
-#        '2INVM9-MU6ab-MU4ab': '',
-
-#        '0DR22-2MU6ab':'',
-#        '7INVM15-2MU4ab' :'',
-#        '0DR22-MU6ab-MU4ab' :'',
-#        '0DR15-2MU4ab':'',
-#        '0DR24-2MU4ab':'',
-#        '0DR15-2MU6ab':'',
- 
-#       '15MINDPHI-EM15s6-XE0':'',
-#        '15MINDPHI-EM12s6-XE0':'',
-#        '10MINDPHI-J20s2-XE30':'',
-#        '0DR25-TAU20abi-TAU12abi':'',
-#        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi':'',
-#        'DISAMB-30INVM-EM20his2-TAU12ab':'',
-#        '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49':'',
 
 #        'EM7'       : 'EM3HI',
 #        'EM8VH'     : 'EM7',
@@ -73,8 +52,7 @@ def defineMenu():
 #        'EM20VH'    : 'EM20C',
 #        'EM20VHI'   : 'EM20VH',
 #        'EM22VHI'   : 'EM20VHI',
-#
-#
+
 #        'J75'       : 'J75A',    
 #        'J85'       : 'J75C',
 #        'J100'      : 'J85',         
@@ -89,70 +67,10 @@ def defineMenu():
 #        'HA30'      : 'HA25', 
 #        'HA40'      : 'HA25IT', 
 #        'HA60'      : 'HA40', 
-				#'2INVM9-2MU4ab':'2INVM8-2MU4ab',
-        #'2INVM9-MU6ab-MU4ab':'2INVM8-MU6ab-MU4ab', 
-#        'KF-XE40-AJall':'KF-XE35-AJall',
-#        'KF-XE50-AJall':'KF-XE45-AJall',
-#        '1INVM5-EMs1-EMs6'  :'1INVM5-EMs1-EMall',
-#        '1INVM5-EM7s1-EMs6' :'1INVM5-EM7s1-EMall',
-#        '1INVM5-EM12s1-EMs6':'1INVM5-EM12s1-EMall',
-#        '100RATIO-0MATCH-TAU30si2-EMall': '210RATIO-0MATCH-TAU30si2-EMall',
 
         }
 
     Lvl1Flags.ItemMap = {
-
-#        'L1_LFV-MU6':'',
-#        'L1_W-15DPHI-EMXE-1':'',
-#        'L1_W-15DPHI-EM15XE-1':'',
-#        'L1_J40_DPHI-J20s2XE30':'',
-#        'L1_J40_XE50_DPHI-J20s2XE50':'',
-#        'L1_MU4_J20_XE30_DPHI-J20s2XE30':'',
-#        'L1_2MU4_J20_XE30_DPHI-J20s2XE30':'',
-#        'L1_DR25-TAU20ITAU12I':'',
-#        'L1_DR25-TAU20ITAU12I-J25':'',
-#        'L1_30M-EM20ITAU12':'',
-#        'L1_MJJ-400-CF':'',
-
-#        'L1_DPHI-AJ20s2XE50':'', 
-#        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE':'', 
-#        "L1_EM12_W-MT35":'', 
-#        "L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE":'', 
-#        "L1_EM12_W-MT35_XS50":'',
-        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMX':'',
-#        "L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE":'',
-#        "L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE":'',
-#        "L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE":'', 
-#        "L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE":'',
-#        "L1_EM10VH_W-MT35_XS50":'', 
-#        "L1_W-15DPHI-EM15XE-0":'',
-
-#        "L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE":'', 
-#        "L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0":'', 
-#        "L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30":'', 
-#        "L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20":'', 
-#        "L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE":'',
-
-#        'L1_DR-EM15TAU12I':'', 
-#        'L1_LATE-MU10_XE50':'', 
-#        'L1_LATE-MU10_J50':'', 
-#        'L1_SC111':'', 
-#        'L1_SC85':'',
-
-#        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6':'',
-#        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4':'',
-#        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B':'',
-#        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO':'',
-#        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4':'',
-#        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4':'',
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4':'',
-#        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4':'',
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4':'',
-#        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4':'',
-
-#        'L1_HT150-J20s5.ETA31_MJJ-400':'',
-#        'L1_HT150-J20s5.ETA31_MJJ-400-CF':'',
-        'L1_J40.0ETA25_2J30_J20.31ETA49':'',
 #        'L1_EM22VHI' : 'L1_EM20A' , #eta [1.6,2.].
 #        'L1_EM13VH'    : 'L1_EM20C',     #eta[-2,-1.6] 
 #        'L1_J75'       : 'L1_J75A',         #[1.6,2.4]
@@ -160,16 +78,11 @@ def defineMenu():
 #        'L1_EM10'      : 'L1_EM3HI',
 #        'L1_TAU30'     : 'L1_TAU20A', 
 #        'L1_TAU60'     : 'L1_TAU20C', 
-#        
 #        'L1_2EM13VH' : '',
 #        'L1_3J75' : '',
 #        'L1_J75_3J20' : '',
 #        'L1_J75_XE40' :'',
 #        'L1_MU6_J75': '',
-#        'L1_KF-XE40':'L1_KF-XE35',
-#        'L1_KF-XE50':'L1_KF-XE45',
-        #'L1_BPH-2M9-2MU4':'L1_BPH-2M8-2MU4',
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4':'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
         }
     
     #----------------------------------------------
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/MonitorDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/MonitorDef.py
index ba87ea3f3c68753488868c10b154176d055d1d35..4096ce5a72e61cd5e1eaf3b4c67def0a38d58922 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/MonitorDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/MonitorDef.py
@@ -29,8 +29,7 @@ For each of these type 64 L1Items can be monitored independently
 
 """
 
-from TriggerMenu.l1.Lvl1Menu import Lvl1Menu
-from TriggerMenu.l1.Lvl1MonCounters import Lvl1MonCounters, Lvl1CtpinCounter, Lvl1CtpmonCounter
+from TriggerMenu.l1.Lvl1MonCounters import Lvl1CtpinCounter, Lvl1CtpmonCounter
 
 class MonitorDef:
 
@@ -134,34 +133,44 @@ class MonitorDef:
 
 
 
-        monItems[TBP] = [
-            "L1_ALFA_B7L1U", "L1_ALFA_B7L1L", "L1_ALFA_A7L1U", "L1_ALFA_A7L1L", "L1_ALFA_A7R1U", "L1_ALFA_A7R1L", "L1_ALFA_B7R1U", "L1_ALFA_B7R1L"
-            ]
-
-
         monItems[TBP|TAP|TAV] = [
-            "L1_EM3","L1_EM20VH","L1_EM22VHI",
-            "L1_MU4","L1_MU10","L1_MU20",
-            "L1_TAU12", "L1_TAU12IT", "L1_TAU20", "L1_TAU60",
-            "L1_J12", "L1_J20", "L1_J100", "L1_J400", "L1_J20.31ETA49", "L1_J30.31ETA49",
-            "L1_XE35", "L1_XE80", "L1_XS20", 
-            "L1_MBTS_4_A", "L1_MBTS_4_C", "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-            "L1_LUCID", "L1_LUCID_A_C_EMPTY", "L1_ALFA_ANY",
-            "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
-            "L1_BPTX0_BGRP0","L1_BPTX1_BGRP0",
-            "L1_CALREQ2",
-            "L1_AFP_NSC","L1_AFP_FSC",
-            "L1_BPH-2M8-2MU4","L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4","L1_BPH-2M9-2MU6_BPH-2DR15-2MU6",
-            "L1_MU6MU4-BO","L1_2MU4-B",
+            "L1_AFP_NSA_BGRP0", "L1_AFP_NSC_BGRP0",
+            "L1_AFP_FSA_SIT_BGRP0", "L1_AFP_FSC_SIT_BGRP0",
+            "L1_AFP_A_SPECTOF_BGRP0", "L1_AFP_C_SPECTOF_BGRP0",
+            "L1_EM12", "L1_EM22VHI", "L1_EM24VHI", "L1_EM24VHIM",
+            "L1_MU4", "L1_MU10", "L1_MU11", "L1_MU21", "L1_MU20",
+            "L1_TAU12IM", "L1_TAU20", "L1_TAU40", "L1_TAU100",
+            "L1_J20", "L1_J100",
+            "L1_J75.31ETA49",
+            "L1_4J15.0ETA25",
+            "L1_XE35", "L1_XE60",
+            "L1_TE50",
+            "L1_MBTS_4_A", "L1_MBTS_4_C",
+            "L1_LUCID",
+            "L1_ZB",
+            "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
+            "L1_LAR-EM", "L1_LAR-J",
+            "L1_HT150-J20s5.ETA31",
+            "L1_MJJ-700",
+            "L1_EM15TAU12I-J25",
+            "L1_DY-BOX-2MU6",
+            "L1_BPH-2M9-2MU6_BPH-2DR15-2MU6",
+            "L1_MU6MU4-BO",
+            "L1_BTAG-MU4J15",
             "L1_LFV-EM8I",
-            "L1_TGC_BURST",
-            "L1_LLP-NOMATCH",
+            "L1_SC85-CJ15",
+            "L1_LFV-MU",
+            "L1_HT150-J20.ETA31",
             "L1_DR-TAU20ITAU12I",
-            "L1_HT190-J15s5.ETA21",
-            "L1_3J15_BTAG-MU4J15",
-            "L1_MJJ-900",
-            "L1_J40_DPHI-J20s2XE50",
-            "L1_KF-XE55",
+            "L1_KF-XE40",
+            "L1_DR-TAU20ITAU12I-J25",
+            "L1_JPSI-1M5",
+            "L1_JPSI-1M5-EM7",
+            "L1_JPSI-1M5-EM12",
+            "L1_LATE-MU10_XE40",
+            "L1_LATE-MU10_J50",
+            "L1_LUCID_BGRP9",
+            "L1_LUCID_BGRP11",
             ]
 
         monItemsHF[TBP|TAP|TAV] = [
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
index fd878c6b79d14681e39a937a0eb5b9d62845059d..73bf51bfa37547309ab742050100e0d1f280c444 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from TriggerMenu.l1.Lvl1Thresholds import LVL1Threshold, ThresholdValue
+from TriggerMenu.l1.Lvl1Thresholds import ThresholdValue
 from TriggerMenu.l1.Limits import CaloLimits as CL
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
@@ -295,8 +295,8 @@ class ThresholdDef:
 
         # Beam Splashes
         for thrV in [75]:
-            tc.registerThr('J%iA' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = 16,  etamax = 24, priority=1)
-            tc.registerThr('J%iC' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = -24,  etamax = -16, priority=1)          
+            tc.registerThr('J%iA' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = 15,  etamax = 23, priority=1)
+            tc.registerThr('J%iC' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = -23,  etamax = -15, priority=1)          
         
 
         # Central jet
@@ -338,7 +338,7 @@ class ThresholdDef:
 
         
         # TE
-        for thrV in [0, 3, 5, 10, 15, 20, 25, 30, 40, 45, 50, 55, 60, 65, 70, 90, 100, 120, 140, 160, 200, 280, 300, 360, 2000, 4000, 10000, 12000, 14000]:
+        for thrV in [0, 2, 3, 4, 5, 10, 15, 20, 25, 30, 40, 45, 50, 55, 60, 65, 70, 90, 100, 120, 140, 160, 200, 280, 300, 360, 2000, 4000, 10000, 12000, 14000]:
             tc.registerThr('TE%i' % thrV, 'TE').addThrValue(thrV)
 
         # XE
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDefRun1.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDefRun1.py
index e4e8e23ca21296a169be0f7fba4e37153cfa5f6f..cb83925053a60cd6ccabd9e88b60a7fb6b0ff1bd 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDefRun1.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDefRun1.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from TriggerMenu.l1.Lvl1Thresholds import LVL1Threshold, ThresholdValue
+from TriggerMenu.l1.Lvl1Thresholds import ThresholdValue
 from TriggerMenu.l1.Limits import CaloLimits as CL
 ClusterOff   = CL.ClusterOff
 IsolationOff = CL.IsolationOff
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoFlags.py
index 9114f8db9e19f2b895ed277f95b707c87199be9e..a0d17a1af27c0bca01d4f4643567b7e170fdf38c 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoFlags.py
@@ -4,8 +4,7 @@
 L1Topo specific flags
 """
 
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from AthenaCommon.Logging import logging
 
 log = logging.getLogger('TriggerMenu.L1TopoFlags.py')
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoMenu.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoMenu.py
index fd8aa97e27f8de9a51c5bcb28ce6d11d37ec0c79..6f105e411465e744e35cbce6952a3ded01e17d42 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoMenu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/L1TopoMenu.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-from TopoOutput import TopoOutput, TriggerLine
+from TopoOutput import TriggerLine
 from AthenaCommon.Logging import logging
 log = logging.getLogger("TriggerMenu.l1topo.L1TopoMenu")
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoAlgos.py
index 4b09969e45fbc8f44478f585ef59b6518bcb852b..5ef84d69cb9b21b44a3aa1230cc26ed8a695d08c 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoAlgos.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoAlgos.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
-from copy import deepcopy 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 log = logging.getLogger("TopoAlgo") 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoOutput.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoOutput.py
index 0738fbce77ee03dbfd92463ac28d3d80af36675d..9bb088a963e5cf80ac54e696f0f3a84231d72b40 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoOutput.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topo/TopoOutput.py
@@ -22,7 +22,6 @@ class TopoOutput(object):
 
 
 
-from collections import namedtuple
 class TriggerLine(object):
 
     import re
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_DC14.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_DC14.py
index db5897f94d859a792d474716a139860f8ca9e44d..d3a0a4bd46a51fb75fb507bcefbd5b166dcefbac 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_DC14.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_DC14.py
@@ -11,7 +11,6 @@ def defineMenu():
     """
     
     from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     L1TopoFlags.algos = []
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_LS1_v1.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_LS1_v1.py
index db5897f94d859a792d474716a139860f8ca9e44d..d3a0a4bd46a51fb75fb507bcefbd5b166dcefbac 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_LS1_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_LS1_v1.py
@@ -11,7 +11,6 @@ def defineMenu():
     """
     
     from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     L1TopoFlags.algos = []
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v3.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v3.py
index 5ab3916dbb1f7f7a4f3190bf7fcbd1971f071f79..846b459542935bcf3bcb34b5d076d5789573dc5c 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v3.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v3.py
@@ -9,9 +9,6 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     import Menu_MC_pp_v6
     Menu_MC_pp_v6.defineMenu()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v4.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v4.py
index 5ab3916dbb1f7f7a4f3190bf7fcbd1971f071f79..6ffa3c7e8ca02da390810dc902ed58c219c30634 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v4.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_HI_v4.py
@@ -9,10 +9,7 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
-
+   
     import Menu_MC_pp_v6
     Menu_MC_pp_v6.defineMenu()
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_PhaseII.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_PhaseII.py
new file mode 100644
index 0000000000000000000000000000000000000000..bde0245be0a28daf3194bcd123bc2f53e41a6bac
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_MC_PhaseII.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+
+
+def defineMenu():
+    """
+    Defines the following LlTopoFlags:
+    
+    algos   .... list of all algo names in the menu 
+
+    """
+    
+
+    import Menu_MC_pp_v7
+    Menu_MC_pp_v7.defineMenu()
+    
+
+    
+    
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v3.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v3.py
index c06d34e8e5a18e4be1b04e2dc84dcf262957943b..cd89bb840dcbd297a69ff42d694030a98ca88c0b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v3.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v3.py
@@ -9,9 +9,6 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     import Menu_MC_pp_v6
     Menu_MC_pp_v6.defineMenu()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v4.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v4.py
index c06d34e8e5a18e4be1b04e2dc84dcf262957943b..cd89bb840dcbd297a69ff42d694030a98ca88c0b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v4.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_HI_v4.py
@@ -9,9 +9,6 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     import Menu_MC_pp_v6
     Menu_MC_pp_v6.defineMenu()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v6.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v6.py
index c06d34e8e5a18e4be1b04e2dc84dcf262957943b..cd89bb840dcbd297a69ff42d694030a98ca88c0b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v6.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v6.py
@@ -9,9 +9,6 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     import Menu_MC_pp_v6
     Menu_MC_pp_v6.defineMenu()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v7.py
index 70e01a064ae3b5fbb7310b6676117bd821ec3ae8..7b80cf282e260bc4d126a9697efb4dbd85da59a9 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/Menu_Physics_pp_v7.py
@@ -9,9 +9,6 @@ def defineMenu():
     algos   .... list of all algo names in the menu 
 
     """
-    
-    from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
-    from TriggerMenu.l1topo.TopoOutput import TopoOutput
 
     import Menu_MC_pp_v7
     Menu_MC_pp_v7.defineMenu()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/TopoAlgoDef.py
index cd634cc24197f10c7006c528577c36b4670c4fe5..0f9dc425779da6239f4713998924357818a5373e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1topomenu/TopoAlgoDef.py
@@ -3,14 +3,14 @@
 from AthenaCommon.Logging import logging
 log = logging.getLogger('TriggerMenu.L1Topo.py')
 
-from TriggerMenu.l1topo.TopoAlgos import SortingAlgo, DecisionAlgo
+#from TriggerMenu.l1topo.TopoAlgos import SortingAlgo, DecisionAlgo
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 # algorithm python base classes generated from C++ code
 import L1TopoAlgorithms.L1TopoAlgConfig as AlgConf
 import L1TopoHardware.L1TopoHardware as HW
 
-import re
+#import re
 
 
 class TopoAlgoDef:
@@ -21,16 +21,12 @@ class TopoAlgoDef:
 
         _etamax = 49
         _minet = 0
-        usev6 = False
         usev7 = False
-        doPhysics = False
 
-        if '_v6' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI' in TriggerFlags.triggerMenuSetup():
-            usev6 = True
         if '_v7' in TriggerFlags.triggerMenuSetup():
             usev7 = True
-        if 'Physics' in TriggerFlags.triggerMenuSetup() or 'HI' in TriggerFlags.triggerMenuSetup():
-            doPhysics = True
+        if '_PhaseII' in TriggerFlags.triggerMenuSetup():
+            usev7 = True
         
         _emscale_for_decision = 2 # global scale for EM, TAU        
         if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
@@ -293,9 +289,6 @@ class TopoAlgoDef:
         # Decision algorithms
         currentAlgoId = 0
         
-
-
-
         # VBF items    
         for x in [
             {"algoname": 'INVM_AJ_HighMass', "Threlist": [ 900, 800, 700, 500 ], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
@@ -304,27 +297,27 @@ class TopoAlgoDef:
             
             for k in x:
                 exec("%s = x[k]" % k)
-
-            inputList = otype + olist
+		
+            inputList = otype + olist # noqa: F821
             toponames=[]
 
-            for minInvm in Threlist:
-                toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, maxInvm,
-                                                            otype, str(ocut1) , olist, str(nleading1) if olist=="s" else "",
-                                                            otype, str(ocut2) , olist, str(nleading2) if olist=="s" else "")   
+            for minInvm in Threlist:  # noqa: F821
+                toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, maxInvm,                                                    # noqa: F821
+                                                            otype, str(ocut1) , olist, str(nleading1) if olist=="s" else "",     # noqa: F821
+                                                            otype, str(ocut2) , olist, str(nleading2) if olist=="s" else "")     # noqa: F821 
                 toponames.append(toponame)
                 
-            alg = AlgConf.InvariantMassInclusive1( name = algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1
+            alg = AlgConf.InvariantMassInclusive1( name = algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1  # noqa: F821
 
-            alg.addgeneric('InputWidth', inputwidth1)
-            alg.addgeneric('MaxTob', nleading1)
+            alg.addgeneric('InputWidth', inputwidth1)      # noqa: F821
+            alg.addgeneric('MaxTob', nleading1)            # noqa: F821
             alg.addgeneric('NumResultBits', len(toponames))
 
-            for bitid, minInvm in enumerate(Threlist): 
-                alg.addvariable('MinET1', ocut1, bitid)
-                alg.addvariable('MinET2', ocut2, bitid)
-                alg.addvariable('MinMSqr', minInvm * minInvm, bitid)
-                alg.addvariable('MaxMSqr', maxInvm * maxInvm, bitid)
+            for bitid, minInvm in enumerate(Threlist):     # noqa: F821
+                alg.addvariable('MinET1', ocut1, bitid)    # noqa: F821
+                alg.addvariable('MinET2', ocut2, bitid)    # noqa: F821
+                alg.addvariable('MinMSqr', minInvm * minInvm, bitid)  # noqa: F821
+                alg.addvariable('MaxMSqr', maxInvm * maxInvm, bitid)  # noqa: F821
 
             tm.registerAlgo(alg)
 
@@ -349,21 +342,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)
-            toponame = "%iINVM%i-%s%s%s"  % (minInvm, maxInvm, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)   # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)                                   # noqa: F821
+            toponame = "%iINVM%i-%s%s%s"  % (minInvm, maxInvm, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)  # noqa: F821
 
             log.info("Define %s" % toponame)
 
 
-            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]
-            algoname = AlgConf.InvariantMassInclusive1 if (mult>1 or otype1==otype2) else AlgConf.InvariantMassInclusive2
+            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]                             # noqa: F821
+            algoname = AlgConf.InvariantMassInclusive1 if (mult>1 or otype1==otype2) else AlgConf.InvariantMassInclusive2                # noqa: F821
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
 
-            if (mult>1 or otype1==otype2):
+            if (mult>1 or otype1==otype2):  # noqa: F821
                 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) 
                 alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', onebarrel)
+                alg.addgeneric('RequireOneBarrel', onebarrel) # noqa: F821
             else:
                 alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
                 alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
@@ -371,10 +364,10 @@ class TopoAlgoDef:
                 alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
 
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1)
-            alg.addvariable('MinET2', ocut2 if ocut2>0 else ocut1)
-            alg.addvariable('MinMSqr', minInvm * minInvm)
-            alg.addvariable('MaxMSqr', maxInvm * maxInvm)
+            alg.addvariable('MinET1', ocut1)                           # noqa: F821
+            alg.addvariable('MinET2', ocut2 if ocut2>0 else ocut1)     # noqa: F821
+            alg.addvariable('MinMSqr', minInvm * minInvm)              # noqa: F821
+            alg.addvariable('MaxMSqr', maxInvm * maxInvm)              # noqa: F821
             tm.registerAlgo(alg)
 
 
@@ -396,20 +389,20 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)
-            toponame = "%iDR%i-%s%s%s"  % (minDr, maxDr, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)    # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)                                    # noqa: F821
+            toponame = "%iDR%i-%s%s%s"  % (minDr, maxDr, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)  # noqa: F821
 
             log.info("Define %s" % toponame)
 
-            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]
-            algoname = AlgConf.DeltaRSqrIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaRSqrIncl2
+            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]    # noqa: F821
+            algoname = AlgConf.DeltaRSqrIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaRSqrIncl2         # noqa: F821
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-
-            if (mult>1 or otype1==otype2):
+ 
+            if (mult>1 or otype1==otype2):  # noqa: F821
                 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
                 alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', onebarrel)
+                alg.addgeneric('RequireOneBarrel', onebarrel)  # noqa: F821
             else:
                 alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
                 alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
@@ -418,10 +411,10 @@ class TopoAlgoDef:
 
 
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1)
-            alg.addvariable('MinET2', ocut2)
-            alg.addvariable('DeltaRMin', minDr*minDr)
-            alg.addvariable('DeltaRMax', maxDr*maxDr)
+            alg.addvariable('MinET1', ocut1)            # noqa: F821
+            alg.addvariable('MinET2', ocut2)            # noqa: F821
+            alg.addvariable('DeltaRMin', minDr*minDr)   # noqa: F821
+            alg.addvariable('DeltaRMax', maxDr*maxDr)   # noqa: F821
             tm.registerAlgo(alg)
         
 
@@ -436,38 +429,38 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist1)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2) if ocut2>0 else "", olist2)
-            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (minDeta, maxDeta, minDphi, maxDphi, obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist1)  # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2) if ocut2>0 else "", olist2)  # noqa: F821
+            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (minDeta, maxDeta, minDphi, maxDphi, obj1, "" if mult>1 else obj2)  # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1] if (mult>1 or otype1==otype2) else [otype1 + olist1, otype2 + olist2]
-            algoname = AlgConf.DeltaEtaPhiIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaEtaPhiIncl2            
+            inputList = [otype1 + olist1] if (mult>1 or otype1==otype2) else [otype1 + olist1, otype2 + olist2]    # noqa: F821
+            algoname = AlgConf.DeltaEtaPhiIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaEtaPhiIncl2        # noqa: F821     
             alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)                        
 
             
-            if (mult>1 or otype1==otype2):
-                alg.addgeneric('InputWidth', nleading1)
-                alg.addgeneric('MaxTob', nleading1)
-                alg.addvariable('MinET1', ocut1)
-                alg.addvariable('MinET2', ocut2)
-                alg.addvariable('MinDeltaEta', minDeta)
-                alg.addvariable('MaxDeltaEta', maxDeta)
-                alg.addvariable('MinDeltaPhi', minDphi)
-                alg.addvariable('MaxDeltaPhi', maxDphi)
+            if (mult>1 or otype1==otype2):  # noqa: F821
+                alg.addgeneric('InputWidth', nleading1)  # noqa: F821
+                alg.addgeneric('MaxTob', nleading1)      # noqa: F821
+                alg.addvariable('MinET1', ocut1)         # noqa: F821
+                alg.addvariable('MinET2', ocut2)         # noqa: F821
+                alg.addvariable('MinDeltaEta', minDeta)  # noqa: F821
+                alg.addvariable('MaxDeltaEta', maxDeta)  # noqa: F821
+                alg.addvariable('MinDeltaPhi', minDphi)  # noqa: F821
+                alg.addvariable('MaxDeltaPhi', maxDphi)  # noqa: F821
             else:
-                alg.addgeneric('InputWidth1', nleading1)
-                alg.addgeneric('InputWidth2', nleading2)
-                alg.addgeneric('MaxTob1', nleading1)
-                alg.addgeneric('MaxTob2', nleading2)
-                alg.addvariable('DeltaEtaMin', minDeta)
-                alg.addvariable('DeltaEtaMax', maxDeta)
-                alg.addvariable('DeltaPhiMin', minDphi)
-                alg.addvariable('DeltaPhiMax', maxDphi)
-                alg.addvariable('MinET1', ocut1)
-                alg.addvariable('MinET2', ocut2)
+                alg.addgeneric('InputWidth1', nleading1) # noqa: F821
+                alg.addgeneric('InputWidth2', nleading2) # noqa: F821
+                alg.addgeneric('MaxTob1', nleading1)     # noqa: F821
+                alg.addgeneric('MaxTob2', nleading2)     # noqa: F821
+                alg.addvariable('DeltaEtaMin', minDeta)  # noqa: F821
+                alg.addvariable('DeltaEtaMax', maxDeta)  # noqa: F821
+                alg.addvariable('DeltaPhiMin', minDphi)  # noqa: F821
+                alg.addvariable('DeltaPhiMax', maxDphi)  # noqa: F821
+                alg.addvariable('MinET1', ocut1)         # noqa: F821
+                alg.addvariable('MinET2', ocut2)         # noqa: F821
             
             tm.registerAlgo(alg)
 
@@ -485,37 +478,38 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s" % (otype1, str(ocut1), olist1)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2)
-            toponame = "%iDR%i-%s%s"  % (minDr, maxDr, obj1, obj2)
+            obj1 = "%s%s%s" % (otype1, str(ocut1), olist1)         # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2)        # noqa: F821
+            toponame = "%iDR%i-%s%s"  % (minDr, maxDr, obj1, obj2) # noqa: F821
 
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1] if otype1==otype2 else [otype1 + olist1, otype2 + olist2]
-            algoname = AlgConf.DeltaRSqrIncl1 if otype1==otype2 else AlgConf.DeltaRSqrIncl2
+            inputList = [otype1 + olist1] if otype1==otype2 else [otype1 + olist1, otype2 + olist2]  # noqa: F821
+            algoname = AlgConf.DeltaRSqrIncl1 if otype1==otype2 else AlgConf.DeltaRSqrIncl2          # noqa: F821
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
 
                             
-            if otype1==otype2:
-                alg.addgeneric('InputWidth', inputwidth1)
-                alg.addgeneric('MaxTob', nleading1)
+            if otype1==otype2: # noqa: F821
+                alg.addgeneric('InputWidth', inputwidth1)   # noqa: F821
+                alg.addgeneric('MaxTob', nleading1)         # noqa: F821
             else:
-                alg.addgeneric('InputWidth1', inputwidth1)
-                alg.addgeneric('InputWidth2', inputwidth2) 
-                alg.addgeneric('MaxTob1', nleading1)
-                alg.addgeneric('MaxTob2', nleading2)
+                alg.addgeneric('InputWidth1', inputwidth1)  # noqa: F821
+                alg.addgeneric('InputWidth2', inputwidth2)  # noqa: F821
+                alg.addgeneric('MaxTob1', nleading1)        # noqa: F821
+                alg.addgeneric('MaxTob2', nleading2)        # noqa: F821
+
             alg.addgeneric('NumResultBits', 1)
 
-            if otype1==otype2:
-                alg.addvariable('MinET1', ocut1)
-                alg.addvariable('MinET2', ocut2)
-                alg.addvariable('DeltaRMin', minDr*minDr)
-                alg.addvariable('DeltaRMax', maxDr*maxDr)
+            if otype1==otype2:  # noqa: F821
+                alg.addvariable('MinET1', ocut1) # noqa: F821
+                alg.addvariable('MinET2', ocut2) # noqa: F821
+                alg.addvariable('DeltaRMin', minDr*minDr) # noqa: F821
+                alg.addvariable('DeltaRMax', maxDr*maxDr) # noqa: F821
             else:
-                alg.addvariable('MinET1', ocut1, 0)
-                alg.addvariable('MinET2', ocut2, 0)
-                alg.addvariable('DeltaRMin', minDr*minDr, 0)
-                alg.addvariable('DeltaRMax', maxDr*maxDr, 0)
+                alg.addvariable('MinET1', ocut1, 0) # noqa: F821
+                alg.addvariable('MinET2', ocut2, 0) # noqa: F821
+                alg.addvariable('DeltaRMin', minDr*minDr, 0) # noqa: F821
+                alg.addvariable('DeltaRMax', maxDr*maxDr, 0) # noqa: F821
                 
             tm.registerAlgo(alg)        
 
@@ -533,23 +527,23 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "HT%d-%s%s%s%s.ETA%s" % (minHT, otype, str(ocut), olist, str(nleading) if olist=="s" else "", str(oeta))
+            toponame = "HT%d-%s%s%s%s.ETA%s" % (minHT, otype, str(ocut), olist, str(nleading) if olist=="s" else "", str(oeta)) # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = otype + olist
+            inputList = otype + olist # noqa: F821
 
             alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
 
 
-            alg.addgeneric('InputWidth', inputwidth)
-            alg.addgeneric('MaxTob', nleading)        
-            alg.addgeneric('NumRegisters', 2 if olist=="all" else 0)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', ocut)                        
+            alg.addgeneric('InputWidth', inputwidth)   # noqa: F821
+            alg.addgeneric('MaxTob', nleading)         # noqa: F821
+            alg.addgeneric('NumRegisters', 2 if olist=="all" else 0) # noqa: F821
+            alg.addgeneric('NumResultBits', 1) # noqa: F821
+            alg.addvariable('MinET', ocut)     # noqa: F821                    
             alg.addvariable('MinEta', 0)
-            alg.addvariable('MaxEta', oeta)            
-            alg.addvariable('MinHt', minHT) 
+            alg.addvariable('MaxEta', oeta)    # noqa: F821
+            alg.addvariable('MinHt', minHT)    # noqa: F821
             tm.registerAlgo(alg)  
 
         # INVM_EM for Jpsi    
@@ -560,29 +554,29 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            inputList = otype + olist
+            inputList = otype + olist  # noqa: F821
             toponames=[]
 
-            for ocut in ocutlist:
-                toponame = "%iINVM%i-%s%s%s%s-EMs6"   % (minInvm, maxInvm, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            for ocut in ocutlist:      # noqa: F821
+                toponame = "%iINVM%i-%s%s%s%s-EMs6"   % (minInvm, maxInvm, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")          # noqa: F821
                 toponames.append(toponame)
 
-            alg = AlgConf.InvariantMassInclusive2( name = algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1    
+            alg = AlgConf.InvariantMassInclusive2( name = algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
 
 
-            alg.addgeneric('InputWidth1', inputwidth)
+            alg.addgeneric('InputWidth1', inputwidth) # noqa: F821
             #alg.addgeneric('InputWidth2', HW.InputWidthEM)
             alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob1', nleading)
+            alg.addgeneric('MaxTob1', nleading)       # noqa: F821
             #alg.addgeneric('MaxTob2', HW.InputWidthEM)
             alg.addgeneric('MaxTob2', HW.OutputWidthSortEM)
             alg.addgeneric('NumResultBits', len(toponames))
 
-            for bitid, ocut in enumerate(ocutlist):
+            for bitid, ocut in enumerate(ocutlist): # noqa: F821
                 alg.addvariable('MinET1', ocut, bitid)
                 alg.addvariable('MinET2', 0, bitid)
-                alg.addvariable('MinMSqr', (minInvm * _emscale_for_decision)*(minInvm * _emscale_for_decision), bitid)                
-                alg.addvariable('MaxMSqr', (maxInvm * _emscale_for_decision)*(maxInvm * _emscale_for_decision), bitid)
+                alg.addvariable('MinMSqr', (minInvm * _emscale_for_decision)*(minInvm * _emscale_for_decision), bitid)        # noqa: F821         
+                alg.addvariable('MaxMSqr', (maxInvm * _emscale_for_decision)*(maxInvm * _emscale_for_decision), bitid)        # noqa: F821
                 
             tm.registerAlgo(alg)
 
@@ -603,22 +597,22 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")  # noqa: F821
             log.info("Define %s" % toponame)
 
-            inputList = otype + olist
+            inputList = otype + olist  # noqa: F821
 
             alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
 
-            alg.addgeneric('InputWidth1', inputwidth)
+            alg.addgeneric('InputWidth1', inputwidth)  # noqa: F821
             alg.addgeneric('InputWidth2', 1) 
-            alg.addgeneric('MaxTob1', nleading)
+            alg.addgeneric('MaxTob1', nleading)        # noqa: F821
             alg.addgeneric('MaxTob2', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut)
+            alg.addvariable('MinET1', ocut)            # noqa: F821
             alg.addvariable('MinET2', 0)
-            alg.addvariable('DeltaPhiMin', minDPhi, 0)
+            alg.addvariable('DeltaPhiMin', minDPhi, 0) # noqa: F821
             tm.registerAlgo(alg)
 
         # W T&P MT
@@ -632,21 +626,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%iMT-%s%s%s%s-XE0"  % (minMT, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            toponame = "%iMT-%s%s%s%s-XE0"  % (minMT, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "") # noqa: F821
             log.info("Define %s" % toponame)
 
-            inputList = otype + olist
+            inputList = otype + olist  # noqa: F821
             
             alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
 
 
             alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob', str(nleading))
+            alg.addgeneric('MaxTob', str(nleading))  # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', str(ocut))
+            alg.addvariable('MinET1', str(ocut))     # noqa: F821
             alg.addvariable('MinET2', 0)
-            alg.addvariable('MinMTSqr', minMT*minMT)                        
+            alg.addvariable('MinMTSqr', minMT*minMT) # noqa: F821                  
             tm.registerAlgo(alg)
 
             
@@ -658,24 +652,24 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s"  % (minDeta, maxDeta,
-                                                        otype, str(ocut1) if ocut1 > 0 else "", olist, str(nleading1) if olist=="s" else "",
-                                                        otype, str(ocut2) if ocut2 > 0 else "", olist, str(nleading2) if olist=="s" else "")
+            toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s"  % (minDeta, maxDeta,  # noqa: F821
+                                                        otype, str(ocut1) if ocut1 > 0 else "", olist, str(nleading1) if olist=="s" else "", # noqa: F821
+                                                        otype, str(ocut2) if ocut2 > 0 else "", olist, str(nleading2) if olist=="s" else "") # noqa: F821
             
             log.info("Define %s" % toponame)
-            inputList = otype + olist
+            inputList = otype + olist # noqa: F821
             
             alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
 
 
 
-            alg.addgeneric('InputWidth', inputwidth1)
-            alg.addgeneric('MaxTob', nleading2)
+            alg.addgeneric('InputWidth', inputwidth1)  # noqa: F821
+            alg.addgeneric('MaxTob', nleading2)        # noqa: F821
             alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', str(ocut1), 0)            
-            alg.addvariable('MinET2', str(ocut2), 0)
-            alg.addvariable('MinDeltaEta', minDeta, 0)
-            alg.addvariable('MaxDeltaEta', maxDeta, 0)
+            alg.addvariable('MinET1', str(ocut1), 0)   # noqa: F821
+            alg.addvariable('MinET2', str(ocut2), 0)   # noqa: F821
+            alg.addvariable('MinDeltaEta', minDeta, 0) # noqa: F821
+            alg.addvariable('MaxDeltaEta', maxDeta, 0) # noqa: F821
             tm.registerAlgo(alg)
             
         # ZH Trigger
@@ -693,21 +687,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "%iMINDPHI-%s%s%s%s-XE%i"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "",ocut2)
+            toponame = "%iMINDPHI-%s%s%s%s-XE%i"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "",ocut2) # noqa: F821
             log.info("Define %s" % toponame)
             
-            inputList = otype + olist
+            inputList = otype + olist # noqa: F821
 
             alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
-            alg.addgeneric('InputWidth1', inputwidth)
+            alg.addgeneric('InputWidth1', inputwidth) # noqa: F821
             alg.addgeneric('InputWidth2', 1)  
-            alg.addgeneric('MaxTob1', nleading)
+            alg.addgeneric('MaxTob1', nleading)       # noqa: F821
             alg.addgeneric('MaxTob2', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut)
-            alg.addvariable('MinET2', ocut2)
-            alg.addvariable('DeltaPhiMin', minDPhi, 0)
+            alg.addvariable('MinET1', ocut)           # noqa: F821
+            alg.addvariable('MinET2', ocut2)          # noqa: F821
+            alg.addvariable('DeltaPhiMin', minDPhi, 0)# noqa: F821
             tm.registerAlgo(alg)
 
             
@@ -723,10 +717,10 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (minDr, maxDr, otype1, str(ocut1), olist1, otype2, str(ocut2), olist2)
+            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (minDr, maxDr, otype1, str(ocut1), olist1, otype2, str(ocut2), olist2) # noqa: F821
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1, otype2 + olist2]
+            inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
 
             alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
 
@@ -735,10 +729,10 @@ class TopoAlgoDef:
             alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
             alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
             alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('DeltaRMin', minDr*minDr, 0)
-            alg.addvariable('DeltaRMax', maxDr*maxDr, 0)
+            alg.addvariable('MinET1', ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0) # noqa: F821
+            alg.addvariable('DeltaRMin', minDr*minDr, 0) # noqa: F821
+            alg.addvariable('DeltaRMax', maxDr*maxDr, 0) # noqa: F821
             tm.registerAlgo(alg)
             
         # dimu INVM items
@@ -767,20 +761,20 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)
-            toponame = "%iINVM%i-%s%s%s"  % (minInvm, maxInvm, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)                                 # noqa: F821
+            toponame = "%iINVM%i-%s%s%s"  % (minInvm, maxInvm, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2) # noqa: F821
 
             log.info("Define %s" % toponame)
 
 
-            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]
-            algoname = AlgConf.InvariantMassInclusive1 if (mult>1 or otype1==otype2) else AlgConf.InvariantMassInclusive2
+            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]              # noqa: F821
+            algoname = AlgConf.InvariantMassInclusive1 if (mult>1 or otype1==otype2) else AlgConf.InvariantMassInclusive2 # noqa: F821
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            if (mult>1 or otype1==otype2):
+            if (mult>1 or otype1==otype2): # noqa: F821
                 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) 
                 alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', onebarrel)
+                alg.addgeneric('RequireOneBarrel', onebarrel)  # noqa: F821
             else:
                 alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
                 alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
@@ -788,10 +782,10 @@ class TopoAlgoDef:
                 alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
 
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1)
-            alg.addvariable('MinET2', ocut2 if ocut2>0 else ocut1)
-            alg.addvariable('MinMSqr', minInvm * minInvm)
-            alg.addvariable('MaxMSqr', maxInvm * maxInvm)
+            alg.addvariable('MinET1', ocut1)                       # noqa: F821
+            alg.addvariable('MinET2', ocut2 if ocut2>0 else ocut1) # noqa: F821
+            alg.addvariable('MinMSqr', minInvm * minInvm)          # noqa: F821
+            alg.addvariable('MaxMSqr', maxInvm * maxInvm)          # noqa: F821
             tm.registerAlgo(alg)
 
         # dimu DR items
@@ -809,19 +803,19 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)
-            toponame = "%iDR%i-%s%s%s"  % (minDr, maxDr, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist)                                 # noqa: F821
+            toponame = "%iDR%i-%s%s%s"  % (minDr, maxDr, "ONEBARREL-" if onebarrel==1 else "", obj1, "" if mult>1 else obj2) # noqa: F821
 
             log.info("Define %s" % toponame)
 
-            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist]
-            algoname = AlgConf.DeltaRSqrIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaRSqrIncl2
+            inputList = [otype1 + olist] if (mult>1 or otype1==otype2) else [otype1 + olist, otype2 + olist] # noqa: F821
+            algoname = AlgConf.DeltaRSqrIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaRSqrIncl2      # noqa: F821
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            if (mult>1 or otype1==otype2):
+            if (mult>1 or otype1==otype2): # noqa: F821
                 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
                 alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', onebarrel)
+                alg.addgeneric('RequireOneBarrel', onebarrel) # noqa: F821
             else:
                 alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
                 alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
@@ -830,10 +824,10 @@ class TopoAlgoDef:
 
 
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1)
-            alg.addvariable('MinET2', ocut2)
-            alg.addvariable('DeltaRMin', minDr*minDr)
-            alg.addvariable('DeltaRMax', maxDr*maxDr)
+            alg.addvariable('MinET1', ocut1) # noqa: F821
+            alg.addvariable('MinET2', ocut2) # noqa: F821
+            alg.addvariable('DeltaRMin', minDr*minDr) # noqa: F821
+            alg.addvariable('DeltaRMax', maxDr*maxDr) # noqa: F821
             tm.registerAlgo(alg)
 
 
@@ -853,38 +847,38 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist1)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2) if ocut2>0 else "", olist2)
-            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (minDeta, maxDeta, minDphi, maxDphi, obj1, "" if mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(mult) if mult>1 else ""), otype1, str(ocut1), olist1) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2) if ocut2>0 else "", olist2) # noqa: F821
+            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (minDeta, maxDeta, minDphi, maxDphi, obj1, "" if mult>1 else obj2) # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1] if (mult>1 or otype1==otype2) else [otype1 + olist1, otype2 + olist2]
-            algoname = AlgConf.DeltaEtaPhiIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaEtaPhiIncl2
+            inputList = [otype1 + olist1] if (mult>1 or otype1==otype2) else [otype1 + olist1, otype2 + olist2] # noqa: F821
+            algoname = AlgConf.DeltaEtaPhiIncl1 if (mult>1 or otype1==otype2) else AlgConf.DeltaEtaPhiIncl2 # noqa: F821
             
             alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)                        
             
-            if (mult>1 or otype1==otype2):
-                alg.addgeneric('InputWidth', nleading1)
-                alg.addgeneric('MaxTob', nleading1)
-                alg.addvariable('MinET1', ocut1, 0)
-                alg.addvariable('MinET2', ocut2, 0)
-                alg.addvariable('MinDeltaEta', minDeta, 0)
-                alg.addvariable('MaxDeltaEta', maxDeta, 0)
-                alg.addvariable('MinDeltaPhi', minDphi, 0)
-                alg.addvariable('MaxDeltaPhi', maxDphi, 0)
+            if (mult>1 or otype1==otype2):                 # noqa: F821
+                alg.addgeneric('InputWidth', nleading1)    # noqa: F821
+                alg.addgeneric('MaxTob', nleading1)        # noqa: F821
+                alg.addvariable('MinET1', ocut1, 0)        # noqa: F821
+                alg.addvariable('MinET2', ocut2, 0)        # noqa: F821
+                alg.addvariable('MinDeltaEta', minDeta, 0) # noqa: F821
+                alg.addvariable('MaxDeltaEta', maxDeta, 0) # noqa: F821
+                alg.addvariable('MinDeltaPhi', minDphi, 0) # noqa: F821
+                alg.addvariable('MaxDeltaPhi', maxDphi, 0) # noqa: F821
             else:
-                alg.addgeneric('InputWidth1', nleading1)
-                alg.addgeneric('InputWidth2', nleading2)
-                alg.addgeneric('MaxTob1', nleading1)
-                alg.addgeneric('MaxTob2', nleading2)
-                alg.addvariable('MinET1', ocut1, 0)
-                alg.addvariable('MinET2', ocut2, 0)
-                alg.addvariable('DeltaEtaMin', minDeta, 0)
-                alg.addvariable('DeltaEtaMax', maxDeta, 0)
-                alg.addvariable('DeltaPhiMin', minDphi, 0)
-                alg.addvariable('DeltaPhiMax', maxDphi, 0)
+                alg.addgeneric('InputWidth1', nleading1)   # noqa: F821
+                alg.addgeneric('InputWidth2', nleading2)   # noqa: F821
+                alg.addgeneric('MaxTob1', nleading1)       # noqa: F821
+                alg.addgeneric('MaxTob2', nleading2)       # noqa: F821
+                alg.addvariable('MinET1', ocut1, 0)        # noqa: F821
+                alg.addvariable('MinET2', ocut2, 0)        # noqa: F821
+                alg.addvariable('DeltaEtaMin', minDeta, 0) # noqa: F821
+                alg.addvariable('DeltaEtaMax', maxDeta, 0) # noqa: F821
+                alg.addvariable('DeltaPhiMin', minDphi, 0) # noqa: F821
+                alg.addvariable('DeltaPhiMax', maxDphi, 0) # noqa: F821
 
             
             tm.registerAlgo(alg)
@@ -903,22 +897,22 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%sDETA%s-%s%s%s-%s%s%s"  % (minDeta, maxDeta, otype1, str(ocut1), olist1, otype2, str(ocut2) if ocut2>0 else "", olist2)
+            toponame = "%sDETA%s-%s%s%s-%s%s%s"  % (minDeta, maxDeta, otype1, str(ocut1), olist1, otype2, str(ocut2) if ocut2>0 else "", olist2) # noqa: F821
  
             log.info("Define %s" % toponame)
 
-            inputList = [otype1 + olist1, otype2 + olist2]
+            inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
             alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)
 
-            alg.addgeneric('InputWidth1', nleading1)
-            alg.addgeneric('InputWidth2', nleading2)
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('MinDeltaEta', minDeta, 0)
-            alg.addvariable('MaxDeltaEta', maxDeta, 0)
+            alg.addgeneric('InputWidth1', nleading1)   # noqa: F821
+            alg.addgeneric('InputWidth2', nleading2)   # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2)       # noqa: F821
+            alg.addvariable('MinET1', ocut1, 0)        # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0)        # noqa: F821
+            alg.addvariable('MinDeltaEta', minDeta, 0) # noqa: F821
+            alg.addvariable('MaxDeltaEta', maxDeta, 0) # noqa: F821
 
             tm.registerAlgo(alg)
 
@@ -935,22 +929,22 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
             
-            toponame = "%sDPHI%s-%s%s%s-%s%s%s"  % (minDphi, maxDphi, otype1, str(ocut1), olist1, otype2, str(ocut2) if ocut2>0 else "", olist2)
+            toponame = "%sDPHI%s-%s%s%s-%s%s%s"  % (minDphi, maxDphi, otype1, str(ocut1), olist1, otype2, str(ocut2) if ocut2>0 else "", olist2) # noqa: F821
  
             log.info("Define %s" % toponame)
 
-            inputList = [otype1 + olist1, otype2 + olist2]
+            inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
             alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)
             
-            alg.addgeneric('InputWidth1', nleading1)
-            alg.addgeneric('InputWidth2', nleading2)
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('MinDeltaPhi', minDphi, 0)
-            alg.addvariable('MaxDeltaPhi', maxDphi, 0)
+            alg.addgeneric('InputWidth1', nleading1)   # noqa: F821
+            alg.addgeneric('InputWidth2', nleading2)   # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2)       # noqa: F821
+            alg.addvariable('MinET1', ocut1, 0)        # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0)        # noqa: F821
+            alg.addvariable('MinDeltaPhi', minDphi, 0) # noqa: F821
+            alg.addvariable('MaxDeltaPhi', maxDphi, 0) # noqa: F821
 
             tm.registerAlgo(alg)
 
@@ -1017,7 +1011,7 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "%02d%s-XE0-HT0-AJj%sall.ETA49"  % (minRatio, Ratio, str(ocut))
+            toponame = "%02d%s-XE0-HT0-AJj%sall.ETA49"  % (minRatio, Ratio, str(ocut)) # noqa: F821
             log.info("Define %s" % toponame)
             
             alg = AlgConf.Ratio( name = toponame, inputs = ['XE', 'AJjall'], outputs = [ toponame ], algoId = currentAlgoId ) 
@@ -1027,13 +1021,13 @@ class TopoAlgoDef:
             alg.addgeneric('MaxTob1', 1)
             alg.addgeneric('MaxTob2', HW.InputWidthJET)
             alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('isXE2', 1 if Ratio=="RATIO2" else 0)
-            alg.addvariable('MinET2', str(ocut))
+            alg.addgeneric('isXE2', 1 if Ratio=="RATIO2" else 0)   # noqa: F821
+            alg.addvariable('MinET2', str(ocut)) # noqa: F821
             alg.addvariable('EtaMin', 0)
             alg.addvariable('EtaMax', 49)
             alg.addvariable('MinET1', 0)                        
             alg.addvariable('HT', 0)
-            alg.addvariable('Ratio', str(minRatio))
+            alg.addvariable('Ratio', str(minRatio)) # noqa: F821
             tm.registerAlgo(alg)
 
             
@@ -1076,16 +1070,16 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "MULT-%s%s%s" % (otype1, str(ocut1), olist1)
+            toponame = "MULT-%s%s%s" % (otype1, str(ocut1), olist1) # noqa: F821
             toponames = [toponame+"[0]", toponame+"[1]"]
             log.info("Define %s" % toponames)
             
-            inputList = [otype1 + olist1] 
+            inputList = [otype1 + olist1]  # noqa: F821
             alg = AlgConf.Multiplicity( name = toponame,  inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1
             
-            alg.addgeneric('InputWidth', inputwidth1)
+            alg.addgeneric('InputWidth', inputwidth1) # noqa: F821
             alg.addgeneric('NumResultBits', 2)
-            alg.addvariable('MinET', ocut1-1) # for MU threshold -1 
+            alg.addvariable('MinET', ocut1-1) # for MU threshold -1   # noqa: F821
             tm.registerAlgo(alg)        
             
         
@@ -1100,24 +1094,24 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1)
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2)
-            toponame = "%sDISAMB-%s%s"  % ( disamb if disamb>0 else "", obj1, obj2)
+            obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2) # noqa: F821
+            toponame = "%sDISAMB-%s%s"  % ( disamb if disamb>0 else "", obj1, obj2) # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1, otype2 + olist2]
+            inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
             alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', nleading1 if olist1.find("ab")>=0 else -1000)
-            alg.addgeneric('InputWidth2', nleading2 if olist2.find("ab")>=0 else -1000) 
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
+            alg.addgeneric('InputWidth1', nleading1 if olist1.find("ab")>=0 else -1000) # noqa: F821
+            alg.addgeneric('InputWidth2', nleading2 if olist2.find("ab")>=0 else -1000)  # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('ClusterOnly', 1 if (otype1=="EM" and otype2=="TAU") or (otype1=="TAU" and otype2=="EM") else 0 )
+            alg.addgeneric('ClusterOnly', 1 if (otype1=="EM" and otype2=="TAU") or (otype1=="TAU" and otype2=="EM") else 0 ) # noqa: F821
             alg.addgeneric('ApplyDR', 0)
-            alg.addvariable('MinET1', ocut1)
-            alg.addvariable('MinET2', ocut2)
-            alg.addvariable('DisambDRSqrMin', disamb*disamb)
+            alg.addvariable('MinET1', ocut1) # noqa: F821
+            alg.addvariable('MinET2', ocut2) # noqa: F821
+            alg.addvariable('DisambDRSqrMin', disamb*disamb) # noqa: F821
             tm.registerAlgo(alg)
         
         # DISAMB 3 lists
@@ -1129,27 +1123,27 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else ""))
-            obj3 = "-%s%s%s" % (otype3, str(ocut3), olist3)
-            toponame = "%sDISAMB-%s%s%s"  % ( disamb if disamb>0 else "", obj1, obj2, obj3)
+            obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else "")) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else "")) # noqa: F821
+            obj3 = "-%s%s%s" % (otype3, str(ocut3), olist3) # noqa: F821
+            toponame = "%sDISAMB-%s%s%s"  % ( disamb if disamb>0 else "", obj1, obj2, obj3) # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1, otype2 + olist2, otype3 + olist3]
+            inputList = [otype1 + olist1, otype2 + olist2, otype3 + olist3] # noqa: F821
             alg = AlgConf.DisambiguationIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', inputwidth1)
-            alg.addgeneric('InputWidth2', inputwidth2)
-            alg.addgeneric('InputWidth3', inputwidth3)
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
-            alg.addgeneric('MaxTob3', nleading3)
+            alg.addgeneric('InputWidth1', inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', inputwidth2) # noqa: F821
+            alg.addgeneric('InputWidth3', inputwidth3) # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2) # noqa: F821
+            alg.addgeneric('MaxTob3', nleading3) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
             alg.addgeneric('ApplyDR', 0)
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('MinET3', ocut3, 0)
-            alg.addvariable('DisambDRSqr', disamb*disamb, 0) # DisambDR
+            alg.addvariable('MinET1', ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0) # noqa: F821
+            alg.addvariable('MinET3', ocut3, 0) # noqa: F821
+            alg.addvariable('DisambDRSqr', disamb*disamb, 0) # DisambDR # noqa: F821
             tm.registerAlgo(alg)         
 
         # DISAMB 3 lists with DR cut to 2nd and 3rd lists
@@ -1165,28 +1159,28 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "-%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else ""))
-            obj3 = "%s%s%s" % (otype3, str(ocut3), olist3)
-            toponame = "%sDISAMB-%s-%dDR%d%s%s"  % ( str(disamb) if disamb>0 else "", obj3, drcutmin, drcutmax, obj1, obj2)
+            obj1 = "-%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else ""))  # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else "")) # noqa: F821
+            obj3 = "%s%s%s" % (otype3, str(ocut3), olist3) # noqa: F821
+            toponame = "%sDISAMB-%s-%dDR%d%s%s"  % ( str(disamb) if disamb>0 else "", obj3, drcutmin, drcutmax, obj1, obj2)  # noqa: F821
 
             log.info("Define %s" % toponame)
             
-            inputList = [otype1 + olist1, otype2 + olist2, otype3 + olist3]
+            inputList = [otype1 + olist1, otype2 + olist2, otype3 + olist3]  # noqa: F821
             alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', inputwidth1)
-            alg.addgeneric('InputWidth2', inputwidth2)
-            alg.addgeneric('InputWidth3', inputwidth3)
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
-            alg.addgeneric('MaxTob3', nleading3)
+            alg.addgeneric('InputWidth1', inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', inputwidth2) # noqa: F821
+            alg.addgeneric('InputWidth3', inputwidth3) # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2) # noqa: F821
+            alg.addgeneric('MaxTob3', nleading3) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('MinET3', ocut3, 0)
-            alg.addvariable('DisambDRSqrMin', drcutmin*drcutmin, 0)
-            alg.addvariable('DisambDRSqrMax', drcutmax*drcutmax, 0)
-            alg.addvariable('DisambDRSqr', disamb*disamb, 0)
+            alg.addvariable('MinET1', ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0) # noqa: F821
+            alg.addvariable('MinET3', ocut3, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMin', drcutmin*drcutmin, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMax', drcutmax*drcutmax, 0) # noqa: F821
+            alg.addvariable('DisambDRSqr', disamb*disamb, 0) # noqa: F821
             tm.registerAlgo(alg)            
 
 
@@ -1199,21 +1193,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "LAR-%s%ss1"  % ( otype, str(ocut) if not otype=="EM" else "50" )
+            toponame = "LAR-%s%ss1"  % ( otype, str(ocut) if not otype=="EM" else "50" )  # noqa: F821
             
             log.info("Define %s" % toponame)
             
-            inputList = otype + 's'
+            inputList = otype + 's'  # noqa: F821
             
             alg = AlgConf.LAr( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', inputwidth) 
+            alg.addgeneric('InputWidth', inputwidth)  # noqa: F821
             alg.addgeneric('MaxTob', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', str(ocut))
-            alg.addvariable('EtaMin', minEta)
-            alg.addvariable('EtaMax', maxEta)
-            alg.addvariable('PhiMin', minPhi)
-            alg.addvariable('PhiMax', maxPhi)
+            alg.addvariable('MinET', str(ocut)) # noqa: F821
+            alg.addvariable('EtaMin', minEta) # noqa: F821
+            alg.addvariable('EtaMax', maxEta) # noqa: F821
+            alg.addvariable('PhiMin', minPhi) # noqa: F821
+            alg.addvariable('PhiMax', maxPhi) # noqa: F821
             tm.registerAlgo(alg)
 
 
@@ -1232,14 +1226,14 @@ class TopoAlgoDef:
             inputList = ['XENoSort', 'AJall']
             toponames=[]
 
-            for minxe in Threlist:
+            for minxe in Threlist:  # noqa: F821
                 toponames.append("KF-XE%s-AJall"  % (minxe))
             
             alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames, algoId = currentAlgoId ); currentAlgoId += 1
             alg.addgeneric('InputWidth', HW.InputWidthJET)
             alg.addgeneric('NumResultBits', len(toponames))
             alg.addvariable('MinET', 0)
-            for bitid,minxe in enumerate(Threlist):
+            for bitid,minxe in enumerate(Threlist):  # noqa: F821
                 alg.addvariable('KFXE', str(minxe), bitid)
             
             tm.registerAlgo(alg)
@@ -1256,22 +1250,22 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")  # noqa: F821
             log.info("Define %s" % toponame)
 
-            inputList = otype + olist
+            inputList = otype + olist  # noqa: F821
 
             alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
 
-            alg.addgeneric('InputWidth1', inputwidth)
+            alg.addgeneric('InputWidth1', inputwidth) # noqa: F821
             alg.addgeneric('InputWidth2', 1) 
-            alg.addgeneric('MaxTob1', nleading)
+            alg.addgeneric('MaxTob1', nleading) # noqa: F821
             alg.addgeneric('MaxTob2', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut)
+            alg.addvariable('MinET1', ocut) # noqa: F821
             alg.addvariable('MinET2', 0)
-            alg.addvariable('DeltaPhiMin', minDPhi, 0)
+            alg.addvariable('DeltaPhiMin', minDPhi, 0)  # noqa: F821
             tm.registerAlgo(alg)
 
             
@@ -1284,21 +1278,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%iMT-%s%s%s%s-XE0"  % (minMT, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            toponame = "%iMT-%s%s%s%s-XE0"  % (minMT, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")  # noqa: F821
             log.info("Define %s" % toponame)
 
-            inputList = otype + olist
+            inputList = otype + olist  # noqa: F821
             
             alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
 
 
             alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob', str(nleading))
+            alg.addgeneric('MaxTob', str(nleading)) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', str(ocut))
+            alg.addvariable('MinET1', str(ocut)) # noqa: F821
             alg.addvariable('MinET2', 0)
-            alg.addvariable('MinMTSqr', minMT*minMT)                        
+            alg.addvariable('MinMTSqr', minMT*minMT) # noqa: F821
             tm.registerAlgo(alg)
             
         # DISAMB 2 lists with DR cut between objects in two lists
@@ -1310,23 +1304,23 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            obj1 = "-%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else ""))
-            toponame = "%sDISAMB-%dDR%d%s%s"  % ( str(disamb) if disamb>0 else "", drcutmin, drcutmax, obj1, obj2)
+            obj1 = "-%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else "")) # noqa: F821
+            obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2.replace('shi','his') + (str(nleading2) if olist2.find('s')>=0 else "")) # noqa: F821
+            toponame = "%sDISAMB-%dDR%d%s%s"  % ( str(disamb) if disamb>0 else "", drcutmin, drcutmax, obj1, obj2) # noqa: F821
 
             log.info("Define %s" % toponame)
 
-            inputList = [otype1 + olist1, otype2 + olist2]
+            inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
             alg = AlgConf.DisambiguationDRIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', inputwidth1)
-            alg.addgeneric('InputWidth2', inputwidth2)
-            alg.addgeneric('MaxTob1', nleading1)
-            alg.addgeneric('MaxTob2', nleading2)
+            alg.addgeneric('InputWidth1', inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', inputwidth2) # noqa: F821
+            alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', nleading2) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut1, 0)
-            alg.addvariable('MinET2', ocut2, 0)
-            alg.addvariable('DisambDRSqrMin', drcutmin*drcutmin, 0)
-            alg.addvariable('DisambDRSqrMax', drcutmax*drcutmax, 0)
+            alg.addvariable('MinET1', ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', ocut2, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMin', drcutmin*drcutmin, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMax', drcutmax*drcutmax, 0) # noqa: F821
             tm.registerAlgo(alg)   
 
         # ZH Trigger
@@ -1339,21 +1333,21 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
                 
-            toponame = "%iMINDPHI-%s%s%s%s-XE50"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "")
+            toponame = "%iMINDPHI-%s%s%s%s-XE50"  % (minDPhi, otype, str(ocut) if ocut > 0 else "", olist, str(nleading) if olist=="s" else "") # noqa: F821
             log.info("Define %s" % toponame)
             
-            inputList = otype + olist
+            inputList = otype + olist # noqa: F821
 
             alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
-            alg.addgeneric('InputWidth1', inputwidth)
+            alg.addgeneric('InputWidth1', inputwidth) # noqa: F821
             alg.addgeneric('InputWidth2', 1)  
-            alg.addgeneric('MaxTob1', nleading)
+            alg.addgeneric('MaxTob1', nleading) # noqa: F821
             alg.addgeneric('MaxTob2', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', ocut)
+            alg.addvariable('MinET1', ocut) # noqa: F821
             alg.addvariable('MinET2', 50)
-            alg.addvariable('DeltaPhiMin', minDPhi, 0)
+            alg.addvariable('DeltaPhiMin', minDPhi, 0)  # noqa: F821
             tm.registerAlgo(alg)
                 
         # LATE MUON
@@ -1365,17 +1359,17 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "%s%ss1"  % ( otype, str(ocut) )
+            toponame = "%s%ss1"  % ( otype, str(ocut) ) # noqa: F821
 
             log.info("Define %s" % toponame)
 
             inputList = 'LMUs'
 
             alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', inputwidth) 
+            alg.addgeneric('InputWidth', inputwidth)  # noqa: F821
             alg.addgeneric('MaxTob', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', str(ocut))
+            alg.addvariable('MinET', str(ocut)) # noqa: F821
             tm.registerAlgo(alg)
             
 
@@ -1388,18 +1382,18 @@ class TopoAlgoDef:
             for k in x:
                 exec("%s = x[k]" % k)
 
-            toponame = "SC%d-%s%s%s%s.ETA%s" % (minHT, otype, str(ocut), olist, str(nleading) if olist=="s" else "", str(oeta))
+            toponame = "SC%d-%s%s%s%s.ETA%s" % (minHT, otype, str(ocut), olist, str(nleading) if olist=="s" else "", str(oeta)) # noqa: F821
 
             log.info("Define %s" % toponame)
 
-            inputList = otype + olist
+            inputList = otype + olist # noqa: F821
 
             alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
 
 
-            alg.addgeneric('InputWidth', inputwidth)
-            alg.addvariable('MinET', ocut)                        
-            alg.addvariable('MinSumET', minHT)
+            alg.addgeneric('InputWidth', inputwidth) # noqa: F821
+            alg.addvariable('MinET', ocut)           # noqa: F821       
+            alg.addvariable('MinSumET', minHT)       # noqa: F821
             alg.addvariable('MaxRSqr', 10*10)                        
             tm.registerAlgo(alg)  
 
@@ -1412,25 +1406,25 @@ class TopoAlgoDef:
                 for k in x:
                     exec("%s = x[k]" % k)
 
-                obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else ""))
-                obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2)
-                toponame = "%sDISAMB-%iINVM%s-%s%s"  % ( disamb if disamb>0 else "", minInvm, str(maxInvm) if maxInvm<9999 else "", obj1, obj2)          
+                obj1 = "%s%s%s"  % (otype1, str(ocut1), olist1.replace('shi','his') + (str(nleading1) if olist1.find('s')>=0 else "")) # noqa: F821
+                obj2 = "-%s%s%s" % (otype2, str(ocut2), olist2) # noqa: F821
+                toponame = "%sDISAMB-%iINVM%s-%s%s"  % ( disamb if disamb>0 else "", minInvm, str(maxInvm) if maxInvm<9999 else "", obj1, obj2)       # noqa: F821    
 
                 log.info("Define %s" % toponame)
-                inputList = [otype1 + olist1, otype2 + olist2]               
+                inputList = [otype1 + olist1, otype2 + olist2]      # noqa: F821         
                 #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
                 alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
 
-                alg.addgeneric('InputWidth1', inputwidth1)
-                alg.addgeneric('InputWidth2', inputwidth2)
-                alg.addgeneric('MaxTob1', nleading1)
-                alg.addgeneric('MaxTob2', nleading2)
+                alg.addgeneric('InputWidth1', inputwidth1) # noqa: F821
+                alg.addgeneric('InputWidth2', inputwidth2) # noqa: F821
+                alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+                alg.addgeneric('MaxTob2', nleading2) # noqa: F821
                 alg.addgeneric('NumResultBits', 1)
             
-                alg.addvariable('MinET1', ocut1)
-                alg.addvariable('MinET2', ocut2)
-                alg.addvariable('MinMSqr', minInvm * minInvm)
-                alg.addvariable('MaxMSqr', maxInvm * maxInvm)
+                alg.addvariable('MinET1', ocut1) # noqa: F821
+                alg.addvariable('MinET2', ocut2) # noqa: F821
+                alg.addvariable('MinMSqr', minInvm * minInvm) # noqa: F821
+                alg.addvariable('MaxMSqr', maxInvm * maxInvm) # noqa: F821
                 
                 tm.registerAlgo(alg)
 
@@ -1442,31 +1436,31 @@ class TopoAlgoDef:
                 for k in x:
                     exec("%s = x[k]" % k)
 
-                obj1 = "%s%s%s.%sETA%i"  % (otype1, str(ocut1), olist1 + (str(nleading1) if olist1.find('s')>=0 else ""),str(minEta1) if minEta1>0 else "", maxEta1)
-                obj2 = "-%s%s%s.%sETA%i"  % (otype2, str(ocut2), olist2 + (str(nleading2) if olist2.find('s')>=0 else ""),str(minEta2) if minEta2>0 else "", maxEta2)
+                obj1 = "%s%s%s.%sETA%i"  % (otype1, str(ocut1), olist1 + (str(nleading1) if olist1.find('s')>=0 else ""),str(minEta1) if minEta1>0 else "", maxEta1) # noqa: F821
+                obj2 = "-%s%s%s.%sETA%i"  % (otype2, str(ocut2), olist2 + (str(nleading2) if olist2.find('s')>=0 else ""),str(minEta2) if minEta2>0 else "", maxEta2) # noqa: F821
             
-                inputList = [otype1 + olist1, otype2 + olist2]
+                inputList = [otype1 + olist1, otype2 + olist2] # noqa: F821
                         
-                toponame = "%iINVM%i-%s%s"   % (minInvm, maxInvm, obj1, obj2)
+                toponame = "%iINVM%i-%s%s"   % (minInvm, maxInvm, obj1, obj2) # noqa: F821
                 alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1    
 
 
-                alg.addgeneric('InputWidth1', inputwidth1)
-                alg.addgeneric('InputWidth2', inputwidth2)
-                alg.addgeneric('MaxTob1', nleading1)
-                alg.addgeneric('MaxTob2', nleading2)
+                alg.addgeneric('InputWidth1', inputwidth1) # noqa: F821
+                alg.addgeneric('InputWidth2', inputwidth2) # noqa: F821
+                alg.addgeneric('MaxTob1', nleading1) # noqa: F821
+                alg.addgeneric('MaxTob2', nleading2) # noqa: F821
                 alg.addgeneric('NumResultBits', 1)
-                if (applyEtaCut>0):
-                    alg.addgeneric('ApplyEtaCut', applyEtaCut)
-
-                alg.addvariable('MinET1', ocut1)
-                alg.addvariable('MinET2', ocut2)
-                alg.addvariable('MinMSqr', minInvm * minInvm )
-                alg.addvariable('MaxMSqr', maxInvm * maxInvm )
-                if (applyEtaCut>0):
-                    alg.addvariable('MinEta1', minEta1)
-                    alg.addvariable('MaxEta1', maxEta1)
-                    alg.addvariable('MinEta2', minEta2)
-                    alg.addvariable('MaxEta2', maxEta2)
+                if (applyEtaCut>0): # noqa: F821
+                    alg.addgeneric('ApplyEtaCut', applyEtaCut) # noqa: F821
+
+                alg.addvariable('MinET1', ocut1) # noqa: F821
+                alg.addvariable('MinET2', ocut2) # noqa: F821
+                alg.addvariable('MinMSqr', minInvm * minInvm ) # noqa: F821
+                alg.addvariable('MaxMSqr', maxInvm * maxInvm ) # noqa: F821
+                if (applyEtaCut>0): # noqa: F821
+                    alg.addvariable('MinEta1', minEta1) # noqa: F821
+                    alg.addvariable('MaxEta1', maxEta1) # noqa: F821
+                    alg.addvariable('MinEta2', minEta2) # noqa: F821
+                    alg.addvariable('MaxEta2', maxEta2) # noqa: F821
 
                 tm.registerAlgo(alg)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/CPS.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/CPS.py
index 50d58f1ac595af999c9bcc14b2b2c7d6abcf605c..106182f354645b361249b263bfc26de39cb73564 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/CPS.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/CPS.py
@@ -52,7 +52,7 @@ def defineCPSGroups():
         #Egamma chains
         "RATE:CPS:HLT_e5_vloose"  :  ['e5_lhvloose_nod0',],
                                       
-
+        "RATE:CPS:HLT_2g3" : ['2g3_loose_L12EM3_VTE70','2g3_loose_dPhi15_L12EM3_VTE70','2g3_medium_dPhi15_L12EM3_VTE70'],
         ########################################################################
 
         "RATE:CPS:HLT_e20_vloose"        : ['e20_lhvloose_nod0'],
@@ -66,7 +66,7 @@ def defineCPSGroups():
 #                                                'e24_lhmedium_nod0_L1EM18VH', 
 #                                                ],
         
-        "RATE:CPS:HLT_e24_tight_L1EM20VH" :  ['e24_lhtight_L1EM20VH',
+        "RATE:CPS:HLT_e24_tight_L1EM20VH" :  [
                                                 'e24_lhtight_nod0_L1EM20VH',
                                                 ],
         
@@ -91,6 +91,11 @@ def defineCPSGroups():
                                                'e13_etcut_trkcut_j20_perf_xe15_2dphi05_mt25',
                                                'e13_etcut_trkcut_xs15_j20_perf_xe15_2dphi05_mt25',],
 
+        #muon chains
+        'RATE:CPS:HLT_muon_idperf'         :['mu20_idperf',
+                                             'mu24_idperf',
+                                             'mu40_idperf',],
+
         #tau chains   
         'RATE:CPS:HLT_tau25_express'         :['tau25_idperf_track',
                                                'tau25_perf_tracktwo',
@@ -98,7 +103,9 @@ def defineCPSGroups():
                                                'tau25_medium1_tracktwo',],  
         'RATE:CPS:HLT_tau160'		     :['tau160_idperf_track',
                                                'tau160_idperf_tracktwo',
-                                               'tau160_perf_tracktwo',],  
+                                               'tau160_perf_tracktwo',],  					       
+        'RATE:CPS:HLT_tau160_L1TAU100'	     :['tau160_idperf_tracktwo_L1TAU100',
+                                               'tau160_perf_tracktwo_L1TAU100',],  
         
         #BJet chains                                                                                                                                                    
         'RATE:CPS:HLT_j35b' : [#'j35_bperf',
@@ -108,21 +115,21 @@ def defineCPSGroups():
                                ],
 
         
-        'RATE:CPS:HLT_j55b' : ['j55_bperf',
-                               'j55_bperf_split',
+        'RATE:CPS:HLT_j55b' : [#'j55_bperf',
+                               #'j55_bperf_split',
                                'j55_boffperf',
                                'j55_boffperf_split',
                                ],
 
 
-        'RATE:CPS:HLT_j150b' : ['j150_bperf',
-                                'j150_bperf_split',
+        'RATE:CPS:HLT_j150b' : [#'j150_bperf',
+                                #'j150_bperf_split',
                                 'j150_boffperf',
                                 'j150_boffperf_split',
                                ],
 
-        'RATE:CPS:HLT_j320b' : ['j320_bperf',
-                                'j320_bperf_split',
+        'RATE:CPS:HLT_j320b' : [#'j320_bperf',
+                                #'j320_bperf_split',
                                 'j320_boffperf',
                                 'j320_boffperf_split',
                                ],         
@@ -195,47 +202,47 @@ def defineCPSGroups():
 
 
         # mu+jets chains 
-        'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_bperf_split_dr05_dz02',
-                                       'mu4_j25_bperf_split_dr05_dz02',
-                                       'mu4_j35_bperf_split_dr05_dz02',
-				       'mu4_j35_bperf_split',
+        'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_boffperf_split_dr05_dz02',
+                                       'mu4_j25_boffperf_split_dr05_dz02',
+                                       'mu4_j35_boffperf_split_dr05_dz02',
+				       'mu4_j35_boffperf_split',
 				       ],
 				       
 				       
       #  'RATE:CPS:HLT_mu_jet_L1MU6_J20' : [	
-				#	'mu6_j60_gsc85_bperf_split_dr05_dz02',
-				#	'mu6_j60_gsc110_bperf_split_dr05_dz02',
+				#	'mu6_j60_gsc85_boffperf_split_dr05_dz02',
+				#	'mu6_j60_gsc110_boffperf_split_dr05_dz02',
 				#       ],
         'RATE:CPS:HLT_mu_jet_L1MU6_J40' : [
-					'mu6_j150_bperf_split_dr05_dz02',
-					'mu6_j150_bperf_split',
-					'mu6_j175_bperf_split_dr05_dz02',	
+					'mu6_j150_boffperf_split_dr05_dz02',
+					'mu6_j150_boffperf_split',
+					'mu6_j175_boffperf_split_dr05_dz02',	
 				       ],
         'RATE:CPS:HLT_mu_jet_L1MU6_J75' : [
-						'mu6_j175_gsc260_bperf_split_dr05_dz02',
-						'mu6_j225_gsc320_bperf_split_dr05_dz02',
-						'mu6_j320_bperf_split',
-						'mu6_j400_bperf_split_dr05_dz02',     
+						'mu6_j175_gsc260_boffperf_split_dr05_dz02',
+						'mu6_j225_gsc320_boffperf_split_dr05_dz02',
+						'mu6_j320_boffperf_split',
+						'mu6_j400_boffperf_split_dr05_dz02',     
 				       ],			    
         }
 
     if "v6"  in TriggerFlags.triggerMenuSetup():
         HLT_CPS_Groups.update({
             'RATE:CPS:HLT_mu_jet_L1MU6_J75' : [
-                'mu6_j260_bperf_split_dr05_dz02',
-                'mu6_j320_bperf_split_dr05_dz02',
-                'mu6_j320_bperf_split',
-                'mu6_j400_bperf_split_dr05_dz02',     
+                'mu6_j260_boffperf_split_dr05_dz02',
+                'mu6_j320_boffperf_split_dr05_dz02',
+                'mu6_j320_boffperf_split',
+                'mu6_j400_boffperf_split_dr05_dz02',     
             ],
             'RATE:CPS:HLT_mu_jet_L1MU6_J40' : [
-                'mu6_j150_bperf_split_dr05_dz02',
-                'mu6_j150_bperf_split',
-                'mu6_j175_bperf_split_dr05_dz02',	
+                'mu6_j150_boffperf_split_dr05_dz02',
+                'mu6_j150_boffperf_split',
+                'mu6_j175_boffperf_split_dr05_dz02',	
             ],
-            'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_bperf_split_dr05_dz02',
-                                           'mu4_j25_bperf_split_dr05_dz02',
-                                           'mu4_j35_bperf_split_dr05_dz02',
-                                           'mu4_j35_bperf_split',
+            'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_boffperf_split_dr05_dz02',
+                                           'mu4_j25_boffperf_split_dr05_dz02',
+                                           'mu4_j35_boffperf_split_dr05_dz02',
+                                           'mu4_j35_boffperf_split',
 				       ],
         'RATE:CPS:HLT_e24_medium_L1EM18VH' : ['e24_lhmedium_L1EM18VH',
                                                 'e24_lhmedium_nod0_L1EM18VH',
@@ -285,28 +292,32 @@ def defineCPSGroups():
                 'RATE:CPS:HLT_e24_medium_L1EM18VHI' : ['e24_lhmedium_L1EM18VHI',
                                                        'e24_lhmedium_nod0_L1EM18VHI',
                                                        ],
-                'RATE:CPS:HLT_mu_jet_L1MU6_J75' : ['mu6_j175_gsc260_bperf_split_dr05_dz02',
-                                                   'mu6_j225_gsc320_bperf_split_dr05_dz02',
-                                                   'mu6_j225_gsc320_bperf_split_dr05_dz99',
-                                                   'mu6_j225_gsc320_bperf_split',
-                                                   'mu6_j225_gsc400_bperf_split_dr05_dz02',     
+                'RATE:CPS:HLT_mu_jet_L1MU6_J75' : ['mu6_j175_gsc260_boffperf_split_dr05_dz02',
+                                                   'mu6_j225_gsc320_boffperf_split_dr05_dz02',
+                                                   'mu6_j225_gsc320_boffperf_split_dr05_dz99',
+                                                   'mu6_j225_gsc320_boffperf_split',
+                                                   'mu6_j225_gsc400_boffperf_split_dr05_dz02',     
                                                    ],
-                'RATE:CPS:HLT_mu_jet_L1MU6_J40' : ['mu6_j110_gsc150_bperf_split_dr05_dz02',
-                                                   'mu6_j110_gsc150_bperf_split_dr05_dz99',
-                                                   'mu6_j110_gsc150_bperf_split',
-                                                   'mu6_j150_gsc175_bperf_split_dr05_dz02',	
+                'RATE:CPS:HLT_mu_jet_L1MU6_J40' : ['mu6_j110_gsc150_boffperf_split_dr05_dz02',
+                                                   'mu6_j110_gsc150_boffperf_split_dr05_dz99',
+                                                   'mu6_j110_gsc150_boffperf_split',
+                                                   'mu6_j150_gsc175_boffperf_split_dr05_dz02',	
                                                    ],
-                'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_bperf_split_dr05_dz02',
-                                               'mu4_j25_bperf_split_dr05_dz02',
-                                               'mu4_j15_gsc35_bperf_split_dr05_dz02',
-                                               'mu4_j15_gsc35_bperf_split_dr05_dz99',
-                                               'mu4_j15_gsc35_bperf_split',
+                'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_boffperf_split_dr05_dz02',
+                                               'mu4_j25_boffperf_split_dr05_dz02',
+                                               'mu4_j15_gsc35_boffperf_split_dr05_dz02',
+                                               'mu4_j15_gsc35_boffperf_split_dr05_dz99',
+                                               'mu4_j15_gsc35_boffperf_split',
                                                ],
 
-                'RATE:CPS:HLT_mu_jet_L1MU6_J20' : ['mu6_j60_gsc85_bperf_split_dr05_dz02',
-                                                   'mu6_j60_gsc110_bperf_split_dr05_dz02',
+                'RATE:CPS:HLT_mu_jet_L1MU6_J20' : ['mu6_j60_gsc85_boffperf_split_dr05_dz02',
+                                                   'mu6_j60_gsc110_boffperf_split_dr05_dz02',
                                                    ],
 
+                'RATE:CPS:HLT_mu4_bJpsi_Trk' : ['mu4_bJpsi_TrkPEB','mu4_bJpsi_Trkloose','mu4_mu2noL1_L1MU4'],
+                'RATE:CPS:HLT_mu6_bJpsi_Trk' : ['mu6_bJpsi_TrkPEB','mu6_bJpsi_lowpt_TrkPEB', 'mu6_bJpsi_Trkloose','mu6_mu2noL1_L1MU6'],
+                'RATE:CPS:HLT_mu10_bJpsi_Trk' : ['mu10_bJpsi_TrkPEB','mu10_bJpsi_Trkloose', 'mu10_bJpsi_TrkPEBmon'],
+                'RATE:CPS:HLT_mu14_bJpsi_Trk' : ['mu14_bJpsi_TrkPEB','mu14_bJpsi_Trkloose'],
 
 #        'RATE:CPS:HLT_xe70_L1XE50' : ['xe70_L1XE50',
 #                                      'xe75_L1XE50',
@@ -408,18 +419,18 @@ def defineCPSGroups():
                                             'xe90_pufit_wEFMu_L1XE70_BGRP7',
                                             ],
 					    
-         'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_bperf_split_dr05_dz02',
-                                       'mu4_j25_bperf_split_dr05_dz02',
-                                       'mu4_j35_bperf_split_dr05_dz02',
+         'RATE:CPS:HLT_mu_jet_L1MU4' : ['mu4_j15_boffperf_split_dr05_dz02',
+                                       'mu4_j25_boffperf_split_dr05_dz02',
+                                       'mu4_j35_boffperf_split_dr05_dz02',
 				       ],   
         'RATE:CPS:HLT_mu_jet_L1MU6_J40' : [
-					'mu6_j150_bperf_split_dr05_dz02',
-					'mu6_j175_bperf_split_dr05_dz02',	
+					'mu6_j150_boffperf_split_dr05_dz02',
+					'mu6_j175_boffperf_split_dr05_dz02',	
 				       ],
         'RATE:CPS:HLT_mu_jet_L1MU6_J75' : [
-						'mu6_j260_bperf_split_dr05_dz02',
-						'mu6_j320_bperf_split_dr05_dz02',
-						'mu6_j400_bperf_split_dr05_dz02',     
+						'mu6_j260_boffperf_split_dr05_dz02',
+						'mu6_j320_boffperf_split_dr05_dz02',
+						'mu6_j400_boffperf_split_dr05_dz02',     
 				       ],      
 					    }) 
     if "v6" in TriggerFlags.triggerMenuSetup():
@@ -547,11 +558,7 @@ def defineCPSGroups():
 
         #Met chains
         'RATE:CPS:HLT_xe35' : ['xe35',
-                               'xe35_tc_lcw',
-                               'xe35_tc_em',
                                'xe35_pueta',
-                               'xe35_pufit',
-                               'xe35_mht',
                                'xe35_wEFMu',
                                'xe35_tc_lcw_wEFMu', 
                                'xe35_tc_em_wEFMu',
@@ -594,19 +601,6 @@ def defineCPSGroups():
    #                                    'xe100_pufit_wEFMu_L1XE50', 
                                        ],         
 
-        'RATE:CPS:HLT_xe45' : ['xe45',
-                               'xe45_mht',
-                               'xe45_mht_wEFMu',
-                               'xe45_pueta',
-                               'xe45_pueta_wEFMu',
-                               'xe45_pufit',
-                               'xe45_pufit_wEFMu',
-                               'xe45_tc_em',
-                               'xe45_tc_em_wEFMu',
-                               'xe45_tc_lcw',
-                               'xe45_tc_lcw_wEFMu',
-                               'xe45_wEFMu',
-                               ],
         'RATE:CPS:HLT_xe100_L1XE35' : ['xe100_L1XE35',  
                                        'xe100_tc_lcw_L1XE35', 
                                        'xe100_tc_em_L1XE35',  
@@ -676,13 +670,9 @@ def defineCPSGroups():
                                                 'e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35',],
 
                 
-        'RATE:CPS:HLT_e28_lhvloose_L1EM20VH_3j20noL1' : ['e28_lhvloose_nod0_L1EM20VH_3j20noL1',],
       
-        'RATE:CPS:HLT_e28_lhvloose_L1EM20VH_4j20noL1' : ['e28_lhvloose_nod0_L1EM20VH_4j20noL1',],
       
-        'RATE:CPS:HLT_e28_lhvloose_L1EM20VH_5j15noL1' : ['e28_lhvloose_nod0_L1EM20VH_5j15noL1',],
       
-        'RATE:CPS:HLT_e28_lhvloose_L1EM20VH_6j15noL1' : ['e28_lhvloose_nod0_L1EM20VH_6j15noL1',],
 
         
         'RATE:CPS:HLT_3mu6_bDimu' : ['3mu6_bDimu',
@@ -715,17 +705,6 @@ def defineCPSGroups():
 
     if "v7" in TriggerFlags.triggerMenuSetup():
         HLT_CPS_Groups.update({
-        'RATE:CPS:HLT_xe45' : ['xe45',
-                               'xe45_mht',
-                               'xe45_mht_wEFMu',
-                               'xe45_pufit',
-                               'xe45_pufit_wEFMu',
-                               'xe45_tc_em',
-                               'xe45_tc_em_wEFMu',
-                               'xe45_tc_lcw',
-                               'xe45_tc_lcw_wEFMu',
-                               'xe45_wEFMu',
-                               ],
 
         # Single-jet chains
         'RATE:CPS:HLT_j35' :    [   'j35',
@@ -944,6 +923,13 @@ def defineCPSGroups():
 
         "RATE:CPS:HLT_g60_loose_L1EM24VHIM" : ['g60_loose_L1EM24VHIM',],
 
+        "RATE:CPS:HLT_jX_L1AFP_A_OR_C_J12" : ['j20_L1AFP_A_OR_C_J12',
+                                              'j45_L1AFP_A_OR_C_J12'],
+        "RATE:CPS:HLT_jX_L1AFP_A_AND_C_J12" : ['j20_L1AFP_A_AND_C_J12',
+                                              'j45_L1AFP_A_AND_C_J12'],
+        "RATE:CPS:HLT_jX_L1J12" : ['j20_L1J12',
+                                   'j45_L1J12'],
+
 
         })
     return (HLT_CPS_Groups)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/ChainDef.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/ChainDef.py
index bde3cacb46f2528adaf3d384b982ae6e443e065b..6384322e479e76cbef30e0d90c38c48c76651109 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/ChainDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/ChainDef.py
@@ -57,7 +57,7 @@ class ChainDef:
 
         #safety: if asked to insert with sig_counter -1, use addSignature
         if signature_counter == -1:
-            addSignature(signature_counter,listOfTriggerElements)
+            self.addSignature(signature_counter,listOfTriggerElements)
         else:
             pos_newSeq = -1
             
@@ -97,6 +97,10 @@ class ChainDef:
     def appendSignature(self, listOfTriggerElements):
         """add new signature to the end of the signature list and increment chain counter automatically"""
 
+        for s in self.signatureList:
+            if( s["listOfTriggerElements"] == listOfTriggerElements ):
+                return
+
         self.signatureList.append(
             {'signature_counter': self.signatureList[-1]["signature_counter"]+1,
              'listOfTriggerElements': listOfTriggerElements})
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/CommonSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/CommonSliceFlags.py
index 1c4e711d84b337b63bdfbe70fb452484d20def0a..157a75584a4bc7cd3e2305d2b4b0600f1777eaf6 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/CommonSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/CommonSliceFlags.py
@@ -2,7 +2,7 @@
 
 """ Common slices flags  """
 
-from AthenaCommon.JobProperties import JobProperty, jobproperties
+from AthenaCommon.JobProperties import JobProperty
 
 
 __author__  = 'T. Bold'
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/DC14.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/DC14.py
index 373972790099b09c97d14fe74feaaea307772a84..fbe9d1afbf54f3e48ea1159a3da9b34dc00a54c7 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/DC14.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/DC14.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
 
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.DC14.py' )
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py
index 83225cf19d58673aa28d2ffc6f9240e320d646ca..dd92910e4110d6aa4cae66ba02f93ba95751eebe 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py
@@ -12,9 +12,6 @@ __author__  = 'Moritz Backes & Catrin Bernius & Joerg Stelzer'
 __version__=""
 __doc__="Obtaining Dictionaries from Chain Names"
 
-
-import re
-
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 logDict = logging.getLogger('TriggerMenu.menu.DictFromChainName')
@@ -106,8 +103,7 @@ 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
         from copy import deepcopy
@@ -177,9 +173,7 @@ 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:
@@ -191,7 +185,7 @@ class DictFromChainName(object):
                 logDict.debug("Pattern found in this string: %s", cpart)
                 m_groupdict = m.groupdict()
                 # Check whether the extra contains a special keyword
-                skip=False
+                #skip=False
 #                for keyword in AllowedMatchingKeywords :
 #                    if keyword in m_groupdict['extra']: skip=True
 #                if skip: continue
@@ -203,7 +197,7 @@ class DictFromChainName(object):
                     # 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
+                    #skip=False
 #                    for keyword in AllowedMatchingKeywords :
 #                        if chainName[theMultiChainIndex:len(chainName)].startswith(cpart+keyword): skip=True
 #                    if skip: continue
@@ -232,6 +226,15 @@ class DictFromChainName(object):
                 mdicts.append(m_groupdict)
                 break # stop loop here so mb doesn't get picked up from min bias slice as it's streaming info
 
+## Not sure if this is necessary, per suggestion from C. Bernius
+            elif cpart=='afp': 
+                logDict.debug('Doing AFP')
+                multichainindex.append(chainName.index(cpart)) 
+                m_groupdict = {'signature': 'AFP', 'threshold': '', 'multiplicity': '', 
+                               'trigType': 'afp', 'extra': ''}
+                if 'AFP' not in signatureNames:  signatureNames.append('AFP')
+                mdicts.append(m_groupdict)
+
             elif cpart=='mb': 
                 logDict.debug('Doing MB')
                 multichainindex.append(chainName.index(cpart)) 
@@ -298,7 +301,6 @@ class DictFromChainName(object):
         # ----  ----
         multichainparts=[]
 
-        remainder = chainName
         multichainindex = sorted(multichainindex, key=int)
         cN = chainName
         for i in reversed(multichainindex):
@@ -321,7 +323,7 @@ class DictFromChainName(object):
             logDict.debug('chainparts %s', chainparts)
 
             # ---- check if L1 item is specified in chain Name ----
-            L1itemFromChainName = ''; L1item = ''; 
+            L1itemfromChainName = ''; L1item = ''; 
             chainpartsNoL1 = chainparts
             
             #Checking for L1 item for chain part and overall in the name
@@ -349,7 +351,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])
 
 
 
@@ -445,7 +447,7 @@ 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 = [] 
+            #unmatched = [] 
             parts = filter(None, parts)     #removing empty strings from list
 
             matchedparts = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py
index 07f3e2ad99a8d1a4447309a53704d8068e4df1d1..e5ab95d2d8340f730aaf9e244dcf1a1f39bb221e 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py
@@ -8,6 +8,7 @@ from TriggerMenu.jet.JetSliceFlags                     import JetSliceFlags
 from TriggerMenu.bjet.BjetSliceFlags                   import BjetSliceFlags
 from TriggerMenu.met.METSliceFlags                     import METSliceFlags
 from TriggerMenu.tau.TauSliceFlags                     import TauSliceFlags
+from TriggerMenu.afp.AFPSliceFlags                     import AFPSliceFlags
 from TriggerMenu.minbias.MinBiasSliceFlags             import MinBiasSliceFlags
 from TriggerMenu.heavyion.HeavyIonSliceFlags           import HeavyIonSliceFlags
 from TriggerMenu.combined.CombinedSliceFlags           import CombinedSliceFlags
@@ -22,12 +23,12 @@ from TriggerMenu.test.TestSliceFlags                   import TestSliceFlags
 from TriggerMenu.menu.TriggerPythonConfig  import TriggerPythonConfig
 from TriggerMenu.menu.CPS                  import addCPS
 from TriggerMenu.menu.Lumi                 import lumi, applyPrescales
-from TriggerMenu.menu.MenuUtil             import checkTriggerGroupAssignment, checkStreamConsistency, getStreamTagForRerunChains,checkGroups
+from TriggerMenu.menu.MenuUtil             import checkStreamConsistency, getStreamTagForRerunChains,checkGroups
 from TriggerMenu.menu.HLTObjects           import HLTChain, HLTSequence
 from TriggerMenu.menu                      import StreamInfo, DictFromChainName
-import TriggerMenu.menu.MenuUtils
+from TriggerMenu.menu.MenuUtils            import splitInterSignatureChainDict,mergeChainDefs
 
-import os, traceback, operator, commands, time
+import os, traceback, operator, commands
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'TriggerMenu.menu.GenerateMenu' )
@@ -76,6 +77,7 @@ class GenerateMenu:
         self.doBphysicsChains    = True
         self.doMETChains         = True
         self.doTauChains         = True
+        self.doAFPChains         = True
         self.doMinBiasChains     = True
         self.doHeavyIonChains     = True
         self.doCosmicChains      = True
@@ -93,9 +95,9 @@ class GenerateMenu:
     
 
     def deactivateChains(self,signatureGroupsToDeactivate):
-        for signatureGroupToDeactive in signatureGroupsToDeactivate:
+        for signatureGroupToDeactivate in signatureGroupsToDeactivate:
             try:
-                eval("self.do"+signatureGroupToDeactive+"Chains = False")
+                eval("self.do"+signatureGroupToDeactivate+"Chains = False")
             except:
                 log.error('GenerateMenu: Could not deactivate trigger signature:',signatureGroupToDeactivate)
 
@@ -149,6 +151,12 @@ class GenerateMenu:
         else:
             self.doTauChains = False
 
+        if (CombinedSliceFlags.signatures() or AFPSliceFlags.signatures()) and self.doAFPChains:
+            chains += AFPSliceFlags.signatures()
+            log.debug('GenerateMenu : AFP : %s', chains)
+        else:
+            self.doAFPChains = False
+
         if (CombinedSliceFlags.signatures() or MinBiasSliceFlags.signatures()) and self.doMinBiasChains:
             chains += MinBiasSliceFlags.signatures()
             log.debug('GenerateMenu : MinBias : %s', chains)
@@ -221,12 +229,23 @@ class GenerateMenu:
         for chain in chains:
             log.debug('chain %s', chain)
             l1item = chain[1]
-            if (l1item not in l1itemnames) & (l1item != ''):
+            if (l1item not in l1itemnames) & (l1item != '') and ',' not in l1item:
                 myl1item = getSpecificL1Seeds(l1item, self.trigConfL1.menu.items)
                 if ('ERROR_' in myl1item):
                     if (l1item not in missingL1items):  missingL1items.append(l1item)                    
                 else:
                     chain[1] = myl1item
+            elif ',' in l1item:
+                myl1item = l1item
+                for each_l1item in l1item.split(','):
+                    if each_l1item not in l1itemnames:
+                        myl1item = 'ERROR'
+                        missingL1items.append(l1item)
+                if ('ERROR' in myl1item):
+                    if (l1item not in missingL1items):  missingL1items.append(l1item)                    
+                else:
+                    chain[1] = myl1item
+
         if  len(missingL1items) > 0 :
             log.error('The following L1 items were not found in the corresponding L1 menu: '+str(missingL1items))
 
@@ -321,6 +340,14 @@ class GenerateMenu:
                 log.info(traceback.print_exc())
                 self.doBjetChains = False
 
+        if self.doAFPChains:
+            try:
+                import TriggerMenu.afp.generateAFPChainDefs
+            except:
+                log.error('Problems when importing AFP.py, disabling AFP chains.')
+                log.info(traceback.print_exc())
+                self.doAFPChains = False
+
         if self.doMinBiasChains:
             try:
                 import TriggerMenu.minbias.generateMinBiasChainDefs 
@@ -405,13 +432,13 @@ class GenerateMenu:
 
 
 
-        allowedSignatures = ["jet","egamma","muon", "electron", "photon","met","tau", 
-                             "minbias", "heavyion", "cosmic", "calibration", "streaming", "monitoring", "ht", 'bjet','eb']
+        #allowedSignatures = ["jet","egamma","muon", "electron", "photon","met","tau", "afp",
+        #                     "minbias", "heavyion", "cosmic", "calibration", "streaming", "monitoring", "ht", 'bjet','eb']
         
         listOfChainDefs = []
 
         log.debug("\n chainDicts1 %s ", chainDicts)
-        chainDicts = TriggerMenu.menu.MenuUtils.splitInterSignatureChainDict(chainDicts)        
+        chainDicts = splitInterSignatureChainDict(chainDicts)        
         log.debug("\n chainDicts2 %s", chainDicts)
         
 
@@ -489,6 +516,14 @@ class GenerateMenu:
                     log.error('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
                     log.info(traceback.print_exc())
                     continue
+                
+            elif chainDict["signature"] == "AFP" and self.doAFPChains:
+                try:
+                    chainDefs = TriggerMenu.afp.generateAFPChainDefs.generateChainDefs(chainDict)
+                except:
+                    log.error('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
+                    log.info(traceback.print_exc())
+                    continue
 
             elif chainDict["signature"] == "MinBias" and self.doMinBiasChains:
                 try:
@@ -588,7 +623,7 @@ class GenerateMenu:
             return False
         elif len(listOfChainDefs)>1:
             if ("mergingStrategy" in chainDicts[0].keys()):
-                theChainDef = TriggerMenu.menu.MenuUtils.mergeChainDefs(listOfChainDefs,chainDicts[0]["mergingStrategy"],chainDicts[0]["mergingOffset"],preserveL2EFOrder = chainDicts[0]["mergingPreserveL2EFOrder"],doTopo=doTopo,chainDicts=chainDicts)#, noTEreplication = chainDicts[0]["mergingNoTEreplication"])
+                theChainDef = mergeChainDefs(listOfChainDefs,chainDicts[0]["mergingStrategy"],chainDicts[0]["mergingOffset"],preserveL2EFOrder = chainDicts[0]["mergingPreserveL2EFOrder"],doTopo=doTopo,chainDicts=chainDicts)#, noTEreplication = chainDicts[0]["mergingNoTEreplication"])
             else:
                 log.error("No merging strategy specified for combined chain %s" % chainDicts[0]['chainName'])
                 
@@ -718,8 +753,9 @@ class GenerateMenu:
         dumpIt(f, EgammaSliceFlags.signatures(), 'Egamma')
         dumpIt(f, METSliceFlags.signatures(), 'MET')
         dumpIt(f, TauSliceFlags.signatures(), 'Tau')
+        dumpIt(f, AFPSliceFlags.signatures(), 'AFP')
         dumpIt(f, MinBiasSliceFlags.signatures(), 'MinBias')
-        dumpIt(f, HeavyIonFlagsFlags.signatures(), 'HeavyIon')
+        dumpIt(f, HeavyIonSliceFlags.signatures(), 'HeavyIon')
         dumpIt(f, CosmicSliceFlags.signatures(), 'Cosmic')
         dumpIt(f, CalibSliceFlags.signatures(), 'Calibration')
         dumpIt(f, StreamingSliceFlags.signatures(), 'Streaming')
@@ -911,7 +947,7 @@ class GenerateMenu:
         log.info('checkGroups')
         checkGroups(self.triggerPythonConfig)
 
-        cpsMenus = ['Physics_pp_v5','Physics_pp_v6','Physics_pp_v7']
+        #cpsMenus = ['Physics_pp_v5','Physics_pp_v6','Physics_pp_v7']
         ##if TriggerFlags.triggerMenuSetup() in cpsMenus:
         if TriggerFlags.triggerMenuSetup().find("pp_v")>=0:            
             log.info('Assigning CPS groups now')
@@ -930,7 +966,6 @@ class GenerateMenu:
 
         #dump configuration files
         log.info('generate: dump configuration Files')
-        lvl1_items = [x.name for x in self.trigConfL1.menu.items]
         #self.dumpSignatureList(self.trigConfL1.menu.items.itemNames(),'hltsigs.txt')
         self.triggerPythonConfig.writeConfigFiles()
         if log.isEnabledFor(logging.DEBUG): self.triggerPythonConfig.dot(algs=True)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/GroupInfo.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/GroupInfo.py
index 857ab87533ec6b8f209c08c3c99fee2f74c84c40..69413e70943ee8551b607953acacc2bdaf1ed7c0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/GroupInfo.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/GroupInfo.py
@@ -6,11 +6,13 @@ log = logging.getLogger( 'TriggerMenu.menu.GroupInfo' )
 AllowedGroups = ['Muon',
                  'Jet',
                  'BJet',
+                 'BJet_combined',
                  'MET',
                  'Tau',
                  'Egamma',
                  'Bphys',
                  'BeamSpot',
+                 'AFP',
                  'MinBias',
                  'Detector',
                  'Other',
@@ -18,6 +20,7 @@ AllowedGroups = ['Muon',
                  'ID',
                  'TauOverlay',
                  'ZeroBias',
+                 'MinBiasOverlay',
                  ]
 
 
@@ -31,10 +34,10 @@ AllowedGroup_HI = ['UltraCentral',
                    ]
 
 def getAllAllowedGroups(menu):    
-    if 'pp_v6' in menu or 'pp_v7' in menu:
+    if 'pp_v6' in menu or 'pp_v7' in menu or 'PhaseII' in menu:
         return AllowedGroups
     elif 'HI' in menu:
         return AllowedGroups+AllowedGroup_HI
     else:
-        log.error("No list of allowed groupd for "+menu)
+        log.error("No list of allowed group for "+menu)
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/HLTObjects.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/HLTObjects.py
index 803955f85c3901f20c294d23f8a23b319700dd36..3a4d99ad0901eb20d924e01a09f926fa4adfc124 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/HLTObjects.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/HLTObjects.py
@@ -1,10 +1,5 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import os
-import time
-import re
-import string
-from sys import settrace
 import xml.etree.cElementTree as etree
 
 from AthenaCommon.Logging import logging  # loads logger
@@ -46,7 +41,8 @@ class HLTChain:
                 for te in self.tes:
                     if type(te) != type(''): # check if this is a string
                         raise Exception("The trigger element: " + str(te) + " in the signature: " + self.sigcounter + "is not a plain string" )
-                    xTriggerElement = etree.SubElement(xSignature, 'TRIGGERELEMENT', te_name=str(te))
+                    #xTriggerElement = etree.SubElement(xSignature, 'TRIGGERELEMENT', te_name=str(te))
+                    etree.SubElement(xSignature, 'TRIGGERELEMENT', te_name=str(te))
                     
     # construction
     def __init__(self, chain_name, chain_counter,
@@ -124,7 +120,7 @@ class HLTChain:
         last_counter = 1
         if len(self.siglist) != 0:
             last_counter = self.siglist[-1].sigcounter
-            logger().debug( "The chain: " + self.chain_name + " contains already signatures. Will align sinatures to it." )
+            logger().debug( "The chain: " + self.chain_name + " with counter " + last_counter + " already contains signatures. Will align sinatures to it." )
 
 
         total_counter = 0
@@ -171,7 +167,7 @@ class HLTChain:
         last_counter = 1
         if len(self.siglist) != 0:
             last_counter = self.siglist[-1].sigcounter
-            logger().debug( "The chain: " + self.chain_name + " contains already signatures. Will align sinatures to it." )
+            logger().debug( "The chain: " + self.chain_name + " with counter " + last_counter + "already contains signatures. Will align sinatures to it." )
 
 
         max_counter = 0;
@@ -292,11 +288,13 @@ class HLTChain:
 
         xTriggerTypeList = etree.SubElement(xChain, 'TRIGGERTYPE_LIST')
         for bit in self.trigger_type_bits:
-            xTriggerType = etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
+            #xTriggerType = etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
+            etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
 
         xStreamTagList = etree.SubElement(xChain, 'STREAMTAG_LIST')
         for stream in self.stream_tag:
-            xStreamTag = etree.SubElement(xStreamTagList, 'STREAMTAG',
+            #xStreamTag = etree.SubElement(xStreamTagList, 'STREAMTAG',
+            etree.SubElement(xStreamTagList, 'STREAMTAG',
                                           stream = stream[0],
                                           type = stream[1],
                                           obeyLB = stream[2],
@@ -310,7 +308,8 @@ class HLTChain:
 
         xGroupList = etree.SubElement(xChain, 'GROUP_LIST')
         for g in self.groups:
-            xGroup = etree.SubElement(xGroupList, 'GROUP', name = g)
+            #xGroup = etree.SubElement(xGroupList, 'GROUP', name = g)
+            etree.SubElement(xGroupList, 'GROUP', name = g)
             
         xSignatureList = etree.SubElement(xChain, 'SIGNATURE_LIST')
         for sig in self.siglist:
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/HltConfig.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/HltConfig.py
index ed79d0a83ef1a71987f3f4abfd9bf6ce78e38be8..55e2fc0f501c98512f3b60bf08e29384b845a046 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/HltConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/HltConfig.py
@@ -4,9 +4,8 @@
 # Hlt configuration base classes
 #-----------------------------------------------------
 
-#from AthenaCommon.Configurable import *
-from TriggerJobOpts.TriggerFlags import *
 from TriggerMenu.menu.ChainDef import ChainDef
+from AthenaCommon.Logging import logging  # loads logger
 
 log = logging.getLogger( 'TriggerMenu.menu.HltConfig.py' )
 # log.setLevel(logging.DEBUG)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/L1Seeds.py
index 0d08b9f22c9d33fb54ed8ae2517c82f901330b17..94b89864c0db154f0465795b5534d8b4b28e8469 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/L1Seeds.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/L1Seeds.py
@@ -54,6 +54,9 @@ def Lvl1ItemByTriggerType(l1object, triggertypebit, triggertypebitmask):
 def getL1BackgroundSeed(menul1items):        
     l1background_seeds = 'L1_BCM_AC_CA_BGRP0,L1_BCM_Wide_EMPTY,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_J30.31ETA49_UNPAIRED_ISO,L1_J12_UNPAIRED_ISO,L1_J12_UNPAIRED_NONISO,L1_J12_ABORTGAPNOTCALIB,L1_BCM_AC_UNPAIRED_ISO,L1_BCM_CA_UNPAIRED_ISO,L1_BCM_AC_UNPAIRED_NONISO,L1_BCM_CA_UNPAIRED_NONISO,L1_J30.31ETA49_UNPAIRED_NONISO,L1_BCM_AC_ABORTGAPNOTCALIB,L1_BCM_CA_ABORTGAPNOTCALIB,L1_BCM_Wide_ABORTGAPNOTCALIB,L1_BCM_AC_CALIB,L1_BCM_CA_CALIB,L1_BCM_Wide_CALIB,L1_J50_UNPAIRED_ISO,L1_J50_UNPAIRED_NONISO,L1_J50_ABORTGAPNOTCALIB'
     
+    if 'pp_v7' in TriggerFlags.triggerMenuSetup():
+        l1background_seeds += ',L1_BCM_AC_UNPAIREDB1,L1_BCM_CA_UNPAIREDB2,L1_J12_UNPAIREDB1,L1_J12_UNPAIREDB2'
+
     if TriggerFlags.triggerMenuSetup() == 'LS1_v1':
         l1background_seeds = 'L1_BCM_AC_CA_BGRP0,L1_BCM_AC_CA_UNPAIRED_ISO,L1_BCM_Wide_EMPTY,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_EM3_UNPAIRED_ISO,L1_FJ30_UNPAIRED_ISO,L1_J10_UNPAIRED_ISO,L1_J10_UNPAIRED_NONISO,L1_LUCID_A_C_EMPTY,L1_LUCID_A_C_UNPAIRED_ISO,L1_LUCID_A_C_UNPAIRED_NONISO,L1_LUCID_EMPTY,L1_LUCID_UNPAIRED_ISO,L1_MU4_UNPAIRED_ISO,L1_LUCID_COMM_UNPAIRED_ISO,L1_LUCID_COMM_EMPTY'
         
@@ -109,9 +112,18 @@ def getL1StandbySeed(l1items):
     #13 April 2017 (ATR-16122) removing SC, LHCF, and 3EM L1 triggers from L1_Standby (seeds HLT_noalg_L1Standby) to 
     #reduce the L1 seed length to below 4000 characters, such that String4k is not overloaded 
     #5 May 2017 also remove L1_X_Y_Z but only L1_X_Y_Z that have X_Y_Z all thresholds
-    exclude_list = ["L1_2MU4_J40_XE20","L1_2MU4_J40_XE50","L1_EM15VHI_2TAU12IM_4J12","L1_EM15VHI_2TAU12IM_J25_3J12","L1_EM15VHI_2TAU12IM_XE35","L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15","L1_EM15VHI_TAU40_2TAU15","L1_EM15VH_2EM8VH_MU6","L1_EM20VHI_TAU20IM_2TAU20_J25_3J20","L1_J40.0ETA25_2J25_J20.31ETA49","L1_MU10_2J15_J20","L1_MU10_TAU12IM_3J12","L1_MU10_TAU12IM_J25_2J12","L1_MU10_TAU12IM_XE35","L1_MU10_TAU20IM_J25_2J20","L1_MU4_J50_XE40","L1_MU6_J30.0ETA49_2J20.0ETA49","L1_TAU20IM_2J20_XE45","L1_TAU20IM_2TAU12IM_J25_2J20_3J12","L1_TAU20IM_2TAU12IM_XE35","L1_TAU20_2TAU12_XE35","L1_TAU25IM_2TAU20IM_2J25_3J20","L1_TAU40_2TAU12IM_XE40"]
-    standby_seeds    = ",".join([ x for x in l1items if "_EMPTY" not in x and "CALREQ" not in x and "ZB" not in x and "-" not in x and "CMU" not in x and "ALFA" not in x  and "RD" not in x and "BCM" not in x and "BGRP12" not in x and "FTK" not in x and "SC" not in x and "LHCF" not in x and "3EM" not in x and x not in exclude_list])
+    exclude_list = ["L1_2MU4_J40_XE50","L1_EM15VHI_2TAU12IM_4J12","L1_EM15VHI_2TAU12IM_J25_3J12","L1_EM15VHI_2TAU12IM_XE35","L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15","L1_EM15VHI_TAU40_2TAU15","L1_EM15VH_2EM8VH_MU6","L1_EM20VHI_TAU20IM_2TAU20_J25_3J20","L1_J40.0ETA25_2J25_J20.31ETA49","L1_MU10_2J15_J20","L1_MU10_TAU12IM_3J12","L1_MU10_TAU12IM_J25_2J12","L1_MU10_TAU12IM_XE35","L1_MU10_TAU20IM_J25_2J20","L1_MU4_J50_XE40","L1_MU6_J30.0ETA49_2J20.0ETA49","L1_TAU20IM_2J20_XE45","L1_TAU20IM_2TAU12IM_J25_2J20_3J12","L1_TAU20IM_2TAU12IM_XE35","L1_TAU25IM_2TAU20IM_2J25_3J20","L1_TAU40_2TAU12IM_XE40"]
+    standby_seeds    = ",".join([ x for x in l1items if "_EMPTY" not in x and "CALREQ" not in x and "ZB" not in x and "-" not in x and "CMU" not in x and "ALFA" not in x  and "RD" not in x and "BCM" not in x and "BGRP12" not in x and "FTK" not in x and "SC" not in x and "LHCF" not in x and "AFP" not in x and "3EM" not in x and x not in exclude_list])
     return standby_seeds
+
+##############################
+def getL1IDprescaledSeed(l1items):
+    standby_list = getL1StandbySeed(l1items)
+    additional_seeds = ",".join([x for x in l1items if "_EMPTY" in x or "RD" in x])
+    idps_seed =  standby_list + ", " + additional_seeds
+    print idps_seed
+    return idps_seed
+
 ##############################
 def getL1TopoSeed(l1items):
     l1topo_seeds = ",".join([ x for x in l1items if  "FTK" not in x and ("-" in x or "CMU" in x) ])
@@ -180,18 +192,15 @@ def getEBnoL1PSSeed(l1items, l1seedname):
     # All of these L1 items must be PS=1 for an EB campaign
     noL1PS_seeds = ''
     if ('L1_PhysicsLow' in l1seedname):
-      if '_v7' in TriggerFlags.triggerMenuSetup():
-         noL1PS_seeds = 'L1_MU6_3MU4,L1_EM15VHI_2TAU12IM_J25_3J12,L1_EM15VHI_2TAU12IM_XE35,L1_EM15VHI_TAU40_2TAU15,L1_EM15VH_MU10,L1_EM15VH_3EM7,L1_EM22VHI,L1_2EM8VH_MU10,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM_XE35,L1_MU10_TAU20IM,L1_4J15,L1_XE50,L1_2J15_XE55,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_TAU20IM_2TAU12IM_XE35,L1_TAU20IM_2J20_XE45,L1_MU20,L1_MU6_J30.0ETA49_2J20.0ETA49,L1_MU10_3J20,L1_J40.0ETA25_2J15.31ETA49,L1_3MU6,L1_MU10_2J15_J20,L1_J40.0ETA25_2J25_J20.31ETA49,L1_2MU6_3MU4,L1_MU11_2MU6'
-      else:
-         noL1PS_seeds = 'L1_MU6_3MU4,L1_EM15HI_2TAU12IM_J25_3J12,L1_EM15HI_2TAU12IM_XE35,L1_EM15HI_TAU40_2TAU15,L1_EM15VH_MU10,L1_EM15VH_3EM7,L1_EM22VHI,L1_2EM8VH_MU10,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM_XE35,L1_MU10_TAU20IM,L1_4J15,L1_XE50,L1_2J15_XE55,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_TAU20IM_2TAU12IM_XE35,L1_TAU20IM_2J20_XE45,L1_MU20,L1_MU6_J30.0ETA49_2J20.0ETA49,L1_MU10_3J20,L1_J40.0ETA25_2J15.31ETA49,L1_3MU6,L1_MU10_2J15_J20,L1_J40.0ETA25_2J25_J20.31ETA49,L1_2MU6_3MU4,L1_MU11_2MU6'
+      noL1PS_seeds = 'L1_2EM15VHI,L1_2EM20VH,L1_2EM8VH_MU10,L1_2J15_XE55,L1_2J50_XE40,L1_2MU10,L1_2MU4_J20_XE30_DPHI-J20s2XE30,L1_2MU4_J40_XE50,L1_2MU6_3MU4,L1_3J15.0ETA25_XE40,L1_3J35.0ETA23,L1_3J50,L1_3MU4,L1_4J15.0ETA25,L1_4J20,L1_4MU4,L1_4J20,L1_5J15.0ETA25,L1_DR-EM15TAU12I-J25,L1_EM15VHI_2TAU12IM_4J12,L1_DR-MU10TAU12I_TAU12I-J25,L1_DR-TAU20ITAU12I-J25,L1_EM15VHI_2TAU12IM_XE35,L1_EM15VHI_TAU40_2TAU15,L1_EM15VH_MU10,L1_EM18VHI_3J20,L1_EM18VHI_MJJ-300,L1_EM20VHI_TAU20IM_2TAU20_J25_3J20,L1_EM20VH_3EM10VH,L1_EM22VHI,L1_EM22VHIM,L1_EM24VHI,L1_EM7_MU20,L1_EM8VH_MU20,L1_HT150-J20s5.ETA31_MJJ-400-CF,L1_HT190-J15s5.ETA21,L1_J100,L1_J25.0ETA23_2J15.31ETA49,L1_J40.0ETA25_2J25_J20.31ETA49,L1_J40_XE50_DPHI-J20s2XE50,L1_J40_XE60,L1_J75.31ETA49,L1_J85_3J30,L1_LATE-MU10_J50,L1_LATE-MU10_XE40,L1_LATE-MU10_XE50,L1_LLP-NOMATCH,L1_LLP-RO,L1_MU10_2J15_J20,L1_MU10_2J20,L1_MU10_TAU12IM_3J12,L1_MU10_TAU12IM_XE35,L1_MU11_2MU6,L1_MU20,L1_MU20_J40,L1_MU20_XE30,L1_MU4_J30_XE40_DPHI-J20s2XE30,L1_MU4_XE60,L1_MU4_J50_XE50_DPHI-J20s2XE30,L1_MU6_3MU4,L1_MU6_J75,L1_TAU100,L1_TAU20IM_2TAU12IM_4J12,L1_TAU40_2TAU12IM_XE40,L1_TAU60_2TAU40,L1_TAU20IM_2J20_XE45,L1_TAU60_DR-TAU20ITAU12I,L1_XE55,L1_XE60'
     elif ('L1_PhysicsHigh' in l1seedname):
-      noL1PS_seeds = 'L1_XE80,L1_J100.31ETA49,L1_J400,L1_6J15'
+      noL1PS_seeds = 'L1_6J15,L1_J100.31ETA49,L1_J400,L1_XE80'
     elif ('L1_EMPTY' in l1seedname):
-      noL1PS_seeds = 'L1_J12_EMPTY,L1_MU11_EMPTY,L1_TAU8_EMPTY,L1_TAU30_EMPTY,L1_EM7_EMPTY'
+      noL1PS_seeds = 'L1_J12_EMPTY,L1_MU11_EMPTY,L1_TAU8_EMPTY,L1_EM7_EMPTY'
     elif ('L1_FIRSTEMPTY' in l1seedname):
       noL1PS_seeds = 'L1_J12_FIRSTEMPTY,L1_MU20_FIRSTEMPTY,L1_TAU8_FIRSTEMPTY,L1_EM7_FIRSTEMPTY'
     elif ('L1_UNPAIRED_ISO' in l1seedname):
-      noL1PS_seeds = 'L1_J12_UNPAIRED_ISO,L1_J15.31ETA49_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_AC_UNPAIRED_ISO,L1_BCM_CA_UNPAIRED_ISO,L1_MU4_UNPAIRED_ISO,L1_EM7_UNPAIRED_ISO,L1_TAU8_UNPAIRED_ISO,L1_TAU30_UNPAIRED_ISO'
+      noL1PS_seeds = 'L1_J12_UNPAIRED_ISO,L1_J15.31ETA49_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_AC_UNPAIRED_ISO,L1_BCM_CA_UNPAIRED_ISO,L1_MU4_UNPAIRED_ISO,L1_EM7_UNPAIRED_ISO,L1_TAU8_UNPAIRED_ISO'
     elif ('L1_UNPAIRED_NONISO' in l1seedname):
       noL1PS_seeds = 'L1_J12_UNPAIRED_NONISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_BCM_AC_UNPAIRED_NONISO,L1_BCM_CA_UNPAIRED_NONISO'
     elif ('L1_ABORTGAPNOTCALIB' in l1seedname): 
@@ -296,9 +305,9 @@ def getL1ALFA_ELAS(l1seed):
 def getL1LowLumi(l1seed):
 
     if '_v7' in TriggerFlags.triggerMenuSetup():
-       L1LowLumi_seeds = 'L1_EM20VH,L1_2EM10VH,L1_MU21,L1_2MU6,L1_3MU4,L1_EM15VH_MU10,L1_EM15I_MU4,L1_EM7_MU10,L1_2EM8VH_MU10,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_EM15VHI_2TAU12IM_XE35,L1_MU10_TAU12IM_XE35,L1_TAU20_2TAU12_XE35,L1_TAU20IM_2TAU12IM_XE35,L1_EM15VHI_2TAU12IM,L1_EM15VHI_2TAU12IM_J25_3J12,L1_EM15VHI_TAU40_2TAU15,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM,L1_J75,L1_4J15,L1_XE50,L1_3J25.0ETA23,L1_3J40,L1_2J15_XE55,L1_MU6_J40,L1_J75.31ETA49'
+       L1LowLumi_seeds = 'L1_EM20VH,L1_2EM10VH,L1_MU21,L1_2MU6,L1_3MU4,L1_EM15VH_MU10,L1_EM15I_MU4,L1_EM7_MU10,L1_2EM8VH_MU10,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_EM15VHI_2TAU12IM_XE35,L1_MU10_TAU12IM_XE35,L1_TAU20IM_2TAU12IM_XE35,L1_EM15VHI_2TAU12IM,L1_EM15VHI_2TAU12IM_J25_3J12,L1_EM15VHI_TAU40_2TAU15,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM,L1_J75,L1_4J15,L1_XE50,L1_3J25.0ETA23,L1_3J40,L1_2J15_XE55,L1_MU6_J40,L1_J75.31ETA49'
     else:
-       L1LowLumi_seeds = 'L1_EM20VH,L1_2EM10VH,L1_MU15,L1_2MU6,L1_3MU4,L1_EM15VH_MU10,L1_EM15I_MU4,L1_EM7_MU10,L1_2EM8VH_MU10,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_EM15HI_2TAU12IM_XE35,L1_MU10_TAU12IM_XE35,L1_TAU20_2TAU12_XE35,L1_TAU20IM_2TAU12IM_XE35,L1_EM15HI_2TAU12IM,L1_EM15HI_2TAU12IM_J25_3J12,L1_EM15HI_TAU40_2TAU15,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM,L1_J75,L1_4J15,L1_XE50,L1_3J25.0ETA23,L1_3J40,L1_2J15_XE55,L1_MU6_J40,L1_J75.31ETA49'
+       L1LowLumi_seeds = 'L1_EM20VH,L1_2EM10VH,L1_MU15,L1_2MU6,L1_3MU4,L1_EM15VH_MU10,L1_EM15I_MU4,L1_EM7_MU10,L1_2EM8VH_MU10,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_EM15HI_2TAU12IM_XE35,L1_MU10_TAU12IM_XE35,L1_TAU20IM_2TAU12IM_XE35,L1_EM15HI_2TAU12IM,L1_EM15HI_2TAU12IM_J25_3J12,L1_EM15HI_TAU40_2TAU15,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM,L1_J75,L1_4J15,L1_XE50,L1_3J25.0ETA23,L1_3J40,L1_2J15_XE55,L1_MU6_J40,L1_J75.31ETA49'
 
 
     # check if all the l1 background seeds given are in the current L1 menu
@@ -314,7 +323,7 @@ def getL1LowLumi(l1seed):
 #####################################
 def getSpecificL1Seeds(l1seedname, l1itemobject):
     l1items = [i.name for i in l1itemobject]
-    l1ctpid = [i.ctpid for i in l1itemobject]
+    #l1ctpid = [i.ctpid for i in l1itemobject]
     L1Seed = ''
     if l1seedname == 'L1_J':
         L1Seed = getL1JetBS()
@@ -333,6 +342,9 @@ def getSpecificL1Seeds(l1seedname, l1itemobject):
     elif (l1seedname == 'L1_Standby'):
         L1Seed = getL1StandbySeed(l1items)
 
+    elif (l1seedname == 'L1_IDprescaled'):
+        L1Seed = getL1IDprescaledSeed(l1items)
+
     elif (l1seedname == 'L1_Topo'):
         L1Seed = getL1TopoSeed(l1items)
 
@@ -407,7 +419,7 @@ def getSpecificL1Seeds(l1seedname, l1itemobject):
         log.warning('No L1item name given!')
 
     else: 
-        #log.error('Given seed %s could not be found!' %l1seedname)
+        log.error('Given seed %s could not be found!' %str(l1seedname))
         return 'ERROR_'+l1seedname
 
     L1Seed = L1Seed.split(",")
@@ -426,7 +438,7 @@ def getInputTEfromL1Item(l1item):
         'L1_TAU8_FIRSTEMPTY': ['HA8'],
         'L1_TAU8_UNPAIRED_ISO': ['HA8'],
         'L1_TAU8_UNPAIRED_NONISO': ['HA8'],
-	'L1_TAU12_EMPTY':      ['HA12'],
+        'L1_TAU12_EMPTY':      ['HA12'],
         'L1_TAU12_FIRSTEMPTY': ['HA12'],
         'L1_TAU12_UNPAIRED_ISO': ['HA12'],
         'L1_RD0_FIRSTEMPTY':  [''],
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/LS1_v1.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/LS1_v1.py
index 25656320efc2b4f7d9491f316721a2859f926d81..900926d67f49c933279c8065879d180a17ad7235 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/LS1_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/LS1_v1.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
 
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.LS1_v1.py' )
@@ -161,8 +160,6 @@ def setupMenu():
         ]
     
 
-    allL1TAUseeds = ",".join([ x for x in tcl1.current.menu.items.itemNames() if "TAU" in x ])
-
     TriggerFlags.CalibSlice.signatures   = [
         ['l1calocalib',              'L1_RD0_FILLED',     [], ['L1CaloCalib'], ["RATE:Calibration", "RATE:L1CaloCalib", "BW:Detector"], -1],
         ['l1calocalib_L1BGRP7',      'L1_BGRP7',          [], ['L1CaloCalib'], ["RATE:Calibration", "RATE:L1CaloCalib", "BW:Detector"], -1], 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py
index de92d33a1631993073d61265ed3933a76376bda9..f626551465375b6e479acb1fe98dc12e5e6053f1 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Lumi.py
@@ -32,6 +32,9 @@ def lumi(triggerPythonConfig):
         elif 'tight' in menu_name:
             L1Prescales = Prescales.L1Prescales_tight_physics_prescale
             HLTPrescales = Prescales.HLTPrescales_tight_physics_prescale
+        elif 'unprescaled_only' in menu_name:
+            L1Prescales = Prescales.L1Prescales_unprescaled_only_physics_prescale
+            HLTPrescales = Prescales.HLTPrescales_unprescaled_only_physics_prescale
         else:
             L1Prescales = Prescales.L1Prescales
             HLTPrescales = Prescales.HLTPrescales
@@ -162,6 +165,20 @@ def lumi(triggerPythonConfig):
         else:
             L1Prescales = Prescales.L1Prescales
             HLTPrescales = Prescales.HLTPrescales        
+
+    elif menu_name.startswith('MC_PhaseII') :
+        log.info('In MC_PhaseII menu setup')
+        from TriggerMenu.menu.MC_PhaseII import setupMenu, Prescales
+        setupMenu()
+        if 'cosmics_prescale' in menu_name:
+            L1Prescales = Prescales.L1Prescales_cosmics
+            HLTPrescales = Prescales.HLTPrescales_cosmics
+        elif 'tight' in menu_name:
+            L1Prescales = Prescales.L1Prescales_tight_physics_prescale
+            HLTPrescales = Prescales.HLTPrescales_tight_physics_prescale
+        else:
+            L1Prescales = Prescales.L1Prescales
+            HLTPrescales = Prescales.HLTPrescales
             
     else:
         log.fatal ('Menu with name %s is not known in this version of TriggerMenu! ', menu_name)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v3.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v3.py
index d28540d5409a6e72fa9cf9508744062922e9d228..2729ed37320eef8750c46b0a02e39046fcaef83c 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v3.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v3.py
@@ -16,7 +16,6 @@ log = logging.getLogger( 'MC_HI_v3.py' )
 def setupMenu():
 
     physics_menu.setupMenu()
-    PhysicsStream="Main"
 
 
     # ---------------------------------------------------------------------------------------
@@ -26,7 +25,10 @@ def setupMenu():
 
     TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
         ]
-    
+
+    TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
+	]
+
     TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
         ]
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v4.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v4.py
index 68174004cf7342fd97e914440786bc310b7fc17b..3002fd8ee8e28ac7eafa1530cd605cc8c8935321 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v4.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_HI_v4.py
@@ -16,7 +16,6 @@ log = logging.getLogger( 'MC_HI_v4.py' )
 def setupMenu():
 
     physics_menu.setupMenu()
-    PhysicsStream="Main"
 
 
     # ---------------------------------------------------------------------------------------
@@ -26,7 +25,10 @@ def setupMenu():
 
     TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
         ]
-    
+
+    TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
+	]
+
     TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
         ]
     
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_PhaseII.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_PhaseII.py
new file mode 100644
index 0000000000000000000000000000000000000000..40eb90866f90862ad7b38cd15d31e259216d62e6
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_PhaseII.py
@@ -0,0 +1,620 @@
+315
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#------------------------------------------------------------------------#
+#
+# MC_PhaseII menu to be used for studies for PhaseII TDR
+# Contacts: Catrin Bernius, Anna Sfyrla, Sarah Demers, Tim Martin
+# Date: May 2017
+#------------------------------------------------------------------------#
+def setupMenu():
+
+    from TriggerJobOpts.TriggerFlags          import TriggerFlags
+    from AthenaCommon.Logging                 import logging
+    log = logging.getLogger( 'TriggerMenu.menu.MC_PhaseII.py' )
+
+    from TriggerMenu.TriggerConfigLVL1 import TriggerConfigLVL1 as tcl1
+    if tcl1.current:
+        log.info("L1 items: %s " % tcl1.current.menu.items.itemNames())
+    else:
+        log.warning("L1 menu has not yet been defined")
+
+    PhysicsStream="Main"
+
+    #---------------------------------------------------------------------
+    # INPUT FORMAT FOR CHAINS:
+    # ['chainName',  'L1itemforchain', [L1 items for chainParts], [stream], [groups], EBstep], OPTIONAL: [mergingStrategy, offset,[merginOrder] ]], topoStartsFrom = False
+    #---------------------------------------------------------------------
+
+    TriggerFlags.Slices_all_setOff()
+
+    TriggerFlags.TestSlice.signatures = []
+    TriggerFlags.MuonSlice.signatures = [
+        # Current primaries (2017 menu)
+        ['mu26_ivarmedium',	     'L1_MU21', 	  [], [PhysicsStream], ['RATE:SingleMuon','BW:Muon'], -1],
+        ['mu60',  'L1_MU21',                              [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_mu8noL1',           'L1_MU21',             ['L1_MU21',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1']]],
+        ['mu24_2mu4noL1',          'L1_MU21',             ['L1_MU21',''], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1,['serial',-1,['mu24','2mu4noL1']]],
+        ['2mu14',                  'L1_2MU10',            [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['2mu14_nomucomb',         'L1_2MU10',            [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+
+        #upgrade study chains
+        ['mu18_ivarmedium',	   'L1_MU6', 	  [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_ivarmedium',	   'L1_MU6', 	  [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu40_L1MU6',			  'L1_MU6',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        ['mu20_mu8noL1',          'L1_MU6', ['L1_MU6',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','mu8noL1']]],
+        ['mu20_2mu4noL1',        'L1_MU6', ['L1_MU6',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu4noL1']]],
+
+        ['2mu11_L1MU6',                         'L1_MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['2mu10_L1MU6',                         'L1_MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+
+        ]
+
+    TriggerFlags.JetSlice.signatures = [   
+        # Current primaries (2017 menu)
+        ['j175',                        'L1_J50',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        ['j400',                    			    'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420',                    			    'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['4j65',                        'L1_3J15', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+
+        ['4j110',                  			    'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['2j250_j150',         		             'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j200',                    			    'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240',                		    'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240_L14J15',       	    'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j70_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet' , 'BW:Jet'], -1],
+        ['6j70',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['6j50_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+
+        ['ht1000_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:MultiJet','BW:Jet'], -1],
+
+        
+        #upgrade study chains
+        ['j100_L1J12',                        'L1_J12',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j110_L1J12',                        'L1_J12',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j120_L1J12',                        'L1_J12',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j175_L1J12',                        'L1_J12',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        ['j300_L1J12',                    			    'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j380_L1J12',                    			    'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j400_L1J12',                    			    'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_L1J12',                    			    'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_L1J12',        	  		    'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j250_j150_L1J12',         		                    'L1_J12', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j200_L1J12',                    		            'L1_J12', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+
+        ['4j55_L1J12',                        'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['4j65_L1J12',                        'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['4j110_L1J12',                  		    'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['5j90_L1J12',                		            'L1_J12', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        
+        ['j400_L1RD0_FILLED',                    			    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_L1RD0_FILLED',                    			    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_L1RD0_FILLED',        	    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j250_j150_L1RD0_FILLED',         		             'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j200_L1RD0_FILLED',                    		    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j110_L1RD0_FILLED',                  		    'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['5j90_L1RD0_FILLED',                		            'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],       
+
+        ['ht1000_L1J12',   'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht500_L1J12',   'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht450_L1J12',   'L1_J12', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+
+        # Standard topocluster large-R jet triggers
+        ['j300_a10_lcw_subjes_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j370_a10_lcw_subjes_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        # Standard topocluster large-R jet triggers + mass cut 
+        ['j375_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j350_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j300_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j275_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j250_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j200_a10t_lcw_jes_30smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        ['j375_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j350_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j300_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j275_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j250_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j200_a10t_lcw_jes_35smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        ['j375_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j350_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j300_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j275_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j250_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j200_a10t_lcw_jes_40smcINF_L1J12',       'L1_J12', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+
+        ]
+
+    TriggerFlags.BjetSlice.signatures = [
+        # Current primaries (2017 menu)
+        ['j225_bmv2c2040_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_gsc225_bmv2c2040_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c2060_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['3j50_gsc65_bmv2c2070_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2060_split_j45_gsc60_bmv2c2060_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c2060_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c2040_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',   'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c2040_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        #['j60_gsc85_bmv2c2050_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        
+        #upgrade study chains
+        # single b-jets with gsc
+        ['j110_gsc150_bmv2c2040_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_bmv2c2077_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        ['j150_gsc175_bmv2c2040_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2077_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        ['j175_gsc225_bmv2c2040_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_gsc225_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_gsc225_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_gsc225_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        ['j225_gsc275_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c2077_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+
+        # single b-jets no gsc
+        ['j175_bmv2c2040_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j175_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        ['j225_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_bmv2c2070_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_bmv2c2077_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j225_bmv2c2085_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        # 1 b-jet + 3 jets
+        ['j25_gsc45_bmv2c1040_split_3j25_gsc45_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j25_gsc45_bmv2c1060_split_3j25_gsc45_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j25_gsc45_bmv2c1070_split_3j25_gsc45_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j25_gsc45_bmv2c1077_split_3j25_gsc45_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j25_gsc45_bmv2c1085_split_3j25_gsc45_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['j35_gsc55_bmv2c1040_split_3j35_gsc55_boffperf_split_L1J12',  'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j35_gsc55_bmv2c1060_split_3j35_gsc55_boffperf_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j35_gsc55_bmv2c1070_split_3j35_gsc55_boffperf_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j35_gsc55_bmv2c1077_split_3j35_gsc55_boffperf_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j35_gsc55_bmv2c1085_split_3j35_gsc55_boffperf_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['j50_gsc65_bmv2c1040_split_3j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1060_split_3j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1070_split_3j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1077_split_3j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1085_split_3j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['j55_gsc75_bmv2c1040_split_3j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1060_split_3j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1070_split_3j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1077_split_3j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1085_split_3j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['j65_gsc85_bmv2c1040_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_gsc85_bmv2c1050_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_gsc85_bmv2c1060_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_gsc85_bmv2c1070_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_gsc85_bmv2c1077_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_gsc85_bmv2c1085_split_3j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['j65_bmv2c1040_split_3j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_bmv2c1050_split_3j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_bmv2c1060_split_3j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j65_bmv2c1070_split_3j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j65_bmv2c1040_split_2j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_bmv2c1050_split_2j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_bmv2c1060_split_2j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_bmv2c1070_split_2j65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        # 2 b-jets + 2 jets
+        ['2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1060_split_2j15_gsc35_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1070_split_2j15_gsc35_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1077_split_2j15_gsc35_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1085_split_2j15_gsc35_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j25_gsc45_bmv2c1040_split_2j25_gsc45_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1060_split_2j25_gsc45_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1070_split_2j25_gsc45_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1077_split_2j25_gsc45_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1085_split_2j25_gsc45_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j25_gsc50_bmv2c1060_split_2j25_gsc50_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j35_gsc55_bmv2c1040_split_2j35_gsc55_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1060_split_2j35_gsc55_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1070_split_2j35_gsc55_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1077_split_2j35_gsc55_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1085_split_2j35_gsc55_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j50_gsc65_bmv2c1040_split_2j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j50_gsc65_bmv2c1060_split_2j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j50_gsc65_bmv2c1070_split_2j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j50_gsc65_bmv2c1077_split_2j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j50_gsc65_bmv2c1085_split_2j50_gsc65_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j55_gsc75_bmv2c1040_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1050_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1060_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1070_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1077_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j55_gsc75_bmv2c1085_split_2j55_gsc75_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['2j65_gsc85_bmv2c1040_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_gsc85_bmv2c1050_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_gsc85_bmv2c1060_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_gsc85_bmv2c1070_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_gsc85_bmv2c1077_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['2j65_gsc85_bmv2c1085_split_2j65_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+
+        #forward jets
+        ['j85_320eta490', 'L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j60_320eta490', 'L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j110_320eta490','L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet','BW:Jet'], -1],
+        ['j175_320eta490','L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet','BW:Jet'], -1],
+        ['j60_320eta490_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j85_320eta490_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j110_320eta490_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j175_320eta490_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+
+        
+
+        # other chains
+        ['j225_bmv2c2040_split_L1J12',        'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['3j50_gsc65_bmv2c2070_split_L13J15', 'L1_3J15', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c2060_split_j45_gsc60_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c2060_split_L14J15', 'L1_4J15', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c2040_split_3j50_gsc65_boffperf_split_L14J15',      'L1_4J15', [], [PhysicsStream], ['RATE:SingleBJet',   'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c2040_split_3j55_gsc75_boffperf_split_L14J15',       'L1_4J15',        [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        #['j60_gsc85_bmv2c2050_split_3j60_gsc85_boffperf_split_L14J15',       'L1_4J15',        [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c2060_split_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c2040_split_3j50_gsc65_boffperf_split_L1J12',      'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet',   'BW:BJet'], -1],
+        #['j60_gsc85_bmv2c2050_split_3j60_gsc85_boffperf_split_L1J12',       'L1_J12',        [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        
+        ]
+    
+    TriggerFlags.METSlice.signatures = [
+        
+        # Current primaries (2017 menu)
+        ['xe110_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_pufit_L1XE55',                'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_pufit_L1XE60',                 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_mht_xe70_L1XE55','L1_XE55',  ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe70_L1XE55'] ]],
+        ['xe120_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE50'] ]],
+        
+        #upgrade study chains
+        ['xe110_L1XE35',                      'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_pufit_L1XE35',                'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_mht_L1XE35_xe70_L1XE35','L1_XE35',  ['L1_XE35','L1_XE35'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht_L1XE35','xe70_L1XE35'] ]],
+
+        ['xe110_L1XE10',                      'L1_XE10',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_pufit_L1XE10',                'L1_XE10',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_mht_L1XE10_xe70_L1XE10','L1_XE10',  ['L1_XE10','L1_XE10'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht_L1XE10','xe70_L1XE10'] ]],
+
+	['xe120_trkmht_L1XE10_xe80_mht_L1XE10','L1_XE10', ['L1_XE10','L1_XE10'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht_L1XE10','xe80_mht_L1XE10'] ]],
+	['xe120_trkmht_xe80_mht_L1XE35','L1_XE35', ['L1_XE35','L1_XE35'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ]
+    
+    TriggerFlags.TauSlice.signatures = [
+        # Current primaries (2017 menu)
+        ['tau160_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40',   'L1_TAU60_2TAU40',['L1_TAU60','L1_TAU40'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau60_medium1_tracktwo_L1TAU40"]]]       ,
+        
+        #upgrade study chains
+        ['tau115_medium1_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau125_medium1_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_medium1_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12',   'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12"]]],
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12',   'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12"]]]       ,
+        ['tau40_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12',   'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau40_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12"]]]       ,
+
+	['tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+	['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_03dR30',   'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12"]]],
+        
+        ]
+    
+    TriggerFlags.EgammaSlice.signatures = [
+        # Current primaries (2017 menu)
+        ['e28_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream,'express'], ['RATE:SingleElectron','BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1] ,
+        ['e60_medium_L1EM24VHI',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron',  'BW:Egamma'],-1], 
+        ['e140_lhloose_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron',  'BW:Egamma'],-1],
+        ['2e24_lhvloose_nod0',                   'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        
+        ['g140_tight',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g200_loose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['2g25_tight_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['2g50_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1], 
+        ['g35_medium_g25_medium_L12EM20VH',          'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        
+        #upgrade study chains
+        # Electrons
+        ['e20_lhmedium_nod0_ivarloose_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'],-1],
+        ['e20_lhtight_nod0_ivarloose_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'],-1],
+
+        ['e22_lhtight_nod0_ivarloose_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'],-1],
+        ['e45_lhmedium_nod0_L1EM15VHI', 			'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e45_medium_L1EM15VHI',               	 	'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e60_lhloose_nod0_L1EM15VHI', 			'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e20_lhtight_nod0_ringer_ivarloose_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'],-1],
+        ['e22_lhtight_nod0_ringer_ivarloose_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'],-1],
+
+
+        ['2e10_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e11_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e12_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e13_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e14_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e15_lhvloose_nod0_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        
+        ['2e10_lhvloose_nod0_ringer_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e12_lhvloose_nod0_ringer_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e15_lhvloose_nod0_ringer_L12EM10VH',                 'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+
+        # Photons
+        ['g100_loose_L1EM15VHI',        				'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g100_medium_L1EM15VHI',        				'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g120_tight_L1EM15VHI',        				'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g120_loose_L1EM15VHI',        			'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g180_loose_L1EM15VHI',        			'L1_EM15VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+
+        ['g25_loose_g20_loose_L12EM10VH',       'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['g25_medium_g20_medium_L12EM10VH',       'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['g25_tight_g20_tight_L12EM10VH',       'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+
+        ['g35_medium_g25_medium_L12EM10VH',       'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+
+        ['2g25_loose_L12EM10VH',       				'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['2g25_medium_L12EM10VH',       			'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['2g25_tight_L12EM10VH',       				'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+
+        ['2g20_loose_L12EM10VH',       				'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['2g20_medium_L12EM10VH',       			'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ['2g20_tight_L12EM10VH',       				'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+
+        ['2g50_loose_L12EM10VH',       			'L1_2EM10VH', [], [PhysicsStream], ['RATE:MultiPhoton',  'BW:Egamma'],-1],
+        ]
+
+    TriggerFlags.BphysicsSlice.signatures = [
+            ]
+
+
+    TriggerFlags.CombinedSlice.signatures = [
+        # Current primaries (2017 menu)
+        ['j60_gsc100_bmv2c2050_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c2050_split','xe80_mht_L1XE60']]],
+        ['2j45_bmv2c2070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:MET'], -1,['serial',-1,['2j45_bmv2c2070_split','xe80_mht']]],
+        ['2j25_gsc45_bmv2c2070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:MET'], -1,['serial',-1,['2j25_gsc45_bmv2c2070_split','xe80_mht']]],
+        ['3j35_bmv2c2077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:MET'], -1, ['serial',-1,['3j35_bmv2c2077_split','xe60_mht']]],
+        ['3j15_gsc35_bmv2c2077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:MET'], -1, ['serial',-1,['3j15_gsc35_bmv2c2077_split','xe60_mht']]],
+        ['j100_xe80',                    'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET',  'BW:Jet', 'BW:MET'], -1,['serial',-1,["j100","xe80"]]],
+        ['j100_xe80_mht',                    'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET',  'BW:Jet', 'BW:MET'], -1,['serial',-1,["j100","xe80_mht"]]],
+        ['j80_bmv2c2050_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet'], -1,['serial',-1,["j80_bmv2c2050_split","xe60"]]],
+        
+
+        #upgrade study chains
+        #bjet + met
+        ['j15_gsc25_bmv2c1040_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1040_split', 'xe100_L1XE35']]],
+        ['j15_gsc25_bmv2c1060_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1060_split', 'xe100_L1XE35']]],
+        ['j15_gsc25_bmv2c1070_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1070_split', 'xe100_L1XE35']]],
+        ['j15_gsc25_bmv2c1077_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1077_split', 'xe100_L1XE35']]],
+        ['j15_gsc25_bmv2c1085_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1085_split', 'xe100_L1XE35']]],
+
+        ['j25_gsc45_bmv2c1040_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1040_split', 'xe100_L1XE35']]],
+        ['j25_gsc45_bmv2c1060_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1060_split', 'xe100_L1XE35']]],
+        ['j25_gsc45_bmv2c1070_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1070_split', 'xe100_L1XE35']]],
+        ['j25_gsc45_bmv2c1077_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1077_split', 'xe100_L1XE35']]],
+        ['j25_gsc45_bmv2c1085_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1085_split', 'xe100_L1XE35']]],
+
+        ['j35_gsc55_bmv2c1040_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1040_split', 'xe100_L1XE35']]],
+        ['j35_gsc55_bmv2c1060_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1060_split', 'xe100_L1XE35']]],
+        ['j35_gsc55_bmv2c1070_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1070_split', 'xe100_L1XE35']]],
+        ['j35_gsc55_bmv2c1077_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1077_split', 'xe100_L1XE35']]],
+        ['j35_gsc55_bmv2c1085_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1085_split', 'xe100_L1XE35']]],
+
+
+        ['j35_gsc55_bmv2c1070_split_xe110_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1070_split', 'xe110_L1XE35']]],
+        ['j35_gsc55_bmv2c1070_split_xe120_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1070_split', 'xe120_L1XE35']]],
+
+        ['j55_gsc75_bmv2c1070_split_xe100_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j55_gsc75_bmv2c1070_split', 'xe100_L1XE35']]],
+        ['j55_gsc75_bmv2c1070_split_xe110_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j55_gsc75_bmv2c1070_split', 'xe110_L1XE35']]],
+        ['j55_gsc75_bmv2c1070_split_xe120_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j55_gsc75_bmv2c1070_split', 'xe120_L1XE35']]],
+        ['j60_gsc100_bmv2c2050_split_xe80_mht_L1XE35','L1_XE35',[],  [PhysicsStream], ['RATE:BJetMET',  'BW:BJet', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c2050_split','xe80_mht_L1XE35']]],
+        ['j80_bmv2c2050_split_xe60_L1XE35', 'L1_XE35',          [],  [PhysicsStream], ['RATE:BJetMET', 'BW:MET', 'BW:BJet'], -1,['serial',-1,["j80_bmv2c2050_split","xe60_L1XE35"]]],
+
+
+        # b-jet + trkmht
+        ['j15_gsc25_bmv2c1040_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1040_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j15_gsc25_bmv2c1060_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1060_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j15_gsc25_bmv2c1070_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1070_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j15_gsc25_bmv2c1077_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1077_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j15_gsc25_bmv2c1085_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j15_gsc25_bmv2c1085_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+
+        ['j25_gsc45_bmv2c1040_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1040_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j25_gsc45_bmv2c1060_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1060_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j25_gsc45_bmv2c1070_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1070_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j25_gsc45_bmv2c1077_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1077_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j25_gsc45_bmv2c1085_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j25_gsc45_bmv2c1085_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+
+        ['j35_gsc55_bmv2c1040_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1040_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j35_gsc55_bmv2c1060_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1060_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j35_gsc55_bmv2c1070_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1070_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j35_gsc55_bmv2c1077_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1077_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+        ['j35_gsc55_bmv2c1085_split_xe120_trkmht_xe80_mht_L1XE35', 'L1_XE35',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['j35_gsc55_bmv2c1085_split', 'xe120_trkmht','xe80_mht_L1XE35'] ]],
+
+
+        #bjet+ht
+        ['j35_gsc55_bmv2c1040_split_ht500_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500_L1J12','j35_gsc55_bmv2c1040_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht500_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500_L1J12','j35_gsc55_bmv2c1060_split']]],
+        ['j35_gsc55_bmv2c1070_split_ht500_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500_L1J12','j35_gsc55_bmv2c1070_split']]],
+        ['j35_gsc55_bmv2c1077_split_ht500_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500_L1J12','j35_gsc55_bmv2c1077_split']]],
+        ['j35_gsc55_bmv2c1085_split_ht500_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500_L1J12','j35_gsc55_bmv2c1085_split']]],
+
+        ['j35_gsc55_bmv2c1040_split_ht450_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht450_L1J12','j35_gsc55_bmv2c1040_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht450_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht450_L1J12','j35_gsc55_bmv2c1060_split']]],
+        ['j35_gsc55_bmv2c1070_split_ht450_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht450_L1J12','j35_gsc55_bmv2c1070_split']]],
+        ['j35_gsc55_bmv2c1077_split_ht450_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht450_L1J12','j35_gsc55_bmv2c1077_split']]],
+        ['j35_gsc55_bmv2c1085_split_ht450_L1J12', 'L1_J12',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht450_L1J12','j35_gsc55_bmv2c1085_split']]],
+
+        ['j55_gsc75_bmv2c1040_split_ht500_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L1J12','j55_gsc75_bmv2c1040_split']]],
+        ['j55_gsc75_bmv2c1070_split_ht500_L1J12', 'L1_J12', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L1J12','j55_gsc75_bmv2c1070_split']]],
+
+        #jet+met
+        ['j80_xe80_L1XE35',                    'L1_XE35',   ['',''], [PhysicsStream], ['RATE:JetMET',  'BW:Jet', 'BW:MET'], -1,['serial',-1,["j80","xe80_L1XE35"]]],
+        ['j135_xe110_mht_L1XE35',                'L1_XE35',['',''], [PhysicsStream], ['RATE:JetMET',  'BW:Jet', 'BW:MET'], -1,['serial',-1,["j135","xe110_mht_L1XE35"]]],
+        ['j135_xe120_mht_L1XE35',                'L1_XE35',['',''], [PhysicsStream], ['RATE:JetMET',  'BW:Jet', 'BW:MET'], -1,['serial',-1,["j135","xe120_mht_L1XE35"]]],
+        
+        # e+mu
+        ['e17_lhloose_nod0_mu14',   'L1_EM15VH_MU10', ['L1_EM15VH', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon',   'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e17_lhloose_nod0_mu14_L1MU6',   'L1_MU6', ['L1_EM15VH', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon',   'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e12_lhmedium_nod0_2mu10', 'L1_MU6', ['L1_EM8VH', 'L1_MU6'], [PhysicsStream], ['RATE:EgammaMuon',  'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e22_lhmedium_nod0_L1EM15VHI_mu8noL1', 'L1_EM15VHI', ['L1_EM15VHI', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e22_lhmedium_nod0_L1EM15VHI','mu8noL1'] ]],
+        ['e7_lhmedium_nod0_mu24',        'L1_MU6', ['L1_EM3', 'L1_MU6'], [PhysicsStream], ['RATE:EgammaMuon',  'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['2e12_lhloose_nod0_mu10',  'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU6'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+
+        #tau+jet
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j25noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j25noL1"]]]       ,
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j35noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j35noL1"]]]       ,
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j55noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j55noL1"]]]       ,
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j100noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j100noL1"]]]       ,
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j125noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j125noL1"]]]       ,
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_j150noL1', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j150noL1"]]]       ,
+
+        ['tau20_medium1_tracktwo_L1TAU20_tau29_medium1_tracktwo_L1TAU12_', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', ''], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau20_medium1_tracktwo_L1TAU20","tau29_medium1_tracktwo_L1TAU12", "j25noL1"]]]       ,
+
+
+        ['tau115_medium1_tracktwo_L1TAU12_j35noL1',      'L1_TAU12', ['L1_TAU12', ''], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1, ['serial',-1,["tau115_medium1_tracktwo_L1TAU12", "j35noL1"]]],
+        ['tau115_medium1_tracktwo_L1TAU12_j55noL1',      'L1_TAU12', ['L1_TAU12', ''], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1, ['serial',-1,["tau115_medium1_tracktwo_L1TAU12", "j55noL1"]]],
+        ['tau115_medium1_tracktwo_L1TAU12_j80noL1',      'L1_TAU12', ['L1_TAU12', ''], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1, ['serial',-1,["tau115_medium1_tracktwo_L1TAU12", "j80noL1"]]],
+
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_j15_gsc35_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "j15_gsc35_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_j25_gsc45_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "j25_gsc45_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_j35_gsc55_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "j35_gsc55_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_j50_gsc65_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "j50_gsc65_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_j55_gsc75_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "j55_gsc75_boffperf_split_L1J12"]]],      
+
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_2j15_gsc35_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "2j15_gsc35_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_2j25_gsc45_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "2j25_gsc45_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_2j35_gsc55_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "2j35_gsc55_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_2j50_gsc65_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "2j50_gsc65_boffperf_split_L1J12"]]],      
+        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_2j55_gsc75_boffperf_split_L1J12', 'L1_TAU20_2TAU12',['L1_TAU20','L1_TAU12', 'L1_J12'], [PhysicsStream], ['RATE:MultiTau',  'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12", "2j55_gsc75_boffperf_split_L1J12"]]],      
+
+
+
+        ]
+
+    TriggerFlags.HeavyIonSlice.signatures = [
+        ]
+
+    TriggerFlags.BeamspotSlice.signatures = [
+        ]
+
+    TriggerFlags.AFPSlice.signatures = [
+        ]
+
+    TriggerFlags.MinBiasSlice.signatures = [
+        ]
+        
+    TriggerFlags.CalibSlice.signatures   = [
+        ]
+
+    TriggerFlags.CosmicSlice.signatures  = [ 
+        ]
+
+    TriggerFlags.StreamingSlice.signatures = [
+        ]
+
+    TriggerFlags.MonitorSlice.signatures = [
+        ['costmonitor', '', [], ['CostMonitoring'], ['RATE:Monitoring','BW:Other'],1],
+        ]
+
+    TriggerFlags.EnhancedBiasSlice.signatures = [
+        ]
+
+    ###############################################################
+    #################################################################
+    signatureList=[]
+    for prop in dir(TriggerFlags):
+        if prop[-5:]=='Slice':
+            sliceName=prop
+            slice=getattr(TriggerFlags,sliceName)
+            if slice.signatures():
+                signatureList.extend(slice.signatures())
+            else:
+                log.debug('SKIPPING '+str(sliceName))
+    mySigList=[]
+    for allInfo in signatureList:
+        mySigList.append(allInfo[0])
+    mydict={}
+    for chain in mySigList:
+        mydict[chain]=[-1,0,0]
+    mydict.update(Prescales.HLTPrescales_cosmics)
+    from copy import deepcopy
+    Prescales.HLTPrescales_cosmics = deepcopy(mydict)
+
+
+#----------------------------------------------------------
+class Prescales:
+    #   Item name             | Prescale
+    #----------------------------------------------------------
+    L1Prescales = {}
+
+    #   Signature name   | [ HLTprescale, HLTpass-through, rerun]
+    #   - Prescale values should be a positive integer (default=1)
+    #   - If the current pass_through value is non-zero,
+    #     the value given here will be used as pass_through rate
+    #     Assuming that pass through chains are configured so
+    #     in the slice files and won't change. Also prescale
+    #     and pass_through will not be used together.
+    #   - If only the first value is specified,
+    #     the default value of pass-through (=0) will be used
+    #----------------------------------------------------------
+    HLTPrescales = {
+        #'larnoiseburst_rerun'       : [ 0, 0 , 1, "LArNoiseBurst"],
+        }
+
+    L1Prescales_cosmics  = {}
+    HLTPrescales_cosmics = {}
+    chain_list=[
+        #'sct_noise',
+        #'tilecalib_laser',
+        ]
+    HLTPrescales_cosmics.update(dict(map(None,chain_list,len(chain_list)*[ [1, 0, 0] ])))
+
+
+######################################################
+# TIGHT physics prescales
+######################################################
+from copy import deepcopy
+# enable if desired: # setting all L1 prescales to 1
+#Prescales.L1Prescales = dict([(ctpid,1) for ctpid in Prescales.L1Prescales]) 
+ 
+Prescales.L1Prescales_tight_physics_prescale  = deepcopy(Prescales.L1Prescales)
+Prescales.HLTPrescales_tight_physics_prescale = deepcopy(Prescales.HLTPrescales)
+
+chain_list=[]
+Prescales.HLTPrescales_tight_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
+######################################################
+
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py
index 7582b08488906319d0b7c246aa89bf4651ce6c61..ca9fa8e36ceff86a430a7a1424d9e9e2ecc1be83 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py
@@ -5,7 +5,7 @@ import TriggerMenu.menu.Physics_pp_v6 as physics_menu
 
 from TriggerJobOpts.TriggerFlags          import TriggerFlags
 from copy                                 import deepcopy
-
+import re
 
 
 from AthenaCommon.Logging import logging
@@ -2731,6 +2731,10 @@ ps_calibmon_list=[
     'larnoiseburst_loose_L1All',
     'larnoiseburst_loose_rerun',
     'larnoiseburst_rerun',
+
+    'larnoiseburst_L1XE55',
+    'larnoiseburst_L1J40_XE60',
+
     'larps_L1EM3_EMPTY',
     'larps_L1EM7_EMPTY',
     'larps_L1EM7_FIRSTEMPTY',
@@ -2802,7 +2806,28 @@ ps_calibmon_list=[
     'satu20em_l1satmon_L1J100_FIRSTEMPTY',
     'sct_noise',
     'tilecalib_laser',
+    'zdcpeb_L1ZDC_A',
+    'zdcpeb_L1ZDC_AND',
+    'zdcpeb_L1ZDC_A_C',
+    'zdcpeb_L1ZDC_C',
+    'mistimemoncaltime',
+    'mistimemoncaltimenomu',
+    'mistimemonj400',
+    'mistimemonl1bccorr',
+    'l1calooverflow',
+
+    'calibAFP_L1AFP_C_AND',
+    'calibAFP_L1AFP_C_ANY',
+    'calibAFP_L1AFP_C_ANY_EMPTY',
+    'calibAFP_L1AFP_C_ANY_FIRSTEMPTY',
+    'calibAFP_L1AFP_C_ANY_UNPAIRED_ISO',
+    'calibAFP_L1AFP_C_ANY_UNPAIRED_NONISO',
+    'calibAFP_L1AFP_C_MBTS_A',
+    'calibAFP_L1AFP_FSC',
+    'calibAFP_L1AFP_NSC',
+
     ]    
+
 ps_eb_list=[
     'eb_high_L1RD2_FILLED',
     'eb_low_L1RD2_FILLED',
@@ -2832,6 +2857,15 @@ ps_beamspot_list=[
     'beamspot_trkFS_trkfast',
     'beamspot_trkFS_trkfast_L1TRT_EMPTY',
     'beamspot_trkFS_trkfast_L1TRT_FILLED',
+
+    #ATR-16514
+    'beamspot_activeTE_trkfast_peb_L13J15',
+    'beamspot_activeTE_trkfast_peb_L1J15',
+    'beamspot_allTE_trkfast_peb_L13J15',
+    'beamspot_allTE_trkfast_peb_L1J15',
+    'beamspot_trkFS_trkfast_L13J15',
+    'beamspot_trkFS_trkfast_L1J15',
+
     ]
 ps_fwdphys_list=[
     'lhcfpeb',
@@ -2860,6 +2894,8 @@ ps_fwdphys_list=[
     'noalg_L1LHCF_UNPAIRED_ISO',
 ]
 ps_minb_list=[
+    'te50_L1RD3_FILLED',
+
     'mb_mbts_L1MBTS_1',
     'mb_mbts_L1MBTS_1_1',
     'mb_mbts_L1MBTS_1_1_EMPTY',
@@ -3192,12 +3228,12 @@ ps_minb_list=[
     ]
 
 ps_rerun_list = [
-    'xe0noL1_l2fsperf',
-    'xe0noL1_l2fsperf_mht',
-    'xe0noL1_l2fsperf_pueta',
-    'xe0noL1_l2fsperf_pufit',
-    'xe0noL1_l2fsperf_tc_em',
-    'xe0noL1_l2fsperf_tc_lcw',
+
+
+
+
+
+
     ]
 ps_larnoiseburst_rerun_list = [
     'larnoiseburst_loose_rerun',
@@ -3205,6 +3241,754 @@ ps_larnoiseburst_rerun_list = [
     ]
 
 ps_perform_list = [
+    # clean up (ATR-16514)
+
+     'e13_etcut_L1EM12_W-MT25',
+     'e13_etcut_L1W-NOMATCH',
+     'e13_etcut_trkcut_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+     'e13_etcut_trkcut_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20_xe20_mt25',
+     'e13_etcut_trkcut_j20_perf_xe15_6dphi05_mt25_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+     'e13_etcut_trkcut_j20_perf_xe15_6dphi05_mt25_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_j20_perf_xe15_6dphi15_mt25_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+     'e13_etcut_trkcut_j20_perf_xe15_6dphi15_mt25_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_xe20_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_xs15_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi05_mt35_L1EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+     'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi15_mt35_L1EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+     'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi15_mt35_L1EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+     'e13_etcut_trkcut_xs30_j15_perf_xe30_2dphi05_mt35_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+     'e13_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+     'e13_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
+     'e13_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
+     'e18_etcut_L1EM15_W-MT35',
+     'e18_etcut_trkcut_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30_xe35_mt35',
+     'e18_etcut_trkcut_j20_perf_xe20_6dphi15_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_j20_perf_xe20_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xe35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi05_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_2dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'e18_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e18_etcut_trkcut_xs60_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e18_etcut_trkcut_xs60_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e20_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e20_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e20_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e20_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e24_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e24_etcut_trkcut_xs30_j15_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e24_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'e24_etcut_trkcut_xs30_xe30_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+     'e5_etcut_L1W-05RO-XEHT-0',
+     'e5_etcut_L1W-250RO2-XEHT-0',
+     'e5_etcut_L1W-90RO2-XEHT-0',
+     'e5_etcut_L1W-HT20-JJ15.ETA49',
+
+
+    '2j330_a10t_lcw_jes_30smcINF',
+    '2j330_a10t_lcw_jes_30smcINF_L1HT190-J15.ETA21',
+    '2j330_a10t_lcw_jes_30smcINF_L1SC111',
+    '4j85_jes',
+    '4j85_lcw',
+    '4j85_lcw_jes',
+    '4j85_lcw_nojcalib',
+    '4j85_nojcalib',
+    '5j65_0eta240_L1J4-MATCH',
+    '5j70_L1J4-MATCH',
+    '5j70_jes_L14J15',
+    '5j70_lcw_L14J15',
+    '5j70_lcw_jes_L14J15',
+    '5j70_lcw_nojcalib_L14J15',
+    '5j70_nojcalib_L14J15',
+    '5j85_jes',
+    '5j85_jes_L14J15',
+    '5j85_lcw',
+    '5j85_lcw_L14J15',
+    '5j85_lcw_jes',
+    '5j85_lcw_jes_L14J15',
+    '5j85_lcw_nojcalib',
+    '5j85_lcw_nojcalib_L14J15',
+    '5j85_nojcalib',
+    '5j85_nojcalib_L14J15',
+    '6j45_0eta240_L14J20',
+    '6j45_0eta240_L1J4-MATCH',
+    '6j50_0eta240_L15J150ETA25',
+    '6j55_0eta240_L15J150ETA25',
+    '7j45_L14J20',
+    '7j45_L1J4-MATCH',
+    'ht1000_L1HT190-J15.ETA21',
+    'ht400_L1HT150-J20.ETA31',
+    'ht550_L1HT150-J20.ETA31',
+    'ht700_L1HT190-J15.ETA21',
+    'ht850_L1HT190-J15.ETA21',
+    'j0_perf_L1RD0_FILLED',
+    'j0_perf_ds1_L1J100',
+    'j0_perf_ds1_L1J75',
+    'j100_a10_lcw_subjes_30smcINF',
+    'j100_a10r_30smcINF',
+    'j100_a10t_lcw_jes',
+    'j100_a10t_lcw_jes_30smcINF',
+    'j175_320eta490_jes',
+    'j175_320eta490_lcw',
+    'j175_320eta490_lcw_jes',
+    'j175_320eta490_lcw_nojcalib',
+    'j175_320eta490_nojcalib',
+    'j175_jes',
+    'j175_lcw',
+    'j175_lcw_jes',
+    'j175_lcw_nojcalib',
+    'j175_nojcalib',
+    'j260_320eta490_jes',
+    'j260_320eta490_lcw',
+    'j260_320eta490_lcw_jes',
+    'j260_320eta490_lcw_nojcalib',
+    'j260_320eta490_nojcalib',
+    'j260_a10_lcw_nojcalib_L1J75',
+    'j260_a10_nojcalib_L1J75',
+    'j260_a10t_lcw_jes_L1J75',
+    'j260_a10t_lcw_nojcalib_L1J75',
+    'j260_a10t_lcw_nojcalib_L1J75',
+    'j260_a10t_nojcalib_L1J75',
+    'j260_a10t_nojcalib_L1J75',
+    'j300_a10_lcw_sub_L1J75',
+    'j300_a10_lcw_subjes_L1SC85',
+    'j300_a10_sub_L1J75',
+    'j300_lcw_nojcalib',
+    'j35_jes',
+    'j35_lcw',
+    'j35_lcw_jes',
+    'j35_lcw_nojcalib',
+    'j35_nojcalib',
+    'j360_320eta490_jes',
+    'j360_320eta490_lcw',
+    'j360_320eta490_lcw_jes',
+    'j360_320eta490_lcw_nojcalib',
+    'j360_320eta490_nojcalib',
+    'j360_a10_lcw_nojcalib',
+    'j360_a10_lcw_nojcalib_L1HT150-J20.ETA31',
+    'j360_a10_lcw_sub',
+    'j360_a10_lcw_sub_L1HT150-J20.ETA31',
+    'j360_a10_lcw_sub_L1J100',
+    'j360_a10_lcw_sub_L1SC111',
+    'j360_a10_lcw_subjes_L1HT150-J20.ETA31',
+    'j360_a10_lcw_subjes_L1HT150-J20s5.ETA31',
+    'j360_a10_lcw_subjes_L1SC111',
+    'j360_a10_nojcalib',
+    'j360_a10_nojcalib_L1HT150-J20.ETA31',
+    'j360_a10_sub',
+    'j360_a10_sub_L1HT150-J20.ETA31',
+    'j360_a10_sub_L1J100',
+    'j360_a10r_L1J100',
+    'j360_lcw_L1HT150-JJ15.ETA49',
+    'j375_a10t_lcw_jes_30smcINF',
+    'j375_a10t_lcw_jes_30smcINF_L1HT190-J15.ETA21',
+    'j375_a10t_lcw_jes_30smcINF_L1SC111',
+    'j380_jes',
+    'j380_lcw',
+    'j380_lcw_jes',
+    'j380_lcw_nojcalib',
+    'j380_nojcalib',
+    'j400_jes',
+    'j400_lcw',
+    'j400_lcw_jes',
+    'j400_lcw_nojcalib',
+    'j400_nojcalib',
+    'j400_sub',
+    'j420_jes',
+    'j420_lcw',
+    'j420_lcw_jes',
+    'j420_lcw_nojcalib',
+    'j420_nojcalib',
+    'j440_a10_lcw_sub_L1J100',
+    'j460_a10_lcw_nojcalib',
+    'j460_a10_lcw_nojcalib_L1HT190-J15.ETA21',
+    'j460_a10_lcw_nojcalib_L1J100',
+    'j460_a10_lcw_sub',
+    'j460_a10_lcw_sub_L1HT190-J15.ETA21',
+    'j460_a10_lcw_sub_L1J100',
+    'j460_a10_lcw_sub_L1SC111',
+    'j460_a10_lcw_subjes_L1HT190-J15.ETA21',
+    'j460_a10_lcw_subjes_L1HT190-J15s5.ETA21',
+    'j460_a10_nojcalib',
+    'j460_a10_nojcalib_L1HT190-J15.ETA21',
+    'j460_a10_nojcalib_L1J100',
+    'j460_a10_sub_L1HT190-J15.ETA21',
+    'j460_a10_sub_L1J100',
+    'j460_a10t_lcw_jes_L1J100',
+    'j460_a10t_lcw_jes_L1J100',
+    'j460_a10t_lcw_nojcalib_L1J100',
+    'j460_a10t_lcw_nojcalib_L1J100',
+    'j460_a10t_nojcalib_L1J100',
+    'j460_a10t_nojcalib_L1J100',
+    'j55_L1RD0_FILLED',
+    'j60_L1J15',
+    'j60_L1RD0_FILLED',
+    'j60_TT',
+    'j85_280eta320_jes',
+    'j85_280eta320_lcw',
+    'j85_280eta320_lcw_jes',
+    'j85_280eta320_lcw_nojcalib',
+    'j85_280eta320_nojcalib',
+    'j85_L1J40',
+    'j85_L1RD0_FILLED',
+    'j85_jes',
+    'j85_lcw',
+    'j85_lcw_jes',
+    'j85_lcw_nojcalib',
+    'j85_nojcalib',
+
+
+    '2j35_bperf_split_2j35_L13J25.0ETA23',
+    '2j45_bperf_split_2j45',
+    '2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-400',
+    '2j65_bperf_split_j65',
+    'j150_bperf_split',
+    'j150_bperf_split_j50_bperf_split',
+    'j35_bperf',
+    'j35_bperf_split',
+    'j45_bperf_split_3j45',
+    'j45_bperf_split_3j45_L13J15.0ETA25',
+    'j45_bperf_split_3j45_L13J20',
+    'j55_bperf_split',
+    'j55_bperf_split_ht500_L14J20',
+    'j65_bperf_3j65_L13J25.0ETA23',
+    'j65_bperf_split_3j65_L13J25.0ETA23',
+    'j70_bperf_3j70_L13J25.0ETA23',
+    'j70_bperf_split_3j70',
+    'j70_bperf_split_3j70_L13J25.0ETA23',
+    'j75_bperf_split_3j75',
+    'j75_bperf_split_3j75_L13J25.0ETA23',
+    'j85_bperf_split',
+    'mu26_imedium_2j35_bperf_split',
+    'mu26_ivarmedium_2j35_bperf_split',
+    'mu6_j150_bperf_split',
+    'mu6_j320_bperf_split',
+    '2j45_boffperf_split_3j45',
+    '2j45_boffperf_split_3j45._L14J15.0ETA25',
+    '2j75_boffperf_split_j75',
+    '2j75_boffperf_split_j75_L13J40',
+    '3j35_boffperf_split_j35_L14J15.0ETA25',
+    '3j55_boffperf_split',
+    '3j55_boffperf_split_L13J35.0ETA23',
+    'j150_boffperf_split_j50_boffperf_split',
+    'j175_boffperf_split_j50_boffperf_split',
+    'j225_gsc380_boffperf_split', 
+    'j225_gsc400_boffperf_split',
+    'j70_boffperf_split_3j70_L14J15.0ETA25',
+    'mu4_2j35_dr05_j35_bmedium_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_2j35_dr05_j35_bmedium_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_2j35_dr05_j35_bmv2c2070_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_2j35_dr05_j35_bmv2c2070_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_2j40_dr05_j40_bloose_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_2j40_dr05_j40_bloose_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_2j40_dr05_j40_bmv2c2077_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_2j40_dr05_j40_bmv2c2077_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_3j30_dr05_j30_bmedium_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_3j30_dr05_j30_bmedium_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_3j35_dr05_j35_bloose_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_3j35_dr05_j35_bloose_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_3j30_dr05_j30_boffperf_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_3j35_dr05_j35_boffperf_split_antimatchdr05mu_L13J15_BTAG-MU4J15',
+    'mu4_3j35_dr05_j35_boffperf_split_antimatchdr05mu_L13J20_BTAG-MU4J20',
+    'mu4_3j45_dr05_L13J15_BTAG-MU4J15',
+    'mu4_3j45_dr05_L13J20_BTAG-MU4J20',
+    'mu4_4j40_dr05_L13J15_BTAG-MU4J15',
+    'mu4_4j40_dr05_L13J20_BTAG-MU4J20',
+    'mu4_j35_bperf_split_dr05_dz02_L1BTAG-MU4J15',
+    'mu4_j55_bperf_split_dr05_dz02_L1BTAG-MU4J15',
+    'mu4_j60_dr05_2j35_L13J15_BTAG-MU4J30',
+    'mu4_j70_dr05_L1BTAG-MU4J30',
+    'mu6_j110_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j150_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j175_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j260_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j320_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j400_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+    'mu6_j85_bperf_split_dr05_dz02_L1BTAG-MU6J20',
+
+    'g25_medium_tau25_dikaonmass_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'g25_medium_tau25_dipion1loose_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'g25_medium_tau25_dipion2_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'g25_medium_tau25_kaonpi1_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'g25_medium_tau25_kaonpi2_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'g25_medium_tau25_singlepion_tracktwo_50mVis10000_L130M-EM20ITAU12',
+    'tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR27_L1DR25-TAU20ITAU12I',
+    'tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR27_L1DR25-TAU20ITAU12I-J25',
+    'tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR27_L1DR25-TAU20ITAU12I',
+    'tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR27_L1DR25-TAU20ITAU12I-J25',
+    'mu14_tau25_medium1_tracktwo_L1DR-MU10TAU12I',
+    'mu14_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25',
+    'mu14_tau25_medium1_tracktwo_L1MU10_TAU12I-J25',
+    'mu14_iloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I',
+    'mu14_iloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25',
+    'mu14_iloose_tau25_medium1_tracktwo_L1MU10_TAU12I-J25',
+    'e17_lhmedium_tau25_medium1_tracktwo_L1DR-EM15TAU12I',
+    'e17_lhmedium_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+    'e17_lhmedium_nod0_tau25_medium1_tracktwo_L1DR-EM15TAU12I',
+    'e17_lhmedium_nod0_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+    'e17_lhmedium_nod0_tau25_medium1_tracktwo_L1EM15TAU12I-J25',
+    'e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I',
+    'e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+    'e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25',
+    'e17_lhmedium_iloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+    'e17_lhmedium_iloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25',
+    'e17_lhmedium_ivarloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25',
+
+
+    'te20',
+    'te20_tc_lcw',
+    'te40_L1MBTS_1_1',
+    'te50_L1MBTS_1_1',
+    'te50_L1RD3_FILLED',
+    'te50_L1TE20',
+    'te50_L1TE20.0ETA24',
+    'te60_L1MBTS_1_1',
+    'te60_L1TE40',
+    'te60_L1TE40.0ETA24',
+    'te70_L1MBTS_1_1',
+    'te80_L1MBTS_1_1',
+    'xe80_L1XE35',
+    'xe100_L1XE35',
+    'xe100_mht_L1XE35',
+    'xe100_mht_wEFMu_L1XE35',
+    'xe100_tc_em_L1XE35',
+    'xe100_tc_em_wEFMu_L1XE35',
+    'xe100_tc_lcw_L1XE35',
+    'xe100_tc_lcw_wEFMu_L1XE35',
+    'xe100_wEFMu_L1XE35',
+    'xe80_L1XE70',
+    'xe80_mht_L1XE70',
+    'xe80_mht_wEFMu_L1XE70',
+    'xe80_pueta_L1XE70',
+    'xe80_pueta_wEFMu_L1XE70',
+    'xe80_pufit_L1XE70',
+    'xe80_pufit_wEFMu_L1XE70',
+    'xe80_tc_em_L1XE70',
+    'xe80_tc_em_wEFMu_L1XE70',
+    'xe80_tc_lcw_L1XE70',
+    'xe80_tc_lcw_wEFMu_L1XE70',
+    'xe80_wEFMu_L1XE70',
+    'xe100_L1XE70',
+    'xe110_L1XE70',
+    'xe120_L1XE70',
+    'xe130_L1XE70',
+    'xe130_mht_L1XE70',
+    'xe130_mht_wEFMu_L1XE70',
+    'xe130_pufit_L1XE70',
+    'xe130_pufit_wEFMu_L1XE70',
+    'xe130_tc_lcw_L1XE70',
+    'xe130_tc_lcw_wEFMu_L1XE70',
+    'xe140_mht_L1XE70',
+    'xe140_pufit_L1XE70',
+    'xe140_tc_lcw_L1XE70',
+    'xe150_mht_L1XE70',
+    'xe160_mht_L1XE70',
+    'xe160_mht_wEFMu_L1XE70',
+    'xe160_pufit_L1XE70',
+    'xe160_pufit_wEFMu_L1XE70',
+    'xe160_tc_lcw_L1XE70',
+    'xe160_tc_lcw_wEFMu_L1XE70',
+    'xe100_L1XE80',
+    'xe100_mht_L1XE80',
+    'xe100_mht_wEFMu_L1XE80',
+    'xe100_pueta_L1XE80',
+    'xe100_pueta_wEFMu_L1XE80',
+    'xe100_pufit_L1XE80',
+    'xe100_pufit_wEFMu_L1XE80',
+    'xe100_tc_em_L1XE80',
+    'xe100_tc_em_wEFMu_L1XE80',
+    'xe100_tc_lcw_L1XE80',
+    'xe100_tc_lcw_wEFMu_L1XE80',
+    'xe100_wEFMu_L1XE80',
+    'xe140_mht_L1XE80',
+    'xe140_mht_wEFMu_L1XE80',
+    'xe140_pufit_L1XE80',
+    'xe140_pufit_wEFMu_L1XE80',
+    'xe140_tc_lcw_L1XE80',
+    'xe140_tc_lcw_wEFMu_L1XE80',
+    'xe160_mht_L1XE80',
+    'xe160_mht_wEFMu_L1XE80',
+    'xe160_pufit_L1XE80',
+    'xe160_pufit_wEFMu_L1XE80',
+    'xe160_tc_lcw_L1XE80',
+    'xe160_tc_lcw_wEFMu_L1XE80',
+    'xe35_pueta',
+    'xe35_pueta_wEFMu',
+    'xe45_pueta',
+    'xe45_pueta_wEFMu',
+    'xe50_pueta',
+    'xe60_pueta',
+    'xe60_pueta_wEFMu',
+    'xe70_pueta',
+    'xe70_pueta_wEFMu',
+    'xe80_pueta',
+    'xe80_pueta_L1XE50',
+    'xe80_pueta_L1XE70',
+    'xe80_pueta_wEFMu',
+    'xe80_pueta_wEFMu_L1XE50',
+    'xe80_pueta_wEFMu_L1XE70',
+    'xe90_pueta',
+    'xe90_pueta_L1XE50',
+    'xe90_pueta_L1XE60',
+    'xe90_pueta_wEFMu',
+    'xe90_pueta_wEFMu_L1XE50',
+    'xe95_pueta_L1XE50',
+    'xe95_pueta_wEFMu_L1XE50',
+    'xe100_pueta',
+    'xe100_pueta_L1XE60',
+    'xe100_pueta_L1XE80',
+    'xe100_pueta_wEFMu',
+    'xe100_pueta_wEFMu_L1XE80',
+    'xe110_pueta_L1XE50',
+    'xe110_pueta_L1XE55',
+    'xe110_pueta_L1XE60',
+    'xe110_pueta_wEFMu_L1XE50',
+    'xe110_pueta_wEFMu_L1XE55',
+    'xe120_pueta',
+    'xe120_pueta_L1XE50',
+    'xe120_pueta_L1XE55',
+    'xe120_pueta_L1XE60',
+    'xe120_pueta_wEFMu',
+    'xe120_pueta_wEFMu_L1XE50',
+    'xe120_pueta_wEFMu_L1XE55',
+    'xe130_pueta_L1XE50',
+    'xe130_pueta_L1XE55',
+    'xe130_pueta_wEFMu_L1XE50',
+    'xe130_pueta_wEFMu_L1XE55',
+    'xe140_pueta_L1XE50',
+    'xe140_pueta_L1XE55',
+    'xe140_pueta_wEFMu_L1XE50',
+    'xe140_pueta_wEFMu_L1XE55',
+    'xe150_pueta_L1XE50',
+    'xe150_pueta_L1XE55',
+    'xe150_pueta_wEFMu_L1XE50',
+    'xe150_pueta_wEFMu_L1XE55',
+    'xe160_pueta_L1XE50',
+    'xe160_pueta_L1XE55',
+    'xe160_pueta_wEFMu_L1XE50',
+    'xe160_pueta_wEFMu_L1XE55',
+    'xe110_mht_FStracks_L1XE50',
+    'xe150_L1XE55',
+    'xe150_L1XE60',
+    'xe150_mht_L1XE50',
+    'xe150_mht_L1XE55',
+    'xe150_mht_L1XE60',
+    'xe150_mht_L1XE60_AND_xe100_L1XE60',
+    'xe150_mht_wEFMu_L1XE55',
+    'xe150_pufit_L1XE50',
+    'xe150_pufit_L1XE55',
+    'xe150_pufit_wEFMu_L1XE50',
+    'xe150_pufit_wEFMu_L1XE55',
+    'xe150_tc_lcw_L1XE50',
+    'xe150_tc_lcw_L1XE55',
+    'xe150_tc_lcw_wEFMu_L1XE50',
+    'xe150_tc_lcw_wEFMu_L1XE55',
+    'xe160_L1XE55',
+    'xe160_mht_L1XE50',
+    'xe160_mht_L1XE55',
+    'xe160_mht_L1XE60',
+    'xe160_mht_wEFMu_L1XE55',
+    'xe160_mht_wEFMu_L1XE60',
+    'xe160_pufit_L1XE50',
+    'xe160_pufit_L1XE55',
+    'xe160_pufit_L1XE60',
+    'xe160_pufit_wEFMu_L1XE50',
+    'xe160_pufit_wEFMu_L1XE55',
+    'xe160_pufit_wEFMu_L1XE60',
+    'xe160_tc_lcw_L1XE50',
+    'xe160_tc_lcw_L1XE55',
+    'xe160_tc_lcw_L1XE60',
+    'xe160_tc_lcw_wEFMu_L1XE50',
+    'xe160_tc_lcw_wEFMu_L1XE55',
+    'xe160_tc_lcw_wEFMu_L1XE60',
+    'xe200_mht_L1XE60_AND_xe150_L1XE60',
+    'xe250_mht_L1XE60_AND_xe200_L1XE60',
+    'xe300_mht_L1XE60_AND_xe250_L1XE60',
+    'xe35',
+    'xe35_mht',
+    'xe35_mht_wEFMu',
+    'xe35_pufit',
+    'xe35_pufit_wEFMu',
+    'xe35_tc_em',
+    'xe35_tc_em_wEFMu',
+    'xe35_tc_lcw',
+    'xe35_tc_lcw_wEFMu',
+    'xe35_wEFMu',
+    'xe45',
+    'xe45_mht',
+    'xe45_mht_wEFMu',
+    'xe45_pufit',
+    'xe45_pufit_wEFMu',
+    'xe45_tc_em',
+    'xe45_tc_em_wEFMu',
+    'xe45_tc_lcw',
+    'xe45_tc_lcw_wEFMu',
+    'xe45_wEFMu',
+    'xe50',
+    'xe50_mht',
+    'xe50_mht_FStracks_L1XE50',
+    'xe50_pufit',
+    'xe50_tc_em',
+    'xe50_tc_lcw',
+    'xe85_L1XE50',
+    'xe85_mht_L1XE50',
+    'xe85_mht_wEFMu_L1XE50',
+    'xe85_tc_em_L1XE50',
+    'xe85_tc_em_wEFMu_L1XE50',
+    'xe85_tc_lcw_L1XE50',
+    'xe85_tc_lcw_wEFMu_L1XE50',
+    'xe85_wEFMu_L1XE50',
+    'xs30',
+    'xs30_tc_lcw',
+    'xe100_pufit_L1KF-XE50',
+    'xe100_pufit_L1KF-XE55',
+    'xe110_L1KF-XE55',
+    'xe110_mht_L1KF-XE55',
+    'xe140_tc_lcw_L1KF-XE55',    
+    'xe0noL1_l2fsperf',
+    'xe0noL1_l2fsperf_mht',
+    'xe0noL1_l2fsperf_pueta',
+    'xe0noL1_l2fsperf_pufit',
+    'xe0noL1_l2fsperf_tc_em',
+    'xe0noL1_l2fsperf_tc_lcw',
+
+    'e5_etcut_L1W-HT20-JJ15.ETA49', 
+    'e18_etcut_trkcut_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30_xe35_mt35',
+    'e30_lhtight_nod0',
+    'e30_lhtight_nod0_ivarloose',
+    'e30_lhtight_cutd0dphideta_ivarloose',
+    'e30_lhtight_idperf',
+    'e30_lhtight_nod0_e15_etcut_L1EM7_Zee',
+    'e30_lhvloose_nod0_L1EM20VH',
+    'e30_lhvloose_nod0_L1EM20VH_3j20noL1',
+    'e30_lhvloose_nod0_L1EM20VH_4j20noL1',
+    'e30_lhvloose_nod0_L1EM20VH_5j15noL1',
+    'e30_lhvloose_nod0_L1EM20VH_6j15noL1',
+    'e30_lhmedium_nod0_L1EM20VH',
+    'e30_lhmedium_nod0_L1EM20VH_3j20noL1',
+    'e30_lhmedium_nod0_L1EM20VH_4j20noL1',
+    'e30_lhmedium_nod0_L1EM20VH_5j15noL1',
+    'e30_lhmedium_nod0_L1EM20VH_6j15noL1',
+    'e32_lhtight_nod0_ivarloose',
+    'e35_lhtight_nod0_ivarloose',
+    'e40_lhtight_nod0_ivarloose',
+    'e50_lhtight_nod0_ivarloose',
+    'e60_lhmedium_nod0_L1EM26VHI',
+    'e140_lhloose_nod0_L1EM26VHI',
+    'e300_etcut_L1EM24VHI',
+    'e300_etcut_L1EM26VHI',
+    'e24_lhmedium_nod0_ringer_L1EM20VH',
+    'e26_lhtight_nod0_ringer_ivarloose',
+    'e28_lhtight_nod0_ringer_ivarloose',
+    'e30_lhtight_nod0_ringer_ivarloose',
+    'e60_lhmedium_nod0_ringer',
+    'e60_lhmedium_nod0_ringer_L1EM24VHI',
+    'e140_lhloose_nod0_ringer',
+    'e140_lhloose_nod0_ringer_L1EM24VHI',
+    '2e17_lhvloose_nod0_ringer',
+    'e17_lhvloose_nod0_ringer',
+    'e17_lhloose_nod0_ringer_mu14',
+    'e17_lhloose_nod0_ringer',
+    '2e20_lhvloose_nod0',
+    '2e22_lhvloose_nod0',
+    'e20_mergedtight_g35_medium',
+    'e20_mergedtight_g35_medium_L12EM18VH',
+    'e25_mergedtight_g35_medium',
+    'e30_mergedtight_g35_medium',
+    'e20_mergedtight',
+    'e20_mergedtight_L1EM18VH',
+    'e25_mergedtight',
+    'e30_mergedtight',
+    'e5_lhtight_nod0_e4_etcut_L1JPSI-1M5',
+    'e5_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5',
+    'e9_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM7',
+    'e5_lhtight_nod0_e9_etcut_Jpsiee_L1JPSI-1M5-EM7',
+    'e14_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM12',
+    'e5_lhtight_nod0_e14_etcut_Jpsiee_L1JPSI-1M5-EM12',
+    'g0_hiptrt_L1EM26VHI',
+    'g60_loose_L1EM24VHI',
+    'g70_loose_L1EM24VHI',
+    'g80_loose_L1EM24VHI',
+    'g100_loose_L1EM24VHI',
+    'g120_loose_L1EM24VHI',
+    'g60_loose_L1EM26VHI',
+    'g70_loose_L1EM26VHI',
+    'g80_loose_L1EM26VHI',
+    'g100_loose_L1EM26VHI',
+    'g120_loose_L1EM26VHI',
+    'g140_loose_L1EM26VHI',
+    'g160_loose_L1EM26VHI',
+    'g180_loose_L1EM26VHI',
+    'g200_loose_L1EM26VHI',
+    'g300_etcut_L1EM24VHI',
+    'g300_etcut_L1EM26VHI',
+    '2g20_tight_ivloose',
+    '2g20_tight_iloose',
+    '2g20_tight_itight',
+    'g20_tight_ivloose',
+    'g20_tight_iloose',
+    'g20_tight_itight',
+    '2g22_tight_ivloose',
+    '2g22_tight_iloose',
+    '2g22_tight_itight',
+    'g22_tight_ivloose',
+    'g22_tight_iloose',
+    'g22_tight_itight',
+    '2g20_tight_L12EM18VH',
+    '2g20_tight_ivloose_L12EM18VH',
+    '2g20_tight_iloose_L12EM18VH',
+    '2g20_tight_itight_L12EM18VH',
+    'g20_tight_L1EM18VH',
+    'g20_tight_ivloose_L1EM18VH',
+    'g20_tight_iloose_L1EM18VH',
+    'g20_tight_itight_L1EM18VH',
+    '2g22_tight_L12EM20VH',
+    '2g22_tight_ivloose_L12EM20VH',
+    '2g22_tight_iloose_L12EM20VH',
+    '2g22_tight_itight_L12EM20VH',
+    'g22_tight_L1EM20VH',
+    'g22_tight_ivloose_L1EM20VH',
+    'g22_tight_iloose_L1EM20VH',
+    'g22_tight_itight_L1EM20VH',
+    'g35_loose_g25_loose_L12EM18VH',
+    'g35_loose_g25_loose_L12EM20VH',
+    'g35_medium_g25_medium_L12EM18VH',
+    'g35_medium_g25_medium_L12EM20VH',
+    'g35_medium_L1EM18VH',
+    'g35_medium_L1EM20VH',
+    '2g50_loose_L12EM18VH',
+    '2g50_loose_L12EM20VH',
+    'g50_loose_L12EM18VH',
+    'g50_loose_L12EM20VH',
+    '2g60_loose_L12EM18VH',
+    '2g60_loose_L12EM20VH',
+    'g60_loose_L12EM18VH',
+    'g60_loose_L12EM20VH',
+    '3g20_loose_L12EM18VH',
+    '3g22_loose_L12EM20VH',
+    'e24_lhmedium_nod0_L1EM18VH_g25_medium',
+    'e24_lhmedium_nod0_L1EM20VH_g25_medium',
+    'e20_lhmedium_nod0_g35_loose_L12EM18VH',
+    'e22_lhmedium_nod0_g35_loose_L12EM20VH',
+    'e30_lhmedium_nod0_L1EM26VHI_mu8noL1',
+    'e30_lhmedium_nod0_L1EM26VHI',
+    'g35_loose_L1EM26VHI_mu18noL1',
+    'g35_loose_L1EM26VHI_mu15noL1_mu2noL1',
+    'g35_loose_L1EM26VHI',
+    'e60_lhloose_nod0_L1EM26VHI_xe60noL1',
+    'e60_lhloose_nod0_L1EM26VHI',
+    'e70_lhloose_nod0_L1EM26VHI_xe70noL1',
+    'e70_lhloose_nod0_L1EM26VHI',
+    'e80_lhloose_nod0_L1EM26VHI_xe80noL1',
+    'e80_lhloose_nod0_L1EM26VHI',
+    'g45_tight_L1EM24VHI_xe45noL1',
+    'g45_tight_L1EM24VHI',
+    'g45_tight_L1EM26VHI_xe45noL1',
+    'g45_tight_L1EM26VHI',
+    'g40_tight_iloose_xe40noL1',
+    'g45_tight_iloose_xe40noL1',
+    'g45_tight_iloose_xe45noL1',
+    'g45_tight_iloose',
+    'g45_tight_iloose_L1EM22VHI_xe45noL1',
+    'g45_tight_iloose_L1EM22VHI',
+    'g45_tight_iloose_L1EM24VHI_xe45noL1',
+    'g45_tight_iloose_L1EM24VHI',
+    'g45_tight_iloose_L1EM26VHI_xe45noL1',
+    'g45_tight_iloose_L1EM26VHI',
+    'g60_loose_L1EM24VHI_xe60noL1',
+    'g70_loose_L1EM24VHI_xe70noL1',
+    'g80_loose_L1EM24VHI_xe80noL1',
+    'g60_loose_L1EM26VHI_xe60noL1',
+    'g70_loose_L1EM26VHI_xe70noL1',
+    'g80_loose_L1EM26VHI_xe80noL1',
+    'g80_loose_iloose_xe80noL1',
+    'g80_loose_iloose',
+    'g80_loose_iloose_L1EM24VHI_xe80noL1',
+    'g80_loose_iloose_L1EM24VHI',
+    'g80_loose_iloose_L1EM26VHI_xe80noL1',
+    'g80_loose_iloose_L1EM26VHI',
+    'g85_tight_3j50noL1_L1EM24VHI',
+    'g85_tight_L1EM24VHI',
+    'g85_tight_3j50noL1_L1EM26VHI',
+    'g85_tight_L1EM26VHI',
+    'g85_tight_iloose_3j50noL1_L1EM22VHI',
+    'g85_tight_iloose',
+    'g85_tight_iloose_3j50noL1_L1EM24VHI',
+    'g85_tight_iloose_L1EM24VHI',
+    'g85_tight_iloose_3j50noL1_L1EM26VHI',
+    'g85_tight_iloose_L1EM26VHI',
+    'g100_tight_3j50noL1_L1EM24VHI',
+    'g100_tight_L1EM24VHI',
+    'g100_tight_3j50noL1_L1EM26VHI',
+    'g100_tight_L1EM26VHI',
+    'g100_tight_iloose_3j50noL1_L1EM22VHI',
+    'g100_tight_iloose',
+    'g100_tight_iloose_3j50noL1_L1EM24VHI',
+    'g100_tight_iloose_3j50noL1_L1EM26VHI',
+    'g100_tight_iloose_L1EM26VHI',
+    'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi15_mt35',
+    'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi05_mt35',
+    'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi15_mt35_L1EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+    'e13_etcut_trkcut_xs40_j10_perf_xe25_6dphi05_mt35_L1EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+    'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi15_mt35_L1EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
+    'e13_etcut_trkcut_xs30_j10_perf_xe25_6dphi05_mt35_L1EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
+    'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+    'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+    'e18_etcut_trkcut_xs60_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+    'e18_etcut_trkcut_xs60_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+    'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi15_mt35_L1EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
+    'e18_etcut_trkcut_xs50_j10_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+
+    'mu18_l2idonly_mu8noL1',
+    'mu22_l2idonly_mu8noL1',
+    'mu24_l2idonly_mu8noL1',
+    'mu18_l2idonly_2mu4noL1',
+    'mu22_l2idonly_2mu4noL1',
+    'mu24_l2idonly_2mu4noL1',
+
+    'mu24_L2Star_idperf',
+    'mu6_L2Star_idperf',
+
+    'mu20_r1extr',
+    'mu10_r1extr',
+    'mu4_r1extr',
+    'mu24_icalo',
+    'mu24_iloosecalo',
+    'mu24_imediumcalo',
+    'mu18_iloose_mu8noL1_calotag_0eta010',
+    'mu22_iloose_mu8noL1_calotag_0eta010',
+    'mu24_iloose_mu8noL1_calotag_0eta010',
+    'mu18_ivarloose_mu8noL1_calotag_0eta010',
+    'mu22_ivarloose_mu8noL1_calotag_0eta010',
+    'mu24_ivarloose_mu8noL1_calotag_0eta010',
+    'mu18_mu8noL1_calotag_0eta010',
+    'mu22_mu8noL1_calotag_0eta010',
+    'mu24_mu8noL1_calotag_0eta010',
+    'mu4noL1',
+    'mu0_perf',
+
+    'tau125_perf_tracktwo',
+    'tau35_perf_tracktwo',
+    'tau35_medium1_tracktwo_L1TAU20',
+    'e17_lhmedium_iloose_tau25_perf_ptonly_L1EM15VHI_2TAU12IM',
+    'mu14_iloose_tau25_perf_ptonly_L1MU10_TAU12IM',
+    'tau160_idperf_tracktwo',
+    'tau160_perf_tracktwo',
+    'tau35_perf_tracktwo',
+    'tau35_perf_tracktwo_L1TAU20_tau25_perf_tracktwo_L1TAU12',
     'tau0_perf_ptonly_L1TAU12',
     'tau0_perf_ptonly_L1TAU60',
     'tau125_medium1_calo',
@@ -3429,6 +4213,66 @@ ps_ftk_list = [
 ]
 
 ps_Bphys_list = [
+
+    '2mu4_bDimu_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bDimu_novtx_noos_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bJpsimumu_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bBmumu_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bBmumuxv2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bDimu_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', 
+    '2mu4_bDimu_novtx_noos_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4',  
+    '2mu4_bJpsimumu_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4',
+    '2mu4_bBmumu_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4',  
+    '2mu4_bBmumuxv2_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4',
+    '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4',  
+    '2mu4_bDimu_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4', 
+    '2mu4_bDimu_novtx_noos_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bJpsimumu_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bBmumu_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',  
+    '2mu4_bBmumuxv2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bDimu_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bDimu_novtx_noos_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bJpsimumu_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bBmumu_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bBmumuxv2_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4',
+    'mu6_mu4_bDimu_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', 
+    'mu6_mu4_bDimu_novtx_noos_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bJpsimumu_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumu_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumuxv2_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_novtx_noos_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bJpsimumu_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumu_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumuxv2_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    '2mu4_bDimu_noL2_L1BPH-2M8-2MU4',
+    '2mu4_bDimu_novtx_noos_noL2_L1BPH-2M8-2MU4',
+    '2mu4_bJpsimumu_noL2_L1BPH-2M8-2MU4',
+    '2mu4_bBmumu_noL2_L1BPH-2M8-2MU4',
+    '2mu4_bBmumuxv2_noL2_L1BPH-2M8-2MU4',
+    '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4',
+
+    '2mu4_bDimu_L1BPH-2M8-2MU4',
+    '2mu4_bDimu_novtx_noos_L1BPH-2M8-2MU4',
+    '2mu4_bBmumuxv2_L1BPH-2M8-2MU4',
+    'mu6_mu4_bDimu_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_novtx_noos_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_novtx_noos_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bDimu_novtx_noos_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bJpsimumu_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumu_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumuxv2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+    'mu6_mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+
+
+
     '2mu4_bBmumux_BcmumuDsloose',
     '2mu4_bBmumux_BcmumuDsloose_noL2',
     'mu6_mu4_bBmumux_BcmumuDsloose_noL2',
@@ -3566,6 +4410,286 @@ if TriggerFlags.doFTK():
         'j150_bmv2c2050_j50_bmv2c2050_FTKRefit',
         ]       
 
+ps_streamers_list = [
+     'noalg_L12EM10VH',
+     'noalg_L12EM15',
+     'noalg_L12EM3',
+     'noalg_L12EM7',
+     'noalg_L12EM8VH_MU10',
+     'noalg_L12J15_XE55',
+     'noalg_L12MU10',
+     'noalg_L12MU4',
+     'noalg_L12MU6',
+     'noalg_L13J25.0ETA23',
+     'noalg_L13J40',
+     'noalg_L13MU4',
+     'noalg_L14J15',
+     'noalg_L1AFP_C_AND',
+     'noalg_L1AFP_C_ANY',
+     'noalg_L1AFP_C_ANY_EMPTY',
+     'noalg_L1AFP_C_ANY_FIRSTEMPTY',
+     'noalg_L1AFP_C_ANY_MBTS_A',
+     'noalg_L1AFP_C_EM3',
+     'noalg_L1AFP_C_J12',
+     'noalg_L1AFP_C_MBTS_A',
+     'noalg_L1AFP_C_MU4',
+     'noalg_L1AFP_C_TE5',
+     'noalg_L1AFP_FSC',
+     'noalg_L1AFP_NSC',
+     'noalg_L1DR-MU10TAU12I',
+     'noalg_L1DR-TAU20ITAU12I',
+     'noalg_L1DY-BOX-2MU6',
+     'noalg_L1DY-DR-2MU4',
+     'noalg_L1EM10VH',
+     'noalg_L1EM12',
+     'noalg_L1EM13VH',
+     'noalg_L1EM15',
+     'noalg_L1EM15HI_2TAU12IM',
+     'noalg_L1EM15HI_2TAU12IM_J25_3J12',
+     'noalg_L1EM15HI_2TAU12IM_XE35',
+     'noalg_L1EM15HI_TAU40_2TAU15',
+     'noalg_L1EM15I_MU4',
+     'noalg_L1EM15VH',
+     'noalg_L1EM15VH_3EM7',
+     'noalg_L1EM15VH_MU10',
+     'noalg_L1EM18VH',
+     'noalg_L1EM20VH',
+     'noalg_L1EM22VHI',
+     'noalg_L1EM3',
+     'noalg_L1EM7',
+     'noalg_L1EM7_MU10',
+     'noalg_L1EM8VH',
+     'noalg_L1J100',
+     'noalg_L1J100.31ETA49',
+     'noalg_L1J12',
+     'noalg_L1J120',
+     'noalg_L1J15',
+     'noalg_L1J15.31ETA49',
+     'noalg_L1J20',
+     'noalg_L1J20.28ETA31',
+     'noalg_L1J20.31ETA49',
+     'noalg_L1J20_J20.31ETA49',
+     'noalg_L1J25',
+     'noalg_L1J30',
+     'noalg_L1J30.31ETA49',
+     'noalg_L1J40',
+     'noalg_L1J400',
+     'noalg_L1J50',
+     'noalg_L1J50.31ETA49',
+     'noalg_L1J75',
+     'noalg_L1J75.31ETA49',
+     'noalg_L1J85',
+     'noalg_L1LFV-MU',
+     'noalg_L1LowLumi',
+     'noalg_L1MBTS_1_BGRP11',
+     'noalg_L1MBTS_1_BGRP9',
+     'noalg_L1MBTS_2_BGRP11',
+     'noalg_L1MBTS_2_BGRP9',
+     'noalg_L1MJJ-100',
+     'noalg_L1MU10',
+     'noalg_L1MU10_TAU12IM',
+     'noalg_L1MU10_TAU12IM_J25_2J12',
+     'noalg_L1MU10_TAU12IM_XE35',
+     'noalg_L1MU11',
+     'noalg_L1MU11_EMPTY',
+     'noalg_L1MU15',
+     'noalg_L1MU20',
+     'noalg_L1MU20_FIRSTEMPTY',
+     'noalg_L1MU4',
+     'noalg_L1MU4_EMPTY',
+     'noalg_L1MU4_FIRSTEMPTY',
+     'noalg_L1MU4_J12',
+     'noalg_L1MU4_UNPAIRED_ISO',
+     'noalg_L1MU6',
+     'noalg_L1MU6_J20',
+     'noalg_L1MU6_J30.0ETA49_2J20.0ETA49',
+     'noalg_L1MU6_J40',
+     'noalg_L1RD0_BGRP11',
+     'noalg_L1RD0_BGRP9',
+     'noalg_L1RD0_EMPTY',
+     'noalg_L1RD0_FILLED',
+     'noalg_L1RD1_FILLED',
+     'noalg_L1RD2_EMPTY',
+     'noalg_L1RD2_FILLED',
+     'noalg_L1RD3_EMPTY',
+     'noalg_L1RD3_FILLED',
+     'noalg_L1TAU12',
+     'noalg_L1TAU12IM',
+     'noalg_L1TAU20',
+     'noalg_L1TAU20IM',
+     'noalg_L1TAU20IM_2TAU12IM',
+     'noalg_L1TAU20IM_2TAU12IM_J25_2J20_3J12',
+     'noalg_L1TAU20IM_2TAU12IM_XE35',
+     'noalg_L1TAU20_2TAU12',
+     'noalg_L1TAU20_2TAU12_XE35',
+     'noalg_L1TAU30',
+     'noalg_L1TAU40',
+     'noalg_L1TAU60',
+     'noalg_L1TAU8',
+     'noalg_L1TE10',
+     'noalg_L1TE10.0ETA24',
+     'noalg_L1TE20',
+     'noalg_L1TE20.0ETA24',
+     'noalg_L1TE30',
+     'noalg_L1TE30.0ETA24',
+     'noalg_L1TE40',
+     'noalg_L1TE40.0ETA24',
+     'noalg_L1TE5',
+     'noalg_L1TE5.0ETA24',
+     'noalg_L1TE70',
+     'noalg_L1Topo',
+     'noalg_L1XE10',
+     'noalg_L1XE150',
+     'noalg_L1XE30',
+     'noalg_L1XE300',
+     'noalg_L1XE35',
+     'noalg_L1XE40',
+     'noalg_L1XE45',
+     'noalg_L1XE50',
+     'noalg_L1XE55',
+     'noalg_L1XE60',
+     'noalg_L1XE70',
+     'noalg_L1XE80',
+     'noalg_L1XS20',
+     'noalg_L1XS30',
+     'noalg_bkg_L1J15.31ETA49_UNPAIRED_ISO',
+     'noalg_bkg_L1MBTS_2_UNPAIRED_ISO',
+     'noalg_bkg_L1MBTS_4_A_UNPAIRED_ISO',
+     'noalg_bkg_L1MBTS_4_C_UNPAIRED_ISO',
+     'noalg_bkg_L1MU4_UNPAIRED_ISO',
+     'noalg_bkg_L1RD0_UNPAIRED_ISO',
+     'noalg_l1calo_L1J400',
+     'noalg_l1topo_L12EM3',
+     'noalg_l1topo_L12MU4',
+     'noalg_l1topo_L12MU4-B',
+     'noalg_l1topo_L12MU4-BO',
+     'noalg_l1topo_L12MU6',
+     'noalg_l1topo_L12MU6-B',
+     'noalg_l1topo_L12MU6-BO',
+     'noalg_l1topo_L13J15_BTAG-MU4J15',
+     'noalg_l1topo_L13J15_BTAG-MU4J30',
+     'noalg_l1topo_L13J15_BTAG-MU6J25',
+     'noalg_l1topo_L13J20_4J20.0ETA49_MJJ-400',
+     'noalg_l1topo_L13J20_4J20.0ETA49_MJJ-700',
+     'noalg_l1topo_L13J20_4J20.0ETA49_MJJ-800',
+     'noalg_l1topo_L13J20_4J20.0ETA49_MJJ-900',
+     'noalg_l1topo_L13J20_BTAG-MU4J20',
+     'noalg_l1topo_L14J15',
+     'noalg_l1topo_L14J20.0ETA49',
+     'noalg_l1topo_L1BOX-TAU20ITAU12I',
+     'noalg_l1topo_L1BPH-2M8-2MU4',
+     'noalg_l1topo_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
+     'noalg_l1topo_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
+     'noalg_l1topo_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+     'noalg_l1topo_L1BPH-8M15-2MU6',
+     'noalg_l1topo_L1BPH-8M15-MU6MU4',
+     'noalg_l1topo_L1BTAG-MU4J15',
+     'noalg_l1topo_L1BTAG-MU4J30',
+     'noalg_l1topo_L1BTAG-MU6J20',
+     'noalg_l1topo_L1BTAG-MU6J25',
+     'noalg_l1topo_L1DPHI-CJ20XE50',
+     'noalg_l1topo_L1DPHI-J20XE50',
+     'noalg_l1topo_L1DPHI-J20s2XE50',
+     'noalg_l1topo_L1DR-EM15TAU12I-J25',
+     'noalg_l1topo_L1DR-MU10TAU12I',
+     'noalg_l1topo_L1DR-MU10TAU12I_TAU12I-J25',
+     'noalg_l1topo_L1DR-TAU20ITAU12I',
+     'noalg_l1topo_L1DR-TAU20ITAU12I-J25',
+     'noalg_l1topo_L1DY-BOX-2MU6',
+     'noalg_l1topo_L1DY-DR-2MU4',
+     'noalg_l1topo_L1EM12_2EM3',
+     'noalg_l1topo_L1EM12_W-MT25',
+     'noalg_l1topo_L1EM15',
+     'noalg_l1topo_L1EM15I_MU4',
+     'noalg_l1topo_L1EM15TAU12I-J25',
+     'noalg_l1topo_L1EM15VH_W-MT35_XS60',
+     'noalg_l1topo_L1EM15_W-MT35',
+     'noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
+     'noalg_l1topo_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'noalg_l1topo_L1EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'noalg_l1topo_L1EM15_W-MT35_XS60',
+     'noalg_l1topo_L1EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
+     'noalg_l1topo_L1EM20VH_W-MT35_XS60',
+     'noalg_l1topo_L1EM22VHI_W-MT35_XS40',
+     'noalg_l1topo_L1EM3',
+     'noalg_l1topo_L1EM7',
+     'noalg_l1topo_L1EM7_2EM3',
+     'noalg_l1topo_L1EM7_MU10',
+     'noalg_l1topo_L1EM8I_MU10',
+     'noalg_l1topo_L1HT150-J20.ETA31',
+     'noalg_l1topo_L1HT150-J20s5.ETA31',
+     'noalg_l1topo_L1HT150-JJ15.ETA49',
+     'noalg_l1topo_L1HT150-JJ15.ETA49_MJJ-400',
+     'noalg_l1topo_L1HT190-J15.ETA21',
+     'noalg_l1topo_L1HT190-J15s5.ETA21',
+     'noalg_l1topo_L1J100',
+     'noalg_l1topo_L1J15',
+     'noalg_l1topo_L1J20',
+     'noalg_l1topo_L1J25',
+     'noalg_l1topo_L1J25_2J20_3J12_BOX-TAU20ITAU12I',
+     'noalg_l1topo_L1J30.0ETA49_2J20.0ETA49',
+     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-400',
+     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-700',
+     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-800',
+     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-900',
+     'noalg_l1topo_L1J4-MATCH',
+     'noalg_l1topo_L1J40_DPHI-CJ20XE50',
+     'noalg_l1topo_L1J40_DPHI-J20XE50',
+     'noalg_l1topo_L1J40_DPHI-J20s2XE50',
+     'noalg_l1topo_L1J40_XE50',
+     'noalg_l1topo_L1JPSI-1M5',
+     'noalg_l1topo_L1JPSI-1M5-EM12',
+     'noalg_l1topo_L1JPSI-1M5-EM7',
+     'noalg_l1topo_L1KF-XE55',
+     'noalg_l1topo_L1KF-XE60',
+     'noalg_l1topo_L1KF-XE65',
+     'noalg_l1topo_L1KF-XE75',
+     'noalg_l1topo_L1LAR-EM',
+     'noalg_l1topo_L1LAR-J',
+     'noalg_l1topo_L1LFV-EM15I',
+     'noalg_l1topo_L1LFV-EM8I',
+     'noalg_l1topo_L1LFV-MU',
+     'noalg_l1topo_L1LLP-NOMATCH',
+     'noalg_l1topo_L1MJJ-100',
+     'noalg_l1topo_L1MJJ-400',
+     'noalg_l1topo_L1MJJ-700',
+     'noalg_l1topo_L1MJJ-800',
+     'noalg_l1topo_L1MJJ-900',
+     'noalg_l1topo_L1MU10_2MU6',
+     'noalg_l1topo_L1MU10_TAU12I-J25',
+     'noalg_l1topo_L1MU10_TAU12IM',
+     'noalg_l1topo_L1MU4',
+     'noalg_l1topo_L1MU4_J12',
+     'noalg_l1topo_L1MU6MU4-BO',
+     'noalg_l1topo_L1MU6_2MU4',
+     'noalg_l1topo_L1MU6_2MU4-B',
+     'noalg_l1topo_L1MU6_J20',
+     'noalg_l1topo_L1MU6_MJJ-200',
+     'noalg_l1topo_L1MU6_MJJ-300',
+     'noalg_l1topo_L1MU6_MJJ-400',
+     'noalg_l1topo_L1MU6_MJJ-500',
+     'noalg_l1topo_L1TAU12IM',
+     'noalg_l1topo_L1TAU20IM_2TAU12IM',
+     'noalg_l1topo_L1TAU20ITAU12I-J25',
+     'noalg_l1topo_L1TAU30',
+     'noalg_l1topo_L1TAU40',
+     'noalg_l1topo_L1W-05RO-XEHT-0',
+     'noalg_l1topo_L1W-250RO2-XEHT-0',
+     'noalg_l1topo_L1W-90RO2-XEHT-0',
+     'noalg_l1topo_L1W-HT20-JJ15.ETA49',
+     'noalg_l1topo_L1W-NOMATCH',
+     'noalg_l1topo_L1XE35',
+     'noalg_l1topo_L1XE35_MJJ-200',
+     'noalg_l1topo_L1XE45',
+     'noalg_l1topo_L1XE55',
+     'noalg_l1topo_L1XE60',
+     'noalg_l1topo_L1XE70',
+     'noalg_standby_L13J15',
+     'noalg_standby_L14J15',
+     'noalg_standby_L1J15',
+]
+
 #-----------------------------------------------------
 
 
@@ -3619,7 +4743,7 @@ Prescales.HLTPrescales_tightperf_mc_prescale.update(dict(map(None,chain_list,len
 ######################################################
 Prescales.L1Prescales_tight_mc_prescale  = deepcopy(Prescales.L1Prescales)
 Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale)
-chain_list=ps_perform_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162
+chain_list=ps_streamers_list+ps_perform_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162
 
 #Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale)
 #chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_ftk_list+ps_perform_list
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
index 762985ec358d5040e742a03bd01099d99bef2b54..6df6b016eefdb2df4c4cd016c7a8609181a43a3b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py
@@ -6,7 +6,7 @@ import TriggerMenu.menu.Physics_pp_v7 as physics_menu
 from TriggerJobOpts.TriggerFlags          import TriggerFlags
 from copy                                 import deepcopy
 
-
+import re
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'MC_pp_v7.py' )
@@ -25,7 +25,7 @@ def setupMenu():
     RATE_BphysTag      = 'RATE:Bphysics'
     RATE_BMultiMuonTag = 'RATE:MultiMuon'  # can become RATE:BMultiMuon' with one letter change 
     BW_BphysTag        = 'BW:Bphys'
-    RATE_DYTag         = 'RATE:Muon'   
+    RATE_DYTag         = 'RATE:Muon'
     BW_DYTag           = 'BW:Muon'   
     
     
@@ -37,30 +37,43 @@ def setupMenu():
     TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
 			 ]
 
+    TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
+        ]
+
+
+
     TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
-        ['mu20_r1extr',            'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu10_r1extr',            'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu4_r1extr',             'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_icalo',             'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_iloosecalo',        'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_imediumcalo',       'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu26_ivarmediumcalo',    'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-
-        ['mu20_imedium_mu8noL1',    'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_imedium','mu8noL1']]],
-        ['mu20_iloose_mu8noL1',     'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_iloose','mu8noL1']]],
-        ['mu20_iloose_2mu4noL1',    'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_iloose','2mu4noL1']]],
+        ['mu100',                  'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu35_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu36_ivarmedium',          'L1_MU20MU21',           ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu40_ivarmedium',          'L1_MU20MU21',           ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu50_ivarmedium',          'L1_MU20MU21',           ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        ['mu20_r1extr',          'L1_MU20MU21',      ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_r1extr',          'L1_MU10',                   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu4_r1extr',           'L1_MU4',                    [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_icalo',           'L1_MU20MU21',      ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_iloosecalo',      'L1_MU20MU21',      ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_imediumcalo',     'L1_MU20MU21',      ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu26_ivarmediumcalo',  'L1_MU20MU21',      ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        ['mu20_imedium_mu8noL1',    'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_imedium','mu8noL1']]],
+        ['mu20_iloose_mu8noL1',     'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_iloose','mu8noL1']]],
+        ['mu20_iloose_2mu4noL1',    'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_iloose','2mu4noL1']]],
         ### ATR-14543
-        ['mu20_ivarmedium_mu8noL1',    'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarmedium','mu8noL1']]],
-        ['mu20_ivarloose_mu8noL1',     'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarloose','mu8noL1']]],
-        ['mu20_ivarloose_2mu4noL1',    'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarloose','2mu4noL1']]],
+        ['mu20_ivarmedium_mu8noL1',    'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarmedium','mu8noL1']]],
+        ['mu20_ivarloose_mu8noL1',     'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarloose','mu8noL1']]],
+        ['mu20_ivarloose_2mu4noL1',    'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_ivarloose','2mu4noL1']]],
 
         # new test chains for dimuon inefficiency
         ['3mu4_noMuCombOvlpRm',    'L1_3MU4',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
         ['2mu14_noMuCombOvlpRm',   'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
 
+        ['2mu16_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['2mu18_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
 
 
-         ['mu60_msonly_mu60noL1_msonly',  'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream],     ['RATE:MultiMuon','BW:Muon'],-1,['serial',-1,['mu60_msonly','mu60noL1_msonly']]],
+         ['mu60_msonly_mu60noL1_msonly',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream],     ['RATE:MultiMuon','BW:Muon'],-1,['serial',-1,['mu60_msonly','mu60noL1_msonly']]],
 
 
 
@@ -70,64 +83,58 @@ def setupMenu():
         ### ATR-14543
         ['mu14_ivarmedium_mu6noL1_msonly',    'L1_MU10',  ['L1_MU10',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu14_ivarmedium','mu6noL1_msonly']]],
         ['2mu6_mu4', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['mu20_msonly_mu12noL1_msonly_nscan05_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu12noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan05_noComb']]],
 
        # not working for now                                                                                                                                                                                   
-        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb',       'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb',       'L1_MU20MU21',      ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
 
         ['mu11_msonly_mu6noL1_msonly_nscan05_noComb',       'L1_MU10',      ['L1_MU10','L2_mu11_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly','mu6noL1_msonly_nscan05_noComb']]],
         ['mu11_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly','mu6noL1_msonly_nscan05_noComb']]],
         ['mu11_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly','mu6noL1_msonly_nscan05_noComb']]],
 
         ### ATR-14377: duplicate noComb chains with leading-leg AND nscan-leg noComb
-        ['mu20_msonly_noComb_mu12noL1_msonly_nscan05_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu12noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_noComb_mu6noL1_msonly_nscan05_noComb',       'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu6noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_noComb_mu12noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu12noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_noComb_mu6noL1_msonly_nscan05_noComb',       'L1_MU20MU21',      ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu6noL1_msonly_nscan05_noComb']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05_noComb',       'L1_MU10',      ['L1_MU10','L2_mu11_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05_noComb']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05_noComb_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05_noComb']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05_noComb']]],
 
         ### ATR-14377: duplicate noComb chains with leading-leg-only noComb
-        ['mu20_msonly_noComb_mu12noL1_msonly_nscan05',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu12noL1_msonly_nscan05']]],
-        ['mu20_msonly_noComb_mu6noL1_msonly_nscan05',       'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_noComb_mu12noL1_msonly_nscan05',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu12noL1_msonly_nscan05']]],
+        ['mu20_msonly_noComb_mu6noL1_msonly_nscan05',       'L1_MU20MU21',      ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_noComb','mu6noL1_msonly_nscan05']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05',       'L1_MU10',      ['L1_MU10','L2_mu11_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05']]],
         ['mu11_msonly_noComb_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU10','L2_mu11_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_msonly_noComb','mu6noL1_msonly_nscan05']]],
 
 
         ### ATR-14377: remove noComb for tests
-        ['mu20_msonly_mu15noL1_msonly_nscan05', 'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan05', 'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05']]],
 
 
         ### ATR-14377: nscan with iloosems legs
-        ['mu20_msonly_iloosems_mu10noL1_msonly_nscan05_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_iloosems_mu10noL1_msonly_nscan03_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_iloosems_mu15noL1_msonly_nscan05_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_iloosems_mu15noL1_msonly_nscan03_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_iloosems_mu12noL1_msonly_nscan03_noComb',   'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu12noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05',        'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_noComb',        'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan03',                 'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03',        'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03_noComb', 'L1_MU20MU21',     ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_iloosems_mu10noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_iloosems_mu10noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_iloosems_mu15noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_iloosems_mu15noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_iloosems_mu12noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu12noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05',           'L1_MU20MU21', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_noComb',    'L1_MU20MU21', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan03',                 'L1_MU20MU21', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03',        'L1_MU20MU21', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03_noComb', 'L1_MU20MU21', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03_noComb']]],
 
        
-        ['mu22_iloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_iloose','mu8noL1_calotag_0eta010']]],
-        ['mu24_iloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24_iloose','mu8noL1_calotag_0eta010']]],
+        ['mu22_iloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_iloose','mu8noL1_calotag_0eta010']]],
+        ['mu24_iloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24_iloose','mu8noL1_calotag_0eta010']]],
         ### ATR-14543
-        ['mu22_ivarloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_ivarloose','mu8noL1_calotag_0eta010']]],
-        ['mu24_ivarloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24_ivarloose','mu8noL1_calotag_0eta010']]],
-
+        ['mu22_ivarloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_ivarloose','mu8noL1_calotag_0eta010']]],
+        ['mu24_ivarloose_mu8noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24_ivarloose','mu8noL1_calotag_0eta010']]],
 
-        ['mu20_nomucomb_2mu4noL1', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_nomucomb','2mu4noL1']]],
-        ['mu22_nomucomb_2mu4noL1', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_nomucomb','2mu4noL1']]],
-        ['mu20_nomucomb_mu8noL1' , 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_nomucomb','mu8noL1']]],
-        ['mu22_nomucomb_mu8noL1' , 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_nomucomb','mu8noL1']]],
-
-
-
-        ['mu10_mgonly_L1LATE-MU10_J50',          'L1_LATE-MU10_J50',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu10_mgonly_L1LATE-MU10_XE50',         'L1_LATE-MU10_XE50',          [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
 
+        ['mu20_nomucomb_2mu4noL1', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_nomucomb','2mu4noL1']]],
+        ['mu22_nomucomb_2mu4noL1', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_nomucomb','2mu4noL1']]],
+        ['mu20_nomucomb_mu8noL1' , 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_nomucomb','mu8noL1']]],
+        ['mu22_nomucomb_mu8noL1' , 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22_nomucomb','mu8noL1']]],
 
         ['mu8',                    'L1_MU6',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], 
         ['3mu6_nomucomb',                   'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
@@ -135,23 +142,113 @@ def setupMenu():
         ['mu4_mu4noL1',            'L1_MU4',  ['L1_MU4',''],  [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu4','mu4noL1']]],
 	['mu4noL1',                '',  [],  [PhysicsStream], ['RATE:SingleMuon','BW:Muon'], -1, ],
 	['mu0noL1',                '',  [],  [PhysicsStream], ['RATE:SingleMuon','BW:Muon'], -1, ],
-        
+       
+ 
         # Toroid-off run (ATR-9923)
         ['mu11_L1MU10_2mu4noL1_nscan03_L1MU10_2MU6', 'L1_MU10_2MU6', ['L1_MU10','L2_mu11_L1MU10'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_L1MU10','2mu4noL1_nscan03']]],
         ['mu11_2mu4noL1_nscan03_L1MU11_2MU6',      'L1_MU11_2MU6',    ['L1_MU11','L2_mu11'],        [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11','2mu4noL1_nscan03']]],
         ['mu11_nomucomb_mu6noL1_nscan03_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu6_nomucomb'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_nomucomb','mu6noL1_nscan03']]],
 
-        ]
+        # single muon
+
+        ['mu24_ivarloose',           'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_iloose',              'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        ['mu0_perf',               'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], 
+        ['mu26_imedium',           'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu28_imedium',           'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu40',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24_imedium',           'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_imedium_L1MU10',    'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu11',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu14_iloose',            'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_msonly',            'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu4_msonly',             'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu14_nomucomb',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_nomucomb',                   'L1_MU20MU21',['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['2mu14_nomucomb',         'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['3mu10_msonly_L13MU6',    'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['2mu10',                  'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['2mu10_nomucomb',         'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['mu20_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','mu8noL1']]],
+        ['2mu6',                    'L1_2MU6',  [], [PhysicsStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
+        ['2mu4',                    'L1_2MU4',  [], [PhysicsStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
+        ['mu20_2mu2noL1',            'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1']]],
+
+        #low-pt multi-muon chains, ATR-15704
+        ['3mu4_nomucomb',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
+        ['3mu4_nomucomb_mu2noL1',  'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4_nomucomb','mu2noL1']]],
+        ['2mu4_mu3_mu2noL1_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['2mu4','mu3','mu2noL1']]],
+        ['3mu4_nomucomb_mu4noL1',  'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4_nomucomb','mu4noL1']]],
+        ['4mu4_nomucomb',          'L1_4MU4', ['L1_4MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['4mu4_nomucomb','']]],
+
+        ['mu18_mu8noL1_calotag_0eta010_L1MU11', 'L1_MU11', ['L1_MU11',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu18','mu8noL1_calotag_0eta010']]],
+        ['mu20_mu8noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','mu8noL1_calotag_0eta010']]],
+
+        # Narrow scan
+        # notes: see ATR-11846
+        # inputTE for narrow scan sequence (2nd inputTE) is a dummy string for MuonDef.py
+        # To indicate narrow scan uses lastTE of previous sequence and also to avoid duplicated sequences with same TE name, write L2_ TE name of the 1st sequence.
+
+        ['mu20_nomucomb_mu6noL1_nscan03', 'L1_MU20MU21',['L1_MU20','L2_mu20_nomucomb'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu20_nomucomb','mu6noL1_nscan03']]],  #OI need to discuss what to do here
+
+        ['mu11_nomucomb_2mu4noL1_nscan03_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu11_nomucomb'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11_nomucomb','2mu4noL1_nscan03']]], #OI need to discuss what to do here
+        ['3mu6_msonly_L1MU4_UNPAIRED_NONISO',                     'L1_MU4_UNPAIRED_NONISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1],
+
+
+        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
+
+        ### ATR-14377:
+        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
+
+        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
+        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],        
+
+
+
+        # exclusive di-lep
+        ['2mu6_10invm30_pt2_z10', 'L1_2MU6', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
+        ['mu20_imedium_L1MU10_2J20', 'L1_MU10_2J20', [], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],                
+        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO',       'L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
+
+        ### ATR-14377: nscan with different L1 seeds
+        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30',          ['L1_MU20_XE30','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40',            ['L1_MU20_J40','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+
+        #ATR-14377
+        ['mu6_dRl1_mu20_msonly_mu6noL1_dRl1_msonly','L1_MU11_2MU6', [['L1_MU6','L1_MU6'],'L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu6_dRl1','mu20_msonly','mu6noL1_dRl1_msonly']]],
+
+        # Calotag items ATR-16142
+        ['3mu4_mu2noL1_calotag_0eta010',           'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4','mu2noL1_calotag_0eta010']]],
+        ['2mu4_mu3_mu2noL1_calotag_0eta010_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['2mu4','mu3','mu2noL1_calotag_0eta010']]],
+			 ]
 
 
     if TriggerFlags.doFTK():
         TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
-            ['mu24_idperf_FTK',            'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
-            ['mu6_idperf_FTK',             'L1_MU6',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
-            ['mu24_idperf_FTKRefit',       'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
-            ['mu6_idperf_FTKRefit',        'L1_MU6',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
-            ['mu22_mu8noL1_ftkFS',         'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_ftkFS']]],
-            ['mu26_ivarmedium_ftk',        'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+            ['mu24_idperf_FTK',            'L1_MU20MU21',    ['L1_MU20'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu6_idperf_FTK',             'L1_MU6',                  [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu24_idperf_FTKRefit',       'L1_MU20MU21',    ['L1_MU20'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu6_idperf_FTKRefit',        'L1_MU6',                  [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu22_mu8noL1_FTKFS',         'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_FTKFS']]],
+            ['mu26_ivarmedium_FTK',        'L1_MU20MU21',    ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
             ]
 
     TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [
@@ -227,6 +324,9 @@ def setupMenu():
         ['j60_tc_lcw_nojcalib',     'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j60_tc_lcw_sub',          'L1_J20',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
+        # Moved from Physics menu
+        ['j35_sktc_lcw_nojcalib',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+
 
 
         #####
@@ -367,7 +467,6 @@ def setupMenu():
         ['j45_0eta240_2j45_320eta490_L1J15.0ETA25_2J15.31ETA49', 'L1_J15.0ETA25_2J15.31ETA49',[] , [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'],  -1,['serial',-1,["j45_0eta240","2j45_320eta490_L1J15"]]],
 
         # VBF triggers
-        ['2j40_0eta490_invm250',                'L1_XE35_MJJ-200', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
         ['j80_0eta240_2j60_320eta490_invm700',  'L1_J40.0ETA25_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1 ], #Bjet rate but needs to be in the Jet slice
 
 
@@ -388,13 +487,41 @@ def setupMenu():
 
 
 
-	]
+
+        # Delayed stream dijet invariant mass range plus y* cut triggers, mainly aimed at the dijet trigger-level analysis
+        # See ATR-14091 for details of the request
+        ['j0_0i1c500m900TLA_delayed',       'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
+        ['j0_1i2c200m8000TLA_delayed',      'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
+        ['j0_0i1c500m2000TLA_delayed',      'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
+
+        ['2j250_j140',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j250_j150',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j275_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j220_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j250_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j250_0eta240_j140_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j275_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j275_0eta240_j140_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+
+        # VBF triggers
+        ['2j40_0eta490_invm250_L1XE55',     'L1_XE55', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+
+        # Central+forward (dijet) triggers
+        ['j15_j15_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['j25_j25_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['j45_j45_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+			 ]
 
 
     if TriggerFlags.doFTK():
         TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [
             ['j100_ftk',                   'L1_J25',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
             ['j75_ftk_L1J20',              'L1_J20', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+            #ATR-16749   
+            ['j100_ftkrefit',           'L1_J25',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+            ['3j30_ftk',                'L1_TE10', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+            ['j420_ftk',                'L1_J100', [], [PhysicsStream], ['Rate:SingleJet', 'BW:Jet'], -1],
+
             ] 
 
     TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
@@ -409,6 +536,10 @@ def setupMenu():
         ['j0_perf_bperf_L1J12_EMPTY',  'L1_J12_EMPTY',[], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         # bperf
+        ['j35_bperf',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_bperf',  'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_bperf', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j320_bperf', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j25_bperf', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j45_bperf', 'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j110_bperf', 'L1_J30', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], 
@@ -431,6 +562,10 @@ def setupMenu():
 
 
         # bperf_split
+        ['j35_bperf_split',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_bperf_split',  'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_bperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j320_bperf_split', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j25_bperf_split', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j45_bperf_split', 'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j110_bperf_split', 'L1_J30', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
@@ -462,12 +597,6 @@ def setupMenu():
         ['j35_boffperf_3j35', 'L1_3J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         ['j45_bperf_3j45_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_bperf_3j45_L13J15.0ETA25', 'L1_3J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_bperf_3j45_L13J20', 'L1_3J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_boffperf_3j45_L13J15.0ETA25', 'L1_3J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_boffperf_3j45_L13J20', 'L1_3J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_bperf_split_3j45_L13J15.0ETA25', 'L1_3J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j45_bperf_split_3j45_L13J20', 'L1_3J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         ['j50_bmv2c1040_split_3j50', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
@@ -606,20 +735,12 @@ def setupMenu():
         #
         #   2b + VBF Jets
         #
-        ['2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-400', 'L1_J30_2J20_4J20.0ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-700', 'L1_J30_2J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-800', 'L1_J30_2J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-900', 'L1_J30_2J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-400', 'L1_3J20_4J20.0ETA49_MJJ-400', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-700', 'L1_3J20_4J20.0ETA49_MJJ-700', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-800', 'L1_3J20_4J20.0ETA49_MJJ-800', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-900', 'L1_3J20_4J20.0ETA49_MJJ-900', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         
-        ['2j55_boffperf_split_L1J30_2J20_4J20.0ETA49_MJJ-400', 'L1_J30_2J20_4J20.0ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_boffperf_split_L1J30_2J20_4J20.0ETA49_MJJ-700', 'L1_J30_2J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_boffperf_split_L1J30_2J20_4J20.0ETA49_MJJ-800', 'L1_J30_2J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_boffperf_split_L1J30_2J20_4J20.0ETA49_MJJ-900', 'L1_J30_2J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_boffperf_split_L13J20_4J20.0ETA49_MJJ-400', 'L1_3J20_4J20.0ETA49_MJJ-400', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_boffperf_split_L13J20_4J20.0ETA49_MJJ-700', 'L1_3J20_4J20.0ETA49_MJJ-700', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_boffperf_split_L13J20_4J20.0ETA49_MJJ-800', 'L1_3J20_4J20.0ETA49_MJJ-800', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
@@ -629,14 +750,6 @@ def setupMenu():
 
 
         # L1Topo VBF MJJ bjets
-        ['2j55_bmv2c1085_split_L1J30_2J20_4J20.0ETA49_MJJ-400', 'L1_J30_2J20_4J20.0ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-400', 'L1_J30_2J20_4J20.0ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1085_split_L1J30_2J20_4J20.0ETA49_MJJ-700', 'L1_J30_2J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-700', 'L1_J30_2J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1085_split_L1J30_2J20_4J20.0ETA49_MJJ-800', 'L1_J30_2J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-800', 'L1_J30_2J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1085_split_L1J30_2J20_4J20.0ETA49_MJJ-900', 'L1_J30_2J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-900', 'L1_J30_2J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bmv2c1085_split_L13J20_4J20.0ETA49_MJJ-400', 'L1_3J20_4J20.0ETA49_MJJ-400', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bperf_L13J20_4J20.0ETA49_MJJ-400', 'L1_3J20_4J20.0ETA49_MJJ-400', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bmv2c1085_split_L13J20_4J20.0ETA49_MJJ-700', 'L1_3J20_4J20.0ETA49_MJJ-700', [''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
@@ -649,14 +762,87 @@ def setupMenu():
         ['2j55_bmv2c1077_split_L13J20_4J20.0ETA49_MJJ-700', 'L1_3J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bmv2c1077_split_L13J20_4J20.0ETA49_MJJ-800', 'L1_3J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_bmv2c1077_split_L13J20_4J20.0ETA49_MJJ-900', 'L1_3J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1077_split_L1J30_2J20_4J20.0ETA49_MJJ-400', 'L1_J30_2J20_4J20.0ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1077_split_L1J30_2J20_4J20.0ETA49_MJJ-700', 'L1_J30_2J20_4J20.0ETA49_MJJ-700', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1077_split_L1J30_2J20_4J20.0ETA49_MJJ-800', 'L1_J30_2J20_4J20.0ETA49_MJJ-800', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j55_bmv2c1077_split_L1J30_2J20_4J20.0ETA49_MJJ-900', 'L1_J30_2J20_4J20.0ETA49_MJJ-900', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
       
         
-    ]# BjetSlice
+        ['j25_gsc45_boffperf_split',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_boffperf_split', 'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j60_gsc85_boffperf_split', 'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split', 'L1_J30', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j150_gsc175_boffperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j175_gsc260_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc320_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        # NOTE: gsc400 and higher boffperf chains are candidates for jet primaries
+        # As such, they have been switched to RATE:SingleJet and BW:Jet, and moved to the jet section
+
+        #
+        # tagged 
+        #
+        ['j225_bmv2c1040_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j275_bmv2c1060_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j300_bmv2c1070_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j360_bmv2c1077_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
+        ['j175_gsc225_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc300_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+
+        ['j225_gsc400_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
+
+
+        #
+        #  1b / 3j
+        #
+        ['j55_gsc80_bmv2c1085_split_2j60_320eta490', 'L1_J40.0ETA25_2J15.31ETA49', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j50_gsc65_bmv2c1050_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1060_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1070_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j60_gsc85_bmv2c1070_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j60_gsc85_bmv2c1077_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        
+        # 
+        #  2b / 2j
+        #
+
+        ['j175_bmv2c1060_split_j60_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c1077_split_j45_gsc60_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        #
+        # 2b / 3j
+        #
+
+        ['2j55_gsc75_boffperf_split_j55_gsc75_boffperf_split_L13J40', 'L1_3J40', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j50_gsc70_boffperf_split_j50_gsc70_boffperf_split_L13J40', 'L1_3J40', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['j110_gsc150_boffperf_split_2j35_gsc55_boffperf_split',  'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1050_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1060_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1070_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1077_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['2j55_gsc75_boffperf_split_j55_gsc75_boffperf_split',         'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        #
+        # 2b / 4j
+        #
+        ['2j35_boffperf_split_2j35_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_boffperf_split_2j15_gsc35_boffperf_split_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1050_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1060_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1070_split_2j25_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1077_split_2j35_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1070_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1077_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1077_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1077_split_3j25_gsc45_boffperf_split_L14J15.0ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['3j50_gsc65_bmv2c1070_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j50_gsc65_bmv2c1085_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+
+        ['3j15_gsc35_bmv2c1060_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j15_gsc35_bmv2c1070_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j15_gsc35_bmv2c1077_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+			 ]
 
     if TriggerFlags.doFTK():
         TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
@@ -775,7 +961,29 @@ def setupMenu():
         ['xe100_pueta_wEFMu_L1XE80',        'L1_XE80', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe100_pufit_wEFMu_L1XE80',        'L1_XE80', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-        ]
+#        ['xe0noL1_l2fsperf_trkmht_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+
+   #L1_XE35
+        ['xe35', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe35_tc_lcw', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe35_tc_em', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe35_pufit', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe35_mht', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe35_mht_em', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+
+#Supporting MET triggers
+        ['xe45_pufit_wEFMu',          'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_wEFMu',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_mht_wEFMu',            'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_tc_lcw',               'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_tc_em',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_mht',                  'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45',                      'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_tc_lcw_wEFMu',         'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_tc_em_wEFMu',          'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_pufit',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe45_mht_xe45', 'L1_XE45',['L1_XE45','L1_XE45'], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1, ['serial',-1,['xe45_mht','xe45_L1XE45']]],
+			 ]
 
         
 
@@ -783,7 +991,13 @@ def setupMenu():
         ['tau35_perf_tracktwo_tau25_perf_tracktwo_ditauL', 'L1_TAU20IM_2TAU12IM' , ['L1_TAU20IM','L1_TAU12IM'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
         ['tau35_perf_tracktwo_tau25_perf_tracktwo_ditauT', 'L1_TAU20IM_2TAU12IM' , ['L1_TAU20IM','L1_TAU12IM'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
                                                                        
-                                                                             
+        # Tracktwomva
+        ['tau25_tight1_tracktwomva',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_tracktwomva',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_loose1_tracktwomva',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_tracktwomva',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_idperf_tracktwomva',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+
         ['tau25_idperf_tracktwo2015',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_perf_tracktwo2015',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_medium1_tracktwo2015',                        'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
@@ -862,24 +1076,30 @@ def setupMenu():
         ['tau160_perf_track',                      'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau80_medium1_track',                    'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau125_medium1_track',                   'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        # Run-II - No BDT: variations
+        ['tau25_perf_ptonly',                      'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_perf_ptonly_L1TAU12',              'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        # Run-II - With BDT: main track-based items
+        ['tau25_medium1_track',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        # Run-II - With BDT: main calo-based items
+        # Run-II - With BDT: pt only
+        ['tau25_loose1_ptonly',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_medium1_ptonly',                   'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_tight1_ptonly',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_singlepiontight_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+
+        #tau+photon (ATR-13061)
+        ['tau35_dikaonmasstight_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_dikaonmass_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_dikaonmasstight_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_dipion1loose_tracktwo_L1TAU12',  'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_dipion2_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_kaonpi1_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau35_kaonpi2_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
 			 ]
 
     if TriggerFlags.doFTK():
             TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
-                ['tau12_idperf_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_perf_FTK',                'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_perf0_FTK',               'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_perf_FTKNoPrec',          'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_perf0_FTKNoPrec',         'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_medium0_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_medium1_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_medium0_FTKNoPrec',       'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau12_medium1_FTKNoPrec',       'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-
-                # standard single tau chains seeded from L1 FTK tau seeds for monitoring in CPS
-                ['tau25_idperf_tracktwo_L1TAU12IM_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau25_perf_tracktwo_L1TAU12IM_FTK',                'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-                ['tau25_medium1_tracktwo_L1TAU12IM_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
                 
                 ['tau20_medium0_FTK_tau12_medium0_FTK_03dR30_L1DR-TAU20ITAU12I-J25_FTK', 'L1_DR-TAU20ITAU12I-J25_FTK' , ['L1_TAU20IM_FTK','L1_TAU12IM_FTK'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
                 ['tau20_medium1_FTK_tau12_medium1_FTK_03dR30_L1DR-TAU20ITAU12I-J25_FTK', 'L1_DR-TAU20ITAU12I-J25_FTK' , ['L1_TAU20IM_FTK','L1_TAU12IM_FTK'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
@@ -917,6 +1137,10 @@ def setupMenu():
         ['e24_lhtight_nod0_ivarloose_L1EM20VH',        'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e24_lhtight_cutd0dphideta_iloose_L1EM20VH',  'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
+        ['e35_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
+        ['e40_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
+        ['e50_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+
 #        ['e26_lhtight_nod0_ringer_ivarloose',  'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         
         # topocone isolation
@@ -993,8 +1217,6 @@ def setupMenu():
         ['e20_mergedtight_g35_medium',           'L1_2EM15VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
 
         ['e20_mergedtight',                      'L1_EM15VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
-        ['e25_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
-        ['e30_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
 
 
         # Fall-back if problem with new tracking kept as before)
@@ -1026,22 +1248,105 @@ def setupMenu():
         ['e18_etcut_L1EM15_W-MT35',             'L1_EM15_W-MT35',             ['L1_EM15'], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e18_etcut_trkcut', 'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE', ['L1_EM15'], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
 
-        # L1Topo JPSI prescaled performance:
-        ['e5_lhtight_nod0_e4_etcut_L1JPSI-1M5',              'L1_JPSI-1M5',      ['L1_EM3','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
-        ['e5_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5',       'L1_JPSI-1M5',      ['L1_EM3','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
-        ['e9_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM7','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
-        ['e5_lhtight_nod0_e9_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM3','L1_EM7'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True], 
-        ['e14_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM12','L1_EM3'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
-        ['e5_lhtight_nod0_e14_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM3','L1_EM12'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
 
-        ]
+        ['g0_hiptrt_L1EM20VH',                  'L1_EM20VH',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g0_hiptrt_L1EM20VHI',                 'L1_EM20VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g20_tight',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+
+        # Di-photon triggers
+        ['g35_loose_L1EM15_g25_loose_L1EM15',       'L1_2EM15', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g20_tight',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g20_tight_L12EM15VHI',                   'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+
+        # Tri-photon triggers
+        ['2g20_loose_g15_loose',                    'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+ 
+        ['e5_lhloose',                          'L1_EM3',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhtight_L1EM20VH',                 'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+
+        ['e26_lhtight_nod0_ringer_ivarloose',  'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_nod0_ringer_ivarloose_L1EM22VHIM',  'L1_EM22VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ringer_ivarloose', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ringer_ivarloose_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e60_medium',                           'L1_EM22VHI',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_medium_L1EM24VHI',               	 'L1_EM24VHI',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e120_lhloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e80_medium',                     'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_medium_L1EM24VHI',           'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        # Rerun mode
+        ['e4_etcut',                             'L1_EM3',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e9_etcut',                             'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e14_etcut',                            'L1_EM12',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e17_lhmedium_nod0_iloose',                  'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhloose_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+#        ['e26_lhmedium_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhmedium_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+#        ['e26_lhtight_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+	
+
+        # support for g+tau chains (ATR-13841)
+        ['g35_medium_L1EM22VHI',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g35_medium_L1EM24VHI',                    'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+
+#Rerun:         
+#Physics (tri-ele):
+        ['e17_lhloose_nod0_2e9_lhloose_nod0',         'L1_EM15VH_3EM7', ['L1_EM15VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
+        ['e17_lhmedium_nod0_2e9_lhmedium_nod0',       'L1_EM15VH_3EM7', ['L1_EM15VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
+        ['e20_lhmedium_nod0_2g10_loose',           'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
+        ['e20_lhmedium_nod0_2g10_medium',          'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
+
+        #ATR-15259
+        ['e25_mergedtight_g35_medium',           'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e30_mergedtight_g35_medium',           'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['2g22_tight_L1EM7_UNPAIRED_NONISO',        'L1_EM7_UNPAIRED_NONISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
+        ['2g50_tight_L1EM7_UNPAIRED_NONISO',        'L1_EM7_UNPAIRED_NONISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
+
+        # L1Topo W T&P 
+        ['e13_etcut_trkcut_L1EM12', 'L1_EM12', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
+        
+     
+        # ATR-12916, Egamma Trigger Menu 2016   
+
+        ['e24_lhmedium_ivarloose_L1EM20VH',      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_ivarloose_L1EM20VH', 'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_cutd0dphideta_ivarloose', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        
+        ['e60_medium_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_medium_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['2e17_lhvloose_nod0_ringer_L12EM15VHI',        'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['2e17_lhvloose_nod0_ringer',          'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
+        ['2e19_lhvloose_nod0_ringer',        'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e17_lhvloose_nod0_ringer_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e17_lhvloose_nod0_ringer',           'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e19_lhvloose_nod0_ringer',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e26_lhmedium_nod0_ringer_ivarmedium_icalomedium',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e28_lhmedium_nod0_ringer_ivarmedium_icalomedium',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e60_lhmedium_nod0_ringer',           'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_ringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e140_lhloose_nod0_ringer',           'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_ringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e30_mergedtight_ivarloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['e26_lhtight_nod0_ivarloose_e15_etcut_L1EM7_Zee',    	  'L1_EM22VHI', ['L1_EM22VHI','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
+        ['e28_lhtight_nod0_ivarloose_e15_etcut_L1EM7_Zee',    	  'L1_EM24VHI', ['L1_EM24VHI','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_e15_etcut_L1EM7_Zee', 'L1_EM22VHIM',  ['L1_EM22VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_e15_etcut_L1EM7_Zee', 'L1_EM24VHIM',  ['L1_EM24VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+			 ]
 
 
     ###########################################################################################################
     #   Bphysics
     ###########################################################################################################
     TriggerFlags.BphysicsSlice.signatures = TriggerFlags.BphysicsSlice.signatures() + [
-
+	
         #['2mu6_bMuMu_L12MU6', 'L1_2MU6', [], [PhysicsStream], [], -1], 
 
         ['2mu4_bBmumu_noL2',    'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
@@ -1070,12 +1375,12 @@ def setupMenu():
         ['3mu4_mu2noL1_bNocut', 'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu2noL1']]],
         ['3mu4_mu4noL1_bNocut', 'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu4noL1']]],
 
-        ['mu20_2mu2noL1_bNocut', 'L1_MU20MU21',     ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
+        ['mu20_2mu2noL1_bNocut', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
 
         
-        ['mu20_2mu2noL1_bDimu', 'L1_MU20MU21',     ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
-        ['mu20_2mu2noL1_bDimu2700', 'L1_MU20MU21',     ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
-        ['mu20_2mu2noL1_bTau', 'L1_MU20MU21',     ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
+        ['mu20_2mu2noL1_bDimu', 'L1_MU20MU21', ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
+        ['mu20_2mu2noL1_bDimu2700', 'L1_MU20MU21', ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
+        ['mu20_2mu2noL1_bTau', 'L1_MU20MU21', ['L1_MU20',''], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_bNocut']]],
 
         # chains with EF B-physics selection skipped
         ['2mu4_bJpsimumu_noEFbph',                    'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
@@ -1116,9 +1421,9 @@ def setupMenu():
         ['2mu6_mu4_bDimu', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
         
         # chains for Bs->mumuPhi and Bs->J/psiPhi 
-        ['mu6_mu4_bBmumux_BsJpsiPhi_delayed',                    'L1_MU6_2MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-        ['2mu6_bBmumux_BsJpsiPhi_delayed',                    'L1_2MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-        ['mu10_mu6_bBmumux_BsJpsiPhi_delayed',            'L1_MU10_2MU6', ['L1_MU10','L1_MU6'],[BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu6_mu4_bBmumux_BsJpsiPhi',                    'L1_MU6_2MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['2mu6_bBmumux_BsJpsiPhi',                    'L1_2MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu10_mu6_bBmumux_BsJpsiPhi',            'L1_MU10_2MU6', ['L1_MU10','L1_MU6'],[BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
 
 
         # Narrow-scan chains seeded L1_MU11_2MU6
@@ -1131,30 +1436,14 @@ def setupMenu():
         ['2mu6_bDimu_novtx_noos_L1BPH-8M15-2MU6_BPH-0DR22-2MU6',     'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['2mu6_bDimu_noL2_L1BPH-8M15-2MU6_BPH-0DR22-2MU6',     'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['2mu6_bDimu_novtx_noos_noL2_L1BPH-8M15-2MU6_BPH-0DR22-2MU6',     'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-         ['2mu4_bDimu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_L1BPH-7M15-2MU4_BPH-0DR24-2MU4',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bUpsimumu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4', 'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-           ['2mu4_bDimu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bUpsimumu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-B', 'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-           ['2mu4_bDimu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bDimu_novtx_noos_noL2_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['2mu4_bUpsimumu_L1BPH-7M15-2MU4_BPH-0DR24-2MU4-BO', 'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO',     ['L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['mu6_mu4_bDimu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['mu6_mu4_bDimu_novtx_noos_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['mu6_mu4_bDimu_noL2_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['mu6_mu4_bDimu_novtx_noos_noL2_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
 
 
-
-        ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
-        ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+          
+        ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False], 
 
 
         ['2mu4_bBmumuxv2',                'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
@@ -1283,7 +1572,7 @@ def setupMenu():
         ['2mu6_bBmumux_BcmumuDsloose_noL2_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',  'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         
        
-       ['2mu6_bTau_L1LFV-MU6_delayed',  'L1_LFV-MU6', ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+       ['2mu6_bTau_L1LFV-MU6',  'L1_LFV-MU6', ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
        ['2mu6_bPhi_L1LFV-MU6',  'L1_LFV-MU6', ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
 
        ### ATR-15263
@@ -1313,6 +1602,36 @@ def setupMenu():
         # backup 95% bckg rejection WP (for Upsilon only)        
         ['2mu6_bDimu_noL2_L1BPH-8M15-2MU6',     'L1_BPH-8M15-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
         ['2mu6_bDimu_novtx_noos_noL2_L1BPH-8M15-2MU6',     'L1_BPH-8M15-2MU6',     ['L1_2MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
+		
+        ['mu4_iloose_mu4_11invm60_noos', 'L1_2MU4', [], [PhysicsStream], [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_7invm9_noos',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_iloose_mu6_11invm24_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_iloose_mu6_24invm60_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+
+        ### ATR-14543
+        ['mu4_ivarloose_mu4_11invm60_noos', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_7invm9_noos',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_ivarloose_mu6_11invm24_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_ivarloose_mu6_24invm60_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+
+        ['mu4_iloose_mu4_11invm60_noos_novtx', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_7invm9_noos_novtx',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_iloose_mu6_11invm24_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_iloose_mu6_24invm60_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+
+        ### ATR-14543
+        ['mu4_ivarloose_mu4_11invm60_noos_novtx', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_7invm9_noos_novtx',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_ivarloose_mu6_11invm24_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_ivarloose_mu6_24invm60_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_11invm60_noos_L1MU6_2MU4',    'L1_MU6_2MU4',    ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_7invm9_noos_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_11invm60_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_iloose_mu4_7invm9_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_11invm60_noos_L1MU6_2MU4',    'L1_MU6_2MU4',    ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_7invm9_noos_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_11invm60_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu4_ivarloose_mu4_7invm9_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
 			 ]
 
     if TriggerFlags.doFTK():
@@ -1389,9 +1708,6 @@ def setupMenu():
  
         # cut-based version of the following triggers staying in MC menu. The LH-based version kept in Physics menu. (ATR-14059)
 
-        # 3 lepton ATR-15246
-        ['e17_lhvloose_nod0_e10_lhvloose_mu6',  'L1_EM15VH_2EM8VH_MU6',['L1_EM15VH','L1_2EM8VH','L1_MU6'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
-
         # photon+tri-jet trigger
 
         ['g45_tight_3j50noL1', 'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g45_tight","3j50noL1"]]],
@@ -1431,9 +1747,6 @@ def setupMenu():
 
         # jet+xe alternative triggers
         ['j80_xe100',               'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j80","xe100"]]],        
-        ['j120_xe80',               'L1_J75_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j120","xe80"]]],        
-        ['j150_xe80',               'L1_J75_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j150","xe80"]]],        
-        ['j150_xe80_tc_lcw',        'L1_J75_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j150","xe80_tc_lcw"]]],        
         ['j40_cleanT_xe75_L1XE60',    'L1_XE60', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe75_L1XE60"]]],
         ['j30_0eta490_cleanT_xe80_L1XE60',    'L1_XE60', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j30_0eta490_cleanT","xe80_L1XE60"]]],
         ['j30_0eta490_cleanT_xe100_tc_lcw_L1XE70', 'L1_XE70', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j30_0eta490_cleanT","xe100_tc_lcw_L1XE70"]]],
@@ -1522,6 +1835,7 @@ def setupMenu():
         ['g35_medium_L1EM24VHI_tau35_kaonpi1_tracktwo_L1TAU12',     'L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["g35_medium_L1EM24VHI","tau35_kaonpi1_tracktwo_L1TAU12"]]],
         ['g35_medium_L1EM24VHI_tau25_kaonpi2_tracktwo_L1TAU12',     'L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["g35_medium_L1EM24VHI","tau25_kaonpi2_tracktwo_L1TAU12"]]],
         ['g35_medium_L1EM24VHI_tau35_kaonpi2_tracktwo_L1TAU12',     'L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["g35_medium_L1EM24VHI","tau35_kaonpi2_tracktwo_L1TAU12"]]],        
+
         # photon+pion (ATR-13525)
         ['g35_medium_tau25_singlepion_tracktwo_L1TAU12',     'L1_EM22VHI', ['L1_EM22VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["g35_medium","tau25_singlepion_tracktwo_L1TAU12"]]],
         ['g35_medium_tau25_singlepiontight_tracktwo_L1TAU12',     'L1_EM22VHI', ['L1_EM22VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["g35_medium","tau25_singlepiontight_tracktwo_L1TAU12"]]],
@@ -1647,7 +1961,6 @@ def setupMenu():
         ['mu4_j15_dr05', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15'] ]],
         ['mu4_j35_dr05', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j35'] ]],
  
-        ['mu4_j55_dr05',  'L1_MU4_J12', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j55'] ]], 
         ['mu6_j85_dr05',  'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j85'] ]], 
         ['mu6_j110_dr05', 'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110'] ]],
         ['mu6_j150_dr05', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j150'] ]],
@@ -1658,13 +1971,26 @@ def setupMenu():
 
 
         # Extra calibration items seeded from L1Topo
-        ['mu4_j55_bperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j55_bperf_split'] ], False],
-        ['mu6_j110_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110_bperf_split'] ], False],
-        ['mu6_j150_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j150_bperf_split'] ], False],
-        ['mu6_j175_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j175_bperf_split'] ], False],
-        ['mu6_j260_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j260_bperf_split'] ], False],
-        ['mu6_j320_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j320_bperf_split'] ], False],
-        ['mu6_j400_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j400_bperf_split'] ], False],
+        ['mu4_j55_boffperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j55_boffperf_split'] ], False],
+        ['mu6_j110_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110_boffperf_split'] ], False],
+        ['mu6_j150_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j150_boffperf_split'] ], False],
+        ['mu6_j175_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j175_boffperf_split'] ], False],
+        ['mu6_j260_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j260_boffperf_split'] ], False],
+        ['mu6_j320_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j320_boffperf_split'] ], False],
+        ['mu6_j400_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j400_boffperf_split'] ], False],
+
+        #Calibration moved from physics
+        ['2mu14_2j35_bperf',                 'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['2mu14', '2j35_bperf']]],
+        ['2e24_lhvloose_nod0_2j35_bperf',                  'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_bperf']]],
+        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_bperf',    'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:BJet'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_bperf'] ]],
+        ['mu26_ivarmedium_j150_bperf_j35_bperf',     'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_bperf','j35_bperf']]],
+        ['mu26_ivarmedium_2j35_bperf',                'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', '2j35_bperf']]],
+        ['e28_lhtight_nod0_ivarloose_j150_bperf_j35_bperf',                                 'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_bperf','j35_bperf']]],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_bperf',                       'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_bperf']]],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_bperf_split',                 'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_bperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_bperf',                       'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_bperf']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_bperf_split',                 'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_bperf_split']]],
+
 
         # Jet + MET
         ['j40_cleanT_xe80_L1XE50',    'L1_XE50', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe80_L1XE50"]]],
@@ -1752,38 +2078,19 @@ def setupMenu():
 	
 
         #ATR-15243
-        ['mu4_j100_xe60_mht_L1MU4_J20_XE30_DPHI-J20s2XE30',  'L1_MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j100","xe60_mht"] ]],
-
-        ['mu4_xe60_mht_L1MU4_J20_XE30_DPHI-J20s2XE30',  'L1_MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","xe60_mht"] ]],
 
         ['2mu4_xe40_mht_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4","xe40_mht"] ]],
 
-        ['e5_lhmedium_nod0_mu4_xe40_mht_L1MU4_J20_XE30_DPHI-J20s2XE30',  'L1_MU4_J20_XE30_DPHI-J20s2XE30', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","xe40_mht"] ]],
-
         ['2e5_lhmedium_nod0_j50_xe80_mht_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j50","xe80_mht"] ]],
 
-        ['e5_lhmedium_nod0_mu4_xe40_mht_L1MU4_2EM3_J20_XE30_DPHI-J20s2XE30',  'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","xe40_mht"] ]],
-
-        ['2e5_lhmedium_nod0_j50_xe80_mht_L13EM3_J40_XE50_DPHI-J20s2XE50',  'L1_3EM3_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j50","xe80_mht"] ]],
 
         ['e5_lhmedium_nod0',  'L1_EM3', ['L1_EM3','',''], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
        
-        ['2mu4_j85_xe50_pufit',  'L1_2MU4_J40_XE20', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4","j85","xe50_pufit"] ]], 
-
 
         # L1Topo VBF 
         ['g15_loose_2j40_0eta490_3j25_0eta490', 'L1_MJJ-400', ['L1_EM12','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g15_loose","2j40_0eta490","3j25_0eta490"]]],
-        ['g20_loose_2j40_0eta490_3j25_0eta490_L1MJJ-700', 'L1_MJJ-700', ['L1_EM15VH','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g20_loose","2j40_0eta490","3j25_0eta490"]]],
         ['g20_loose_2j40_0eta490_3j25_0eta490', 'L1_MJJ-800', ['L1_EM15VH','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g20_loose","2j40_0eta490","3j25_0eta490"]]],
-        ['g20_loose_2j40_0eta490_3j25_0eta490_L1MJJ-900', 'L1_MJJ-900', ['L1_EM15VH','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g20_loose","2j40_0eta490","3j25_0eta490"]]],
         ['mu6_2j40_0eta490_invm400', 'L1_MU6_MJJ-200', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon'], -1, ['serial',-1,["mu6","2j40_0eta490_invm400"]]],
-        ['mu6_2j40_0eta490_invm600', 'L1_MU6_MJJ-300', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon'], -1, ['serial',-1,["mu6","2j40_0eta490_invm600"]]],
-        ['mu6_2j40_0eta490_invm800', 'L1_MU6_MJJ-400', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon'], -1, ['serial',-1,["mu6","2j40_0eta490_invm800"]]],
-        ['mu6_2j40_0eta490_invm1000', 'L1_MU6_MJJ-500', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon'], -1, ['serial',-1,["mu6","2j40_0eta490_invm1000"]]],
-
-        # L1Topo BTAG Single mu-jet items
-        ['mu6_j60_dr05_L1BTAG-MU6J25', 'L1_BTAG-MU6J25', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet', 'BW:Muon'], -1,['serial',-1,['mu6', 'j60'] ], False],
-        ['mu4_j70_dr05_L1BTAG-MU4J30', 'L1_BTAG-MU4J30', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet', 'BW:Muon'], -1,['serial',-1,['mu4', 'j70'] ], False],
         
         # Asymmetric items
         ['mu6_j50_dr05_2j35_L13J15_BTAG-MU6J25', 'L1_3J15_BTAG-MU6J25', ['L1_MU6', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j50', '2j35'] ], False],
@@ -1818,24 +2125,170 @@ def setupMenu():
         # Tau + Muon
         ['mu14_tau25_medium1_tracktwo',      'L1_MU10_TAU12IM_J25_2J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14","tau25_medium1_tracktwo"]]],     
         ['mu14_tau35_medium1_tracktwo',  'L1_MU10_TAU20IM',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14","tau35_medium1_tracktwo"]]],
+
+        # ATR-15226
+        ## ATR-14355: L1Topo bjet/HT items
+        
+        #
+        # b + ht
+        #
+
+        # 4J20
+        ['j35_gsc55_boffperf_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_boffperf_split']]],
+        ['j35_gsc55_bmv2c1040_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_bmv2c1040_split']]],
+        ['j35_gsc55_bmv2c1050_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_bmv2c1050_split']]],
+        ['j55_gsc75_bmv2c1040_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht500_L14J20','j55_gsc75_bmv2c1040_split']]],
+        ['j55_gsc75_bmv2c1050_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht500_L14J20','j55_gsc75_bmv2c1050_split']]],
+
+        ['j35_gsc55_bmv2c1050_split_ht700_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht700_L14J20','j35_gsc55_bmv2c1050_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht700_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht700_L14J20','j35_gsc55_bmv2c1060_split']]],
+
+
+        #
+        # 2b +ht
+        #
+        ['2j55_boffperf_split_ht300_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j55_boffperf_split']]],
+        ['2j35_gsc55_boffperf_split_ht300_L14J20',  'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_boffperf_split']]],
+        ['2j35_gsc55_bmv2c1040_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1040_split']]],
+        ['2j35_gsc55_bmv2c1050_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1050_split']]],
+        ['2j35_gsc55_bmv2c1060_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1060_split']]],
+        ['2j35_gsc55_bmv2c1070_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1070_split']]],
+        ['j60_gsc100_bmv2c1060_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['xe80_mht_L1XE60','j60_gsc100_bmv2c1060_split']]],
+        ['2j45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['xe80_mht','2j45_bmv2c1070_split']]],
+
+        ['e24_lhmedium_nod0_L1EM20VHI_mu8noL1', 'L1_EM20VHI', ['L1_EM20VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e24_lhmedium_nod0_L1EM20VHI','mu8noL1'] ]],
+
+        ['e60_lhloose_nod0_xe60noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e60_lhloose_nod0","xe60noL1"]]],
+        ['e60_lhloose_nod0_L1EM24VHIM_xe60noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e60_lhloose_nod0_L1EM24VHIM","xe60noL1"]]],
+
+        ['g40_tight_xe40noL1',           'L1_EM20VH',  ['L1_EM20VH',''],  [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g40_tight","xe40noL1"]]],
+        ['g45_tight_xe45noL1',           'L1_EM20VH',  ['L1_EM20VH',''],  [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight","xe45noL1"]]],
+        ['g60_loose_xe60noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g60_loose","xe60noL1"]]],
+        ['g70_loose_xe70noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose","xe70noL1"]]],
+        ['g60_loose_L1EM24VHI_xe60noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g60_loose_L1EM24VHI","xe60noL1"]]],
+        ['g70_loose_L1EM24VHI_xe70noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose_L1EM24VHI","xe70noL1"]]],
+        ['g70_loose_L1EM24VHIM_xe70noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose_L1EM24VHIM","xe70noL1"]]],
+
+        ['g40_tight_icalovloose_xe40noL1', 	        'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g40_tight_icalovloose","xe40noL1"]]],
+        ['g45_tight_icalovloose_xe40noL1',           'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose","xe40noL1"]]],
+        ['g45_tight_icalovloose_xe45noL1', 	        'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose","xe45noL1"]]],
+
+        ['j100_xe80',                    'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j100","xe80"]]],
+        
+
+	# ATR-14717
+        ['j50_xe80_pufit_2dphi10_L1XE60',  'L1_XE60', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j50","xe80_pufit_L1XE60"] ]],
+        ['j70_xe100_pufit_2dphi10_L1XE60',  'L1_XE60', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j70","xe100_pufit_L1XE60"] ]],
+
+        # Wgg triggers
+
+        ['e20_lhmedium_2g10_loose',  'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e20_lhmedium_2g10_medium', 'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['j30_muvtx_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+
+        ['j30_jes_cleanLLP_PS_llp_L1TAU8_EMPTY',        'L1_TAU8_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_L1TAU8_UNPAIRED_ISO', 'L1_TAU8_UNPAIRED_ISO', [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_L1TAU8_UNPAIRED_NONISO', 'L1_TAU8_UNPAIRED_NONISO', [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_EMPTY',        'L1_TAU8_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_UNPAIRED_ISO',        'L1_TAU8_UNPAIRED_ISO',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_UNPAIRED_NONISO',     'L1_TAU8_UNPAIRED_NONISO',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_muvtx_noiso_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+        ['g15_loose_2mu10_msonly_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO',['L1_EM8VH','L1_2MU10'], ["Late"], ['RATE:EgammaMuon', 'BW:Egamma','BW:Muon'],-1,['parallel',-1,[] ]],
+
+
+        # Electron + Muon
+        ['g10_etcut_L1EM8I_mu10_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_etcut_L1EM8I","mu10"]] ],
+        ['g20_etcut_L1EM15_mu4_iloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_etcut_L1EM15","mu4_iloose"]] ],
+
+        ### ATR-14543
+        ['g10_loose_L1EM8I_mu10_ivarloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_loose_L1EM8I","mu10_ivarloose"]] ],
+        ['g20_loose_L1EM15_mu4_ivarloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_loose_L1EM15","mu4_ivarloose"]] ],
+        ['g10_etcut_L1EM8I_mu10_ivarloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_etcut_L1EM8I","mu10_ivarloose"]] ],
+        ['g20_etcut_L1EM15_mu4_ivarloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_etcut_L1EM15","mu4_ivarloose"]] ],
+
+        # HLT photon and di-muon chains
+        ['g35_loose_L1EM22VHI_mu18noL1',        'L1_EM22VHI', ['L1_EM22VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM22VHI','mu18noL1'] ]],
+        ['g35_loose_L1EM22VHI_mu15noL1_mu2noL1', 'L1_EM22VHI', ['L1_EM22VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM22VHI','mu15noL1','mu2noL1']]],
+        # alternative HLT photon and di-muon chains with L1EM24VHI seed
+        ['g35_loose_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu18noL1'] ]],
+        ['g35_loose_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu18noL1'] ]],
+        ['g35_loose_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu15noL1','mu2noL1']]],
+        ['g35_loose_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu15noL1','mu2noL1']]],
+ 
+
+
+	# COMBINED TAU CHAINS
+
+	# e+tau
+        #new ones   
+	                                                                                                                     
+	['e17_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo_L1EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15',   'L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15',['L1_EM15VHI','L1_TAU20IM'], [PhysicsStream],['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau35_medium1_tracktwo"]]],
+
+	# support for l1topo chains
+        ['e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM',  'L1_EM15VHI_2TAU12IM',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_iloose","tau25_medium1_tracktwo"]]],
+        ### ATR-14543
+        ['mu14_ivarloose_tau25_perf_tracktwo', 'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_perf_tracktwo"]]],
+
+        ['mu14_iloose_tau25_medium1_tracktwo',      'L1_MU10_TAU12IM_J25_2J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],        
+        ['mu14_iloose_tau35_medium1_tracktwo',  'L1_MU10_TAU20IM',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau35_medium1_tracktwo"]]],
+
+        #mu+tau chains seeded by L1MU10TAU20IM, needed as supporting triggers for the primary chains with either L1 jet or L1topo
+        ['mu14_iloose_tau25_medium1_tracktwo_L1MU10_TAU12IM',  'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],
+        
+        # Ditau + MET
+        ['mu14_iloose_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14_iloose", "tau25_medium1_tracktwo","xe50"]]],        
+        ['e24_lhvloose_nod0_L1EM20VH_3j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","3j20noL1"] ]],
+        ['e24_lhvloose_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","4j20noL1"] ]],
+        ['e24_lhvloose_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","5j15noL1"] ]],
+        ['e24_lhvloose_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","6j15noL1"] ]],
+        ['e24_lhmedium_nod0_L1EM20VH_3j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","3j20noL1"] ]],
+        ['e24_lhmedium_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","4j20noL1"] ]],
+        ['e24_lhmedium_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","5j15noL1"] ]],
+        ['e24_lhmedium_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","6j15noL1"] ]],
+#        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', 'j35_0eta490_bmv2c1077','3j35_0eta490_invm700']]],
+#        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490_bmv2c1077','2j35_0eta490']]],
+        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI','3j35_0eta490_invm700','j35_0eta490_bmv2c1077']]],
+        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490','2j35_0eta490_bmv2c1077']]],
+
+	# Hbb VBF trigger (ATR-13526)
+        ['j80_0eta240_j60_j45_320eta490_invm700_AND_j45_bmv2c1070_split_j45_bmv2c1077_split','L1_J40.0ETA25_2J25_J20.31ETA49', ['','','','',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j80_0eta240','j60','j45_320eta490_invm700_AND','j45_bmv2c1070_split','j45_bmv2c1077_split'] ]],
+        ['j55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','j55_bmv2c1070_split'] ]],
+
+
+        ['g75_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g75_tight_L1EM22VHI","3j50noL1"]]],
+
+
+
+
+
+#        ['j80_bmv2c1060_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["j80_bmv2c1060_split","xe60"]]], 
+     #ATR-14196
+#     	['j80_bmv2c1050_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["j80_bmv2c1050_split","xe60"]]],
+#      	['j80_bmv2c1077_split_xe70_L1J400ETA25_XE50','L1_J40.0ETA25_XE50',  ['L1_J40.0ETA25','XE50'],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["j80_bmv2c1077_split","xe70_L1J400ETA25_XE50"]]],
+
+        ['j80_bmv2c1060_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["xe60","j80_bmv2c1060_split"]]],
+        ['j80_bmv2c1077_split_xe70_L1J400ETA25_XE50','L1_J40.0ETA25_XE50',  ['L1_J40.0ETA25','XE50'],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["xe70_L1J400ETA25_XE50","j80_bmv2c1077_split"]]],
+
+
+        # MET+jet chains with cleaning
+        ['j40_cleanT_xe80_L1XE60',    'L1_XE60', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe80_L1XE60"]]],
+
+        # muon plus multijets
+        ['mu14_iloose_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14_iloose', '3j20'] ],True],
+
+        ['j30_muvtx_L1MU4_EMPTY',        'L1_MU4_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+        ['j30_muvtx_noiso_L1MU4_EMPTY',        'L1_MU4_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+        ['e26_lhmedium_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e26_lhmedium","5j30_0eta240"] ]],
+        ['e24_lhmedium_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e24_lhmedium","5j30_0eta240"] ]],
+
+        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU11',    'L1_EM7_MU11',  ['L1_MU11','','L1_EM7'],   [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
 			 ]
 
-    if TriggerFlags.doFTK():
-            TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
-        # muon +tau FTK chains for T&P performance measurement
-        ['mu26_ivarmedium_tau12_idperf_FTK',             'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_idperf_FTK"]]],
-        ['mu26_ivarmedium_tau12_perf0_FTK',              'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf0_FTK"]]],
-        ['mu26_ivarmedium_tau12_perf_FTK',               'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf_FTK"]]],
-        ['mu26_ivarmedium_tau12_medium0_FTK',            'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium0_FTK"]]],
-        ['mu26_ivarmedium_tau12_medium1_FTK',            'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium1_FTK"]]],
-        ['mu26_ivarmedium_tau12_perf0_FTKNoPrec',        'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf0_FTKNoPrec"]]],
-        ['mu26_ivarmedium_tau12_perf_FTKNoPrec',         'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf_FTKNoPrec"]]],
-        ['mu26_ivarmedium_tau12_medium0_FTKNoPrec',      'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium0_FTKNoPrec"]]],
-        ['mu26_ivarmedium_tau12_medium1_FTKNoPrec',      'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium1_FTKNoPrec"]]],
-        ['mu26_ivarmedium_tau25_idperf_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',    'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_idperf_tracktwo_L1TAU12IM_FTK"]]],
-        ['mu26_ivarmedium_tau25_perf_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',          'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_perf_tracktwo_L1TAU12IM_FTK"]]],
-        ['mu26_ivarmedium_tau25_medium1_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',       'L1_MU21_TAU12IM_FTK',['L1_MU21','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_medium1_tracktwo_L1TAU12IM_FTK"]]],
-                         ]
+
+
+
+
 
     TriggerFlags.MinBiasSlice.signatures = TriggerFlags.MinBiasSlice.signatures() + [
         #HMT
@@ -1855,10 +2308,10 @@ def setupMenu():
 
     if TriggerFlags.doFTK():
         TriggerFlags.BeamspotSlice.signatures = TriggerFlags.BeamspotSlice.signatures() + [                                                                 
-            ['beamspot_idperf_FTK',          'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
-            ['beamspot_trkFS_FTK',           'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
-            ['beamspot_trkFS_FTKRefit', 'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
-            ['beamspot_idperf_FTKRefit', 'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],       
+            ['beamspot_idperf_FTK',          'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+            ['beamspot_trkFS_FTK',           'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+            ['beamspot_trkFS_FTKRefit', 'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+            ['beamspot_idperf_FTKRefit', 'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
             ]
 
     ## The following slices are only needed for Physics runnings and LS1 menus
@@ -1881,7 +2334,6 @@ def setupMenu():
         ['noalg_L1TAU20IM_2TAU12IM_J25_2J20_3J12', 'L1_TAU20IM_2TAU12IM_J25_2J20_3J12', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1EM15VHI_2TAU12IM_XE35',           'L1_EM15VHI_2TAU12IM_XE35',           [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1MU10_TAU12IM_XE35',              'L1_MU10_TAU12IM_XE35',              [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
-        ['noalg_L1TAU20_2TAU12_XE35',              'L1_TAU20_2TAU12_XE35',              [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1TAU20IM_2TAU12IM_XE35',          'L1_TAU20IM_2TAU12IM_XE35',          [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1EM15VHI_2TAU12IM',                'L1_EM15VHI_2TAU12IM',                [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1EM15VHI_2TAU12IM_J25_3J12',       'L1_EM15VHI_2TAU12IM_J25_3J12',       [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
@@ -1993,6 +2445,8 @@ ps_calibmon_list=[
     'idcalib_trk29_fwd',
     'idcalib_trk9_central',
     'idcalib_trk9_fwd',
+#    'idcalib_trk9_central_L1MBTS_1_VTE70',
+#    'idcalib_trk9_fwd_L1MBTS_1_VTE70',
     'j40_L1ZB',
     'j0_perf_ds1_L1All',
     'l1calocalib',
@@ -2036,6 +2490,7 @@ ps_calibmon_list=[
     'lumipeb_L1MBTS_1_UNPAIRED_ISO',
     'lumipeb_L1MBTS_2',
     'lumipeb_L1MBTS_2_UNPAIRED_ISO',
+    'lumipeb_L1MBTS_2_LUCID',
     'lumipeb_vdm_L1MBTS_1',
     'lumipeb_vdm_L1MBTS_1_BGRP11',
     'lumipeb_vdm_L1MBTS_1_BGRP9',
@@ -2044,6 +2499,10 @@ ps_calibmon_list=[
     'lumipeb_vdm_L1MBTS_2_BGRP11',
     'lumipeb_vdm_L1MBTS_2_BGRP9',
     'lumipeb_vdm_L1MBTS_2_UNPAIRED_ISO',
+    'lumipeb_vdm_L1MBTS_2_LUCID',
+    'lumipeb_vdm_L1MBTS_2_LUCID_BGRP11',
+    'lumipeb_vdm_L1MBTS_2_LUCID_BGRP9',
+    'lumipeb_vdm_L1MBTS_2_LUCID_UNPAIRED_ISO',
     'lumipeb_vdm_L1RD0_BGRP11',
     'lumipeb_vdm_L1RD0_BGRP9',
     'lumipeb_vdm_L1RD0_FILLED',
@@ -2088,6 +2547,8 @@ ps_calibmon_list=[
     'satu20em_l1satmon_L1J100_FIRSTEMPTY',
     'sct_noise',
     'tilecalib_laser',
+    'rpcpeb_L1RD0_EMPTY',
+    'idpsl1_L1IDprescaled'
     ]    
 ps_eb_list=[
     'eb_high_L1RD2_FILLED',
@@ -2118,14 +2579,16 @@ ps_beamspot_list=[
     'beamspot_trkFS_trkfast',
     'beamspot_trkFS_trkfast_L1TRT_EMPTY',
     'beamspot_trkFS_trkfast_L1TRT_FILLED',
-    'beamspot_activeTE_trkfast_peb_L13J15',
+    'beamspot_trkFS_trkfast_L1J15',
+    'beamspot_allTE_trkfast_peb_L1J15',
+    'beamspot_activeTE_trkfast_peb_L1J15',
     'beamspot_allTE_trkfast_peb_L13J15',
     'beamspot_trkFS_trkfast_L13J15',
-    'beamspot_activeTE_trkfast_peb_L1J15',
-    'beamspot_allTE_trkfast_peb_L1J15',
-    'beamspot_trkFS_trkfast_L1J15'
+    'beamspot_activeTE_trkfast_peb_L13J15',
+#    'beamspot_activeTE_trkfast_peb_L1MBTS_1_VTE70',
+#    'beamspot_allTE_trkfast_peb_L1MBTS_1_VTE70',
+#    'beamspot_trkFS_trkfast_L1MBTS_1_VTE70'
     ]
-
 ps_fwdphys_list=[
     'lhcfpeb',
     'lhcfpeb_L1LHCF_EMPTY',
@@ -2152,150 +2615,306 @@ ps_minb_list=[
     'mb_perf_L1RD1_FILLED',
     'mb_sptrk_vetombts2in_L1ZDC_AND',
     'mb_sptrk_vetombts2in_L1ZDC_A_C',
+    'mb_sp600_pusup300_trk40_hmt_L1TE5',
+    'mb_sp700_pusup350_trk50_hmt_L1TE5',
     'mb_sp900_pusup400_trk50_hmt_L1TE5',
     'mb_sp900_pusup400_trk60_hmt_L1TE5',
     'mb_sp1000_pusup450_trk70_hmt_L1TE5',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE5',
     'mb_sp1200_pusup500_trk80_hmt_L1TE5',
     'mb_sp1200_pusup500_trk90_hmt_L1TE5',
     'mb_sp1200_pusup500_trk100_hmt_L1TE5',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE5',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE5',
     'mb_sp1800_pusup700_trk110_hmt_L1TE5',
     'mb_sp2100_pusup900_trk120_hmt_L1TE5',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE5',
+    'mb_sp600_pusup300_trk40_hmt_L1TE10',
+    'mb_sp700_pusup350_trk50_hmt_L1TE10',
+    'mb_sp900_pusup400_trk60_hmt_L1TE10',
     'mb_sp1000_pusup450_trk70_hmt_L1TE10',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE10',
     'mb_sp1200_pusup500_trk80_hmt_L1TE10',
     'mb_sp1400_pusup550_trk90_hmt_L1TE10',
     'mb_sp1600_pusup600_trk100_hmt_L1TE10',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE10',
     'mb_sp1800_pusup700_trk110_hmt_L1TE10',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE10',
     'mb_sp2100_pusup900_trk120_hmt_L1TE10',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE10',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE10',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE15',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE15',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE15',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE15',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE15',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE15',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE15',
+    'mb_sp700_pusup350_trk50_hmt_L1TE20',
+    'mb_sp900_pusup400_trk60_hmt_L1TE20',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE20',
+    'mb_sp1200_pusup500_trk80_hmt_L1TE20',
     'mb_sp1400_pusup550_trk90_hmt_L1TE20',
     'mb_sp1600_pusup600_trk100_hmt_L1TE20',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE20',
     'mb_sp1800_pusup700_trk110_hmt_L1TE20',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE20',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE20',
     'mb_sp2100_pusup900_trk120_hmt_L1TE20',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE20',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE20',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE20',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE20',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE20',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE25',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE25',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE25',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE25',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE25',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE25',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE25',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE30',
+    'mb_sp1200_pusup500_trk80_hmt_L1TE30',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE30',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE30',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE30',
     'mb_sp1800_pusup700_trk110_hmt_L1TE30',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE30',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE30',
     'mb_sp2100_pusup900_trk120_hmt_L1TE30',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE30',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE30',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE30',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE30',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE30',
     'mb_sp2900_pusup1300_trk160_hmt_L1TE30',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE40',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE40',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE40',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE40',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE40',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE40',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE40',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE40',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE40',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE40',
     'mb_sp2900_pusup1300_trk160_hmt_L1TE40',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE50',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE50',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE50',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE50',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE50',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE50',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE60',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE60',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE60',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE60',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE60',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE70',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE70',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE70',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE70',
+    'mb_sp600_trk40_hmt_L1TE5',
+    'mb_sp700_trk50_hmt_L1TE5',
     'mb_sp900_trk50_hmt_L1TE5',
     'mb_sp900_trk60_hmt_L1TE5',
     'mb_sp1000_trk70_hmt_L1TE5',
+    'mb_sp1100_trk70_hmt_L1TE5',
     'mb_sp1200_trk80_hmt_L1TE5',
     'mb_sp1200_trk90_hmt_L1TE5',
     'mb_sp1200_trk100_hmt_L1TE5',
+    'mb_sp1400_trk90_hmt_L1TE5',
+    'mb_sp1600_trk100_hmt_L1TE5',
     'mb_sp1800_trk110_hmt_L1TE5',
     'mb_sp2100_trk120_hmt_L1TE5',
     'mb_sp2300_trk130_hmt_L1TE5',
+    'mb_sp600_trk40_hmt_L1TE10',
+    'mb_sp700_trk50_hmt_L1TE10',
+    'mb_sp900_trk60_hmt_L1TE10',
     'mb_sp1000_trk70_hmt_L1TE10',
+    'mb_sp1100_trk70_hmt_L1TE10',
     'mb_sp1200_trk80_hmt_L1TE10',
     'mb_sp1400_trk90_hmt_L1TE10',
     'mb_sp1600_trk100_hmt_L1TE10',
+    'mb_sp1700_trk110_hmt_L1TE10',
     'mb_sp1800_trk110_hmt_L1TE10',
+    'mb_sp1900_trk120_hmt_L1TE10',
     'mb_sp2100_trk120_hmt_L1TE10',
     'mb_sp2300_trk130_hmt_L1TE10',
     'mb_sp2500_trk140_hmt_L1TE10',
-    'mb_sp1200_trk80_hmt_L1TE15',
-    'mb_sp1400_trk90_hmt_L1TE15',
-    'mb_sp1600_trk100_hmt_L1TE15',
-    'mb_sp1800_trk110_hmt_L1TE15',
-    'mb_sp2100_trk120_hmt_L1TE15',
-    'mb_sp2300_trk130_hmt_L1TE15',
-    'mb_sp2500_trk140_hmt_L1TE15',
+    'mb_sp700_trk50_hmt_L1TE20',
+    'mb_sp900_trk60_hmt_L1TE20',
+    'mb_sp1100_trk70_hmt_L1TE20',
+    'mb_sp1200_trk80_hmt_L1TE20',
     'mb_sp1400_trk90_hmt_L1TE20',
     'mb_sp1600_trk100_hmt_L1TE20',
+    'mb_sp1700_trk110_hmt_L1TE20',
     'mb_sp1800_trk110_hmt_L1TE20',
+    'mb_sp1900_trk120_hmt_L1TE20',
+    'mb_sp2100_trk130_hmt_L1TE20',
     'mb_sp2100_trk120_hmt_L1TE20',
+    'mb_sp2200_trk140_hmt_L1TE20',
     'mb_sp2300_trk130_hmt_L1TE20',
+    'mb_sp2400_trk150_hmt_L1TE20',
     'mb_sp2500_trk140_hmt_L1TE20',
     'mb_sp2700_trk150_hmt_L1TE20',
-    'mb_sp1600_trk100_hmt_L1TE25',
-    'mb_sp1800_trk110_hmt_L1TE25',
-    'mb_sp2100_trk120_hmt_L1TE25',
-    'mb_sp2300_trk130_hmt_L1TE25',
-    'mb_sp2500_trk140_hmt_L1TE25',
-    'mb_sp2700_trk150_hmt_L1TE25',
-    'mb_sp2900_trk160_hmt_L1TE25',
+    'mb_sp1100_trk70_hmt_L1TE30',
+    'mb_sp1200_trk80_hmt_L1TE30',
+    'mb_sp1400_trk90_hmt_L1TE30',
+    'mb_sp1600_trk100_hmt_L1TE30',
+    'mb_sp1700_trk110_hmt_L1TE30',
     'mb_sp1800_trk110_hmt_L1TE30',
+    'mb_sp1900_trk120_hmt_L1TE30',
+    'mb_sp2100_trk130_hmt_L1TE30',
     'mb_sp2100_trk120_hmt_L1TE30',
+    'mb_sp2200_trk140_hmt_L1TE30',
     'mb_sp2300_trk130_hmt_L1TE30',
+    'mb_sp2400_trk150_hmt_L1TE30',
     'mb_sp2500_trk140_hmt_L1TE30',
     'mb_sp2700_trk150_hmt_L1TE30',
     'mb_sp2900_trk160_hmt_L1TE30',
+    'mb_sp1400_trk90_hmt_L1TE40',
+    'mb_sp1600_trk100_hmt_L1TE40',
+    'mb_sp1700_trk110_hmt_L1TE40',
+    'mb_sp1900_trk120_hmt_L1TE40',
+    'mb_sp2100_trk130_hmt_L1TE40',
+    'mb_sp2200_trk140_hmt_L1TE40',
     'mb_sp2300_trk130_hmt_L1TE40',
+    'mb_sp2400_trk150_hmt_L1TE40',
     'mb_sp2500_trk140_hmt_L1TE40',
     'mb_sp2700_trk150_hmt_L1TE40',
     'mb_sp2900_trk160_hmt_L1TE40',
-    'mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24',
-    'mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24',
-    'mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24',
-    'mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24',
+    'mb_sp1600_trk100_hmt_L1TE50',
+    'mb_sp1700_trk110_hmt_L1TE50',
+    'mb_sp1900_trk120_hmt_L1TE50',
+    'mb_sp2100_trk130_hmt_L1TE50',
+    'mb_sp2200_trk140_hmt_L1TE50',
+    'mb_sp2400_trk150_hmt_L1TE50',
+    'mb_sp1700_trk110_hmt_L1TE60',
+    'mb_sp1900_trk120_hmt_L1TE60',
+    'mb_sp2100_trk130_hmt_L1TE60',
+    'mb_sp2200_trk140_hmt_L1TE60',
+    'mb_sp2400_trk150_hmt_L1TE60',
+    'mb_sp1900_trk120_hmt_L1TE70',
+    'mb_sp2100_trk130_hmt_L1TE70',
+    'mb_sp2200_trk140_hmt_L1TE70',
+    'mb_sp2400_trk150_hmt_L1TE70',
+    #'mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24',
+    #'mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24',
+    'mu4_mb_sp600_trk40_hmt_L1MU4_TE10',
+    'mu4_mb_sp700_trk50_hmt_L1MU4_TE10',
+    'mu4_mb_sp900_trk60_hmt_L1MU4_TE10',
+    'mu4_mb_sp1100_trk70_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_trk80_hmt_L1MU4_TE10',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE10',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE10',
+    'mu4_mb_sp600_pusup300_trk40_hmt_L1MU4_TE10',
+    'mu4_mb_sp700_pusup350_trk50_hmt_L1MU4_TE10',
+    'mu4_mb_sp900_pusup400_trk60_hmt_L1MU4_TE10',
+    'mu4_mb_sp1100_pusup450_trk70_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE10',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE10',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_trk80_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE40',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE50',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE50',
+    'mu4_mb_sp1700_trk110_hmt_L1MU4_TE50',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE50',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE50',
+    'mu4_mb_sp1700_pusup650_trk110_hmt_L1MU4_TE50',
+    'mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE40',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE40',
+    'j40_mb_sp600_pusup300_trk40_hmt',
+    'j40_mb_sp700_pusup350_trk50_hmt',
+    'j40_mb_sp900_pusup400_trk60_hmt',
+    'j40_mb_sp1100_pusup450_trk70_hmt',
+    'j40_mb_sp1200_pusup500_trk80_hmt',
+    'j40_mb_sp1400_pusup550_trk90_hmt',
+    'j40_mb_sp1600_pusup600_trk100_hmt',
+    'j40_mb_sp600_trk40_hmt',
+    'j40_mb_sp700_trk50_hmt',
+    'j40_mb_sp900_trk60_hmt',
+    'j40_mb_sp1100_trk70_hmt',
+    'j40_mb_sp1200_trk80_hmt',
+    'j40_mb_sp1400_trk90_hmt',
+    'j40_mb_sp1600_trk100_hmt',
+    'j45_mb_sp600_pusup300_trk40_hmt',
+    'j45_mb_sp700_pusup350_trk50_hmt',
+    'j45_mb_sp900_pusup400_trk60_hmt',
+    'j45_mb_sp1100_pusup450_trk70_hmt',
+    'j45_mb_sp1200_pusup500_trk80_hmt',
+    'j45_mb_sp1400_pusup550_trk90_hmt',
+    'j45_mb_sp1600_pusup600_trk100_hmt',
+    'j45_mb_sp600_trk40_hmt',
+    'j45_mb_sp700_trk50_hmt',
+    'j45_mb_sp900_trk60_hmt',
+    'j45_mb_sp1100_trk70_hmt',
+    'j45_mb_sp1200_trk80_hmt',
+    'j45_mb_sp1400_trk90_hmt',
+    'j45_mb_sp1600_trk100_hmt',
+    'j60_mb_sp600_pusup300_trk40_hmt',
+    'j60_mb_sp700_pusup350_trk50_hmt',
+    'j60_mb_sp900_pusup400_trk60_hmt',
+    'j60_mb_sp1100_pusup450_trk70_hmt',
+    'j60_mb_sp1200_pusup500_trk80_hmt',
+    'j60_mb_sp1400_pusup550_trk90_hmt',
+    'j60_mb_sp1600_pusup600_trk100_hmt',
+    'j60_mb_sp600_trk40_hmt',
+    'j60_mb_sp700_trk50_hmt',
+    'j60_mb_sp900_trk60_hmt',
+    'j60_mb_sp1100_trk70_hmt',
+    'j60_mb_sp1200_trk80_hmt',
+    'j60_mb_sp1400_trk90_hmt',
+    'j60_mb_sp1600_trk100_hmt',
+    'j110_mb_sp600_pusup300_trk40_hmt',
+    'j110_mb_sp700_pusup350_trk50_hmt',
+    'j110_mb_sp900_pusup400_trk60_hmt',
+    'j110_mb_sp1100_pusup450_trk70_hmt',
+    'j110_mb_sp1200_pusup500_trk80_hmt',
+    'j110_mb_sp1400_pusup550_trk90_hmt',
+    'j110_mb_sp1600_pusup600_trk100_hmt',
+    'j110_mb_sp600_trk40_hmt',
+    'j110_mb_sp700_trk50_hmt',
+    'j110_mb_sp900_trk60_hmt',
+    'j110_mb_sp1100_trk70_hmt',
+    'j110_mb_sp1200_trk80_hmt',
+    'j110_mb_sp1400_trk90_hmt',
+    'j110_mb_sp1600_trk100_hmt',
     'mb_sp400_trk40_hmt_L1MBTS_1_1',
     'mb_sp600_trk45_hmt_L1MBTS_1_1',
     'mb_sp700_trk55_hmt_L1MBTS_1_1',
@@ -2304,74 +2923,71 @@ ps_minb_list=[
     'mb_sp1000_trk70_hmt_L1MBTS_1_1',
     'mb_sp1200_trk75_hmt_L1MBTS_1_1',
     'mb_sp1400_trk80_hmt_L1MBTS_1_1',
-    'mb_sp900_trk50_hmt_L1TE5.0ETA24',
-    'mb_sp900_trk60_hmt_L1TE5.0ETA24',
-    'mb_sp1000_trk70_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk90_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk100_hmt_L1TE5.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE5.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE5.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE5.0ETA24',
-    'mb_sp1000_trk70_hmt_L1TE10.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE10.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE10.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE10.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE10.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE10.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE10.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE10.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE15.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE15.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE15.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE15.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE15.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE15.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE15.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE20.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE20.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE20.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE20.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE20.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE20.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE20.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE25.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE25.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE25.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE25.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE25.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE25.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE25.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE30.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE30.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE30.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE30.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE30.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE30.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE40.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE40.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE40.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE40.0ETA24',
+    #'mb_sp900_trk50_hmt_L1TE5.0ETA24',
+    #'mb_sp900_trk60_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_trk70_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk90_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk100_hmt_L1TE5.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE5.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE5.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_trk70_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE10.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE10.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE10.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE10.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE10.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE10.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE15.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE15.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE15.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE15.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE15.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE20.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE20.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE20.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE20.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE20.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE25.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE25.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE25.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE25.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE25.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE30.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE30.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE30.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE30.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE40.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE40.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE40.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE40.0ETA24',
     'mb_sp800_hmtperf_L1TE5',
     'mb_sp800_hmtperf_L1TE10',
     'mb_sp1200_hmtperf_L1TE10',
-    'mb_sp1200_hmtperf_L1TE15',
-    'mb_sp1600_hmtperf_L1TE15',
     'mb_sp1600_hmtperf_L1TE20',
     'mb_sp2100_hmtperf_L1TE20',
-    'mb_sp2100_hmtperf_L1TE25',
     'mb_sp2100_hmtperf_L1TE30',
     'mb_sp2100_hmtperf_L1TE40',
-    'mb_sp800_hmtperf_L1TE5.0ETA24',
-    'mb_sp800_hmtperf_L1TE10.0ETA24',
-    'mb_sp1200_hmtperf_L1TE10.0ETA24',
-    'mb_sp1200_hmtperf_L1TE15.0ETA24',
-    'mb_sp1600_hmtperf_L1TE15.0ETA24',
-    'mb_sp1600_hmtperf_L1TE20.0ETA24',
-    'mb_sp2100_hmtperf_L1TE20.0ETA24',
-    'mb_sp2100_hmtperf_L1TE25.0ETA24',
-    'mb_sp2100_hmtperf_L1TE30.0ETA24',
-    'mb_sp2100_hmtperf_L1TE40.0ETA24',
+    #'mb_sp800_hmtperf_L1TE5.0ETA24',
+    #'mb_sp800_hmtperf_L1TE10.0ETA24',
+    #'mb_sp1200_hmtperf_L1TE10.0ETA24',
+    #'mb_sp1200_hmtperf_L1TE15.0ETA24',
+    #'mb_sp1600_hmtperf_L1TE15.0ETA24',
+    #'mb_sp1600_hmtperf_L1TE20.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE20.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE25.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE30.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE40.0ETA24',
     'mb_sp2000_trk70_hmt',
     'mb_sp2000_pusup600_trk70_hmt',
     'mb_sp1800_hmtperf_L1TE40',
@@ -2387,6 +3003,7 @@ ps_minb_list=[
     'mb_sp_L1RD0_UNPAIRED_ISO',
     'mb_sp_ncb_L1RD0_UNPAIRED_ISO',
     'mb_sp_blayer_L1RD0_UNPAIRED_ISO',
+    'mb_sp_L1RD0_FILLED',
     'mb_sptrk_L1RD3_FILLED',
     'mb_sptrk_noisesup',
     'mb_sptrk_noisesup_L1RD0_EMPTY',
@@ -2407,6 +3024,23 @@ ps_minb_list=[
     'mb_sptrk_vetombts2in_L1RD0_FILLED',
     'mb_sptrk_trk80_L1MBTS_2',
     'mb_sptrk_pt2_L1MBTS_2',
+##     'mb_sptrk_L1MBTS_1_VTE2',
+##     'mb_sptrk_L1MBTS_1_VTE3',
+##     'mb_sptrk_L1MBTS_1_VTE4',
+##     'mb_sptrk_L1MBTS_1_VTE5',
+##     'mb_sptrk_L1MBTS_1_VTE10',
+##     'mb_sptrk_L1MBTS_2_VTE2',
+##     'mb_sptrk_L1MBTS_2_VTE3',
+##     'mb_sptrk_L1MBTS_2_VTE4',
+##     'mb_sptrk_L1MBTS_2_VTE5',
+##     'mb_sptrk_L1MBTS_2_VTE10',
+##     'mb_sptrk_L1VTE2',
+##     'mb_sptrk_L1VTE3',
+##     'mb_sptrk_L1VTE4',
+##     'mb_sptrk_L1VTE5',
+##     'mb_sptrk_L1VTE10',
+#    'mb_sptrk_L1MBTS_1',
+    
     'noalg_mb_L1LUCID',
     'noalg_mb_L1LUCID_EMPTY',
     'noalg_mb_L1LUCID_UNPAIRED_ISO',
@@ -2427,30 +3061,41 @@ ps_minb_list=[
     'noalg_mb_L1RD2_FILLED',
     'noalg_mb_L1RD3_EMPTY',
     'noalg_mb_L1RD3_FILLED',
+    #'noalg_mb_L1TE5.0ETA24',
+ ##    'noalg_mb_L1TE2',
+##     'noalg_mb_L1TE3',
+##     'noalg_mb_L1TE4',
     'noalg_mb_L1TE5',
-    'noalg_mb_L1TE5.0ETA24',
     'noalg_mb_L1TE10',
-    'noalg_mb_L1TE10.0ETA24',
+    #'noalg_mb_L1TE10.0ETA24',
     'noalg_mb_L1TE20',
-    'noalg_mb_L1TE20.0ETA24',
+    #'noalg_mb_L1TE20.0ETA24',
     'noalg_mb_L1TE30',
-    'noalg_mb_L1TE30.0ETA24',
+    #'noalg_mb_L1TE30.0ETA24',
     'noalg_mb_L1TE40',
-    'noalg_mb_L1TE40.0ETA24',
+    #'noalg_mb_L1TE40.0ETA24',
+    'noalg_mb_L1TE50',
+    'noalg_mb_L1TE60',
     'noalg_mb_L1TE70',
-    'noalg_mb_L1TE70.0ETA24',
+    #'noalg_mb_L1TE70.0ETA24',
     'noalg_mb_L1ZDC_A',
     'noalg_mb_L1ZDC_C',
     'noalg_mb_L1ZDC_AND',
     'noalg_mb_L1ZDC_A_C',
+#    'mb_sp_L1MBTS_1_OVERLAY',
+#    'mb_sptrk_L1MBTS_1_OVERLAY',
+#    'noalg_L1MBTS_1_OVERLAY',
+#    'noalg_L1TE20_OVERLAY',
     ]
 
 ps_rerun_list = [
 
-
-
-
-
+    'xe0noL1_l2fsperf',
+    'xe0noL1_l2fsperf_mht',
+    'xe0noL1_l2fsperf_mht_em',
+    'xe0noL1_l2fsperf_pufit',
+    'xe0noL1_l2fsperf_tc_em',
+    'xe0noL1_l2fsperf_tc_lcw',
 
     ]
 
@@ -2471,13 +3116,10 @@ ps_perform_list = [
 
     '2j35_bperf_split_2j35_L13J25.0ETA23',
     '2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-400',
-    '2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-400',
     'j150_bperf_split',
     'j150_bperf_split_j50_bperf_split',
     'j35_bperf',
     'j35_bperf_split',
-    'j45_bperf_split_3j45_L13J15.0ETA25',
-    'j45_bperf_split_3j45_L13J20',
     'j55_bperf_split',
     'j65_bperf_split_3j65_L13J25.0ETA23',
     'j70_bperf_split_3j70',
@@ -2485,17 +3127,6 @@ ps_perform_list = [
     'j75_bperf_split_3j75',
     'j75_bperf_split_3j75_L13J25.0ETA23',
 
-    'e35_lhtight_nod0_ivarloose',
-    'e40_lhtight_nod0_ivarloose',
-    'e50_lhtight_nod0_ivarloose',
-
-    'e5_etcut_L1W-HT20-JJ15.ETA49',
-    'e13_etcut_L1EM12_W-MT25',
-    'e18_etcut_trkcut',
-    'e18_etcut_L1EM15_W-MT35',
-
-
-
     'mu14_tau25_medium1_tracktwo_L1DR-MU10TAU12I',
     'mu14_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25',
     'mu14_tau25_medium1_tracktwo_L1MU10_TAU12I-J25',
@@ -2514,51 +3145,7 @@ ps_perform_list = [
     'e17_lhmedium_iloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
     'e17_lhmedium_iloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25',
 
-    'xe90_trkmht_xe80_mht_L1XE50',
-    'xe100_trkmht_xe80_mht_L1XE50',
-    'xe110_trkmht_xe80_mht_L1XE50',
-    'xe110_trkmht_wEFMu_xe80_mht_L1XE50',
-    'xe120_trkmht_xe80_mht_L1XE50',
-    'xe100_trkmht_xe90_mht_L1XE50',
-    'xe110_trkmht_xe90_mht_L1XE50',
-    'xe110_trkmht_wEFMu_xe90_mht_L1XE50',
-    'xe120_trkmht_xe90_mht_L1XE50',
-    'xe110_trkmht_xe100_mht_L1XE50',
-    'xe110_trkmht_wEFMu_xe100_mht_L1XE50',
-    'xe120_trkmht_xe100_mht_L1XE50',
-    'xe90_trkmht_xe80_mht_L1XE55',
-    'xe100_trkmht_xe80_mht_L1XE55',
-    'xe110_trkmht_xe80_mht_L1XE55',
-    'xe110_trkmht_wEFMu_xe80_mht_L1XE55',
-    'xe120_trkmht_xe80_mht_L1XE55',
-    'xe130_trkmht_xe80_mht_L1XE55',
-    'xe100_trkmht_xe90_mht_L1XE55',
-    'xe110_trkmht_xe90_mht_L1XE55',
-    'xe110_trkmht_wEFMu_xe90_mht_L1XE55',
-    'xe120_trkmht_xe90_mht_L1XE55',
-    'xe130_trkmht_xe90_mht_L1XE55',
-    'xe110_trkmht_xe100_mht_L1XE55',
-    'xe110_trkmht_wEFMu_xe100_mht_L1XE55',
-    'xe120_trkmht_xe100_mht_L1XE55',
-    'xe130_trkmht_xe100_mht_L1XE55',
-    'xe90_trkmht_xe80_mht_L1XE60',
-    'xe100_trkmht_xe80_mht_L1XE60',
-    'xe110_trkmht_xe80_mht_L1XE60',
-    'xe120_trkmht_xe80_mht_L1XE60',
-    'xe120_trkmht_wEFMu_xe80_mht_L1XE60',
-    'xe130_trkmht_xe80_mht_L1XE60',
-    'xe140_trkmht_xe80_mht_L1XE60',
-    'xe100_trkmht_xe90_mht_L1XE60',
-    'xe110_trkmht_xe90_mht_L1XE60',
-    'xe120_trkmht_xe90_mht_L1XE60',
-    'xe120_trkmht_wEFMu_xe90_mht_L1XE60',
-    'xe130_trkmht_xe90_mht_L1XE60',
-    'xe140_trkmht_xe90_mht_L1XE60',
-    'xe110_trkmht_xe100_mht_L1XE60',
-    'xe120_trkmht_xe100_mht_L1XE60',
-    'xe120_trkmht_wEFMu_xe100_mht_L1XE60',
-    'xe130_trkmht_xe100_mht_L1XE60',
-    'xe140_trkmht_xe100_mht_L1XE60',
+
 
     'xe100_mht_xe65_L1XE70',
     'xe100_mht_xe70_L1XE70',
@@ -2629,12 +3216,6 @@ ps_perform_list = [
     'xe45_wEFMu',
     'xe50',
     'xe50_mht_FStracks_L1XE50',
-    'xe0noL1_l2fsperf',
-    'xe0noL1_l2fsperf_mht',
-    'xe0noL1_l2fsperf_mht_em',
-    'xe0noL1_l2fsperf_pufit',
-    'xe0noL1_l2fsperf_tc_em',
-    'xe0noL1_l2fsperf_tc_lcw',   
     'xe110_mht_em_L1KF-XE60',
     'xe110_mht_em_L1KF-XE65',
     'xe110_mht_em_L1KF-XE75',
@@ -2715,6 +3296,11 @@ ps_perform_list = [
     'tau5_perf_ptonly_L1TAU8',
     'tau80_medium1_calo',
     'tau80_medium1_track',
+    'tau25_idperf_tracktwomva',
+    'tau25_perf_tracktwomva',
+    'tau25_loose1_tracktwomva',
+    'tau25_medium1_tracktwomva',
+    'tau25_tight1_tracktwomva',
     'tau35_perf_ptonly_tau25_perf_ptonly_L1TAU20IM_2TAU12IM',
     '2j30_boffperf_L12J15_XE55',
     '2j35_boffperf_2j35_L13J25.0ETA23',
@@ -2732,10 +3318,6 @@ ps_perform_list = [
     '2j55_bperf_L13J20_4J20.0ETA49_MJJ-700',
     '2j55_bperf_L13J20_4J20.0ETA49_MJJ-800',
     '2j55_bperf_L13J20_4J20.0ETA49_MJJ-900',
-    '2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-400',
-    '2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-700',
-    '2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-800',
-    '2j55_bperf_L1J30_2J20_4J20.0ETA49_MJJ-900',
     '2j55_bperf_ht300_L14J20',
     '2j65_boffperf_j65',
     '2j65_bperf_j65',
@@ -2776,11 +3358,7 @@ ps_perform_list = [
     'j400_boffperf',
     'j400_bperf',
     'j45_boffperf',
-    'j45_boffperf_3j45_L13J15.0ETA25',
-    'j45_boffperf_3j45_L13J20',
     'j45_bperf',
-    'j45_bperf_3j45_L13J15.0ETA25',
-    'j45_bperf_3j45_L13J20',
     'j45_bperf_3j45_L14J20',
     'j55_boffperf',
     'j55_boffperf_ht500_L14J20',
@@ -2803,7 +3381,6 @@ ps_perform_list = [
     'j80_boffperf_L1XE60',
     'mu4_j15_dr05' ,
     'mu4_j35_dr05'  ,
-    'mu4_j55_dr05' ,
     'mu6_j110_dr05',
     'mu6_j150_dr05',
     'mu6_j175_dr05',
@@ -2831,9 +3408,12 @@ ps_perform_list = [
     '2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-700',
     '2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-800',
     '2j55_bperf_split_L13J20_4J20.0ETA49_MJJ-900',
-    '2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-700',
-    '2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-800',
-    '2j55_bperf_split_L1J30_2J20_4J20.0ETA49_MJJ-900',
+    'j15_gsc35_boffperf_split',
+    'j25_bperf_split',
+    'j25_boffperf',
+    'e4_etcut',
+    'e5_lhmedium_nod0',
+    'e5_lhloose_nod0_idperf'
     ]
 
 ps_Jpsi_list = [
@@ -2956,9 +3536,9 @@ if TriggerFlags.doFTK():
         'mu26_ivarmedium_tau12_medium1_FTK',
         'mu26_ivarmedium_tau12_medium0_FTKNoPrec',
         'mu26_ivarmedium_tau12_medium1_FTKNoPrec',
-        'mu26_ivarmedium_tau25_idperf_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',
-        'mu26_ivarmedium_tau25_perf_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',
-        'mu26_ivarmedium_tau25_medium1_tracktwo_L1TAU12IM_FTK_L1MU21_TAU12IM_FTK',
+        'mu26_ivarmedium_tau25_idperf_tracktwo_L1TAU12IM_FTK',
+        'mu26_ivarmedium_tau25_perf_tracktwo_L1TAU12IM_FTK',
+        'mu26_ivarmedium_tau25_medium1_tracktwo_L1TAU12IM_FTK',
         'j15_bperf_split_FTK',
         'j35_bperf_split_FTK',
         'j45_bperf_split_FTK',
@@ -3051,10 +3631,6 @@ ps_streamers_list = [
      'noalg_L1AFP_A_OR_C_TE5',
      'noalg_L1AFP_A_OR_C_UNPAIRED_ISO',
      'noalg_L1AFP_A_OR_C_UNPAIRED_NONISO',
-     'noalg_L1AFP_A_OR_C_EM3',
-     'noalg_L1AFP_A_AND_C_EM3',
-     'noalg_L1AFP_A_OR_C_MU4',
-     'noalg_L1AFP_A_AND_C_MU4',
      'noalg_L1AFP_C',
      'noalg_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
      'noalg_L1DR-MU10TAU12I',
@@ -3075,6 +3651,8 @@ ps_streamers_list = [
      'noalg_L1EM20VH',
      'noalg_L1EM22VHI',
      'noalg_L1EM3',
+     'noalg_L1EM3_AFP_A_AND_C',
+     'noalg_L1EM3_AFP_A_OR_C',
      'noalg_L1EM7',
      'noalg_L1EM7_MU10',
      'noalg_L1EM8VH',
@@ -3119,9 +3697,10 @@ ps_streamers_list = [
      'noalg_L1MU21',
      'noalg_L1MU21_FIRSTEMPTY',
      'noalg_L1MU4',
+     'noalg_L1MU4_AFP_A_AND_C',
+     'noalg_L1MU4_AFP_A_OR_C',
      'noalg_L1MU4_EMPTY',
      'noalg_L1MU4_FIRSTEMPTY',
-     'noalg_L1MU4_J12',
      'noalg_L1MU4_UNPAIRED_ISO',
      'noalg_L1MU6',
      'noalg_L1MU6_2MU4',
@@ -3145,25 +3724,25 @@ ps_streamers_list = [
      'noalg_L1TAU20IM_2TAU12IM_J25_2J20_3J12',
      'noalg_L1TAU20IM_2TAU12IM_XE35',
      'noalg_L1TAU20_2TAU12',
-     'noalg_L1TAU20_2TAU12_XE35',
      'noalg_L1TAU30',
      'noalg_L1TAU40',
      'noalg_L1TAU60',
      'noalg_L1TAU8',
      'noalg_L1TE10',
-     'noalg_L1TE10.0ETA24',
+     #'noalg_L1TE10.0ETA24',
      'noalg_L1TE20',
-     'noalg_L1TE20.0ETA24',
+     #'noalg_L1TE20.0ETA24',
      'noalg_L1TE30',
-     'noalg_L1TE30.0ETA24',
+     #'noalg_L1TE30.0ETA24',
      'noalg_L1TE40',
-     'noalg_L1TE40.0ETA24',
+     #'noalg_L1TE40.0ETA24',
      'noalg_L1TE5',
-     'noalg_L1TE5.0ETA24',
+     #'noalg_L1TE5.0ETA24',
+     'noalg_L1TE50',
+     'noalg_L1TE60',
      'noalg_L1TE70',
      'noalg_L1Topo',
      'noalg_L1XE10',
-     'noalg_L1XE150',
      'noalg_L1XE30',
      'noalg_L1XE300',
      'noalg_L1XE35',
@@ -3174,17 +3753,25 @@ ps_streamers_list = [
      'noalg_L1XE60',
      'noalg_L1XE70',
      'noalg_L1XE80',
-     'noalg_L1XS20',
-     'noalg_L1XS30',
      'noalg_bkg_L1J15.31ETA49_UNPAIRED_ISO',
      'noalg_bkg_L1MBTS_2_UNPAIRED_ISO',
      'noalg_bkg_L1MBTS_4_A_UNPAIRED_ISO',
      'noalg_bkg_L1MBTS_4_C_UNPAIRED_ISO',
      'noalg_bkg_L1MU4_UNPAIRED_ISO',
      'noalg_bkg_L1RD0_UNPAIRED_ISO',
-  
+     'noalg_l1calo_L1EM12',
+     'noalg_l1calo_L1EM15',
+     'noalg_l1calo_L1EM7',
+     'noalg_l1calo_L1J100',
+     'noalg_l1calo_L1J10031ETA49',
+     'noalg_l1calo_L1J120',
      'noalg_l1calo_L1J400',
-
+     'noalg_l1calo_L1J5031ETA49',
+     'noalg_l1calo_L1J75',
+     'noalg_l1calo_L1J7531ETA49',
+     'noalg_l1calo_L1TAU12',
+     'noalg_l1calo_L1TAU20',
+     'noalg_l1calo_L1TAU8',
      'noalg_l1topo_L12EM3',
      'noalg_l1topo_L12MU4',
      'noalg_l1topo_L12MU4-B',
@@ -3202,17 +3789,11 @@ ps_streamers_list = [
      'noalg_l1topo_L13J20_BTAG-MU4J20',
      'noalg_l1topo_L14J15',
      'noalg_l1topo_L14J20.0ETA49',
-     'noalg_l1topo_L1BOX-TAU20ITAU12I',
-     'noalg_l1topo_L1BPH-2M8-2MU4',
-     'noalg_l1topo_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
-     'noalg_l1topo_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4',
      'noalg_l1topo_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
      'noalg_l1topo_L1BPH-8M15-2MU6',
      'noalg_l1topo_L1BPH-8M15-MU6MU4',
      'noalg_l1topo_L1BTAG-MU4J15',
-     'noalg_l1topo_L1BTAG-MU4J30',
      'noalg_l1topo_L1BTAG-MU6J20',
-     'noalg_l1topo_L1BTAG-MU6J25',
      'noalg_l1topo_L1DPHI-CJ20XE50',
      'noalg_l1topo_L1DPHI-J20XE50',
      'noalg_l1topo_L1DPHI-J20s2XE50',
@@ -3228,16 +3809,10 @@ ps_streamers_list = [
      'noalg_l1topo_L1EM15',
      'noalg_l1topo_L1EM15I_MU4',
      'noalg_l1topo_L1EM15TAU12I-J25',
-     'noalg_l1topo_L1EM15VH_W-MT35_XS60',
      'noalg_l1topo_L1EM15_W-MT35',
      'noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
      'noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
      'noalg_l1topo_L1EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-     'noalg_l1topo_L1EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-     'noalg_l1topo_L1EM15_W-MT35_XS60',
-     'noalg_l1topo_L1EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-     'noalg_l1topo_L1EM20VH_W-MT35_XS60',
-     'noalg_l1topo_L1EM22VHI_W-MT35_XS40',
      'noalg_l1topo_L1EM3',
      'noalg_l1topo_L1EM7',
      'noalg_l1topo_L1EM7_2EM3',
@@ -3253,12 +3828,7 @@ ps_streamers_list = [
      'noalg_l1topo_L1J15',
      'noalg_l1topo_L1J20',
      'noalg_l1topo_L1J25',
-     'noalg_l1topo_L1J25_2J20_3J12_BOX-TAU20ITAU12I',
      'noalg_l1topo_L1J30.0ETA49_2J20.0ETA49',
-     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-400',
-     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-700',
-     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-800',
-     'noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-900',
      'noalg_l1topo_L1J4-MATCH',
      'noalg_l1topo_L1J40_DPHI-CJ20XE50',
      'noalg_l1topo_L1J40_DPHI-J20XE50',
@@ -3279,22 +3849,16 @@ ps_streamers_list = [
      'noalg_l1topo_L1LLP-NOMATCH',
      'noalg_l1topo_L1MJJ-100',
      'noalg_l1topo_L1MJJ-400',
-     'noalg_l1topo_L1MJJ-700',
      'noalg_l1topo_L1MJJ-800',
-     'noalg_l1topo_L1MJJ-900',
      'noalg_l1topo_L1MU10_2MU6',
      'noalg_l1topo_L1MU10_TAU12I-J25',
      'noalg_l1topo_L1MU10_TAU12IM',
      'noalg_l1topo_L1MU4',
-     'noalg_l1topo_L1MU4_J12',
      'noalg_l1topo_L1MU6MU4-BO',
      'noalg_l1topo_L1MU6_2MU4',
      'noalg_l1topo_L1MU6_2MU4-B',
      'noalg_l1topo_L1MU6_J20',
      'noalg_l1topo_L1MU6_MJJ-200',
-     'noalg_l1topo_L1MU6_MJJ-300',
-     'noalg_l1topo_L1MU6_MJJ-400',
-     'noalg_l1topo_L1MU6_MJJ-500',
      'noalg_l1topo_L1TAU12IM',
      'noalg_l1topo_L1TAU20IM_2TAU12IM',
      'noalg_l1topo_L1TAU20ITAU12I-J25',
@@ -3306,12 +3870,13 @@ ps_streamers_list = [
      'noalg_l1topo_L1W-HT20-JJ15.ETA49',
      'noalg_l1topo_L1W-NOMATCH',
      'noalg_l1topo_L1XE35',
-     'noalg_l1topo_L1XE35_MJJ-200',
      'noalg_l1topo_L1XE45',
      'noalg_l1topo_L1XE55',
      'noalg_l1topo_L1XE60',
      'noalg_l1topo_L1XE70',
-  
+     'noalg_mb_L1EM3',
+     'noalg_mb_L1J12',
+     'noalg_mb_L1MU4',
      'noalg_standby_L13J15',
      'noalg_standby_L14J15',
      'noalg_standby_L1J15',
@@ -3370,8 +3935,10 @@ Prescales.HLTPrescales_tightperf_mc_prescale.update(dict(map(None,chain_list,len
 ######################################################
 Prescales.L1Prescales_tight_mc_prescale  = deepcopy(Prescales.L1Prescales)
 Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale)
-chain_list=ps_streamers_list + ps_perform_list
+chain_list=ps_streamers_list + ps_perform_list + ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162
 
+#Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale)
+#chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_ftk_list+ps_perform_list
 Prescales.HLTPrescales_tight_mc_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
 ######################################################
 
@@ -3380,4 +3947,4 @@ Prescales.L1Prescales_upgrade_mc_prescale  = deepcopy(Prescales.L1Prescales)
 Prescales.HLTPrescales_upgrade_mc_prescale = deepcopy(Prescales.HLTPrescales_tight_mc_prescale)
 # Note: "upgrade" prescales are set with regular expressions at the end
 #       of the setupMenu() function above 
-######################################################	
+######################################################
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtil.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtil.py
index 68c966865d93f2aa6b5920593e37c910437889de..a8a79642274fc6311423a3615693759c43831ffb 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtil.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtil.py
@@ -116,7 +116,6 @@ def checkStreamConsistency(triggerPythonConfig):
     """
     menu_name = TriggerFlags.triggerMenuSetup()
     log.info( "Menu: " + menu_name)
-    CheckGroups=False
 
     from TriggerMenu.menu.StreamInfo       import getAllStreams
 
@@ -219,6 +218,7 @@ def allSignatures():
         TriggerFlags.METSlice,
         TriggerFlags.TauSlice,
         TriggerFlags.EgammaSlice,
+        TriggerFlags.AFPSlice,
         TriggerFlags.MinBiasSlice,
         TriggerFlags.CombinedSlice,
         )
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v3.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v3.py
index 054034eb0df7139a64b4306707722f854ad331f8..4a5b85384559065dc37e5cc513bf2aa5af94fcda 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v3.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v3.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
     
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.Physics_HI_v3.py' )
@@ -32,6 +31,8 @@ def setupMenu():
     TriggerFlags.Slices_all_setOff()
 
     TriggerFlags.TestSlice.signatures = [] 
+
+    TriggerFlags.AFPSlice.signatures = []
     
     TriggerFlags.MuonSlice.signatures = [
 	#ID tracking performance
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v4.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v4.py
index 79961a7ca88d6c316067e71059557d7b3964c25d..4f62298e6f696735da378cd508e55dfdc37ec1c5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v4.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_HI_v4.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
     
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.Physics_HI_v4.py' )
@@ -32,6 +31,8 @@ def setupMenu():
     TriggerFlags.Slices_all_setOff()
 
     TriggerFlags.TestSlice.signatures = [] 
+
+    TriggerFlags.AFPSlice.signatures = []
     
     TriggerFlags.MuonSlice.signatures = [
 	#ID tracking performance
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py
index b06da53bfeee46ba8d21a6f433e9dad62cc98ba3..4725919009d5060af514368e7576800f729f966d 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
 
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.Physics_pp_v6.py' )
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py
index aa97ba724ea88d63e43f37e4f8917706ed6bc83b..59febf1363ce533d67278f02ce8be3ebbcac93f5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py
@@ -4,7 +4,6 @@
 #------------------------------------------------------------------------#
 def setupMenu():
 
-    from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
     from TriggerJobOpts.TriggerFlags          import TriggerFlags
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenu.menu.Physics_pp_v7.py' )
@@ -21,7 +20,7 @@ def setupMenu():
     BPhysicsStream     = "BphysLS"
     BMultiMuonStream   = "Main"  
     RATE_BphysTag      = 'RATE:Bphysics'
-    RATE_BMultiMuonTag = 'RATE:MultiMuon'  # can become RATE:BMultiMuon' with one letter change 
+    RATE_BMultiMuonTag = 'RATE:BMultiMuon'  # can become RATE:BMultiMuon' with one letter change 
     BW_BphysTag        = 'BW:Bphys'
     RATE_DYTag         = 'RATE:Muon'   
     BW_DYTag           = 'BW:Muon'   
@@ -41,47 +40,34 @@ def setupMenu():
 
     TriggerFlags.TestSlice.signatures = []
 
+    TriggerFlags.AFPSlice.signatures = [
+        ['afp_jetexc_L1AFP_A_AND_C_SPECTOF_J50',  'L1_AFP_A_AND_C_SPECTOF_J50',  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['afp_jetexc_L1AFP_A_AND_C_SPECTOF_J75',  'L1_AFP_A_AND_C_SPECTOF_J75',  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['afp_jetexc_L1AFP_A_AND_C_SPECTOF_J100',  'L1_AFP_A_AND_C_SPECTOF_J100',  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ]
 
     TriggerFlags.MuonSlice.signatures = [
-        # single muon
-
-        ['mu24_ivarloose', 'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_iloose', 'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_ivarmedium',	      'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu26_ivarmedium',	     'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
-#        ['mu26_ivarmedium_zROItest', 'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu28_ivarmedium',	     'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu35_ivarmedium',	     'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-
-        ['mu0_perf',              'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], 
-        ['mu26_imedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu28_imedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu100',                 'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu80',                  'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu50',                  'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu60',                  'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu60_0eta105_msonly',   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu40',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_imedium',           'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu20_imedium_L1MU10',    'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu26_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+#        ['mu26_ivarmedium_zROItest', 'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu28_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu80',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu50',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:17000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu60',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu60_0eta105_msonly',    'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu20_ivarmedium_L1MU10', 'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu26',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu22',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu20',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu20_msonly',            'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu26',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu22',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu24',                   'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu20_msonly',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu14',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu11',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu14_iloose',            'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu14_ivarloose',         'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu10',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu10_msonly',            'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu6',                    'L1_MU6',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu6_msonly',             'L1_MU6',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu4',                    'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu4_msonly',             'L1_MU4',            [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu24_idperf',            'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
-        ['mu20_idperf',            'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu24_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu20_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu40_idperf',            'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
         ['mu10_idperf',            'L1_MU10',           [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
         ['mu6_idperf',             'L1_MU6',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
         ['mu4_idperf',             'L1_MU4',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
@@ -89,9 +75,15 @@ def setupMenu():
         ['mu4_nomucomb',                   'L1_MU4',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu6_nomucomb',                   'L1_MU6',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu10_nomucomb',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu11_nomucomb',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu14_nomucomb',                   'L1_MU10',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu20_nomucomb',                   'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu11_nomucomb',                   'L1_MU11',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        #ATR-16981
+        ['mu24_ivarmedium',	     'L1_MU20MU21',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        #Low-mu run triggers
+        ['mu15',     'L1_MU11',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu16',     'L1_MU11',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu18',     'L1_MU11',           [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
 
 				# Toroid-off run (ATR-9923)
         ['mu8_mucombTag_noEF_L1MU40',  'L1_MU20', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
@@ -102,55 +94,38 @@ def setupMenu():
 
         # multi muons
         ['2mu14',                  'L1_2MU10',          [], [PhysicsStream, 'express'], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu15_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu16_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu18_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu14_nomucomb',         'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['3mu6',                   'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['3mu6_msonly',            'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['3mu8_msonly',            'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['3mu10_msonly_L13MU6',    'L1_3MU6',           [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu10',                  'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['2mu10_nomucomb',         'L1_2MU10',          [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['mu24_mu8noL1',           'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream, 'express'], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1']]],
-        ['mu24_mu10noL1',          'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu10noL1']]],
-        ['mu24_2mu4noL1',          'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','2mu4noL1']]],
-        ['mu26_mu8noL1',           'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu8noL1']]],
-        ['mu26_mu10noL1',          'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu10noL1']]],
-        ['mu28_mu8noL1',           'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu28','mu8noL1']]],
-        ['mu22_mu8noL1',           'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1']]],
-        ['mu22_2mu4noL1',          'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','2mu4noL1']]],
-        ['mu20_mu8noL1',           'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','mu8noL1']]],
-        ['mu20_2mu4noL1',          'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu4noL1']]],
-        ['2mu6',                    'L1_2MU6',  [], [PhysicsStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
-        ['2mu4',                    'L1_2MU4',  [], [PhysicsStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
-        ['mu20_2mu2noL1_JpsimumuFS', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_JpsimumuFS']]],  # OI - who owns these triggers? Bphys?
-        ['mu20_2mu4_JpsimumuL2',     'L1_MU20MU21',  ['L1_MU20','L1_2MU4'], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['2mu4_JpsimumuL2','mu20']]], # OI - who owns these triggers?
-        ['mu20_2mu2noL1',            'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1']]],
+        ['2mu15_L12MU10',          'L1_2MU10',          [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['3mu6',                   'L1_3MU6',           [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['3mu6_msonly',            'L1_3MU6',           [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['3mu8_msonly',            'L1_3MU6',           [], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'], -1],
+        ['mu24_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream, 'express'], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1']]],
+        ['mu24_mu10noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu10noL1']]],
+        ['mu24_2mu4noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','2mu4noL1']]],
+        ['mu26_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu8noL1']]],
+        ['mu26_mu10noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu10noL1']]],
+        ['mu28_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu28','mu8noL1']]],
+        ['mu22_mu8noL1',           'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:17000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1']]],
+        ['mu22_2mu4noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','2mu4noL1']]],
+        ['mu20_2mu4noL1',          'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20','2mu4noL1']]],
+        ['mu20_2mu2noL1_JpsimumuFS', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu20','2mu2noL1_JpsimumuFS']]],  # OI - who owns these triggers? Bphys?
+        ['mu20_2mu4_JpsimumuL2',     'L1_MU20MU21', ['L1_MU20','L1_2MU4'], [PhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['2mu4_JpsimumuL2','mu20']]], # OI - who owns these triggers?
         
         # Primary (multi muon chains)
         ['3mu4',                   'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
-
-        #low-pt multi-muon chains, ATR-15704
-        ['3mu4_nomucomb',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
         ['3mu4_mu2noL1',           'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4','mu2noL1']]],
-        ['3mu4_nomucomb_mu2noL1',  'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4_nomucomb','mu2noL1']]],
-        ['2mu4_mu3_mu2noL1_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['2mu4','mu3','mu2noL1']]],
         ['3mu3_mu3noL1_L13MU4',    'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu3','mu3noL1']]],
         ['3mu4_mu4noL1',           'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4','mu4noL1']]],
-        ['3mu4_nomucomb_mu4noL1',  'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4_nomucomb','mu4noL1']]],
         ['4mu4',                   'L1_4MU4', ['L1_4MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['4mu4','']]],
-        ['4mu4_nomucomb',          'L1_4MU4', ['L1_4MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['4mu4_nomucomb','']]],
 
 #				#ATR-15246
-        ['mu22_mu8noL1_mu6noL1',   'L1_MU20MU21',  ['L1_MU20','',''], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'],  -1,['serial',-1,['mu22','mu8noL1','mu6noL1']]],
+        ['mu22_mu8noL1_mu6noL1',   'L1_MU20MU21',       ['L1_MU20','',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon', 'BW:Muon'],  -1,['serial',-1,['mu22','mu8noL1','mu6noL1']]],
 				#ATR-15878
-        ['mu22_mu8noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_calotag_0eta010']]],
-        ['mu24_mu8noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1_calotag_0eta010']]],
-        ['mu26_mu8noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu8noL1_calotag_0eta010']]],
-        ['mu28_mu8noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu28','mu8noL1_calotag_0eta010']]],
-        ['mu24_mu10noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu10noL1_calotag_0eta010']]],
-        ['mu26_mu10noL1_calotag_0eta010', 'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu10noL1_calotag_0eta010']]],
+        ['mu22_mu8noL1_calotag_0eta010',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:17000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_calotag_0eta010']]],
+        ['mu24_mu8noL1_calotag_0eta010',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu8noL1_calotag_0eta010']]],
+        ['mu26_mu8noL1_calotag_0eta010',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu8noL1_calotag_0eta010']]],
+        ['mu28_mu8noL1_calotag_0eta010',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu28','mu8noL1_calotag_0eta010']]],
+        ['mu24_mu10noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu24','mu10noL1_calotag_0eta010']]],
+        ['mu26_mu10noL1_calotag_0eta010', 'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu26','mu10noL1_calotag_0eta010']]],
 
         #DiMuon for TAU OVERLAY
         ['2mu20_L12MU20_OVERLAY',   'L1_2MU20_OVERLAY', [], ['TauOverlay'], ["RATE:TauOverlay",  "BW:TauOverlay"], -1],
@@ -162,24 +137,15 @@ def setupMenu():
         ['mu4_msonly_cosmic_L1MU11_EMPTY',       'L1_MU11_EMPTY', [],  ['CosmicMuons'], ["RATE:Cosmic_Muon", "BW:Muon"], -1],                            
                 
         # muon calibration
-        ['mu0_muoncalib',             'L1_MU20MU21',     ['L1_MU20'],['Muon_Calibration'],["RATE:Calibration","BW:Muon"],-1],
+        ['mu0_muoncalib',             'L1_MU20MU21', ['L1_MU20'],['Muon_Calibration'],["RATE:Calibration","BW:Muon"],-1],
         ['mu0_muoncalib_L1MU4_EMPTY', 'L1_MU4_EMPTY',[],['Muon_Calibration'],["RATE:Calibration","BW:Muon"],-1],
 
         # muon calibration, data scouting
-        ['mu0_muoncalib_ds3',             'L1_MU20MU21',     ['L1_MU20'],['DataScouting_03_CosmicMuons'],["RATE:Calibration","BW:Muon"],-1],        
+        ['mu0_muoncalib_ds3',             'L1_MU20MU21', ['L1_MU20'],['DataScouting_03_CosmicMuons'],["RATE:Calibration","BW:Muon"],-1],        
         ['mu0_muoncalib_ds3_L1MU4_EMPTY', 'L1_MU4_EMPTY',[],['DataScouting_03_CosmicMuons'],["RATE:Calibration","BW:Muon"],-1],   
 
-        # Narrow scan
-        # notes: see ATR-11846
-        # inputTE for narrow scan sequence (2nd inputTE) is a dummy string for MuonDef.py
-        # To indicate narrow scan uses lastTE of previous sequence and also to avoid duplicated sequences with same TE name, write L2_ TE name of the 1st sequence.
-
-        ['mu20_nomucomb_mu6noL1_nscan03',                     'L1_MU20MU21',  ['L1_MU20','L2_mu20_nomucomb'],        [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_nomucomb','mu6noL1_nscan03']]],  #OI need to discuss what to do here
-
-        ['mu11_nomucomb_2mu4noL1_nscan03_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu11_nomucomb'], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_nomucomb','2mu4noL1_nscan03']]], #OI need to discuss what to do here
-
         ## LFV topo based nscan (ATR-14352)
-        ['mu11_nomucomb_2mu4noL1_nscan03_L1LFV-MU', 'L1_LFV-MU', ['L1_MU10','L2_mu11_nomucomb'], [BPhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu11_nomucomb','2mu4noL1_nscan03']]], #OI need to discuss what to do here
+        ['mu11_nomucomb_2mu4noL1_nscan03_L1LFV-MU', 'L1_LFV-MU', ['L1_MU10','L2_mu11_nomucomb'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11_nomucomb','2mu4noL1_nscan03']]], #OI need to discuss what to do here
 	# -----------------------------------------------------
 
         # LLP chains
@@ -189,94 +155,70 @@ def setupMenu():
         ['3mu6_msonly_L1MU4_EMPTY',                              'L1_MU4_EMPTY',        ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1],
         ['3mu6_msonly_L1MU6_EMPTY',                              'L1_MU6_EMPTY',        ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1],
         ['3mu6_msonly_L1MU4_UNPAIRED_ISO',                       'L1_MU4_UNPAIRED_ISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1],
-        ['3mu6_msonly_L1MU4_UNPAIRED_NONISO',                     'L1_MU4_UNPAIRED_NONISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1],
-
-
-        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb',   'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb',   'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]],
 
 
          ### ATR-14377: Emergency additional class of chains instead of mu20_msonly_mu10noL1_msonly_nscan05_noComb*
-         ['mu20_msonly_mu15noL1_msonly_nscan05_noComb',   'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
-
-        ### ATR-14377:
-        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb',   'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]],
-
-        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb',   'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],
-        ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]],        
-
+        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb',   'L1_MU20MU21',   ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU6_EMPTY',          'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
+        ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO',   'L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]],
 
 
-        # exclusive di-lep
-        ['2mu6_10invm30_pt2_z10', 'L1_2MU6', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1],
-
-
-        ['mu6_2mu4', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [PhysicsStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
-        ['mu20_imedium_L1MU10_2J20', 'L1_MU10_2J20', [], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],                
-        ['mu20_ivarmedium_L1MU10_2J20', 'L1_MU10_2J20', [], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],                
-        ['mu20_ivarmedium_L1MU10_2J15_J20', 'L1_MU10_2J15_J20', [], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],  
+        ['mu6_2mu4', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
+        ['mu20_ivarmedium_L1MU10_2J20', 'L1_MU10_2J20', [], [PhysicsStream], ['Primary:20000','RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],                
+        ['mu20_ivarmedium_L1MU10_2J15_J20', 'L1_MU10_2J15_J20', [], [PhysicsStream], ['Primary:17000','RATE:MuonJet', 'BW:Muon','BW:Jet'], -1],  
 
         #nscan05 triggers rejecting CB muons
 
-        ['mu20_msonly_mu6noL1_msonly_nscan05',       'L1_MU20MU21',  ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU6_EMPTY',       'L1_MU6_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO',       'L1_MU4_UNPAIRED_ISO',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_EMPTY',       'L1_MU4_EMPTY',        ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]],
-
-        ### ATR-14377: nscan with different L1 seeds
-        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30',          ['L1_MU20_XE30','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30', ['L1_MU20_XE30','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40',            ['L1_MU20_J40','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40',   ['L1_MU20_J40','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU6_EMPTY', 'L1_MU6_EMPTY',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
-        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_mu6noL1_msonly_nscan05', 'L1_MU20MU21',      ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30', ['L1_MU20_XE30','L2_mu20_msonly_iloosems'], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40',   ['L1_MU20_J40','L2_mu20_msonly_iloosems'], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU6_EMPTY', 'L1_MU6_EMPTY',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO',   ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['Primary:20000','RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]],
+        ['mu6_dRl1_mu20_msonly_iloosems_mu6noL1_dRl1_msonly','L1_MU11_2MU6', [['L1_MU6','L1_MU6'],'L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu6_dRl1','mu20_msonly_iloosems','mu6noL1_dRl1_msonly']]],
 
         #Chains for testing 2e34 menus
-        ['mu32_ivarmedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu36_ivarmedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu40_ivarmedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        ['mu50_ivarmedium',          'L1_MU20MU21',     ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu32_ivarmedium',          'L1_MU20MU21',           ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         
 
         # Bphys item, needs to be in muon slice: ATR-14367
         ['mu6_nomucomb_2mu4_nomucomb_L1MU6_3MU4',          'L1_MU6_3MU4',  ['L1_MU6','L1_2MU4'],          [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
         ['2mu6_nomucomb_mu4_nomucomb_L12MU6_3MU4',          'L1_2MU6_3MU4',  ['L1_2MU6','L1_MU4'],          [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
-
-        # Calotag items ATR-16142
-        ['3mu4_mu2noL1_calotag_0eta010',           'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4','mu2noL1_calotag_0eta010']]],
-        ['2mu4_mu3_mu2noL1_calotag_0eta010_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['2mu4','mu3','mu2noL1_calotag_0eta010']]],
         ['3mu3_mu3noL1_calotag_0eta010_L13MU4',    'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu3','mu3noL1_calotag_0eta010']]],
         ['3mu4_mu4noL1_calotag_0eta010',           'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1,['serial',-1,['3mu4','mu4noL1_calotag_0eta010']]],
 
         #AFP muons
+        ['mu4_L1MU4_AFP_A_AND_C',                        'L1_MU4_AFP_A_AND_C',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['mu4_L1MU4_AFP_A_OR_C',                        'L1_MU4_AFP_A_OR_C',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
         ['mu4_L1MU4',                        'L1_MU4',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        
+        #HMT muons in MB stream (ATR16442)
+        ['mu6_L1MU6',                    'L1_MU6',            [], ['MinBias'], ['RATE:MinBias','BW:MinBias'], -1],
+        ['mu10_L1MU10',                   'L1_MU10',           [], ['MinBias'], ['RATE:MinBias','BW:MinBias'], -1],
+        ['mu11_L1MU10',                   'L1_MU10',           [], ['MinBias'], ['RATE:MinBias','BW:MinBias'], -1],
+        ['mu14_L1MU10',                   'L1_MU10',           [], ['MinBias'], ['RATE:MinBias','BW:MinBias'], -1],
 
-        ]
+
+        ['mu10_mgonly_L1LATE-MU10_J50',          'L1_LATE-MU10_J50',           [], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_mgonly_L1LATE-MU10_XE50',         'L1_LATE-MU10_XE50',          [], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu10_mgonly_L1LATE-MU10_XE40',         'L1_LATE-MU10_XE40',          [], [PhysicsStream], ['Primary:20000','RATE:SingleMuon', 'BW:Muon'], -1],
+	['mu50_mgonly_inTimeRoI',                'L1_MU20MU21',       ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        ['mu60_mgonly_inTimeRoI',                'L1_MU20MU21',       ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+
+        #Low-mu run triggers
+        ['mu4_mu2noL1_L1MU4', 'L1_MU4',  ['L1_MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu4','mu2noL1']]],
+        ['mu6_mu2noL1_L1MU6', 'L1_MU6',  ['L1_MU6',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu6','mu2noL1']]],
+
+			 ]
 
 
     if TriggerFlags.doFTK():
         TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
-            ['mu24_idperf_FTK_L1MU20MU21_FTK',            'L1_MU20MU21_FTK',  ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu24_idperf_FTK_L1MU20MU21_FTK',       'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
             ['mu6_idperf_FTK_L1MU6_FTK',             'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
-            ['mu24_idperf_FTKRefit_L1MU20MU21_FTK',       'L1_MU20MU21_FTK',  ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
+            ['mu24_idperf_FTKRefit_L1MU20MU21_FTK',  'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1], 
             ['mu6_idperf_FTKRefit_L1MU6_FTK',        'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
-            ['mu22_mu8noL1_ftkFS_L1MU20MU21_FTK',         'L1_MU20MU21_FTK',  ['L1_MU20_FTK',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_ftkFS']]],
-            ['mu26_ivarmedium_ftk_L1MU20MU21_FTK',        'L1_MU20MU21_FTK',  ['L1_MU20_FTK'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+            ['mu22_mu8noL1_FTKFS_L1MU20MU21_FTK',    'L1_MU20MU21_FTK', ['L1_MU20_FTK',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_FTKFS']]],
+            ['mu26_ivarmedium_FTK_L1MU20MU21_FTK',   'L1_MU20MU21_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
             ]
 
 
@@ -290,9 +232,15 @@ def setupMenu():
 
         # Jet data scouting stream chains
         # These record only the trigger jets, but for every event passing the L1 trigger
+        ['j0_perf_ds1_L1J50',      'L1_J50',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
         ['j0_perf_ds1_L1J75',      'L1_J75',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
         ['j0_perf_ds1_L1J100',     'L1_J100', [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
 
+        #Low-mu run triggers
+        ['j0_perf_ds1_L1J15',      'L1_J15',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+        ['j0_perf_ds1_L1J20',      'L1_J20',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+        ['j0_perf_ds1_L1J30',      'L1_J30',  [], ['DataScouting_05_Jets'], ['RATE:Jets_DS', 'BW:Jet'], -1],
+
         # Performance chains
         ['ht0_L1J12_EMPTY',        'L1_J12_EMPTY', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j0_L1J12_EMPTY',         'L1_J12_EMPTY', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -319,21 +267,21 @@ def setupMenu():
         ['j360',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j380',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j400',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j420',                        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j440',                        'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j450',                        'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420',                        'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440',                        'L1_J120', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j450',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['j460',                        'L1_J120', [], [PhysicsStream, 'express'], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j480',                        'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j500',                        'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500',                        'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
 
         # Standard gsc central jet triggers (primaries)
         ['j225_gsc400_boffperf_split',  'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc420_boffperf_split',  'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc440_boffperf_split',  'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc450_boffperf_split',  'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc460_boffperf_split',  'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc480_boffperf_split',  'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j225_gsc500_boffperf_split',  'L1_J120', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc420_boffperf_split',  'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc440_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc450_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc460_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc480_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j225_gsc500_boffperf_split',  'L1_J120', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
 
         # Alternative calibration central jet triggers
         ['j35_subjes',                  'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
@@ -356,7 +304,7 @@ def setupMenu():
         ['j450_lcw_nojcalib',           'L1_J120', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
 
         # SoftKiller central jet triggers
-        ['j35_sktc_lcw_nojcalib',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        #['j35_sktc_lcw_nojcalib',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
 
         # Standard forward jet triggers
         ['j15_320eta490',               'L1_RD0_FILLED',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -367,8 +315,8 @@ def setupMenu():
         ['j85_320eta490',               'L1_J20.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
         ['j110_320eta490',              'L1_J30.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
         ['j175_320eta490',              'L1_J50.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490',              'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j360_320eta490',              'L1_J100.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490',              'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j360_320eta490',              'L1_J100.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
 
         # Alternative calibration forward jet triggers
         ['j35_320eta490_subjes',        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
@@ -380,15 +328,15 @@ def setupMenu():
         ['j35_320eta490_lcw_jes',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
         ['j35_320eta490_lcw_sub',       'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
         ['j35_320eta490_lcw_nojcalib',  'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_subjes',       'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_jes',          'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_sub',          'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_nojcalib',     'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_lcw',          'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_lcw_subjes',   'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_lcw_jes',      'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_lcw_sub',      'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
-        ['j260_320eta490_lcw_nojcalib', 'L1_J75.31ETA49', [], [PhysicsStream], ['RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_subjes',       'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_jes',          'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_sub',          'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_nojcalib',     'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw',          'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_subjes',   'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_jes',      'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_sub',      'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
+        ['j260_320eta490_lcw_nojcalib', 'L1_J75.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet',  'BW:Jet'], -1],
         
         
         
@@ -400,11 +348,11 @@ def setupMenu():
         ['j260_a10_lcw_subjes_L1J75',       'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j420_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j440_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j460_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j480_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j460_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['j500_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j520_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j540_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10_lcw_subjes_L1J100',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
 
         # Alternative calibration topocluster large-R jet triggers
         ['j260_a10_sub_L1J75',              'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -428,11 +376,11 @@ def setupMenu():
         ['j260_a10r_L1J75',                 'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j420_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j440_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j460_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j480_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j500_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j520_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j540_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j460_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10r_L1J100',                'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         
         # L1topo standard reclustered large-R jet triggers
         ['j260_a10r_L1SC85',                'L1_SC85-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -446,11 +394,11 @@ def setupMenu():
         ['j260_a10t_lcw_jes_L1J75',         'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j420_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j440_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j460_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j480_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j500_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j520_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j540_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j460_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j480_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j500_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j520_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
+        ['j540_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
 
         # Alternative calibration trimmed large-R jet triggers
         ['j260_a10t_lcw_nojcalib_L1J75',    'L1_J75', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -497,10 +445,10 @@ def setupMenu():
         ['j390_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j390_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',    'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j390_a10t_lcw_jes_40smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j420_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j420_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
         ['j420_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',    'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j420_a10t_lcw_jes_40smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j440_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j440_a10t_lcw_jes_40smcINF_L1J100',               'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['j440_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',    'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j440_a10t_lcw_jes_40smcINF_L1SC111',              'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
@@ -540,13 +488,13 @@ def setupMenu():
         ['2j350_a10t_lcw_jes_35smcINF_L1HT190-J15.ETA21',   'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j350_a10t_lcw_jes_35smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
-        ['2j330_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j330_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['2j330_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',   'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j330_a10t_lcw_jes_40smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['2j340_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j340_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['2j340_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',   'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j340_a10t_lcw_jes_40smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['2j350_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['2j350_a10t_lcw_jes_40smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
         ['2j350_a10t_lcw_jes_40smcINF_L1HT190-J15.ETA21',   'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j350_a10t_lcw_jes_40smcINF_L1SC111',             'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
@@ -563,6 +511,11 @@ def setupMenu():
         ['j350_a10t_lcw_jes_40smcINF_j300_a10t_lcw_jes_40smcINF_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j320_a10t_lcw_jes_40smcINF_j250_a10t_lcw_jes_40smcINF_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
+        ['j310_a10t_lcw_jes_60smcINF_j310_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j325_a10t_lcw_jes_60smcINF_j325_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j340_a10t_lcw_jes_60smcINF_j340_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j360_a10t_lcw_jes_60smcINF_j360_a10t_lcw_jes_L1SC111',   'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+
         # Trimmed + mass-cut di-jet support triggers (for mass efficiency bootstrap)
         ['2j330_a10t_lcw_jes_L1J100',                       'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j330_a10t_lcw_jes_L1HT190-J15.ETA21',            'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -574,31 +527,33 @@ def setupMenu():
         ['2j350_a10t_lcw_jes_L1HT190-J15.ETA21',            'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['2j350_a10t_lcw_jes_L1SC111',                      'L1_SC111-CJ15', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
-
+        #Low-mu run triggers
+        ['j360_a10_lcw_subjes_L1J100',     'L1_J100',[], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j110_a10_lcw_subjes_L1J30',      'L1_J30', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
         #####
         ######################### Multi-jet small-R trigger chains
         #####
 
         # 3-jet single threshold triggers
-        ['3j200',                       'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['3j225',                       'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['3j250',                       'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j200',                       'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j225',                       'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['3j250',                       'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 4-jet single threshold triggers
         ['4j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['4j45',                        'L1_3J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['4j100',                       'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['4j110',                       'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['4j120',                       'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['4j130',                       'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j120',                       'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j130',                       'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 4-jet gsc single threshold triggers
         ['4j60_gsc100_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['4j60_gsc110_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['4j60_gsc115_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['4j70_gsc120_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['4j70_gsc130_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j60_gsc115_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j70_gsc120_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['4j70_gsc130_boffperf_split',  'L1_3J50', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 4-jet single threshold alternative calibration triggers
         ['4j45_subjes',                 'L1_3J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
@@ -617,45 +572,45 @@ def setupMenu():
         ['5j70_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j70_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j70',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j85_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j85_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j85',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j90_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j90',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j100_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j100',                       'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_L14J15',                 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85',                        'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j90',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j100_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j100',                       'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 5-jet gsc single threshold triggers
         ['5j50_gsc70_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j50_gsc70_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j55_gsc75_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j55_gsc75_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc85_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc90_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc90_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc100_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j60_gsc100_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc85_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc90_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc90_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc100_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j60_gsc100_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 5-jet single threshold restricted eta range triggers
         ['5j65_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j65_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j65_0eta240',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j70_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j70_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j70_0eta240',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j75_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j75_0eta240',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j85_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j85_0eta240',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j70_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j75_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j75_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j85_0eta240',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
  
         # 5-jet gsc single threshold restricted eta range triggers
         ['5j50_gsc65_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['5j50_gsc65_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j50_gsc70_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j50_gsc70_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j55_gsc75_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['5j55_gsc75_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc70_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j50_gsc70_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['5j55_gsc75_boffperf_split_0eta240',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 6-jet single threshold triggers
         ['6j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],        
@@ -663,11 +618,11 @@ def setupMenu():
         ['6j60_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j60_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j60',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j70_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j70_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j70',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j85_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j85',                        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j70_L14J15',                 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j70_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j70',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j85_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j85',                        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 6-jet gsc single threshold triggers
         ['6j45_gsc60_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
@@ -676,12 +631,12 @@ def setupMenu():
         ['6j50_gsc65_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j50_gsc65_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j50_gsc65_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j50_gsc70_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j50_gsc70_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j50_gsc70_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_gsc85_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_gsc85_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc70_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc70_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j50_gsc70_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split',               'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_gsc85_boffperf_split_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 6-jet single threshold restricted eta range triggers
         ['6j45_0eta240',                'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
@@ -692,13 +647,13 @@ def setupMenu():
         ['6j50_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j50_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j50_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j55_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j55_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j55_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j55_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j60_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L14J15',         'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j55_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j60_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 6-jet gsc single threshold restricted eta range triggers
         ['6j25_gsc45_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
@@ -707,12 +662,12 @@ def setupMenu():
         ['6j25_gsc50_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j25_gsc50_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['6j25_gsc50_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j35_gsc55_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j35_gsc55_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j35_gsc55_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j45_gsc60_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j45_gsc60_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['6j45_gsc60_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc55_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc55_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j35_gsc55_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['6j45_gsc60_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 6-jet single threshold alternative calibration triggers
         ['6j45_subjes',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
@@ -727,41 +682,41 @@ def setupMenu():
 
         # 7-jet single-threshold triggers
         ['7j25',                        'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],      
-        ['7j45_L14J15',                 'L1_4J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45_L14J20',                 'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45',                        'L1_6J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j50_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j50_L14J20',                 'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j50',                        'L1_6J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_L14J15',                 'L1_4J15', [], [PhysicsStream], ['Primary:17000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_L14J20',                 'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45',                        'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50_L14J150ETA25',           'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50_L14J20',                 'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j50',                        'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 7-jet gsc single threshold triggers
-        ['7j25_gsc45_boffperf_split_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc45_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc45_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_L14J150ETA25',          'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_L14J20',                'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_L15J150ETA25',          'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 7-jet single-threshold restricted eta range triggers
-        ['7j45_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j45_0eta240',                'L1_6J15', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240_L14J150ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240_L14J20',         'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240_L15J150ETA25',   'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j45_0eta240',                'L1_6J15', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         
         # 7-jet gsc single threshold restricted eta range triggers
-        ['7j25_gsc45_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc45_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc45_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['7j25_gsc50_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc45_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_0eta240_L14J150ETA25',  'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_0eta240_L14J20',        'L1_4J20', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['7j25_gsc50_boffperf_split_0eta240_L15J150ETA25',  'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
 
         # 10-jet single-threshold triggers
-        ['10j40_L14J15',                'L1_4J15' , [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['10j40_L14J150ETA25',          'L1_4J15.0ETA25' , [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['10j40_L14J20',                'L1_4J20' , [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['10j40_L16J15',                'L1_6J15' , [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['10j40_L14J15',                'L1_4J15' , [], [PhysicsStream], ['Primary:17000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['10j40_L14J150ETA25',          'L1_4J15.0ETA25' , [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['10j40_L14J20',                'L1_4J20' , [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['10j40_L16J15',                'L1_6J15' , [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
 
         # L1topo multi-jet triggers
         ['5j65_0eta240_L1J4-MATCH',     'L1_J4-MATCH', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
@@ -781,9 +736,9 @@ def setupMenu():
         # HT triggers
         ['ht700_L1J75',     'L1_J75', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1], 
         ['ht700_L1J100',    'L1_J100', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['ht1000_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['ht1200_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['ht1400_L1J100',   'L1_J100', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht1000_L1J100',   'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht1200_L1J100',   'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
+        ['ht1400_L1J100',   'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet', 'BW:Jet'], -1],
 
         # L1topo HT triggers
         ['ht700_L1HT150-J20.ETA31',     'L1_HT150-J20.ETA31', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -807,31 +762,14 @@ def setupMenu():
         ['j0_0i1c500m900TLA',               'L1_J100',  [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
         ['j0_1i2c200m8000TLA',              'L1_J100',  [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
 
-        # Delayed stream dijet invariant mass range plus y* cut triggers, mainly aimed at the dijet trigger-level analysis
-        # See ATR-14091 for details of the request
-        ['j0_0i1c500m900TLA_delayed',       'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
-        ['j0_1i2c200m8000TLA_delayed',      'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
-        ['j0_0i1c500m2000TLA_delayed',      'L1_J100',  [], ['ExoDelayed'], ['RATE:ExoDelayed', 'BW:Jet'], -1],
-
-        # Analysis-driven multijet triggers
-        ['j80_0eta240_2j60_320eta490',      'L1_J40.0ETA25_2J15.31ETA49', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-
         ['2j220_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['2j250_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j250_j140',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j250_j150',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j275_j120',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
         ['2j275_j140',                      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j220_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j250_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j250_0eta240_j140_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j275_0eta240_j120_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j275_0eta240_j140_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j225_gsc250_boffperf_split_0eta240_j70_gsc120_boffperf_split_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
-        ['2j225_gsc250_boffperf_split_0eta240_j70_gsc140_boffperf_split_0eta240',      'L1_J100', [], [PhysicsStream], ['RATE:MultiJet',  'BW:Jet'], -1],
 
-        # VBF triggers
-        ['2j40_0eta490_invm250_L1XE55',     'L1_XE55', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        # Analysis-driven multijet triggers
+        ['j80_0eta240_2j60_320eta490',      'L1_J40.0ETA25_2J15.31ETA49', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
+        ['2j225_gsc250_boffperf_split_0eta240_j70_gsc120_boffperf_split_0eta240',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
+        ['2j225_gsc250_boffperf_split_0eta240_j70_gsc140_boffperf_split_0eta240',      'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiJet',  'BW:Jet'], -1],
         ['j80_0eta240_j60_j45_320eta490',   'L1_J40.0ETA25_2J25_J20.31ETA49', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j40_0eta490_invm400',            'L1_MJJ-400', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
 
@@ -839,7 +777,7 @@ def setupMenu():
         ['ht300_2j40_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'],-1,['serial',-1,['ht300', '2j40_0eta490_invm700']]],
         # ATR-15044: 2017 VBF Hbb
         ['ht300_2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF','L1_HT150-J20s5.ETA31_MJJ-400-CF', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:Jet'],-1,['serial',-1,[  'ht300', '2j40_0eta490_invm700']]],
-        ['ht300_2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF_AND_2j25_gsc45_bmv2c1070_split','L1_HT150-J20s5.ETA31_MJJ-400-CF', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet', 'BW:Jet'],-1,['serial',-1,[  'ht300', '2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF_AND','2j25_gsc45_bmv2c1070_split']]],
+        ['ht300_2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF_AND_2j25_gsc45_bmv2c1070_split','L1_HT150-J20s5.ETA31_MJJ-400-CF', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet',  'BW:BJet', 'BW:Jet'],-1,['serial',-1,[  'ht300', '2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF_AND','2j25_gsc45_bmv2c1070_split']]],
 
         #####
         ######################### Specialty jet trigger chains (mostly for performance studies)
@@ -848,11 +786,6 @@ def setupMenu():
         # Jet triggers to probe the EMEC IW region
         # This region is know to be more challenging
         ['j60_280eta320',       'L1_J20.28ETA31', [], [PhysicsStream, 'express'], ['RATE:SingleJet',  'BW:Jet'], -1],
-
-        # Central+forward (dijet) triggers
-        ['j15_j15_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['j25_j25_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
-        ['j45_j45_320eta490',   'L1_RD0_FILLED',      [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
         ['j60_j60_320eta490',   'L1_J20_J20.31ETA49', [], [PhysicsStream], ['RATE:MultiJet', 'BW:Jet'], -1],
 
         # Jet cleaning chains to probe NCB
@@ -886,7 +819,12 @@ def setupMenu():
         ['j10_320eta490_L1MBTS_2',          'L1_MBTS_2', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['2j10_deta20_L1MBTS_2',            'L1_MBTS_2', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-    ]
+        #Low-mu run triggers
+        ['j45_L1AFP_A_OR_C_J12',          'L1_AFP_A_OR_C_J12',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['j45_L1AFP_A_AND_C_J12',         'L1_AFP_A_AND_C_J12',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['j45_L1J12',                     'L1_J12', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+			 ]
 
     TriggerFlags.BjetSlice.signatures = [
    
@@ -899,11 +837,6 @@ def setupMenu():
         ['j0_perf_boffperf_L1MU10',       'L1_MU10',[], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j0_perf_boffperf_L1J12_EMPTY',  'L1_J12_EMPTY',[], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
-        # bperf
-        ['j35_bperf',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j55_bperf',  'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j150_bperf', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j320_bperf', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         # boffperf
         ['j35_boffperf',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
@@ -911,11 +844,6 @@ def setupMenu():
         ['j150_boffperf', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j320_boffperf', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
-        # bperf_split
-        ['j35_bperf_split',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j55_bperf_split',  'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j150_bperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j320_bperf_split', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         # bperf_split
         ['j35_boffperf_split',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
@@ -926,54 +854,27 @@ def setupMenu():
 
         #  gsc
         ['j15_gsc35_boffperf_split',   'L1_RD0_FILLED', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j25_gsc45_boffperf_split',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j35_gsc55_boffperf_split', 'L1_J15', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j50_gsc65_boffperf_split', 'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j60_gsc85_boffperf_split', 'L1_J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j60_gsc110_boffperf_split', 'L1_J20', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], 
-        ['j110_gsc150_boffperf_split', 'L1_J30', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j150_gsc175_boffperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j175_gsc225_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j175_gsc260_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc275_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j225_gsc320_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc300_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc360_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc380_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        # NOTE: gsc400 and higher boffperf chains are candidates for jet primaries
-        # As such, they have been switched to RATE:SingleJet and BW:Jet, and moved to the jet section
-
-        #
-        # tagged 
-        #
-        ['j225_bmv2c1040_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j275_bmv2c1060_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j300_bmv2c1070_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j360_bmv2c1077_split',        'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
         
-        ['j175_gsc225_bmv2c1040_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j175_gsc225_bmv2c1040_split', 'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],
         ['j175_gsc225_bmv2c1050_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],        
-        ['j175_gsc225_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
-        ['j225_gsc275_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc275_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc275_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc275_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
-        ['j225_gsc300_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j225_gsc300_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc300_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j225_gsc300_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
-        ['j225_gsc360_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
+        ['j225_gsc360_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],                   
         ['j225_gsc360_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
 
-        ['j225_gsc400_bmv2c1085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
-
-
-        #
-        #  1b / 3j
-        #
-        ['j55_gsc80_bmv2c1085_split_2j60_320eta490', 'L1_J40.0ETA25_2J15.31ETA49', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
 
         # 
         #  1b / 4j
@@ -981,137 +882,101 @@ def setupMenu():
 
         ['j50_gsc65_boffperf_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
         ['j50_gsc65_bmv2c1040_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
-        ['j50_gsc65_bmv2c1050_split_3j50_gsc65_boffperf_split',      'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:SingleBJet',  'BW:BJet'], -1],
 
         ['j55_gsc75_boffperf_split_3j55_gsc75_boffperf_split',        'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j55_gsc75_bmv2c1040_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j55_gsc75_bmv2c1040_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],
         ['j55_gsc75_bmv2c1050_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j55_gsc75_bmv2c1060_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j55_gsc75_bmv2c1070_split_3j55_gsc75_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
 
         ['j60_gsc85_boffperf_split_3j60_gsc85_boffperf_split',        'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j60_gsc85_bmv2c1050_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j60_gsc85_bmv2c1050_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet'], -1],
         ['j60_gsc85_bmv2c1060_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j60_gsc85_bmv2c1070_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j60_gsc85_bmv2c1077_split_3j60_gsc85_boffperf_split',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        
-        # 
-        #  2b / 2j
-        #
-
-        ['j175_bmv2c1060_split_j60_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         ['j150_gsc175_boffperf_split_j45_gsc60_boffperf_split',   'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['j150_gsc175_bmv2c1060_split_j45_gsc60_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j150_gsc175_bmv2c1060_split_j45_gsc60_bmv2c1060_split', 'L1_J100', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['j150_gsc175_bmv2c1070_split_j45_gsc60_bmv2c1070_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['j150_gsc175_bmv2c1077_split_j45_gsc60_bmv2c1077_split', 'L1_J100', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
-        #
-        # 2b / 3j
-        #
-
-        ['2j55_gsc75_boffperf_split_j55_gsc75_boffperf_split_L13J40', 'L1_3J40', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j50_gsc70_boffperf_split_j50_gsc70_boffperf_split_L13J40', 'L1_3J40', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
-        ['j110_gsc150_boffperf_split_2j35_gsc55_boffperf_split',  'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1050_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1060_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1070_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1077_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
-        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1070_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1070_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1077_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['j110_gsc150_boffperf_split_2j35_gsc55_boffperf_split_L1J85_3J30', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
-        ['2j55_gsc75_boffperf_split_j55_gsc75_boffperf_split',         'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_gsc75_bmv2c1050_split_j55_gsc75_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j55_gsc75_bmv2c1060_split_j55_gsc75_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         ['2j60_gsc85_bmv2c1070_split_j60_gsc85_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j60_gsc85_bmv2c1077_split_j60_gsc85_boffperf_split',        'L1_3J25.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
-        #
-        # 2b / 4j
-        #
-        ['2j35_boffperf_split_2j35_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_boffperf_split_2j15_gsc35_boffperf_split_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
         ['2j35_boffperf_split_2j35_L14J15.0ETA25',            'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
         ['2j15_gsc35_boffperf_split_2j15_gsc35_boffperf_split_L14J15.0ETA25','L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet',  'BW:BJet'], -1],
 
-        ['2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j15_gsc35_bmv2c1050_split_2j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j15_gsc35_bmv2c1060_split_2j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
-        ['2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_bmv2c1050_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_bmv2c1060_split_2j15_gsc35_boffperf_split_L14J20',        'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
 
-        ['2j25_gsc45_bmv2c1050_split_2j25_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1050_split_2j25_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j25_gsc45_bmv2c1060_split_2j25_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j25_gsc45_bmv2c1070_split_2j25_gsc45_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
-        ['2j35_gsc55_bmv2c1060_split_2j35_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_gsc55_bmv2c1060_split_2j35_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j35_gsc55_bmv2c1070_split_2j35_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j35_gsc55_bmv2c1077_split_2j35_gsc55_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
 
         #
         #  2b / 5j
         #
-        ['2j15_gsc35_bmv2c1050_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1050_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j15_gsc35_bmv2c1060_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_bmv2c1070_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_bmv2c1077_split_3j15_gsc35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         ['2j25_gsc45_bmv2c1050_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j25_gsc45_bmv2c1060_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j25_gsc45_bmv2c1060_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j25_gsc45_bmv2c1070_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j25_gsc45_bmv2c1077_split_3j25_gsc45_boffperf_split',                 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         ['2j25_gsc45_bmv2c1050_split_3j25_gsc45_boffperf_split_L14J15.0ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j25_gsc45_bmv2c1060_split_3j25_gsc45_boffperf_split_L14J15.0ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j25_gsc45_bmv2c1070_split_3j25_gsc45_boffperf_split_L14J15.0ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j25_gsc45_bmv2c1077_split_3j25_gsc45_boffperf_split_L14J15.0ETA25',   'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         #
         #  3b / 3j
         #
         ['3j65_boffperf_split_L13J35.0ETA23',        'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
         ['3j50_gsc65_boffperf_split_L13J35.0ETA23',  'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
-        ['3j50_gsc65_bmv2c1070_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['3j50_gsc65_bmv2c1077_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['3j50_gsc65_bmv2c1085_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j50_gsc65_bmv2c1077_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
 
         #
         #  3b / 4j
         #
         ['3j15_gsc35_bmv2c1060_split_j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['3j15_gsc35_bmv2c1070_split_j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j15_gsc35_bmv2c1070_split_j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['3j15_gsc35_bmv2c1077_split_j15_gsc35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
-        ['3j15_gsc35_bmv2c1060_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['3j15_gsc35_bmv2c1070_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['3j15_gsc35_bmv2c1077_split_j15_gsc35_boffperf_split', 'L1_4J20',        [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-
         #
         #  4b 
         #
-        ['4j15_gsc35_bmv2c1077_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['4j15_gsc35_bmv2c1077_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['4j15_gsc35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         ['2j15_gsc35_bmv2c1060_split_2j15_gsc35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
-        ['2j15_gsc35_bmv2c1070_split_2j15_gsc35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j15_gsc35_bmv2c1070_split_2j15_gsc35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
         ['2j15_gsc35_bmv2c1077_split_2j15_gsc35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         #
         # L1Topo VBF MJJ bjets
         #
-        ['j55_gsc80_bmv2c1070_split_j45_gsc60_bmv2c1085_split_j45_320eta490', 'L1_J40.0ETA25_2J25_J20.31ETA49', [], [PhysicsStream], ['RATE:MultiBJet','BW:BJet'], -1],
-
-        ] # BjetSlice
+        ['j55_gsc80_bmv2c1070_split_j45_gsc60_bmv2c1085_split_j45_320eta490', 'L1_J40.0ETA25_2J25_J20.31ETA49', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet','BW:BJet'], -1],
+
+				# Backup ATR-16986
+        ['2j35_bmv2c1040_split_2j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1050_split_2j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1060_split_2j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1050_split_3j35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1060_split_3j35_boffperf_split', 'L1_5J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j35_bmv2c1060_split_j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j35_bmv2c1070_split_j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j35_bmv2c1077_split_j35_boffperf_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['4j35_bmv2c1077_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['4j35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1060_split_2j35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1070_split_2j35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet'], -1],
+        ['2j35_bmv2c1077_split_2j35_bmv2c1085_split_L14J15.0ETA25', 'L1_4J15.0ETA25', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+			 ]
    
 
     if TriggerFlags.doFTK():
@@ -1163,32 +1028,10 @@ def setupMenu():
         ['xe0noL1_l2fsperf_mht',     '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe0noL1_l2fsperf_mht_em',     '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe0noL1_l2fsperf_pufit',   '',        [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-#        ['xe0noL1_l2fsperf_trkmht_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-
-   #L1_XE35
-        ['xe35', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe35_tc_lcw', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe35_tc_em', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe35_pufit', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe35_mht', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe35_mht_em', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe35_trkmht_FTK', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
         ['xe50', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-#Supporting MET triggers
-        ['xe45_pufit_wEFMu',          'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_wEFMu',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_mht_wEFMu',            'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_tc_lcw',               'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_tc_em',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_mht',                  'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45',                      'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_tc_lcw_wEFMu',         'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_tc_em_wEFMu',          'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_pufit',                'L1_XE45',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe45_mht_xe45', 'L1_XE45',['L1_XE45','L1_XE45'], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1, ['serial',-1,['xe45_mht','xe45_L1XE45']]],
-
   ###############      
   ## L1_XE50 ####
   ###############
@@ -1214,8 +1057,8 @@ def setupMenu():
  	['xe110_tc_em_wEFMu_L1XE50',          'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
  	['xe110_tc_lcw_L1XE50',               'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
  	['xe110_tc_lcw_wEFMu_L1XE50',         'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
- 	['xe110_pufit_L1XE50',                'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
- 	['xe110_pufit_wEFMu_L1XE50',                'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+ 	['xe110_pufit_L1XE50',                'L1_XE50',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
+ 	['xe110_pufit_wEFMu_L1XE50',                'L1_XE50',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
 #        ['xe110_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe110_trkmht_FTK_wEFMu_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1], 
 
@@ -1223,8 +1066,8 @@ def setupMenu():
         ['xe120_mht_em_L1XE50',                'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_em_L1XE50',                'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_lcw_L1XE50',               'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe120_pufit_L1XE50',                'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe120_pufit_wEFMu_L1XE50',                'L1_XE50',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_pufit_L1XE50',                'L1_XE50',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
+        ['xe120_pufit_wEFMu_L1XE50',                'L1_XE50',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
 #        ['xe120_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
         ['xe130_mht_L1XE50',                'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
@@ -1256,7 +1099,7 @@ def setupMenu():
         ['xe90_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe90_mht','xe80_L1XE50'] ]],
         ['xe100_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe100_mht','xe80_L1XE50'] ]],
         ['xe110_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_mht','xe80_L1XE50'] ]],
-	['xe120_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE50'] ]],
+	['xe120_mht_xe80_L1XE50','L1_XE50', ['L1_XE50','L1_XE50'], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE50'] ]],
 
      ## mht + trkmht ##
 
@@ -1294,8 +1137,8 @@ def setupMenu():
         ['xe100_pufit_wEFMu_L1XE55',                'L1_XE55', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe100_trkmht_FTK_L1XE55', 'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-        ['xe110_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe110_wEFMu_L1XE55',                'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe110_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
+        ['xe110_wEFMu_L1XE55',                'L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
         ['xe110_mht_L1XE55',                   'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe110_mht_wEFMu_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe110_mht_em_L1XE55',                   'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
@@ -1304,21 +1147,21 @@ def setupMenu():
  	['xe110_tc_em_wEFMu_L1XE55',          'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 	['xe110_tc_lcw_L1XE55',               'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
  	['xe110_tc_lcw_wEFMu_L1XE55',         'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-	['xe110_pufit_L1XE55',                'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
- 	['xe110_pufit_wEFMu_L1XE55',                'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+	['xe110_pufit_L1XE55',                'L1_XE55',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
+ 	['xe110_pufit_wEFMu_L1XE55',                'L1_XE55',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
 #        ['xe110_trkmht_FTK_L1XE55', 'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe110_trkmht_FTK_wEFMu_L1XE55', 'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-        ['xe120_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe120_L1XE55',                      'L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
         ['xe120_mht_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_mht_em_L1XE55',                   'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_em_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_lcw_L1XE55',               'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-  	['xe120_pufit_L1XE55',                'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe120_pufit_wEFMu_L1XE55',              'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+  	['xe120_pufit_L1XE55',                'L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
+        ['xe120_pufit_wEFMu_L1XE55',              'L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
 #        ['xe120_trkmht_FTK_L1XE55', 'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-        ['xe130_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+        ['xe130_L1XE55','L1_XE55',[], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET'], -1],
         ['xe130_mht_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe130_mht_em_L1XE55',                   'L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe130_tc_em_L1XE55','L1_XE55',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
@@ -1351,7 +1194,7 @@ def setupMenu():
         ['xe90_mht_xe80_L1XE55', 'L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe90_mht','xe80_L1XE55'] ]],
         ['xe100_mht_xe80_L1XE55','L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe100_mht','xe80_L1XE55'] ]],
         ['xe110_mht_xe80_L1XE55','L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_mht','xe80_L1XE55'] ]],
-	['xe120_mht_xe80_L1XE55','L1_XE55',  ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE55'] ]],
+	['xe120_mht_xe80_L1XE55','L1_XE55',  ['L1_XE55','L1_XE55'], [PhysicsStream], ['Primary:17000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE55'] ]],
 	['xe130_mht_xe80_L1XE55','L1_XE55',  ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe130_mht','xe80_L1XE55'] ]],
 
 
@@ -1391,7 +1234,7 @@ def setupMenu():
         ['xe100_pufit_wEFMu_L1XE60',               'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe100_trkmht_FTK_L1XE60', 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
- 	['xe110_pufit_L1XE60',                 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+ 	['xe110_pufit_L1XE60',                 'L1_XE60',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
         ['xe110_pufit_wEFMu_L1XE60',               'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe110_trkmht_FTK_L1XE60', 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
@@ -1405,8 +1248,8 @@ def setupMenu():
         ['xe120_tc_em_wEFMu_L1XE60',         'L1_XE60', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_lcw_L1XE60',               'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe120_tc_lcw_wEFMu_L1XE60',        'L1_XE60', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
- 	['xe120_pufit_L1XE60',                 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xe120_pufit_wEFMu_L1XE60',         'L1_XE60', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+ 	['xe120_pufit_L1XE60',                 'L1_XE60',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
+        ['xe120_pufit_wEFMu_L1XE60',         'L1_XE60', [], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
 #        ['xe120_trkmht_FTK_L1XE60', 'L1_XE60',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe120_trkmht_FTK_wEFMu_L1XE60', 'L1_XE60', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
@@ -1444,7 +1287,7 @@ def setupMenu():
 	['xe90_mht_xe80_L1XE60',  'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe90_mht','xe80_L1XE60'] ]],
 	['xe100_mht_xe80_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe100_mht','xe80_L1XE60'] ]],
 	['xe110_mht_xe80_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_mht','xe80_L1XE60'] ]],
-	['xe120_mht_xe80_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE60'] ]],
+	['xe120_mht_xe80_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe80_L1XE60'] ]],
 	['xe130_mht_xe80_L1XE60', 'L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe130_mht','xe80_L1XE60'] ]],
 
      ## mht + trkmht ##
@@ -1484,14 +1327,14 @@ def setupMenu():
 	['xe100_pufit_L1XE70',                 'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
         ['xe100_pufit_wEFMu_L1XE70',          'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
-	['xe110_pufit_L1XE70',                 'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+	['xe110_pufit_L1XE70',                 'L1_XE70',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
         ['xe110_pufit_wEFMu_L1XE70',          'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
  	['xe120_mht_L1XE70',                   'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1], 
 	['xe120_mht_em_L1XE70',                   'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1], 
         ['xe120_tc_em_L1XE70',         'L1_XE70', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 	['xe120_tc_lcw_L1XE70',               'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-	['xe120_pufit_L1XE70',                 'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+	['xe120_pufit_L1XE70',                 'L1_XE70',[], [PhysicsStream], ['Primary:20000','RATE:MET', 'BW:MET'], -1],
         ['xe120_pufit_wEFMu_L1XE70',          'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 #        ['xe120_trkmht_FTK_L1XE70', 'L1_XE70',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
 
@@ -1605,12 +1448,21 @@ def setupMenu():
 	['xe110_mht_xe70_L1KF-XE75', 'L1_KF-XE75', ['L1_KF-XE75','L1_KF-XE75'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_mht','xe70_L1KF-XE75'] ]],
 	['xe120_mht_xe70_L1KF-XE75', 'L1_KF-XE75', ['L1_KF-XE75','L1_KF-XE75'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_mht','xe70_L1KF-XE75'] ]],
 
-    ## XS triggers ##	
-        ['xs15_L1XS20',                            'L1_XS20',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
-        ['xs20_L1XS30',                            'L1_XS30',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+### ATR-16713 mht+pufit
 
+        ['xe100_trkmht_xe100_pufit_L1XE55','L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe100_trkmht','xe100_pufit_L1XE55'] ]],
+        ['xe100_trkmht_xe100_pufit_L1XE60','L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe100_trkmht','xe100_pufit_L1XE60'] ]],
+        ['xe110_trkmht_xe100_pufit_L1XE55','L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_trkmht','xe100_pufit_L1XE55'] ]],
+        ['xe110_trkmht_xe100_pufit_L1XE60','L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_trkmht','xe100_pufit_L1XE60'] ]],
+        ['xe120_trkmht_xe100_pufit_L1XE55','L1_XE55', ['L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht','xe100_pufit_L1XE55'] ]],
+        ['xe120_trkmht_xe100_pufit_L1XE60','L1_XE60', ['L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht','xe100_pufit_L1XE60'] ]],
+
+        ['xe110_trkmht_xe110_mht_xe80_L1XE55','L1_XE55', ['L1_XE55','L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_trkmht','xe110_mht','xe80_L1XE55'] ]],
+        ['xe110_trkmht_xe110_mht_xe80_L1XE60','L1_XE60', ['L1_XE60','L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe110_trkmht','xe110_mht','xe80_L1XE60'] ]],
+        ['xe120_trkmht_xe110_mht_xe80_L1XE55','L1_XE55', ['L1_XE55','L1_XE55','L1_XE55'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht','xe110_mht','xe80_L1XE55'] ]],
+        ['xe120_trkmht_xe110_mht_xe80_L1XE60','L1_XE60', ['L1_XE60','L1_XE60','L1_XE60'], [PhysicsStream], ['RATE:MET', 'BW:MET' ], -1, ['serial',-1,['xe120_trkmht','xe110_mht','xe80_L1XE60'] ]],
 	
-    ]
+			 ]
     if TriggerFlags.doFTK():
         TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [
            # FTK MET chains
@@ -1659,20 +1511,10 @@ def setupMenu():
         ['tau25_perf_track',                       'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_perf_tracktwo',                    'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_perf_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        # Run-II - No BDT: variations
-        ['tau25_perf_ptonly',                      'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau25_perf_ptonly_L1TAU12',              'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        # Run-II - With BDT: main track-based items
-        ['tau25_medium1_track',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_loose1_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_medium1_tracktwo',                 'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_tight1_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_medium1_tracktwo_L1TAU12',         'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        # Run-II - With BDT: main calo-based items
-        # Run-II - With BDT: pt only
-        ['tau25_loose1_ptonly',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau25_medium1_ptonly',                   'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau25_tight1_ptonly',                    'L1_TAU12IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         # Run-II - High-pT variations
         ['tau35_loose1_tracktwo',                  'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau35_medium1_tracktwo',                 'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
@@ -1687,49 +1529,53 @@ def setupMenu():
         ['tau160_idperf_tracktwo',                 'L1_TAU60', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Tau', 'BW:ID'], -1],
 
         # chains for 2e34 backup (ATR-15225)
-        ['tau160_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau200_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['Primary:20000','RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau200_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['Primary:20000','RATE:SingleTau', 'BW:Tau'], -1],
 
-        ['tau0_perf_ptonly_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau160_idperf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau160_perf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau0_perf_ptonly_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_idperf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau160_perf_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
 
         ['tau35_perf_tracktwo_tau25_perf_tracktwo', 'L1_TAU20IM_2TAU12IM' , ['L1_TAU20IM','L1_TAU12IM'],[PhysicsStream, 'express'], ['RATE:MultiTau','BW:Tau'], -1],
         
         ['tau35_loose1_tracktwo_tau25_loose1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_loose1_tracktwo","tau25_loose1_tracktwo"]]],
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
-        ['tau40_medium1_tracktwo_tau35_medium1_tracktwo',   'L1_TAU25IM_2TAU20IM_2J25_3J20',['L1_TAU25IM','L1_TAU20IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau40_medium1_tracktwo","tau35_medium1_tracktwo"]]],
+        ['tau40_medium1_tracktwo_tau35_medium1_tracktwo',   'L1_TAU25IM_2TAU20IM_2J25_3J20',['L1_TAU25IM','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau40_medium1_tracktwo","tau35_medium1_tracktwo"]]],
         ['tau35_tight1_tracktwo_tau25_tight1_tracktwo',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
-        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12',   'L1_TAU20IM_2TAU12IM_4J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12',   'L1_TAU20IM_2TAU12IM_4J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
 
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM',   'L1_TAU20IM_2TAU12IM',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
 
 	# l1topo ditau chains
 	['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20ITAU12I-J25',   'L1_TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]]	,
 	['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I',   'L1_DR-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
-        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
-        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
-        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1BOX-TAU20ITAU12I',   'L1_BOX-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
 
         # tau+tau topo_start_from
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I',   'L1_DR-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]],True],
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_notautsf_L1DR-TAU20ITAU12I',   'L1_DR-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]],False],
-        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]],True],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]],True],
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_notautsf_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]],False],
 
 	['tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I',   'L1_DR-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
-        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
+        ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo"]]],
 
         # chains for 2e34 backup (ATR-15225)
         ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30',   'L1_TAU20IM_2TAU12IM_J25_2J20_3J12',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
         ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I',   'L1_DR-TAU20ITAU12I',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
-        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
+        ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',   'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]],
 
 
-        ['tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12I',   'L1_TAU60_DR-TAU20ITAU12I',['L1_TAU60','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau35_medium1_tracktwo_L1TAU12IM"]]]	,
+        ['tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12I',   'L1_TAU60_DR-TAU20ITAU12I',['L1_TAU60','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau35_medium1_tracktwo_L1TAU12IM"]]]	,
         # non-L1topo backup (ATR-15757)
-        ['tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40',   'L1_TAU60_2TAU40',['L1_TAU60','L1_TAU40'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau60_medium1_tracktwo_L1TAU40"]]]       ,
+        ['tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40',   'L1_TAU60_2TAU40',['L1_TAU60','L1_TAU40'], [PhysicsStream], ['Primary:20000','RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau60_medium1_tracktwo_L1TAU40"]]]       ,
+
+        #non-L1topo backup - ATR-16230
+        ['2tau35_medium1_tracktwo_L12TAU20IM_3J20',  'L1_2TAU20IM_3J20', ['L1_TAU20IM', 'L1_TAU20IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1],
+        ['2tau35_medium1_tracktwo',                   'L1_2TAU20IM_J25_3J20', ['L1_TAU20IM','L1_TAU20IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1],
+        ['tau40_medium1_tracktwo_tau25_medium1_tracktwo',   'L1_TAU25IM_2TAU12IM_J25_3J12',['L1_TAU25IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau40_medium1_tracktwo","tau25_medium1_tracktwo"]]],
 
         # High-pT DiTau seeding off of single-tau
         ['tau80_medium1_tracktwo_L1TAU60_tau50_medium1_tracktwo_L1TAU12', 'L1_TAU60',['L1_TAU60','L1_TAU12'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau50_medium1_tracktwo_L1TAU12"]]],
@@ -1741,23 +1587,13 @@ def setupMenu():
 
         # photon+pion chains (ATR-13525) 
         ['tau25_singlepion_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau25_singlepiontight_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-
-        #tau+photon (ATR-13061)
-        ['tau35_dikaonmasstight_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau35_dikaonmass_tracktwo_L1TAU12',            'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau25_dikaonmasstight_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_dikaonmass_tracktwo',                    'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
 
 	#tau + photon (ATR-13841)
         ['tau25_dipion1_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau35_dipion1loose_tracktwo_L1TAU12',  'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_dipion2_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau35_dipion2_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_kaonpi1_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau35_kaonpi1_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau25_kaonpi2_tracktwo',               'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
-        ['tau35_kaonpi2_tracktwo_L1TAU12',       'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
 
         ['tau160_medium1HighptL_tracktwo',         'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau160_medium1HighptM_tracktwo',         'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
@@ -1765,11 +1601,36 @@ def setupMenu():
         
 			 ]
 
+    if TriggerFlags.doFTK():
+            TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
+                ['tau12_idperf_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_perf_FTK',                'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_perf0_FTK',               'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_perf_FTKNoPrec',          'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_perf0_FTKNoPrec',         'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_medium0_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_medium1_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_medium0_FTKNoPrec',       'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_medium1_FTKNoPrec',       'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+
+                # standard single tau chains seeded from L1 FTK tau seeds for monitoring in CPS
+                ['tau25_idperf_tracktwo_L1TAU12IM_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau25_perf_tracktwo_L1TAU12IM_FTK',                'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau25_medium1_tracktwo_L1TAU12IM_FTK',             'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+
+                           ]
 
+    TriggerFlags.EgammaSlice.signatures = [
 
+        #Performance:
+        ['e26_lhtight_idperf',        'L1_EM22VHI',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e28_lhtight_idperf',        'L1_EM24VHI',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e26_lhtight_idperf_L1EM22VHIM',        'L1_EM22VHIM',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e28_lhtight_idperf_L1EM24VHIM',        'L1_EM24VHIM',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
 
-
-    TriggerFlags.EgammaSlice.signatures = [
+        ['2g3_loose_dPhi15_L12EM3_VTE70', 'L1_2EM3_VTE70', [], [PhysicsStream],['RATE:SinglePhoton','BW:Egamma'],-1],
+        ['2g3_loose_L12EM3_VTE70', 'L1_2EM3_VTE70', [], [PhysicsStream],['RATE:SinglePhoton','BW:Egamma'],-1],
+        ['2g3_medium_dPhi15_L12EM3_VTE70', 'L1_2EM3_VTE70', [], [PhysicsStream],['RATE:SinglePhoton','BW:Egamma'],-1],
 
         ['g0_perf_L1EM3_EMPTY',                  'L1_EM3_EMPTY', [], [PhysicsStream], ['RATE:SinglePhoton',   'BW:Egamma'], -1],        
         ['e0_perf_L1EM3_EMPTY',                  'L1_EM3_EMPTY', [], [PhysicsStream], ['RATE:SinglePhoton',   'BW:Egamma'], -1],        
@@ -1788,9 +1649,9 @@ def setupMenu():
         ['g80_loose_larpeb',                     'L1_EM24VHI', [], ['LArCells'], ['RATE:SinglePhoton', 'BW:Egamma'],-1],        
         ['g200_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
         ['g250_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
-        ['g300_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
-        ['g300_etcut_L1EM24VHI',          'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
-        ['g300_etcut_L1EM24VHIM',          'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
+        ['g300_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton', 'BW:Egamma'],-1], 
+        ['g300_etcut_L1EM24VHI',          'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'],-1], 
+        ['g300_etcut_L1EM24VHIM',          'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'],-1],
 
         ## Aranxtas request, to be run in rerun mode
         ['g22_tight',                             'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
@@ -1807,12 +1668,9 @@ def setupMenu():
         ['e160_etcut_L1EM24VHIM',  'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e180_etcut',  'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e180_etcut_L1EM24VHIM',  'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['g0_hiptrt_L1EM20VH',                  'L1_EM20VH',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
-        ['g0_hiptrt_L1EM20VHI',                 'L1_EM20VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
-        ['g0_hiptrt_L1EM22VHI',                 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
-        ['g0_hiptrt_L1EM24VHI',                 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
-        ['g0_hiptrt_L1EM24VHIM',                'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g0_hiptrt_L1EM22VHI',                 'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g0_hiptrt_L1EM24VHI',                 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'], -1],
+        ['g0_hiptrt_L1EM24VHIM',                'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton', 'BW:Egamma'], -1],
 
         # PS-ed trigger to supmbined chains
         ['g15_loose_L1EM7',               'L1_EM7',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'], -1], 
@@ -1833,7 +1691,6 @@ def setupMenu():
         ['g10_medium',                    'L1_EM7',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
         ['g15_loose_L1EM3',               'L1_EM3',   [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
         ['g20_loose',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
-        ['g20_tight',                     'L1_EM15VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
         ['g40_tight',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
         ['g45_tight',                     'L1_EM20VHI',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
         ['g50_loose',                     'L1_EM15VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
@@ -1842,34 +1699,26 @@ def setupMenu():
 	# ATR-16089
 	['g25_tight_L1EM20VH',            'L1_EM20VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
 	['g15_loose_L1EM8VH',             'L1_EM8VH', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
-
-        # Di-photon triggers
-        ['g35_loose_L1EM15_g25_loose_L1EM15',       'L1_2EM15', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['2g20_tight',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['2g20_tight_L12EM15VHI',                   'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g20_tight_icalovloose_L12EM15VHI',           'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g20_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g22_tight_L12EM15VHI',                   'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g22_tight_icalovloose_L12EM15VHI',           'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g20_tight_icalovloose_L12EM15VHI',           'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g20_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_L12EM15VHI',                   'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalovloose_L12EM15VHI',           'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
         ['2g22_tight_icalovloose',           'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g22_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g22_tight_icalotight_L12EM15VHI',            'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
         ['2g22_tight_icalotight',            'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
         ['2g50_loose',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
         ['2g60_loose_L12EM15VH',                    'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],  
-        ['2g50_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['2g60_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g50_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g60_loose_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
         ['g50_loose_L1EM20VH',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
         ['g60_loose_L1EM20VH',                     'L1_EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
         ##Adding tight diphoton triggers (ATR-10762)
         ['2g22_tight',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-        ['2g25_tight_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
-
-        # Tri-photon triggers
-        ['2g20_loose_g15_loose',                    'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g25_tight_L12EM20VH',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
         ['3g20_loose',                              'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['2g25_loose_g15_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['2g25_loose_g20_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
-        ['3g25_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
+        ['2g25_loose_g15_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['2g25_loose_g20_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1], 
+        ['3g25_loose',                    'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:MultiPhoton', 'BW:Egamma'],-1],
         #prescaled
         ['2g20_loose_L12EM15',                      'L1_2EM15', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
         ['2g20_loose',                   'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], 
@@ -1889,10 +1738,18 @@ def setupMenu():
         ['e26_lhmedium_nod0_L1EM20VH',                'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
         ['e28_lhmedium_nod0_L1EM20VH',                'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
 
-        ['e26_lhtight_nod0_e15_etcut_L1EM7_Zee',    	  'L1_EM22VHI', ['L1_EM22VHI','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
+        # ATR-17148
+        ['e9_lhvloose_nod0',                          'L1_EM3',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e9_lhvloose_nod0_L1EM7',                    'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e9_lhvloose_nod0_L1EM8VH',                  'L1_EM8VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        #ATR-16981
+        ['e24_lhtight_nod0_ivarloose',                'L1_EM20VHI',    [], [PhysicsStream, 'express'], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
+
+        ['e26_lhtight_nod0_e15_etcut_L1EM7_Zee',    	  'L1_EM22VHI', ['L1_EM22VHI','L1_EM7'], [PhysicsStream], ['Primary:17000','RATE:MultiElectron', 'BW:Egamma'],-1 ],
         ['e28_lhtight_nod0_e15_etcut_L1EM7_Zee',    	  'L1_EM24VHI', ['L1_EM24VHI','L1_EM7'], [PhysicsStream, 'express'], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
-        ['e26_lhtight_nod0_L1EM22VHIM_e15_etcut_L1EM7_Zee', 'L1_EM22VHIM',  ['L1_EM22VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e28_lhtight_nod0_L1EM24VHIM_e15_etcut_L1EM7_Zee', 'L1_EM24VHIM',  ['L1_EM24VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_nod0_L1EM22VHIM_e15_etcut_L1EM7_Zee', 'L1_EM22VHIM',  ['L1_EM22VHIM','L1_EM7'], [PhysicsStream], ['Primary:17000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_L1EM24VHIM_e15_etcut_L1EM7_Zee', 'L1_EM24VHIM',  ['L1_EM24VHIM','L1_EM7'], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
 
         # Jpsiee T&P LH-based nod0
         ['e5_lhtight_nod0_e4_etcut',         'L1_2EM3',      [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
@@ -1902,11 +1759,17 @@ def setupMenu():
         ['e14_lhtight_nod0_e4_etcut_Jpsiee', 'L1_EM12_2EM3', ['L1_EM12','L1_EM3'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
         ['e5_lhtight_nod0_e14_etcut_Jpsiee', 'L1_EM12_2EM3', ['L1_EM3','L1_EM12'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
 
+        # L1Topo JPSI prescaled performance:
+        ['e5_lhtight_nod0_e4_etcut_L1JPSI-1M5',              'L1_JPSI-1M5',      ['L1_EM3','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5',       'L1_JPSI-1M5',      ['L1_EM3','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e9_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM7','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhtight_nod0_e9_etcut_Jpsiee_L1JPSI-1M5-EM7',   'L1_JPSI-1M5-EM7',  ['L1_EM3','L1_EM7'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e14_lhtight_nod0_e4_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM12','L1_EM3'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+        ['e5_lhtight_nod0_e14_etcut_Jpsiee_L1JPSI-1M5-EM12', 'L1_JPSI-1M5-EM12', ['L1_EM3','L1_EM12'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+
         # Supporting trigger
         ['e0_perf_L1EM15',              'L1_EM15',[], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
         ['g0_perf_L1EM15',                'L1_EM15',  [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
- 
-        ['e5_lhloose',                          'L1_EM3',       [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e5_lhloose_idperf',                   'L1_EM3',       [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
 
         # extra id perf chains for TRT HT studies                                                                                               
@@ -1918,26 +1781,18 @@ def setupMenu():
         # Single electron triggers
         ['e17_lhmedium_nod0_L1EM15',                    'L1_EM15',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e24_lhmedium_L1EM18VHI',                'L1_EM18VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e24_lhtight_L1EM20VH',                 'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-
-        ['e26_lhtight_nod0_ringer_ivarloose',  'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhtight_nod0_ringer_ivarloose_L1EM22VHIM',  'L1_EM22VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
-        ['e28_lhtight_nod0_ringer_ivarloose', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e28_lhtight_nod0_ringer_ivarloose_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['e60_medium',                           'L1_EM22VHI',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e60_medium_L1EM24VHI',               	 'L1_EM24VHI',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-        ['e60_lhmedium_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e120_lhloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['g140_loose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
-        ['g140_tight',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
-        ['g140_tight_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
+        ['e28_lhtight_nod0_noringer_ivarloose', 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_noringer_ivarloose_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g140_loose',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:17000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g140_tight',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['g140_tight_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
         ['g160_loose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
         ['g180_loose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
         ['g200_loose',        'L1_EM24VHI', [], [PhysicsStream, 'express'], ['RATE:SinglePhoton','BW:Egamma'],-1],
-        ['g200_loose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SinglePhoton','BW:Egamma'],-1],
-        ['e140_lhloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['g200_loose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SinglePhoton','BW:Egamma'],-1],
+        ['e140_lhloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
 
         #2016 egamma primaries
         ['2e17_lhloose_nod0_L12EM15',    									'L1_2EM15',     [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
@@ -1954,11 +1809,12 @@ def setupMenu():
         ['e80_lhvloose_nod0',  														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
         ['e100_lhvloose_nod0', 														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
         ['e120_lhvloose_nod0', 														'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_lhmedium_nod0',              'L1_EM22VHI',   [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        ['e80_lhmedium_nod0_L1EM24VHI',    'L1_EM24VHI',   [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1 ],
 
-        ['e80_medium',                     'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
-        ['e80_lhmedium_nod0',              'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
-        ['e80_medium_L1EM24VHI',           'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
-        ['e80_lhmedium_nod0_L1EM24VHI',    'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ],
+        #Low-mu run triggers
+        ['e15_lhloose_nod0_L1EM12',  'L1_EM12', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'], -1],
+        ['e15_lhvloose_nod0_L1EM12', 'L1_EM12', [], [PhysicsStream], ['RATE:SingleElectron','BW:Egamma'], -1],
 
         # Prescaled triggers
         # Rate = 1 Hz each
@@ -1991,10 +1847,6 @@ def setupMenu():
 
         #New nod0 chains:
         ['e24_lhtight_nod0_L1EM20VH',                 'L1_EM20VH',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-        # Rerun mode
-        ['e4_etcut',                             'L1_EM3',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-        ['e9_etcut',                             'L1_EM7',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-        ['e14_etcut',                            'L1_EM12',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
 
 
 	['e7_lhmedium_nod0',                           'L1_EM3',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],        
@@ -2002,7 +1854,6 @@ def setupMenu():
 	['e9_lhmedium_nod0',                          'L1_EM7',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e12_lhmedium_nod0',                        'L1_EM8VH',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e17_lhmedium_nod0',                         'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e17_lhmedium_nod0_iloose',                  'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e17_lhmedium_nod0_ivarloose_L1EM15VHI',     'L1_EM15VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
 
         ['e20_lhmedium_nod0',                         'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2012,6 +1863,8 @@ def setupMenu():
         ['e80_lhloose_nod0',                          'L1_EM22VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e80_lhloose_nod0_L1EM24VHI',                          'L1_EM24VHI',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e5_lhtight_nod0',                           'L1_EM3',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+				['e5_lhtight_nod0_e4_etcut_Jpsiee_L1RD0_FILLED',       'L1_RD0_FILLED',      ['L1_EM3','L1_EM3'],  [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1, True],
+
         ['e9_lhtight_nod0',                           'L1_EM7',     [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e14_lhtight_nod0',                          'L1_EM12',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e26_lhmedium_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2019,11 +1872,6 @@ def setupMenu():
 
 # Start up menu
         ['e26_lhloose_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhloose_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-#        ['e26_lhmedium_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhmedium_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-#        ['e26_lhtight_nod0',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhtight_nod0_ringer',              'L1_EM22VHI',    [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
          # Supporting triggers
          
@@ -2054,33 +1902,17 @@ def setupMenu():
         ['g24_loose',                     'L1_EM20VH',[], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
 
         ['2e17_lhvloose_nod0',                   'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['2e17_lhvloose_nod0_L12EM15VHI',         'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['2e19_lhvloose_nod0',         'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['2e17_lhvloose_nod0_L12EM15VHI',         'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['2e19_lhvloose_nod0',         'L1_2EM15VHI', [], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
         ['2e24_lhvloose_nod0',                   'L1_2EM20VH', [], [PhysicsStream, 'express'], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-
-	
-
-        # support for g+tau chains (ATR-13841)
-        ['g35_medium_L1EM22VHI',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
-        ['g35_medium_L1EM24VHI',                    'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1],
-
-#Rerun:         
-#Physics (tri-ele):
-        ['e17_lhloose_nod0_2e9_lhloose_nod0',         'L1_EM15VH_3EM7', ['L1_EM15VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhmedium_nod0_2e9_lhmedium_nod0',       'L1_EM15VH_3EM7', ['L1_EM15VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhloose_nod0_2e10_lhloose_nod0_L1EM15VH_3EM8VH',                        'L1_EM15VH_3EM8VH', ['L1_EM15VH','L1_3EM8VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhvloose_nod0_2e10_lhvloose_nod0_L1EM15VH_3EM8VH',                        'L1_EM15VH_3EM8VH', ['L1_EM15VH','L1_3EM8VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
         ['e17_lhloose_nod0_2e12_lhloose_nod0_L1EM15VH_3EM10VH',                       'L1_EM15VH_3EM10VH', ['L1_EM15VH','L1_3EM10VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhmedium_nod0_2e10_lhmedium_nod0_L1EM15VH_3EM8VH',                      'L1_EM15VH_3EM8VH', ['L1_EM15VH','L1_3EM8VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhloose_nod0_e12_lhloose_nod0_e9_lhloose_nod0_L1EM15VH_2EM10VH_3EM7',   'L1_EM15VH_2EM10VH_3EM7', ['L1_EM15VH','L1_2EM10VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
-        ['e17_lhmedium_nod0_e12_lhmedium_nod0_e9_lhmedium_nod0_L1EM15VH_2EM10VH_3EM7','L1_EM15VH_2EM10VH_3EM7', ['L1_EM15VH','L1_2EM10VH','L1_3EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],  
 
         ['e22_lhloose_nod0_e12_lhloose_nod0_e10_lhloose_nod0_L1EM20VH_2EM10VH_3EM8VH',    'L1_EM20VH_2EM10VH_3EM8VH', ['L1_EM20VH','L1_2EM10VH','L1_3EM8VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
         ['e22_lhvloose_nod0_e12_lhvloose_nod0_e10_lhvloose_nod0_L1EM20VH_2EM10VH_3EM8VH', 'L1_EM20VH_2EM10VH_3EM8VH', ['L1_EM20VH','L1_2EM10VH','L1_3EM8VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e24_lhloose_nod0_2e12_lhloose_nod0_L1EM20VH_3EM10VH',   'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VH', 'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e24_lhmedium_nod0_2g12_loose',                          'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'],-1,['parallel',-1,[] ]],
-        ['e24_lhmedium_nod0_2g12_medium',                         'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'],-1,['parallel',-1,[] ]],
+        ['e24_lhloose_nod0_2e12_lhloose_nod0_L1EM20VH_3EM10VH',   'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VH', 'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e24_lhmedium_nod0_2g12_loose',                          'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'],-1,['parallel',-1,[] ]],
+        ['e24_lhmedium_nod0_2g12_medium',                         'L1_EM20VH_3EM10VH', ['L1_EM20VH','L1_3EM10VH'], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'],-1,['parallel',-1,[] ]],
 
 
         ##########
@@ -2098,16 +1930,8 @@ def setupMenu():
 
 #Physics (e+g):
         ['e24_lhmedium_nod0_L1EM15VH_g25_medium',  'L1_2EM15VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-        ['e24_lhmedium_nod0_L1EM20VH_g25_medium',  'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
+        ['e24_lhmedium_nod0_L1EM20VH_g25_medium',  'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
         ['e20_lhmedium_nod0_g35_loose',            'L1_2EM15VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-        ['e20_lhmedium_nod0_2g10_loose',           'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-        ['e20_lhmedium_nod0_2g10_medium',          'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-        ['e20_lhmedium_nod0_2g10_loose_L1EM15VH_3EM8VH',           'L1_EM15VH_3EM8VH', ['L1_EM15VH','L1_2EM8VH'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-        ['e20_lhmedium_nod0_2g10_medium_L1EM15VH_3EM8VH',          'L1_EM15VH_3EM8VH', ['L1_EM15VH','L1_2EM8VH'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]], 
-
-        #ATR-15259
-        ['e25_mergedtight_g35_medium',           'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
-        ['e30_mergedtight_g35_medium',           'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
 
         #Diphoton triggers
         ['g35_loose_g25_loose',                      'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1],
@@ -2121,24 +1945,13 @@ def setupMenu():
 
         ['2g22_tight_L1EM7_EMPTY',    'L1_EM7_EMPTY', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
         ['2g22_tight_L1EM7_UNPAIRED_ISO',        'L1_EM7_UNPAIRED_ISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
-        ['2g22_tight_L1EM7_UNPAIRED_NONISO',        'L1_EM7_UNPAIRED_NONISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
         ['2g50_tight_L1EM7_EMPTY',    'L1_EM7_EMPTY', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
         ['2g50_tight_L1EM7_UNPAIRED_ISO',        'L1_EM7_UNPAIRED_ISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
-        ['2g50_tight_L1EM7_UNPAIRED_NONISO',        'L1_EM7_UNPAIRED_NONISO', [], ["Late"], ['RATE:MultiPhoton', 'BW:Egamma'], -1],
-
-        # L1Topo W T&P 
-        ['e13_etcut_trkcut_L1EM12', 'L1_EM12', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
-        
-     
-        # ATR-12916, Egamma Trigger Menu 2016   
-
-        ['e24_lhmedium_ivarloose_L1EM20VH',      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e24_lhmedium_nod0_L1EM20VH',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e24_lhmedium_nod0_ivarloose_L1EM20VH', 'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
         ['e26_lhtight_nod0',                  'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhtight_nod0_ivarloose',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM',        'L1_EM22VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_nod0_ivarloose',        'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM',        'L1_EM22VHIM', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
 
         ['e26_lhmedium_nod0_ivarloose',       'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e26_lhmedium_nod0_ivarmedium',      'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2146,7 +1959,7 @@ def setupMenu():
 
         ['e28_lhtight_nod0',                  'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream,'express'], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
 
         ['e28_lhmedium_nod0_ivarloose',       'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivarmedium',      'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2156,26 +1969,22 @@ def setupMenu():
         #Supporting
         
         ['e28_lhtight_nod0_L1EM22VHI',            'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e28_lhtight_nod0_ivarloose_L1EM22VHI',  'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e28_lhtight_nod0_ivarloose_L1EM22VHI',  'L1_EM22VHI', [], [PhysicsStream], ['Primary:17000','RATE:SingleElectron', 'BW:Egamma'],-1],
 
         # Et cut only chains
         ['e250_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e300_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
-        ['e300_etcut_L1EM24VHIM',                 'L1_EM24VHIM',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e300_etcut',                           'L1_EM24VHI',  [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e300_etcut_L1EM24VHIM',                 'L1_EM24VHIM',  [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1], 
 
         # 2e34 single items
-        ['e60_lhmedium_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e60_lhmedium_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e140_lhloose_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e140_lhloose_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e26_lhtight_cutd0dphideta_ivarloose', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
 				
         
         #Chains for testing 2e34 menus
-        ['e32_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
-        ['e35_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
-        ['e40_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],  
-        ['e50_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], 
+        ['e32_lhtight_nod0_ivarloose',        'L1_EM24VHI', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],  
         
 
         #ATR-16089 supporting triggers for MC16c
@@ -2194,17 +2003,10 @@ def setupMenu():
         ['e28_lhmedium_nod0_ivarloose_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivarmedium_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivartight_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        
-        ['e60_medium_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e80_medium_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e80_lhmedium_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['2e17_lhvloose_nod0_ringer_L12EM15VHI',        'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['2e17_lhvloose_nod0_ringer',          'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiElectron',  'BW:Egamma'],-1],
-        ['2e19_lhvloose_nod0_ringer',        'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e17_lhvloose_nod0_ringer_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e17_lhvloose_nod0_ringer',           'L1_EM15VH',  [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e19_lhvloose_nod0_ringer',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e80_lhmedium_nod0_L1EM24VHIM',        'L1_EM24VHIM', [], [PhysicsStream], ['Primary:20000','RATE:SingleElectron', 'BW:Egamma'],-1],
+
+        ['2e17_lhvloose_nod0_noringer_L12EM15VHI',        'L1_2EM15VHI', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
+        ['e17_lhvloose_nod0_noringer_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e17_lhvloose_nod0_L1EM15VHI',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e19_lhvloose_nod0',        'L1_EM15VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
@@ -2275,8 +2077,6 @@ def setupMenu():
         ['e26_lhmedium_nod0_ivarmedium_icalomedium',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e26_lhmedium_nod0_ivartight_icalotight',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
-        ['e26_lhmedium_nod0_ringer_ivarmedium_icalomedium',        'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
         ['e28_lhmedium_nod0_icaloloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_icalomedium',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_icalotight',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2284,18 +2084,15 @@ def setupMenu():
         ['e28_lhmedium_nod0_ivarloose_icaloloose',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivarmedium_icalomedium',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivartight_icalotight',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['e28_lhmedium_nod0_ringer_ivarmedium_icalomedium',        'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['e60_lhmedium_nod0_ringer',           'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e60_lhmedium_nod0_ringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-
-        ['e140_lhloose_nod0_ringer',           'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e140_lhloose_nod0_ringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_noringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e60_lhmedium_nod0_noringer_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_noringer_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e140_lhloose_nod0_noringer_L1EM24VHIM', 'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
         #ATR-16089 test chains
         ['e25_mergedtight_ivarloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
-        ['e30_mergedtight_ivarloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
+        ['e25_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
+        ['e30_mergedtight',                      'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'], -1],
 
         ['g35_medium_icalovloose',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['g35_medium_icalotight',           'L1_EM20VH', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
@@ -2303,18 +2100,21 @@ def setupMenu():
         ['e26_lhmedium_nod0_ivartight_icalotight_L1EM22VHIM',           'L1_EM22VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
         ['e28_lhmedium_nod0_ivartight_icalotight_L1EM24VHIM',           'L1_EM24VHIM', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1],
 
-        ['e26_lhtight_nod0_ivarloose_e15_etcut_L1EM7_Zee',    	  'L1_EM22VHI', ['L1_EM22VHI','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
-        ['e28_lhtight_nod0_ivarloose_e15_etcut_L1EM7_Zee',    	  'L1_EM24VHI', ['L1_EM24VHI','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1 ],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_e15_etcut_L1EM7_Zee', 'L1_EM22VHIM',  ['L1_EM22VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_e15_etcut_L1EM7_Zee', 'L1_EM24VHIM',  ['L1_EM24VHIM','L1_EM7'], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1],
-
         #AFP egamma       
+        ['g10_loose_L1EM3_AFP_A_OR_C',                  'L1_EM3_AFP_A_OR_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['g10_loose_L1EM3_AFP_A_AND_C',                  'L1_EM3_AFP_A_AND_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        ['e10_lhloose_L1EM3_AFP_A_OR_C',                  'L1_EM3_AFP_A_OR_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['e10_lhloose_L1EM3_AFP_A_AND_C',                  'L1_EM3_AFP_A_AND_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
         ['g10_loose_L1EM3',                  'L1_EM3',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['e10_lhloose_L1EM3',                  'L1_EM3',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
 			 ]
 
     TriggerFlags.BphysicsSlice.signatures = [
+        #ATR-16219
+        ['3mu4_bDimu2700',                'L1_3MU4', [], [BPhysicsStream],             [RATE_BphysTag,BW_BphysTag], -1],
 
         ['2mu6_bPhi',                     'L1_2MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu11_mu6_bPhi',                 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','mu6_bPhi']]],
@@ -2364,50 +2164,31 @@ def setupMenu():
         ['mu6_bJpsi_Trkloose',            'L1_MU6',  [], [PhysicsStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu10_bJpsi_Trkloose',           'L1_MU10', [], [PhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu14_bJpsi_Trkloose',           'L1_MU10', [], [PhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-        ['mu20_bJpsi_Trkloose',           'L1_MU20MU21', ['L1_MU20'], [PhysicsStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu20_bJpsi_Trkloose',       'L1_MU20MU21', ['L1_MU20'], [PhysicsStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
 
         # ATR-16163
         ['mu4_bJpsi_TrkPEB',            'L1_MU4',  [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu6_bJpsi_TrkPEB',            'L1_MU6',  [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu6_bJpsi_lowpt_TrkPEB',      'L1_MU6',  [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu10_bJpsi_TrkPEB',           'L1_MU10', [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu10_bJpsi_TrkPEBmon',        'L1_MU10',  [], [BPhysicsStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu14_bJpsi_TrkPEB',           'L1_MU10', [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
-        ['mu20_bJpsi_TrkPEB',           'L1_MU20MU21', ['L1_MU20'], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_bJpsi_TrkPEB',           'L1_MU11', [], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu20_bJpsi_TrkPEB',       'L1_MU20MU21', ['L1_MU20'], ['BphysPEB'], [RATE_BphysTag,BW_BphysTag], -1],
         
-        ['3mu4_bDimu',                    'L1_3MU4', [], [BMultiMuonStream,'express'], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu4_bDimu',                    'L1_3MU4', [], [BMultiMuonStream,'express'], [RATE_BMultiMuonTag,BW_BphysTag], -1],
         ['3mu4_bJpsi',                    'L1_3MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['3mu4_bTau',                     'L1_3MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['3mu4_nomucomb_bTau',            'L1_3MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],  # OI validation w.r.t 2016 
-        ['3mu4_bUpsi',                    'L1_3MU4', [], [BMultiMuonStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu4_bUpsi',                    'L1_3MU4', [], [BMultiMuonStream], [RATE_BMultiMuonTag,BW_BphysTag], -1],
         
-        ['3mu6_bDimu',                   'L1_3MU6', [], [BMultiMuonStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu6_bDimu',                   'L1_3MU6', [], [BMultiMuonStream], [RATE_BMultiMuonTag,BW_BphysTag], -1],
         ['3mu6_bJpsi',                   'L1_3MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['3mu6_bTau',                    'L1_3MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-        ['3mu6_bUpsi',                   'L1_3MU6', [], [BMultiMuonStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['3mu6_bUpsi',                   'L1_3MU6', [], [BMultiMuonStream], [RATE_BMultiMuonTag,BW_BphysTag], -1],
 
         ['mu6_2mu4_bJpsi', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BPhysicsStream], [RATE_BphysTag, BW_BphysTag], -1],
-        ['mu6_2mu4_bUpsi', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BMultiMuonStream], [RATE_BphysTag, BW_BphysTag], -1],
-		
-        ['mu4_iloose_mu4_11invm60_noos', 'L1_2MU4', [], [PhysicsStream], [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_iloose_mu4_7invm9_noos',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_iloose_mu6_11invm24_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_iloose_mu6_24invm60_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-
-        ### ATR-14543
-        ['mu4_ivarloose_mu4_11invm60_noos', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_ivarloose_mu4_7invm9_noos',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_ivarloose_mu6_11invm24_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_ivarloose_mu6_24invm60_noos', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-
-        ['mu4_iloose_mu4_11invm60_noos_novtx', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_iloose_mu4_7invm9_noos_novtx',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_iloose_mu6_11invm24_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_iloose_mu6_24invm60_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-
-        ### ATR-14543
-        ['mu4_ivarloose_mu4_11invm60_noos_novtx', 'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_ivarloose_mu4_7invm9_noos_novtx',   'L1_2MU4', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_ivarloose_mu6_11invm24_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu6_ivarloose_mu6_24invm60_noos_novtx', 'L1_2MU6', [], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
+        ['mu6_2mu4_bUpsi', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
 
         ### ATR-14616: L1Topo SM DY
         ['mu6_iloose_mu6_11invm24_noos_L1DY-BOX-2MU6',       'L1_DY-BOX-2MU6', ['L1_MU6','L1_MU6'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
@@ -2461,27 +2242,27 @@ def setupMenu():
        ['mu6_mu4_bDimu_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
        ['mu6_mu4_bDimu_novtx_noos_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4','L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
 
-        ['mu11_mu6_bDimu2700',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], ['RATE:Bphysics','BW:Bphys'], -1],
-        ['mu11_mu6_bDimu_Lxy0',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], ['RATE:Bphysics','BW:Bphys'], -1],
-        ['mu11_mu6_bDimu2700_Lxy0',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], ['RATE:Bphysics','BW:Bphys'], -1],
+        ['mu11_mu6_bDimu2700',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_mu6_bDimu_Lxy0',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['mu11_mu6_bDimu2700_Lxy0',            'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         
-        ['3mu4_bNocut',          'L1_3MU4',           [], [BMultiMuonStream, 'express'], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
-        ['3mu4_bVertex2',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
-        ['3mu4_bVertex3',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, 'BW:Muon'], -1],
+        ['3mu4_bNocut',          'L1_3MU4',           [], [BMultiMuonStream, 'express'], [RATE_BMultiMuonTag, 'BW:Bphys'], -1],
+        ['3mu4_bVertex2',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, 'BW:Bphys'], -1],
+        ['3mu4_bVertex3',          'L1_3MU4',           [], [BMultiMuonStream], [RATE_BMultiMuonTag, 'BW:Bphys'], -1],
         ['3mu3_mu3noL1_bNocut_L13MU4', 'L1_3MU4', ['L1_3MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['3mu3','mu3noL1']]],
         ['2mu4_mu3_mu2noL1_bNocut_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['2mu4','mu3','mu2noL1']]],
-        ['2mu6_mu4_bUpsi', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BMultiMuonStream], [RATE_BphysTag, BW_BphysTag], -1],
+        ['2mu6_mu4_bUpsi', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag, BW_BphysTag], -1],
         ['4mu4_bNocut', 'L1_4MU4', ['L1_4MU4',''], [BMultiMuonStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['4mu4','']]],
 
         #OI replacement for mu20_nomucomb_mu6noL1_nscan03 and mu11_nomucomb_2mu4noL1_nscan03_L1MU11_2MU6
-        ['mu20_mu6noL1_bNocut',             'L1_MU20MU21',      ['L1_MU20','L2_mu20'],        [BPhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu20','mu6noL1']]],  
-        ['mu11_2mu4noL1_bNocut_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu11'], [BPhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu11','2mu4noL1']]], 
-        ['mu11_2mu4noL1_bNocut_L1LFV-MU', 'L1_LFV-MU', ['L1_MU10','L2_mu11'], [BPhysicsStream], [RATE_BMultiMuonTag,'BW:Muon'], -1,['serial',-1,['mu11','2mu4noL1']]], 
+        ['mu20_mu6noL1_bNocut',             'L1_MU20MU21',      ['L1_MU20','L2_mu20'],        [BPhysicsStream], [RATE_BphysTag,'BW:Muon'], -1,['serial',-1,['mu20','mu6noL1']]],  
+        ['mu11_2mu4noL1_bNocut_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu11'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','2mu4noL1']]], 
+        ['mu11_2mu4noL1_bNocut_L1LFV-MU', 'L1_LFV-MU', ['L1_MU10','L2_mu11'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','2mu4noL1']]], 
 
-				['3mu4_bPhi',                     'L1_3MU4', [], [BMultiMuonStream], [RATE_BphysTag,BW_BphysTag], -1],
+				['3mu4_bPhi',                     'L1_3MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
 
-        ['mu6_2mu4_bNocut_L1MU6_3MU4', 'L1_MU6_3MU4', ['L1_MU6','L1_2MU4'], [BMultiMuonStream], ['RATE:MultiMuon','BW:Muon'], -1],
-        ['2mu6_mu4_bNocut_L12MU6_3MU4', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BMultiMuonStream], ['RATE:MultiMuon','BW:Muon'], -1],
+        ['mu6_2mu4_bNocut_L1MU6_3MU4', 'L1_MU6_3MU4', ['L1_MU6','L1_2MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag,'BW:Muon'], -1],
+        ['2mu6_mu4_bNocut_L12MU6_3MU4', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BMultiMuonStream], [RATE_BMultiMuonTag,'BW:Muon'], -1],
 
 
         ['mu11_2mu4noL1_bTau_L1MU11_2MU6', 'L1_MU11_2MU6', ['L1_MU11','L2_mu11'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','2mu4noL1']]],
@@ -2490,21 +2271,15 @@ def setupMenu():
         ## LFV topo based nscan (ATR-14352)
         ['mu11_2mu4noL1_bTau_L1LFV-MU',    'L1_LFV-MU', ['L1_MU10','L2_mu11'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','2mu4noL1']]],      
 
+
+        
         ['mu6_2mu4_bTau_L1MU6_3MU4' , 'L1_MU6_3MU4',  ['L1_MU6','L1_2MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['2mu6_mu4_bTau_L12MU6_3MU4', 'L1_2MU6_3MU4', ['L1_2MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         
         ['mu6_iloose_mu6_24invm60_noos_L1DY-BOX-2MU6', 'L1_DY-BOX-2MU6', ['L1_MU6','L1_MU6'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1, False],
-        ['mu4_iloose_mu4_11invm60_noos_L1MU6_2MU4',    'L1_MU6_2MU4',    ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_iloose_mu4_7invm9_noos_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_iloose_mu4_11invm60_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_iloose_mu4_7invm9_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
 
         ### ATR-14543
         ['mu6_ivarloose_mu6_24invm60_noos_L1DY-BOX-2MU6', 'L1_DY-BOX-2MU6', ['L1_MU6','L1_MU6'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1, False],
-        ['mu4_ivarloose_mu4_11invm60_noos_L1MU6_2MU4',    'L1_MU6_2MU4',    ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_ivarloose_mu4_7invm9_noos_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_ivarloose_mu4_11invm60_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
-        ['mu4_ivarloose_mu4_7invm9_noos_novtx_L1MU6_2MU4',           'L1_MU6_2MU4',                         ['L1_MU4','L1_MU4'], [PhysicsStream],  [RATE_DYTag,BW_DYTag], -1],
 
         ### ATR-14478  
         ['2mu6_bBmumux_Taumumux',         'L1_2MU6', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
@@ -2589,8 +2364,10 @@ def setupMenu():
         ['mu10_mu6_bBmumux_BcmumuDsloose_L1LFV-MU',  'L1_LFV-MU',     ['L1_MU10','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
 
         ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',     ['L1_MU6','L1_MU4'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        #ATR-16219
+        ['mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO', 'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',     ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1, False],
 
-
+# ATR-14350
 
 
 
@@ -2602,9 +2379,6 @@ def setupMenu():
 
 
 
-
-
-
         ['mu11_mu6noL1_bTau_L1LFV-MU', 'L1_LFV-MU', ['L1_MU10','L2_mu6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','mu6noL1']]],
         
         # new baseline triggers, ATR-15503
@@ -2619,86 +2393,81 @@ def setupMenu():
         ['mu11_mu6_bDimu_noinvm_novtx_ss', 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu11_mu6_bDimu_novtx_noos',      'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1],
 
+        # ATR-16314
+        ['mu11_mu6_bTau',                  'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1],
+
+        
         # support triggers ATR-15851
         ['mu11_mu6_bNocut',                 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu11_mu6noL1_bNocut_L1MU11_2MU6',  'L1_MU11_2MU6', ['L1_MU11','L2_mu6'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1,['serial',-1,['mu11','mu6noL1']]],
 
-            ]
+			 ]
 
     TriggerFlags.CombinedSlice.signatures = [
-
-        # ATR-15226
-        ## ATR-14355: L1Topo bjet/HT items
-        
-        #
-        # b + ht
-        #
-
-        # 4J20
-        ['j35_gsc55_boffperf_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_boffperf_split']]],
-        ['j35_gsc55_bmv2c1040_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_bmv2c1040_split']]],
-        ['j35_gsc55_bmv2c1050_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L14J20','j35_gsc55_bmv2c1050_split']]],
-        ['j55_gsc75_bmv2c1040_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L14J20','j55_gsc75_bmv2c1040_split']]],
-        ['j55_gsc75_bmv2c1050_split_ht500_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht500_L14J20','j55_gsc75_bmv2c1050_split']]],
-
-        ['j35_gsc55_bmv2c1050_split_ht700_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht700_L14J20','j35_gsc55_bmv2c1050_split']]],
-        ['j35_gsc55_bmv2c1060_split_ht700_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht700_L14J20','j35_gsc55_bmv2c1060_split']]],
         
 
-        ['j35_gsc55_boffperf_split_ht500_L1HT190-J15.ETA21',  'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j35_gsc55_boffperf_split']]], 
-        ['j35_gsc55_bmv2c1040_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1040_split']]],
-        ['j35_gsc55_bmv2c1050_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1050_split']]],
-        ['j55_gsc75_bmv2c1040_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j55_gsc75_bmv2c1040_split']]],
-        ['j55_gsc75_bmv2c1050_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j55_gsc75_bmv2c1050_split']]],
-        ['j35_gsc55_bmv2c1050_split_ht700_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1050_split']]],
-        ['j35_gsc55_bmv2c1060_split_ht700_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1060_split']]],
+        ['j35_gsc55_boffperf_split_ht500_L1HT190-J15.ETA21',  'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j35_gsc55_boffperf_split']]], 
+        ['j35_gsc55_bmv2c1040_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1040_split']]],
+        ['j35_gsc55_bmv2c1050_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1050_split']]],
+        ['j55_gsc75_bmv2c1040_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j55_gsc75_bmv2c1040_split']]],
+        ['j55_gsc75_bmv2c1050_split_ht500_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j55_gsc75_bmv2c1050_split']]],
+        ['j35_gsc55_bmv2c1050_split_ht700_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1050_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht700_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21',   [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1060_split']]],
 
         # kill these ?
-        ['j35_gsc55_boffperf_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1, ['ht500','j35_gsc55_boffperf_split' ]]], 
-        ['j35_gsc55_bmv2c1050_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1050_split']]],
-        ['j35_gsc55_bmv2c1060_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1060_split']]],
-        ['j35_gsc55_bmv2c1050_split_ht700_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1050_split']]],
-        ['j35_gsc55_bmv2c1060_split_ht700_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1060_split']]],
-
-
-        #
-        # 2b +ht
-        #
-        ['2j55_boffperf_split_ht300_L14J20',        'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j55_boffperf_split']]],
-        ['2j35_gsc55_boffperf_split_ht300_L14J20',  'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_boffperf_split']]],
-        ['2j35_gsc55_bmv2c1040_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1040_split']]],
-        ['2j35_gsc55_bmv2c1050_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1050_split']]],
-        ['2j35_gsc55_bmv2c1060_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1060_split']]],
-        ['2j35_gsc55_bmv2c1070_split_ht300_L14J20', 'L1_4J20', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'],  -1,['serial',-1,[ 'ht300_L14J20','2j35_gsc55_bmv2c1070_split']]],
-
-        ['2j55_boffperf_split_ht300_L1HT190-J15.ETA21',       'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',   '2j55_boffperf_split']]], 
-        ['2j35_gsc55_boffperf_split_ht300_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',  '2j35_gsc55_boffperf_split'  ]]], 
-        ['2j35_gsc55_bmv2c1050_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1050_split' ]]], 
-        ['2j35_gsc55_bmv2c1040_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1040_split' ]]], 
-        ['2j35_gsc55_bmv2c1060_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1060_split' ]]], 
-        ['2j35_gsc55_bmv2c1070_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1070_split' ]]], 
+        ['j35_gsc55_boffperf_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1, ['ht500','j35_gsc55_boffperf_split' ]]], 
+        ['j35_gsc55_bmv2c1050_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1050_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht500_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht500','j35_gsc55_bmv2c1060_split']]],
+        ['j35_gsc55_bmv2c1050_split_ht700_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['Primary:20000','RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1050_split']]],
+        ['j35_gsc55_bmv2c1060_split_ht700_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht700','j35_gsc55_bmv2c1060_split']]],
+
+        ['2j55_boffperf_split_ht300_L1HT190-J15.ETA21',       'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',   '2j55_boffperf_split']]], 
+        ['2j35_gsc55_boffperf_split_ht300_L1HT190-J15.ETA21', 'L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',  '2j35_gsc55_boffperf_split'  ]]], 
+        ['2j35_gsc55_bmv2c1050_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1050_split' ]]], 
+        ['2j35_gsc55_bmv2c1040_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1040_split' ]]], 
+        ['2j35_gsc55_bmv2c1060_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1060_split' ]]], 
+        ['2j35_gsc55_bmv2c1070_split_ht300_L1HT190-J15.ETA21','L1_HT190-J15.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,['ht300',  '2j35_gsc55_bmv2c1070_split' ]]], 
 
 #        # L1HT190-J15s5.ETA21
-        ['2j55_boffperf_split_ht300_L1HT190-J15s5.ETA21',        'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,[ 'ht300', '2j55_boffperf_split'        ]]], 
-        ['2j35_gsc55_boffperf_split_ht300_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_boffperf_split'  ]]], 
-        ['2j35_gsc55_bmv2c1050_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1050_split' ]]], 
-        ['2j35_gsc55_bmv2c1060_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1060_split' ]]], 
-        ['2j35_gsc55_bmv2c1070_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1070_split' ]]], 
+        ['2j55_boffperf_split_ht300_L1HT190-J15s5.ETA21',        'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j55_boffperf_split'        ]]], 
+        ['2j35_gsc55_boffperf_split_ht300_L1HT190-J15s5.ETA21',  'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_boffperf_split'  ]]], 
+        ['2j35_gsc55_bmv2c1050_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1050_split' ]]], 
+        ['2j35_gsc55_bmv2c1060_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1060_split' ]]], 
+        ['2j35_gsc55_bmv2c1070_split_ht300_L1HT190-J15s5.ETA21', 'L1_HT190-J15s5.ETA21', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'], -1,['serial',-1,[ 'ht300', '2j35_gsc55_bmv2c1070_split' ]]], 
+
+        ['mu4_j35_gsc55_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream, 'express'], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_gsc55_boffperf_split'] ]],
+
+				# Backup ATR-16986
+        ['mu4_j35_boffperf_split_dr05_dz99', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ]],
+        ['mu4_j35_boffperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j35_boffperf_split'] ], False],
+        ['mu26_ivarmedium_j110_gsc150_boffperf_split_j35_boffperf_split', 'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', 'j110_gsc150_boffperf_split', 'j35_boffperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_j110_gsc150_boffperf_split_j35_boffperf_split',  'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j110_gsc150_boffperf_split','j35_boffperf_split']]],
+        ['g20_tight_icaloloose_j35_bmv2c1077_split_3j35_0eta490_invm500', 'L1_EM18VHI_MJJ-300', ['','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g20_tight_icaloloose","3j35_0eta490_invm500","j35_bmv2c1077_split"]]],
+        ['g27_medium_L1EM24VHI_j35_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","3j35_0eta490_invm700","j35_bmv2c1077_split"]]],
+        ['g27_medium_L1EM24VHI_2j35_bmv2c1077_split_2j35_0eta490', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","2j35_0eta490","2j35_bmv2c1077_split"]]],
 
 
         ### ATR-14356: bjets+HT VBF chians
-        ['2j45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'],-1,['serial',-1,['2j45_bmv2c1060_split', '2j35_0eta490_invm700']]],
-        ['2j25_gsc45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'],-1,['serial',-1,['2j25_gsc45_bmv2c1060_split', '2j35_0eta490_invm700']]],
+#        ['2j45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'],-1,['serial',-1,['2j45_bmv2c1060_split', '2j35_0eta490_invm700']]],
+#        ['2j25_gsc45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'],-1,['serial',-1,['2j25_gsc45_bmv2c1060_split', '2j35_0eta490_invm700']]],
+        ['2j45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'],-1,['serial',-1,['2j35_0eta490_invm700','2j45_bmv2c1060_split']]],
+        ['2j25_gsc45_bmv2c1060_split_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_HT150-JJ15.ETA49_MJJ-400', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined'],-1,['serial',-1,['2j35_0eta490_invm700','2j25_gsc45_bmv2c1060_split']]],
 
 	#
 	#  1/2/3b + xe
 	#
-        ['j60_gsc100_bmv2c1050_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c1050_split','xe80_mht_L1XE60']]],
-        ['j60_gsc100_bmv2c1060_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c1060_split','xe80_mht_L1XE60']]],
-        ['2j45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1,['serial',-1,['2j45_bmv2c1070_split','xe80_mht']]],
-        ['2j25_gsc45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1,['serial',-1,['2j25_gsc45_bmv2c1070_split','xe80_mht']]],
-        ['3j35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1, ['serial',-1,['3j35_bmv2c1077_split','xe60_mht']]],
-        ['3j15_gsc35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet', 'BW:MET'], -1, ['serial',-1,['3j15_gsc35_bmv2c1077_split','xe60_mht']]],
+#        ['j60_gsc100_bmv2c1050_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c1050_split','xe80_mht_L1XE60']]],
+#        ['j60_gsc100_bmv2c1060_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['j60_gsc100_bmv2c1060_split','xe80_mht_L1XE60']]],
+#        ['2j45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['2j45_bmv2c1070_split','xe80_mht']]],
+#        ['2j25_gsc45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['2j25_gsc45_bmv2c1070_split','xe80_mht']]],
+#        ['3j35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1, ['serial',-1,['3j35_bmv2c1077_split','xe60_mht']]],
+#        ['3j15_gsc35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1, ['serial',-1,['3j15_gsc35_bmv2c1077_split','xe60_mht']]],
+        ['j60_gsc100_bmv2c1050_split_xe80_mht_L1XE60','L1_XE60',[],[PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['xe80_mht_L1XE60','j60_gsc100_bmv2c1050_split']]],
+        ['2j25_gsc45_bmv2c1070_split_xe80_mht_L12J15_XE55','L1_2J15_XE55',[],[PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1,['serial',-1,['xe80_mht','2j25_gsc45_bmv2c1070_split']]],
+        ['3j35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1, ['serial',-1,['xe60_mht','3j35_bmv2c1077_split']]],
+        ['3j15_gsc35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',"L1_3J15.0ETA25_XE40",[],[PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined', 'BW:MET'], -1, ['serial',-1,['xe60_mht','3j15_gsc35_bmv2c1077_split']]],
 
         # Non-L1Topo W T&P triggers
         ['e13_etcut_trkcut_xs30_xe30_mt35', 'L1_EM12_XS20', ['L1_EM12','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e13_etcut_trkcut","xs30","xe30"]]],
@@ -2724,133 +2493,106 @@ def setupMenu():
         ['e18_etcut_trkcut_j20_perf_xe20_6dphi15_mt35',      'L1_EM15_XS30', ['L1_EM15','',''],[PhysicsStream],['RATE:EgammaMET','BW:Egamma'],-1,['serial',-1,["e18_etcut_trkcut","j20_perf","xe20"]]],
 
 
-        ['2e12_lhloose_nod0_mu10',  'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['2e12_lhloose_nod0_mu10',  'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
 
 
-        ['2e12_lhmedium_nod0_mu10', 'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['2e12_lhmedium_nod0_mu10', 'L1_2EM8VH_MU10', ['L1_2EM8VH', 'L1_MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
 
 
-        ['e12_lhloose_nod0_2mu10',  'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e12_lhloose_nod0_2mu10',  'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
 
 
-        ['e12_lhmedium_nod0_2mu10', 'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e12_lhmedium_nod0_2mu10', 'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
 
 
-        ['e17_lhloose_nod0_mu14',   'L1_EM15VH_MU10', ['L1_EM15VH', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
-
-        ['e24_lhmedium_nod0_L1EM20VHI_mu8noL1', 'L1_EM20VHI', ['L1_EM20VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e24_lhmedium_nod0_L1EM20VHI','mu8noL1'] ]],
-        ['e26_lhmedium_nod0_mu8noL1', 'L1_EM22VHI', ['L1_EM22VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e26_lhmedium_nod0','mu8noL1'] ]],
-        ['e28_lhmedium_nod0_mu8noL1', 'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0','mu8noL1'] ]],
-        ['e26_lhmedium_nod0_L1EM22VHIM_mu8noL1', 'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e26_lhmedium_nod0_L1EM22VHIM','mu8noL1'] ]],
-        ['e28_lhmedium_nod0_L1EM24VHIM_mu8noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHIM','mu8noL1'] ]],
+        ['e17_lhloose_nod0_mu14',   'L1_EM15VH_MU10', ['L1_EM15VH', 'L1_MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
+        ['e26_lhmedium_nod0_mu8noL1', 'L1_EM22VHI', ['L1_EM22VHI', ''], [PhysicsStream], ['Primary:17000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e26_lhmedium_nod0','mu8noL1'] ]],
+        ['e28_lhmedium_nod0_mu8noL1', 'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0','mu8noL1'] ]],
+        ['e26_lhmedium_nod0_L1EM22VHIM_mu8noL1', 'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['Primary:17000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e26_lhmedium_nod0_L1EM22VHIM','mu8noL1'] ]],
+        ['e28_lhmedium_nod0_L1EM24VHIM_mu8noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHIM','mu8noL1'] ]],
         ['e28_lhmedium_nod0', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1],
+        ['e70_lhloose_nod0_xe70noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e70_lhloose_nod0","xe70noL1"]]],
+        ['e70_lhloose_nod0_L1EM24VHIM_xe70noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e70_lhloose_nod0_L1EM24VHIM","xe70noL1"]]],
+        ['e80_lhloose_nod0_xe80noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0","xe80noL1"]]],
+        ['e80_lhloose_nod0_L1EM24VHI_xe80noL1',    'L1_EM24VHI',['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHI","xe80noL1"]]],
+        ['e80_lhloose_nod0_L1EM24VHIM_xe80noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHIM","xe80noL1"]]],
 
-        ['e60_lhloose_nod0_xe60noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e60_lhloose_nod0","xe60noL1"]]],
-        ['e60_lhloose_nod0_L1EM24VHIM_xe60noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e60_lhloose_nod0_L1EM24VHIM","xe60noL1"]]],
-        ['e70_lhloose_nod0_xe70noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e70_lhloose_nod0","xe70noL1"]]],
-        ['e70_lhloose_nod0_L1EM24VHIM_xe70noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e70_lhloose_nod0_L1EM24VHIM","xe70noL1"]]],
-        ['e80_lhloose_nod0_xe80noL1',    'L1_EM22VHI',['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0","xe80noL1"]]],
-        ['e80_lhloose_nod0_L1EM24VHI_xe80noL1',    'L1_EM24VHI',['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHI","xe80noL1"]]],
-        ['e80_lhloose_nod0_L1EM24VHIM_xe80noL1',    'L1_EM24VHIM',['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["e80_lhloose_nod0_L1EM24VHIM","xe80noL1"]]],
-
-        ['e7_lhmedium_nod0_mu24',        'L1_MU20MU21', ['L1_EM3', 'L1_MU20'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
-
-        ['g40_tight_xe40noL1',           'L1_EM20VH',  ['L1_EM20VH',''],  [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g40_tight","xe40noL1"]]],
-        ['g45_tight_xe45noL1',           'L1_EM20VH',  ['L1_EM20VH',''],  [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight","xe45noL1"]]],
+        ['e7_lhmedium_nod0_mu24',        'L1_MU20MU21', ['L1_EM3', 'L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['parallel',-1,[] ]],
         ['g45_tight_L1EM22VHI_xe45noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM22VHI","xe45noL1"]]],
         ['g45_tight_L1EM24VHI_xe45noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM24VHI","xe45noL1"]]],
         ['g45_tight_L1EM24VHIM_xe45noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_L1EM24VHIM","xe45noL1"]]],
         ['g45_tight_icalovloose_L1EM24VHIM_xe45noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM24VHIM","xe45noL1"]]],
-        ['g60_loose_xe60noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g60_loose","xe60noL1"]]],
-        ['g70_loose_xe70noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose","xe70noL1"]]],
-        ['g60_loose_L1EM24VHI_xe60noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g60_loose_L1EM24VHI","xe60noL1"]]],
-        ['g70_loose_L1EM24VHI_xe70noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose_L1EM24VHI","xe70noL1"]]],
-        ['g70_loose_L1EM24VHIM_xe70noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g70_loose_L1EM24VHIM","xe70noL1"]]],
-        ['g80_loose_L1EM24VHI_xe80noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHI","xe80noL1"]]],
-        ['g80_loose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHIM","xe80noL1"]]],
-        ['g80_loose_icalovloose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHIM","xe80noL1"]]],
+        ['g80_loose_L1EM24VHI_xe80noL1',           'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHI","xe80noL1"]]],
+        ['g80_loose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_L1EM24VHIM","xe80noL1"]]],
+        ['g80_loose_icalovloose_L1EM24VHIM_xe80noL1',           'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHIM","xe80noL1"]]],
         ['g45_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
-
-        ['g40_tight_icalovloose_xe40noL1', 	        'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g40_tight_icalovloose","xe40noL1"]]],
-        ['g45_tight_icalovloose_xe40noL1',           'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose","xe40noL1"]]],
-        ['g45_tight_icalovloose_xe45noL1', 	        'L1_EM20VHI', ['L1_EM20VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose","xe45noL1"]]],
         ['g45_tight_icalovloose_L1EM22VHI_xe45noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM22VHI","xe45noL1"]]],
         ['g45_tight_icalovloose_L1EM24VHI_xe45noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g45_tight_icalovloose_L1EM24VHI","xe45noL1"]]],
-        ['g80_loose_icalovloose_xe80noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose","xe80noL1"]]],
-        ['g80_loose_icalovloose_L1EM24VHI_xe80noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHI","xe80noL1"]]],
-        ['g85_tight_icalovloose_L1EM22VHI_3j50noL1',  'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM22VHI","3j50noL1"]]],
-        ['g100_tight_icalovloose_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM22VHI","3j50noL1"]]],
-        ['g85_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
-        ['g100_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
+        ['g80_loose_icalovloose_xe80noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose","xe80noL1"]]],
+        ['g80_loose_icalovloose_L1EM24VHI_xe80noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose_icalovloose_L1EM24VHI","xe80noL1"]]],
+        ['g85_tight_icalovloose_L1EM22VHI_3j50noL1',  'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM22VHI","3j50noL1"]]],
+        ['g100_tight_icalovloose_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM22VHI","3j50noL1"]]],
+        ['g85_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
+        ['g100_tight_icalovloose_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHI","3j50noL1"]]],
 
         #ATR-14196
-        ['g80_loose_xe80noL1',           'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose","xe80noL1"]]],
+        ['g80_loose_xe80noL1',           'L1_EM22VHI',  ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaMET', 'BW:Egamma', 'BW:MET'], -1,['serial',-1,["g80_loose","xe80noL1"]]],
 
-        ['g25_medium_mu24',              'L1_MU20MU21', ['L1_EM15VH','L1_MU20'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,[] ]],
+        ['g25_medium_mu24',              'L1_MU20MU21', ['L1_EM15VH','L1_MU20'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,[] ]],
 
-        ['g15_loose_2mu10_msonly',       'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,[] ]],
-
-        ['j100_xe80',                    'L1_J40_XE50',['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j100","xe80"]]],
+        ['g15_loose_2mu10_msonly',       'L1_2MU10', ['L1_EM8VH', 'L1_2MU10'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,[] ]],
 
         ### ATR-14351
         ['j100_xe110_mht_1dphi10_L1J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20s2XE50', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1,['serial',-1,["j100","xe110_mht"]]],
-        
-        ['mu4_j100_xe80_mht',  'L1_MU4_J50_XE40', ['L1_MU4','L1_J50', 'L1_XE40'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j100","xe80_mht"] ]],
-        ['2mu4_j80_xe40_mht',  'L1_2MU4_J40_XE20', ['L1_2MU4','L1_J40', 'L1_XE20'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4","j80","xe40_mht"] ]],
-
-	# ATR-14717
-        ['mu4_j125_xe90_mht',  'L1_MU4_J50_XE40', ['L1_MU4','L1_J50', 'L1_XE40'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j125","xe90_mht"] ]],
-        ['2mu4_j85_xe50_mht',  'L1_2MU4_J40_XE20', ['L1_2MU4','L1_J40', 'L1_XE20'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4","j85","xe50_mht"] ]],
 
 
         #ATR-15243 Higgsino
         #di-muon primary
-        ['2mu4_invm1_j20_xe40_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe40_pufit"]]], 
+        ['2mu4_invm1_j20_xe40_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe40_pufit"]]], 
 
         #di-muon backup
-        ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
+        ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
         ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE40_DPHI-J20s2XE30',  'L1_2MU4_J20_XE40_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
         ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE50_DPHI-J20s2XE30',  'L1_2MU4_J20_XE50_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
         ['2mu4_invm1_j20_xe80_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',  'L1_2MU4_J20_XE30_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe80_pufit"] ]],
         ['2mu4_invm1_j20_xe80_pufit_2dphi10_L12MU4_J20_XE40_DPHI-J20s2XE30',  'L1_2MU4_J20_XE40_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe80_pufit"] ]],
         ['2mu4_invm1_j20_xe80_pufit_2dphi10_L12MU4_J20_XE50_DPHI-J20s2XE30',  'L1_2MU4_J20_XE50_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe80_pufit"] ]],
-        ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J40_XE50',  'L1_2MU4_J40_XE50', ['L1_2MU4','L1_J40','L1_XE50'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
+        ['2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J40_XE50',  'L1_2MU4_J40_XE50', ['L1_2MU4','L1_J40','L1_XE50'], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe60_pufit"] ]],
         ['2mu4_invm1_j20_xe80_pufit_2dphi10_L12MU4_J40_XE50',  'L1_2MU4_J40_XE50', ['L1_2MU4','L1_J40','L1_XE50'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4_invm1","j20","xe80_pufit"] ]],
-        ['2mu4_invm1_j20_xe80_pufit_2dphi10_L12MU4_XE60',  'L1_2MU4_XE60', ['L1_2MU4','','L1_XE60'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet', 'BW:MET'], -1, ['serial',-1,["2mu4_invm1","j20","xe80_pufit"] ]],
 
         #single muon
         ['mu4_j80_xe80_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j80","xe80_pufit"] ]],
 
         #single muon backup
         ['mu4_j80_xe80_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',  'L1_MU4_J50_XE50_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j80","xe80_pufit"] ]],
-        ['mu4_j90_xe90_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',  'L1_MU4_J50_XE50_DPHI-J20s2XE30', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j90","xe90_pufit"] ]],
+        ['mu4_j90_xe90_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',  'L1_MU4_J50_XE50_DPHI-J20s2XE30', [], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j90","xe90_pufit"] ]],
         ['mu4_j80_xe80_pufit_2dphi10_L1MU4_XE60',  'L1_MU4_XE60', ['L1_MU4','','L1_XE60'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j80","xe80_pufit"] ]],
-        ['mu4_j90_xe90_pufit_2dphi10_L1MU4_XE60',  'L1_MU4_XE60', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j90","xe90_pufit"] ]],
+        ['mu4_j90_xe90_pufit_2dphi10_L1MU4_XE60',  'L1_MU4_XE60', [], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu4","j90","xe90_pufit"] ]],
 
 
   
 
         # mu-e
-        ['e5_lhvloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30', 'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1,['serial',-1,["e5_lhvloose_nod0","mu4","j30","xe40_pufit"]]],
+        ['e5_lhvloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30', 'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1,['serial',-1,["e5_lhvloose_nod0","mu4","j30","xe40_pufit"]]],
 
         #mu-e backup
-        ['e5_lhloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","mu4","j30","xe40_pufit"] ]],
+        ['e5_lhloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","mu4","j30","xe40_pufit"] ]],
         ['e5_lhmedium_nod0_mu4_j30_xe50_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe50_pufit"] ]], 
 
         ['e5_lhmedium_nod0_mu4_j30_xe65_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',  'L1_MU4_J30_XE40_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe65_pufit"] ]], 
         ['e5_lhmedium_nod0_mu4_j30_xe50_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',  'L1_MU4_J50_XE50_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe50_pufit"] ]], 
         ['e5_lhmedium_nod0_mu4_j30_xe65_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',  'L1_MU4_J50_XE50_DPHI-J20s2XE30', ['L1_EM3','','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe65_pufit"] ]], 
-        ['e5_lhmedium_nod0_mu4_j30_xe65_pufit_2dphi10_L1MU4_XE60',  'L1_MU4_XE60', ['L1_EM3','L1_MU4','','L1_XE60'], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe65_pufit"] ]], 
+        ['e5_lhmedium_nod0_mu4_j30_xe65_pufit_2dphi10_L1MU4_XE60',  'L1_MU4_XE60', ['L1_EM3','L1_MU4','','L1_XE60'], [PhysicsStream], ['Primary:20000','RATE:MuonJetMET', 'BW:Egamma', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","j30","xe65_pufit"] ]], 
 
 
         #di-electron
-        ['2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhvloose_nod0","j40","xe70_pufit"] ]],
+        ['2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhvloose_nod0","j40","xe70_pufit"] ]],
 
         #di-electron backup
         ['2e5_lhloose_nod0_j40_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhloose_nod0","j40","xe70_pufit"] ]],
         ['2e5_lhmedium_nod0_j40_xe80_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j40","xe80_pufit"] ]],
         ['2e5_lhmedium_nod0_j40_xe90_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j40","xe90_pufit"] ]],
-        ['2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhvloose_nod0","j40","xe70_pufit_L1XE60"] ]],
+        ['2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhvloose_nod0","j40","xe70_pufit_L1XE60"] ]],
         ['2e5_lhloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhloose_nod0","j40","xe70_pufit_L1XE60"] ]],
         ['2e5_lhmedium_nod0_j40_xe80_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j40","xe80_pufit_L1XE60"] ]],
         ['2e5_lhmedium_nod0_j40_xe90_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j40","xe90_pufit_L1XE60"] ]],
@@ -2859,11 +2601,11 @@ def setupMenu():
         ['e5_lhvloose_nod0_j50_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhvloose_nod0","j50","xe70_pufit"] ]],
 
         #single electron backup 
-        ['e5_lhloose_nod0_j50_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","j50","xe70_pufit"] ]],
-        ['e5_lhmedium_nod0_j50_xe80_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j50","xe80_pufit"] ]],
+        ['e5_lhloose_nod0_j50_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","j50","xe70_pufit"] ]],
+        ['e5_lhmedium_nod0_j50_xe80_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j50","xe80_pufit"] ]],
         ['e5_lhmedium_nod0_j50_xe90_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j50","xe90_pufit"] ]],
         ['e5_lhvloose_nod0_j50_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhvloose_nod0","j50","xe70_pufit_L1XE60"] ]],
-        ['e5_lhloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","j40","xe70_pufit_L1XE60"] ]],
+        ['e5_lhloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhloose_nod0","j40","xe70_pufit_L1XE60"] ]],
         ['e5_lhmedium_nod0_j40_xe80_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j40","xe80_pufit_L1XE60"] ]],
         ['e5_lhmedium_nod0_j40_xe90_pufit_2dphi10_L1XE60',  'L1_XE60', ['L1_EM3','',''], [PhysicsStream], ['RATE:EgammaJetMET', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","j40","xe90_pufit_L1XE60"] ]],
 
@@ -2872,8 +2614,6 @@ def setupMenu():
 
         #inclusive backup
         ['j70_xe100_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',  'L1_J40_XE50_DPHI-J20s2XE50', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j70","xe100_pufit"] ]],
-        ['j50_xe80_pufit_2dphi10_L1XE60',  'L1_XE60', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j50","xe80_pufit_L1XE60"] ]],
-        ['j70_xe100_pufit_2dphi10_L1XE60',  'L1_XE60', [], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j70","xe100_pufit_L1XE60"] ]],
 
         #ATR-16089 combined egamma support chains
         ['e50_etcut_trkcut_xe50_mt35', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e50_etcut_trkcut","xe50"]]],
@@ -2892,34 +2632,33 @@ def setupMenu():
         ['e50_etcut_trkcut_L1EM24VHIM_xe50_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e50_etcut_trkcut_L1EM24VHIM","xe50"]]],
         ['e60_etcut_trkcut_L1EM24VHIM_xe60_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","xe60"]]],
         ['e50_etcut_trkcut_L1EM24VHIM_j15_perf_xe50_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e50_etcut_trkcut_L1EM24VHIM","j15_perf","xe50"]]],
-        ['e60_etcut_trkcut_L1EM24VHIM_j15_perf_xe60_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","j15_perf","xe60"]]],
+        ['e60_etcut_trkcut_L1EM24VHIM_j15_perf_xe60_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","j15_perf","xe60"]]],
         ['e50_etcut_trkcut_L1EM24VHIM_xs30_xe30_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e50_etcut_trkcut_L1EM24VHIM","xs30","xe30"]]],
         ['e60_etcut_trkcut_L1EM24VHIM_xs30_xe30_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","xs30","xe30"]]],
         ['e50_etcut_trkcut_L1EM24VHIM_xs30_j15_perf_xe30_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e50_etcut_trkcut_L1EM24VHIM","xs30","j15_perf","xe30"]]],
-        ['e60_etcut_trkcut_L1EM24VHIM_xs30_j15_perf_xe30_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","xs30","j15_perf","xe30"]]],
+        ['e60_etcut_trkcut_L1EM24VHIM_xs30_j15_perf_xe30_6dphi15_mt35', 'L1_EM24VHIM', ['L1_EM24VHIM','','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e60_etcut_trkcut_L1EM24VHIM","xs30","j15_perf","xe30"]]],
 
 
 
-        ['mu4_j15_bperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15_bperf_split'] ]],
-        ['mu4_j25_bperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j25_bperf_split'] ]],
-        ['mu4_j15_gsc35_bperf_split_dr05_dz99', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15_gsc35_bperf_split'] ]],
-        ['mu6_j110_gsc150_bperf_split_dr05_dz99', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110_gsc150_bperf_split'] ]],
-        ['mu6_j225_gsc320_bperf_split_dr05_dz99', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j225_gsc320_bperf_split'] ]],
+        ['mu4_j15_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_boffperf_split'] ]],
+        ['mu4_j25_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j25_boffperf_split'] ]],
+        ['mu4_j15_gsc35_boffperf_split_dr05_dz99', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_gsc35_boffperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split_dr05_dz99', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split_dr05_dz99', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
 
-        ['mu4_j15_gsc35_bperf_split', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15_gsc35_bperf_split'] ]],
-        ['mu4_j15_gsc35_bperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15_gsc35_bperf_split'] ]],
-        ['mu4_j55_bperf_split_dr05_dz02',  'L1_MU4_J12', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j55_bperf_split'] ]],
-        ['mu6_j60_gsc85_bperf_split_dr05_dz02',  'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j60_gsc85_bperf_split'] ]],
-        ['mu6_j60_gsc110_bperf_split_dr05_dz02', 'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j60_gsc110_bperf_split'] ]],
-        ['mu6_j110_gsc150_bperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110_gsc150_bperf_split'] ]],
+        ['mu4_j15_gsc35_boffperf_split', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_gsc35_boffperf_split'] ]],
+        ['mu4_j15_gsc35_boffperf_split_dr05_dz02', 'L1_MU4',     ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_gsc35_boffperf_split'] ]],
+        ['mu6_j60_gsc85_boffperf_split_dr05_dz02',  'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j60_gsc85_boffperf_split'] ]],
+        ['mu6_j60_gsc110_boffperf_split_dr05_dz02', 'L1_MU6_J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j60_gsc110_boffperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
 
-        ['mu6_j110_gsc150_bperf_split', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j110_gsc150_bperf_split'] ]],
-        ['mu6_j150_gsc175_bperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j150_gsc175_bperf_split']]],
-        ['mu6_j175_gsc260_bperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j175_gsc260_bperf_split'] ]],
-        ['mu6_j225_gsc320_bperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j225_gsc320_bperf_split'] ]],
+        ['mu6_j110_gsc150_boffperf_split', 'L1_MU6_J40',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j110_gsc150_boffperf_split'] ]],
+        ['mu6_j150_gsc175_boffperf_split_dr05_dz02', 'L1_MU6_J40', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j150_gsc175_boffperf_split']]],
+        ['mu6_j175_gsc260_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j175_gsc260_boffperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
 
-        ['mu6_j225_gsc320_bperf_split', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j225_gsc320_bperf_split'] ]],
-        ['mu6_j225_gsc400_bperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j225_gsc400_bperf_split'] ]],
+        ['mu6_j225_gsc320_boffperf_split', 'L1_MU6_J75',     ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc320_boffperf_split'] ]],
+        ['mu6_j225_gsc400_boffperf_split_dr05_dz02', 'L1_MU6_J75', ['L1_MU6', ''], [PhysicsStream], ['Primary:17000','RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j225_gsc400_boffperf_split'] ]],
 
         ### ATR-14348: L1Topo egamma chains
         ['e18_etcut_trkcut_xs30_j15_perf_xe30_6dphi05_mt35_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30', 'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30', ['L1_EM15','','',''], [PhysicsStream], ['RATE:EgammaMET', 'BW:Egamma'], -1, ['serial',-1,["e18_etcut_trkcut","xs30","j15_perf","xe30"]]],
@@ -2933,15 +2672,15 @@ def setupMenu():
 
 
         ### ATR-14355: L1Topo bjet chains
-        ['mu4_2j40_dr05_j40_bmv2c1077_split_antimatchdr05mu_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '2j40', 'j40_bmv2c1077_split_antimatchdr05mu'] ], False],
-        ['mu4_2j35_dr05_j35_bmv2c1070_split_antimatchdr05mu_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '2j35', 'j35_bmv2c1070_split_antimatchdr05mu'] ], False],
-        ['mu4_2j40_dr05_j40_bmv2c1077_split_antimatchdr05mu_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '2j40', 'j40_bmv2c1077_split_antimatchdr05mu'] ], False],
-        ['mu4_2j35_dr05_j35_bmv2c1070_split_antimatchdr05mu_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '2j35', 'j35_bmv2c1070_split_antimatchdr05mu'] ], False],
-        ['mu4_3j45_dr05_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '3j45'] ], False],
-        ['mu4_3j45_dr05_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', '3j45'] ], False],
-
-        ['mu4_j15_gsc35_bperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu4', 'j15_gsc35_bperf_split'] ], False],
-        ['mu6_j60_gsc85_bperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet'], -1,['serial',-1,['mu6', 'j60_gsc85_bperf_split'] ], False],
+        ['mu4_2j40_dr05_j40_bmv2c1077_split_antimatchdr05mu_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '2j40', 'j40_bmv2c1077_split_antimatchdr05mu'] ], False],
+        ['mu4_2j35_dr05_j35_bmv2c1070_split_antimatchdr05mu_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '2j35', 'j35_bmv2c1070_split_antimatchdr05mu'] ], False],
+        ['mu4_2j40_dr05_j40_bmv2c1077_split_antimatchdr05mu_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '2j40', 'j40_bmv2c1077_split_antimatchdr05mu'] ], False],
+        ['mu4_2j35_dr05_j35_bmv2c1070_split_antimatchdr05mu_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', '', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '2j35', 'j35_bmv2c1070_split_antimatchdr05mu'] ], False],
+        ['mu4_3j45_dr05_L13J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '3j45'] ], False],
+        ['mu4_3j45_dr05_L13J20_BTAG-MU4J20', 'L1_3J20_BTAG-MU4J20', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', '3j45'] ], False],
+
+        ['mu4_j15_gsc35_boffperf_split_dr05_dz02_L1BTAG-MU4J15', 'L1_BTAG-MU4J15', ['L1_MU4', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu4', 'j15_gsc35_boffperf_split'] ], False],
+        ['mu6_j60_gsc85_boffperf_split_dr05_dz02_L1BTAG-MU6J20', 'L1_BTAG-MU6J20', ['L1_MU6', ''], [PhysicsStream], ['RATE:MuonBJet', 'BW:BJet_combined'], -1,['serial',-1,['mu6', 'j60_gsc85_boffperf_split'] ], False],
  
         #
         # BJet signal Perf chains
@@ -2949,74 +2688,55 @@ def setupMenu():
         # (Critical for BTagging SF Calculation with ttbar !) 
 
         # 2mu
-        ['2mu14_2j35_bperf',                 'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['2mu14', '2j35_bperf']]],
-        ['2mu14_2j35_boffperf',              'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['2mu14', '2j35_boffperf']]],
-        ['2mu14_2j35_boffperf_split',        'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['2mu14', '2j35_boffperf_split']]],
-        ['2mu14_2j15_gsc35_boffperf_split',  'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['2mu14', '2j15_gsc35_boffperf_split']]],
+        ['2mu14_2j35_boffperf',              'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['2mu14', '2j35_boffperf']]],
+        ['2mu14_2j35_boffperf_split',        'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['2mu14', '2j35_boffperf_split']]],
+        ['2mu14_2j15_gsc35_boffperf_split',  'L1_2MU10',   ['L1_2MU10',   ''],     [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['2mu14', '2j15_gsc35_boffperf_split']]],
 
         # 2e 
-        ['2e24_lhvloose_nod0_2j35_bperf',                  'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_bperf']]],
-        ['2e24_lhvloose_nod0_2j35_boffperf',               'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_boffperf']]],
-        ['2e24_lhvloose_nod0_2j35_boffperf_split',         'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_boffperf_split']]],
-        ['2e24_lhvloose_nod0_2j15_gsc35_boffperf_split',   'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j15_gsc35_boffperf_split']]],
+        ['2e24_lhvloose_nod0_2j35_boffperf',               'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_boffperf']]],
+        ['2e24_lhvloose_nod0_2j35_boffperf_split',         'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j35_boffperf_split']]],
+        ['2e24_lhvloose_nod0_2j15_gsc35_boffperf_split',   'L1_2EM20VH', ['L1_2EM20VH', ''],     [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],   -1, ['serial',-1,['2e24_lhvloose_nod0', '2j15_gsc35_boffperf_split']]],
 
         # e-mu
-#        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_bperf',                'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:BJet'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_bperf'] ]],
-#        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf',             'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:BJet'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_boffperf'] ]],
-#        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf_split',       'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:BJet'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_boffperf_split'] ]],
-#        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j15_gsc35_boffperf_split', 'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaMuon',  'BW:BJet'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j15_gsc35_boffperf_split'] ]],
+        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf',             'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon',  'BW:BJet_combined'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_boffperf'] ]],
+        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf_split',       'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon',  'BW:BJet_combined'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j35_boffperf_split'] ]],
+        ['e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j15_gsc35_boffperf_split', 'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon',  'BW:BJet_combined'], -1, ['serial',-1,['e28_lhmedium_nod0_L1EM24VHI','mu8noL1','2j15_gsc35_boffperf_split'] ]],
 
         # mu +asymmetric
-        ['mu26_ivarmedium_j150_bperf_j35_bperf',                                'L1_MU20MU21',  ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_bperf','j35_bperf']]],
-        ['mu26_ivarmedium_j150_boffperf_j35_boffperf',                          'L1_MU20MU21',  ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_boffperf','j35_boffperf']]],
-        ['mu26_ivarmedium_j150_boffperf_split_j35_boffperf_split',              'L1_MU20MU21',  ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_boffperf_split','j35_boffperf_split']]],
-        ['mu26_ivarmedium_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split', 'L1_MU20MU21',  ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],  -1, ['serial',-1,['mu26_ivarmedium', 'j110_gsc150_boffperf_split', 'j15_gsc35_boffperf_split']]],
+        ['mu26_ivarmedium_j150_boffperf_j35_boffperf',                      'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_boffperf','j35_boffperf']]],
+        ['mu26_ivarmedium_j150_boffperf_split_j35_boffperf_split',          'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', 'j150_boffperf_split','j35_boffperf_split']]],
+        ['mu26_ivarmedium_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split', 'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['Primary:20000','RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', 'j110_gsc150_boffperf_split', 'j15_gsc35_boffperf_split']]],
 
         # mu + symmetric
-        ['mu26_ivarmedium_2j35_bperf',    'L1_MU20MU21',  ['L1_MU20', ''],    [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],-1,['serial',-1,['mu26_ivarmedium', '2j35_bperf']]],
-        ['mu26_ivarmedium_2j35_boffperf',       'L1_MU20MU21',  ['L1_MU20', ''],    [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],-1,['serial',-1,['mu26_ivarmedium', '2j35_boffperf']]],
-        ['mu26_ivarmedium_2j35_boffperf_split',    'L1_MU20MU21',  ['L1_MU20', ''],    [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],-1,['serial',-1,['mu26_ivarmedium', '2j35_boffperf_split']]],
-        ['mu26_ivarmedium_2j15_gsc35_boffperf_split',    'L1_MU20MU21',  ['L1_MU20', ''],    [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet'],-1,['serial',-1,['mu26_ivarmedium', '2j15_gsc35_boffperf_split']]],
+        ['mu26_ivarmedium_2j35_boffperf',             'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', '2j35_boffperf']]],
+        ['mu26_ivarmedium_2j35_boffperf_split',       'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', '2j35_boffperf_split']]],
+        ['mu26_ivarmedium_2j15_gsc35_boffperf_split', 'L1_MU20MU21',    ['L1_MU20',    '', ''], [PhysicsStream], ['RATE:MuonBJet',  'BW:BJet_combined'],  -1, ['serial',-1,['mu26_ivarmedium', '2j15_gsc35_boffperf_split']]],
+
 
         # e
-        ['e28_lhtight_nod0_ivarloose_j150_bperf_j35_bperf',                                 'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_bperf','j35_bperf']]],
-        ['e28_lhtight_nod0_ivarloose_j150_boffperf_j35_boffperf',                           'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_boffperf','j35_boffperf']]],
-        ['e28_lhtight_nod0_ivarloose_j150_boffperf_split_j35_boffperf_split',               'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_boffperf_split','j35_boffperf_split']]],
-        ['e28_lhtight_nod0_ivarloose_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split',  'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j110_gsc150_boffperf_split','j15_gsc35_boffperf_split']]],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_bperf',                       'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_bperf']]],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_bperf_split',                 'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_bperf_split']]],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_boffperf',                    'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_boffperf']]],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_boffperf_split',              'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_boffperf_split']]],
-        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j15_gsc35_boffperf_split',        'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j15_gsc35_boffperf_split']]],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_bperf',                       'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_bperf']]],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_bperf_split',                 'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_bperf_split']]],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_boffperf',                    'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_boffperf']]],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_boffperf_split',              'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_boffperf_split']]],
-        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j15_gsc35_boffperf_split',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j15_gsc35_boffperf_split']]],
-
-        # Wgg triggers
-
-        ['e20_lhmedium_2g10_loose',  'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
-        ['e20_lhmedium_2g10_medium', 'L1_EM15VH_3EM7', ['L1_EM15VH','L1_2EM7'], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
-        ['2g10_loose_mu20',          'L1_MU20MU21',        ['L1_2EM7', 'L1_MU20'],  [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['2g10_loose','mu20'] ]],
-        ['2g10_medium_mu20',         'L1_MU20MU21',        ['L1_2EM7', 'L1_MU20'],  [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['2g10_medium','mu20'] ]],
+        ['e28_lhtight_nod0_ivarloose_j150_boffperf_j35_boffperf',                           'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_boffperf','j35_boffperf']]],
+        ['e28_lhtight_nod0_ivarloose_j150_boffperf_split_j35_boffperf_split',               'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j150_boffperf_split','j35_boffperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split',  'L1_EM24VHI', ['L1_EM24VHI', '', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose', 'j110_gsc150_boffperf_split','j15_gsc35_boffperf_split']]],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_boffperf',                    'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_boffperf']]],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j35_boffperf_split',              'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j35_boffperf_split']]],
+        ['e26_lhtight_nod0_ivarloose_L1EM22VHIM_2j15_gsc35_boffperf_split',        'L1_EM22VHIM', ['L1_EM22VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e26_lhtight_nod0_ivarloose_L1EM22VHIM', '2j15_gsc35_boffperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_boffperf',                    'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_boffperf']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j35_boffperf_split',              'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j35_boffperf_split']]],
+        ['e28_lhtight_nod0_ivarloose_L1EM24VHIM_2j15_gsc35_boffperf_split',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined'],  -1, ['serial',-1,['e28_lhtight_nod0_ivarloose_L1EM24VHIM', '2j15_gsc35_boffperf_split']]],
+        ['2g10_loose_mu20',          'L1_MU20MU21',    ['L1_2EM7', 'L1_MU20'],  [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['2g10_loose','mu20'] ]],
+        ['2g10_medium_mu20',         'L1_MU20MU21',    ['L1_2EM7', 'L1_MU20'],  [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['2g10_medium','mu20'] ]],
 
         # LLP trigger seeded by MUON items
-        ['j30_muvtx',                    'L1_2MU10',            [], [PhysicsStream], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
-        ['j30_muvtx_noiso',              'L1_2MU10',            [], [PhysicsStream], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+        ['j30_muvtx',                    'L1_2MU10',            [], [PhysicsStream], ['Primary:20000','RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
+        ['j30_muvtx_noiso',              'L1_2MU10',            [], [PhysicsStream], ['Primary:20000','RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
         ['j30_muvtx_L1MU6_EMPTY',        'L1_MU6_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
         ['j30_muvtx_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
-        ['j30_muvtx_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
 
         # LLP trigger seeded by TAU items
         ['j30_jes_PS_llp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j30_jes_PS_llp_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j30_jes_cleanLLP_PS_llp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_L1TAU100',             'L1_TAU100',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-
-        ['j30_jes_cleanLLP_PS_llp_L1TAU8_EMPTY',        'L1_TAU8_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_L1TAU8_UNPAIRED_ISO', 'L1_TAU8_UNPAIRED_ISO', [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_L1TAU8_UNPAIRED_NONISO', 'L1_TAU8_UNPAIRED_NONISO', [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_L1TAU100',             'L1_TAU100',             [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
       
 
         ['j30_jes_cleanLLP_PS_llp_L1TAU30_EMPTY',        'L1_TAU30_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -3025,21 +2745,17 @@ def setupMenu():
         ['j30_jes_cleanLLP_PS_llp_pufix_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j30_jes_cleanLLP_PS_llp_pufix_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU60',       'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU100',       'L1_TAU100',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
-
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_EMPTY',        'L1_TAU8_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_UNPAIRED_ISO',        'L1_TAU8_UNPAIRED_ISO',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU8_UNPAIRED_NONISO',     'L1_TAU8_UNPAIRED_NONISO',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU100',       'L1_TAU100',             [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1],
 
         ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU30_EMPTY',        'L1_TAU30_EMPTY',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
         ['j30_jes_cleanLLP_PS_llp_noiso_L1TAU30_UNPAIRED_ISO',  'L1_TAU30_UNPAIRED_ISO',        [], ["Late"], ['RATE:SingleJet', 'BW:Jet'], -1],
 
         # L1Topo LLP with TAU
-        ['j30_jes_cleanLLP_PS_llp_L1LLP-NOMATCH',       'L1_LLP-NOMATCH',       [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1, False],
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1LLP-NOMATCH', 'L1_LLP-NOMATCH',       [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1, False],
+        ['j30_jes_cleanLLP_PS_llp_L1LLP-NOMATCH',       'L1_LLP-NOMATCH',       [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1, False],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1LLP-NOMATCH', 'L1_LLP-NOMATCH',       [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1, False],
 
-        ['j30_jes_cleanLLP_PS_llp_L1LLP-RO',       'L1_LLP-RO',       [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1, False],
-        ['j30_jes_cleanLLP_PS_llp_noiso_L1LLP-RO', 'L1_LLP-RO',       [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1, False],
+        ['j30_jes_cleanLLP_PS_llp_L1LLP-RO',       'L1_LLP-RO',       [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1, False],
+        ['j30_jes_cleanLLP_PS_llp_noiso_L1LLP-RO', 'L1_LLP-RO',       [], [PhysicsStream], ['Primary:20000','RATE:SingleJet', 'BW:Jet'], -1, False],
 
         # reversed calo-ratio triggers
         ['j250_jes_cleanLLP_PS_revllp_L1TAU60',             'L1_TAU60',             [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
@@ -3048,12 +2764,10 @@ def setupMenu():
 
         ['j30_muvtx_noiso_L1MU6_EMPTY',        'L1_MU6_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
         ['j30_muvtx_noiso_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
-        ['j30_muvtx_noiso_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
 
         # LLP triggers
         ['g15_loose_2mu10_msonly_L1MU6_EMPTY',        'L1_MU6_EMPTY',['L1_EM8VH','L1_2MU10'], ["Late"], ['RATE:EgammaMuon', 'BW:Egamma','BW:Muon'],-1,['parallel',-1,[] ]],
         ['g15_loose_2mu10_msonly_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO',['L1_EM8VH','L1_2MU10'], ["Late"], ['RATE:EgammaMuon', 'BW:Egamma','BW:Muon'],-1,['parallel',-1,[] ]],
-        ['g15_loose_2mu10_msonly_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO',['L1_EM8VH','L1_2MU10'], ["Late"], ['RATE:EgammaMuon', 'BW:Egamma','BW:Muon'],-1,['parallel',-1,[] ]],
 
         ['j30_xe10_razor170', 'L1_2J15_XE55', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j30','xe10']]],
 
@@ -3068,25 +2782,14 @@ def setupMenu():
         ['j30_xe60_razor185', 'L1_2J15_XE55', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j30','xe60']]],
         ['j30_xe60_razor195', 'L1_2J15_XE55', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j30','xe60']]],
         #ATR-14196
-        ['j30_xe60_razor220', 'L1_2J15_XE55', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j30','xe60']]],
+        ['j30_xe60_razor220', 'L1_2J15_XE55', ['',''], [PhysicsStream], ['Primary:20000','RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j30','xe60']]],
 
         ['j55_0eta240_xe50_L1J30_EMPTY', 'L1_J30_EMPTY', ['',''], ['Late'], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,['j55_0eta240','xe50']]],
-
-
-        # Electron + Muon
-        ['g10_etcut_L1EM8I_mu10_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_etcut_L1EM8I","mu10"]] ],
         ['g20_etcut_L1EM15_mu4_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_etcut_L1EM15","mu4"]] ],
 
         ['g10_loose_L1EM8I_mu10_iloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_loose_L1EM8I","mu10_iloose"]] ],
         ['g20_loose_L1EM15_mu4_iloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_loose_L1EM15","mu4_iloose"]] ],
         ['g10_etcut_L1EM8I_mu10_iloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_etcut_L1EM8I","mu10_iloose"]] ],
-        ['g20_etcut_L1EM15_mu4_iloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_etcut_L1EM15","mu4_iloose"]] ],
-
-        ### ATR-14543
-        ['g10_loose_L1EM8I_mu10_ivarloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_loose_L1EM8I","mu10_ivarloose"]] ],
-        ['g20_loose_L1EM15_mu4_ivarloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_loose_L1EM15","mu4_ivarloose"]] ],
-        ['g10_etcut_L1EM8I_mu10_ivarloose_taumass',      'L1_EM8I_MU10',  ['L1_EM8I', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_etcut_L1EM8I","mu10_ivarloose"]] ],
-        ['g20_etcut_L1EM15_mu4_ivarloose_taumass',      'L1_EM15I_MU4',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_etcut_L1EM15","mu4_ivarloose"]] ],
 
         ## LFV chains (ATR-14352)
         ['g10_loose_mu10_iloose_taumass_L1LFV-EM8I', 'L1_LFV-EM8I',  ['L1_EM7', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_loose","mu10_iloose"]] ],
@@ -3095,103 +2798,65 @@ def setupMenu():
         ### ATR-14543
         ['g10_loose_mu10_ivarloose_taumass_L1LFV-EM8I', 'L1_LFV-EM8I',  ['L1_EM7', 'L1_MU10'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g10_loose","mu10_ivarloose"]] ],
         ['g20_loose_mu4_ivarloose_taumass_L1LFV-EM15I', 'L1_LFV-EM15I',  ['L1_EM15', 'L1_MU4'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['parallel',-1,["g20_loose","mu4_ivarloose"]] ],
-
-        # HLT photon and di-muon chains
-        ['g35_loose_L1EM22VHI_mu18noL1',        'L1_EM22VHI', ['L1_EM22VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM22VHI','mu18noL1'] ]],
-        ['g35_loose_L1EM22VHI_mu15noL1_mu2noL1', 'L1_EM22VHI', ['L1_EM22VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM22VHI','mu15noL1','mu2noL1']]],
-        # alternative HLT photon and di-muon chains with L1EM24VHI seed
-        ['g35_loose_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu18noL1'] ]],
-        ['g35_loose_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu18noL1'] ]],
-        ['g35_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
-        ['g40_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
-        ['g35_loose_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu15noL1','mu2noL1']]],
-        ['g35_loose_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu15noL1','mu2noL1']]],
-        ['g35_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
-        ['g40_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
+        ['g35_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
+        ['g40_tight_icalotight_L1EM24VHIM_mu18noL1',        'L1_EM24VHIM', ['L1_EM24VHIM', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu18noL1'] ]],
+        ['g35_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
+        ['g40_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHIM','mu15noL1','mu2noL1']]],
  
         #ATR-11623 photon + muon/di-muon chains L1_EM24VHI and L1_EM24VHIM seed
-        ['g35_tight_icalotight_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHI','mu18noL1'] ]],
-        ['g35_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHI','mu15noL1','mu2noL1']]],
-
-        ['g40_tight_icalotight_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu18noL1'] ]],
-        ['g40_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu15noL1','mu2noL1']]],
-
-        ['g35_loose_L1EM24VHI_mu18',        'L1_EM24VHI', ['L1_EM24VHI', 'L1_MU11'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu18'] ]],
-        ['g35_loose_L1EM24VHI_mu15_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', 'L1_MU11',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu15','mu2noL1']]],
-
-        ['g35_loose_L1EM24VHIM_mu18',        'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu18'] ]],
-        ['g35_loose_L1EM24VHIM_mu15_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11',''], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu15','mu2noL1']]],
+        ['g35_tight_icalotight_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHI','mu18noL1'] ]],
+        ['g35_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_tight_icalotight_L1EM24VHI','mu15noL1','mu2noL1']]],
 
+        ['g40_tight_icalotight_L1EM24VHI_mu18noL1',        'L1_EM24VHI', ['L1_EM24VHI', ''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu18noL1'] ]],
+        ['g40_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', '',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g40_tight_icalotight_L1EM24VHI','mu15noL1','mu2noL1']]],
 
+        ['g35_loose_L1EM24VHI_mu18',        'L1_EM24VHI', ['L1_EM24VHI', 'L1_MU11'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu18'] ]],
+        ['g35_loose_L1EM24VHI_mu15_mu2noL1', 'L1_EM24VHI', ['L1_EM24VHI', 'L1_MU11',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHI','mu15','mu2noL1']]],
 
-
-        #Performance:
-        ['e26_lhtight_idperf',        'L1_EM22VHI',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
-        ['e28_lhtight_idperf',        'L1_EM24VHI',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
-        ['e26_lhtight_idperf_L1EM22VHIM',        'L1_EM22VHIM',    [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
-        ['e28_lhtight_idperf_L1EM24VHIM',        'L1_EM24VHIM',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['g35_loose_L1EM24VHIM_mu18',        'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu18'] ]],
+        ['g35_loose_L1EM24VHIM_mu15_mu2noL1', 'L1_EM24VHIM', ['L1_EM24VHIM', 'L1_MU11',''], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1, ['serial',-1,['g35_loose_L1EM24VHIM','mu15','mu2noL1']]],
 
         # Heg chains
-        ['e25_mergedtight_g35_medium_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
-        ['e30_mergedtight_g35_medium_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e25_mergedtight_g35_medium_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e30_mergedtight_g35_medium_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
 
         # ATR-16089 Heg chains
         ['e25_mergedtight_g35_medium_icalovloose_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
         ['e25_mergedtight_g35_medium_icalotight_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
-        ['e25_mergedtight_ivarloose_g35_medium_icalovloose_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
+        ['e25_mergedtight_ivarloose_g35_medium_icalovloose_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
         ['e25_mergedtight_ivarloose_g35_medium_icalotight_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
  
         ['e30_mergedtight_g35_medium_icalovloose_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
         ['e30_mergedtight_g35_medium_icalotight_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
         ['e30_mergedtight_ivarloose_g35_medium_icalovloose_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
         ['e30_mergedtight_ivarloose_g35_medium_icalotight_Heg',       'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
- 
-
-
-	# COMBINED TAU CHAINS
-
-	# e+tau
-        #new ones   
-	                                                                                                                     
-	['e17_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo_L1EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15',   'L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15',['L1_EM15VHI','L1_TAU20IM'], [PhysicsStream],['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau35_medium1_tracktwo"]]],
 	# new chain for 2e34 backup (ATR-15225)
-        ['e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo',  'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',['L1_EM20VHI','L1_TAU20IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e24_lhmedium_nod0_ivarloose","tau35_medium1_tracktwo"]]],
+        ['e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo',  'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',['L1_EM20VHI','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e24_lhmedium_nod0_ivarloose","tau35_medium1_tracktwo"]]],
 	                                               
         ['e17_lhmedium_nod0_tau80_medium1_tracktwo',   'L1_EM15VHI_TAU40_2TAU15',['L1_EM15VHI','L1_TAU40'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0","tau80_medium1_tracktwo"]]],
-        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo',  'L1_EM15VHI_2TAU12IM_J25_3J12',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream],['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
+        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo',  'L1_EM15VHI_2TAU12IM_J25_3J12',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream],['Primary:17000','RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
 
-        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM_4J12',   'L1_EM15VHI_2TAU12IM_4J12',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream],['RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
-
-	# support for l1topo chains
-        ['e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM',  'L1_EM15VHI_2TAU12IM',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_iloose","tau25_medium1_tracktwo"]]],
+        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM_4J12',   'L1_EM15VHI_2TAU12IM_4J12',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream],['Primary:20000','RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
         ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM',  'L1_EM15VHI_2TAU12IM',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
 
 	#L1Topo e+tau chains
         ['e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',  'L1_DR-EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1 ,["e17_lhmedium_nod0_iloose","tau25_medium1_tracktwo"]]],
-        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25', 'L1_DR-EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'],-1,['serial',-1 ,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
+        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25', 'L1_DR-EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:ElectronTau', 'BW:Tau'],-1,['serial',-1 ,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
         ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25', 'L1_EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo"]]],
         ['e17_lhmedium_nod0_tau25_medium1_tracktwo_L1EM15TAU12I-J25',  'L1_EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0","tau25_medium1_tracktwo"]]],
         ['e17_lhmedium_nod0_iloose_tau25_medium1_tracktwo_L1EM15TAU12I-J25',  'L1_EM15TAU12I-J25',['L1_EM15VHI','L1_TAU12IM'], [PhysicsStream], ['RATE:ElectronTau', 'BW:Tau'], -1,['serial',-1,["e17_lhmedium_nod0_iloose","tau25_medium1_tracktwo"]]],
-        ['mu14_ivarloose_tau35_medium1_tracktwo',  'L1_MU10_TAU20IM',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwo"]]],
-        ['mu14_ivarloose_L1MU11_tau35_medium1_tracktwo_L1MU11_TAU20IM',  'L1_MU11_TAU20IM',['L1_MU11','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose_L1MU11","tau35_medium1_tracktwo"]]],
-        ['mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20',      'L1_MU10_TAU20IM_J25_2J20',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwo"]]],   
+        ['mu14_ivarloose_tau35_medium1_tracktwo',  'L1_MU10_TAU20IM',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['Primary:17000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwo"]]],
+        ['mu14_ivarloose_L1MU11_tau35_medium1_tracktwo_L1MU11_TAU20IM',  'L1_MU11_TAU20IM',['L1_MU11','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose_L1MU11","tau35_medium1_tracktwo"]]],
+        ['mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20',      'L1_MU10_TAU20IM_J25_2J20',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau35_medium1_tracktwo"]]],   
 
         ['mu14_iloose_tau25_perf_tracktwo', 'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau25_perf_tracktwo"]]],
-        ### ATR-14543
-        ['mu14_ivarloose_tau25_perf_tracktwo', 'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream, 'express'], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_perf_tracktwo"]]],
-
-        ['mu14_iloose_tau25_medium1_tracktwo',      'L1_MU10_TAU12IM_J25_2J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],        
-        ['mu14_ivarloose_tau25_medium1_tracktwo',      'L1_MU10_TAU12IM_J25_2J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],        
-        ['mu14_iloose_tau35_medium1_tracktwo',  'L1_MU10_TAU20IM',['L1_MU10','L1_TAU20IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_iloose","tau35_medium1_tracktwo"]]],
-        ['mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM_3J12',      'L1_MU10_TAU12IM_3J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
-
-        #mu+tau chains seeded by L1MU10TAU20IM, needed as supporting triggers for the primary chains with either L1 jet or L1topo
-        ['mu14_iloose_tau25_medium1_tracktwo_L1MU10_TAU12IM',  'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],
+        ['mu14_ivarloose_tau25_medium1_tracktwo',      'L1_MU10_TAU12IM_J25_2J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['Primary:17000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],        
+        ['mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM_3J12',      'L1_MU10_TAU12IM_3J12',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
         ['mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM',  'L1_MU10_TAU12IM',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
 
         # l1topo tau+mu chains
         ['mu14_tau25_medium1_tracktwo_L1DR-MU10TAU12I',  'L1_DR-MU10TAU12I',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14","tau25_medium1_tracktwo"]]],
-        ['mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25', 'L1_DR-MU10TAU12I_TAU12I-J25',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
+        ['mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25', 'L1_DR-MU10TAU12I_TAU12I-J25',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['Primary:20000','RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
         ['mu14_iloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25', 'L1_DR-MU10TAU12I_TAU12I-J25',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],
         ['mu14_iloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I', 'L1_DR-MU10TAU12I',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_iloose","tau25_medium1_tracktwo"]]],
         ['mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I', 'L1_DR-MU10TAU12I',['L1_MU10','L1_TAU12IM'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose","tau25_medium1_tracktwo"]]],
@@ -3200,22 +2865,18 @@ def setupMenu():
 
         
         # Tau + MET
-        ['tau35_medium1_tracktwo_xe70_L1XE45',  'L1_TAU20IM_2J20_XE45',['L1_TAU20IM','L1_XE45'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","xe70_L1XE45"]]],  
-        
-        # Ditau + MET
-        ['tau35_medium1_tracktwo_L1TAU20_tau25_medium1_tracktwo_L1TAU12_xe50', 'L1_TAU20_2TAU12_XE35',['L1_TAU20','L1_TAU12','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo_L1TAU20","tau25_medium1_tracktwo_L1TAU12","xe50"]]],
+        ['tau35_medium1_tracktwo_xe70_L1XE45',  'L1_TAU20IM_2J20_XE45',['L1_TAU20IM','L1_XE45'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","xe70_L1XE45"]]],  
         ['tau35_medium1_tracktwo_tau25_medium1_tracktwo_xe50', 'L1_TAU20IM_2TAU12IM_XE35',['L1_TAU20IM','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau35_medium1_tracktwo","tau25_medium1_tracktwo","xe50"]]],
-        ['tau60_medium1_tracktwo_tau25_medium1_tracktwo_xe50', 'L1_TAU40_2TAU12IM_XE40',['L1_TAU40','L1_TAU12IM','L1_XE40'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau60_medium1_tracktwo","tau25_medium1_tracktwo","xe50"]]],
+        ['tau60_medium1_tracktwo_tau25_medium1_tracktwo_xe50', 'L1_TAU40_2TAU12IM_XE40',['L1_TAU40','L1_TAU12IM','L1_XE40'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["tau60_medium1_tracktwo","tau25_medium1_tracktwo","xe50"]]],
  
         # Tau + e + MET
-        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_xe50', 'L1_EM15VHI_2TAU12IM_XE35',['L1_EM15VHI','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau', 'BW:Egamma'],-1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo", "xe50"]]],
-        ['e17_lhmedium_nod0_tau25_medium1_tracktwo_xe50', 'L1_EM15VHI_2TAU12IM_XE35',['L1_EM15VHI','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0","tau25_medium1_tracktwo", "xe50"]]],
+        ['e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_xe50', 'L1_EM15VHI_2TAU12IM_XE35',['L1_EM15VHI','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau', 'BW:Egamma'],-1,['serial',-1,["e17_lhmedium_nod0_ivarloose","tau25_medium1_tracktwo", "xe50"]]],
+        ['e17_lhmedium_nod0_tau25_medium1_tracktwo_xe50', 'L1_EM15VHI_2TAU12IM_XE35',['L1_EM15VHI','L1_TAU12IM','L1_XE35'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e17_lhmedium_nod0","tau25_medium1_tracktwo", "xe50"]]],
 
 
         # Tau + mu + MET
-        ['mu14_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14", "tau25_medium1_tracktwo","xe50"]]],
-        ['mu14_iloose_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14_iloose", "tau25_medium1_tracktwo","xe50"]]],        
-        ['mu14_ivarloose_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose", "tau25_medium1_tracktwo","xe50"]]],
+        ['mu14_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14", "tau25_medium1_tracktwo","xe50"]]],
+        ['mu14_ivarloose_tau25_medium1_tracktwo_xe50', 'L1_MU10_TAU12IM_XE35',['L1_MU10', 'L1_TAU12IM','L1_XE35'], [PhysicsStream], ['Primary:20000','RATE:TauMET', 'BW:Tau'], -1,['serial',-1,["mu14_ivarloose", "tau25_medium1_tracktwo","xe50"]]],
 
 
         ['j80_xe80',               'L1_J40_XE50',['',''], [PhysicsStream, 'express'], ['RATE:JetMET', 'BW:Jet', 'BW:MET'], -1,['serial',-1,["j80","xe80"]]], 
@@ -3224,7 +2885,7 @@ def setupMenu():
         ['e20_lhtight_nod0_3j20_L1EM18VHI_3J20',      'L1_EM18VHI_3J20',    ['L1_EM18VHI_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhtight_nod0","3j20"] ]],
 
         ### ATR-15524
-        ['e20_lhtight_nod0_ivarloose_3j20_L1EM18VHI_3J20', 'L1_EM18VHI_3J20',    ['L1_EM18VHI_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhtight_nod0_ivarloose","3j20"] ]],
+        ['e20_lhtight_nod0_ivarloose_3j20_L1EM18VHI_3J20', 'L1_EM18VHI_3J20',    ['L1_EM18VHI_3J20',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhtight_nod0_ivarloose","3j20"] ]],
         ['e20_lhmedium_nod0_3j20_L1EM18VHI_3J20', 'L1_EM18VHI_3J20',    ['L1_EM18VHI_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhmedium_nod0","3j20"] ]],
          
          
@@ -3238,10 +2899,6 @@ def setupMenu():
         ['e26_lhvloose_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM20VH","4j20noL1"] ]],
         ['e26_lhvloose_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM20VH","5j15noL1"] ]],
         ['e26_lhvloose_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhvloose_nod0_L1EM20VH","6j15noL1"] ]],
-        ['e24_lhvloose_nod0_L1EM20VH_3j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","3j20noL1"] ]],
-        ['e24_lhvloose_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","4j20noL1"] ]],
-        ['e24_lhvloose_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","5j15noL1"] ]],
-        ['e24_lhvloose_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhvloose_nod0_L1EM20VH","6j15noL1"] ]],
 				# e+jets ATR-14404
         ['e28_lhmedium_nod0_L1EM20VH_3j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM20VH","3j20noL1"] ]],
         ['e28_lhmedium_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e28_lhmedium_nod0_L1EM20VH","4j20noL1"] ]],
@@ -3251,40 +2908,41 @@ def setupMenu():
         ['e26_lhmedium_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM20VH","4j20noL1"] ]],
         ['e26_lhmedium_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM20VH","5j15noL1"] ]],
         ['e26_lhmedium_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e26_lhmedium_nod0_L1EM20VH","6j15noL1"] ]],
-        ['e24_lhmedium_nod0_L1EM20VH_3j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","3j20noL1"] ]],
-        ['e24_lhmedium_nod0_L1EM20VH_4j20noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","4j20noL1"] ]],
-        ['e24_lhmedium_nod0_L1EM20VH_5j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","5j15noL1"] ]],
-        ['e24_lhmedium_nod0_L1EM20VH_6j15noL1',  'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1, ['serial',-1,["e24_lhmedium_nod0_L1EM20VH","6j15noL1"] ]],
 
 
-        ['mu26_2j20noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","2j20noL1"] ]],
-        ['mu26_3j20noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","3j20noL1"] ]],
-        ['mu26_4j15noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","4j15noL1"] ]],
-        ['mu26_5j15noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","5j15noL1"] ]],
+        ['mu26_2j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","2j20noL1"] ]],
+        ['mu26_3j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","3j20noL1"] ]],
+        ['mu26_4j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","4j15noL1"] ]],
+        ['mu26_5j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu26","5j15noL1"] ]],
          
-        ['mu24_2j20noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","2j20noL1"] ]],
-        ['mu24_3j20noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","3j20noL1"] ]],
-        ['mu24_4j15noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","4j15noL1"] ]],
-        ['mu24_5j15noL1',  'L1_MU20MU21',  ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","5j15noL1"] ]],
+        ['mu24_2j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","2j20noL1"] ]],
+        ['mu24_3j20noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","3j20noL1"] ]],
+        ['mu24_4j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","4j15noL1"] ]],
+        ['mu24_5j15noL1',  'L1_MU20MU21', ['L1_MU20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu24","5j15noL1"] ]],
 
         
         # VBF triggers
 
         ['g25_medium_L1EM22VHI_4j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_medium_L1EM22VHI","4j35_0eta490_invm700"]]],
         #ATR-14196
-        ['g25_medium_L1EM22VHI_4j35_0eta490_invm1000', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_medium_L1EM22VHI","4j35_0eta490_invm1000"]]],
+        ['g25_medium_L1EM22VHI_4j35_0eta490_invm1000', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_medium_L1EM22VHI","4j35_0eta490_invm1000"]]],
         ['g25_loose_L1EM20VH_4j35_0eta490', 'L1_EM20VH', ['L1_EM20VH',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g25_loose_L1EM20VH","4j35_0eta490"]]],
-        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', 'j35_0eta490_bmv2c1077','3j35_0eta490_invm700']]],
-        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490_bmv2c1077','2j35_0eta490']]],
-	
-        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', 'j35_0eta490_bmv2c1077_split','3j35_0eta490_invm700']]],
+
 	
-        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_split_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490_bmv2c1077_split','2j35_0eta490']]],	
+#        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', 'j35_0eta490_bmv2c1077_split','3j35_0eta490_invm700']]],
+#        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_split_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490_bmv2c1077_split','2j35_0eta490']]],	
+        ['g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI','3j35_0eta490_invm700','j35_0eta490_bmv2c1077_split']]],
+        ['g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_split_2j35_0eta490', 'L1_EM22VHI', ['L1_EM22VHI', '', ''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:BJet_combined','BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI','2j35_0eta490','2j35_0eta490_bmv2c1077_split']]],
+
 
         #ATR-15062
-        ['g20_tight_icaloloose_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm500', 'L1_EM18VHI_MJJ-300', ['','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g20_tight_icaloloose","j15_gsc35_bmv2c1077_split","3j35_0eta490_invm500"]]],
-        ['g27_medium_L1EM24VHI_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","j15_gsc35_bmv2c1077_split","3j35_0eta490_invm700"]]],        
-        ['g27_medium_L1EM24VHI_2j15_gsc35_bmv2c1077_split_2j35_0eta490', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","2j15_gsc35_bmv2c1077_split","2j35_0eta490"]]],
+#        ['g20_tight_icaloloose_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm500', 'L1_EM18VHI_MJJ-300', ['','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g20_tight_icaloloose","j15_gsc35_bmv2c1077_split","3j35_0eta490_invm500"]]],
+#        ['g27_medium_L1EM24VHI_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","j15_gsc35_bmv2c1077_split","3j35_0eta490_invm700"]]],        
+#        ['g27_medium_L1EM24VHI_2j15_gsc35_bmv2c1077_split_2j35_0eta490', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","2j15_gsc35_bmv2c1077_split","2j35_0eta490"]]],
+        ['g20_tight_icaloloose_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm500', 'L1_EM18VHI_MJJ-300', ['','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g20_tight_icaloloose","3j35_0eta490_invm500","j15_gsc35_bmv2c1077_split"]]],
+        ['g27_medium_L1EM24VHI_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm700', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","3j35_0eta490_invm700","j15_gsc35_bmv2c1077_split"]]],
+        ['g27_medium_L1EM24VHI_2j15_gsc35_bmv2c1077_split_2j35_0eta490', 'L1_EM24VHI', ['L1_EM24VHI','',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g27_medium_L1EM24VHI","2j35_0eta490","2j15_gsc35_bmv2c1077_split"]]],
+
 
         ### ATR-14356: egamma+jets VBF chians
         ['g25_medium_L1EM22VHI_2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400', 'L1_EM22VHI', ['L1_EM22VHI', 'L1_HT150-JJ15.ETA49_MJJ-400'], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'],-1,['serial',-1,['g25_medium_L1EM22VHI', '2j35_0eta490_invm700_L1HT150-JJ15.ETA49_MJJ-400']]],
@@ -3293,31 +2951,30 @@ def setupMenu():
         ['mu6_2j40_0eta490_invm400_L1MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J30.0ETA49_2J20.0ETA49', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu6","2j40_0eta490_invm400"]]],
         ['mu6_2j40_0eta490_invm600_L1MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J30.0ETA49_2J20.0ETA49', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu6","2j40_0eta490_invm600"]]],
         ['mu6_2j40_0eta490_invm800_L1MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J30.0ETA49_2J20.0ETA49', ['L1_MU6',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["mu6","2j40_0eta490_invm800"]]],
+        ['j80_0eta240_j60_j45_320eta490_AND_2j25_gsc45_bmv2c1070_split','L1_J40.0ETA25_2J25_J20.31ETA49', ['','','','',''], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j80_0eta240','j60','j45_320eta490_AND','2j25_gsc45_bmv2c1070_split'] ]],
 
-	# Hbb VBF trigger (ATR-13526)
-        ['j80_0eta240_j60_j45_320eta490_invm700_AND_j45_bmv2c1070_split_j45_bmv2c1077_split','L1_J40.0ETA25_2J25_J20.31ETA49', ['','','','',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1, ['serial',-1,['j80_0eta240','j60','j45_320eta490_invm700_AND','j45_bmv2c1070_split','j45_bmv2c1077_split'] ]],
+#        ['j55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j55_bmv2c1070_split','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
+#        ['j35_gsc55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j35_gsc55_bmv2c1070_split','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
+	['j55_0eta240_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['j55_0eta240','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
+        ['j35_gsc55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['Primary:20000','RATE:MultiBJet', 'BW:BJet_combined' ], -1, ['serial',-1,['2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','j35_gsc55_bmv2c1070_split'] ]],
 
-        ['j80_0eta240_j60_j45_320eta490_AND_2j25_gsc45_bmv2c1070_split','L1_J40.0ETA25_2J25_J20.31ETA49', ['','','','',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1, ['serial',-1,['j80_0eta240','j60','j45_320eta490_AND','2j25_gsc45_bmv2c1070_split'] ]],
-        ['j55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1, ['serial',-1,['j55_bmv2c1070_split','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
-        ['j35_gsc55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1, ['serial',-1,['j35_gsc55_bmv2c1070_split','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
-				['j55_0eta240_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49','L1_J25.0ETA23_2J15.31ETA49',['',''], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet' ], -1, ['serial',-1,['j55_0eta240','2j45_320eta490_L1J25.0ETA23_2J15.31ETA49'] ]],
 
         ['j40_0eta490_j30_0eta490_deta25_xe80_L1XE50',    'L1_XE50', ['','',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_0eta490","j30_0eta490_deta25","xe80_L1XE50"]]],
  
         # 2017 g+tau chains (ATR-16266)
 	# ATR-14947
-        ['g25_medium_L1EM24VHIM_tau25_dikaonmass_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dikaonmass_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_dikaonmass_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dikaonmass_tracktwo'],False]],
-        ['g25_medium_L1EM24VHIM_tau25_singlepion_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_singlepion_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_singlepion_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_singlepion_tracktwo'],False]],
-        ['g25_medium_L1EM24VHIM_tau25_dipion1loose_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion1loose_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_dipion1loose_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dipion1loose_tracktwo'],False]],
-        ['g25_medium_L1EM24VHIM_tau25_dipion2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion2_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_dipion2_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dipion2_tracktwo'],False]],
-        ['g25_medium_L1EM24VHIM_tau25_kaonpi1_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi1_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_kaonpi1_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi1_tracktwo'],False]],
-        ['g25_medium_L1EM24VHIM_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi2_tracktwo'],False]],
-        ['g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi2_tracktwo'],False]],	
+        ['g25_medium_L1EM24VHIM_tau25_dikaonmass_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dikaonmass_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_dikaonmass_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dikaonmass_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_singlepion_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_singlepion_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_singlepion_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_singlepion_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_dipion1loose_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion1loose_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_dipion1loose_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dipion1loose_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_dipion2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_dipion2_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_dipion2_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_dipion2_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_kaonpi1_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi1_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_kaonpi1_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi1_tracktwo'],False]],
+        ['g25_medium_L1EM24VHIM_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHIM', ['L1_EM24VHIM','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHIM','tau25_kaonpi2_tracktwo'],False]],
+        ['g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwo_50mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium_L1EM24VHI','tau25_kaonpi2_tracktwo'],False]],	
         # new L1topo g+tau chain (ATR-14349)
         ['g25_medium_tau25_dikaonmass_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_dikaonmass_tracktwo'],False]],
         ['g25_medium_tau25_singlepion_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_singlepion_tracktwo'],False]],
@@ -3326,41 +2983,24 @@ def setupMenu():
         ['g25_medium_tau25_kaonpi1_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_kaonpi1_tracktwo'],False]],
         ['g25_medium_tau25_kaonpi2_tracktwo_50mVis10000_L130M-EM20ITAU12','L1_30M-EM20ITAU12', ['L1_EM20VHI','L1_TAU12'], [PhysicsStream], ['RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g25_medium','tau25_kaonpi2_tracktwo'],False]],
 
-
-        ['g75_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g75_tight_L1EM22VHI","3j50noL1"]]],
-
         ### ATR-14196
-        ['g85_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHIM","3j50noL1"]]],
-        ['g85_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
-        ['g100_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHIM","3j50noL1"]]],
-        ['g100_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
-       	['g85_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM22VHI","3j50noL1"]]],
-        ['g85_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHI","3j50noL1"]]],
-        ['g100_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM22VHI","3j50noL1"]]],
-        ['g100_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHI","3j50noL1"]]],
+        ['g85_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHIM","3j50noL1"]]],
+        ['g85_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
+        ['g100_tight_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHIM","3j50noL1"]]],
+        ['g100_tight_icalovloose_L1EM24VHIM_3j50noL1', 'L1_EM24VHIM', ['L1_EM24VHIM',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_icalovloose_L1EM24VHIM","3j50noL1"]]],
+       	['g85_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM22VHI","3j50noL1"]]],
+        ['g85_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g85_tight_L1EM24VHI","3j50noL1"]]],
+        ['g100_tight_L1EM22VHI_3j50noL1', 'L1_EM22VHI', ['L1_EM22VHI',''], [PhysicsStream], ['Primary:17000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM22VHI","3j50noL1"]]],
+        ['g100_tight_L1EM24VHI_3j50noL1', 'L1_EM24VHI', ['L1_EM24VHI',''], [PhysicsStream], ['Primary:20000','RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'], -1,['serial',-1,["g100_tight_L1EM24VHI","3j50noL1"]]],
 
         ['g85_tight', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
         ['g85_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
         ['g100_tight', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
         ['g100_tight_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1],
-
-
-
-
-
-        ['j80_bmv2c1060_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet'], -1,['serial',-1,["j80_bmv2c1060_split","xe60"]]], 
      #ATR-14196
-     ['j80_bmv2c1050_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet'], -1,['serial',-1,["j80_bmv2c1050_split","xe60"]]],
-
-      ['j80_bmv2c1077_split_xe70_L1J400ETA25_XE50','L1_J40.0ETA25_XE50',  ['L1_J40.0ETA25','XE50'],  [PhysicsStream], ['RATE:JetMET', 'BW:MET', 'BW:BJet'], -1,['serial',-1,["j80_bmv2c1077_split","xe70_L1J400ETA25_XE50"]]],
-
-        # MET+jet chains with cleaning
-        ['j40_cleanT_xe80_L1XE60',    'L1_XE60', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe80_L1XE60"]]],
+        ['j80_bmv2c1050_split_xe60_L12J50_XE40','L1_2J50_XE40',  [],  [PhysicsStream], ['Primary:17000','RATE:JetMET', 'BW:MET', 'BW:BJet_combined'], -1,['serial',-1,["xe60","j80_bmv2c1050_split"]]],
         ['j40_cleanT_xe85_tc_lcw_2dphi05_L1XE50',         'L1_XE50', ['',''], [PhysicsStream], ['RATE:JetMET', 'BW:Jet'], -1, ['serial',-1,["j40_cleanT","xe85_tc_lcw_L1XE50"]]],
-
-        # muon plus multijets
-        ['mu14_iloose_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14_iloose', '3j20'] ],True],
-        ['mu14_ivarloose_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14_ivarloose', '3j20'] ],True],
+        ['mu14_ivarloose_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['Primary:20000','RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14_ivarloose', '3j20'] ],True],
         ### ATR-15524
         ['mu14_3j20_L1MU10_3J20', 'L1_MU10_3J20', ['L1_MU10_3J20', ''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1,['serial',-1,['mu14', '3j20'] ],True],
 
@@ -3371,28 +3011,139 @@ def setupMenu():
         #mujet matching chain 
         ['g15_loose_2mu10_msonly_L1MU4_EMPTY',        'L1_MU4_EMPTY',['L1_EM8VH','L1_2MU10'], ["Late"], ['RATE:EgammaMuon', 'BW:Egamma','BW:Muon'],-1,['parallel',-1,[] ]],
 
-        ['j30_muvtx_L1MU4_EMPTY',        'L1_MU4_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
-        ['j30_muvtx_noiso_L1MU4_EMPTY',        'L1_MU4_EMPTY',        [], ["Late"], ['RATE:MuonJet','BW:Muon', 'BW:Jet'], -1],
-
-
+        # with pi0's (ATR-16600)
+        ['g35_medium_L1EM24VHI_tau25_dipion3_tracktwo_60mVis10000','L1_EM24VHI', ['L1_EM24VHI','L1_TAU12'], [PhysicsStream], ['Primary:20000','RATE:TauGamma', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,['g35_medium_L1EM24VHI','tau25_dipion3_tracktwo'],False]],
 
         ## Lepton + jets with unisolated leptons:
         # For above 1.0 e34
         ['e26_lhmedium_nod0_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e26_lhmedium_nod0","5j30_0eta240"] ]],
-        ['e26_lhmedium_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e26_lhmedium","5j30_0eta240"] ]],
         ['mu26_5j30_0eta240_L1MU10_3J20',    	'L1_MU10_3J20',    ['L1_MU10_3J20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'],-1, ['serial',-1,["mu26","5j30_0eta240"] ]],
         # For below 1.0 e34
         ['e24_lhmedium_nod0_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e24_lhmedium_nod0","5j30_0eta240"] ]],
-        ['e24_lhmedium_5j30_0eta240_L1EM20VH_3J20',    	'L1_EM20VH_3J20',    ['L1_EM20VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e24_lhmedium","5j30_0eta240"] ]],
         ['mu24_5j30_0eta240_L1MU10_3J20',    	'L1_MU10_3J20',    ['L1_MU10_3J20',''], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon', 'BW:Jet'],-1, ['serial',-1,["mu24","5j30_0eta240"] ]],
-        ['mu20_mu8noL1_e9_lhvloose_nod0',        'L1_MU20',  ['L1_MU20','','L1_EM3'],   [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
-        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM8VH_MU20',  'L1_EM8VH_MU20',['L1_MU20','','L1_EM8VH'], [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
-        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU20',    'L1_EM7_MU20',  ['L1_MU20','','L1_EM7'],   [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
-        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU11',    'L1_EM7_MU11',  ['L1_MU11','','L1_EM7'],   [PhysicsStream], ['RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
+        ['mu20_mu8noL1_e9_lhvloose_nod0',        'L1_MU20MU21',  ['L1_MU20','','L1_EM3'],   [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
+        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM8VH_MU20',  'L1_EM8VH_MU20',['L1_MU20','','L1_EM8VH'], [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
+        ['mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU20',    'L1_EM7_MU20',  ['L1_MU20','','L1_EM7'],   [PhysicsStream], ['Primary:20000','RATE:EgammaMuon', 'BW:Egamma', 'BW:Muon'], -1,['serial',-1,['mu20','mu8noL1','e9_lhvloose_nod0'] ]],
+
+        #HMT + muons
+        ['mu4_mb_sp600_trk40_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp600_trk40_hmt'],False]],
+        ['mu4_mb_sp700_trk50_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp700_trk50_hmt'],False]],
+        ['mu4_mb_sp900_trk60_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp900_trk60_hmt'],False]],
+        ['mu4_mb_sp1100_trk70_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1100_trk70_hmt'],False]],
+        ['mu4_mb_sp1200_trk80_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1200_trk80_hmt'],False]],
+        ['mu4_mb_sp1400_trk90_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_trk100_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_trk100_hmt'],False]],
+
+        ['mu4_mb_sp600_pusup300_trk40_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp600_pusup300_trk40_hmt'],False]],
+        ['mu4_mb_sp700_pusup350_trk50_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp700_pusup350_trk50_hmt'],False]],
+        ['mu4_mb_sp900_pusup400_trk60_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp900_pusup400_trk60_hmt'],False]],
+        ['mu4_mb_sp1100_pusup450_trk70_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1100_pusup450_trk70_hmt'],False]],
+        ['mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE10', 'L1_MU4_TE10', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+        
+        ['mu4_mb_sp1200_trk80_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1200_trk80_hmt'],False]],
+        ['mu4_mb_sp1400_trk90_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_trk100_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_trk100_hmt'],False]],
+        ['mu4_mb_sp1400_trk90_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_trk100_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_trk100_hmt'],False]],
+        ['mu4_mb_sp1700_trk110_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1700_trk110_hmt'],False]],
+
+        ['mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+        ['mu4_mb_sp1700_pusup650_trk110_hmt_L1MU4_TE50', 'L1_MU4_TE50', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1700_pusup650_trk110_hmt'],False]],
+        ['mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE40', 'L1_MU4_TE40', ['', ''], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['mu4', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+		
+		#HMT + jets
+		['j40_mb_sp600_pusup300_trk40_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp600_pusup300_trk40_hmt'],False]],
+        ['j40_mb_sp700_pusup350_trk50_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp700_pusup350_trk50_hmt'],False]],
+        ['j40_mb_sp900_pusup400_trk60_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp900_pusup400_trk60_hmt'],False]],
+        ['j40_mb_sp1100_pusup450_trk70_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1100_pusup450_trk70_hmt'],False]],
+        ['j40_mb_sp1200_pusup500_trk80_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['j40_mb_sp1400_pusup550_trk90_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['j40_mb_sp1600_pusup600_trk100_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+        
+        ['j40_mb_sp600_trk40_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp600_trk40_hmt'],False]],
+        ['j40_mb_sp700_trk50_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp700_trk50_hmt'],False]],
+        ['j40_mb_sp900_trk60_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp900_trk60_hmt'],False]],
+        ['j40_mb_sp1100_trk70_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1100_trk70_hmt'],False]],
+        ['j40_mb_sp1200_trk80_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1200_trk80_hmt'],False]],
+        ['j40_mb_sp1400_trk90_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1400_trk90_hmt'],False]],
+        ['j40_mb_sp1600_trk100_hmt', 'L1_J12',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j40', 'mb_sp1600_trk100_hmt'],False]],
+        
+        ['j45_mb_sp600_pusup300_trk40_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp600_pusup300_trk40_hmt'],False]],
+        ['j45_mb_sp700_pusup350_trk50_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp700_pusup350_trk50_hmt'],False]],
+        ['j45_mb_sp900_pusup400_trk60_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp900_pusup400_trk60_hmt'],False]],
+        ['j45_mb_sp1100_pusup450_trk70_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1100_pusup450_trk70_hmt'],False]],
+        ['j45_mb_sp1200_pusup500_trk80_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['j45_mb_sp1400_pusup550_trk90_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['j45_mb_sp1600_pusup600_trk100_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+        
+        ['j45_mb_sp600_trk40_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp600_trk40_hmt'],False]],
+        ['j45_mb_sp700_trk50_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp700_trk50_hmt'],False]],
+        ['j45_mb_sp900_trk60_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp900_trk60_hmt'],False]],
+        ['j45_mb_sp1100_trk70_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1100_trk70_hmt'],False]],
+        ['j45_mb_sp1200_trk80_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1200_trk80_hmt'],False]],
+        ['j45_mb_sp1400_trk90_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1400_trk90_hmt'],False]],
+        ['j45_mb_sp1600_trk100_hmt', 'L1_J15',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j45', 'mb_sp1600_trk100_hmt'],False]],
+        
+        ['j60_mb_sp600_pusup300_trk40_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp600_pusup300_trk40_hmt'],False]],
+        ['j60_mb_sp700_pusup350_trk50_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp700_pusup350_trk50_hmt'],False]],
+        ['j60_mb_sp900_pusup400_trk60_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp900_pusup400_trk60_hmt'],False]],
+        ['j60_mb_sp1100_pusup450_trk70_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1100_pusup450_trk70_hmt'],False]],
+        ['j60_mb_sp1200_pusup500_trk80_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['j60_mb_sp1400_pusup550_trk90_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['j60_mb_sp1600_pusup600_trk100_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1600_pusup600_trk100_hmt'],False]],
+        
+        ['j60_mb_sp600_trk40_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp600_trk40_hmt'],False]],
+        ['j60_mb_sp700_trk50_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp700_trk50_hmt'],False]],
+        ['j60_mb_sp900_trk60_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp900_trk60_hmt'],False]],
+        ['j60_mb_sp1100_trk70_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1100_trk70_hmt'],False]],
+        ['j60_mb_sp1200_trk80_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1200_trk80_hmt'],False]],
+        ['j60_mb_sp1400_trk90_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1400_trk90_hmt'],False]],
+        ['j60_mb_sp1600_trk100_hmt', 'L1_J20',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j60', 'mb_sp1600_trk100_hmt'],False]],
+        
+        ['j110_mb_sp600_pusup300_trk40_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp600_pusup300_trk40_hmt'],False]],
+        ['j110_mb_sp700_pusup350_trk50_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp700_pusup350_trk50_hmt'],False]],
+        ['j110_mb_sp900_pusup400_trk60_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp900_pusup400_trk60_hmt'],False]],
+        ['j110_mb_sp1100_pusup450_trk70_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1100_pusup450_trk70_hmt'],False]],
+        ['j110_mb_sp1200_pusup500_trk80_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1200_pusup500_trk80_hmt'],False]],
+        ['j110_mb_sp1400_pusup550_trk90_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1400_pusup550_trk90_hmt'],False]],
+        ['j110_mb_sp1600_pusup600_trk100_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1600_pusup600_trk100_hmt'],False]],
         
+        ['j110_mb_sp600_trk40_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp600_trk40_hmt'],False]],
+        ['j110_mb_sp700_trk50_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp700_trk50_hmt'],False]],
+        ['j110_mb_sp900_trk60_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp900_trk60_hmt'],False]],
+        ['j110_mb_sp1100_trk70_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1100_trk70_hmt'],False]],
+        ['j110_mb_sp1200_trk80_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1200_trk80_hmt'],False]],
+        ['j110_mb_sp1400_trk90_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1400_trk90_hmt'],False]],
+        ['j110_mb_sp1600_trk100_hmt', 'L1_J30',  ['', ''], ['MinBias'],["BW:MinBias", "RATE:MinBias"], 1, ['serial', -1, ['j110', 'mb_sp1600_trk100_hmt'],False]],
+			 
 			 ]
 
 
+    if TriggerFlags.doFTK():
+            TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
+
+        # muon +tau FTK chains for T&P performance measurement
+        ['mu26_ivarmedium_tau12_idperf_FTK',             'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_idperf_FTK"]]],
+        ['mu26_ivarmedium_tau12_perf0_FTK',              'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf0_FTK"]]],
+        ['mu26_ivarmedium_tau12_perf_FTK',               'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf_FTK"]]],
+        ['mu26_ivarmedium_tau12_medium0_FTK',            'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium0_FTK"]]],
+        ['mu26_ivarmedium_tau12_medium1_FTK',            'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium1_FTK"]]],
+        ['mu26_ivarmedium_tau12_perf0_FTKNoPrec',        'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf0_FTKNoPrec"]]],
+        ['mu26_ivarmedium_tau12_perf_FTKNoPrec',         'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_perf_FTKNoPrec"]]],
+        ['mu26_ivarmedium_tau12_medium0_FTKNoPrec',      'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium0_FTKNoPrec"]]],
+        ['mu26_ivarmedium_tau12_medium1_FTKNoPrec',      'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau12_medium1_FTKNoPrec"]]],
+        ['mu26_ivarmedium_tau25_idperf_tracktwo_L1TAU12IM_FTK',    'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_idperf_tracktwo_L1TAU12IM_FTK"]]],
+        ['mu26_ivarmedium_tau25_perf_tracktwo_L1TAU12IM_FTK',          'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_perf_tracktwo_L1TAU12IM_FTK"]]],
+        ['mu26_ivarmedium_tau25_medium1_tracktwo_L1TAU12IM_FTK',       'L1_MU20_TAU12IM_FTK',['L1_MU20_FTK','L1_TAU12IM_FTK'], [PhysicsStream], ['RATE:MuonTau', 'BW:Tau', 'BW:Muon'], -1,['serial',-1,["mu26_ivarmedium","tau25_medium1_tracktwo_L1TAU12IM_FTK"]]],
+
+             ]
+
+
     TriggerFlags.HeavyIonSlice.signatures = [
         ]
 
@@ -3407,7 +3158,7 @@ def setupMenu():
         ['beamspot_allTE_trkfast_peb_L1TRT_EMPTY',           'L1_TRT_EMPTY', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
 
 
-        ['beamspot_allTE_trkfast_peb',           'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+        ['beamspot_allTE_trkfast_peb',           'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
 
         ##trkFS --> no selection, add TRT to PEB events        
 
@@ -3418,7 +3169,7 @@ def setupMenu():
 
 # taking this out all together, not needed and even with PS=-1 makes histograms
 
-        ['beamspot_allTE_trkfast_pebTRT',           'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+        ['beamspot_allTE_trkfast_pebTRT',           'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
 
 
         ##trkFS --> select good vertices, and write out PEB events
@@ -3430,7 +3181,7 @@ def setupMenu():
 
 
 
-        ['beamspot_activeTE_trkfast_peb',           'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+        ['beamspot_activeTE_trkfast_peb',           'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
 
         ##trkFS --> select good vertices, add TRT data to PEB events
 
@@ -3441,7 +3192,7 @@ def setupMenu():
 
 # taking this out all together, not needed and even with PS=-1 makes histograms
 
-        ['beamspot_activeTE_trkfast_pebTRT',           'L1_4J15', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+        ['beamspot_activeTE_trkfast_pebTRT',           'L1_4J20', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
 
         ##trkFS --> online beam-spot determination
 
@@ -3459,16 +3210,20 @@ def setupMenu():
         ['beamspot_activeTE_trkfast_peb_L1J15', 'L1_J15', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
         ['beamspot_allTE_trkfast_peb_L1J15', 'L1_J15', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
         ['beamspot_trkFS_trkfast_L1J15', 'L1_J15', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+        
+#        ['beamspot_activeTE_trkfast_peb_L1MBTS_1_VTE70', 'L1_MBTS_1_VTE70', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+#        ['beamspot_allTE_trkfast_peb_L1MBTS_1_VTE70', 'L1_MBTS_1_VTE70', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+#        ['beamspot_trkFS_trkfast_L1MBTS_1_VTE70', 'L1_MBTS_1_VTE70', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
 
         ]   
 
 
     if TriggerFlags.doFTK():
         TriggerFlags.BeamspotSlice.signatures = TriggerFlags.BeamspotSlice.signatures() + [                                                                 
-            ['beamspot_idperf_FTK_L14J15_FTK',      'L1_4J15_FTK', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
-            ['beamspot_trkFS_FTK_L14J15_FTK',       'L1_4J15_FTK', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
-            ['beamspot_trkFS_FTKRefit_L14J15_FTK',  'L1_4J15_FTK', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
-            ['beamspot_idperf_FTKRefit_L14J15_FTK', 'L1_4J15_FTK', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],       
+            ['beamspot_idperf_FTK_L14J20_FTK',      'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+            ['beamspot_trkFS_FTK_L14J20_FTK',       'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+            ['beamspot_trkFS_FTKRefit_L14J20_FTK',  'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+            ['beamspot_idperf_FTKRefit_L14J20_FTK', 'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
             ]
 
 
@@ -3483,6 +3238,31 @@ def setupMenu():
         ['mb_sptrk_noisesup',            'L1_RD0_FILLED', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
         ['mb_sptrk_noisesup_L1RD0_UNPAIRED_ISO',    'L1_RD0_UNPAIRED_ISO', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
         ['mb_sptrk_noisesup_L1RD0_EMPTY',   'L1_RD0_EMPTY', [], ['MinBias'], ["RATE:Cosmic_MinBias", "BW:MinBias"], -1],
+        
+        #For Xe run
+##         ['mb_sptrk_L1MBTS_1',   'L1_MBTS_1', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_1_VTE2',   'L1_MBTS_1_VTE2', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_1_VTE3',   'L1_MBTS_1_VTE3', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_1_VTE4',   'L1_MBTS_1_VTE4', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_1_VTE5',   'L1_MBTS_1_VTE5', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_1_VTE10',   'L1_MBTS_1_VTE10', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+        
+##         ['mb_sptrk_L1MBTS_2_VTE2',   'L1_MBTS_2_VTE2', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_2_VTE3',   'L1_MBTS_2_VTE3', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_2_VTE4',   'L1_MBTS_2_VTE4', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_2_VTE5',   'L1_MBTS_2_VTE5', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1MBTS_2_VTE10',   'L1_MBTS_2_VTE10', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+        
+##         ['mb_sptrk_L1VTE2',   'L1_VTE2', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1VTE3',   'L1_VTE3', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1VTE4',   'L1_VTE4', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1VTE5',   'L1_VTE5', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+##         ['mb_sptrk_L1VTE10',   'L1_VTE10', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
+        
+        #overlay
+#        ['mb_sp_L1MBTS_1_OVERLAY',  'L1_MBTS_1_OVERLAY', [], ['MinBiasOverlay'],["BW:MinBiasOverlay", "RATE:MinBiasOverlay"], 1],
+#        ['mb_sptrk_L1MBTS_1_OVERLAY',  'L1_MBTS_1_OVERLAY', [], ['MinBiasOverlay'],["BW:MinBiasOverlay", "RATE:MinBiasOverlay"], 1],
+
 
 	#leading track for low-mu run
 	['mb_sptrk_pt4_L1MBTS_1',                     'L1_MBTS_1', [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
@@ -3534,254 +3314,329 @@ def setupMenu():
         ['mb_sp1200_trk75_hmt_L1MBTS_1_1', 'L1_MBTS_1_1', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1400_trk80_hmt_L1MBTS_1_1', 'L1_MBTS_1_1', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         
+
         #HMT with pileup supprestion seeded by L1_TE triggers
+        ['mb_sp600_pusup300_trk40_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp700_pusup350_trk50_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp900_pusup400_trk50_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp900_pusup400_trk60_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1000_pusup450_trk70_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_pusup450_trk70_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_pusup500_trk80_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_pusup500_trk90_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_pusup500_trk100_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1400_pusup550_trk90_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_pusup600_trk100_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_pusup700_trk110_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_pusup900_trk120_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
         ['mb_sp2300_pusup1000_trk130_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+ 
+        ['mb_sp600_pusup300_trk40_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp700_pusup350_trk50_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp900_pusup400_trk60_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1000_pusup450_trk70_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_pusup450_trk70_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_pusup500_trk80_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1400_pusup550_trk90_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1600_pusup600_trk100_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_pusup700_trk110_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_pusup900_trk120_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_pusup1000_trk130_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_pusup1100_trk140_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['mb_sp1200_pusup500_trk80_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_pusup550_trk90_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+        ['mb_sp700_pusup350_trk50_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp900_pusup400_trk60_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_pusup450_trk70_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1200_pusup500_trk80_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1400_pusup550_trk90_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1600_pusup600_trk100_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_pusup700_trk110_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_pusup900_trk120_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_pusup1000_trk130_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
         ['mb_sp2500_pusup1100_trk140_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_pusup1200_trk150_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_pusup1200_trk150_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_pusup1300_trk160_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+        ['mb_sp1100_pusup450_trk70_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1200_pusup500_trk80_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1400_pusup550_trk90_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_pusup600_trk100_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_pusup700_trk110_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_pusup900_trk120_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_pusup1000_trk130_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_pusup1100_trk140_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_pusup1200_trk150_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2900_pusup1300_trk160_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+ 
+        ['mb_sp1400_pusup550_trk90_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_pusup600_trk100_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_pusup1000_trk130_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_pusup1100_trk140_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_pusup1200_trk150_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2900_pusup1300_trk160_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         
+        ['mb_sp1600_pusup600_trk100_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        ['mb_sp1700_pusup650_trk110_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        ['mb_sp1900_pusup700_trk120_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_pusup750_trk130_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_pusup800_trk140_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_pusup850_trk150_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
         
         #HMT without pileup supprestion seeded by L1_TE triggers
+        ['mb_sp600_trk40_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp700_trk50_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp900_trk50_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp900_trk60_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1000_trk70_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_trk70_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_trk80_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_trk90_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_trk100_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1400_trk90_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_trk100_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_trk110_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_trk120_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
         ['mb_sp2300_trk130_hmt_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+ 
+        ['mb_sp600_trk40_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp700_trk50_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp900_trk60_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1000_trk70_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_trk70_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_trk80_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1400_trk90_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1600_trk100_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_trk110_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_trk110_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_trk120_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_trk130_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_trk140_hmt_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['mb_sp1200_trk80_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_trk90_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_trk100_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+        ['mb_sp700_trk50_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp900_trk60_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1100_trk70_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1200_trk80_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1400_trk90_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1600_trk100_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_trk110_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_trk110_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_trk120_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_trk130_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
         ['mb_sp2500_trk140_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_trk150_hmt_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['mb_sp1600_trk100_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_trk150_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_trk160_hmt_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+        ['mb_sp1100_trk70_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1200_trk80_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1400_trk90_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_trk100_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_trk110_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1800_trk110_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_trk120_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_trk130_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_trk140_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_trk150_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2900_trk160_hmt_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
+ 
+        ['mb_sp1400_trk90_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_trk100_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_trk110_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2300_trk130_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2500_trk140_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2700_trk150_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2900_trk160_hmt_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         
-                #HMT with pileup supprestion seeded by L1_TE.0ETA24 triggers
-        ['mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1600_trk100_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1700_trk110_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE50', 'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        ['mb_sp1700_trk110_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp1900_trk120_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE60', 'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        ['mb_sp1900_trk120_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2100_trk130_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2200_trk140_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp2400_trk150_hmt_L1TE70', 'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        #HMT with pileup supprestion seeded by L1_TE.0ETA24 triggers
+        #['mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         
         
         #HMT without pileup supprestion seeded by L1_TE.0ETA24 triggers
-        ['mb_sp900_trk50_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp900_trk60_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1000_trk70_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_trk80_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_trk90_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_trk100_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
-        ['mb_sp2300_trk130_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1000_trk70_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_trk80_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_trk90_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_trk100_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1200_trk80_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1400_trk90_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_trk100_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1400_trk90_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_trk100_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_trk150_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1600_trk100_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1800_trk110_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_trk150_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_trk160_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp1800_trk110_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_trk120_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2300_trk130_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_trk150_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_trk160_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['mb_sp2300_trk130_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2500_trk140_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2700_trk150_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2900_trk160_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp900_trk50_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp900_trk60_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1000_trk70_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_trk80_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_trk90_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_trk100_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_trk110_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],        
+        #['mb_sp2300_trk130_hmt_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1000_trk70_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_trk80_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1400_trk90_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_trk100_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_trk110_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_trk130_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1200_trk80_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1400_trk90_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_trk100_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_trk110_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_trk130_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1400_trk90_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_trk100_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_trk110_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_trk130_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_trk150_hmt_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1600_trk100_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1800_trk110_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_trk130_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_trk150_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_trk160_hmt_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp1800_trk110_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_trk120_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2300_trk130_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_trk150_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_trk160_hmt_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        #['mb_sp2300_trk130_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2500_trk140_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2700_trk150_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2900_trk160_hmt_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
         
         #HMT performance
         ['mb_sp800_hmtperf_L1TE5', 'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp800_hmtperf_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1200_hmtperf_L1TE10', 'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_hmtperf_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_hmtperf_L1TE15', 'L1_TE15', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp1600_hmtperf_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_hmtperf_L1TE20', 'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_hmtperf_L1TE25', 'L1_TE25', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_hmtperf_L1TE30', 'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2100_hmtperf_L1TE40', 'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['mb_sp800_hmtperf_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp800_hmtperf_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_hmtperf_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1200_hmtperf_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_hmtperf_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp1600_hmtperf_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_hmtperf_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_hmtperf_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_hmtperf_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['mb_sp2100_hmtperf_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp800_hmtperf_L1TE5.0ETA24', 'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp800_hmtperf_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_hmtperf_L1TE10.0ETA24', 'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1200_hmtperf_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_hmtperf_L1TE15.0ETA24', 'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp1600_hmtperf_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_hmtperf_L1TE20.0ETA24', 'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_hmtperf_L1TE25.0ETA24', 'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_hmtperf_L1TE30.0ETA24', 'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['mb_sp2100_hmtperf_L1TE40.0ETA24', 'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
         ['mb_sp2_hmtperf_L1MBTS_1_1', 'L1_MBTS_1_1', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['mb_sp2_hmtperf', 'L1_RD3_FILLED', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
@@ -3807,6 +3662,14 @@ def setupMenu():
 
         ['mb_sptrk_pt2_L1MBTS_2',                     'L1_MBTS_2',                     [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
+        ['mb_sp_vetospmbts2in_L1AFP_A_OR_C',                     'L1_AFP_A_OR_C',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp_vetospmbts2in_L1AFP_A_AND_C',                     'L1_AFP_A_AND_C',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp_vetospmbts2in_L1AFP_A',                     'L1_AFP_A',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp_vetospmbts2in_L1AFP_C',                     'L1_AFP_C',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['mb_sp_vetosp_L1AFP_A_AND_C',                     'L1_AFP_A_AND_C',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+
+        ['mb_sp_L1RD0_FILLED',                     'L1_RD0_FILLED',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
         ]
         
     TriggerFlags.CalibSlice.signatures   = [
@@ -3823,6 +3686,7 @@ def setupMenu():
         ['lumipeb_L1MBTS_1_UNPAIRED_ISO',   'L1_MBTS_1_UNPAIRED_ISO',   [], ['PixelBeam'], ["RATE:Calibration", "RATE:PixelBeamCalibration", "BW:Detector"], -1],
         ['lumipeb_L1MBTS_2',                'L1_MBTS_2',                [], ['PixelBeam'], ["RATE:Calibration", "RATE:PixelBeamCalibration", "BW:Detector"], -1], 
         ['lumipeb_L1MBTS_2_UNPAIRED_ISO',   'L1_MBTS_2_UNPAIRED_ISO',   [], ['PixelBeam'], ["RATE:Calibration", "RATE:PixelBeamCalibration", "BW:Detector"], -1],
+        ['lumipeb_L1MBTS_2_LUCID',          'L1_MBTS_2,L1_LUCID',       [], ['PixelBeam'], ["RATE:Calibration", "RATE:PixelBeamCalibration", "BW:Detector"], -1], 
 
         # triggers for VdM scan
         ['lumipeb_vdm_L1MBTS_1_BGRP11',       'L1_MBTS_1_BGRP11',       [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
@@ -3834,14 +3698,25 @@ def setupMenu():
         ['lumipeb_vdm_L1MBTS_1_UNPAIRED_ISO', 'L1_MBTS_1_UNPAIRED_ISO', [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
         ['lumipeb_vdm_L1MBTS_2_UNPAIRED_ISO', 'L1_MBTS_2_UNPAIRED_ISO', [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
         ['lumipeb_vdm_L1RD0_UNPAIRED_ISO',    'L1_RD0_UNPAIRED_ISO',    [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
-        
+        ['lumipeb_vdm_L1RD2_BGRP12',          'L1_RD2_BGRP12',          [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
+        ['lumipeb_vdm_L1RD0_BGRP10',          'L1_RD0_BGRP10',          [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
+
         ['lumipeb_vdm_L1MBTS_1', 'L1_MBTS_1', [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
         ['lumipeb_vdm_L1MBTS_2', 'L1_MBTS_2', [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
         ['lumipeb_vdm_L1RD0_FILLED',         'L1_RD0_FILLED', [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
-        
+ 
+
+        ['lumipeb_vdm_L1MBTS_2_LUCID',                 'L1_MBTS_2,L1_LUCID',    [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1], 
+        ['lumipeb_vdm_L1MBTS_2_LUCID_UNPAIRED_ISO',    'L1_MBTS_2_UNPAIRED_ISO,L1_LUCID_UNPAIRED_ISO',    [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
+
+        ['lumipeb_vdm_L1MBTS_2_LUCID_BGRP9',  'L1_MBTS_2_BGRP9,L1_LUCID_BGRP9',     [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
+        ['lumipeb_vdm_L1MBTS_2_LUCID_BGRP11', 'L1_MBTS_2_BGRP11,L1_LUCID_BGRP11',   [], ['VdM'], ["RATE:Calibration", "BW:Detector"], -1],
 
         ['lumipeb_L1RD0_ABORTGAPNOTCALIB',    'L1_RD0_ABORTGAPNOTCALIB',    [], ['PixelBeam'], ["RATE:Calibration", "BW:Detector"], -1],
 
+        ['larpebcalib_L1RD0_BGRP11',          'L1_RD0_BGRP11',         [], ['LArPEB'], ["RATE:Calibration", "BW:Detector"], -1],
+        ['larpebcalib_L1RD0_EMPTY',           'L1_RD0_EMPTY',          [], ['LArPEB'], ["RATE:Calibration", "BW:Detector"], -1],
+
         ['larnoiseburst_loose_L1All',             'L1_All',       [], ['LArNoiseBurst'], ["RATE:Calibration", "BW:Detector"], -1],
         ['larnoiseburst_L1All',             'L1_All',       [], ['LArNoiseBurst'], ["RATE:Calibration", "BW:Detector"], -1],
         ['larnoiseburst_L1XE60',            'L1_XE60',       [], ['LArNoiseBurst'], ["RATE:Calibration", "BW:Detector"], -1],
@@ -3884,6 +3759,9 @@ def setupMenu():
         ['idcalib_trk16_fwd',       'L1_TAU', [], ['IDTracks'], [ 'RATE:IDTracks','BW:Detector'], -1],
         ['idcalib_trk29_central',   'L1_TAU', [], ['IDTracks'], [ 'RATE:IDTracks','BW:Detector'], -1],
         ['idcalib_trk29_fwd',       'L1_TAU', [], ['IDTracks'], [ 'RATE:IDTracks','BW:Detector'], -1],
+        
+#        ['idcalib_trk9_central_L1MBTS_1_VTE70',    'L1_MBTS_1_VTE70', [], ['IDTracks'], [ 'RATE:IDTracks','BW:Detector'], -1],
+#        ['idcalib_trk9_fwd_L1MBTS_1_VTE70',        'L1_MBTS_1_VTE70', [], ['IDTracks'], [ 'RATE:IDTracks','BW:Detector'], -1],
 
         ['conej40_larpebj',  'L1_J20',     [], ['LArCells'], ['RATE:Calibration', 'BW:Detector'],-1],
         ['conej165_larpebj', 'L1_J100',     [], ['LArCells'], ['RATE:Calibration', 'BW:Detector'],-1], 
@@ -3921,6 +3799,9 @@ def setupMenu():
         ['calibAFP_L1AFP_A',                   'L1_AFP_A'    ,              [],  ['AFP'], ['RATE:CalibrationAFP','BW:Detector'], -1],
         ['calibAFP_L1AFP_C',                   'L1_AFP_C'    ,              [],  ['AFP'], ['RATE:CalibrationAFP','BW:Detector'], -1],
 
+        ['rpcpeb_L1RD0_EMPTY', 'L1_RD0_EMPTY', [], ['RPCNoise'], ["BW:Detector", "RATE:Calibration", "RATE:RPCCalibration",], -1],
+
+        ['idpsl1_L1IDprescaled','', [], ['IDprescaledL1'], ["RATE:SeededStreamers","BW:Other"], -1],
 
         ]
 
@@ -3980,8 +3861,11 @@ def setupMenu():
         ['noalg_L1EM15VH_3EM7',    'L1_EM15VH_3EM7',    [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
         ['noalg_L1EM7',            'L1_EM7',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
         ['noalg_L1EM3',            'L1_EM3',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
+        ['noalg_mb_L1EM3',         'L1_EM3',            [], ['MinBias'], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
         ['noalg_L12EM3',           'L1_2EM3',           [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
 
+        ['noalg_L1EM3_EMPTY',            'L1_EM3_EMPTY',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Egamma'], -1],
+
         # Muon streamers
         ['noalg_L1MU20',           'L1_MU20',           [], [PhysicsStream, 'express'], ['RATE:SeededStreamers', 'BW:Muon'], -1],
         ['noalg_L1MU21',           'L1_MU21',           [], [PhysicsStream, 'express'], ['RATE:SeededStreamers', 'BW:Muon'], -1],
@@ -3996,24 +3880,36 @@ def setupMenu():
         ['noalg_L1MU4_FIRSTEMPTY', 'L1_MU4_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
         ['noalg_L1MU11_EMPTY',      'L1_MU11_EMPTY',      [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
         ['noalg_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
+        ['noalg_L1MU6_EMPTY',            'L1_MU6_EMPTY',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
 
-        ['noalg_L1MU20_FIRSTEMPTY', 'L1_MU20_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
-        ['noalg_L1MU21_FIRSTEMPTY', 'L1_MU21_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
+        ['noalg_L1MU20_FIRSTEMPTY',     'L1_MU20_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
+        ['noalg_L1MU21_FIRSTEMPTY',     'L1_MU21_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
         ['noalg_L1MU20MU21_FIRSTEMPTY', 'L1_MU20MU21_FIRSTEMPTY', [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Muon'], -1],
         
+##         ['noalg_mb_L1TE2',  'L1_TE2', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+##         ['noalg_mb_L1TE3',  'L1_TE3', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+##         ['noalg_mb_L1TE4',  'L1_TE4', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['noalg_mb_L1TE5',  'L1_TE5', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['noalg_mb_L1TE10',  'L1_TE10', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
         ['noalg_mb_L1TE20',  'L1_TE20', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['noalg_mb_L1TE30',  'L1_TE30', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
         ['noalg_mb_L1TE40',  'L1_TE40', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['noalg_mb_L1TE50',  'L1_TE50', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['noalg_mb_L1TE60',  'L1_TE60', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['noalg_mb_L1TE70',  'L1_TE70', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-
-        ['noalg_mb_L1TE5.0ETA24',  'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['noalg_mb_L1TE10.0ETA24',  'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
-        ['noalg_mb_L1TE20.0ETA24',  'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
-        ['noalg_mb_L1TE30.0ETA24',  'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
-        ['noalg_mb_L1TE40.0ETA24',  'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
-        ['noalg_mb_L1TE70.0ETA24',  'L1_TE70.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        
+        #data min-bias overlay
+#	    ['noalg_L1TE20_OVERLAY',   'L1_TE20_OVERLAY', [], ['MinBiasOverlay'], ["BW:MinBiasOverlay", "RATE:MinBiasOverlay"], 1],
+#	    ['noalg_L1MBTS_1_OVERLAY',   'L1_MBTS_1_OVERLAY', [], ['MinBiasOverlay'], ["BW:MinBiasOverlay", "RATE:MinBiasOverlay"], 1],
+
+        #['noalg_mb_L1TE5.0ETA24',  'L1_TE5.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['noalg_mb_L1TE10.0ETA24',  'L1_TE10.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['noalg_mb_L1TE15.0ETA24',  'L1_TE15.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
+        #['noalg_mb_L1TE20.0ETA24',  'L1_TE20.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        #['noalg_mb_L1TE25.0ETA24',  'L1_TE25.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
+        #['noalg_mb_L1TE30.0ETA24',  'L1_TE30.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
+        #['noalg_mb_L1TE40.0ETA24',  'L1_TE40.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1], 
+        #['noalg_mb_L1TE70.0ETA24',  'L1_TE70.0ETA24', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
         # ZDC streamers
         ['noalg_mb_L1ZDC_A',    'L1_ZDC_A', [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
@@ -4034,26 +3930,30 @@ def setupMenu():
         ['noalg_L1TAU12IM',            'L1_TAU12IM',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
         ['noalg_L1TAU20IM',            'L1_TAU20IM',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
 
+        ['noalg_L1TAU8_EMPTY',            'L1_TAU8_EMPTY',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Tau'], -1],
+
         # MET streamers
         ['noalg_L1XE35',             'L1_XE35',             [], [PhysicsStream, 'express'], ['RATE:SeededStreamers', 'BW:MET'], -1],
         ['noalg_L1XE10',             'L1_XE10',             [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:MET'], -1],
         ['noalg_L1XE30',             'L1_XE30',             [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:MET'], -1],
-        ['noalg_L1XE150',            'L1_XE150',             [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:MET'], -1],
         ['noalg_L1XE300',            'L1_XE300',             [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:MET'], -1],
 
+        # Jet streamers
         ['noalg_L1J20_J20.31ETA49',                'L1_J20_J20.31ETA49',                [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Jet'], -1],
 
+        ['noalg_L1J12_EMPTY',            'L1_J12_EMPTY',            [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:Jet'], -1],
+
         # VBF triggers
         ['noalg_L1MJJ-100', 'L1_MJJ-100', [], [PhysicsStream], ["RATE:L1TopoStreamers", "BW:Other"], -1],  
 
         # Chains for Week1 menu (ATR-11119)
-        ['noalg_L1MU4',   'L1_MU4',  [], [PhysicsStream, 'express'], ["RATE:SeededStreamers", "BW:Muon"], -1 ],
+        ['noalg_L1MU4',   'L1_MU4',  [], [PhysicsStream, 'express'], ["RATE:SeededStreamers", "BW:Muon"], -1 ], #AFP request
+        ['noalg_mb_L1MU4', 'L1_MU4',  [], ['MinBias'], ["RATE:SeededStreamers", "BW:Muon"], -1 ], #AFP request
         ['noalg_L1MU6',   'L1_MU6',  [], [PhysicsStream,'express'], ["RATE:SeededStreamers", "BW:Muon"], -1 ],
         ['noalg_L1J50',   'L1_J50',  [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ],
 
         #ATR-10976
         ['noalg_L1MU6_J20',    'L1_MU6_J20',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:BJet"], -1 ],
-        ['noalg_L1MU4_J12',    'L1_MU4_J12',   [], [PhysicsStream], ['RATE:SeededStreamers', 'BW:BJet'], -1],
 
       
         ['noalg_L1CALREQ2',   'L1_CALREQ2', [], ['Tile'], ["RATE:Calibration", "RATE:Cosmic_TileCalibration", "BW:Detector"], -1],
@@ -4086,6 +3986,19 @@ def setupMenu():
         ['noalg_larcells_L1LAR-EM',                'L1_LAR-EM',           [], ['LArCells'],     ["RATE:SeededStreamers", "BW:Other"], -1], 
         ['noalg_larcells_L1LAR-J',                 'L1_LAR-J',            [], ['LArCells'],     ["RATE:SeededStreamers", "BW:Other"], -1], 
         ['noalg_L1Calo_EMPTY',            'L1_Calo_EMPTY',       [], ['L1Calo'],     ["RATE:SeededStreamers", "BW:Other"], -1], 
+      
+        ['noalg_l1calo_L1J75',         'L1_J75', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1J100',        'L1_J100', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1J120',        'L1_J120', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1J5031ETA49',  'L1_J50.31ETA49', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1J7531ETA49',  'L1_J75.31ETA49', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1J10031ETA49', 'L1_J100.31ETA49', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1EM7',         'L1_EM7', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1EM12',        'L1_EM12', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1EM15',        'L1_EM15', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1TAU8',        'L1_TAU8', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1TAU12',       'L1_TAU12', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
+        ['noalg_l1calo_L1TAU20',       'L1_TAU20', [], ['L1Calo'], ["RATE:SeededStreamers", "BW:Other"], -1],
 
         ['noalg_l1topo_L12EM3',   'L1_2EM3',    [], ['L1Topo'],    ["RATE:SeededStreamers", "BW:Other"], -1],
         ['noalg_l1topo_L12MU4',   'L1_2MU4',    [], ['L1Topo'],    ["RATE:SeededStreamers", "BW:Other"], -1],
@@ -4121,20 +4034,15 @@ def setupMenu():
         ['noalg_l1topo_L1XE55',   'L1_XE55',    [], ['L1Topo'],    ["RATE:SeededStreamers", "BW:Other"], -1],
         ['noalg_l1topo_L1XE60',   'L1_XE60',    [], ['L1Topo'],    ["RATE:SeededStreamers", "BW:Other"], -1],
         ['noalg_l1topo_L1XE70',   'L1_XE70',    [], ['L1Topo'],    ["RATE:SeededStreamers", "BW:Other"], -1],
-        ['noalg_l1topo_L1MU4_J12', 'L1_MU4_J12', [], ['L1Topo'], ["RATE:SeededStreamers", "BW:Other"], -1],
 
 
 	#L1Topo streamer (ATR-14714)
-	["noalg_l1topo_L1J25_2J20_3J12_BOX-TAU20ITAU12I",   	"L1_J25_2J20_3J12_BOX-TAU20ITAU12I",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1DR-MU10TAU12I_TAU12I-J25",          	"L1_DR-MU10TAU12I_TAU12I-J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MU10_TAU12I-J25",          		"L1_MU10_TAU12I-J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BPH-2M8-2MU4",          		"L1_BPH-2M8-2MU4",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1BPH-8M15-MU6MU4",          		"L1_BPH-8M15-MU6MU4",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1BPH-8M15-2MU6",          		"L1_BPH-8M15-2MU6",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1BTAG-MU4J15",          		"L1_BTAG-MU4J15",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BTAG-MU4J30",          		"L1_BTAG-MU4J30",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1BTAG-MU6J20",          		"L1_BTAG-MU6J20",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BTAG-MU6J25",          		"L1_BTAG-MU6J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J15_BTAG-MU4J15",          		"L1_3J15_BTAG-MU4J15",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J15_BTAG-MU4J30",          		"L1_3J15_BTAG-MU4J30",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J15_BTAG-MU6J25",          		"L1_3J15_BTAG-MU6J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
@@ -4160,22 +4068,14 @@ def setupMenu():
 	["noalg_l1topo_L1W-250RO2-XEHT-0",          		"L1_W-250RO2-XEHT-0",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1W-HT20-JJ15.ETA49",          		"L1_W-HT20-JJ15.ETA49",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1W-NOMATCH",          			"L1_W-NOMATCH",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          "L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          "L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1EM15_W-MT35",          		"L1_EM15_W-MT35",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM15_W-MT35_XS60",          		"L1_EM15_W-MT35_XS60",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM15VH_W-MT35_XS60",          		"L1_EM15VH_W-MT35_XS60",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM20VH_W-MT35_XS60",          		"L1_EM20VH_W-MT35_XS60",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1EM22VHI_W-MT35_XS40",          	"L1_EM22VHI_W-MT35_XS40",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30",    	"L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          	"L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1HT150-JJ15.ETA49_MJJ-400",         	"L1_HT150-JJ15.ETA49_MJJ-400",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4",    	"L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",          "L1_BPH-2M9-2MU6_BPH-2DR15-2MU6",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MU6MU4-BO",          			"L1_MU6MU4-BO",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L12MU4-B",          			"L1_2MU4-B",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L12MU6-B",          			"L1_2MU6-B",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4",  	"L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L12MU4-BO",          			"L1_2MU4-BO",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L12MU6-BO",          			"L1_2MU6-BO",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MU6_2MU4-B",          			"L1_MU6_2MU4-B",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
@@ -4187,9 +4087,7 @@ def setupMenu():
 	["noalg_l1topo_L1DPHI-J20s2XE50",          		"L1_DPHI-J20s2XE50",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1DPHI-J20XE50",          		"L1_DPHI-J20XE50",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1DPHI-CJ20XE50",          		"L1_DPHI-CJ20XE50",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1MJJ-900",          			"L1_MJJ-900",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MJJ-800",          			"L1_MJJ-800",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1MJJ-700",          			"L1_MJJ-700",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MJJ-400",          			"L1_MJJ-400",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MJJ-100",          			"L1_MJJ-100",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1HT150-JJ15.ETA49",          		"L1_HT150-JJ15.ETA49",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
@@ -4200,24 +4098,22 @@ def setupMenu():
 	["noalg_l1topo_L1DR-EM15TAU12I-J25",          		"L1_DR-EM15TAU12I-J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1TAU20ITAU12I-J25",          		"L1_TAU20ITAU12I-J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1DR-TAU20ITAU12I",          		"L1_DR-TAU20ITAU12I",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1BOX-TAU20ITAU12I",          		"L1_BOX-TAU20ITAU12I",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1DR-TAU20ITAU12I-J25",          	"L1_DR-TAU20ITAU12I-J25",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1LAR-EM",          			"L1_LAR-EM",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1LAR-J",          			"L1_LAR-J",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L1MU6_MJJ-200",          		"L1_MU6_MJJ-200",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1MU6_MJJ-300",         	 		"L1_MU6_MJJ-300",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1MU6_MJJ-400",          		"L1_MU6_MJJ-400",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1MU6_MJJ-500",          		"L1_MU6_MJJ-500",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-400",       	"L1_J30_2J20_4J20.0ETA49_MJJ-400",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-700",       	"L1_J30_2J20_4J20.0ETA49_MJJ-700",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-800",     	"L1_J30_2J20_4J20.0ETA49_MJJ-800",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1J30_2J20_4J20.0ETA49_MJJ-900",         "L1_J30_2J20_4J20.0ETA49_MJJ-900",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J20_4J20.0ETA49_MJJ-400",         	"L1_3J20_4J20.0ETA49_MJJ-400",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J20_4J20.0ETA49_MJJ-700",          	"L1_3J20_4J20.0ETA49_MJJ-700",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J20_4J20.0ETA49_MJJ-800",          	"L1_3J20_4J20.0ETA49_MJJ-800",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
 	["noalg_l1topo_L13J20_4J20.0ETA49_MJJ-900",          	"L1_3J20_4J20.0ETA49_MJJ-900",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-	["noalg_l1topo_L1XE35_MJJ-200",          		"L1_XE35_MJJ-200",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
-
+	["noalg_l1topo_L130M-EM20ITAU12",          		"L1_30M-EM20ITAU12",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+	["noalg_l1topo_L1TAU60_DR-TAU20ITAU12I",          		"L1_TAU60_DR-TAU20ITAU12I",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1LLP-RO",          		"L1_LLP-RO",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1MJJ-400-CF",          		"L1_MJJ-400-CF",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1SC111-CJ15",          		"L1_SC111-CJ15",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1SC85-CJ15",          		"L1_SC85-CJ15",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1LATE-MU10_J50",          		"L1_LATE-MU10_J50",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
+ 	["noalg_l1topo_L1LATE-MU10_XE40",          		"L1_LATE-MU10_XE40",          [], ["L1Topo"], ["RATE:L1TopoStreamers", "BW:Other"], -1 ],
  
         # #minbias streamer
         ['noalg_mb_L1MBTS_1',             'L1_MBTS_1',        [], ['MinBias'], ["RATE:MinBias", "BW:MinBias"], -1],
@@ -4267,10 +4163,10 @@ def setupMenu():
         ['noalg_L1AFP_A_AND_C',                      'L1_AFP_A_AND_C',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
         ['noalg_L1AFP_A_AND_C_MBTS_2',                      'L1_AFP_A_AND_C_MBTS_2',               [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
 
-        ['noalg_L1AFP_A_OR_C_EM3',                  'L1_AFP_A_OR_C_EM3',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['noalg_L1AFP_A_AND_C_EM3',                  'L1_AFP_A_AND_C_EM3',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
-        ['noalg_L1AFP_A_OR_C_MU4',                        'L1_AFP_A_OR_C_MU4',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
-        ['noalg_L1AFP_A_AND_C_MU4',                        'L1_AFP_A_AND_C_MU4',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['noalg_L1EM3_AFP_A_OR_C',                  'L1_EM3_AFP_A_OR_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['noalg_L1EM3_AFP_A_AND_C',                  'L1_EM3_AFP_A_AND_C',                  [], ['MinBias'], ["BW:MinBias", "RATE:MinBias"], -1],
+        ['noalg_L1MU4_AFP_A_OR_C',                        'L1_MU4_AFP_A_OR_C',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['noalg_L1MU4_AFP_A_AND_C',                        'L1_MU4_AFP_A_AND_C',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
 
         ['noalg_L1AFP_A_OR_C_TE5',                        'L1_AFP_A_OR_C_TE5',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
         ['noalg_L1AFP_A_AND_C_TE5',                        'L1_AFP_A_AND_C_TE5',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
@@ -4281,9 +4177,9 @@ def setupMenu():
         ['noalg_L1AFP_A_OR_C_EMPTY',                        'L1_AFP_A_OR_C_EMPTY',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
         ['noalg_L1AFP_A_OR_C_FIRSTEMPTY',                        'L1_AFP_A_OR_C_FIRSTEMPTY',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
 
-        ['noalg_L1AFP_A_AND_C_SPECTOF_J50',                        'L1_AFP_A_AND_C_SPECTOF_J50',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
-        ['noalg_L1AFP_A_AND_C_SPECTOF_J75',                        'L1_AFP_A_AND_C_SPECTOF_J75',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
-        ['noalg_L1AFP_A_AND_C_SPECTOF_J100',                        'L1_AFP_A_AND_C_SPECTOF_J100',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['noalg_L1AFP_A_AND_C_SPECTOF_J50',                        'L1_AFP_A_AND_C_SPECTOF_J50',                  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['noalg_L1AFP_A_AND_C_SPECTOF_J75',                        'L1_AFP_A_AND_C_SPECTOF_J75',                  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
+        ['noalg_L1AFP_A_AND_C_SPECTOF_J100',                        'L1_AFP_A_AND_C_SPECTOF_J100',                  [],  [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
 
         ['noalg_L1MBTS_2',                        'L1_MBTS_2',                  [],  ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
 
@@ -4348,7 +4244,8 @@ def setupMenu():
         #L1Calo requested streamers
 	['noalg_L1J100',  'L1_J100',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1],
 	['noalg_L1J100.31ETA49',  'L1_J100.31ETA49',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ], 
-	['noalg_L1J12',  'L1_J12',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ], 
+        ['noalg_L1J12',  'L1_J12',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ],
+        ['noalg_mb_L1J12',  'L1_J12',   [], ['MinBias'], ["RATE:SeededStreamers", "BW:Jet"], -1 ],
 	['noalg_L1J120',  'L1_J120',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1],
 	['noalg_L1J15',  'L1_J15',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ],
 	['noalg_L1J15.31ETA49',  'L1_J15.31ETA49',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:Jet"], -1 ],
@@ -4384,20 +4281,24 @@ def setupMenu():
         ['noalg_L1XE40',  'L1_XE40',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
 	
         ['noalg_L1TE70',  'L1_TE70',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        ['noalg_L1TE60',  'L1_TE60',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        ['noalg_L1TE50',  'L1_TE50',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
         ['noalg_L1TE40',  'L1_TE40',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
         ['noalg_L1TE30',  'L1_TE30',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
         ['noalg_L1TE20',  'L1_TE20',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
         ['noalg_L1TE10',   'L1_TE10', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
         ['noalg_L1TE5',   'L1_TE5', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
-        ['noalg_L1TE5.0ETA24',   'L1_TE5.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
-        ['noalg_L1TE10.0ETA24',   'L1_TE10.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
-        ['noalg_L1TE20.0ETA24',  'L1_TE20.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
-        ['noalg_L1TE30.0ETA24',  'L1_TE30.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
-        ['noalg_L1TE40.0ETA24',  'L1_TE40.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
+#        ['noalg_L1TE4',   'L1_TE4', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+#        ['noalg_L1TE3',   'L1_TE3', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+#        ['noalg_L1TE2',   'L1_TE2', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        #['noalg_L1TE5.0ETA24',   'L1_TE5.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        #['noalg_L1TE10.0ETA24',   'L1_TE10.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        #['noalg_L1TE15.0ETA24',   'L1_TE15.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        #['noalg_L1TE20.0ETA24',  'L1_TE20.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
+        #['noalg_L1TE25.0ETA24',   'L1_TE25.0ETA24', [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
+        #['noalg_L1TE30.0ETA24',  'L1_TE30.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
+        #['noalg_L1TE40.0ETA24',  'L1_TE40.0ETA24',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ], 
         
-        ['noalg_L1XS30',  'L1_XS30',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
-        ['noalg_L1XS20',  'L1_XS20',   [], [PhysicsStream], ["RATE:SeededStreamers", "BW:MET"], -1 ],
-	
         ]
 
     TriggerFlags.MonitorSlice.signatures = [
@@ -4427,6 +4328,7 @@ def setupMenu():
         ['eb_high_L1RD2_FILLED',              'L1_RD2_FILLED',             [], ['EnhancedBias'], ["RATE:EnhancedBias", "BW:Detector"], -1],
         ]
 
+
     ###############################################################
     #################################################################
     signatureList=[]
@@ -4445,9 +4347,13 @@ def setupMenu():
     for chain in mySigList:
         mydict[chain]=[-1,0,0]
     mydict.update(Prescales.HLTPrescales_cosmics)
+    mydict.update(Prescales.HLTPrescales_unprescaled_only_physics_prescale)
+    mydict.update(Prescales.L1Prescales_unprescaled_only_physics_prescale)
     from copy import deepcopy
     Prescales.HLTPrescales_cosmics = deepcopy(mydict)
-    
+    Prescales.L1Prescales_unprescaled_only_physics_prescale  = deepcopy(mydict)
+    Prescales.HLTPrescales_unprescaled_only_physics_prescale = deepcopy(mydict)
+
 
 class Prescales:
     #   Item name             | Prescale
@@ -4478,7 +4384,7 @@ class Prescales:
         'id_cosmicid_L1MU11_EMPTY',
         'id_cosmicid_L1MU4_EMPTY',
         'j0_L1J12_EMPTY',
-        'j0_perf_bperf_L1J12_EMPTY',
+        'j0_perf_boffperf_L1J12_EMPTY',
         'larcalib_L1EM3_EMPTY',
         'larcalib_L1J12_EMPTY',
         'larcalib_L1J3031ETA49_EMPTY',
@@ -4500,6 +4406,527 @@ class Prescales:
         ]
     HLTPrescales_cosmics.update(dict(map(None,chain_list,len(chain_list)*[ [1, 0, 0] ])))
 
+    HLTPrescales_unprescaled_only_physics_prescale = {}
+    HLTPrescales_unprescaled_only_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0, -1] ])))
+    L1Prescales_unprescaled_only_physics_prescale = {}
+    L1Prescales_unprescaled_only_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0, -1] ])))
+
+
+    HLT_chain_list = [
+        'xe110_pufit_L1XE50',
+        'xe110_pufit_wEFMu_L1XE50',
+        'xe120_pufit_L1XE50',
+        'xe120_pufit_wEFMu_L1XE50',
+        'xe120_mht_xe80_L1XE50',
+        'tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I-J25',
+        'g35_medium_L1EM24VHI_tau25_dipion3_tracktwo_60mVis10000',
+        'e60_etcut_trkcut_L1EM24VHIM_j15_perf_xe60_6dphi15_mt35',
+        'e60_etcut_trkcut_L1EM24VHIM_xs30_j15_perf_xe30_6dphi15_mt35',
+        'xe100_pufit_L1XE55',
+        'xe100_pufit_L1XE60',
+        '2e24_lhvloose_nod0_2j15_gsc35_boffperf_split',
+        '2e24_lhvloose_nod0_2j35_boffperf',
+        '2e24_lhvloose_nod0_2j35_boffperf_split',
+        '2j15_gsc35_bmv2c1040_split_2j15_gsc35_boffperf_split_L14J15.0ETA25',
+        '2j15_gsc35_bmv2c1050_split_3j15_gsc35_boffperf_split',
+        '2j15_gsc35_bmv2c1070_split_2j15_gsc35_bmv2c1085_split_L14J15.0ETA25',
+        '2j25_gsc45_bmv2c1050_split_2j25_gsc45_boffperf_split_L14J15.0ETA25',
+        '2j25_gsc45_bmv2c1060_split_3j25_gsc45_boffperf_split',
+        '2j25_gsc45_bmv2c1070_split_xe80_mht_L12J15_XE55',
+        '2j35_gsc55_bmv2c1050_split_ht300_L1HT190-J15s5.ETA21',
+        '2j35_gsc55_bmv2c1060_split_2j35_gsc55_boffperf_split_L14J15.0ETA25',
+        '2mu14_2j15_gsc35_boffperf_split',
+        '2mu14_2j35_boffperf',
+        '2mu14_2j35_boffperf_split',
+        '3j15_gsc35_bmv2c1070_split_j15_gsc35_boffperf_split_L14J15.0ETA25',
+        '3j15_gsc35_bmv2c1077_split_xe60_mht_L13J15.0ETA25_XE40',
+        '3j50_gsc65_bmv2c1077_split_L13J35.0ETA23',
+        '4j15_gsc35_bmv2c1077_split_L14J15.0ETA25',
+        'e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j15_gsc35_boffperf_split',
+        'e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf',
+        'e28_lhmedium_nod0_L1EM24VHI_mu8noL1_2j35_boffperf_split',
+        'e28_lhtight_nod0_ivarloose_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split',
+        'e28_lhtight_nod0_ivarloose_j150_boffperf_j35_boffperf',
+        'e28_lhtight_nod0_ivarloose_j150_boffperf_split_j35_boffperf_split',
+        'g25_medium_L1EM22VHI_2j35_0eta490_bmv2c1077_split_2j35_0eta490',
+        'g25_medium_L1EM22VHI_j35_0eta490_bmv2c1077_split_3j35_0eta490_invm700',
+        'ht300_2j40_0eta490_invm700_L1HT150-J20s5.ETA31_MJJ-400-CF_AND_2j25_gsc45_bmv2c1070_split',
+        'j110_gsc150_boffperf_split_2j35_gsc55_bmv2c1070_split_L1J85_3J30',
+        'j150_gsc175_bmv2c1060_split_j45_gsc60_bmv2c1060_split',
+        'j175_gsc225_bmv2c1040_split',
+        'j225_gsc275_bmv2c1060_split',
+        'j225_gsc300_bmv2c1070_split',
+        'j225_gsc360_bmv2c1077_split',
+        'j35_gsc55_bmv2c1050_split_ht700_L1HT190-J15s5.ETA21',
+        'j35_gsc55_bmv2c1070_split_2j45_320eta490_L1J25.0ETA23_2J15.31ETA49',
+        'j55_gsc75_bmv2c1040_split_3j55_gsc75_boffperf_split',
+        'j55_gsc80_bmv2c1070_split_j45_gsc60_bmv2c1085_split_j45_320eta490',
+        'j60_gsc100_bmv2c1050_split_xe80_mht_L1XE60',
+        'j60_gsc85_bmv2c1050_split_3j60_gsc85_boffperf_split',
+        'j80_0eta240_j60_j45_320eta490_AND_2j25_gsc45_bmv2c1070_split',
+        'mu26_ivarmedium_j110_gsc150_boffperf_split_j15_gsc35_boffperf_split',
+        'mu26_ivarmedium_j150_boffperf_j35_boffperf',
+        'mu26_ivarmedium_j150_boffperf_split_j35_boffperf_split',
+        'mu6_j225_gsc400_boffperf_split_dr05_dz02',
+        '2mu10_bBmumuxv2',
+        '2mu10_bJpsimumu',
+        '2mu10_bUpsimumu',
+        '2mu6_bBmumu_Lxy0_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        '2mu6_bBmumux_BpmumuKp_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        '2mu6_bBmumux_BsmumuPhi_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        '2mu6_bJpsimumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        '2mu6_bJpsimumu_Lxy0_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
+        '2mu6_bUpsimumu_L1BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        '2mu6_mu4_bTau_L12MU6_3MU4',
+        '2mu6_mu4_bUpsi',
+        '3mu3_mu3noL1_L13MU4',
+        '3mu3_mu3noL1_calotag_0eta010_L13MU4',
+        '3mu4_bDimu',
+        '3mu4_bJpsi',
+        '3mu4_bPhi',
+        '3mu4_bTau',
+        '3mu4_bUpsi',
+        '3mu4_mu2noL1',
+        '3mu4_mu4noL1',
+        '3mu4_mu4noL1_calotag_0eta010',
+        '3mu6_bJpsi',
+        '3mu6_bTau',
+        '3mu6_bUpsi',
+        '4mu4',
+        'mu11_2mu4noL1_bTau_L1MU11_2MU6',
+        'mu11_mu6_bBmumu',
+        'mu11_mu6_bBmumux_BpmumuKp',
+        'mu11_mu6_bBmumuxv2',
+        'mu11_mu6_bDimu',
+        'mu11_mu6_bDimu2700',
+        'mu11_mu6_bDimu2700_Lxy0',
+        'mu11_mu6_bDimu_Lxy0',
+        'mu11_mu6_bJpsimumu',
+        'mu11_mu6_bJpsimumu_Lxy0',
+        'mu11_mu6_bPhi',
+        'mu11_mu6_bTau',
+        'mu11_mu6_bUpsimumu',
+        'mu11_mu6noL1_bPhi_L1MU11_2MU6',
+        'mu20_mu6noL1_bTau',
+        'mu6_2mu4_bTau_L1MU6_3MU4',
+        'mu6_2mu4_bUpsi',
+        'larcalib_L1J3031ETA49_EMPTY',
+        'larhec_L1EM7_FIRSTEMPTY',
+        'larhec_L1J12_FIRSTEMPTY',
+        'larhec_L1J30_FIRSTEMPTY',
+        'larnoiseburst_L1J100',
+        'larnoiseburst_L1J40_XE60',
+        'larnoiseburst_L1XE60',
+        'larnoiseburst_L1XE70',
+        'larnoiseburst_L1XE80',
+        'larps_L1J3031ETA49_EMPTY',
+        'larps_L1J30_FIRSTEMPTY',
+        'noalg_L1TGC_BURST',
+        'satu20em_l1satmon_L1EM20VH_FIRSTEMPTY',
+        'satu20em_l1satmon_L1J100',
+        'satu20em_l1satmon_L1J100.31ETA49',
+        'satu20em_l1satmon_L1J100.31ETA49_FIRSTEMPTY',
+        'satu20em_l1satmon_L1J100_FIRSTEMPTY',
+        'tilecalib_laser',
+        '2e12_lhloose_nod0_mu10',
+        '2e12_lhmedium_nod0_mu10',
+        '2e17_lhvloose_nod0_L12EM15VHI',
+        '2e19_lhvloose_nod0',
+        '2e24_lhvloose_nod0',
+        '2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',
+        '2e5_lhvloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',
+        '2g10_loose_mu20',
+        '2g10_medium_mu20',
+        '2g20_tight_icalotight_L12EM15VHI',
+        '2g20_tight_icalovloose_L12EM15VHI',
+        '2g22_tight_L12EM15VHI',
+        '2g22_tight_L1EM7_EMPTY',
+        '2g22_tight_L1EM7_UNPAIRED_ISO',
+        '2g22_tight_icalotight_L12EM15VHI',
+        '2g22_tight_icalovloose_L12EM15VHI',
+        '2g25_loose_g15_loose',
+        '2g25_loose_g20_loose',
+        '2g25_tight_L12EM20VH',
+        '2g50_loose_L12EM20VH',
+        '2g50_tight_L1EM7_EMPTY',
+        '2g50_tight_L1EM7_UNPAIRED_ISO',
+        '2g60_loose_L12EM20VH',
+        '3g25_loose',
+        'e12_lhloose_nod0_2mu10',
+        'e12_lhmedium_nod0_2mu10',
+        'e140_lhloose_nod0',
+        'e140_lhloose_nod0_L1EM24VHI',
+        'e140_lhloose_nod0_L1EM24VHIM',
+        'e17_lhloose_nod0_mu14',
+        'e20_lhtight_nod0_ivarloose_3j20_L1EM18VHI_3J20',
+        'e24_lhloose_nod0_2e12_lhloose_nod0_L1EM20VH_3EM10VH',
+        'e24_lhmedium_nod0_2g12_loose',
+        'e24_lhmedium_nod0_2g12_medium',
+        'e24_lhmedium_nod0_L1EM20VH_g25_medium',
+        'e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VH',
+        'e25_mergedtight_g35_medium_Heg',
+        'e25_mergedtight_ivarloose_g35_medium_icalovloose_Heg',
+        'e26_lhmedium_nod0_L1EM22VHIM_mu8noL1',
+        'e26_lhmedium_nod0_mu8noL1',
+        'e26_lhtight_nod0_L1EM22VHIM_e15_etcut_L1EM7_Zee',
+        'e26_lhtight_nod0_e15_etcut_L1EM7_Zee',
+        'e26_lhtight_nod0_ivarloose',
+        'e26_lhtight_nod0_ivarloose_L1EM22VHIM',
+        'e28_lhmedium_nod0_L1EM24VHIM_mu8noL1',
+        'e28_lhmedium_nod0_mu8noL1',
+        'e28_lhtight_nod0_L1EM24VHIM_e15_etcut_L1EM7_Zee',
+        'e28_lhtight_nod0_e15_etcut_L1EM7_Zee',
+        'e28_lhtight_nod0_ivarloose',
+        'e28_lhtight_nod0_ivarloose_L1EM22VHI',
+        'e28_lhtight_nod0_ivarloose_L1EM24VHIM',
+        'e28_lhtight_nod0_noringer_ivarloose',
+        'e28_lhtight_nod0_noringer_ivarloose_L1EM24VHIM',
+        'e300_etcut',
+        'e300_etcut_L1EM24VHIM',
+        'e30_mergedtight_g35_medium_Heg',
+        'e32_lhtight_nod0_ivarloose',
+        'e5_lhloose_nod0_j40_xe70_pufit_2dphi10_L1XE60',
+        'e5_lhloose_nod0_j50_xe70_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',
+        'e5_lhloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',
+        'e5_lhmedium_nod0_j50_xe80_pufit_2dphi10_L1J40_XE50_DPHI-J20s2XE50',
+        'e5_lhmedium_nod0_mu4_j30_xe65_pufit_2dphi10_L1MU4_XE60',
+        'e60_lhmedium_nod0',
+        'e60_lhmedium_nod0_L1EM24VHI',
+        'e60_lhmedium_nod0_L1EM24VHIM',
+        'e70_lhloose_nod0_L1EM24VHIM_xe70noL1',
+        'e70_lhloose_nod0_xe70noL1',
+        'e7_lhmedium_nod0_mu24',
+        'e80_lhloose_nod0_L1EM24VHIM_xe80noL1',
+        'e80_lhloose_nod0_L1EM24VHI_xe80noL1',
+        'e80_lhloose_nod0_xe80noL1',
+        'e80_lhmedium_nod0',
+        'e80_lhmedium_nod0_L1EM24VHI',
+        'e80_lhmedium_nod0_L1EM24VHIM',
+        'g0_hiptrt_L1EM22VHI',
+        'g0_hiptrt_L1EM24VHI',
+        'g0_hiptrt_L1EM24VHIM',
+        'g100_tight_L1EM22VHI_3j50noL1',
+        'g100_tight_L1EM24VHIM_3j50noL1',
+        'g100_tight_L1EM24VHI_3j50noL1',
+        'g100_tight_icalovloose_L1EM22VHI_3j50noL1',
+        'g100_tight_icalovloose_L1EM24VHIM_3j50noL1',
+        'g100_tight_icalovloose_L1EM24VHI_3j50noL1',
+        'g140_loose',
+        'g140_tight',
+        'g140_tight_L1EM24VHIM',
+        'g15_loose_2mu10_msonly',
+        'g15_loose_2mu10_msonly_L1MU4_UNPAIRED_ISO',
+        'g15_loose_2mu10_msonly_L1MU6_EMPTY',
+        'g200_loose',
+        'g200_loose_L1EM24VHIM',
+        'g20_tight_icaloloose_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm500',
+        'g25_medium_L1EM22VHI_4j35_0eta490_invm1000',
+        'g25_medium_mu24',
+        'g27_medium_L1EM24VHI_2j15_gsc35_bmv2c1077_split_2j35_0eta490',
+        'g27_medium_L1EM24VHI_j15_gsc35_bmv2c1077_split_3j35_0eta490_invm700',
+        'g300_etcut',
+        'g300_etcut_L1EM24VHI',
+        'g300_etcut_L1EM24VHIM',
+        'g35_loose_L1EM24VHIM_mu15_mu2noL1',
+        'g35_loose_L1EM24VHIM_mu18',
+        'g35_loose_L1EM24VHI_mu15_mu2noL1',
+        'g35_loose_L1EM24VHI_mu18',
+        'g35_medium_g25_medium_L12EM20VH',
+        'g35_medium_g25_medium_L1EM7_EMPTY',
+        'g35_medium_g25_medium_L1EM7_UNPAIRED_ISO',
+        'g35_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1',
+        'g35_tight_icalotight_L1EM24VHIM_mu18noL1',
+        'g35_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1',
+        'g35_tight_icalotight_L1EM24VHI_mu18noL1',
+        'g40_tight_icalotight_L1EM24VHIM_mu15noL1_mu2noL1',
+        'g40_tight_icalotight_L1EM24VHIM_mu18noL1',
+        'g40_tight_icalotight_L1EM24VHI_mu15noL1_mu2noL1',
+        'g40_tight_icalotight_L1EM24VHI_mu18noL1',
+        'g80_loose_L1EM24VHIM_xe80noL1',
+        'g80_loose_L1EM24VHI_xe80noL1',
+        'g80_loose_icalovloose_L1EM24VHIM_xe80noL1',
+        'g80_loose_icalovloose_L1EM24VHI_xe80noL1',
+        'g80_loose_icalovloose_xe80noL1',
+        'g80_loose_xe80noL1',
+        'g85_tight_L1EM22VHI_3j50noL1',
+        'g85_tight_L1EM24VHIM_3j50noL1',
+        'g85_tight_L1EM24VHI_3j50noL1',
+        'g85_tight_icalovloose_L1EM22VHI_3j50noL1',
+        'g85_tight_icalovloose_L1EM24VHIM_3j50noL1',
+        'g85_tight_icalovloose_L1EM24VHI_3j50noL1',
+        'mu20_mu8noL1_e9_lhvloose_nod0',
+        'mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU20',
+        'mu20_mu8noL1_e9_lhvloose_nod0_L1EM8VH_MU20',
+        '10j40_L14J15',
+        '10j40_L14J150ETA25',
+        '10j40_L14J20',
+        '10j40_L16J15',
+        '2j225_gsc250_boffperf_split_0eta240_j70_gsc120_boffperf_split_0eta240',
+        '2j225_gsc250_boffperf_split_0eta240_j70_gsc140_boffperf_split_0eta240',
+        '2j330_a10t_lcw_jes_40smcINF_L1J100',
+        '2j340_a10t_lcw_jes_40smcINF_L1J100',
+        '2j350_a10t_lcw_jes_40smcINF_L1J100',
+        '3j200',
+        '3j225',
+        '3j250',
+        '4j120',
+        '4j130',
+        '4j60_gsc115_boffperf_split',
+        '4j70_gsc120_boffperf_split',
+        '4j70_gsc130_boffperf_split',
+        '5j100',
+        '5j100_L14J150ETA25',
+        '5j50_gsc70_boffperf_split_0eta240',
+        '5j50_gsc70_boffperf_split_0eta240_L14J150ETA25',
+        '5j55_gsc75_boffperf_split_0eta240',
+        '5j55_gsc75_boffperf_split_0eta240_L14J150ETA25',
+        '5j60_gsc100_boffperf_split',
+        '5j60_gsc100_boffperf_split_L14J150ETA25',
+        '5j60_gsc85_boffperf_split',
+        '5j60_gsc85_boffperf_split_L14J150ETA25',
+        '5j60_gsc90_boffperf_split',
+        '5j60_gsc90_boffperf_split_L14J150ETA25',
+        '5j70_0eta240',
+        '5j70_0eta240_L14J15',
+        '5j70_0eta240_L14J150ETA25',
+        '5j75_0eta240',
+        '5j75_0eta240_L14J150ETA25',
+        '5j85',
+        '5j85_0eta240',
+        '5j85_0eta240_L14J150ETA25',
+        '5j85_L14J15',
+        '5j85_L14J150ETA25',
+        '5j90',
+        '5j90_L14J150ETA25',
+        '6j35_gsc55_boffperf_split_0eta240_L14J150ETA25',
+        '6j35_gsc55_boffperf_split_0eta240_L14J20',
+        '6j35_gsc55_boffperf_split_0eta240_L15J150ETA25',
+        '6j45_gsc60_boffperf_split_0eta240_L14J150ETA25',
+        '6j45_gsc60_boffperf_split_0eta240_L14J20',
+        '6j45_gsc60_boffperf_split_0eta240_L15J150ETA25',
+        '6j50_gsc70_boffperf_split',
+        '6j50_gsc70_boffperf_split_L14J150ETA25',
+        '6j50_gsc70_boffperf_split_L15J150ETA25',
+        '6j55_0eta240_L14J15',
+        '6j55_0eta240_L14J150ETA25',
+        '6j55_0eta240_L14J20',
+        '6j55_0eta240_L15J150ETA25',
+        '6j60_0eta240_L14J150ETA25',
+        '6j60_0eta240_L14J20',
+        '6j60_0eta240_L15J150ETA25',
+        '6j60_gsc85_boffperf_split',
+        '6j60_gsc85_boffperf_split_L14J150ETA25',
+        '6j60_gsc85_boffperf_split_L15J150ETA25',
+        '6j70',
+        '6j70_L14J15',
+        '6j70_L14J150ETA25',
+        '6j85',
+        '6j85_L14J150ETA25',
+        '7j25_gsc45_boffperf_split_0eta240_L14J150ETA25',
+        '7j25_gsc45_boffperf_split_0eta240_L14J20',
+        '7j25_gsc45_boffperf_split_0eta240_L15J150ETA25',
+        '7j25_gsc45_boffperf_split_L14J150ETA25',
+        '7j25_gsc45_boffperf_split_L14J20',
+        '7j25_gsc45_boffperf_split_L15J150ETA25',
+        '7j25_gsc50_boffperf_split_0eta240_L14J150ETA25',
+        '7j25_gsc50_boffperf_split_0eta240_L14J20',
+        '7j25_gsc50_boffperf_split_0eta240_L15J150ETA25',
+        '7j25_gsc50_boffperf_split_L14J150ETA25',
+        '7j25_gsc50_boffperf_split_L14J20',
+        '7j25_gsc50_boffperf_split_L15J150ETA25',
+        '7j45',
+        '7j45_0eta240',
+        '7j45_0eta240_L14J150ETA25',
+        '7j45_0eta240_L14J20',
+        '7j45_0eta240_L15J150ETA25',
+        '7j45_L14J15',
+        '7j45_L14J150ETA25',
+        '7j45_L14J20',
+        '7j50',
+        '7j50_L14J150ETA25',
+        '7j50_L14J20',
+        'ht1000_L1J100',
+        'ht1200_L1J100',
+        'ht1400_L1J100',
+        'j0_perf_ds1_L1J100',
+        'j225_gsc420_boffperf_split',
+        'j225_gsc440_boffperf_split',
+        'j225_gsc450_boffperf_split',
+        'j225_gsc460_boffperf_split',
+        'j225_gsc480_boffperf_split',
+        'j225_gsc500_boffperf_split',
+        'j260_320eta490',
+        'j260_320eta490_jes',
+        'j260_320eta490_lcw',
+        'j260_320eta490_lcw_jes',
+        'j260_320eta490_lcw_nojcalib',
+        'j260_320eta490_lcw_sub',
+        'j260_320eta490_lcw_subjes',
+        'j260_320eta490_nojcalib',
+        'j260_320eta490_sub',
+        'j260_320eta490_subjes',
+        'j30_jes_cleanLLP_PS_llp_L1LLP-NOMATCH',
+        'j30_jes_cleanLLP_PS_llp_L1LLP-RO',
+        'j30_jes_cleanLLP_PS_llp_L1TAU100',
+        'j30_jes_cleanLLP_PS_llp_L1TAU30_EMPTY',
+        'j30_jes_cleanLLP_PS_llp_L1TAU30_UNPAIRED_ISO',
+        'j30_jes_cleanLLP_PS_llp_noiso_L1LLP-NOMATCH',
+        'j30_jes_cleanLLP_PS_llp_noiso_L1LLP-RO',
+        'j30_jes_cleanLLP_PS_llp_noiso_L1TAU100',
+        'j30_jes_cleanLLP_PS_llp_noiso_L1TAU30_EMPTY',
+        'j30_jes_cleanLLP_PS_llp_noiso_L1TAU30_UNPAIRED_ISO',
+        'j30_xe60_razor220',
+        'j360_320eta490',
+        'j420',
+        'j420_a10t_lcw_jes_40smcINF_L1J100',
+        'j440',
+        'j440_a10t_lcw_jes_40smcINF_L1J100',
+        'j450',
+        'j460',
+        'j460_a10_lcw_subjes_L1J100',
+        'j460_a10r_L1J100',
+        'j460_a10t_lcw_jes_L1J100',
+        'j480',
+        'j480_a10_lcw_subjes_L1J100',
+        'j480_a10r_L1J100',
+        'j480_a10t_lcw_jes_L1J100',
+        'j500',
+        'j500_a10_lcw_subjes_L1J100',
+        'j500_a10r_L1J100',
+        'j500_a10t_lcw_jes_L1J100',
+        'j520_a10_lcw_subjes_L1J100',
+        'j520_a10r_L1J100',
+        'j520_a10t_lcw_jes_L1J100',
+        'j540_a10_lcw_subjes_L1J100',
+        'j540_a10r_L1J100',
+        'j540_a10t_lcw_jes_L1J100',
+        'j55_0eta240_xe50_L1J30_EMPTY',
+        'noalg_L1J400',
+        'noalg_cosmiccalo_L1J3031ETA49_EMPTY',
+        'j80_bmv2c1050_split_xe60_L12J50_XE40',
+        'xe100_pufit_L1XE55',
+        'xe100_pufit_L1XE60',
+        'xe110_L1XE55',
+        'xe110_pufit_L1XE55',
+        'xe110_pufit_L1XE60',
+        'xe110_pufit_L1XE70',
+        'xe110_pufit_wEFMu_L1XE55',
+        'xe110_wEFMu_L1XE55',
+        'xe120_L1XE55',
+        'xe120_mht_xe80_L1XE55',
+        'xe120_mht_xe80_L1XE60',
+        'xe120_pufit_L1XE55',
+        'xe120_pufit_L1XE60',
+        'xe120_pufit_L1XE70',
+        'xe120_pufit_wEFMu_L1XE55',
+        'xe120_pufit_wEFMu_L1XE60',
+        'xe130_L1XE55',
+        '2mu14',
+        '2mu15_L12MU10',
+        '2mu4_invm1_j20_xe40_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',
+        '2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J20_XE30_DPHI-J20s2XE30',
+        '2mu4_invm1_j20_xe60_pufit_2dphi10_L12MU4_J40_XE50',
+        '2mu4_mu3_mu2noL1_bNocut_L13MU4',
+        '3mu3_mu3noL1_bNocut_L13MU4',
+        '3mu6',
+        '3mu6_msonly',
+        '3mu6_msonly_L1MU4_UNPAIRED_ISO',
+        '3mu6_msonly_L1MU6_EMPTY',
+        '3mu8_msonly',
+        '4mu4_bNocut',
+        'e5_lhvloose_nod0_mu4_j30_xe40_pufit_2dphi10_L1MU4_J30_XE40_DPHI-J20s2XE30',
+        'j30_muvtx',
+        'j30_muvtx_L1MU4_UNPAIRED_ISO',
+        'j30_muvtx_L1MU6_EMPTY',
+        'j30_muvtx_noiso',
+        'j30_muvtx_noiso_L1MU4_UNPAIRED_ISO',
+        'j30_muvtx_noiso_L1MU6_EMPTY',
+        'mu0_muoncalib',
+        'mu10_mgonly_L1LATE-MU10_J50',
+        'mu10_mgonly_L1LATE-MU10_XE40',
+        'mu10_mgonly_L1LATE-MU10_XE50',
+        'mu11_2mu4noL1_bNocut_L1MU11_2MU6',
+        'mu13_mu13_idperf_Zmumu',
+        'mu14_ivarloose_3j20_L1MU10_3J20',
+        'mu20_2mu4noL1',
+        'mu20_ivarmedium_L1MU10_2J15_J20',
+        'mu20_ivarmedium_L1MU10_2J20',
+        'mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_J40',
+        'mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_XE30',
+        'mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISO',
+        'mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU6_EMPTY',
+        'mu22_2mu4noL1',
+        'mu22_mu8noL1',
+        'mu22_mu8noL1_calotag_0eta010',
+        'mu22_mu8noL1_mu6noL1',
+        'mu24_2mu4noL1',
+        'mu24_mu10noL1',
+        'mu24_mu10noL1_calotag_0eta010',
+        'mu24_mu8noL1',
+        'mu24_mu8noL1_calotag_0eta010',
+        'mu26_ivarmedium',
+        'mu26_mu10noL1',
+        'mu26_mu10noL1_calotag_0eta010',
+        'mu26_mu8noL1',
+        'mu26_mu8noL1_calotag_0eta010',
+        'mu28_ivarmedium',
+        'mu28_mu8noL1',
+        'mu28_mu8noL1_calotag_0eta010',
+        'mu4_j90_xe90_pufit_2dphi10_L1MU4_J50_XE50_DPHI-J20s2XE30',
+        'mu4_j90_xe90_pufit_2dphi10_L1MU4_XE60',
+        'mu50',
+        'mu60',
+        'mu60_0eta105_msonly',
+        'mu80',
+        'noalg_bkg_L1J15.31ETA49_UNPAIRED_ISO',
+        'noalg_l1calo_L1J400',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM_4J12',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_xe50',
+        'e17_lhmedium_nod0_tau25_medium1_tracktwo_xe50',
+        'e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo',
+        'g25_medium_L1EM24VHIM_tau25_dikaonmass_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHIM_tau25_dipion1loose_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHIM_tau25_dipion2_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHIM_tau25_kaonpi1_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHIM_tau25_kaonpi2_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHIM_tau25_singlepion_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_dikaonmass_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_dipion1loose_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_dipion2_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_kaonpi1_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_kaonpi2_tracktwo_50mVis10000',
+        'g25_medium_L1EM24VHI_tau25_singlepion_tracktwo_50mVis10000',
+        'mu14_ivarloose_L1MU11_tau35_medium1_tracktwo_L1MU11_TAU20IM',
+        'mu14_ivarloose_tau25_medium1_tracktwo',
+        'mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25',
+        'mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM_3J12',
+        'mu14_ivarloose_tau25_medium1_tracktwo_xe50',
+        'mu14_ivarloose_tau35_medium1_tracktwo',
+        'mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20',
+        'mu14_tau25_medium1_tracktwo_xe50',
+        'tau160_medium1_tracktwo_L1TAU100',
+        'tau200_medium1_tracktwo_L1TAU100',
+        'tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',
+        'tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I-J25',
+        'tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12',
+        'tau35_medium1_tracktwo_xe70_L1XE45',
+        'tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25',
+        'tau35_tight1_tracktwo_tau25_tight1_tracktwo_L1DR-TAU20ITAU12I-J25',
+        'tau40_medium1_tracktwo_tau35_medium1_tracktwo',
+        'tau60_medium1_tracktwo_tau25_medium1_tracktwo_xe50',
+        'tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12I',
+        'tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40',
+        '2tau35_medium1_tracktwo_L12TAU20IM_3J20',
+        '2tau35_medium1_tracktwo',
+        'tau40_medium1_tracktwo_tau25_medium1_tracktwo',
+        ]
+
+    HLTPrescales_unprescaled_only_physics_prescale = {}
+    HLTPrescales_unprescaled_only_physics_prescale.update(dict(map(None,HLT_chain_list,len(HLT_chain_list)*[ [1, 0, -1] ])))
+
+
 
 ######################################################
 # TIGHT physics prescales
@@ -4533,150 +4960,306 @@ chain_list=[
     'mb_perf_L1LUCID_UNPAIRED_ISO',
     'mb_perf_L1MBTS_2',
     'mb_perf_L1RD1_FILLED',
+    'mb_sp600_pusup300_trk40_hmt_L1TE5',
+    'mb_sp700_pusup350_trk50_hmt_L1TE5',
     'mb_sp900_pusup400_trk50_hmt_L1TE5',
     'mb_sp900_pusup400_trk60_hmt_L1TE5',
     'mb_sp1000_pusup450_trk70_hmt_L1TE5',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE5',
     'mb_sp1200_pusup500_trk80_hmt_L1TE5',
     'mb_sp1200_pusup500_trk90_hmt_L1TE5',
     'mb_sp1200_pusup500_trk100_hmt_L1TE5',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE5',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE5',
     'mb_sp1800_pusup700_trk110_hmt_L1TE5',
     'mb_sp2100_pusup900_trk120_hmt_L1TE5',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE5',
+    'mb_sp600_pusup300_trk40_hmt_L1TE10',
+    'mb_sp700_pusup350_trk50_hmt_L1TE10',
+    'mb_sp900_pusup400_trk60_hmt_L1TE10',
     'mb_sp1000_pusup450_trk70_hmt_L1TE10',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE10',
     'mb_sp1200_pusup500_trk80_hmt_L1TE10',
     'mb_sp1400_pusup550_trk90_hmt_L1TE10',
     'mb_sp1600_pusup600_trk100_hmt_L1TE10',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE10',
     'mb_sp1800_pusup700_trk110_hmt_L1TE10',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE10',
     'mb_sp2100_pusup900_trk120_hmt_L1TE10',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE10',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE10',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE15',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE15',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE15',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE15',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE15',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE15',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE15',
+    'mb_sp700_pusup350_trk50_hmt_L1TE20',
+    'mb_sp900_pusup400_trk60_hmt_L1TE20',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE20',
+    'mb_sp1200_pusup500_trk80_hmt_L1TE20',
     'mb_sp1400_pusup550_trk90_hmt_L1TE20',
     'mb_sp1600_pusup600_trk100_hmt_L1TE20',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE20',
     'mb_sp1800_pusup700_trk110_hmt_L1TE20',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE20',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE20',
     'mb_sp2100_pusup900_trk120_hmt_L1TE20',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE20',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE20',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE20',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE20',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE20',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE25',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE25',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE25',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE25',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE25',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE25',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE25',
+    'mb_sp1100_pusup450_trk70_hmt_L1TE30',
+    'mb_sp1200_pusup500_trk80_hmt_L1TE30',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE30',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE30',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE30',
     'mb_sp1800_pusup700_trk110_hmt_L1TE30',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE30',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE30',
     'mb_sp2100_pusup900_trk120_hmt_L1TE30',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE30',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE30',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE30',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE30',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE30',
     'mb_sp2900_pusup1300_trk160_hmt_L1TE30',
+    'mb_sp1400_pusup550_trk90_hmt_L1TE40',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE40',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE40',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE40',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE40',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE40',
     'mb_sp2300_pusup1000_trk130_hmt_L1TE40',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE40',
     'mb_sp2500_pusup1100_trk140_hmt_L1TE40',
     'mb_sp2700_pusup1200_trk150_hmt_L1TE40',
     'mb_sp2900_pusup1300_trk160_hmt_L1TE40',
+    'mb_sp1600_pusup600_trk100_hmt_L1TE50',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE50',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE50',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE50',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE50',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE50',
+    'mb_sp1700_pusup650_trk110_hmt_L1TE60',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE60',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE60',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE60',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE60',
+    'mb_sp1900_pusup700_trk120_hmt_L1TE70',
+    'mb_sp2100_pusup750_trk130_hmt_L1TE70',
+    'mb_sp2200_pusup800_trk140_hmt_L1TE70',
+    'mb_sp2400_pusup850_trk150_hmt_L1TE70',
+    'mb_sp600_trk40_hmt_L1TE5',
+    'mb_sp700_trk50_hmt_L1TE5',
     'mb_sp900_trk50_hmt_L1TE5',
     'mb_sp900_trk60_hmt_L1TE5',
     'mb_sp1000_trk70_hmt_L1TE5',
+    'mb_sp1100_trk70_hmt_L1TE5',
     'mb_sp1200_trk80_hmt_L1TE5',
     'mb_sp1200_trk90_hmt_L1TE5',
     'mb_sp1200_trk100_hmt_L1TE5',
+    'mb_sp1400_trk90_hmt_L1TE5',
+    'mb_sp1600_trk100_hmt_L1TE5',
     'mb_sp1800_trk110_hmt_L1TE5',
     'mb_sp2100_trk120_hmt_L1TE5',
     'mb_sp2300_trk130_hmt_L1TE5',
+    'mb_sp600_trk40_hmt_L1TE10',
+    'mb_sp700_trk50_hmt_L1TE10',
+    'mb_sp900_trk60_hmt_L1TE10',
     'mb_sp1000_trk70_hmt_L1TE10',
+    'mb_sp1100_trk70_hmt_L1TE10',
     'mb_sp1200_trk80_hmt_L1TE10',
     'mb_sp1400_trk90_hmt_L1TE10',
     'mb_sp1600_trk100_hmt_L1TE10',
+    'mb_sp1700_trk110_hmt_L1TE10',
     'mb_sp1800_trk110_hmt_L1TE10',
+    'mb_sp1900_trk120_hmt_L1TE10',
     'mb_sp2100_trk120_hmt_L1TE10',
     'mb_sp2300_trk130_hmt_L1TE10',
     'mb_sp2500_trk140_hmt_L1TE10',
-    'mb_sp1200_trk80_hmt_L1TE15',
-    'mb_sp1400_trk90_hmt_L1TE15',
-    'mb_sp1600_trk100_hmt_L1TE15',
-    'mb_sp1800_trk110_hmt_L1TE15',
-    'mb_sp2100_trk120_hmt_L1TE15',
-    'mb_sp2300_trk130_hmt_L1TE15',
-    'mb_sp2500_trk140_hmt_L1TE15',
+    'mb_sp700_trk50_hmt_L1TE20',
+    'mb_sp900_trk60_hmt_L1TE20',
+    'mb_sp1100_trk70_hmt_L1TE20',
+    'mb_sp1200_trk80_hmt_L1TE20',
     'mb_sp1400_trk90_hmt_L1TE20',
     'mb_sp1600_trk100_hmt_L1TE20',
+    'mb_sp1700_trk110_hmt_L1TE20',
     'mb_sp1800_trk110_hmt_L1TE20',
+    'mb_sp1900_trk120_hmt_L1TE20',
+    'mb_sp2100_trk130_hmt_L1TE20',
     'mb_sp2100_trk120_hmt_L1TE20',
+    'mb_sp2200_trk140_hmt_L1TE20',
     'mb_sp2300_trk130_hmt_L1TE20',
+    'mb_sp2400_trk150_hmt_L1TE20',
     'mb_sp2500_trk140_hmt_L1TE20',
     'mb_sp2700_trk150_hmt_L1TE20',
-    'mb_sp1600_trk100_hmt_L1TE25',
-    'mb_sp1800_trk110_hmt_L1TE25',
-    'mb_sp2100_trk120_hmt_L1TE25',
-    'mb_sp2300_trk130_hmt_L1TE25',
-    'mb_sp2500_trk140_hmt_L1TE25',
-    'mb_sp2700_trk150_hmt_L1TE25',
-    'mb_sp2900_trk160_hmt_L1TE25',
+    'mb_sp1100_trk70_hmt_L1TE30',
+    'mb_sp1200_trk80_hmt_L1TE30',
+    'mb_sp1400_trk90_hmt_L1TE30',
+    'mb_sp1600_trk100_hmt_L1TE30',
+    'mb_sp1700_trk110_hmt_L1TE30',
     'mb_sp1800_trk110_hmt_L1TE30',
+    'mb_sp1900_trk120_hmt_L1TE30',
+    'mb_sp2100_trk130_hmt_L1TE30',
     'mb_sp2100_trk120_hmt_L1TE30',
+    'mb_sp2200_trk140_hmt_L1TE30',
     'mb_sp2300_trk130_hmt_L1TE30',
+    'mb_sp2400_trk150_hmt_L1TE30',
     'mb_sp2500_trk140_hmt_L1TE30',
     'mb_sp2700_trk150_hmt_L1TE30',
     'mb_sp2900_trk160_hmt_L1TE30',
+    'mb_sp1400_trk90_hmt_L1TE40',
+    'mb_sp1600_trk100_hmt_L1TE40',
+    'mb_sp1700_trk110_hmt_L1TE40',
+    'mb_sp1900_trk120_hmt_L1TE40',
+    'mb_sp2100_trk130_hmt_L1TE40',
+    'mb_sp2200_trk140_hmt_L1TE40',
     'mb_sp2300_trk130_hmt_L1TE40',
+    'mb_sp2400_trk150_hmt_L1TE40',
     'mb_sp2500_trk140_hmt_L1TE40',
     'mb_sp2700_trk150_hmt_L1TE40',
     'mb_sp2900_trk160_hmt_L1TE40',
-    'mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24',
-    'mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24',
-    'mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24',
-    'mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24',
-    'mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24',
-    'mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24',
-    'mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24',
-    'mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24',
-    'mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24',
-    'mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24',
-    'mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24',
-    'mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24',
-    'mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24',
-    'mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24',
+    'mb_sp1600_trk100_hmt_L1TE50',
+    'mb_sp1700_trk110_hmt_L1TE50',
+    'mb_sp1900_trk120_hmt_L1TE50',
+    'mb_sp2100_trk130_hmt_L1TE50',
+    'mb_sp2200_trk140_hmt_L1TE50',
+    'mb_sp2400_trk150_hmt_L1TE50',
+    'mb_sp1700_trk110_hmt_L1TE60',
+    'mb_sp1900_trk120_hmt_L1TE60',
+    'mb_sp2100_trk130_hmt_L1TE60',
+    'mb_sp2200_trk140_hmt_L1TE60',
+    'mb_sp2400_trk150_hmt_L1TE60',
+    'mb_sp1900_trk120_hmt_L1TE70',
+    'mb_sp2100_trk130_hmt_L1TE70',
+    'mb_sp2200_trk140_hmt_L1TE70',
+    'mb_sp2400_trk150_hmt_L1TE70',
+    #'mb_sp900_pusup400_trk50_hmt_L1TE5.0ETA24',
+    #'mb_sp900_pusup400_trk60_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_pusup450_trk70_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk90_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_pusup500_trk100_hmt_L1TE5.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE5.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE5.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_pusup450_trk70_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE10.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE10.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE10.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE10.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE10.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE10.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_pusup500_trk80_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE15.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE15.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE15.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE15.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE15.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_pusup550_trk90_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE20.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE20.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE20.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE20.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE20.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_pusup600_trk100_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE25.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE25.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE25.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE25.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE25.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_pusup700_trk110_hmt_L1TE30.0ETA24',
+    #'mb_sp2100_pusup900_trk120_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE30.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE30.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE30.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_pusup1000_trk130_hmt_L1TE40.0ETA24',
+    #'mb_sp2500_pusup1100_trk140_hmt_L1TE40.0ETA24',
+    #'mb_sp2700_pusup1200_trk150_hmt_L1TE40.0ETA24',
+    #'mb_sp2900_pusup1300_trk160_hmt_L1TE40.0ETA24',
+    'mu4_mb_sp600_trk40_hmt_L1MU4_TE10',
+    'mu4_mb_sp700_trk50_hmt_L1MU4_TE10',
+    'mu4_mb_sp900_trk60_hmt_L1MU4_TE10',
+    'mu4_mb_sp1100_trk70_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_trk80_hmt_L1MU4_TE10',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE10',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE10',
+    'mu4_mb_sp600_pusup300_trk40_hmt_L1MU4_TE10',
+    'mu4_mb_sp700_pusup350_trk50_hmt_L1MU4_TE10',
+    'mu4_mb_sp900_pusup400_trk60_hmt_L1MU4_TE10',
+    'mu4_mb_sp1100_pusup450_trk70_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE10',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE10',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE10',
+    'mu4_mb_sp1200_trk80_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE40',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_trk90_hmt_L1MU4_TE50',
+    'mu4_mb_sp1600_trk100_hmt_L1MU4_TE50',
+    'mu4_mb_sp1700_trk110_hmt_L1MU4_TE50',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE50',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE50',
+    'mu4_mb_sp1700_pusup650_trk110_hmt_L1MU4_TE50',
+    'mu4_mb_sp1200_pusup500_trk80_hmt_L1MU4_TE40',
+    'mu4_mb_sp1400_pusup550_trk90_hmt_L1MU4_TE40',
+    'mu4_mb_sp1600_pusup600_trk100_hmt_L1MU4_TE40',
+    'j40_mb_sp600_pusup300_trk40_hmt',
+    'j40_mb_sp700_pusup350_trk50_hmt',
+    'j40_mb_sp900_pusup400_trk60_hmt',
+    'j40_mb_sp1100_pusup450_trk70_hmt',
+    'j40_mb_sp1200_pusup500_trk80_hmt',
+    'j40_mb_sp1400_pusup550_trk90_hmt',
+    'j40_mb_sp1600_pusup600_trk100_hmt',
+    'j40_mb_sp600_trk40_hmt',
+    'j40_mb_sp700_trk50_hmt',
+    'j40_mb_sp900_trk60_hmt',
+    'j40_mb_sp1100_trk70_hmt',
+    'j40_mb_sp1200_trk80_hmt',
+    'j40_mb_sp1400_trk90_hmt',
+    'j40_mb_sp1600_trk100_hmt',
+    'j45_mb_sp600_pusup300_trk40_hmt',
+    'j45_mb_sp700_pusup350_trk50_hmt',
+    'j45_mb_sp900_pusup400_trk60_hmt',
+    'j45_mb_sp1100_pusup450_trk70_hmt',
+    'j45_mb_sp1200_pusup500_trk80_hmt',
+    'j45_mb_sp1400_pusup550_trk90_hmt',
+    'j45_mb_sp1600_pusup600_trk100_hmt',
+    'j45_mb_sp600_trk40_hmt',
+    'j45_mb_sp700_trk50_hmt',
+    'j45_mb_sp900_trk60_hmt',
+    'j45_mb_sp1100_trk70_hmt',
+    'j45_mb_sp1200_trk80_hmt',
+    'j45_mb_sp1400_trk90_hmt',
+    'j45_mb_sp1600_trk100_hmt',
+    'j60_mb_sp600_pusup300_trk40_hmt',
+    'j60_mb_sp700_pusup350_trk50_hmt',
+    'j60_mb_sp900_pusup400_trk60_hmt',
+    'j60_mb_sp1100_pusup450_trk70_hmt',
+    'j60_mb_sp1200_pusup500_trk80_hmt',
+    'j60_mb_sp1400_pusup550_trk90_hmt',
+    'j60_mb_sp1600_pusup600_trk100_hmt',
+    'j60_mb_sp600_trk40_hmt',
+    'j60_mb_sp700_trk50_hmt',
+    'j60_mb_sp900_trk60_hmt',
+    'j60_mb_sp1100_trk70_hmt',
+    'j60_mb_sp1200_trk80_hmt',
+    'j60_mb_sp1400_trk90_hmt',
+    'j60_mb_sp1600_trk100_hmt',
+    'j110_mb_sp600_pusup300_trk40_hmt',
+    'j110_mb_sp700_pusup350_trk50_hmt',
+    'j110_mb_sp900_pusup400_trk60_hmt',
+    'j110_mb_sp1100_pusup450_trk70_hmt',
+    'j110_mb_sp1200_pusup500_trk80_hmt',
+    'j110_mb_sp1400_pusup550_trk90_hmt',
+    'j110_mb_sp1600_pusup600_trk100_hmt',
+    'j110_mb_sp600_trk40_hmt',
+    'j110_mb_sp700_trk50_hmt',
+    'j110_mb_sp900_trk60_hmt',
+    'j110_mb_sp1100_trk70_hmt',
+    'j110_mb_sp1200_trk80_hmt',
+    'j110_mb_sp1400_trk90_hmt',
+    'j110_mb_sp1600_trk100_hmt',
     'mb_sp400_trk40_hmt_L1MBTS_1_1',
     'mb_sp600_trk45_hmt_L1MBTS_1_1',
     'mb_sp700_trk55_hmt_L1MBTS_1_1',
@@ -4685,74 +5268,71 @@ chain_list=[
     'mb_sp1000_trk70_hmt_L1MBTS_1_1',
     'mb_sp1200_trk75_hmt_L1MBTS_1_1',
     'mb_sp1400_trk80_hmt_L1MBTS_1_1',
-    'mb_sp900_trk50_hmt_L1TE5.0ETA24',
-    'mb_sp900_trk60_hmt_L1TE5.0ETA24',
-    'mb_sp1000_trk70_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk90_hmt_L1TE5.0ETA24',
-    'mb_sp1200_trk100_hmt_L1TE5.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE5.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE5.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE5.0ETA24',
-    'mb_sp1000_trk70_hmt_L1TE10.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE10.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE10.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE10.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE10.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE10.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE10.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE10.0ETA24',
-    'mb_sp1200_trk80_hmt_L1TE15.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE15.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE15.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE15.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE15.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE15.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE15.0ETA24',
-    'mb_sp1400_trk90_hmt_L1TE20.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE20.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE20.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE20.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE20.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE20.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE20.0ETA24',
-    'mb_sp1600_trk100_hmt_L1TE25.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE25.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE25.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE25.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE25.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE25.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE25.0ETA24',
-    'mb_sp1800_trk110_hmt_L1TE30.0ETA24',
-    'mb_sp2100_trk120_hmt_L1TE30.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE30.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE30.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE30.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE30.0ETA24',
-    'mb_sp2300_trk130_hmt_L1TE40.0ETA24',
-    'mb_sp2500_trk140_hmt_L1TE40.0ETA24',
-    'mb_sp2700_trk150_hmt_L1TE40.0ETA24',
-    'mb_sp2900_trk160_hmt_L1TE40.0ETA24',
+    #'mb_sp900_trk50_hmt_L1TE5.0ETA24',
+    #'mb_sp900_trk60_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_trk70_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk90_hmt_L1TE5.0ETA24',
+    #'mb_sp1200_trk100_hmt_L1TE5.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE5.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE5.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE5.0ETA24',
+    #'mb_sp1000_trk70_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE10.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE10.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE10.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE10.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE10.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE10.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE10.0ETA24',
+    #'mb_sp1200_trk80_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE15.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE15.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE15.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE15.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE15.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE15.0ETA24',
+    #'mb_sp1400_trk90_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE20.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE20.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE20.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE20.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE20.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE20.0ETA24',
+    #'mb_sp1600_trk100_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE25.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE25.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE25.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE25.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE25.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE25.0ETA24',
+    #'mb_sp1800_trk110_hmt_L1TE30.0ETA24',
+    #'mb_sp2100_trk120_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE30.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE30.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE30.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE30.0ETA24',
+    #'mb_sp2300_trk130_hmt_L1TE40.0ETA24',
+    #'mb_sp2500_trk140_hmt_L1TE40.0ETA24',
+    #'mb_sp2700_trk150_hmt_L1TE40.0ETA24',
+    #'mb_sp2900_trk160_hmt_L1TE40.0ETA24',
     'mb_sp800_hmtperf_L1TE5',
     'mb_sp800_hmtperf_L1TE10',
     'mb_sp1200_hmtperf_L1TE10',
-    'mb_sp1200_hmtperf_L1TE15',
-    'mb_sp1600_hmtperf_L1TE15',
     'mb_sp1600_hmtperf_L1TE20',
     'mb_sp2100_hmtperf_L1TE20',
-    'mb_sp2100_hmtperf_L1TE25',
     'mb_sp2100_hmtperf_L1TE30',
     'mb_sp2100_hmtperf_L1TE40',
-    'mb_sp800_hmtperf_L1TE5.0ETA24',
-    'mb_sp800_hmtperf_L1TE10.0ETA24',
-    'mb_sp1200_hmtperf_L1TE10.0ETA24',
-    'mb_sp1200_hmtperf_L1TE15.0ETA24',
-    'mb_sp1600_hmtperf_L1TE15.0ETA24',
-    'mb_sp1600_hmtperf_L1TE20.0ETA24',
-    'mb_sp2100_hmtperf_L1TE20.0ETA24',
-    'mb_sp2100_hmtperf_L1TE25.0ETA24',
-    'mb_sp2100_hmtperf_L1TE30.0ETA24',
-    'mb_sp2100_hmtperf_L1TE40.0ETA24',
+    #'mb_sp800_hmtperf_L1TE5.0ETA24',
+    #'mb_sp800_hmtperf_L1TE10.0ETA24',
+    #'mb_sp1200_hmtperf_L1TE10.0ETA24',
+    #'mb_sp1200_hmtperf_L1TE15.0ETA24',
+    #'mb_sp1600_hmtperf_L1TE15.0ETA24',
+    #'mb_sp1600_hmtperf_L1TE20.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE20.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE25.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE30.0ETA24',
+    #'mb_sp2100_hmtperf_L1TE40.0ETA24',
     'mb_sp2_hmtperf_L1MBTS_1_1',
     'mb_sp2_hmtperf',
     'mb_sp500_hmtperf',
@@ -4786,7 +5366,23 @@ chain_list=[
     'mb_sptrk_vetombts2in_L1ZDC_A_C',
     'mb_sptrk_trk80_L1MBTS_2',
     'mb_sptrk_pt2_L1MBTS_2',
-    #
+#    'mb_sptrk_L1MBTS_1',
+##     'mb_sptrk_L1MBTS_1_VTE2',
+##     'mb_sptrk_L1MBTS_1_VTE3',
+##     'mb_sptrk_L1MBTS_1_VTE4',
+##     'mb_sptrk_L1MBTS_1_VTE5',
+##     'mb_sptrk_L1MBTS_1_VTE10',
+##     'mb_sptrk_L1MBTS_2_VTE2',
+##     'mb_sptrk_L1MBTS_2_VTE3',
+##     'mb_sptrk_L1MBTS_2_VTE4',
+##     'mb_sptrk_L1MBTS_2_VTE5',
+##     'mb_sptrk_L1MBTS_2_VTE10',
+##     'mb_sptrk_L1VTE2',
+##     'mb_sptrk_L1VTE3',
+##     'mb_sptrk_L1VTE4',
+##     'mb_sptrk_L1VTE5',
+##     'mb_sptrk_L1VTE10',   
+    
     # minBias streamer
     'noalg_mb_L1LUCID',
     'noalg_mb_L1LUCID_EMPTY',
@@ -4808,18 +5404,23 @@ chain_list=[
     'noalg_mb_L1RD2_FILLED',
     'noalg_mb_L1RD3_EMPTY',
     'noalg_mb_L1RD3_FILLED',
+ ##    'noalg_mb_L1TE2',
+##     'noalg_mb_L1TE3',
+##     'noalg_mb_L1TE4',
     'noalg_mb_L1TE5',
-    'noalg_mb_L1TE5.0ETA24',
+    #'noalg_mb_L1TE5.0ETA24',
     'noalg_mb_L1TE10',
-    'noalg_mb_L1TE10.0ETA24',
+    #'noalg_mb_L1TE10.0ETA24',
     'noalg_mb_L1TE20',
-    'noalg_mb_L1TE20.0ETA24',
+    #'noalg_mb_L1TE20.0ETA24',
     'noalg_mb_L1TE30',
-    'noalg_mb_L1TE30.0ETA24',
+    #'noalg_mb_L1TE30.0ETA24',
     'noalg_mb_L1TE40',
-    'noalg_mb_L1TE40.0ETA24',
+    #'noalg_mb_L1TE40.0ETA24',
+    'noalg_mb_L1TE50',
+    'noalg_mb_L1TE60',
     'noalg_mb_L1TE70',
-    'noalg_mb_L1TE70.0ETA24',
+    #'noalg_mb_L1TE70.0ETA24',
     'noalg_mb_L1ZDC_A',
     'noalg_mb_L1ZDC_C',
     'noalg_mb_L1ZDC_A_C',
@@ -4829,7 +5430,10 @@ chain_list=[
     'zdcpeb_L1ZDC_AND', 
     'zdcpeb_L1ZDC_A_C',
     'timeburner',
+#    'mb_sp_L1MBTS_1_OVERLAY',
+#    'mb_sptrk_L1MBTS_1_OVERLAY',
+#    'noalg_L1MBTS_1_OVERLAY',
+#    'noalg_L1TE20_OVERLAY',
     ]
 Prescales.HLTPrescales_tight_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ])))
 ######################################################
-
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
index f1fd71b62b1077be40d12c74c26391cc4181d286..3ead33bc12252e62671f6a5cd261ce36b6064a3e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
@@ -18,6 +18,7 @@ SliceIDDict = {
     'MET'     : 'xe',
     'XS'      : 'xs',
     'TE'      : 'te',
+    'AFP'     : 'afp',
     'MinBias' : 'mb',
     'HeavyIon' : 'hi',
     'Cosmic'  : 'cosmic',
@@ -62,7 +63,7 @@ AllowedTopos_bphys = ['bJpsi', 'bTau', 'bDimu', 'bDimu2700', 'bNocut','bVertex2'
                       'BcmumuDs' ,   'BcmumuDsloose' ,
                       '7invm9', 'noos', 'noid', 'novtx',
                       '11invm60','18invm60', 'bUpsi',
-                      'Trkloose',  'TrkPEB', 'Zmumu', 'noL2', 'noEFbph',
+                      'Trkloose',  'TrkPEB', 'TrkPEBmon', "lowpt",'Zmumu', 'noL2', 'noEFbph',
                       'noinvm', 'ss', 'BpmumuKp', 'Taumumux', 'Dsmumux', 'LbmumuLambda',
                       'trkTau', 'bTauTrk', 'bDsPhiX', 'bPhi','bDsPhiXtight',
                       '11invm24', '24invm60',
@@ -131,7 +132,7 @@ JetChainParts = {
 #    'bMatching'    : ['mu4antidr05', 'mu6antidr05'],
     'bMatching'    : ['antimatchdr05mu'],
     'dataScouting' : ['ds1', 'ds2'],
-    'smc'          : ['30smcINF', '35smcINF', '40smcINF', 'nosmc'],
+    'smc'          : ['30smcINF', '35smcINF', '40smcINF', '60smcINF', 'nosmc'],
     'trkopt'       : ['notrk', 'ftk', 'ftkrefit'],
     # Et cut by the jet build tool (ptmin)
     'recoCutUncalib': ['rcuDefault', 'rcu0', 'rcu5'],
@@ -204,14 +205,14 @@ MuonChainParts = {
     'IDinfo'         : [],
     'isoInfo'        : ['iloose', 'imedium', 'itight', 'ivarloose', 'ivarmedium','icalo','iloosecalo','imediumcalo','iloosems', 'ivarloosecalo', 'ivarmediumcalo'],
     'reccalibInfo'   : ['msonly', 'l2msonly', 'l2idonly', 'nomucomb', 'idperf','muoncalib', 'mucombTag','muL2', 'mgonly'],
-    'trkInfo'        : ['fasttr', 'hlttr', 'ftk', 'IDT'],
+    'trkInfo'        : ['fasttr', 'hlttr', 'IDT'],
     'hypoInfo'       : [],
-    'FSinfo'         : ['ftkFS', 'nscan03', 'l2nscan03', 'nscan05', 'l2nscan05', 'JpsimumuFS', 'JpsimumuL2','calotag'],
+    'FSinfo'         : ['FTKFS', 'nscan03', 'l2nscan03', 'nscan05', 'l2nscan05', 'JpsimumuFS', 'JpsimumuL2','calotag'],
     'L2IDAlg'        : ['L2Star','IdScan','FTK','FTKRefit'],
     'L2SAAlg'        : ['muFast', 'l2muonSA',],
     'L2CBAlg'        : ['muComb',],
     'EFAlg'          : ['SuperEF'],
-    'addInfo'        : ['cosmicEF', 'cosmic','IdTest','fsperf', 'ds1', 'ds2','ds3', 'r1extr', 'perf', 'noEF','10invm30','pt2','z10','llns','noComb','zROItest','invm1'],
+    'addInfo'        : ['cosmicEF', 'cosmic','IdTest','fsperf', 'ds1', 'ds2','ds3', 'r1extr', 'perf', 'noEF','10invm30','pt2','z10','llns','noComb','zROItest','invm1','inTimeRoI','dRl1'],
     'overlapRemoval' : ['wOvlpRm', 'noOvlpRm', 'noMuCombOvlpRm'],
     'topo'           : AllowedTopos_mu,
     'flavour'        : ['hf'],
@@ -270,8 +271,8 @@ TauChainParts = {
     'L1item'       : '',
     'chainPartName': '',
     'threshold'    : '',
-    'preselection' : ['r1', 'FTK', 'FTKRefit', 'FTKNoPrec', 'calo', 'track', 'mvonly', 'ptonly', 'caloonly', 'trackonly', 'tracktwo', 'trackcalo', 'tracktwocalo','tracktwo2015'],
-    'selection'    : ['medium0','loose1', 'medium1', 'tight1', 'perf', 'perf0', 'r1medium1', 'r1perf', 'cosmic', 'kaonpi1', 'kaonpi2', 'dipion1', 'dipion1loose', 'dipion2', 'dikaon', 'dikaontight', 'dikaonmass', 'dikaonmasstight', 'singlepion', 'singlepiontight',  'medium1HighptL', 'medium1HighptM', 'medium1HighptH'],
+    'preselection' : ['r1', 'FTK', 'FTKRefit', 'FTKNoPrec', 'calo', 'track', 'mvonly', 'ptonly', 'caloonly', 'trackonly', 'tracktwo', 'trackcalo', 'tracktwocalo','tracktwo2015', 'tracktwomva'],
+    'selection'    : ['medium0','loose1', 'medium1', 'tight1', 'perf', 'perf0', 'r1medium1', 'r1perf', 'cosmic', 'kaonpi1', 'kaonpi2', 'dipion1', 'dipion1loose', 'dipion2', 'dipion3', 'dikaon', 'dikaontight', 'dikaonmass', 'dikaonmasstight', 'singlepion', 'singlepiontight',  'medium1HighptL', 'medium1HighptM', 'medium1HighptH'],
     'multiplicity' : '',
     'trigType'     : ['tau'],   
     'trkInfo'      : ['idperf'],
@@ -382,7 +383,7 @@ ElectronChainParts = {
     'caloInfo'       : ['L2EFCalo','HLTCalo'],
     'lhInfo'         : ['cutd0dphideta','nod0','nodphires','nodeta','smooth'],
     'L2IDAlg'        : ['L2StarA','L2StarB','L2StarC','FTK','TRT','SiTrack','IdScan'],
-    'addInfo'        : ['etcut','ringer','conv','etisem','gsf','trkcut',
+    'addInfo'        : ['etcut','ringer','noringer','conv','etisem','gsf','trkcut',
                         'L2Star','perf','IdTest'],
     }
 # ---- Egamma Dictinary of default Values ----
@@ -429,7 +430,8 @@ PhotonChainParts = {
     'hypoInfo'       : '',
     'recoAlg'        : [],
     'FSinfo'         : ['ftkFS',],
-    'addInfo'        : ['etcut', 'jetcalibdelayed', 'cosmic', 'perf', 'hiptrt','ringer','conv','larpeb',],
+    'addInfo'        : ['etcut', 'jetcalibdelayed', 'cosmic', 'perf', 'hiptrt','ringer','conv','larpeb'],
+    'topo'           : ['dPhi15'],
     }
 
 # ---- Photon Dictinary of default Values ----
@@ -449,6 +451,7 @@ PhotonChainParts_Default = {
     'recoAlg'        : '',
     'FSinfo'         : '',
     'addInfo'        : [],
+    'topo'           : '',
     }
 
 #==========================================================
@@ -493,6 +496,37 @@ CombinedChainParts_Default['chainParts'] = ['g','mu'],
 CombinedChainParts_Default['trigType'] =['g','mu']
 CombinedChainParts_Default['topo'] = []
 
+#==========================================================
+# AFP
+#==========================================================
+# ---- AFP Dictinary of all allowed Values ----
+AFPChainParts = {
+    'signature'      : ['AFP'],
+    'L1item'         : ['AFP_A_AND_C'],
+    'chainPartName'  : '',
+    'multiplicity'   : '',
+    'calib'        : ['lcw','had','em'],
+    'trigType'       : ['afp'],
+    'jetCalib'     : JetChainParts['jetCalib'],
+    'threshold'      : '',
+    'extra'          : ['jetexc'],
+    'addInfo'        : []
+    }
+# ---- AFPDictinary of default Values ----
+AFPChainParts_Default = {
+    'signature'      : ['AFP'],
+    'L1item'         : '',
+    'chainPartName'  : '',
+    'multiplicity'   : '',
+    'calib'          : 'lcw',
+    'trigType'       : ['afp'],
+    'jetCalib'       : JetChainParts_Default['jetCalib'],
+    'threshold'      : '',
+    'extra'          : '',
+    'addInfo'        : []
+    }
+
+
 #==========================================================
 # MinBias chains
 #==========================================================
@@ -509,10 +543,10 @@ MinBiasChainParts = {
     'ZDCinfo'        : ['lg', 'hg'],
     'trkInfo'        : ['hlttr', 'ftk', 'costr'],
     'hypoL2Info'     : ['sp2', 'sp3', 'sp5', 'sp10', 'sp15', 'sp100', 'sp300', 'sp400', 'sp500', 'sp600', 'sp700', 'sp800', 'sp900',
-                        'sp1000', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800', 
+                        'sp1000', 'sp1100', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800', 'sp1900',
                         'sp2000', 'sp2100', 'sp2200', 'sp2300', 'sp2400', 'sp2500', 'sp2700', 'sp2800', 'sp2900', 'sp3000',
                         'sp3100', 'sp3500', 'sp4100', 'sp4500', 'sp4800', 'sp5000', 'sp5200',],
-    'pileupInfo'     : ['pusup200','pusup300','pusup350', 'pusup400', 'pusup450', 'pusup500', 'pusup550', 'pusup600', 'pusup700', 'pusup750', 'pusup800', 'pusup900',
+    'pileupInfo'     : ['pusup200','pusup300','pusup350', 'pusup400', 'pusup450', 'pusup500', 'pusup550', 'pusup600', 'pusup650', 'pusup700', 'pusup750', 'pusup800', 'pusup850', 'pusup900',
                         'pusup1000', 'pusup1100', 'pusup1200', 'pusup1300', 'pusup1400', 'pusup1500',],
     'hypoEFInfo'     : ['trk3','trk5','trk10','trk15',  'trk20',  'trk30',  'trk40', 'trk45', 'trk50', 'trk55', 'trk60', 'trk65', 'trk70', 'trk75', 'trk80', 'trk90',
                         'trk100', 'trk110', 'trk120', 'trk130', 'trk140', 'trk150', 'trk160', 'trk180', 'trk200', 'trk220', 'trk240', 'trk260', 'trk280',      
@@ -685,6 +719,9 @@ AllowedCalibChainIdentifiers = ['csccalib',
                                 'l1satmon',
                                 'zdcpeb',
                                 'calibAFP',
+                                'rpcpeb',
+                                'idpsl1',
+                                'larpebcalib'
                                 ]
 
 # ---- Calib Chain Dictinary of all allowed Values ----
@@ -877,6 +914,8 @@ def getSignatureInformation(signature):
         return [XSChainParts_Default, XSChainParts]
     if signature == "TE":
         return [TEChainParts_Default, TEChainParts]
+    if signature == "AFP":
+        return [AFPChainParts_Default, AFPChainParts]
     if signature == "MinBias":
         return [MinBiasChainParts_Default, MinBiasChainParts]
     if signature == "HeavyIon":
@@ -901,7 +940,6 @@ def getSignatureInformation(signature):
 
 def getBasePattern():
     import re
-    import itertools
     # possibleTT = '|'.join(allowedSignaturePropertiesAndValues['trigType'])
     #print 'SignatureDicts.py: Allowed values for triType in base pattern', SliceIDDict.values()
     allTrigTypes = SliceIDDict.values()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/SliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/SliceFlags.py
index 552e49cbeb1726c4b90be1a6e0f178914e2f4863..ea6ae25cccc547c02e90bd3efb171cfc209ebe5e 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/SliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/SliceFlags.py
@@ -1,21 +1,22 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import TriggerMenu.egamma.EgammaSliceFlags
-import TriggerMenu.jet.JetSliceFlags
-import TriggerMenu.bjet.BjetSliceFlags
-import TriggerMenu.muon.MuonSliceFlags
-import TriggerMenu.met.METSliceFlags
-import TriggerMenu.tau.TauSliceFlags
-import TriggerMenu.bphysics.BphysicsSliceFlags
-import TriggerMenu.minbias.MinBiasSliceFlags
-import TriggerMenu.heavyion.HeavyIonSliceFlags
-import TriggerMenu.combined.CombinedSliceFlags
-import TriggerMenu.calibcosmicmon.CosmicSliceFlags
-import TriggerMenu.calibcosmicmon.CalibSliceFlags
-import TriggerMenu.calibcosmicmon.StreamingSliceFlags
-import TriggerMenu.calibcosmicmon.MonitorSliceFlags
-import TriggerMenu.calibcosmicmon.BeamspotSliceFlags
-import TriggerMenu.calibcosmicmon.EnhancedBiasSliceFlags
-import TriggerMenu.test.TestSliceFlags
+import TriggerMenu.egamma.EgammaSliceFlags                  # noqa: F401
+import TriggerMenu.jet.JetSliceFlags                        # noqa: F401
+import TriggerMenu.bjet.BjetSliceFlags                      # noqa: F401
+import TriggerMenu.muon.MuonSliceFlags                      # noqa: F401
+import TriggerMenu.met.METSliceFlags                        # noqa: F401
+import TriggerMenu.tau.TauSliceFlags                        # noqa: F401
+import TriggerMenu.bphysics.BphysicsSliceFlags              # noqa: F401
+import TriggerMenu.afp.AFPSliceFlags                        # noqa: F401
+import TriggerMenu.minbias.MinBiasSliceFlags                # noqa: F401
+import TriggerMenu.heavyion.HeavyIonSliceFlags              # noqa: F401
+import TriggerMenu.combined.CombinedSliceFlags              # noqa: F401
+import TriggerMenu.calibcosmicmon.CosmicSliceFlags          # noqa: F401
+import TriggerMenu.calibcosmicmon.CalibSliceFlags           # noqa: F401
+import TriggerMenu.calibcosmicmon.StreamingSliceFlags       # noqa: F401
+import TriggerMenu.calibcosmicmon.MonitorSliceFlags         # noqa: F401
+import TriggerMenu.calibcosmicmon.BeamspotSliceFlags        # noqa: F401
+import TriggerMenu.calibcosmicmon.EnhancedBiasSliceFlags    # noqa: F401
+import TriggerMenu.test.TestSliceFlags                      # noqa: F401
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/StreamInfo.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/StreamInfo.py
index f6f4da0b10d02b54a70d2595533f83017399f1b0..517938def35ff62f5da64d1986427dfa20d4470f 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/StreamInfo.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/StreamInfo.py
@@ -1,43 +1,35 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
+from collections import Counter
 log = logging.getLogger( 'TriggerMenu.menu.StreamInfo' )
 
-monStreams = ['monitoring_random', 
+monStreams = ['monitoring_random',
               'CSC',
-              'IDMonitoring',
-              'MetRateStudies',
+              'IDMonitoring'
               ]
 
 physicsStreams = ['Main',
                   'BphysLS',
-                  'Physics',
                   'Background',
                   'DISCARD',
-                  'Egamma', 
-                  'Bphysics',
-                  'Combined',
-                  'Muon', 
-                  'Met', 'Jet', 'Tau', 
                   'MinBias',
                   'ZeroBias',
                   'TauOverlay',
                   'Standby', 
-                  'L1Muon', 'L1Calo', 'L1MinBias', 'L1Topo',
+                  'L1Calo', 'L1Topo',
                   'IDCosmic','CosmicCalo',
                   'HLTPassthrough',
                   'JetTauEtmiss', # needed for LS1menu
                   'EnhancedBias',
                   'CosmicMuons',
                   'HLT_IDCosmic',
-                  'CosmicID',
                   'Late',
                   'HardProbes',
                   'MinBiasOverlay',
                   'UPC',
                   'Mistimed',
-                  'ExoDelayed',
-                  'BphysDelayed',
+                  'ExoDelayed'
                   ]
 
 calibStreams = [
@@ -49,7 +41,6 @@ calibStreams = [
                 'PixelNoise', 'PixelBeam', 
                 'SCTNoise',
                 'CostMonitoring',
-                'beamspot',
                 'Muon_Calibration',
                 'ALFACalib',
                 'IBLLumi',
@@ -60,18 +51,17 @@ calibStreams = [
                 'BeamSpot',
                 'zdcCalib',
                 'AFP',
-                'BphysPEB'
+                'BphysPEB',
+                'RPCNoise',
+                'IDprescaledL1',
+                'LArPEB'
                 ]
 
 ##NOTE: DataScouting_xx_NAME: 
 ##xx stands for the unique ROB_ID associated with the stream. If you add a new one,
 ##make sure to use a unique number
-dataScoutingStreams = ['DataScouting_01_CosmicMuons',
-                       'DataScouting_02_CosmicMuons',
-                       'DataScouting_03_CosmicMuons',
-                       'DataScouting_04_IDCosmic',                    
-                       'DataScouting_05_Jets',
-                       'DataScouting_06_Jets',
+dataScoutingStreams = ['DataScouting_03_CosmicMuons',
+                       'DataScouting_05_Jets'
                        ]
 
 expressStreams = ['express']
@@ -79,6 +69,14 @@ expressStreams = ['express']
 
 def getAllStreams():
 
+    allStreams = monStreams + physicsStreams + calibStreams + dataScoutingStreams + expressStreams
+
+    duplicates = [stream for stream,count in Counter(allStreams).items() if count>1]
+
+    if duplicates:
+        log.error('Stream %s is duplicated' % duplicates)
+
+
     return monStreams + physicsStreams + calibStreams + dataScoutingStreams + expressStreams
 
 
@@ -93,7 +91,7 @@ def getStreamTag(streams):
         if stream in physicsStreams:
             streamTags += [(stream, 'physics', 'yes', '1')]
         elif stream in calibStreams:
-            if 'BeamSpot' in stream or 'Background' in stream or "IDTracks" in stream or 'VdM' in stream or 'PixelBeam' in stream:
+            if 'BeamSpot' in stream or 'Background' in stream or "IDTracks" in stream or 'VdM' in stream or 'PixelBeam' in stream or 'BphysPEB' in stream or 'IDprescaledL1' in stream:
                streamTags += [(stream, 'calibration', 'yes', '1')]
             else: 
                streamTags += [(stream, 'calibration', 'no', '1')]
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/simpleExpress.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/simpleExpress.py
index 5aa9b6634ef47e8cab3f9b98fbb74c38cac73d12..381d56181cc36100ad88f7df19d50b0f80f8c6aa 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/simpleExpress.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/simpleExpress.py
@@ -45,3 +45,10 @@ ExpressNamesPPV4= {
     'mu24_tight'               :   1,
     }
 
+ExpressNamesPPV5 = {
+}
+ExpressNamesPPV6 = {
+}
+ExpressNamesPPV7 = {
+}
+
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/met/METSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/met/METSliceFlags.py
index f0a0c95920d6053434f0bd149672e74078e5acc7..ef098a8e112344520a7ac33a4d862a9ae871b6f9 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/met/METSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/met/METSliceFlags.py
@@ -2,10 +2,8 @@
 
 """ MET slice specific flags  """
 
- 
-from AthenaCommon.Logging import logging
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 # create container
 __author__  = 'T. Bold'
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py b/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py
index 5176b6052b208790a3831b50185dd6a0920a5fa9..68b3cce144952e05dfc5354c6969d33c80f3f336 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py
@@ -15,12 +15,12 @@ log = logging.getLogger("TriggerMenu.met.MissingETDef")
 from TrigEFMissingET.TrigEFMissingETConfig import (EFMissingET_Fex_2sidednoiseSupp,
                                                    EFMissingET_Fex_Jets,
                                                    EFMissingET_Fex_TrackAndJets,
+                                                   EFMissingET_Fex_FTKTrackAndJets,
                                                    EFMissingET_Fex_topoClusters,
                                                    EFMissingET_Fex_topoClustersPS, 
                                                    EFMissingET_Fex_topoClustersPUC)
 
-from TrigL2MissingET.TrigL2MissingETConfig import (L2CaloMissingET_Fex_ReadL2L1,
-                                                   L2MissingET_Fex)
+from TrigL2MissingET.TrigL2MissingETConfig import L2MissingET_Fex
 
 from TrigMissingETHypo.TrigMissingETHypoConfig import (EFMetHypoJetsXE,
                                                        EFMetHypoTrackAndJetsXE,
@@ -30,16 +30,13 @@ from TrigMissingETHypo.TrigMissingETHypoConfig import (EFMetHypoJetsXE,
                                                        EFMetHypoTCXE,
                                                        EFMetHypoTE,
                                                        EFMetHypoXE, 
-                                                       EFMetHypoXS_2sided,
-                                                       L2MetHypoFEBXE,
-                                                       L2MetHypoXE)
+                                                       EFMetHypoXS_2sided)
 
 from TrigMissingETMuon.TrigMissingETMuonConfig import (EFTrigMissingETMuon_Fex,
                                                        EFTrigMissingETMuon_Fex_Jets,
                                                        EFTrigMissingETMuon_Fex_topocl,
                                                        EFTrigMissingETMuon_Fex_topoclPS,
                                                        EFTrigMissingETMuon_Fex_topoclPUC,
-                                                       L2CaloTrigMissingETMuon_Fex,
                                                        L2TrigMissingETMuon_Fex)
 
 from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo
@@ -110,8 +107,7 @@ class L2EFChain_met(L2EFChainDef):
         calibration = self.chainPart['calib']
         jetCalib    = self.chainPart['jetCalib']
         L2recoAlg   = self.chainPart['L2recoAlg']
-        EFrecoAlg   = self.chainPart['EFrecoAlg']        
-        L2muon      = self.chainPart['L2muonCorr']
+        EFrecoAlg   = self.chainPart['EFrecoAlg']
         EFmuon      = self.chainPart['EFmuonCorr']
         addInfo     = self.chainPart["addInfo"]
 
@@ -140,18 +136,6 @@ class L2EFChain_met(L2EFChainDef):
         ##L1 MET 
         theL2Fex     = L2MissingET_Fex()
         theL2MuonFex = L2TrigMissingETMuon_Fex()
-        
-        ##FEB MET at L2
-#        theL2FEBL1Check  =  L2CaloMissingET_Fex_ReadL2L1()
-        
-#        theL2FEBMuonFex  =  L2CaloTrigMissingETMuon_Fex() 
-
-        mucorr=  '_wMu' if L2muon else '' 
-        if L2recoAlg=="L2FS":
-            theL2MuonHypo  =  L2MetHypoFEBXE(name='L2MetHypo_xe%d%s_FEB'%(threshold,mucorr),l2_thr=threshold*GeV)
-        else:            
-            theL2MuonHypo  =  L2MetHypoXE('L2MetHypo_xe_noL2%s' %mucorr,l2_thr=threshold*GeV)
-
 
         mucorr=  '_wMu' if EFmuon else ''          
         ##MET with topo-cluster
@@ -191,12 +175,14 @@ class L2EFChain_met(L2EFChainDef):
                 #Muon correction fex
                 theEFMETMuonFex = EFTrigMissingETMuon_Fex_Jets("EFTrigMissingETMuon_Fex_Jets{0}".format(calibCorr) )
                 #mucorr= '_wMu' if EFmuon else ''
-                theEFMETHypo = EFMetHypoJetsXE('EFMetHypo_Jets_xe%s_tc%s%s%s'%(threshold,jetCalib,calibration,mucorr),ef_thr=float(threshold)*GeV)
+                theEFMETHypo = EFMetHypoJetsXE('EFMetHypo_Jets_xe%s_tc%s%s%s'%(threshold,jetCalib,calibration,mucorr),ef_thr=float(threshold)*GeV, extraCalib=calibCorr)
+
 
              ##MET based on trigger jets
             if EFrecoAlg=='trkmht':
                 #MET fex                                                                                                                                                    
-                theEFMETFex = EFMissingET_Fex_TrackAndJets()                                                                                                                
+                if "FTK" in addInfo: theEFMETFex = EFMissingET_Fex_FTKTrackAndJets()
+                else: theEFMETFex = EFMissingET_Fex_TrackAndJets()                                                                                                                
                 #Muon correction fex                                                                                                                                        
                 ## this will be added later                                                                                                                                 
                 theEFMETMuonFex = EFTrigMissingETMuon_Fex_Jets()                                                                                                            
@@ -241,11 +227,6 @@ class L2EFChain_met(L2EFChainDef):
         # Obtaining the needed jet TEs from the jet code
         #----------------------------------------------------
         from TriggerJobOpts.TriggerFlags import TriggerFlags
-        #if "v6" in TriggerFlags.triggerMenuSetup() or "v5" in TriggerFlags.triggerMenuSetup():
-        #    chain = ['j0_lcw', '',  [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]
-        #else:
-        #    chain = ['j0', '',  [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]
-        # chain = ['j0_lcw', '',  [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]
 
         chain = ['j0_{0}_{1}'.format(calibration, jetCalib), '', [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]
 
@@ -296,16 +277,6 @@ class L2EFChain_met(L2EFChainDef):
             self.L2sequenceList += [[ self.l2_input_tes,              [theL2Fex],                      'L2_xe_step1']]
             ##Moun Correction to L1 MET
             self.L2sequenceList += [[ ['L2_xe_step1', muonSeed],  [theL2MuonFex],                  'L2_xe_step2']]
-            
-            # ##FEB Met
-            # self.L2sequenceList += [[ 'L2_xe_step2',                 [theL2FEBL1Check],               'L2_xe_step3']]
-
-            # if L2recoAlg=="l2fsperf":
-            #     #Only execute Muon FEB MET and muon correction
-            #     self.L2sequenceList += [[ ['L2_xe_step3',muonSeed],   [theL2FEBMuonFex], 'L2_xe_step4']]            
-            # if L2recoAlg=="L2FS":
-            #     #Hypo on FEB MET
-            #     self.L2sequenceList += [[ ['L2_xe_step3',muonSeed],   [theL2FEBMuonFex,theL2MuonHypo], 'L2_xe_step4']]
 
         # --- EF ---                
 
@@ -355,7 +326,7 @@ class L2EFChain_met(L2EFChainDef):
             self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]]
             if "FStracks" in addInfo:
                 from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-                trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", "FTF").getSequence()
+                trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
                 print "XXXXXXXXXXXXXXXXXX"
                 print trk_algs[0]
                 dummyAlg = PESA__DummyUnseededAllTEAlgo("EF_DummyFEX_xe")
@@ -378,7 +349,7 @@ class L2EFChain_met(L2EFChainDef):
 
             else:
                 from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-                trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", "FTF").getSequence()
+                trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
                 dummyAlg = PESA__DummyUnseededAllTEAlgo("EF_DummyFEX_xe")
                 self.EFsequenceList +=[[ [''], [dummyAlg]+trk_algs[0], 'EF_xe_step0' ]]
 
@@ -395,8 +366,6 @@ class L2EFChain_met(L2EFChainDef):
         if L2recoAlg=="l2fsperf" or  L2recoAlg=="L2FS" :
             self.L2signatureList += [ [['L2_xe_step1']] ]
             self.L2signatureList += [ [['L2_xe_step2']] ]
-#            self.L2signatureList += [ [['L2_xe_step3']] ]
-#            self.L2signatureList += [ [['L2_xe_step4']] ]
 
         if EFrecoAlg=="trkmht" :
             self.EFsignatureList += [ [['EF_xe_step0']] ]   
@@ -413,13 +382,10 @@ class L2EFChain_met(L2EFChainDef):
         if L2recoAlg=="l2fsperf" or  L2recoAlg=="L2FS" :
             self.TErenamingDict['L2_xe_step1']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step1')
             self.TErenamingDict['L2_xe_step2']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step2')
-#            self.TErenamingDict['L2_xe_step3']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step3')
-#            self.TErenamingDict['L2_xe_step4']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step4')
 
         if EFrecoAlg=='trkmht':
             self.TErenamingDict['EF_xe_step0']= mergeRemovingOverlap('EF_', self.sig_id_noMult+"_step0")                                                                    
-  
-            
+              
         self.TErenamingDict['EF_xe_step1']= mergeRemovingOverlap('EF_', self.sig_id_noMult+'_step1')
         if "FStracks" in addInfo:
             self.TErenamingDict['EF_xe_step2']= mergeRemovingOverlap('EF_', self.sig_id_noMult+"_step2")
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/met/generateMETChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/met/generateMETChainDefs.py
index 3a527ed414847aa3c9e92f80db111b62e73d6731..4ff7b1a0f18979c3e73c8bff089383fa23685202 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/met/generateMETChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/met/generateMETChainDefs.py
@@ -9,10 +9,10 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 
 
-from TriggerMenu.met.MissingETDef import *
+from TriggerMenu.met.MissingETDef import L2EFChain_met
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasDef.py b/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasDef.py
index 9b6800064936c2f87b89b1df2cb6003d7933f09e..849bdb5a6ea9833aa8ffc46862e638d56d320fcc 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasDef.py
@@ -10,22 +10,14 @@ logging.getLogger().info("Importing %s",__name__)
 
 logMinBiasDef = logging.getLogger("TriggerMenu.minbias.MinBiasDef")
 
-from AthenaCommon import CfgGetter
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+from AthenaCommon.SystemOfUnits import GeV
 
-import re
+from TriggerMenu.menu.HltConfig import L2EFChainDef,mergeRemovingOverlap
 
-from TriggerJobOpts.TriggerFlags            import TriggerFlags
-
-from TriggerMenu.minbias.MinBiasSliceFlags  import MinBiasSliceFlags
-
-from TriggerMenu.menu.HltConfig import *
-
-from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo
-
-#theTrigEFIDInsideOut_FullScan = TrigEFIDSequence("FullScan","fullScan")
-
-from TrigT2MinBias.TrigT2MinBiasConfig import *
+from TrigT2MinBias.TrigT2MinBiasConfig import (MbMbtsHypo,L2MbMbtsFex,L2MbSpFex,L2MbSpFex_SCTNoiseSup,L2MbSpFex_ncb,
+                                               L2MbSpHypo_blayer,L2MbSpHypo_veto,L2MbSpFex_noPix,L2MbSpMhNoPixHypo_hip,
+                                               L2MbSpFex_BLayer,L2MbSpHypo_ncb,L2MbSpHypo,L2MbSpHypo_PT,
+                                               L2MbMbtsHypo_PT,L2MbZdcFex_LG,L2MbZdcHypo_PT,L2MbZdcFex_HG,trigT2MinBiasProperties)
 from InDetTrigRecExample.EFInDetConfig import TrigEFIDSequence
 #fexes.efid = TrigEFIDSequence("minBias","minBias","InsideOut").getSequence()
 #fexes.efid2P = TrigEFIDSequence("minBias2P","minBias2","InsideOutLowPt").getSequence()
@@ -35,20 +27,19 @@ efid = TrigEFIDSequence("minBias","minBias","InsideOut").getSequence()
 efid_heavyIon = TrigEFIDSequence("heavyIonFS","heavyIonFS","InsideOut").getSequence()
 efid2P = TrigEFIDSequence("minBias2P","minBias2","InsideOutLowPt").getSequence()
 
-from TrigMinBias.TrigMinBiasConfig import *
-
+from TrigMinBias.TrigMinBiasConfig import (EFMbTrkFex,EFMbTrkHypoExclusiveLoose,EFMbTrkHypoExclusiveTight,EFMbTrkHypo,
+                                           EFMbVxFex,MbVxHypo,MbTrkHypo)
 
 from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyRoI
 from TrigGenericAlgs.TrigGenericAlgsConf import PrescaleAlgo
 dummyRoI=DummyRoI(name='MinBiasDummyRoI', createRoIDescriptors = True, NumberOfOutputTEs=1)
 terminateAlgo = PrescaleAlgo('terminateAlgo')
 
-
 # for HI
 from TrigHIHypo.TrigHIHypoConfig import HIEFTrackHypo_AtLeastOneTrack
 atLeastOneTrack = HIEFTrackHypo_AtLeastOneTrack(name='HIEFTrackHypo_AtLeastOneTrack')
 
-from TrigHIHypo.TrigHIHypoConfig import *
+from TrigHIHypo.TrigHIHypoConfig import HIL2VtxMultHypo
 #hypos.update(hi_hypos)
 
 #L2 pileup suppression
@@ -326,7 +317,6 @@ class L2EFChain_MB(L2EFChainDef):
             chainSuffix = "idperf"
             if not doHeavyIon:
                 theEFFex1 =  efid
-                theEFFex2 =  efid2P
             else:
                 theEFFex1 =  efid_heavyIon
 
@@ -351,9 +341,6 @@ class L2EFChain_MB(L2EFChainDef):
 
 ###########################
     def setup_mb_perf(self):
-        doHeavyIon=False
-        if 'ion' in self.chainPart['extra']:
-            doHeavyIon=True
 
         ########## L2 algos ##################
         if "perf" in self.chainPart['recoAlg']:
@@ -399,9 +386,6 @@ class L2EFChain_MB(L2EFChainDef):
 
 ###########################
     def setup_mb_zdcperf(self):
-        doHeavyIon=False
-        if 'ion' in self.chainPart['extra']:
-            doHeavyIon=True
 
         ########## L2 algos ##################
         if "zdcperf" in self.chainPart['recoAlg']:
@@ -438,9 +422,6 @@ class L2EFChain_MB(L2EFChainDef):
 
 ###########################
     def setup_mb_mbts(self):
-        doHeavyIon=False
-        if 'ion' in self.chainPart['extra']:
-            doHeavyIon=True
 
         theL2Fex  = L2MbMbtsFex
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasSliceFlags.py
index 216ca7caa7cb0d52bd37e7e4c024357ce06dffe3..6c8b9a7567d6eae9160a187535a350c95b3ba104 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/minbias/MinBiasSliceFlags.py
@@ -2,10 +2,8 @@
 
 """ MinBias slice specific flags  """
 
-from AthenaCommon.Logging import logging
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
-from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'R. Kwee, B. Demirkoz, T.Bold, T.Kohno, W. H. Bell'
 __version__="$Revision: 1.18 $"
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/minbias/generateMinBiasChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/minbias/generateMinBiasChainDefs.py
index 49d40473f3143de0b39bcb2a4685e050d037b7d5..18f811026fc8de85af1f1be24d76cec38b8e6759 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/minbias/generateMinBiasChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/minbias/generateMinBiasChainDefs.py
@@ -9,8 +9,8 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 
 
-from TriggerMenu.minbias.MinBiasDef import *
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.minbias.MinBiasDef import L2EFChain_MB
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 
 MinBias = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py
index c903c593a6b8c21f90059d8da48e5e7704d7fa87..c580e52468a116559b72aa9660898078259413e4 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py
@@ -11,7 +11,7 @@ logging.getLogger().info("Importing %s",__name__)
 
 log = logging.getLogger("TriggerMenu.muon.MuonDef")
 
-from TriggerMenu.menu.HltConfig import *
+from TriggerMenu.menu.HltConfig import mergeRemovingOverlap,L2EFChainDef
 
 from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
 from InDetTrigRecExample.EFInDetConfig import TrigEFIDSequence
@@ -49,7 +49,7 @@ class L2EFChain_mu(L2EFChainDef):
   fullScanSeqMap = getFullScanCaloSequences()
   # ----------------------------------------------------------------
 
-  def __init__(self, chainDict, asymDiMuonChain = False, AllMuons = [], thisIsBphysChain=False):
+  def __init__(self, chainDict, asymDiMuonChain = False, asymMultiMuonChain = False, AllMuons = [], thisIsBphysChain=False):
     self.L2sequenceList   = []
     self.EFsequenceList   = []
     self.L2signatureList  = []
@@ -72,10 +72,22 @@ class L2EFChain_mu(L2EFChainDef):
     if 'AFP' in self.L2InputTE:
       self.L2InputTE = self.L2InputTE.replace("AFP_C_","")
     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
-    
+      if "dRl1" in self.chainPart['addInfo']:
+        #the dRl1 acts on a list of L1 RoIs, so we need to treat each item in the list separately
+        #then recreate the list with proper thresholds
+        #would probably be easier to just use ['MU6','MU6'] in the menu, but this way it's consistent 
+        tmpL2InputTE = []
+        for l1Thr in self.L2InputTE:
+          l1Thr = l1Thr.replace("L1_","")
+          l1Thr = l1Thr.split("_")[0]
+          l1Thr = l1Thr[1:] if l1Thr.isdigit() else l1Thr 
+          tmpL2InputTE.append(l1Thr)
+        self.L2InputTE = tmpL2InputTE
+      else:
+        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
+      
     # --- used to configure hypos for FS muon chains
     self.allMuThrs=AllMuons
 
@@ -85,16 +97,19 @@ class L2EFChain_mu(L2EFChainDef):
     # --- when to run with ovlp removal ---
     self.ovlpRm = self.chainPart['overlapRemoval']
     self.asymDiMuonChain = asymDiMuonChain
+    self.asymMultiMuonChain = asymMultiMuonChain
 
     self.doOvlpRm = False
     if "nscan" in self.chainName or "bTau" in self.chainName :
       self.doOvlpRm = False
-    elif "ftkFS" in self.chainPart['FSinfo']:
+    elif "FTKFS" in self.chainPart['FSinfo']:
       self.setup_muXX_noL1FTK()
     elif (self.mult > 1) & ('wOvlpRm' in self.ovlpRm):
       self.doOvlpRm = True
     elif "bJpsi" in self.chainName or "bDimu" in self.chainName or "bUpsi" in self.chainName or self.thisIsBphysChain :
       self.doOvlpRm = False
+    elif self.asymMultiMuonChain and not self.chainPart['extra'] and not self.chainPart['reccalibInfo'] and not self.thisIsBphysChain:
+      self.doOvlpRm = True
     elif (self.asymDiMuonChain) and (self.mult > 1) and not self.chainPart['extra'] and not self.chainPart['reccalibInfo'] :
       self.doOvlpRm = True
     else: self.doOvlpRm = False
@@ -106,6 +121,7 @@ class L2EFChain_mu(L2EFChainDef):
           and not self.chainPart['hypoInfo'] \
           and not self.chainPart['reccalibInfo'] \
           and "cosmicEF" not in self.chainPart['addInfo'] \
+          and not "dRl1" in self.chainPart['addInfo'] \
           and not self.thisIsBphysChain :
       self.setup_muXX_ID()
     elif "muL2" in self.chainPart['reccalibInfo']:
@@ -116,8 +132,10 @@ class L2EFChain_mu(L2EFChainDef):
       self.setup_muXX_NS()
     elif "calotag" in self.chainPart['FSinfo']:
       self.setup_muXX_calotag_noL1()
-    elif self.chainPart['extra'] or "JpsimumuFS" in self.chainPart['FSinfo']:
+    elif "noL1" in self.chainPart['extra'] or "JpsimumuFS" in self.chainPart['FSinfo']:
       self.setup_muXX_noL1()
+    elif "dRl1" in self.chainPart['addInfo']:
+      self.setup_muXX_dR()
     elif self.chainPart['reccalibInfo'] == "idperf":
       self.setup_muXX_idperf()
     elif self.chainPart['reccalibInfo'] == "l2msonly"  and "cosmicEF" not in self.chainPart['addInfo'] :
@@ -263,7 +281,7 @@ class L2EFChain_mu(L2EFChainDef):
       log.error("Chain built with %s but so far only l2muonSA is supported." % (self.chainPart['L2SAAlg']))
       return False
     
-    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
     
     
 
@@ -341,12 +359,12 @@ class L2EFChain_mu(L2EFChainDef):
       EFinputTE = 'L2_mu_hypo2'
 
       # Run also FTK tracking
-    if self.chainPart['trkInfo'] == "ftk":
+    if "FTK" in self.chainPart['L2IDAlg']:
       from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
       
       [ftktrkfast, ftktrkprec] = TrigInDetFTKSequence("Muon","muonIso",sequenceFlavour=["PT"]).getSequence()    
       
-      self.L2sequenceList += [[['L2_mu_step2'],
+      self.L2sequenceList += [[['L2_mu_hypo2'],
                                ftktrkfast+ftktrkprec,
                                'L2_mu_step3']]
       from TrigMuonHypo.TrigMuonHypoConfig import MuisoHypoConfig
@@ -360,7 +378,7 @@ class L2EFChain_mu(L2EFChainDef):
                                'L2_mu_step4']]
       self.L2sequenceList += [[['L2_mu_step4'],
                                [theMuonFTKIsolationHypo],
-                               'L2_mu_hypo3']] 
+                               'L2_mu_hypo3']]
 
 
     self.EFsequenceList += [[[EFinputTE],
@@ -481,7 +499,7 @@ class L2EFChain_mu(L2EFChainDef):
       self.L2signatureList += [ [['L2_mu_step2']*self.mult] ]
       self.L2signatureList += [ [['L2_mu_hypo2']*self.mult] ]
      
-    if self.chainPart['trkInfo'] == 'ftk':
+    if "FTK" in self.chainPart['L2IDAlg']:
       self.L2signatureList += [ [['L2_mu_step3']*self.mult] ]
       self.L2signatureList += [ [['L2_mu_step4']*self.mult] ] 
       self.L2signatureList += [ [['L2_mu_hypo3']*self.mult] ] 
@@ -519,7 +537,7 @@ class L2EFChain_mu(L2EFChainDef):
       'EF_mu_step1': mergeRemovingOverlap('EF_EFIDInsideOut_', self.chainPartNameNoMult+'_'+self.L2InputTE),
       'EF_mu_step2': mergeRemovingOverlap('EF_SuperEF_',   self.chainPartNameNoMult+'_'+self.L2InputTE),
       }    
-    if self.chainPart['trkInfo'] == "ftk":
+    if "FTK" in self.chainPart['L2IDAlg']:
       self.TErenamingDict.update({'L2_mu_step3': mergeRemovingOverlap('EF_ftkfex_',self.chainPartNameNoMult+'_'+self.L2InputTE),
                                   'L2_mu_step4': mergeRemovingOverlap('EF_ftkiso_',self.chainPartNameNoMult+'_'+self.L2InputTE),
                                   'L2_mu_hypo3': mergeRemovingOverlap('EF_ftkhypo_',self.chainPartNameNoMult+'_'+self.L2InputTE),
@@ -649,7 +667,7 @@ class L2EFChain_mu(L2EFChainDef):
       log.error("Chain built with %s but so far only l2muonSA is supported." % (self.chainPart['L2SAAlg']))
       return False
 
-    [trkfast, trkprec, trkiso] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkfast, trkprec, trkiso] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
     
     id_alg_output = "TrigFastTrackFinder_Muon" 
     if "muComb" in self.chainPart['L2CBAlg']:
@@ -1012,7 +1030,7 @@ class L2EFChain_mu(L2EFChainDef):
       return False
     from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFExtrapolatorHypoConfig
     theTrigMuonEFExtrapolatorHypoConfig = TrigMuonEFExtrapolatorHypoConfig(EFRecoAlgName, EFExtrapolatorThresh)
-    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
     if "wOvlpRm" in self.chainPart['overlapRemoval']:
       from TrigMuonHypo.TrigEFMuonOverlapRemoverConfig import TrigEFMuonOverlapRemoverConfig
       theEFOvlpRmConfig = TrigEFMuonOverlapRemoverConfig('MuExtr','loose')
@@ -1089,27 +1107,31 @@ class L2EFChain_mu(L2EFChainDef):
 
     from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFExtrapolatorMultiHypoConfig, TrigMuonEFExtrapolatorHypoConfig
 
+    if "dRl1" in self.chainPart['addInfo']:
+      Nmuons=len(self.allMuThrs)-1
+    else:
+      Nmuons=len(self.allMuThrs)
     ##Use list of muon threshold in the chain to correctly configure the FS hypos
     
     if "JpsimumuFS" in self.chainPart['FSinfo']:
       theTrigMuonEFSA_FS_Hypo = TrigMuonEFExtrapolatorMultiHypoConfig('Muon','0GeV','0GeV')
       hypocut='0GeV_0GeV'    
     else:
-      if len(self.allMuThrs) == 0:
+      if Nmuons == 0:
         log.error("The list of allMuonThreshold is empty for a noL1 chain! It should never happen")
 
-      if len(self.allMuThrs) == 1:
+      if Nmuons == 1:
     	  theTrigMuonEFSA_FS_Hypo = TrigMuonEFExtrapolatorHypoConfig('Muon', '0GeV')
     	  hypocut = '0GeV'
 
-      elif len(self.allMuThrs) == 2:
+      elif Nmuons == 2:
     	  theTrigMuonEFSA_FS_Hypo = TrigMuonEFExtrapolatorMultiHypoConfig('Muon', '0GeV','0GeV')
     	  hypocut = '0GeV_0GeV'
 
-      elif len(self.allMuThrs) == 3:
+      elif Nmuons == 3:
     	  theTrigMuonEFSA_FS_Hypo = TrigMuonEFExtrapolatorMultiHypoConfig('Muon', '0GeV','0GeV','0GeV')
     	  hypocut = '0GeV_0GeV_0GeV'
-      elif len(self.allMuThrs) == 4:
+      elif Nmuons == 4:
          theTrigMuonEFSA_FS_Hypo = TrigMuonEFExtrapolatorMultiHypoConfig('Muon', '0GeV','0GeV','0GeV','0GeV')
          hypocut = '0GeV_0GeV_0GeV_0GeV'
       else:
@@ -1339,10 +1361,19 @@ class L2EFChain_mu(L2EFChainDef):
 
       }
 
+  #################################################################################################
+  #################################################################################################
 
+  def setup_muXX_dR(self):
+    
+    from TrigGenericAlgs.TrigGenericAlgsConfig import OverlapRemovalConfig
+    OverlapRemoval_algo = OverlapRemovalConfig('OvlRem', MinCentDist = 1)
+    
+    self.L2sequenceList += [[self.L2InputTE,
+                             [OverlapRemoval_algo],
+                             'L2_OvlRem_dRl1']]
 
-
-
+    self.L2signatureList += [ [['L2_OvlRem_dRl1']] ]
 
   #################################################################################################
   #################################################################################################
@@ -1360,7 +1391,7 @@ class L2EFChain_mu(L2EFChainDef):
     multiplicity = str(self.mult)
     hypocut = 'opposite'
     hypocutEF = multiplicity+"_"+threshold
-    seed = self.allMuThrs[0]
+    #seed = self.allMuThrs[0]
     theCTAlg = CfgGetter.getAlgorithm("TrigMuSuperEF_CTonly")
     from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonCaloTagHypoConfig
     theTrigMuonCT_FS_Hypo = TrigMuonCaloTagHypoConfig('MuonCT', threshold, int(multiplicity),  self.allMuThrs[0])
@@ -1376,7 +1407,7 @@ class L2EFChain_mu(L2EFChainDef):
     inputTEfromL2 = "placeHolderTE"
     ########### Sequence List ##############
     if "0eta010" in self.chainPart['etaRange'] or "0eta500" in self.chainPart["etaRange"]:
-      seed = '0eta0'
+      #seed = '0eta0'
       from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo
       from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFFSRoiMakerUnseededConfig, TrigMuonEFFSRoiMakerConfig
       if "0eta010" in self.chainPart['etaRange']:
@@ -1390,7 +1421,7 @@ class L2EFChain_mu(L2EFChainDef):
         return
       
       theEFRoIMakerCT = TrigMuonEFFSRoiMakerConfig("TrigMuonEFFSRoiMakerCT", RoISizeEta=0.1)
-      combinedMuonTE=inputTEfromL2[0]
+
       self.EFsequenceList += [["",
                               [PESA__DummyUnseededAllTEAlgo("EFDummyAlgo")],
                                'EF_CT_seed']]
@@ -1482,7 +1513,7 @@ class L2EFChain_mu(L2EFChainDef):
 
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
     if self.chainPart['isoInfo'] == "iloosems":
-      [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+      [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
     else:
       [trkfast, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig").getSequence()
 
@@ -2025,7 +2056,7 @@ class L2EFChain_mu(L2EFChainDef):
     theL2StandAloneHypo = MufastHypoConfig(L2AlgName, muFastThresh)
 
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
 
     if 'SuperEF' in self.chainPart['EFAlg']:
       theTrigMuSuperEF = CfgGetter.getAlgorithm("TrigMuSuperEF")
@@ -2141,7 +2172,7 @@ class L2EFChain_mu(L2EFChainDef):
     theL2StandAloneHypo = MufastHypoConfig(L2AlgName, muFastThresh)
     
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
-    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence()
+    [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence()
     
     theTrigMuSuperEF = CfgGetter.getAlgorithm("TrigMuSuperEF")
     EFRecoAlgName = "Muon"
@@ -2201,7 +2232,7 @@ class L2EFChain_mu(L2EFChainDef):
       'EF_mu_hypo1': mergeRemovingOverlap('EF_SuperEFhyp_',   idmulti+'_'+self.chainPartNameNoMult.replace(self.chainPart['specialStream'], '')+'_'+self.L2InputTE).replace('__', '_'),
       }
 
-    # OI this makes no sense , as we already cut on good tracks at L2, there is no rejection, skip it (at least in 2017)
+    # OI this part gives problem to EF 2TE algos; keep it for v6 only.
     from TriggerJobOpts.TriggerFlags import TriggerFlags
     if "_v6" in TriggerFlags.triggerMenuSetup():
       self.EFsequenceList += [[['EF_mu_hypo1'],
@@ -2219,9 +2250,6 @@ class L2EFChain_mu(L2EFChainDef):
     from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
     [trkfast, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig").getSequence()
 
-    from TrigmuRoI.TrigmuRoIConfig import TrigmuRoIConfig
-    Roimaker = TrigmuRoIConfig("TrigMuRoIMGonly")
-
     ########### EF algos  #################
     print self.chainPart['EFAlg']
     if 'SuperEF' in self.chainPart['EFAlg']:
@@ -2236,19 +2264,35 @@ class L2EFChain_mu(L2EFChainDef):
 
     from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFCombinerHypoConfig
     theTrigMuonEFCombinerHypoConfig = TrigMuonEFCombinerHypoConfig(EFRecoAlgName,EFCombinerThresh)
-    self.EFsequenceList += [[ '' , [Roimaker], 'EF_mu_step2a' ]]
-    self.EFsequenceList += [[ 'EF_mu_step2a' , trkfast+trkprec, 'EF_mu_step2b']]
+
+    # L1 seeded from RoiMaker (seed from L1Topo) or Muon L1 Trigger + HLT chains configuration
+    if "inTimeRoI" not in self.chainPart['addInfo']:
+      from TrigmuRoI.TrigmuRoIConfig import TrigmuRoIConfig
+      Roimaker = TrigmuRoIConfig("TrigMuRoIMGonly")
+      self.EFsequenceList += [[ '' , [Roimaker], 'EF_mu_step2a' ]]
+      self.EFsequenceList += [[ 'EF_mu_step2a' , trkfast+trkprec, 'EF_mu_step2b']]
+    else:
+      self.EFsequenceList += [[ self.L2InputTE , trkfast+trkprec, 'EF_mu_step2b']]
     self.EFsequenceList += [[ 'EF_mu_step2b' , [theEFAlg], 'EF_mu_step2']]
     self.EFsequenceList += [[ 'EF_mu_step2'  , [theTrigMuonEFCombinerHypoConfig], 'EF_mu_step3']]
-    self.EFsignatureList += [ [['EF_mu_step2a']] ]
+
+    if "inTimeRoI" not in self.chainPart['addInfo']:
+      self.EFsignatureList += [ [['EF_mu_step2a']] ]
     self.EFsignatureList += [ [['EF_mu_step2b']] ]
     self.EFsignatureList += [ [['EF_mu_step2']] ]
     self.EFsignatureList += [ [['EF_mu_step3']] ]
 
-    self.TErenamingDict = {
-      'EF_mu_step2a': mergeRemovingOverlap('EF_SuperEF_MGOnly_L1x',  self.L2InputTE ),
-      'EF_mu_step2b': mergeRemovingOverlap('EF_SuperEF_MGOnly_',  '2b' + self.L2InputTE ),
-      'EF_mu_step2':  mergeRemovingOverlap('EF_SuperEF_MGOnly',  self.chainPartNameNoMult),
-      'EF_mu_step3':  mergeRemovingOverlap('EF_SuperEFHypo_MGOnly',  self.chainPartNameNoMult)
+    if "inTimeRoI" not in self.chainPart['addInfo']:
+      self.TErenamingDict = {
+        'EF_mu_step2a': mergeRemovingOverlap('EF_SuperEF_MGOnly_L1x',  self.L2InputTE ),
+        'EF_mu_step2b': mergeRemovingOverlap('EF_SuperEF_MGOnly_',  '2b' + self.L2InputTE ),
+        'EF_mu_step2':  mergeRemovingOverlap('EF_SuperEF_MGOnly',  self.chainPartNameNoMult),
+        'EF_mu_step3':  mergeRemovingOverlap('EF_SuperEFHypo_MGOnly',  self.chainPartNameNoMult)
+      }
+    else:
+      self.TErenamingDict = {
+        'EF_mu_step2b': mergeRemovingOverlap('EF_SuperEF_MGOnly_inTimeRoI_',  '2b' + self.L2InputTE ),
+        'EF_mu_step2':  mergeRemovingOverlap('EF_SuperEF_MGOnly_inTimeRoI',  self.chainPartNameNoMult),
+        'EF_mu_step3':  mergeRemovingOverlap('EF_SuperEFHypo_MGOnly_inTimeRoI',  self.chainPartNameNoMult)
       }
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDefIdTest.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDefIdTest.py
index 172ee62cdb85cf362dd694cf5b13869d9a04f486..c090baffa1371a0687e3853c5c6e460015c71297 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDefIdTest.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDefIdTest.py
@@ -10,9 +10,7 @@ logging.getLogger().info("Importing %s",__name__)
 
 logMuonDef = logging.getLogger("TriggerMenu.muon.MuonDef")
 
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-import re
-from TriggerMenu.menu.HltConfig import *
+from TriggerMenu.menu.HltConfig import mergeRemovingOverlap,L2EFChainDef
 
 
 #-----------------------------------
@@ -388,7 +386,7 @@ class L2EFChain_mu(L2EFChainDef):
     theTrigEFIDInsideOutMerged_Muon     = TrigEFIDSequence("Muon","muon","InsideOutMerged")
     theTrigEFIDInsideOut_Muon = TrigEFIDSequence("Muon","muon")          # ---> this is Run1 tracking - keep it here
     #theTrigEFIDInsideOut_Muon_MergedDP = TrigEFIDSequence("Muon","muon","DataPrep")
-    theTrigEFIDOutsideInTRTOnly_Muon = TrigEFIDSequence("Muon","muon","TRTOnly")
+    #theTrigEFIDOutsideInTRTOnly_Muon = TrigEFIDSequence("Muon","muon","TRTOnly")
 
     from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFExtrapolatorHypoConfig
     theTrigMuonEFExtrapolatorHypoConfig = TrigMuonEFExtrapolatorHypoConfig(EFRecoAlgName, EFExtrapolatorThresh)
@@ -566,7 +564,7 @@ class L2EFChain_mu(L2EFChainDef):
     from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_Muon
     theTrigFastTrackFinder_Muon = TrigFastTrackFinder_Muon()
     theTrigEFIDInsideOutMerged_Muon = TrigEFIDSequence("Muon","muon","InsideOutMerged").getSequence()
-    theTrigEFIDInsideOut_Muon = TrigEFIDSequence("Muon","muon","InsideOut").getSequence()
+    #theTrigEFIDInsideOut_Muon = TrigEFIDSequence("Muon","muon","InsideOut").getSequence() for the fallback on line 605
 
     from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFRoiAggregatorConfig
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonSliceFlags.py
index f921110469b6bc310239816039c7250f70178306..47bc256ee358e138147a4074d69e2a6dec413c23 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonSliceFlags.py
@@ -2,8 +2,8 @@
 
 """ Muon slice specific flags  """
 
-from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties         import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'T. Bold, B.Demirkoz'
 __version__="$Revision: 1.46 $"
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/generateMuonChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/generateMuonChainDefs.py
index 062400d76f9a3ace8cd44e62d70fe80820137cc6..640db836a379671e2b2929c19bee11b6f9c34ec7 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/muon/generateMuonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/generateMuonChainDefs.py
@@ -7,9 +7,12 @@ __author__  = 'M.Woudstra, Y.Nakahama, K.Nagano'
 __doc__="Definition of muon chains as used v4- menu" 
 
 from AthenaCommon.Logging import logging
-logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger( 'TriggerMenu.muon.generateMuonChainDefs.py' )
+log.info("Importing %s",__name__)
 
 from TriggerMenu.muon.MuonDef import L2EFChain_mu as L2EFChain_mu
+import traceback
+
 try:
     from TriggerMenu.muon.MuonDefIdTest import L2EFChain_mu as L2EFChain_mu_IdTest
 except:
@@ -17,7 +20,7 @@ except:
     log.info(traceback.print_exc())
 
 
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
 
 ###########################################################################
 ###########################################################################
@@ -49,6 +52,10 @@ def generateChainDefs(chainDict, thisIsBphysChain=False):
     if (len(listOfChainDicts) > 1): asymDiMuonChain = True
     else: asymDiMuonChain = False
 
+    asymMultiMuonChain = False
+    if(len(listOfChainDicts) > 1 and "noL1" not in chainDict["chainName"] and sum(map(int, [subChainDict["chainParts"]["multiplicity"] for subChainDict in listOfChainDicts])) > 1):
+        asymMultiMuonChain = True
+
     modifyNscanInputTE = False
     modifyCalotagInputTE = False
 
@@ -62,7 +69,7 @@ def generateChainDefs(chainDict, thisIsBphysChain=False):
             else:
                 AllMuons=[]
 
-            Muon = L2EFChain_mu(subChainDict, asymDiMuonChain, AllMuons, thisIsBphysChain)
+            Muon = L2EFChain_mu(subChainDict, asymDiMuonChain, asymMultiMuonChain, AllMuons, thisIsBphysChain)
 
         listOfChainDefs += [Muon.generateHLTChainDef()]
         
@@ -117,7 +124,7 @@ def _modifyTEinChainDef(theChainDef,chainDict):
 
 def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True):
 
-    maxL2SignatureIndex = -1
+    #maxL2SignatureIndex = -1
     # for signatureIndex,signature in enumerate(theChainDef.signatureList):
     #     if signature['listOfTriggerElements'][0][0:2] == "L2":
     #         maxL2SignatureIndex = max(maxL2SignatureIndex,signatureIndex)
@@ -160,10 +167,6 @@ def _AsymmChainConfig(theChainDef,chainDict):
     inputTEsL2 = theChainDef.signatureList[maxL2SignatureIndex]['listOfTriggerElements'] 
     inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements']
 
-    L2ChainName = "L2_" + chainDict['chainName']
-    EFChainName = "EF_" + chainDict['chainName']
-    HLTChainName = "HLT_" + chainDict['chainName']   
-
     idmultiArr = []
     listOfChainDicts = splitChainDict(chainDict)
     totalmulti = 0
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py
index 98baa1ef530cc725120090e0653cc0ce25c1eee8..da2dfc5d199c2da84160cb329ff3a31f4211a7a5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py
@@ -10,7 +10,6 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger(__name__)
 
-from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigVertexxAODCnv 
 from InDetTrigRecExample.EFInDetConfig import TrigEFIDInsideOut_Tau
 from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_tau, TrigCaloClusterMaker_topo
 from TrigFTK_RecAlgs.TrigFTK_RecAlgs_Config import TrigFTK_VxPrimary_EF
@@ -29,7 +28,8 @@ from TrigTauRec.TrigTauRecConfig import (TrigTauRecMerged_Tau2012,
                                          TrigTauRecMerged_TauCaloOnly,
                                          TrigTauRecMerged_TauFTK,
                                          TrigTauRecMerged_TauPrecision,
-                                         TrigTauRecMerged_TauPreselection)
+                                         TrigTauRecMerged_TauPreselection,
+                                         TrigTauRecMerged_TauPreselectionMva)
 from TrigTauRec.TrigTauRecCosmicsConfig import TrigTauRecCosmics_Tau2012
 from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap
 
@@ -165,13 +165,13 @@ class L2EFChain_tau(L2EFChainDef):
         elif preselection == 'FTKRefit':
             [trkfast, trkprec[:]] = TrigInDetFTKSequence("Tau","tau",sequenceFlavour=["refit","PT"]).getSequence()
         elif preselection == 'FTKNoPrec':
-            [trkfast] = TrigInDetFTKSequence("Tau","tau","").getSequence()
+            [trkfast] = TrigInDetFTKSequence("Tau","tau",sequenceFlavour=[""]).getSequence()
             [trkprec[:]] = TrigInDetFTKSequence("Tau","tau",sequenceFlavour=["refit"]).getSequence()
         else:
             [trkfast, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig").getSequence()
         # Use cosmic-specific tracking algorithm
         if selection == 'cosmic':
-            [trkfast] = TrigInDetSequence("Cosmics", "cosmics", "IDTrig", "FTF").getSequence()
+            [trkfast] = TrigInDetSequence("Cosmics", "cosmics", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
 
         # Run fast-tracking
         self.EFsequenceList += [[[ self.currentItem ],
@@ -199,7 +199,6 @@ class L2EFChain_tau(L2EFChainDef):
 #        from TrigInDetConf.TrigInDetSequence import vertexXAODCnvNeeded 
 #        if vertexXAODCnvNeeded():
 #           theTrigFTK_VxPrimary_EF.vxContainerName = 'PrimVxFTK'
-#           theTrigFTK_VxPrimary_EF.getVertexContainer = False
 #           theInDet__TrigVertexxAODCnv = InDet__TrigVertexxAODCnv(name="FTKTauVtxConversion")
 #           theInDet__TrigVertexxAODCnv.InputVxContainerKey = 'PrimVxFTK'
 #           theInDet__TrigVertexxAODCnv.OutputVxContainerKey = 'PrimVertexFTK'
@@ -207,15 +206,17 @@ class L2EFChain_tau(L2EFChainDef):
 #           self.EFsequenceList += [[[ self.currentItem ],vertexAlgorithms,self.continueChain('L2', 'vertex')]]          
 #        else:
         theTrigFTK_VxPrimary_EF.vertexContainerName= 'PrimVertexFTK'
-        theTrigFTK_VxPrimary_EF.getVertexContainer = True
         vertexAlgorithms = [theTrigFTK_VxPrimary_EF]
         self.EFsequenceList += [[[ self.currentItem ], vertexAlgorithms, self.continueChain('L2', 'vertex')]]
         
     #create the TrigTauRec preselection sequence       
     def addTrigTauRecTauPreselectionSequence(self,threshold,selection,preselection,idperf):              
         # Run TrigTauRec to store pre-selected taus
-        recPreselection = TrigTauRecMerged_TauPreselection()
-
+        if 'mva' in preselection:
+            recPreselection = TrigTauRecMerged_TauPreselectionMva()
+        else:
+            recPreselection = TrigTauRecMerged_TauPreselection()
+            
         self.EFsequenceList += [[[ self.currentItem ],
                                  [recPreselection],
                                  self.continueChain('L2', 'storepre')]]
@@ -233,7 +234,7 @@ class L2EFChain_tau(L2EFChainDef):
     def addTwoStepTrackingSequence(self,threshold,selection,preselection,idperf,trkprec): 
         # Get the necessary fexes
         # use [:] so the list trkprec is modified by this function
-        [trkcore, trkiso, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence()
+        [trkcore, trkiso, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence()
 
         # Get the HLTTrackTauHypo_rejectNoTracks
         tauRejectEmpty = HLTTrackTauHypo_rejectNoTracks("TauRejectEmpty")
@@ -294,8 +295,6 @@ class L2EFChain_tau(L2EFChainDef):
     def setup_tauChain(self):
 
         threshold   = self.chainPart['threshold']
-        calibration = self.chainPart['calib']
-        recoAlg     = self.chainPart['recoAlg'] 
         selection   = self.chainPart['selection']
         preselection= self.chainPart['preselection']
         idperf      = "idperf" in self.chainPart['trkInfo']
@@ -305,13 +304,13 @@ class L2EFChain_tau(L2EFChainDef):
         # Strategies which need calorimeter pre-selection
         needsCaloPre  = ['calo', 'ptonly', 'mvonly', 'caloonly',
                          'track', 'trackonly', 'tracktwo',
-                         'trackcalo', 'tracktwocalo','tracktwo2015']
+                         'trackcalo', 'tracktwocalo','tracktwo2015', 'tracktwomva']
         # Strategies which need fast-track finding
-        needsTrackTwoPre = ['tracktwo', 'tracktwoonly', 'tracktwocalo','tracktwo2015']
+        needsTrackTwoPre = ['tracktwo', 'tracktwoonly', 'tracktwocalo','tracktwo2015', 'tracktwomva']
         needsTrackPre    = ['track', 'trackonly', 'trackcalo', 'FTK', 'FTKRefit', 'FTKNoPrec']
         # Strategies which need Run-II final hypo
         needsRun2Hypo = ['calo', 'ptonly', 'mvonly', 'caloonly',
-                         'trackonly', 'track', 'tracktwo', 'tracktwocalo', 'trackcalo', 'FTK', 'FTKRefit', 'FTKNoPrec', 'tracktwo2015']
+                         'trackonly', 'track', 'tracktwo', 'tracktwocalo', 'trackcalo', 'FTK', 'FTKRefit', 'FTKNoPrec', 'tracktwo2015', 'tracktwomva']
         fastTrackingUsed = needsTrackPre + needsTrackTwoPre
         
         #Set the default values
@@ -343,12 +342,12 @@ class L2EFChain_tau(L2EFChainDef):
             # Two step fast-tracking
             if preselection in needsTrackTwoPre:
                 self.addTwoStepTrackingSequence(threshold,selection,preselection,idperf, trkprec)
-                if preselection != 'tracktwo':
-                    self.addTwoStepTrackingSelectionSequence(threshold,selection,preselection,idperf)
+                if preselection in ('tracktwo', 'tracktwomva'):
                     self.addTrigTauRecTauPreselectionSequence(threshold,selection,preselection,idperf)
+                    self.addTwoStepTrackingSelectionSequence(threshold,selection,preselection,idperf)
                 else:
-                    self.addTrigTauRecTauPreselectionSequence(threshold,selection,preselection,idperf)
                     self.addTwoStepTrackingSelectionSequence(threshold,selection,preselection,idperf)
+                    self.addTrigTauRecTauPreselectionSequence(threshold,selection,preselection,idperf)
             # One step fast-tracking
             if preselection in needsTrackPre:
                 self.addTrackingSequence(threshold,selection,preselection,idperf,trkprec)
@@ -382,7 +381,7 @@ class L2EFChain_tau(L2EFChainDef):
                                      self.continueChain('EF', 'tr')]]
 
             # TrigTauRec and Hypo (no BDT)
-            if selection == 'kaonpi1' or selection == 'kaonpi2' or selection == 'dipion1' or selection=='dipion1loose' or selection == 'dipion2' or selection == 'dikaon' or selection == 'dikaontight' or selection == 'dikaonmass' or selection == 'dikaonmasstight' or selection == 'singlepion' or selection == 'singlepiontight':
+            if selection == 'kaonpi1' or selection == 'kaonpi2' or selection == 'dipion1' or selection=='dipion1loose' or selection == 'dipion2' or selection == 'dipion3' or selection == 'dikaon' or selection == 'dikaontight' or selection == 'dikaonmass' or selection == 'dikaonmasstight' or selection == 'singlepion' or selection == 'singlepiontight':
                 self.EFsequenceList += [[[ self.currentItem ],
                                          [recmerged_2012, theEFHypo],
                                          self.continueChain('EF', 'effinal')]]                
@@ -396,8 +395,6 @@ class L2EFChain_tau(L2EFChainDef):
     def setup_tauChainRunOne(self):
         
         threshold   = self.chainPart['threshold']
-        calibration = self.chainPart['calib']
-        recoAlg     = self.chainPart['recoAlg']
         selection   = self.chainPart['selection']
         preselection= self.chainPart['preselection']
         idperf      = "idperf" in self.chainPart['trkInfo']
@@ -474,8 +471,6 @@ class L2EFChain_tau(L2EFChainDef):
     def setup_tauChainTwoStep(self):
 
         threshold   = self.chainPart['threshold']
-        calibration = self.chainPart['calib']
-        recoAlg     = self.chainPart['recoAlg'] 
         selection   = self.chainPart['selection']
         preselection= self.chainPart['preselection']
         idperf      = "idperf" in self.chainPart['trkInfo']
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDefIdTest.py b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDefIdTest.py
index a7254eecdb42b70031e8935be586108c9ac43474..4f035879bb7379ae088e3fb67b858e021f427408 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDefIdTest.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDefIdTest.py
@@ -121,8 +121,6 @@ class L2EFChain_tau(L2EFChainDef):
     def setup_tauChain(self):
 
         threshold   = self.chainPart['threshold']
-        calibration = self.chainPart['calib']
-        recoAlg     = self.chainPart['recoAlg'] 
         selection   = self.chainPart['selection']
         preselection= self.chainPart['preselection']
         idperf      = "idperf" in self.chainPart['trkInfo']
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauHypoProvider.py b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauHypoProvider.py
index f9834da4322afb4d131e8a1a1448e39e7bff50e6..7edfb3490508973aaca5181bf91e32795db24681 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauHypoProvider.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauHypoProvider.py
@@ -68,7 +68,7 @@ class TauHypoProvider:
                         from TrigTauHypo.TrigTauHypoConfig2012 import EFTauMVHypo_tauNoCut
                         currentHypo = EFTauMVHypo_tauNoCut(currentHypoKey.replace(threshold, ''))
 
-                    elif criteria=='dikaon' or criteria=='dikaontight' or criteria=='dikaonmass' or criteria=='dikaonmasstight' or criteria=='kaonpi1' or criteria=='kaonpi2' or criteria=='dipion1' or criteria=='dipion1loose' or criteria=='dipion2':
+                    elif criteria=='dikaon' or criteria=='dikaontight' or criteria=='dikaonmass' or criteria=='dikaonmasstight' or criteria=='kaonpi1' or criteria=='kaonpi2' or criteria=='dipion1' or criteria=='dipion1loose' or criteria=='dipion2' or criteria=='dipion3':
                         from TrigTauHypo.TrigTauHypoConfig2012 import EFTauDiKaonHypo
                         theVars = ['massTrkSysMin', 'massTrkSysMax', 'massTrkSysKaonMin', 'massTrkSysKaonMax', 'massTrkSysKaonPiMin', 'massTrkSysKaonPiMax', 'targetMassTrkSysKaonPi', 'leadTrkPtMin','EtCalibMin','EMPOverTrkSysPMax']
                         theThresh = self.thresholdsEF_dikaon[(criteria, int(threshold))]
@@ -105,7 +105,7 @@ class TauHypoProvider:
                         theThresh = self.thresholdsEF[(criteria, int(threshold))]
                         currentHypo = EFTauMVHypo(currentHypoKey, theVars, theThresh)
 
-        if strategy == 'calo' or strategy =='ptonly' or strategy == 'mvonly' or strategy == 'caloonly' or strategy == 'track' or strategy == 'trackonly' or strategy == 'tracktwo' or strategy == 'trackcalo' or strategy == 'tracktwocalo' or strategy == 'tracktwo2015' or strategy == 'FTK' or strategy == 'FTKRefit' or strategy == 'FTKNoPrec':
+        if strategy == 'calo' or strategy =='ptonly' or strategy == 'mvonly' or strategy == 'caloonly' or strategy == 'track' or strategy == 'trackonly' or strategy == 'tracktwo' or strategy == 'trackcalo' or strategy == 'tracktwocalo' or strategy == 'tracktwo2015' or strategy == 'FTK' or strategy == 'FTKRefit' or strategy == 'FTKNoPrec' or strategy == 'tracktwomva':
 
             # Simple implementation of 2015 pre-selection
             currentHypoKey = 'l2'+part+'_tau'+threshold+'_'+criteria+'_'+strategy
@@ -155,7 +155,7 @@ class TauHypoProvider:
                     theThresh = [0,3,1,0.*self.GeV,-1111,0]
                     currentHypo = EFTauMVHypo(currentHypoKey, theVars, theThresh)
                 else:
-                    if strategy != 'tracktwo' and strategy != 'FTK' and strategy != 'FTKRefit' and strategy != 'FTKNoPrec':
+                    if strategy != 'tracktwo' and strategy != 'FTK' and strategy != 'FTKRefit' and strategy != 'FTKNoPrec' and strategy != 'tracktwomva':
                         theVars = ['LowerPtCut','LowerTrackPtCut']
                         theThresh = [int(threshold)*self.GeV,1.*self.GeV]
                         currentHypo = HLTTrackTauHypo(currentHypoKey, theVars, theThresh)
@@ -336,6 +336,7 @@ class TauHypoProvider:
         ('medium1HighptH'):[160.0*GeV,330.0*GeV,410.0*GeV]   
         }
 
+# 'massTrkSysMin', 'massTrkSysMax', 'massTrkSysKaonMin', 'massTrkSysKaonMax', 'massTrkSysKaonPiMin', 'massTrkSysKaonPiMax', 'targetMassTrkSysKaonPi', 'leadTrkPtMin','EtCalibMin','EMPOverTrkSysPMax'
     thresholdsEF_dikaon = {
         ('dikaon', 25):          [0.2*GeV, 0.45*GeV,    0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   15.0*GeV, 25.0*GeV, 1.5],
         ('dikaon', 35):          [0.2*GeV, 0.45*GeV,    0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 35.0*GeV, 1.5], 
@@ -354,7 +355,8 @@ class TauHypoProvider:
         ('dipion1loose', 25):    [0.475*GeV, 1.075*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 25.0*GeV, 1.5],
         ('dipion1loose', 35):    [0.475*GeV, 1.075*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 35.0*GeV, 1.5],
         ('dipion2', 25):         [0.460*GeV, 0.538*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   15.0*GeV, 25.0*GeV, 1.0],
-        ('dipion2', 35):         [0.460*GeV, 0.538*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 35.0*GeV, 1.0]
+        ('dipion2', 35):         [0.460*GeV, 0.538*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 35.0*GeV, 1.0],
+        ('dipion3', 25):         [0.279*GeV, 0.648*GeV, 0.0*GeV, 1000.0*GeV,  0.0*GeV, 1000.0*GeV, 0.0*GeV,   25.0*GeV, 25.0*GeV, 2.2], #ATR-16600
         }
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauSliceFlags.py
index 32e809dfc4b065523bb0e8ec1e85d2a5fa441e51..164db119f1bfe6cc0dfc4d48cfc1e46bb75a12d2 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauSliceFlags.py
@@ -2,11 +2,8 @@
 
 """ Tau slice specific flags  """
 
-
- 
-from AthenaCommon.Logging import logging
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = ''
 __version__="$Revision: 1.34 $"
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/test/TestDef.py b/Trigger/TriggerCommon/TriggerMenu/python/test/TestDef.py
index 4cd0ceb786a722e62ca1ac1cb47cf3f465f67245..73dcca1893061389116a996277c7895316c43e6d 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/test/TestDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/test/TestDef.py
@@ -9,12 +9,7 @@ from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger( 'TriggerMenu.test.TestDef' )
 
-from TriggerMenu.menu.HltConfig import *
-
-from AthenaCommon.Include import include
-from AthenaCommon.SystemOfUnits import GeV
-from TriggerJobOpts.TriggerFlags  import TriggerFlags
-
+from TriggerMenu.menu.HltConfig import L2EFChainDef,mergeRemovingOverlap
 
 ###################################################################################
 
@@ -28,9 +23,7 @@ def getInputTEfromL1Item(item):
 class L2EFChain_test(L2EFChainDef):
 
     def __init__(self, chainDict):
-        mlog = logging.getLogger( 'TestDef.py:L2EFChain_TestTemplate' )
-
-        self.L2sequenceList   = []
+ 
         self.EFsequenceList   = []
         self.L2signatureList  = []
         self.EFsignatureList  = []
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/test/TestSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/test/TestSliceFlags.py
index a85bf29d4c7b34e8e02c696af862b02ea18bdaf0..0db18ea6f09e5af665af1d4d3563599344577f17 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/test/TestSliceFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/test/TestSliceFlags.py
@@ -2,10 +2,8 @@
 
 """ MinBias slice specific flags  """
 
-from AthenaCommon.Logging import logging
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
-from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
-from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
 
 __author__  = 'M. Backes'
 __version__=""
@@ -21,9 +19,6 @@ class signatures(JobProperty):
     StoredValue   = [
         ]
 
-
-    
-    
 _flags.append(signatures)
 
 # create container
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/test/generateTestChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/test/generateTestChainDefs.py
index 92b0b9b0a3449108288aeaadcd363efb04b1c610..a7e0df44203721c51a111c8d9a67ad9cdf5c9d67 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/test/generateTestChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/test/generateTestChainDefs.py
@@ -11,17 +11,16 @@ logging.getLogger().info("Importing %s",__name__)
 
 from TriggerMenu.test.TestDef import L2EFChain_test as L2EFChain_test
 
-from TriggerMenu.menu.MenuUtils import *
+from TriggerMenu.menu.MenuUtils import splitChainDict
 TestChains = []
 
 ##########################################################################################
 ##########################################################################################
 
 def generateChainDefs(chainDict):
-    chainParts = chainDict['chainParts']
-    
+   
     listOfChainDicts = splitChainDict(chainDict)
-    listOfChainDefs = []
+
     subChainDict = listOfChainDicts[0] # take only the first
     TestChain = L2EFChain_test(subChainDict)
             
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/addPS.py b/Trigger/TriggerCommon/TriggerMenu/scripts/addPS.py
index 5a56b64f3856c9d0c57c3f6bc06a1ddaa154b099..fcc53b52e178db7dfea6fd39350b5e8308458cf8 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/addPS.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/addPS.py
@@ -4,7 +4,6 @@
 import os, sys
 import xml.etree.cElementTree as ET
 import logging
-import math
 
 logging.basicConfig(level=logging.INFO,
                     format='%(asctime)s %(levelname)s %(message)s')
@@ -148,7 +147,7 @@ class PSRule:
             if target_lumi > self.scd_min_lumi:
                 #make this completely independent
                 #get PS at snd_min_lumi
-                scd_ps = self.scd_min_lumi/current_lumi*self.factor
+                #scd_ps = self.scd_min_lumi/current_lumi*self.factor
                 if (self.scd_factor==0):
                     ret_prescale = self.scd_value
                 else:
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1Menu.sh b/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1Menu.sh
new file mode 100755
index 0000000000000000000000000000000000000000..bc9801acf6184728f769ba543db8566372d35a2f
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1Menu.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+generateL1Menu.py l1xml_unit_test_v7
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1items.py b/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1items.py
index f335bb36aae5b301ee7097c4a5e3826663e92d56..2e9f7682b0d1d207e45a4e4bd8238306018d14b0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1items.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/checkL1items.py
@@ -9,7 +9,7 @@
 """
 
 import importlib
-import sys, re
+import sys
 
 tag = "pp_v6"
 if len(sys.argv) > 1:
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/checkTigherThanPrimary.py b/Trigger/TriggerCommon/TriggerMenu/scripts/checkTigherThanPrimary.py
index c48403285ddf296b129e2036b70f3622993abe92..53f3db3bc7a897f8720888ec41b668c5d2e418e3 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/checkTigherThanPrimary.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/checkTigherThanPrimary.py
@@ -9,7 +9,7 @@
 """
 
 import importlib
-import sys, re, os
+import sys, re
 from TriggerJobOpts.TriggerFlags					import TriggerFlags
 
 def_maxlumi = 20000
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/compareHLTXML.py b/Trigger/TriggerCommon/TriggerMenu/scripts/compareHLTXML.py
index 87276edc3b1b9c4b755f11a1b270cccb47464ade..26c4e887f27f8addf192c0e005b189dd4ed88e5b 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/compareHLTXML.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/compareHLTXML.py
@@ -8,7 +8,6 @@
 
 import xml.etree.cElementTree as ET
 import sys
-import string
 
 class Ddict(dict):
     def __init__(self, default=None):
@@ -190,7 +189,10 @@ def chain_input_comparisons(chain_input_info):
             if len(mismatch) > 0:
                 diff_input_info[j] = [chain_input_info[i][j] , chain_input_info[k][j], "Differences in TE elements with index: %s" % mismatch]
                 found_input_diff = True
-            
+
+    if found_input_diff:
+        print "Found a diff in the inputs"
+    
     for i in diff_input_info.keys():
         print "*** Chain: %s %s" % (i, diff_input_info[i][2])
         print "***  from ==>"
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/compareLVL1XML.py b/Trigger/TriggerCommon/TriggerMenu/scripts/compareLVL1XML.py
index 597a4d81526c2b122c45af1869989c6c911108cb..58efb2b849282e7bf9712ab665364ef031f92900 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/compareLVL1XML.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/compareLVL1XML.py
@@ -4,9 +4,7 @@
 
 import xml.etree.cElementTree as ET
 import sys
-import string
-import ROOT
-from ROOT import *
+from ROOT import TH1F,TFile
 
 output_file = TFile("L1Summary.root","recreate")
 allItems = TH1F("AllItems", "AllItems", 512, 0, 512)
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/compareRuleBookXML.py b/Trigger/TriggerCommon/TriggerMenu/scripts/compareRuleBookXML.py
index 0857f81cf2cba32707dd034b9830200daf1f80ea..f7cbfb53a9ca10f98b8b376b83b2a9235e115169 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/compareRuleBookXML.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/compareRuleBookXML.py
@@ -79,7 +79,6 @@ def readPsFile(fname):
             
         return items
 
-    import xml.dom.minidom as dom
     import xml.etree.cElementTree as et
     
     xdoc   = et.parse(fname)
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/compare_rulebook_xml.py b/Trigger/TriggerCommon/TriggerMenu/scripts/compare_rulebook_xml.py
index 8d356c869e6e594458940e778cb1decf807fc9d1..ba5bf21cb104423352224c525e2051647f988fdf 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/compare_rulebook_xml.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/compare_rulebook_xml.py
@@ -3,9 +3,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import sys
-import os
 import commands
-import time
 import xml.etree.cElementTree as ET
 
 
@@ -42,7 +40,7 @@ class TriggerRule:
         input_list = line.strip(' \n').split(';')
 
         if len(input_list) < 3:
-            log.warning('Skip incorrectly formatted input line: %s' % line)
+            print "Skip incorrectly formatted input line:", line
             return False
 
         self.trigger_name = input_list[0].strip()
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/dumpMenu.py b/Trigger/TriggerCommon/TriggerMenu/scripts/dumpMenu.py
index 018b711ce61530d8bf3fd97da90371c23c367fac..e6e929da04c5ecf0fac4deadc8fe91bf69166a8f 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/dumpMenu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/dumpMenu.py
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import os, sys
 
 ## from AthenaCommon.AppMgr import ToolSvc
 ## from AthenaCommon.Include import include
@@ -10,20 +9,19 @@ import os, sys
 
 from TriggerMenu.menu.Lvl1 import Lvl1
 from TriggerMenu.menu.Lvl1Flags import Lvl1Flags
-from TriggerMenu.menu.TriggerPythonConfig import *
+from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 from AthenaCommon.Logging import logging
 
-from TriggerMenu.bjet.BjetSliceFlags import *
-from TriggerMenu.bphysics.BphysicsSliceFlags import *
-from TriggerMenu.menu.CombinedSliceFlags import *
-from TriggerMenu.menu.CommonSliceFlags import *
-from TriggerMenu.egamma.EgammaSliceFlags import *
-from TriggerMenu.jet.JetSliceFlags import *
-from TriggerMenu.met.METSliceFlags import *
-from TriggerMenu.minbias.MinBiasSliceFlags import *
-from TriggerMenu.muon.MuonSliceFlags import *
-from TriggerMenu.tau.TauSliceFlags import *
+from TriggerMenu.bjet.BjetSliceFlags import BjetSliceFlags
+from TriggerMenu.bphysics.BphysicsSliceFlags import BphysicsSliceFlags
+from TriggerMenu.menu.CombinedSliceFlags import CombinedSliceFlags
+from TriggerMenu.egamma.EgammaSliceFlags import EgammaSliceFlags
+from TriggerMenu.jet.JetSliceFlags import JetSliceFlags
+from TriggerMenu.met.METSliceFlags import METSliceFlags
+from TriggerMenu.minbias.MinBiasSliceFlags import MinBiasSliceFlags
+from TriggerMenu.muon.MuonSliceFlags import MuonSliceFlags
+from TriggerMenu.tau.TauSliceFlags import TauSliceFlags
 
 l1thresholds_in_1e31 = [
     'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU40',
@@ -176,6 +174,8 @@ def print2(m, offset=''):
 
 def printSignatures(slice):
     print2('TriggerFlags.%s.signatures = [' % slice, offset)
+    names = []
+    sigs = []
     exec 'sigs = %sFlags.signatures.allowedValues.allowedList' % slice
     exec 'names = %sFlags.signatures.StoredValue' % slice
     for name in names:
@@ -197,6 +197,7 @@ def printSignatures(slice):
 
 def printL1Thresholds():
     print2('Lvl1Flags.thresholds = [', offset)
+    thrs = []
     exec 'thrs = Lvl1Flags.thresholds.allowedValues.allowedList'
     str = ''
     for i, thr in enumerate(thrs):
@@ -213,6 +214,7 @@ def printL1Thresholds():
     
 def printL1Items():
     print2('Lvl1Flags.items = [', offset)
+    items = []
     exec 'items = Lvl1Flags.items.allowedValues.allowedList'
     str = ''
     for i, item in enumerate(items):
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/dumpXMLInfo_RuleBook.py b/Trigger/TriggerCommon/TriggerMenu/scripts/dumpXMLInfo_RuleBook.py
index f32a2a21ac9c43eb0c0b5eadbc3e3a8775b5c399..76bfe6adfbb07bb201318ef81c9f871abc207b92 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/dumpXMLInfo_RuleBook.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/dumpXMLInfo_RuleBook.py
@@ -4,7 +4,6 @@
 
 import xml.etree.cElementTree as ET
 import sys
-import string
 
 menu_name = []
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_ES.py b/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_ES.py
index 53ad41c5942009c1aca0cf8d48831ad4119af364..4dcaa3e170525bc5381883e98b2f17d760c5bfc2 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_ES.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_ES.py
@@ -4,11 +4,8 @@
 
 import sys
 import os
-import commands
-import time
 import xml.etree.cElementTree as ET
 
-
 #-----------------------------------------------------------------------------
 # Create and configure option parser
 #
@@ -226,15 +223,15 @@ def Calculate_ES_Prescale(chain, PS, PT):
 
     if chain in read_bw.keys() :
     
-        rate = read_rates[chain][0]
+        #rate = read_rates[chain][0]
         cor_rate = corrected_rate[chain][0]
-        PT_contribution = rate - cor_rate
+        #PT_contribution = rate - cor_rate
         
         target_rate = float(read_bw_file(options.bw_file)[chain])
         
         EF_Chain = chain
         EF_Prescale = read_rates[EF_Chain][1]
-        EF_Rate = read_rates[EF_Chain][0]
+        #EF_Rate = read_rates[EF_Chain][0]
         
         L2_Chain = read_rates[EF_Chain][2]
         L2_Prescale = read_rates[L2_Chain][1]
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_cooking.py b/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_cooking.py
index ad8cdbb5c6526a8ab5da307f8bef1b0d565c0cf1..c4f45d93814b5dfc55924eded65bbcdbc93b699e 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_cooking.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/fineTune_cooking.py
@@ -4,11 +4,8 @@
 
 import sys
 import os
-import commands
-import time
 import xml.etree.cElementTree as ET
 
-
 #-----------------------------------------------------------------------------
 # Create and configure option parser
 #
@@ -283,22 +280,22 @@ def Calculate_BW_Prescale(PS, chain, lumiP):
         
                     target_rate = float(read_bw_prescale[EF_chain])
 
-                    rate = read_rates[chain][0]
+                    #rate = read_rates[chain][0]
                     cor_rate = corrected_rate[chain][0]
-                    PT_contribution = rate - cor_rate
+                    #PT_contribution = rate - cor_rate
         
                     EF_Chain = EF_chain
                     EF_Prescale = read_rates[EF_Chain][1]
-                    EF_Rate = read_rates[EF_Chain][0]
+                    #EF_Rate = read_rates[EF_Chain][0]
                     
                     L2_Chain = read_rates[EF_Chain][2]
                     L2_Prescale = read_rates[L2_Chain][1]
-                    L2_Rate = read_rates[L2_Chain][0]
-                    L2_Corrected_Rate = corrected_rate[L2_Chain][0]
+                    #L2_Rate = read_rates[L2_Chain][0]
+                    #L2_Corrected_Rate = corrected_rate[L2_Chain][0]
                     
                     L1_Chain = read_rates[L2_Chain][2]
                     L1_Prescale = read_rates[L1_Chain][1]
-                    L1_Rate = read_rates[L1_Chain][0]
+                    #L1_Rate = read_rates[L1_Chain][0]
                                         
                     total_rate =  L1_Prescale* L2_Prescale* EF_Prescale* cor_rate
                     
@@ -331,19 +328,19 @@ def Calculate_L2_PT_Prescale(chain, PS):
             PT_prescale=1
             return PT_prescale
 
-        rate = read_rates[chain][0]
-        cor_rate = corrected_rate[chain][0]
-        PT_contribution = rate - cor_rate
+        #rate = read_rates[chain][0]
+        #cor_rate = corrected_rate[chain][0]
+        #PT_contribution = rate - cor_rate
         
         target_rate = float(read_l2_pt_bw[chain])
         
         L2_Chain = chain
-        L2_Prescale = read_rates[L2_Chain][1]
-        L2_Rate = read_rates[L2_Chain][0]
-        L2_Corrected_Rate = corrected_rate[L2_Chain][0]
+        #L2_Prescale = read_rates[L2_Chain][1]
+        #L2_Rate = read_rates[L2_Chain][0]
+        #L2_Corrected_Rate = corrected_rate[L2_Chain][0]
         
         L1_Chain = read_rates[L2_Chain][2]
-        L1_Prescale = read_rates[L1_Chain][1]
+        #L1_Prescale = read_rates[L1_Chain][1]
         L1_Rate = read_rates[L1_Chain][0]
 
         total_rate_scale = options.lumi * L1_Rate / (lumi_xml_ref * PS[L1_Chain])
@@ -370,24 +367,24 @@ def Calculate_EF_PT_Prescale(chain, PS):
             PT_prescale=1
             return PT_prescale
 
-        rate = read_rates[chain][0]
-        cor_rate = corrected_rate[chain][0]
-        PT_contribution = rate - cor_rate
+        #rate = read_rates[chain][0]
+        #cor_rate = corrected_rate[chain][0]
+        #PT_contribution = rate - cor_rate
         
         target_rate = float(read_ef_pt_bw[chain])
         
         EF_Chain = chain
-        EF_Prescale = read_rates[EF_Chain][1]
-        EF_Rate = read_rates[EF_Chain][0]
+        #EF_Prescale = read_rates[EF_Chain][1]
+        #EF_Rate = read_rates[EF_Chain][0]
         
         L2_Chain = read_rates[EF_Chain][2]
         L2_Prescale = read_rates[L2_Chain][1]
-        L2_Rate = read_rates[L2_Chain][0]
+        #L2_Rate = read_rates[L2_Chain][0]
         L2_Corrected_Rate = corrected_rate[L2_Chain][0]
         
         L1_Chain = read_rates[L2_Chain][2]
         L1_Prescale = read_rates[L1_Chain][1]
-        L1_Rate = read_rates[L1_Chain][0]
+        #L1_Rate = read_rates[L1_Chain][0]
         
 
         total_rate_noPT_L2 =  L1_Prescale* L2_Prescale* L2_Corrected_Rate
@@ -417,15 +414,15 @@ def Calculate_ES_Prescale(chain, PS, PT):
 
     if chain in read_es_bw.keys() :
     
-        rate = read_rates[chain][0]
+        #rate = read_rates[chain][0]
         cor_rate = corrected_rate[chain][0]
-        PT_contribution = rate - cor_rate
+        #PT_contribution = rate - cor_rate
         
         target_rate = float(read_es_bw[chain])
         
         EF_Chain = chain
         EF_Prescale = read_rates[EF_Chain][1]
-        EF_Rate = read_rates[EF_Chain][0]
+        #EF_Rate = read_rates[EF_Chain][0]
         
         L2_Chain = read_rates[EF_Chain][2]
         L2_Prescale = read_rates[L2_Chain][1]
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/generateChainDef.py b/Trigger/TriggerCommon/TriggerMenu/scripts/generateChainDef.py
index ccc2c16175a881ae6c713321a5b9283b471ffaac..7d86a00504e81c1b2c21f4761cea9d109d176f9e 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/generateChainDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/generateChainDef.py
@@ -2,11 +2,8 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import os, sys
-import re
 import xml.dom.minidom
 
-
 HypoTypes = (
     'TrigBjetHypo', 
     'TrigLeptonJetHypo', 
@@ -153,7 +150,7 @@ class ChainList:
             if c.chain_name == chain_name:
                 return c
         return None
-    def findL2ChainSeedingEF(efchain):
+    def findL2ChainSeedingEF(self, efchain):
         for c in self.L2List:
             if c.chain_name == efchain.lower_chain_name:
                 return c
@@ -284,7 +281,6 @@ class L2EFChainDef:
     def dumpSeqDef(self):
         print """
     def defineSequences(self):"""
-        seq_types = []
         tes = []
         for sig in self.l2chain.signatures+self.efchain.signatures:
             for te in sig:
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1Menu.py b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1Menu.py
index 11d5583e8bfeb4186555e4f4163f602287daca6c..91a03461e220ef276d27c3e262ba2ff8e5fd3cc5 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1Menu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1Menu.py
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import sys,os
+import sys,os,filecmp
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
 from TriggerMenu.TriggerConfigLVL1 import TriggerConfigLVL1
@@ -40,6 +40,23 @@ def generateL1Menu(menu, doFTK="False",useTopoMenu="MATCH"):
         
     return tpcl1.menu
 
+def compareL1Menus(menu="LVL1config_Physics_pp_v7.xml"):
+
+    from AthenaCommon.Logging import logging
+    log = logging.getLogger("TriggerConfigLVL1")
+    log.setLevel(logging.INFO)
+
+    import os
+    for path in os.environ['XMLPATH'].split(':'):
+        if not 'TriggerMenuXML' in os.listdir(path):
+            continue
+        if menu in os.listdir("%s/TriggerMenuXML/" % path):
+            fullname = "%s/TriggerMenuXML/%s" % (path,menu)
+        break # we only want to look into the first TriggerMenuXML package
+    print 'comparing: ', fullname, TF.outputLVL1configFile()
+    local_menu = TF.outputLVL1configFile()
+    are_files_identical = filecmp.cmp(fullname,local_menu)
+    return are_files_identical
 
 def readL1MenuFromXML(menu="LVL1config_Physics_pp_v6.xml"):
 
@@ -71,9 +88,6 @@ def readL1MenuFromXML(menu="LVL1config_Physics_pp_v6.xml"):
 
 
 def findUnneededRun2():
-    from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-    from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
-    
     menus = ['Physics_pp_v6']
 
     for menu in menus:
@@ -85,10 +99,8 @@ def findUnneededRun2():
 
 
 def findRequiredItemsFromXML():
-    from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-    from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
     
-    menus = ['Physics_pp_v7','MC_pp_v7','Physics_pp_v6','MC_pp_v6']
+    menus = ['Physics_pp_v7','MC_pp_v7','Physics_pp_v6','MC_pp_v6', 'MC_PhaseII']
 
     from TriggerMenu.l1.XMLReader import L1MenuXMLReader
 
@@ -136,11 +148,8 @@ def findFreeCTPIDs(menu):
     [menus,allItems,allThrs] = load(f)
 
     TF.triggerMenuSetup = menu
-    tpcl1 = TriggerConfigLVL1( outputFile = TF.outputLVL1configFile() )
 
     print set(Lvl1Flags.CtpIdMap().keys()) - allItems
-
-
     
 def main():
     printCabling = False
@@ -151,18 +160,34 @@ def main():
         if arg.lower().startswith("doftk"):
             FTKFlag = True
 
+    if len(sys.argv) > 1 and sys.argv[1] == "l1xml_unit_test_v7":
+        generateL1Menu(menu="Physics_pp_v7")
+        phys_comp = compareL1Menus(menu="LVL1config_Physics_pp_v7.xml")
+        generateL1Menu(menu="MC_pp_v7")
+        mc_comp = compareL1Menus(menu="LVL1config_MC_pp_v7.xml")
+
+        from AthenaCommon.Logging import logging
+        log = logging.getLogger("L1MenuDiff")
+        log.setLevel(logging.INFO)
+
+        if phys_comp and mc_comp:
+            log.info("The menus are the same")
+        else:
+            log.error("The L1 menus are different!")
+        return 0
+
     if len(sys.argv)==1 or (len(sys.argv)==2 and FTKFlag):        
         
         generateL1Menu(menu="Physics_pp_v7",doFTK=FTKFlag)
         generateL1Menu(menu="MC_pp_v7",doFTK=FTKFlag)
         generateL1Menu(menu="Physics_pp_v6",doFTK=FTKFlag)
         generateL1Menu(menu="MC_pp_v6",doFTK=FTKFlag)
+        generateL1Menu(menu="MC_PhaseII",doFTK=FTKFlag)
 #        generateL1Menu(menu="LS1_v1" )
         #generateL1Menu(menu="DC14")
 #        generateL1Menu(menu="Physics_HI_v3")  # currently disabled since not defined in JobProp
 #        generateL1Menu(menu="MC_HI_v3")  # currently disabled since not defined in JobProp
         return 0
-
     
     if sys.argv[1].endswith(".xml"):
         readL1MenuFromXML(sys.argv[1])
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py
index 0816e89251fa2813c7669869117a1b45b7ed70a7..44ec0bf66b4c6cb4bc88f9cfb820da0f9a53d4ea 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/generateL1TopoMenu.py
@@ -4,7 +4,6 @@
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
 from TriggerMenu.TriggerConfigL1Topo import TriggerConfigL1Topo
-from TriggerMenu.l1topo.L1TopoFlags import L1TopoFlags
 
 def generateL1TopoMenu(menu):
 
@@ -38,9 +37,10 @@ def main():
         generateL1TopoMenu(menu="MC_HI_v4")
         generateL1TopoMenu(menu="LS1_v1" )
         generateL1TopoMenu(menu="DC14")
+        generateL1TopoMenu(menu="MC_PhaseII")
         return 0
 
-    if sys.argv[1] in ["Physics_HI_v4", "MC_HI_v4", "Physics_HI_v3", "MC_HI_v3", "LS1_v1", "DC14","Physics_pp_v7", "MC_pp_v7","Physics_pp_v6", "MC_pp_v6"]: # explicit names for TMXML nightly
+    if sys.argv[1] in ["Physics_HI_v4", "MC_HI_v4", "Physics_HI_v3", "MC_HI_v3", "LS1_v1", "DC14","Physics_pp_v7", "MC_pp_v7","Physics_pp_v6", "MC_pp_v6", "MC_PhaseII"]: # explicit names for TMXML nightly
         generateL1TopoMenu(menu=sys.argv[1])
         return 0
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook.py b/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook.py
index 5d71663281502f8e1fb76c0303e8bce434889c51..562b88bb8a3840e1624142fca51c7a875f966680 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook.py
@@ -4,9 +4,7 @@
 # usage python makeNewRulebook.py ../rules/InitialBeam_HI_rulebook.txt rel_1 Physics_HI_v
 
 import sys
-import os
 import commands
-import time
 import xml.etree.cElementTree as ET
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook_menuConsistent.py b/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook_menuConsistent.py
index 5ea4c75ef6ae0657ab9d3ba0034e61d8521dbeae..71d24f2b9bc567b2dfcc334255a939133a5a782b 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook_menuConsistent.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/makeNewRulebook_menuConsistent.py
@@ -3,9 +3,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 import sys
-import os
 import commands
-import time
 import xml.etree.cElementTree as ET
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/moveDisabledChains.py b/Trigger/TriggerCommon/TriggerMenu/scripts/moveDisabledChains.py
index 3cf550466499b6bb7c7896c7e66d13a32585c169..41557e3f1a7849d6c23bb1b41e37073a3569d7c0 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/moveDisabledChains.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/moveDisabledChains.py
@@ -18,18 +18,31 @@ if len(sys.argv) > 1:
 import checkTigherThanPrimary
 tighter_than_primaries = set([x for x, y in checkTigherThanPrimary.main()])
 
+keep = set()
+if os.path.exists("keepChains.txt"):
+	with open("keepChains.txt") as infile:
+		for line in infile:
+			if "------" in line: continue
+			chain, dec = line.split("==>")
+			chain = chain.strip()
+			if "OK, move" in dec: dec = True
+			elif "No, keep" in dec: dec = False
+			else: print "WTF:",dec
+			if dec==False: keep.add(chain)
+	print "len(keep)",len(keep)
+
 def swapItems():
 	physics_rulemod		 		= importlib.import_module("TrigMenuRulebook.Physics_%s_rules" % tag)
 	monitoring_rulemod 		= importlib.import_module("TrigMenuRulebook.Monitoring_%s_rules" % tag)
 	standby_rulemod		 		= importlib.import_module("TrigMenuRulebook.Standby_%s_rules" % tag)
 	cosmic_rulemod		 		= importlib.import_module("TrigMenuRulebook.Cosmic_%s_rules" % tag)
 	toroidoff_rulemod	 		= importlib.import_module("TrigMenuRulebook.Physics_%s_ToroidOff_rules" % tag)
-	commissioning_rulemod	= importlib.import_module("TrigMenuRulebook.Commissioning2016_rules")
-	startup_rulemod		 		= importlib.import_module("TrigMenuRulebook.Physics_%s_startup_rules" % tag)
+#	startup_rulemod		 		= importlib.import_module("TrigMenuRulebook.Physics_%s_startup_rules" % tag)
 	monitoring_rulemod.rules = monitoring_rulemod.physics_rules
-	modules = (physics_rulemod,monitoring_rulemod,standby_rulemod,cosmic_rulemod,toroidoff_rulemod,commissioning_rulemod,startup_rulemod)
-	modules = (physics_rulemod,monitoring_rulemod,standby_rulemod,cosmic_rulemod,toroidoff_rulemod,commissioning_rulemod)
-	
+#	modules = (physics_rulemod,monitoring_rulemod,standby_rulemod,cosmic_rulemod,toroidoff_rulemod,commissioning_rulemod,startup_rulemod)
+#	modules = (physics_rulemod,monitoring_rulemod,standby_rulemod,cosmic_rulemod,toroidoff_rulemod,commissioning_rulemod)
+	modules = (physics_rulemod,monitoring_rulemod,standby_rulemod,cosmic_rulemod,toroidoff_rulemod)
+
 	l1topo_pattern = "\w-\w"
 	
 	def getPS(item):
@@ -55,12 +68,15 @@ def swapItems():
 	count_toMC 			= 0
 	count_toPhysics = 0
 	items_MC_fromPhysics = set()
+	items_MC_fromPhysics_dict = {}
 	items_Physics_fromMC_withPS = set()
 	items_Physics_withPS = set()
 	
 	current_Physics = "../python/menu/Physics_%s.py" % tag
 	current_MC			 = "../python/menu/MC_%s.py" % tag
-	slice_start_pattern = r"\s*TriggerFlags.(.*).signatures *=.*\[[^\]]"
+#	slice_start_pattern = r"\s*TriggerFlags.(\w*).signatures *=.*"
+#	slice_start_pattern = r"\s*TriggerFlags.(.*).signatures *=.*\[[^\]]"
+	slice_start_pattern = r"\s*TriggerFlags.(.*).signatures *=.*\[(?!\])"
 	slice_end_pattern	 = "^\s*\]\s*$"
 	item_pattern = """(?x)\['(.*)'\s*,	#chainName
 												\s*'.*'\s*,	 #L1itemforchain
@@ -69,34 +85,40 @@ def swapItems():
 												\s*\[.*\]\s*, #[groups]
 												\s*.*\]*			#EBstep and ]"""
 	ftk_pattern = "if TriggerFlags.doFTK()"
+	ignore_slice_pattern = "TriggerFlags.(AFP)Slice.signatures"
 	last_slice_pattern = "TriggerFlags.(HeavyIon|MinBias|Beamspot)Slice.signatures"
 	output_Physics = ""
 	output_MC			= ""
 	
 	with open (current_Physics) as file_Physics:
 		currentSlice = None
+		if_ftk = False
+		ignoreSlice = False
 		linebuffer = ""
 		lastslice = False
 		for line in file_Physics:
+			cleanline = line.strip()
+			if "#" in line: cleanline = line[:line.find("#")].strip()
 			commented = line.strip().startswith("#")
 			# Last slice pattern
-			m = re.search(last_slice_pattern,line)
+			m = re.search(last_slice_pattern,cleanline)
 			if m and not commented: 
 				lastslice = True
 			if lastslice:
 				output_Physics += line
 				continue
 			# Item pattern
-			m = re.search(item_pattern,line)
-			if m and not commented:
-				assert(currentSlice != None)
+			m = re.search(item_pattern,cleanline)
+			if m and not commented and not ignoreSlice and not if_ftk:
+				assert currentSlice != None, (currentSlice, cleanline)
 				name = m.group(1)
 				ps = getPS(name)
 				if name in tighter_than_primaries:
 					print "Found item that is tighter than primary, instead of moving to MC please enable the rule in RB:", name
-				if ps==-1 and not name in tighter_than_primaries and not re.search(l1topo_pattern,line):
+				if name not in keep and ps==-1 and not name in tighter_than_primaries and not re.search(l1topo_pattern,cleanline):
 					lines_MC_fromPhysics[currentSlice] += linebuffer+line
 					items_MC_fromPhysics.add(name)
+					items_MC_fromPhysics_dict[currentSlice].append(name)
 					count_toMC += 1
 				else: 
 					lines_Physics[currentSlice] += linebuffer+line
@@ -105,22 +127,34 @@ def swapItems():
 					items_Physics_withPS.add(name)
 				continue
 			# Slice start pattern
-			m = re.search(slice_start_pattern,line)
-			if m and not commented: 
-				assert(currentSlice == None)
+			m = re.search(slice_start_pattern,cleanline)
+			m_ignore = re.search(ignore_slice_pattern,cleanline)
+			if m and not commented and not if_ftk: 
+				#print "Start slice:",line
+				assert currentSlice == None, (currentSlice, cleanline)
+				if m_ignore:
+					ignoreSlice = True
+					output_Physics += line
+					continue
 				currentSlice = m.group(1)
 				output_Physics += "REPLACE_%s\n"%currentSlice
 				if not currentSlice in lines_Physics.keys(): 				lines_Physics[currentSlice] = line
-				if not currentSlice in lines_MC_fromPhysics.keys(): lines_MC_fromPhysics[currentSlice] = ""
+				if not currentSlice in lines_MC_fromPhysics.keys(): lines_MC_fromPhysics[currentSlice] = ""; items_MC_fromPhysics_dict[currentSlice] = []
 				continue
 			# Slice end pattern
-			m = re.search(slice_end_pattern,line)
+			m = re.search(slice_end_pattern,cleanline)
 			if m and not commented: 
+				ignoreSlice = False
+				if_ftk = False
 				if currentSlice!=None:
 					lines_Physics[currentSlice] += linebuffer
 					linebuffer = ""
 					currentSlice = None
 					continue
+			# FTK pattern
+			m = re.search(ftk_pattern,cleanline)
+			if m and not commented: 
+				if_ftk = True
 			# Store line in the proper place
 			if currentSlice == None:
 				output_Physics += line
@@ -133,20 +167,22 @@ def swapItems():
 		linebuffer = ""
 		lastslice = False
 		for line in file_MC:
+			cleanline = line.strip()
+			if "#" in line: cleanline = line[:line.find("#")].strip()
 			commented = line.strip().startswith("#")
 			# Last slice pattern
-			m = re.search(last_slice_pattern,line)
+			m = re.search(last_slice_pattern,cleanline)
 			if m and not commented: 
 				lastslice = True
 			if lastslice:
 				output_MC += line
 				continue
 			# Item pattern
-			m = re.search(item_pattern,line)
-			if m and not commented and not if_ftk: 
-				assert(currentSlice != None)
+			m = re.search(item_pattern,cleanline)
+			if m and not commented and not ignoreSlice and not if_ftk: 
+				assert currentSlice != None, (currentSlice, cleanline)
 				ps = getPS(m.group(1))
-				if ps==-1 or re.search(l1topo_pattern,line):
+				if ps==-1 or re.search(l1topo_pattern,cleanline):
 					lines_MC[currentSlice] += linebuffer+line
 				else: 
 					lines_Physics_fromMC[currentSlice] += linebuffer+line
@@ -156,16 +192,21 @@ def swapItems():
 				linebuffer = ""
 				continue
 			# Slice start pattern
-			m = re.search(slice_start_pattern,line)
+			m = re.search(slice_start_pattern,cleanline)
+			m_ignore = re.search(ignore_slice_pattern,cleanline)
 			if m and not commented and not if_ftk: 
-				assert(currentSlice == None)
+				assert currentSlice == None, (currentSlice, cleanline)
+				if m_ignore:
+					ignoreSlice = True
+					output_MC += line
+					continue
 				currentSlice = m.group(1)
 				output_MC += "REPLACE_%s\n"%currentSlice
 				if not currentSlice in lines_Physics_fromMC.keys(): lines_Physics_fromMC[currentSlice] = ""
 				if not currentSlice in lines_MC.keys():							lines_MC[currentSlice] = line
 				continue
 			# Slice end pattern
-			m = re.search(slice_end_pattern,line)
+			m = re.search(slice_end_pattern,cleanline)
 			if m and not commented: 
 				if_ftk = False
 				if currentSlice!=None:
@@ -174,7 +215,7 @@ def swapItems():
 					currentSlice = None
 					continue
 			# FTK pattern
-			m = re.search(ftk_pattern,line)
+			m = re.search(ftk_pattern,cleanline)
 			if m and not commented: 
 				if_ftk = True
 			# Store line in the proper place
@@ -208,6 +249,11 @@ def swapItems():
 		print "Some new items in Physics are prescaled, you probably want to add them to CPS.py:"
 		print sorted(list(items_Physics_fromMC_withPS))
 
+	with open("disabled.txt","w") as outfile:
+		for mslice,items in items_MC_fromPhysics_dict.iteritems():
+			outfile.write(mslice+" ---------\n")
+			for item in items:
+				outfile.write("\t"+item+"\n")
 	return items_MC_fromPhysics
 
 def cleanCPS(movedToMC):
@@ -224,22 +270,24 @@ def cleanCPS(movedToMC):
 	with open (cpsfile+".edit","w") as outcps, open (cpsfile) as incps:
 		removing = False
 		for line in incps:
+			cleanline = line.strip()
+			if "#" in line: cleanline = line[:line.find("#")].strip()
 			commented = line.strip().startswith("#")
 			# CPS start pattern
-			m = re.search(cps_start_pattern,line)
+			m = re.search(cps_start_pattern,cleanline)
 			if m and not commented:
 				name = 'RATE:CPS:%s'%m.group(1)
 				if name in cps_to_remove:
 					removing = True
 			#CPS item pattern
 			if not m:
-				m = re.search(cps_item_pattern,line)
+				m = re.search(cps_item_pattern,cleanline)
 				if m and not commented:
 					if m.group(1) in movedToMC: continue
 			if not removing:
 				outcps.write(line)
 			# CPS end pattern
-			m = re.search(cps_end_pattern,line)
+			m = re.search(cps_end_pattern,cleanline)
 			if m and not commented:
 				removing = False
 			
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/printLVL1XML.py b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/printLVL1XML.py
index fbe7529922213e57c9dfb1dcb9e629fb6cb2064e..c8ad7ee25cc66257f8cd13aeea6192f510312930 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/printLVL1XML.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/printLVL1XML.py
@@ -4,9 +4,7 @@
 
 import xml.etree.cElementTree as ET
 import sys
-import string
-import ROOT
-from ROOT import *
+from ROOT import TH1F,TFile
 
 output_file = TFile("L1Summary.root","recreate")
 allItems = TH1F("AllItems", "AllItems", 256, 0, 256)
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_dumphltchain.py b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_dumphltchain.py
index dd4d1f14477ad0b0f4301e90e5a4f691698c1baa..e868a854a4e0097755afee2120192f52c0628a47 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_dumphltchain.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_dumphltchain.py
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import os, sys
+import sys
 import xml.dom.minidom
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_find_related.py b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_find_related.py
index d41a93556cb8d132688f1ae5bd1d6d977d6b30f0..2c379f21d00c61b7b352e7d28b95c4a721fd6d3c 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_find_related.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/oldScripts/trigconf_find_related.py
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import os, sys
+import sys
 import xml.dom.minidom
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/plotItem.py b/Trigger/TriggerCommon/TriggerMenu/scripts/plotItem.py
index c13cc428e6c7ba0cafcd933e2fc8907c8dc9a350..06480401b98750e81f45cb8650a0418682e68397 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/plotItem.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/plotItem.py
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import sys, os, commands
+import os, commands
 import matplotlib.pyplot as plt
 import TriggerClasses
 
@@ -27,7 +27,7 @@ class plotter:
             return repr(self.value)
 
     def setValues(self, PS):
-        nLumi = len(PS['Lumi'])
+        #nLumi = len(PS['Lumi'])
         
         try:
             self.EFPS = PS['EFPS']
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/printL1CableMap.py b/Trigger/TriggerCommon/TriggerMenu/scripts/printL1CableMap.py
index c962ea66c873a375e7526eb7403a6cbab28127ce..006f5fda03bc24c11d4dc956cb7b5471c4d097b4 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/printL1CableMap.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/printL1CableMap.py
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import os, sys
+import sys
 import xml.etree.cElementTree as ET
 
 class ThrInfo:
@@ -55,7 +55,6 @@ def printMap(m, logic_string):
                     thrs.append(v)
             for bit in range(31):
                 thrdata = ''
-                used = ''
                 for thr in thrs:
                     if thr.includesBit(bit):
                         thrdata = str(thr)
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/pyflakesMenu.sh b/Trigger/TriggerCommon/TriggerMenu/scripts/pyflakesMenu.sh
index dac992a3ac4163a5cd4500837919a1d922983262..6a5f0e380f47ef30f31f2d4da9a10d977587818d 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/pyflakesMenu.sh
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/pyflakesMenu.sh
@@ -1,5 +1,3 @@
 #!/usr/bin/env sh
 echo $PYPATH
 flake8 --ignore=E,W `find $PYPATH -name '*.py'`
-
-exit 0
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/read_RuleBook.py b/Trigger/TriggerCommon/TriggerMenu/scripts/read_RuleBook.py
index df23d38f0578999034d6cb9ad1ee0aa92b0ac795..26a7f3b0106ff8877acb117bca9951ec3ea87ea3 100755
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/read_RuleBook.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/read_RuleBook.py
@@ -4,8 +4,6 @@
 
 import sys
 import os
-import commands
-import time
 
 #-----------------------------------------------------------------------------
 # Create and configure option parser
diff --git a/Trigger/TriggerCommon/TriggerMenu/scripts/testRulebook.py b/Trigger/TriggerCommon/TriggerMenu/scripts/testRulebook.py
index 076e51a49f6b12302fbbfb881894046f317b4e7b..57197638ebb3598b2544e4ccc167f07323ae8b23 100644
--- a/Trigger/TriggerCommon/TriggerMenu/scripts/testRulebook.py
+++ b/Trigger/TriggerCommon/TriggerMenu/scripts/testRulebook.py
@@ -2,10 +2,10 @@
 
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-import sys, os, commands
+import os, commands
 import TriggerClasses
 import logging
-from operator import itemgetter, attrgetter
+from operator import attrgetter
 import xml.etree.cElementTree as ET
 
 def checkFormat(file_path, trigger_rules = {}):
@@ -36,7 +36,7 @@ def checkFormat(file_path, trigger_rules = {}):
         logging.error("Failed to read %s lines: \n" % len(badlines))
         for line in badlines:
             logging.error("%s\n" % line.strip())
-        lgogging.error("Found %s duplicate entries: \n" % len(duplicates))
+        logging.error("Found %s duplicate entries: \n" % len(duplicates))
         for dup in duplicates:
             logging.error("%s\n" % dup.strip())
             
diff --git a/Trigger/TriggerCommon/TriggerMenu/share/generate.py b/Trigger/TriggerCommon/TriggerMenu/share/generate.py
index 9e07b5138fc2ee6b8635cb3ad9fb1acd810d3948..320f213fc844dd06d92acc545d1381ed181ceec1 100755
--- a/Trigger/TriggerCommon/TriggerMenu/share/generate.py
+++ b/Trigger/TriggerCommon/TriggerMenu/share/generate.py
@@ -1,16 +1,15 @@
 #!/bin/env python
 
-from AthenaCommon.AthenaCommonFlags import jobproperties 
-from AthenaCommon.GlobalFlags import jobproperties
-
-jobproperties.print_JobProperties('tree&value')
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+from AthenaCommon.GlobalFlags import globalflags
 
+athenaCommonFlags.print_JobProperties('tree&value')
 
 from TriggerMenu.menu.GenerateMenu import GenerateMenu
 
 g = GenerateMenu()
 g.generate()
 
-jobproperties.AthenaCommonFlags.EvtMax=0
+athenaCommonFlags.EvtMax=0
 
-jobproperties.print_JobProperties('tree&value')
+globalflags.print_JobProperties('tree&value')
diff --git a/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt
index 02c80c54176997c849fbc09f902d3502e142b822..731c904539b29ca25888fb343626422b57a5bdcf 100644
--- a/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt
@@ -108,15 +108,9 @@ atlas_install_xmls( data/*.xml )
 
 # List of menus to be created:
 
-atlas_build_trigger_menu( Physics_pp_v6 )
-atlas_build_trigger_menu( Physics_pp_v6_tight_physics_prescale )
-atlas_build_trigger_menu( MC_pp_v6 )
-atlas_build_trigger_menu( MC_pp_v6_loose_mc_prescale )
-atlas_build_trigger_menu( MC_pp_v6_tight_mc_prescale )
-atlas_build_trigger_menu( MC_pp_v6_tightperf_mc_prescale )
-
 atlas_build_trigger_menu( Physics_pp_v7 )
 atlas_build_trigger_menu( Physics_pp_v7_tight_physics_prescale )
+atlas_build_trigger_menu( Physics_pp_v7_unprescaled_only_physics_prescale )
 atlas_build_trigger_menu( MC_pp_v7 )
 atlas_build_trigger_menu( MC_pp_v7_loose_mc_prescale )
 atlas_build_trigger_menu( MC_pp_v7_tight_mc_prescale )
@@ -129,3 +123,5 @@ atlas_build_trigger_menu( MC_HI_v3_tight_mc_prescale )
 atlas_build_trigger_menu( Physics_HI_v4 )
 atlas_build_trigger_menu( MC_HI_v4 )
 atlas_build_trigger_menu( MC_HI_v4_tight_mc_prescale )
+
+atlas_build_trigger_menu( MC_PhaseII )
diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/L1Topoconfig_MC_PhaseII.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/L1Topoconfig_MC_PhaseII.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e7eeb1eb916e964d04dc9e0a6a04becb09e534fd
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuXML/data/L1Topoconfig_MC_PhaseII.xml
@@ -0,0 +1,2140 @@
+<?xml version="1.0" ?>
+<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
+  <!--File is generated by TriggerMenu-->
+  <!--No. L1Topo algos defined: 85-->
+  <OutputList>
+    <Output algname="INVM_AJ_HighMass" triggerline="900INVM9999-AJ30s6-AJ20s6,800INVM9999-AJ30s6-AJ20s6,700INVM9999-AJ30s6-AJ20s6,500INVM9999-AJ30s6-AJ20s6" algoId="0" module="0" fpga="0" firstbit="0" clock="0"/>
+    <Output algname="INVM_AJ_LowMass" triggerline="400INVM9999-AJ30s6-AJ20s6,300INVM9999-AJ30s6-AJ20s6,200INVM9999-AJ30s6-AJ20s6,100INVM9999-AJ30s6-AJ20s6" algoId="1" module="0" fpga="0" firstbit="4" clock="0"/>
+    <Output algname="HT150-J20s5.ETA31" triggerline="HT150-J20s5.ETA31" algoId="25" module="0" fpga="0" firstbit="9" clock="0"/>
+    <Output algname="HT190-J15s5.ETA21" triggerline="HT190-J15s5.ETA21" algoId="26" module="0" fpga="0" firstbit="10" clock="0"/>
+    <Output algname="05MINDPHI-EM12s6-XE0" triggerline="05MINDPHI-EM12s6-XE0" algoId="35" module="0" fpga="0" firstbit="14" clock="0"/>
+    <Output algname="05MINDPHI-EM15s6-XE0" triggerline="05MINDPHI-EM15s6-XE0" algoId="36" module="0" fpga="0" firstbit="0" clock="1"/>
+    <Output algname="25MT-EM12s6-XE0" triggerline="25MT-EM12s6-XE0" algoId="37" module="0" fpga="0" firstbit="1" clock="1"/>
+    <Output algname="35MT-EM15s6-XE0" triggerline="35MT-EM15s6-XE0" algoId="38" module="0" fpga="0" firstbit="3" clock="1"/>
+    <Output algname="10MINDPHI-J20s2-XE50" triggerline="10MINDPHI-J20s2-XE50" algoId="39" module="0" fpga="0" firstbit="6" clock="1"/>
+    <Output algname="100RATIO-0MATCH-TAU30si2-EMall" triggerline="100RATIO-0MATCH-TAU30si2-EMall" algoId="62" module="0" fpga="0" firstbit="7" clock="1"/>
+    <Output algname="NOT-0MATCH-TAU30si2-EMall" triggerline="NOT-0MATCH-TAU30si2-EMall" algoId="63" module="0" fpga="0" firstbit="8" clock="1"/>
+    <Output algname="LAR-EM50s1" triggerline="LAR-EM50s1" algoId="72" module="0" fpga="0" firstbit="9" clock="1"/>
+    <Output algname="LAR-J100s1" triggerline="LAR-J100s1" algoId="73" module="0" fpga="0" firstbit="10" clock="1"/>
+    <Output algname="NOT-02MATCH-EM10s1-AJj15all.ETA49" triggerline="NOT-02MATCH-EM10s1-AJj15all.ETA49" algoId="58" module="0" fpga="0" firstbit="11" clock="1"/>
+    <Output algname="15MINDPHI-EM12s6-XE0" triggerline="15MINDPHI-EM12s6-XE0" algoId="75" module="0" fpga="0" firstbit="14" clock="1"/>
+    <Output algname="15MINDPHI-EM15s6-XE0" triggerline="15MINDPHI-EM15s6-XE0" algoId="76" module="0" fpga="0" firstbit="15" clock="1"/>
+    <Output algname="35MT-EM12s6-XE0" triggerline="35MT-EM12s6-XE0" algoId="77" module="0" fpga="0" firstbit="13" clock="1"/>
+    <Output algname="1DISAMB-EM15his2-TAU12abi-J25ab" triggerline="1DISAMB-EM15his2-TAU12abi-J25ab" algoId="67" module="0" fpga="1" firstbit="2" clock="0"/>
+    <Output algname="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi" triggerline="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi" algoId="69" module="0" fpga="1" firstbit="3" clock="0"/>
+    <Output algname="2INVM9-2MU6ab" triggerline="2INVM9-2MU6ab" algoId="8" module="0" fpga="1" firstbit="4" clock="0"/>
+    <Output algname="2INVM8-ONEBARREL-MU6ab-MU4ab" triggerline="2INVM8-ONEBARREL-MU6ab-MU4ab" algoId="49" module="0" fpga="1" firstbit="6" clock="0"/>
+    <Output algname="5DETA99-5DPHI99-MU6ab-MU4ab" triggerline="5DETA99-5DPHI99-MU6ab-MU4ab" algoId="20" module="0" fpga="1" firstbit="8" clock="0"/>
+    <Output algname="5DETA99-5DPHI99-2MU6ab" triggerline="5DETA99-5DPHI99-2MU6ab" algoId="21" module="0" fpga="1" firstbit="9" clock="0"/>
+    <Output algname="1DISAMB-TAU20abi-TAU12abi-J25ab" triggerline="1DISAMB-TAU20abi-TAU12abi-J25ab" algoId="68" module="0" fpga="1" firstbit="10" clock="0"/>
+    <Output algname="0DR28-MU10ab-TAU12abi" triggerline="0DR28-MU10ab-TAU12abi" algoId="22" module="0" fpga="1" firstbit="11" clock="0"/>
+    <Output algname="0DETA20-0DPHI20-TAU20abi-TAU12abi" triggerline="0DETA20-0DPHI20-TAU20abi-TAU12abi" algoId="52" module="0" fpga="1" firstbit="12" clock="0"/>
+    <Output algname="DISAMB-0DR28-EM15his2-TAU12abi" triggerline="DISAMB-0DR28-EM15his2-TAU12abi" algoId="78" module="0" fpga="1" firstbit="15" clock="0"/>
+    <Output algname="DISAMB-30INVM-EM20his2-TAU12ab" triggerline="DISAMB-30INVM-EM20his2-TAU12ab" algoId="83" module="0" fpga="1" firstbit="0" clock="1"/>
+    <Output algname="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49" triggerline="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49" algoId="84" module="0" fpga="0" firstbit="15" clock="0"/>
+    <Output algname="0DR22-2MU6ab" triggerline="0DR22-2MU6ab" algoId="17" module="0" fpga="1" firstbit="4" clock="1"/>
+    <Output algname="7INVM15-2MU4ab" triggerline="7INVM15-2MU4ab" algoId="9" module="0" fpga="1" firstbit="5" clock="1"/>
+    <Output algname="0DR22-MU6ab-MU4ab" triggerline="0DR22-MU6ab-MU4ab" algoId="18" module="0" fpga="1" firstbit="6" clock="1"/>
+    <Output algname="0DR15-2MU4ab" triggerline="0DR15-2MU4ab" algoId="13" module="0" fpga="1" firstbit="7" clock="1"/>
+    <Output algname="0DR24-2MU4ab" triggerline="0DR24-2MU4ab" algoId="16" module="0" fpga="1" firstbit="8" clock="1"/>
+    <Output algname="0DR15-2MU6ab" triggerline="0DR15-2MU6ab" algoId="19" module="0" fpga="1" firstbit="9" clock="1"/>
+    <Output algname="2INVM9-2MU4ab" triggerline="2INVM9-2MU4ab" algoId="3" module="0" fpga="1" firstbit="10" clock="1"/>
+    <Output algname="2INVM9-MU6ab-MU4ab" triggerline="2INVM9-MU6ab-MU4ab" algoId="6" module="0" fpga="1" firstbit="11" clock="1"/>
+    <Output algname="INVM_EMs6" triggerline="1INVM5-EMs1-EMs6,1INVM5-EM7s1-EMs6,1INVM5-EM12s1-EMs6" algoId="31" module="0" fpga="0" firstbit="11" clock="0"/>
+    <Output algname="05MINDPHI-AJj10s6-XE0" triggerline="05MINDPHI-AJj10s6-XE0" algoId="32" module="1" fpga="0" firstbit="0" clock="0"/>
+    <Output algname="10MINDPHI-AJj10s6-XE0" triggerline="10MINDPHI-AJj10s6-XE0" algoId="33" module="1" fpga="0" firstbit="1" clock="0"/>
+    <Output algname="15MINDPHI-AJj10s6-XE0" triggerline="15MINDPHI-AJj10s6-XE0" algoId="34" module="1" fpga="0" firstbit="2" clock="0"/>
+    <Output algname="0DR04-MU4ab-CJ15ab" triggerline="0DR04-MU4ab-CJ15ab" algoId="43" module="1" fpga="0" firstbit="3" clock="0"/>
+    <Output algname="0DR04-MU4ab-CJ20ab" triggerline="0DR04-MU4ab-CJ20ab" algoId="47" module="1" fpga="0" firstbit="4" clock="0"/>
+    <Output algname="0DR04-MU4ab-CJ30ab" triggerline="0DR04-MU4ab-CJ30ab" algoId="44" module="1" fpga="0" firstbit="5" clock="0"/>
+    <Output algname="0DR04-MU6ab-CJ20ab" triggerline="0DR04-MU6ab-CJ20ab" algoId="45" module="1" fpga="0" firstbit="6" clock="0"/>
+    <Output algname="0DR04-MU6ab-CJ25ab" triggerline="0DR04-MU6ab-CJ25ab" algoId="46" module="1" fpga="0" firstbit="7" clock="0"/>
+    <Output algname="10MINDPHI-CJ20ab-XE50" triggerline="10MINDPHI-CJ20ab-XE50" algoId="41" module="1" fpga="0" firstbit="8" clock="0"/>
+    <Output algname="0DR24-2CMU4ab" triggerline="0DR24-2CMU4ab" algoId="50" module="1" fpga="0" firstbit="9" clock="0"/>
+    <Output algname="MULT-CMU4ab" triggerline="MULT-CMU4ab[0],MULT-CMU4ab[1]" algoId="64" module="1" fpga="0" firstbit="11" clock="0"/>
+    <Output algname="MULT-CMU6ab" triggerline="MULT-CMU6ab[0],MULT-CMU6ab[1]" algoId="65" module="1" fpga="0" firstbit="13" clock="0"/>
+    <Output algname="0DETA04-EM8abi-MU10ab" triggerline="0DETA04-EM8abi-MU10ab" algoId="53" module="1" fpga="0" firstbit="3" clock="1"/>
+    <Output algname="0DPHI03-EM8abi-MU10ab" triggerline="0DPHI03-EM8abi-MU10ab" algoId="55" module="1" fpga="0" firstbit="6" clock="1"/>
+    <Output algname="0DETA04-EM15abi-MUab" triggerline="0DETA04-EM15abi-MUab" algoId="54" module="1" fpga="0" firstbit="4" clock="1"/>
+    <Output algname="0DPHI03-EM15abi-MUab" triggerline="0DPHI03-EM15abi-MUab" algoId="56" module="1" fpga="0" firstbit="8" clock="1"/>
+    <Output algname="0DR24-CMU4ab-MU4ab" triggerline="0DR24-CMU4ab-MU4ab" algoId="51" module="1" fpga="0" firstbit="5" clock="1"/>
+    <Output algname="2INVM8-CMU4ab-MU4ab" triggerline="2INVM8-CMU4ab-MU4ab" algoId="48" module="1" fpga="0" firstbit="7" clock="1"/>
+    <Output algname="0DR25-TAU20abi-TAU12abi" triggerline="0DR25-TAU20abi-TAU12abi" algoId="24" module="1" fpga="1" firstbit="10" clock="1"/>
+    <Output algname="10MINDPHI-AJ20s2-XE50" triggerline="10MINDPHI-AJ20s2-XE50" algoId="79" module="1" fpga="0" firstbit="9" clock="1"/>
+    <Output algname="LATE-MU10s1" triggerline="LATE-MU10s1" algoId="80" module="1" fpga="0" firstbit="10" clock="1"/>
+    <Output algname="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi" triggerline="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi" algoId="71" module="1" fpga="1" firstbit="11" clock="1"/>
+    <Output algname="10MINDPHI-J20s2-XE30" triggerline="10MINDPHI-J20s2-XE30" algoId="42" module="0" fpga="0" firstbit="5" clock="1"/>
+    <Output algname="KF-XE-AJall" triggerline="KF-XE40-AJall,KF-XE50-AJall,KF-XE55-AJall,KF-XE60-AJall,KF-XE65-AJall,KF-XE75-AJall" algoId="74" module="1" fpga="1" firstbit="0" clock="0"/>
+    <Output algname="0MATCH-4AJ20.ETA31-4AJj15.ETA31" triggerline="0MATCH-4AJ20.ETA31-4AJj15.ETA31" algoId="57" module="1" fpga="1" firstbit="6" clock="0"/>
+    <Output algname="HT190-AJ15all.ETA21" triggerline="HT190-AJ15all.ETA21" algoId="27" module="1" fpga="1" firstbit="7" clock="0"/>
+    <Output algname="HT150-AJ20all.ETA31" triggerline="HT150-AJ20all.ETA31" algoId="28" module="1" fpga="1" firstbit="8" clock="0"/>
+    <Output algname="HT150-AJj15all.ETA49" triggerline="HT150-AJj15all.ETA49" algoId="29" module="1" fpga="1" firstbit="9" clock="0"/>
+    <Output algname="HT20-AJj15all.ETA49" triggerline="HT20-AJj15all.ETA49" algoId="30" module="1" fpga="1" firstbit="10" clock="0"/>
+    <Output algname="SC111-CJ15ab.ETA26" triggerline="SC111-CJ15ab.ETA26" algoId="81" module="1" fpga="0" firstbit="11" clock="1"/>
+    <Output algname="SC85-CJ15ab.ETA26" triggerline="SC85-CJ15ab.ETA26" algoId="82" module="1" fpga="0" firstbit="12" clock="1"/>
+    <Output algname="05RATIO-XE0-HT0-AJj15all.ETA49" triggerline="05RATIO-XE0-HT0-AJj15all.ETA49" algoId="59" module="1" fpga="1" firstbit="13" clock="0"/>
+    <Output algname="90RATIO2-XE0-HT0-AJj15all.ETA49" triggerline="90RATIO2-XE0-HT0-AJj15all.ETA49" algoId="60" module="1" fpga="1" firstbit="15" clock="0"/>
+    <Output algname="250RATIO2-XE0-HT0-AJj15all.ETA49" triggerline="250RATIO2-XE0-HT0-AJj15all.ETA49" algoId="61" module="1" fpga="1" firstbit="0" clock="1"/>
+    <Output algname="10MINDPHI-J20ab-XE50" triggerline="10MINDPHI-J20ab-XE50" algoId="40" module="1" fpga="1" firstbit="1" clock="1"/>
+    <Output algname="0DR28-TAU20abi-TAU12abi" triggerline="0DR28-TAU20abi-TAU12abi" algoId="23" module="1" fpga="1" firstbit="2" clock="1"/>
+    <Output algname="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi" triggerline="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi" algoId="70" module="1" fpga="1" firstbit="3" clock="1"/>
+    <Output algname="1DISAMB-TAU12abi-J25ab" triggerline="1DISAMB-TAU12abi-J25ab" algoId="66" module="1" fpga="1" firstbit="4" clock="1"/>
+    <Output algname="0DR10-MU10ab-MU6ab" triggerline="0DR10-MU10ab-MU6ab" algoId="11" module="1" fpga="1" firstbit="5" clock="1"/>
+    <Output algname="2DR99-2MU4ab" triggerline="2DR99-2MU4ab" algoId="10" module="1" fpga="1" firstbit="6" clock="1"/>
+    <Output algname="0DR34-2MU4ab" triggerline="0DR34-2MU4ab" algoId="15" module="1" fpga="1" firstbit="7" clock="1"/>
+    <Output algname="2DR15-2MU6ab" triggerline="2DR15-2MU6ab" algoId="12" module="1" fpga="1" firstbit="8" clock="1"/>
+    <Output algname="0DR15-MU6ab-MU4ab" triggerline="0DR15-MU6ab-MU4ab" algoId="14" module="1" fpga="1" firstbit="9" clock="1"/>
+    <Output algname="8INVM15-MU6ab-MU4ab" triggerline="8INVM15-MU6ab-MU4ab" algoId="4" module="1" fpga="1" firstbit="12" clock="1"/>
+    <Output algname="8INVM15-2MU6ab" triggerline="8INVM15-2MU6ab" algoId="7" module="1" fpga="1" firstbit="13" clock="1"/>
+    <Output algname="2INVM8-2MU4ab" triggerline="2INVM8-2MU4ab" algoId="2" module="1" fpga="1" firstbit="14" clock="1"/>
+    <Output algname="2INVM8-MU6ab-MU4ab" triggerline="2INVM8-MU6ab-MU4ab" algoId="5" module="1" fpga="1" firstbit="15" clock="1"/>
+  </OutputList>
+
+  <TopoConfig>
+  </TopoConfig>
+
+  <SortAlgo type="ClusterNoSort" name="EMall" output="EMall" algoId="0">
+    <Fixed>
+      <Input name="ClusterTobArray" value="EmTobArray"/>
+      <Output name="TobArrayOut" value="EMall"/>
+      <Generic name="InputWidth" value=":InputWidthEM:"/>
+      <Generic name="OutputWidth" value=":InputWidthEM:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="IsoMask" value="0"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSelect" name="TAUabi" output="TAUabi" algoId="1">
+    <Fixed>
+      <Input name="ClusterTobArray" value="TauTobArray"/>
+      <Output name="TobArrayOut" value="TAUabi"/>
+      <Generic name="InputWidth" value=":InputWidthTAU:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectTAU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectTAU:"/>
+      <Generic name="DoIsoCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="24"/>
+      <Parameter pos="1" name="IsoMask" value="2"/>
+      <Parameter pos="2" name="MinEta" value="0"/>
+      <Parameter pos="3" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSelect" name="EMabi" output="EMabi" algoId="2">
+    <Fixed>
+      <Input name="ClusterTobArray" value="EmTobArray"/>
+      <Output name="TobArrayOut" value="EMabi"/>
+      <Generic name="InputWidth" value=":InputWidthEM:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectEM:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectEM:"/>
+      <Generic name="DoIsoCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="16"/>
+      <Parameter pos="1" name="IsoMask" value="2"/>
+      <Parameter pos="2" name="MinEta" value="0"/>
+      <Parameter pos="3" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSelect" name="TAUab" output="TAUab" algoId="4">
+    <Fixed>
+      <Input name="ClusterTobArray" value="TauTobArray"/>
+      <Output name="TobArrayOut" value="TAUab"/>
+      <Generic name="InputWidth" value=":InputWidthTAU:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectTAU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectTAU:"/>
+      <Generic name="DoIsoCut" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="24"/>
+      <Parameter pos="1" name="IsoMask" value="0"/>
+      <Parameter pos="2" name="MinEta" value="0"/>
+      <Parameter pos="3" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSort" name="EMs" output="EMs" algoId="5">
+    <Fixed>
+      <Input name="ClusterTobArray" value="EmTobArray"/>
+      <Output name="TobArrayOut" value="EMs"/>
+      <Generic name="InputWidth" value=":InputWidthEM:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortEM:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="DoIsoCut" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="IsoMask" value="0"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSort" name="EMshi" output="EMshi" algoId="6">
+    <Fixed>
+      <Input name="ClusterTobArray" value="EmTobArray"/>
+      <Output name="TobArrayOut" value="EMshi"/>
+      <Generic name="InputWidth" value=":InputWidthEM:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortEM:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="DoIsoCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="IsoMask" value="3"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="ClusterSort" name="TAUsi" output="TAUsi" algoId="7">
+    <Fixed>
+      <Input name="ClusterTobArray" value="TauTobArray"/>
+      <Output name="TobArrayOut" value="TAUsi"/>
+      <Generic name="InputWidth" value=":InputWidthTAU:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortTAU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortTAU:"/>
+      <Generic name="DoIsoCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="IsoMask" value="2"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetNoSort" name="AJall" output="AJall" algoId="8">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="AJall"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="OutputWidth" value=":InputWidthJET:"/>
+      <Generic name="JetSize" value=":DefaultJetSize:"/>
+    </Fixed>
+    <Variable>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetNoSort" name="AJjall" output="AJjall" algoId="9">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="AJjall"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="OutputWidth" value=":InputWidthJET:"/>
+      <Generic name="JetSize" value="1"/>
+    </Fixed>
+    <Variable>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetNoSortMatch" name="AJMatchall" output="AJMatchall" algoId="10">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="AJMatchall"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="OutputWidth" value=":InputWidthJET:"/>
+      <Generic name="JetSize" value="2"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="15"/>
+      <Parameter pos="1" name="MinET2" value="20"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetSelect" name="Jab" output="Jab" algoId="11">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="Jab"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectJET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectJET:"/>
+      <Generic name="JetSize" value="2"/>
+      <Generic name="DoEtaCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="20"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="31"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetSelect" name="CJab" output="CJab" algoId="12">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="CJab"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectJET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectJET:"/>
+      <Generic name="JetSize" value="2"/>
+      <Generic name="DoEtaCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="26"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetSort" name="AJjs" output="AJjs" algoId="13">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="AJjs"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortJET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="JetSize" value="1"/>
+      <Generic name="DoEtaCut" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinEta" value="0"/>
+      <Parameter pos="1" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetSort" name="AJs" output="AJs" algoId="14">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="AJs"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortJET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="JetSize" value="2"/>
+      <Generic name="DoEtaCut" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinEta" value="0"/>
+      <Parameter pos="1" name="MaxEta" value="49"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="JetSort" name="Js" output="Js" algoId="15">
+    <Fixed>
+      <Input name="JetTobArray" value="JetTobArray"/>
+      <Output name="TobArrayOut" value="Js"/>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSortJET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="JetSize" value="2"/>
+      <Generic name="DoEtaCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinEta" value="0"/>
+      <Parameter pos="1" name="MaxEta" value="31"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="METNoSort" name="XENoSort" output="XENoSort" algoId="16">
+    <Fixed>
+      <Input name="MetTobArray" value="MetTobArray"/>
+      <Output name="TobArrayOut" value="XENoSort"/>
+      <Generic name="InputWidth" value=":InputWidthMET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthMET:"/>
+    </Fixed>
+    <Variable>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="MetSort" name="XE" output="XE" algoId="17">
+    <Fixed>
+      <Input name="MetTobArray" value="MetTobArray"/>
+      <Output name="TobArrayOut" value="XE"/>
+      <Generic name="InputWidth" value=":InputWidthMET:"/>
+      <Generic name="OutputWidth" value=":OutputWidthMET:"/>
+    </Fixed>
+    <Variable>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="MuonSelect" name="MUab" output="MUab" algoId="18">
+    <Fixed>
+      <Input name="MuonTobArray" value="MuonTobArray"/>
+      <Output name="TobArrayOut" value="MUab"/>
+      <Generic name="InputWidth" value=":InputWidthMU:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectMU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="3"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="25"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="MuonSelect" name="CMUab" output="CMUab" algoId="19">
+    <Fixed>
+      <Input name="MuonTobArray" value="MuonTobArray"/>
+      <Output name="TobArrayOut" value="CMUab"/>
+      <Generic name="InputWidth" value=":InputWidthMU:"/>
+      <Generic name="InputWidth1stStage" value=":InputWidth1stStageSelectMU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="3"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="10"/>
+    </Variable>
+  </SortAlgo>
+
+  <SortAlgo type="MuonSort_1BC" name="LMUs" output="LMUs" algoId="20">
+    <Fixed>
+      <Input name="LateMuonTobArray" value="LateMuonTobArray"/>
+      <Output name="TobArrayOut" value="LMUs"/>
+      <Generic name="InputWidth" value=":InputWidthMU:"/>
+      <Generic name="OutputWidth" value=":OutputWidthSortMU:"/>
+      <Generic name="nDelayedMuons" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinEta" value="0"/>
+      <Parameter pos="1" name="MaxEta" value="25"/>
+    </Variable>
+  </SortAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="INVM_AJ_HighMass" algoId="0">
+    <Fixed>
+      <Input name="Tob" value="AJs" position="0"/>
+      <Output name="Results" bits="4">
+        <Bit selection="0" name="900INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="1" name="800INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="2" name="700INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="3" name="500INVM9999-AJ30s6-AJ20s6"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob" value="6"/>
+      <Generic name="NumResultBits" value="4"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="20"/>
+      <Parameter pos="2" name="MinMSqr" selection="0" value="810000"/>
+      <Parameter pos="3" name="MaxMSqr" selection="0" value="99980001"/>
+      <Parameter pos="4" name="MinET1" selection="1" value="30"/>
+      <Parameter pos="5" name="MinET2" selection="1" value="20"/>
+      <Parameter pos="6" name="MinMSqr" selection="1" value="640000"/>
+      <Parameter pos="7" name="MaxMSqr" selection="1" value="99980001"/>
+      <Parameter pos="8" name="MinET1" selection="2" value="30"/>
+      <Parameter pos="9" name="MinET2" selection="2" value="20"/>
+      <Parameter pos="10" name="MinMSqr" selection="2" value="490000"/>
+      <Parameter pos="11" name="MaxMSqr" selection="2" value="99980001"/>
+      <Parameter pos="12" name="MinET1" selection="3" value="30"/>
+      <Parameter pos="13" name="MinET2" selection="3" value="20"/>
+      <Parameter pos="14" name="MinMSqr" selection="3" value="250000"/>
+      <Parameter pos="15" name="MaxMSqr" selection="3" value="99980001"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="INVM_AJ_LowMass" algoId="1">
+    <Fixed>
+      <Input name="Tob" value="AJs" position="0"/>
+      <Output name="Results" bits="4">
+        <Bit selection="0" name="400INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="1" name="300INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="2" name="200INVM9999-AJ30s6-AJ20s6"/>
+        <Bit selection="3" name="100INVM9999-AJ30s6-AJ20s6"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob" value="6"/>
+      <Generic name="NumResultBits" value="4"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="20"/>
+      <Parameter pos="2" name="MinMSqr" selection="0" value="160000"/>
+      <Parameter pos="3" name="MaxMSqr" selection="0" value="99980001"/>
+      <Parameter pos="4" name="MinET1" selection="1" value="30"/>
+      <Parameter pos="5" name="MinET2" selection="1" value="20"/>
+      <Parameter pos="6" name="MinMSqr" selection="1" value="90000"/>
+      <Parameter pos="7" name="MaxMSqr" selection="1" value="99980001"/>
+      <Parameter pos="8" name="MinET1" selection="2" value="30"/>
+      <Parameter pos="9" name="MinET2" selection="2" value="20"/>
+      <Parameter pos="10" name="MinMSqr" selection="2" value="40000"/>
+      <Parameter pos="11" name="MaxMSqr" selection="2" value="99980001"/>
+      <Parameter pos="12" name="MinET1" selection="3" value="30"/>
+      <Parameter pos="13" name="MinET2" selection="3" value="20"/>
+      <Parameter pos="14" name="MinMSqr" selection="3" value="10000"/>
+      <Parameter pos="15" name="MaxMSqr" selection="3" value="99980001"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT150-J20s5.ETA31" algoId="25">
+    <Fixed>
+      <Input name="Tob" value="Js" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT150-J20s5.ETA31"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob" value="5"/>
+      <Generic name="NumRegisters" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="20"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="31"/>
+      <Parameter pos="3" name="MinHt" value="150"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT190-J15s5.ETA21" algoId="26">
+    <Fixed>
+      <Input name="Tob" value="Js" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT190-J15s5.ETA21"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob" value="5"/>
+      <Generic name="NumRegisters" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="21"/>
+      <Parameter pos="3" name="MinHt" value="190"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="05MINDPHI-EM12s6-XE0" algoId="35">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="05MINDPHI-EM12s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="24"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="5"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="05MINDPHI-EM15s6-XE0" algoId="36">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="05MINDPHI-EM15s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="30"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="5"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="TransverseMassInclusive1" name="25MT-EM12s6-XE0" algoId="37">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="25MT-EM12s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="MaxTob" value="6"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="24"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="MinMTSqr" value="625"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="TransverseMassInclusive1" name="35MT-EM15s6-XE0" algoId="38">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="35MT-EM15s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="MaxTob" value="6"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="30"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="MinMTSqr" value="1225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-J20s2-XE50" algoId="39">
+    <Fixed>
+      <Input name="Tob1" value="Js" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-J20s2-XE50"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="50"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="RatioMatch" name="100RATIO-0MATCH-TAU30si2-EMall" algoId="62">
+    <Fixed>
+      <Input name="Tob1" value="TAUsi" position="0"/>
+      <Input name="Tob2" value="EMall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="100RATIO-0MATCH-TAU30si2-EMall"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortTAU:"/>
+      <Generic name="InputWidth2" value=":InputWidthEM:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":InputWidthEM:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="60"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="Ratio" selection="0" value="100"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="NotMatch" name="NOT-0MATCH-TAU30si2-EMall" algoId="63">
+    <Fixed>
+      <Input name="Tob1" value="TAUsi" position="0"/>
+      <Input name="Tob2" value="EMall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="NOT-0MATCH-TAU30si2-EMall"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortTAU:"/>
+      <Generic name="InputWidth2" value=":InputWidthEM:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":InputWidthEM:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="60"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="EtaMin1" value="0"/>
+      <Parameter pos="3" name="EtaMax1" value="49"/>
+      <Parameter pos="4" name="EtaMin2" value="0"/>
+      <Parameter pos="5" name="EtaMax2" value="49"/>
+      <Parameter pos="6" name="DRCut" value="0"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="LAr" name="LAR-EM50s1" algoId="72">
+    <Fixed>
+      <Input name="Tob" value="EMs" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="LAR-EM50s1"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="MaxTob" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="40"/>
+      <Parameter pos="1" name="EtaMin" value="0"/>
+      <Parameter pos="2" name="EtaMax" value="15"/>
+      <Parameter pos="3" name="PhiMin" value="16"/>
+      <Parameter pos="4" name="PhiMax" value="23"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="LAr" name="LAR-J100s1" algoId="73">
+    <Fixed>
+      <Input name="Tob" value="Js" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="LAR-J100s1"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="100"/>
+      <Parameter pos="1" name="EtaMin" value="0"/>
+      <Parameter pos="2" name="EtaMax" value="14"/>
+      <Parameter pos="3" name="PhiMin" value="16"/>
+      <Parameter pos="4" name="PhiMax" value="23"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="NotMatch" name="NOT-02MATCH-EM10s1-AJj15all.ETA49" algoId="58">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="AJjall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="NOT-02MATCH-EM10s1-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":InputWidthJET:"/>
+      <Generic name="MaxTob1" value="1"/>
+      <Generic name="MaxTob2" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="15"/>
+      <Parameter pos="2" name="EtaMin1" value="0"/>
+      <Parameter pos="3" name="EtaMax1" value="49"/>
+      <Parameter pos="4" name="EtaMin2" value="0"/>
+      <Parameter pos="5" name="EtaMax2" value="49"/>
+      <Parameter pos="6" name="DRCut" value="4"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="15MINDPHI-EM12s6-XE0" algoId="75">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="15MINDPHI-EM12s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="24"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="15"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="15MINDPHI-EM15s6-XE0" algoId="76">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="15MINDPHI-EM15s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="30"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="15"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="TransverseMassInclusive1" name="35MT-EM12s6-XE0" algoId="77">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="35MT-EM12s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSortEM:"/>
+      <Generic name="MaxTob" value="6"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="24"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="MinMTSqr" value="1225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationIncl3" name="1DISAMB-EM15his2-TAU12abi-J25ab" algoId="67">
+    <Fixed>
+      <Input name="Tob1" value="EMshi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Input name="Tob3" value="Jab" position="2"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-EM15his2-TAU12abi-J25ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth3" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob3" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="ApplyDR" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinET3" selection="0" value="25"/>
+      <Parameter pos="3" name="DisambDRSqr" selection="0" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationDRIncl3" name="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi" algoId="69">
+    <Fixed>
+      <Input name="Tob1" value="EMshi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Input name="Tob3" value="Jab" position="2"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth3" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob3" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinET3" selection="0" value="25"/>
+      <Parameter pos="3" name="DisambDRSqrMin" selection="0" value="0"/>
+      <Parameter pos="4" name="DisambDRSqrMax" selection="0" value="784"/>
+      <Parameter pos="5" name="DisambDRSqr" selection="0" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM9-2MU6ab" algoId="8">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM9-2MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="81"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM8-ONEBARREL-MU6ab-MU4ab" algoId="49">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM8-ONEBARREL-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="64"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaEtaPhiIncl1" name="5DETA99-5DPHI99-MU6ab-MU4ab" algoId="20">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="5DETA99-5DPHI99-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinDeltaEta" value="5"/>
+      <Parameter pos="3" name="MaxDeltaEta" value="99"/>
+      <Parameter pos="4" name="MinDeltaPhi" value="5"/>
+      <Parameter pos="5" name="MaxDeltaPhi" value="99"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaEtaPhiIncl1" name="5DETA99-5DPHI99-2MU6ab" algoId="21">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="5DETA99-5DPHI99-2MU6ab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="MinDeltaEta" value="5"/>
+      <Parameter pos="3" name="MaxDeltaEta" value="99"/>
+      <Parameter pos="4" name="MinDeltaPhi" value="5"/>
+      <Parameter pos="5" name="MaxDeltaPhi" value="99"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationIncl3" name="1DISAMB-TAU20abi-TAU12abi-J25ab" algoId="68">
+    <Fixed>
+      <Input name="Tob1" value="TAUabi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Input name="Tob3" value="Jab" position="2"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-TAU20abi-TAU12abi-J25ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth3" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob3" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="ApplyDR" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="40"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinET3" selection="0" value="25"/>
+      <Parameter pos="3" name="DisambDRSqr" selection="0" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR28-MU10ab-TAU12abi" algoId="22">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR28-MU10ab-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="9"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="784"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaEtaPhiIncl1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi" algoId="52">
+    <Fixed>
+      <Input name="Tob" value="TAUabi" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectTAU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="40"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinDeltaEta" selection="0" value="0"/>
+      <Parameter pos="3" name="MaxDeltaEta" selection="0" value="20"/>
+      <Parameter pos="4" name="MinDeltaPhi" selection="0" value="0"/>
+      <Parameter pos="5" name="MaxDeltaPhi" selection="0" value="20"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationDRIncl2" name="DISAMB-0DR28-EM15his2-TAU12abi" algoId="78">
+    <Fixed>
+      <Input name="Tob1" value="EMshi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="DISAMB-0DR28-EM15his2-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="DisambDRSqrMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DisambDRSqrMax" selection="0" value="784"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationInvmIncl2" name="DISAMB-30INVM-EM20his2-TAU12ab" algoId="83">
+    <Fixed>
+      <Input name="Tob1" value="EMshi" position="0"/>
+      <Input name="Tob2" value="TAUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="DISAMB-30INVM-EM20his2-TAU12ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="40"/>
+      <Parameter pos="1" name="MinET2" value="24"/>
+      <Parameter pos="2" name="MinMSqr" value="900"/>
+      <Parameter pos="3" name="MaxMSqr" value="99980001"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive2" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49" algoId="84">
+    <Fixed>
+      <Input name="Tob1" value="AJs" position="0"/>
+      <Input name="Tob2" value="AJs" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSortJET:"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="6"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="ApplyEtaCut" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="30"/>
+      <Parameter pos="1" name="MinET2" value="20"/>
+      <Parameter pos="2" name="MinMSqr" value="160000"/>
+      <Parameter pos="3" name="MaxMSqr" value="99980001"/>
+      <Parameter pos="4" name="MinEta1" value="0"/>
+      <Parameter pos="5" name="MaxEta1" value="31"/>
+      <Parameter pos="6" name="MinEta2" value="31"/>
+      <Parameter pos="7" name="MaxEta2" value="49"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR22-2MU6ab" algoId="17">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR22-2MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="484"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="7INVM15-2MU4ab" algoId="9">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="7INVM15-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="49"/>
+      <Parameter pos="3" name="MaxMSqr" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR22-MU6ab-MU4ab" algoId="18">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR22-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="484"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR15-2MU4ab" algoId="13">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR15-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR24-2MU4ab" algoId="16">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR24-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="576"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR15-2MU6ab" algoId="19">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR15-2MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM9-2MU4ab" algoId="3">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM9-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="81"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM9-MU6ab-MU4ab" algoId="6">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM9-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="81"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive2" name="INVM_EMs6" algoId="31">
+    <Fixed>
+      <Input name="Tob1" value="EMs" position="0"/>
+      <Input name="Tob2" value="EMs" position="1"/>
+      <Output name="Results" bits="3">
+        <Bit selection="0" name="1INVM5-EMs1-EMs6"/>
+        <Bit selection="1" name="1INVM5-EM7s1-EMs6"/>
+        <Bit selection="2" name="1INVM5-EM12s1-EMs6"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSortEM:"/>
+      <Generic name="MaxTob1" value="1"/>
+      <Generic name="MaxTob2" value=":OutputWidthSortEM:"/>
+      <Generic name="NumResultBits" value="3"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="0"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="0"/>
+      <Parameter pos="2" name="MinMSqr" selection="0" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" selection="0" value="100"/>
+      <Parameter pos="4" name="MinET1" selection="1" value="14"/>
+      <Parameter pos="5" name="MinET2" selection="1" value="0"/>
+      <Parameter pos="6" name="MinMSqr" selection="1" value="4"/>
+      <Parameter pos="7" name="MaxMSqr" selection="1" value="100"/>
+      <Parameter pos="8" name="MinET1" selection="2" value="24"/>
+      <Parameter pos="9" name="MinET2" selection="2" value="0"/>
+      <Parameter pos="10" name="MinMSqr" selection="2" value="4"/>
+      <Parameter pos="11" name="MaxMSqr" selection="2" value="100"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="05MINDPHI-AJj10s6-XE0" algoId="32">
+    <Fixed>
+      <Input name="Tob1" value="AJjs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="05MINDPHI-AJj10s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="10"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="5"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-AJj10s6-XE0" algoId="33">
+    <Fixed>
+      <Input name="Tob1" value="AJjs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-AJj10s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="10"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="15MINDPHI-AJj10s6-XE0" algoId="34">
+    <Fixed>
+      <Input name="Tob1" value="AJjs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="15MINDPHI-AJj10s6-XE0"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="6"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="10"/>
+      <Parameter pos="1" name="MinET2" value="0"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="15"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR04-MU4ab-CJ15ab" algoId="43">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="CJab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR04-MU4ab-CJ15ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="3"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="15"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="16"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR04-MU4ab-CJ20ab" algoId="47">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="CJab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR04-MU4ab-CJ20ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="3"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="20"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="16"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR04-MU4ab-CJ30ab" algoId="44">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="CJab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR04-MU4ab-CJ30ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="3"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="30"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="16"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR04-MU6ab-CJ20ab" algoId="45">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="CJab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR04-MU6ab-CJ20ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="5"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="20"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="16"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR04-MU6ab-CJ25ab" algoId="46">
+    <Fixed>
+      <Input name="Tob1" value="MUab" position="0"/>
+      <Input name="Tob2" value="CJab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR04-MU6ab-CJ25ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="5"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="25"/>
+      <Parameter pos="2" name="DeltaRMin" selection="0" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" selection="0" value="16"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-CJ20ab-XE50" algoId="41">
+    <Fixed>
+      <Input name="Tob1" value="CJab" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-CJ20ab-XE50"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="50"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR24-2CMU4ab" algoId="50">
+    <Fixed>
+      <Input name="Tob" value="CMUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR24-2CMU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="576"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="Multiplicity" name="MULT-CMU4ab" algoId="64">
+    <Fixed>
+      <Input name="Tob" value="CMUab" position="0"/>
+      <Output name="Results" bits="2">
+        <Bit selection="0" name="MULT-CMU4ab[0]"/>
+        <Bit selection="1" name="MULT-CMU4ab[1]"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="NumResultBits" value="2"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="2"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="Multiplicity" name="MULT-CMU6ab" algoId="65">
+    <Fixed>
+      <Input name="Tob" value="CMUab" position="0"/>
+      <Output name="Results" bits="2">
+        <Bit selection="0" name="MULT-CMU6ab[0]"/>
+        <Bit selection="1" name="MULT-CMU6ab[1]"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="NumResultBits" value="2"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="4"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaEtaIncl2" name="0DETA04-EM8abi-MU10ab" algoId="53">
+    <Fixed>
+      <Input name="Tob1" value="EMabi" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DETA04-EM8abi-MU10ab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth1" value=":OutputWidthSelectEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectEM:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="16"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="9"/>
+      <Parameter pos="2" name="MinDeltaEta" selection="0" value="0"/>
+      <Parameter pos="3" name="MaxDeltaEta" selection="0" value="4"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaPhiIncl2" name="0DPHI03-EM8abi-MU10ab" algoId="55">
+    <Fixed>
+      <Input name="Tob1" value="EMabi" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DPHI03-EM8abi-MU10ab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth1" value=":OutputWidthSelectEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectEM:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="16"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="9"/>
+      <Parameter pos="2" name="MinDeltaPhi" selection="0" value="0"/>
+      <Parameter pos="3" name="MaxDeltaPhi" selection="0" value="3"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaEtaIncl2" name="0DETA04-EM15abi-MUab" algoId="54">
+    <Fixed>
+      <Input name="Tob1" value="EMabi" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DETA04-EM15abi-MUab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth1" value=":OutputWidthSelectEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectEM:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="0"/>
+      <Parameter pos="2" name="MinDeltaEta" selection="0" value="0"/>
+      <Parameter pos="3" name="MaxDeltaEta" selection="0" value="4"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaPhiIncl2" name="0DPHI03-EM15abi-MUab" algoId="56">
+    <Fixed>
+      <Input name="Tob1" value="EMabi" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DPHI03-EM15abi-MUab"/>
+      </Output>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="InputWidth1" value=":OutputWidthSelectEM:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectEM:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="30"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="0"/>
+      <Parameter pos="2" name="MinDeltaPhi" selection="0" value="0"/>
+      <Parameter pos="3" name="MaxDeltaPhi" selection="0" value="3"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl2" name="0DR24-CMU4ab-MU4ab" algoId="51">
+    <Fixed>
+      <Input name="Tob1" value="CMUab" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR24-CMU4ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="576"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive2" name="2INVM8-CMU4ab-MU4ab" algoId="48">
+    <Fixed>
+      <Input name="Tob1" value="CMUab" position="0"/>
+      <Input name="Tob2" value="MUab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM8-CMU4ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectMU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectMU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="64"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR25-TAU20abi-TAU12abi" algoId="24">
+    <Fixed>
+      <Input name="Tob" value="TAUabi" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR25-TAU20abi-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="40"/>
+      <Parameter pos="1" name="MinET2" value="24"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="625"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-AJ20s2-XE50" algoId="79">
+    <Fixed>
+      <Input name="Tob1" value="AJs" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-AJ20s2-XE50"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="50"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="EtCut" name="LATE-MU10s1" algoId="80">
+    <Fixed>
+      <Input name="Tob" value="LMUs" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="LATE-MU10s1"/>
+      </Output>
+      <Generic name="InputWidth" value=":NumberOfDelayedMuons:"/>
+      <Generic name="MaxTob" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="9"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationDRIncl3" name="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi" algoId="71">
+    <Fixed>
+      <Input name="Tob1" value="TAUabi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Input name="Tob3" value="Jab" position="2"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth3" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob3" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="40"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinET3" selection="0" value="25"/>
+      <Parameter pos="3" name="DisambDRSqrMin" selection="0" value="0"/>
+      <Parameter pos="4" name="DisambDRSqrMax" selection="0" value="625"/>
+      <Parameter pos="5" name="DisambDRSqr" selection="0" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-J20s2-XE30" algoId="42">
+    <Fixed>
+      <Input name="Tob1" value="Js" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-J20s2-XE30"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSortJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value="2"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="30"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="KalmanMETCorrection" name="KF-XE-AJall" algoId="74">
+    <Fixed>
+      <Input name="Tob1" value="XENoSort" position="0"/>
+      <Input name="Tob2" value="AJall" position="1"/>
+      <Output name="Results" bits="6">
+        <Bit selection="0" name="KF-XE40-AJall"/>
+        <Bit selection="1" name="KF-XE50-AJall"/>
+        <Bit selection="2" name="KF-XE55-AJall"/>
+        <Bit selection="3" name="KF-XE60-AJall"/>
+        <Bit selection="4" name="KF-XE65-AJall"/>
+        <Bit selection="5" name="KF-XE75-AJall"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="6"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="0"/>
+      <Parameter pos="1" name="KFXE" selection="0" value="40"/>
+      <Parameter pos="2" name="KFXE" selection="1" value="50"/>
+      <Parameter pos="3" name="KFXE" selection="2" value="55"/>
+      <Parameter pos="4" name="KFXE" selection="3" value="60"/>
+      <Parameter pos="5" name="KFXE" selection="4" value="65"/>
+      <Parameter pos="6" name="KFXE" selection="5" value="75"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MultiplicityCustom" name="0MATCH-4AJ20.ETA31-4AJj15.ETA31" algoId="57">
+    <Fixed>
+      <Input name="Tob" value="AJMatchall" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0MATCH-4AJ20.ETA31-4AJj15.ETA31"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="0"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="31"/>
+      <Parameter pos="3" name="MinMultiplicity" value="4"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT190-AJ15all.ETA21" algoId="27">
+    <Fixed>
+      <Input name="Tob" value="AJall" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT190-AJ15all.ETA21"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="MaxTob" value=":InputWidthJET:"/>
+      <Generic name="NumRegisters" value="2"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="21"/>
+      <Parameter pos="3" name="MinHt" value="190"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT150-AJ20all.ETA31" algoId="28">
+    <Fixed>
+      <Input name="Tob" value="AJall" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT150-AJ20all.ETA31"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="MaxTob" value=":InputWidthJET:"/>
+      <Generic name="NumRegisters" value="2"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="20"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="31"/>
+      <Parameter pos="3" name="MinHt" value="150"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT150-AJj15all.ETA49" algoId="29">
+    <Fixed>
+      <Input name="Tob" value="AJjall" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT150-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="MaxTob" value=":InputWidthJET:"/>
+      <Generic name="NumRegisters" value="2"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="49"/>
+      <Parameter pos="3" name="MinHt" value="150"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="JetHT" name="HT20-AJj15all.ETA49" algoId="30">
+    <Fixed>
+      <Input name="Tob" value="AJjall" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="HT20-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth" value=":InputWidthJET:"/>
+      <Generic name="MaxTob" value=":InputWidthJET:"/>
+      <Generic name="NumRegisters" value="2"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinEta" value="0"/>
+      <Parameter pos="2" name="MaxEta" value="49"/>
+      <Parameter pos="3" name="MinHt" value="20"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="SimpleCone" name="SC111-CJ15ab.ETA26" algoId="81">
+    <Fixed>
+      <Input name="Tob" value="CJab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="SC111-CJ15ab.ETA26"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectJET:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinSumET" value="111"/>
+      <Parameter pos="2" name="MaxRSqr" value="100"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="SimpleCone" name="SC85-CJ15ab.ETA26" algoId="82">
+    <Fixed>
+      <Input name="Tob" value="CJab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="SC85-CJ15ab.ETA26"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectJET:"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET" value="15"/>
+      <Parameter pos="1" name="MinSumET" value="85"/>
+      <Parameter pos="2" name="MaxRSqr" value="100"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="Ratio" name="05RATIO-XE0-HT0-AJj15all.ETA49" algoId="59">
+    <Fixed>
+      <Input name="Tob1" value="XE" position="0"/>
+      <Input name="Tob2" value="AJjall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="05RATIO-XE0-HT0-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth1" value="1"/>
+      <Generic name="InputWidth2" value=":InputWidthJET:"/>
+      <Generic name="MaxTob1" value="1"/>
+      <Generic name="MaxTob2" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="isXE2" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET2" value="15"/>
+      <Parameter pos="1" name="EtaMin" value="0"/>
+      <Parameter pos="2" name="EtaMax" value="49"/>
+      <Parameter pos="3" name="MinET1" value="0"/>
+      <Parameter pos="4" name="HT" value="0"/>
+      <Parameter pos="5" name="Ratio" value="5"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="Ratio" name="90RATIO2-XE0-HT0-AJj15all.ETA49" algoId="60">
+    <Fixed>
+      <Input name="Tob1" value="XE" position="0"/>
+      <Input name="Tob2" value="AJjall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth1" value="1"/>
+      <Generic name="InputWidth2" value=":InputWidthJET:"/>
+      <Generic name="MaxTob1" value="1"/>
+      <Generic name="MaxTob2" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="isXE2" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET2" value="15"/>
+      <Parameter pos="1" name="EtaMin" value="0"/>
+      <Parameter pos="2" name="EtaMax" value="49"/>
+      <Parameter pos="3" name="MinET1" value="0"/>
+      <Parameter pos="4" name="HT" value="0"/>
+      <Parameter pos="5" name="Ratio" value="90"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="Ratio" name="250RATIO2-XE0-HT0-AJj15all.ETA49" algoId="61">
+    <Fixed>
+      <Input name="Tob1" value="XE" position="0"/>
+      <Input name="Tob2" value="AJjall" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
+      </Output>
+      <Generic name="InputWidth1" value="1"/>
+      <Generic name="InputWidth2" value=":InputWidthJET:"/>
+      <Generic name="MaxTob1" value="1"/>
+      <Generic name="MaxTob2" value=":InputWidthJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="isXE2" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET2" value="15"/>
+      <Parameter pos="1" name="EtaMin" value="0"/>
+      <Parameter pos="2" name="EtaMax" value="49"/>
+      <Parameter pos="3" name="MinET1" value="0"/>
+      <Parameter pos="4" name="HT" value="0"/>
+      <Parameter pos="5" name="Ratio" value="250"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="MinDeltaPhiIncl2" name="10MINDPHI-J20ab-XE50" algoId="40">
+    <Fixed>
+      <Input name="Tob1" value="Jab" position="0"/>
+      <Input name="Tob2" value="XE" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="10MINDPHI-J20ab-XE50"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectJET:"/>
+      <Generic name="InputWidth2" value="1"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob2" value="1"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="20"/>
+      <Parameter pos="1" name="MinET2" value="50"/>
+      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="10"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR28-TAU20abi-TAU12abi" algoId="23">
+    <Fixed>
+      <Input name="Tob" value="TAUabi" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR28-TAU20abi-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectTAU:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="40"/>
+      <Parameter pos="1" name="MinET2" value="24"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="784"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationDRIncl3" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi" algoId="70">
+    <Fixed>
+      <Input name="Tob1" value="TAUabi" position="0"/>
+      <Input name="Tob2" value="TAUabi" position="1"/>
+      <Input name="Tob3" value="Jab" position="2"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth3" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob3" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" selection="0" value="40"/>
+      <Parameter pos="1" name="MinET2" selection="0" value="24"/>
+      <Parameter pos="2" name="MinET3" selection="0" value="25"/>
+      <Parameter pos="3" name="DisambDRSqrMin" selection="0" value="0"/>
+      <Parameter pos="4" name="DisambDRSqrMax" selection="0" value="784"/>
+      <Parameter pos="5" name="DisambDRSqr" selection="0" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DisambiguationIncl2" name="1DISAMB-TAU12abi-J25ab" algoId="66">
+    <Fixed>
+      <Input name="Tob1" value="TAUabi" position="0"/>
+      <Input name="Tob2" value="Jab" position="1"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="1DISAMB-TAU12abi-J25ab"/>
+      </Output>
+      <Generic name="InputWidth1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="InputWidth2" value=":OutputWidthSelectJET:"/>
+      <Generic name="MaxTob1" value=":OutputWidthSelectTAU:"/>
+      <Generic name="MaxTob2" value=":OutputWidthSelectJET:"/>
+      <Generic name="NumResultBits" value="1"/>
+      <Generic name="ClusterOnly" value="0"/>
+      <Generic name="ApplyDR" value="0"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="24"/>
+      <Parameter pos="1" name="MinET2" value="25"/>
+      <Parameter pos="2" name="DisambDRSqrMin" value="1"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR10-MU10ab-MU6ab" algoId="11">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR10-MU10ab-MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="9"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="100"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="2DR99-2MU4ab" algoId="10">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2DR99-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="4"/>
+      <Parameter pos="3" name="DeltaRMax" value="9801"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR34-2MU4ab" algoId="15">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR34-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="1156"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="2DR15-2MU6ab" algoId="12">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2DR15-2MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="DeltaRMin" value="4"/>
+      <Parameter pos="3" name="DeltaRMax" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="DeltaRSqrIncl1" name="0DR15-MU6ab-MU4ab" algoId="14">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="0DR15-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="DeltaRMin" value="0"/>
+      <Parameter pos="3" name="DeltaRMax" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="8INVM15-MU6ab-MU4ab" algoId="4">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="8INVM15-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="64"/>
+      <Parameter pos="3" name="MaxMSqr" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="8INVM15-2MU6ab" algoId="7">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="8INVM15-2MU6ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="5"/>
+      <Parameter pos="2" name="MinMSqr" value="64"/>
+      <Parameter pos="3" name="MaxMSqr" value="225"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM8-2MU4ab" algoId="2">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM8-2MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="3"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="64"/>
+    </Variable>
+  </DecisionAlgo>
+
+  <DecisionAlgo type="InvariantMassInclusive1" name="2INVM8-MU6ab-MU4ab" algoId="5">
+    <Fixed>
+      <Input name="Tob" value="MUab" position="0"/>
+      <Output name="Results" bits="1">
+        <Bit selection="0" name="2INVM8-MU6ab-MU4ab"/>
+      </Output>
+      <Generic name="InputWidth" value=":OutputWidthSelectMU:"/>
+      <Generic name="MaxTob" value=":OutputWidthSelectMU:"/>
+      <Generic name="RequireOneBarrel" value="0"/>
+      <Generic name="NumResultBits" value="1"/>
+    </Fixed>
+    <Variable>
+      <Parameter pos="0" name="MinET1" value="5"/>
+      <Parameter pos="1" name="MinET2" value="3"/>
+      <Parameter pos="2" name="MinMSqr" value="4"/>
+      <Parameter pos="3" name="MaxMSqr" value="64"/>
+    </Variable>
+  </DecisionAlgo>
+
+</TOPO_MENU>
diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_PhaseII.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_PhaseII.xml
new file mode 100644
index 0000000000000000000000000000000000000000..44a62c7f6a491caaffbe6838e6340c0e4fa89ea6
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_PhaseII.xml
@@ -0,0 +1,7625 @@
+<?xml version="1.0"?>
+<!DOCTYPE LVL1Config SYSTEM "LVL1config.dtd">
+<LVL1Config name="MC_PhaseII" ctpVersion="4" l1Version="1">
+  <!--File is generated by TriggerMenu-->
+  <!--No. L1 thresholds defined: 287-->
+  <!--No. L1 items defined: 471-->
+  <TriggerMenu name="MC_PhaseII" phase="lumi">
+    <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="1" partition="1" name="L1_EM7" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="2" partition="1" name="L1_EM12" complex_deadtime="0" definition="(EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="3" partition="1" name="L1_EM8VH" complex_deadtime="0" definition="(EM8VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM8VH_x1" triggerthreshold="EM8VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="4" partition="1" name="L1_EM10VH" complex_deadtime="0" definition="(EM10VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="5" partition="1" name="L1_EM15VHI_2TAU12IM_4J12" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;J12[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="4" name="J12_x4" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="6" partition="1" name="L1_EM15" complex_deadtime="0" definition="(EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="7" partition="1" name="L1_EM15VH" complex_deadtime="0" definition="(EM15VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="8" partition="1" name="L1_EM18VHI" complex_deadtime="0" definition="(EM18VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM18VHI_x1" triggerthreshold="EM18VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="9" partition="1" name="L1_EM20VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="10" partition="1" name="L1_EM20VHI" complex_deadtime="0" definition="(EM20VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VHI_x1" triggerthreshold="EM20VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="11" partition="1" name="L1_EM22VHI" complex_deadtime="0" definition="(EM22VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="12" partition="1" name="L1_EM3_EMPTY" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="13" partition="1" name="L1_EM7_EMPTY" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="14" partition="1" name="L1_MU4" complex_deadtime="0" definition="(MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="15" partition="1" name="L1_MU6" complex_deadtime="0" definition="(MU6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="16" partition="1" name="L1_MU10" complex_deadtime="0" definition="(MU10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="17" partition="1" name="L1_MU21" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="18" partition="1" name="L1_MU20" complex_deadtime="0" definition="(MU20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="19" partition="1" name="L1_MU4_EMPTY" complex_deadtime="0" definition="(MU4[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="20" partition="1" name="L1_MU4_FIRSTEMPTY" complex_deadtime="0" definition="(MU4[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="21" partition="1" name="L1_MU11_EMPTY" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="22" partition="1" name="L1_MU4_UNPAIRED_ISO" complex_deadtime="0" definition="(MU4[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="23" partition="1" name="L1_2EM3" complex_deadtime="0" definition="(EM3[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="24" partition="1" name="L1_2EM7" complex_deadtime="0" definition="(EM7[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM7_x2" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="25" partition="1" name="L1_2EM10VH" complex_deadtime="0" definition="(EM10VH[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM10VH_x2" triggerthreshold="EM10VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="26" partition="1" name="L1_EM20VH_3J20" complex_deadtime="0" definition="(EM20VH[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="27" partition="1" name="L1_2EM15" complex_deadtime="0" definition="(EM15[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM15_x2" triggerthreshold="EM15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="28" partition="1" name="L1_2EM15VH" complex_deadtime="0" definition="(EM15VH[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM15VH_x2" triggerthreshold="EM15VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="29" partition="1" name="L1_EM7_2EM3" complex_deadtime="0" definition="(EM7[x1]&amp;EM3[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="30" partition="1" name="L1_EM12_2EM3" complex_deadtime="0" definition="(EM12[x1]&amp;EM3[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="31" partition="1" name="L1_EM15VH_3EM7" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM7[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="3" name="EM7_x3" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="32" partition="1" name="L1_2MU4" complex_deadtime="0" definition="(MU4[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="33" partition="1" name="L1_2MU6" complex_deadtime="0" definition="(MU6[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU6_x2" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="34" partition="1" name="L1_2MU10" complex_deadtime="0" definition="(MU10[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU10_x2" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="35" partition="1" name="L1_2MU20_OVERLAY" complex_deadtime="0" definition="(MU20[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU20_x2" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="36" partition="1" name="L1_MU10_2MU6" complex_deadtime="0" definition="(MU10[x1]&amp;MU6[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="2" name="MU6_x2" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="37" partition="1" name="L1_MU11_2MU6" complex_deadtime="0" definition="(MU11[x1]&amp;MU6[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
+        <TriggerCondition multi="2" name="MU6_x2" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="38" partition="1" name="L1_3MU4" complex_deadtime="0" definition="(MU4[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="MU4_x3" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="39" partition="1" name="L1_MU6_2MU4" complex_deadtime="0" definition="(MU6[x1]&amp;MU4[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="40" partition="1" name="L1_3MU6" complex_deadtime="0" definition="(MU6[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="MU6_x3" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="41" partition="1" name="L1_4J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J15.0ETA25_x4" triggerthreshold="J15.0ETA25"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="42" partition="1" name="L1_EM15I_MU4" complex_deadtime="0" definition="(EM15[x1]&amp;EM8I[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="EM8I_x1" triggerthreshold="EM8I"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="43" partition="1" name="L1_2EM8VH_MU10" complex_deadtime="0" definition="(EM8VH[x2]&amp;MU10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM8VH_x2" triggerthreshold="EM8VH"/>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="44" partition="1" name="L1_EM15VH_MU10" complex_deadtime="0" definition="(EM15VH[x1]&amp;MU10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="45" partition="1" name="L1_TAU12" complex_deadtime="0" definition="(HA12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA12_x1" triggerthreshold="HA12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="46" partition="1" name="L1_4MU4" complex_deadtime="0" definition="(MU4[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="MU4_x4" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="47" partition="1" name="L1_TAU12IM" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="48" partition="1" name="L1_TE15.0ETA24" complex_deadtime="0" definition="(TE15.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE15.0ETA24_x1" triggerthreshold="TE15.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="49" partition="1" name="L1_TAU20" complex_deadtime="0" definition="(HA20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="50" partition="1" name="L1_EM12_W-MT25" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="51" partition="1" name="L1_TAU20IM" complex_deadtime="0" definition="(HA20IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="52" partition="1" name="L1_TAU100" complex_deadtime="0" definition="(HA100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA100_x1" triggerthreshold="HA100"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="53" partition="1" name="L1_TAU30" complex_deadtime="0" definition="(HA30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA30_x1" triggerthreshold="HA30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="54" partition="1" name="L1_TAU40" complex_deadtime="0" definition="(HA40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="55" partition="1" name="L1_TAU60" complex_deadtime="0" definition="(HA60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="56" partition="1" name="L1_TAU8" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="57" partition="1" name="L1_TAU8_EMPTY" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="58" partition="1" name="L1_TAU20IM_2TAU12IM" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="59" partition="1" name="L1_TAU20_2TAU12" complex_deadtime="0" definition="(HA20[x1]&amp;HA12[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
+        <TriggerCondition multi="2" name="HA12_x2" triggerthreshold="HA12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="60" partition="1" name="L1_EM15VHI_2TAU12IM" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="61" partition="1" name="L1_EM15VHI_2TAU12IM_J25_3J12" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="62" partition="1" name="L1_EM15VHI_TAU40_2TAU15" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA40[x1]&amp;HA15[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
+        <TriggerCondition multi="2" name="HA15_x2" triggerthreshold="HA15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="63" partition="1" name="L1_MU10_TAU12IM" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="64" partition="1" name="L1_MU10_TAU12IM_J25_2J12" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;J25[x1]&amp;J12[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J12_x2" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="65" partition="1" name="L1_EM7_MU10" complex_deadtime="0" definition="(EM7[x1]&amp;MU10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="66" partition="1" name="L1_MU6_EMPTY" complex_deadtime="0" definition="(MU6[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="67" partition="1" name="L1_MU10_TAU20IM" complex_deadtime="0" definition="(MU10[x1]&amp;HA20IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="68" partition="1" name="L1_XE10" complex_deadtime="0" definition="(XE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE10_x1" triggerthreshold="XE10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="69" partition="1" name="L1_EM20VHI_TAU20IM_2TAU20_J25_3J20" complex_deadtime="0" definition="(EM20VHI[x1]&amp;HA20IM[x1]&amp;HA20[x2]&amp;J25[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VHI_x1" triggerthreshold="EM20VHI"/>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA20_x2" triggerthreshold="HA20"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="70" partition="1" name="L1_TAU20IM_2TAU12IM_J25_2J20_3J12" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J20[x2]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="71" partition="1" name="L1_J25_2J20_3J12_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(J25[x1]&amp;J20[x2]&amp;J12[x3]&amp;0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="72" partition="1" name="L1_DR-MU10TAU12I_TAU12I-J25" complex_deadtime="0" definition="(0DR28-MU10ab-TAU12abi[x1]&amp;1DISAMB-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR28-MU10ab-TAU12abi_x1" triggerthreshold="0DR28-MU10ab-TAU12abi"/>
+        <TriggerCondition multi="1" name="1DISAMB-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-TAU12abi-J25ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="73" partition="1" name="L1_MU10_TAU12I-J25" complex_deadtime="0" definition="(MU10[x1]&amp;1DISAMB-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="1DISAMB-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-TAU12abi-J25ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="74" partition="1" name="L1_TAU20IM_2J20_XE45" complex_deadtime="0" definition="(HA20IM[x1]&amp;J20[x2]&amp;XE45[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE45_x1" triggerthreshold="XE45"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="75" partition="1" name="L1_J15.31ETA49_UNPAIRED_ISO" complex_deadtime="0" definition="(J15.31ETA49[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J15.31ETA49_x1" triggerthreshold="J15.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="76" partition="1" name="L1_TAU60_DR-TAU20ITAU12I" complex_deadtime="0" definition="(HA60[x1]&amp;0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/>
+        <TriggerCondition multi="1" name="0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="0DR28-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="78" partition="1" name="L1_EM15VHI_2TAU12IM_XE35" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="81" partition="1" name="L1_MU10_TAU12IM_XE35" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="82" partition="1" name="L1_TE50" complex_deadtime="0" definition="(TE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE50_x1" triggerthreshold="TE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="83" partition="1" name="L1_TAU20IM_2TAU12IM_XE35" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="84" partition="1" name="L1_TAU20_2TAU12_XE35" complex_deadtime="0" definition="(HA20[x1]&amp;HA12[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
+        <TriggerCondition multi="2" name="HA12_x2" triggerthreshold="HA12"/>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="85" partition="1" name="L1_XE30" complex_deadtime="0" definition="(XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="86" partition="1" name="L1_TAU20IM_FTK" complex_deadtime="0" definition="(HA20IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="87" partition="1" name="L1_MU4_J12" complex_deadtime="0" definition="(MU4[x1]&amp;J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="88" partition="1" name="L1_MU6_J20" complex_deadtime="0" definition="(MU6[x1]&amp;J20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="89" partition="1" name="L1_MU6_J40" complex_deadtime="0" definition="(MU6[x1]&amp;J40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="90" partition="1" name="L1_MU6_J75" complex_deadtime="0" definition="(MU6[x1]&amp;J75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="91" partition="1" name="L1_J12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:111">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="92" partition="1" name="L1_J15" complex_deadtime="0" definition="(J15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J15_x1" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="93" partition="1" name="L1_J20" complex_deadtime="0" definition="(J20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="94" partition="1" name="L1_J25" complex_deadtime="0" definition="(J25[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="95" partition="1" name="L1_J30" complex_deadtime="0" definition="(J30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="96" partition="1" name="L1_J40" complex_deadtime="0" definition="(J40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="97" partition="1" name="L1_J50" complex_deadtime="0" definition="(J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="98" partition="1" name="L1_J75" complex_deadtime="0" definition="(J75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="99" partition="1" name="L1_J85" complex_deadtime="0" definition="(J85[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J85_x1" triggerthreshold="J85"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="100" partition="1" name="L1_J100" complex_deadtime="0" definition="(J100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="101" partition="1" name="L1_J120" complex_deadtime="0" definition="(J120[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J120_x1" triggerthreshold="J120"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="102" partition="1" name="L1_J400" complex_deadtime="0" definition="(J400[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J400_x1" triggerthreshold="J400"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="103" partition="1" name="L1_J20.31ETA49" complex_deadtime="0" definition="(J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="104" partition="1" name="L1_J30.31ETA49" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="105" partition="1" name="L1_J50.31ETA49" complex_deadtime="0" definition="(J50.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J50.31ETA49_x1" triggerthreshold="J50.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="106" partition="1" name="L1_J75.31ETA49" complex_deadtime="0" definition="(J75.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J75.31ETA49_x1" triggerthreshold="J75.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="107" partition="1" name="L1_J100.31ETA49" complex_deadtime="0" definition="(J100.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J100.31ETA49_x1" triggerthreshold="J100.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="109" partition="1" name="L1_J15.31ETA49" complex_deadtime="0" definition="(J15.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J15.31ETA49_x1" triggerthreshold="J15.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="110" partition="1" name="L1_J20.28ETA31" complex_deadtime="0" definition="(J20.28ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J20.28ETA31_x1" triggerthreshold="J20.28ETA31"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="111" partition="1" name="L1_J12_EMPTY" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="112" partition="1" name="L1_J12_FIRSTEMPTY" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="113" partition="1" name="L1_J12_UNPAIRED_ISO" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="114" partition="1" name="L1_J12_UNPAIRED_NONISO" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="115" partition="1" name="L1_J12_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP8)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="116" partition="1" name="L1_J30_EMPTY" complex_deadtime="0" definition="(J30[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="117" partition="1" name="L1_J30_FIRSTEMPTY" complex_deadtime="0" definition="(J30[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="118" partition="1" name="L1_J30.31ETA49_EMPTY" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="119" partition="1" name="L1_J30.31ETA49_UNPAIRED_ISO" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="120" partition="1" name="L1_J30.31ETA49_UNPAIRED_NONISO" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="121" partition="1" name="L1_J50_UNPAIRED_ISO" complex_deadtime="0" definition="(J50[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="122" partition="1" name="L1_J50_UNPAIRED_NONISO" complex_deadtime="0" definition="(J50[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="123" partition="1" name="L1_J50_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(J50[x1]&amp;BGRP0&amp;BGRP8)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="125" partition="1" name="L1_J20_J20.31ETA49" complex_deadtime="0" definition="(J20[x1]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="126" partition="1" name="L1_3J15" complex_deadtime="0" definition="(J15[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="128" partition="1" name="L1_3J40" complex_deadtime="0" definition="(J40[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J40_x3" triggerthreshold="J40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="130" partition="1" name="L1_3J50" complex_deadtime="0" definition="(J50[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J50_x3" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="131" partition="1" name="L1_4J15" complex_deadtime="0" definition="(J15[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J15_x4" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="132" partition="1" name="L1_4J20" complex_deadtime="0" definition="(J20[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J20_x4" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="133" partition="1" name="L1_J75_XE50" complex_deadtime="0" definition="(J75[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="135" partition="1" name="L1_6J15" complex_deadtime="0" definition="(J15[x6]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="6" name="J15_x6" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="136" partition="1" name="L1_J75_3J20" complex_deadtime="0" definition="(J75[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="137" partition="1" name="L1_J30.0ETA49_2J20.0ETA49" complex_deadtime="0" definition="(J30.0ETA49[x1]&amp;J20.0ETA49[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.0ETA49_x1" triggerthreshold="J30.0ETA49"/>
+        <TriggerCondition multi="2" name="J20.0ETA49_x2" triggerthreshold="J20.0ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="138" partition="1" name="L1_TE10" complex_deadtime="0" definition="(TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="139" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="140" partition="1" name="L1_5J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x5]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="5" name="J15.0ETA25_x5" triggerthreshold="J15.0ETA25"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="141" partition="1" name="L1_2J15_XE55" complex_deadtime="0" definition="(J15[x2]&amp;XE55[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="J15_x2" triggerthreshold="J15"/>
+        <TriggerCondition multi="1" name="XE55_x1" triggerthreshold="XE55"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="142" partition="1" name="L1_J40_XE50" complex_deadtime="0" definition="(J40[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="143" partition="1" name="L1_TE60" complex_deadtime="0" definition="(TE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE60_x1" triggerthreshold="TE60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="144" partition="1" name="L1_XE35" complex_deadtime="0" definition="(XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="145" partition="1" name="L1_XE40" complex_deadtime="0" definition="(XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="146" partition="1" name="L1_XE45" complex_deadtime="0" definition="(XE45[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE45_x1" triggerthreshold="XE45"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="147" partition="1" name="L1_XE50" complex_deadtime="0" definition="(XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="148" partition="1" name="L1_XE55" complex_deadtime="0" definition="(XE55[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE55_x1" triggerthreshold="XE55"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="149" partition="1" name="L1_XE60" complex_deadtime="0" definition="(XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="150" partition="1" name="L1_XE70" complex_deadtime="0" definition="(XE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE70_x1" triggerthreshold="XE70"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="151" partition="1" name="L1_XE80" complex_deadtime="0" definition="(XE80[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE80_x1" triggerthreshold="XE80"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="154" partition="1" name="L1_EM12_XS20" complex_deadtime="0" definition="(EM12[x1]&amp;XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="155" partition="1" name="L1_EM15_XS30" complex_deadtime="0" definition="(EM15[x1]&amp;XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="157" partition="1" name="L1_TE30" complex_deadtime="0" definition="(TE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE30_x1" triggerthreshold="TE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="158" partition="1" name="L1_TE40" complex_deadtime="0" definition="(TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="159" partition="1" name="L1_TE70" complex_deadtime="0" definition="(TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="160" partition="1" name="L1_TE30.0ETA24" complex_deadtime="0" definition="(TE30.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE30.0ETA24_x1" triggerthreshold="TE30.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="161" partition="1" name="L1_BCM_Wide_UNPAIRED_NONISO" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="162" partition="1" name="L1_BCM_AC_CA_UNPAIRED_ISO" complex_deadtime="0" definition="((BCM_AtoC[x1]|BCM_CtoA[x1])&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+          <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="163" partition="1" name="L1_BCM_AC_UNPAIRED_ISO" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="164" partition="1" name="L1_MBTS_1_EMPTY" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="165" partition="1" name="L1_MBTS_1_UNPAIRED_ISO" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="166" partition="1" name="L1_MBTS_2_EMPTY" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="167" partition="1" name="L1_MBTS_2_UNPAIRED_ISO" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="168" partition="1" name="L1_MBTS_1_1_EMPTY" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="169" partition="1" name="L1_MBTS_1_1_UNPAIRED_ISO" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="170" partition="1" name="L1_AFP_A_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="171" partition="1" name="L1_DPHI-AJ20s2XE50" complex_deadtime="0" definition="(10MINDPHI-AJ20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="10MINDPHI-AJ20s2-XE50_x1" triggerthreshold="10MINDPHI-AJ20s2-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="172" partition="1" name="L1_EM18VHI_3J20" complex_deadtime="0" definition="(EM18VHI[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM18VHI_x1" triggerthreshold="EM18VHI"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="173" partition="1" name="L1_MU10_3J20" complex_deadtime="0" definition="(MU10[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="174" partition="1" name="L1_AFP_A_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="175" partition="1" name="L1_2J50_XE40" complex_deadtime="0" definition="(J50[x2]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="J50_x2" triggerthreshold="J50"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="176" partition="1" name="L1_J40_XE60" complex_deadtime="0" definition="(J40[x1]&amp;XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="177" partition="1" name="L1_J40.0ETA25_XE50" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="179" partition="1" name="L1_BPH-8M15-MU6MU4" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="180" partition="1" name="L1_BPH-8M15-2MU6" complex_deadtime="0" definition="(8INVM15-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-2MU6ab_x1" triggerthreshold="8INVM15-2MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="181" partition="1" name="L1_J40.0ETA25_2J15.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J15.31ETA49[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="2" name="J15.31ETA49_x2" triggerthreshold="J15.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="182" partition="1" name="L1_J40.0ETA25_2J25_J20.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J25[x2]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="2" name="J25_x2" triggerthreshold="J25"/>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="183" partition="1" name="L1_AFP_C_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="184" partition="1" name="L1_3J15.0ETA25_XE40" complex_deadtime="0" definition="(J15.0ETA25[x3]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J15.0ETA25_x3" triggerthreshold="J15.0ETA25"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="185" partition="1" name="L1_MBTS_4_A_UNPAIRED_ISO" complex_deadtime="0" definition="(MBTS_A[x4]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="MBTS_A_x4" triggerthreshold="MBTS_A"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="186" partition="1" name="L1_MBTS_4_C_UNPAIRED_ISO" complex_deadtime="0" definition="(MBTS_C[x4]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="MBTS_C_x4" triggerthreshold="MBTS_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="187" partition="1" name="L1_XE300" complex_deadtime="0" definition="(XE300[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE300_x1" triggerthreshold="XE300"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="188" partition="1" name="L1_RD1_BGRP10" complex_deadtime="0" definition="(RNDM1&amp;BGRP0&amp;BGRP10)" trigger_type="10000010" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM1"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP10"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="189" partition="1" name="L1_AFP_C_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSC_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="190" partition="1" name="L1_AFP_A_OR_C_UNPAIRED_ISO" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;BGRP0&amp;BGRP4)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="191" partition="1" name="L1_AFP_A_OR_C_UNPAIRED_NONISO" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;BGRP0&amp;BGRP5)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="192" partition="1" name="L1_AFP_A_OR_C_EMPTY" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;BGRP0&amp;BGRP3)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="193" partition="1" name="L1_AFP_A_OR_C_FIRSTEMPTY" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;BGRP0&amp;BGRP6)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="194" partition="1" name="L1_MBTS_4_A" complex_deadtime="0" definition="(MBTS_A[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="MBTS_A_x4" triggerthreshold="MBTS_A"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="195" partition="1" name="L1_MBTS_4_C" complex_deadtime="0" definition="(MBTS_C[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="MBTS_C_x4" triggerthreshold="MBTS_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="196" partition="1" name="L1_MBTS_1_BGRP9" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP9)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="197" partition="1" name="L1_MBTS_2_BGRP9" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP9)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="198" partition="1" name="L1_MBTS_1_BGRP11" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP11)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="199" partition="1" name="L1_MBTS_2_BGRP11" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP11)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="200" partition="1" name="L1_RD0_FILLED" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP1)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="201" partition="1" name="L1_RD0_UNPAIRED_ISO" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP4)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="202" partition="1" name="L1_RD0_EMPTY" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP3)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="203" partition="1" name="L1_RD1_FILLED" complex_deadtime="0" definition="(RNDM1&amp;BGRP0&amp;BGRP1)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM1"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="204" partition="1" name="L1_RD1_EMPTY" complex_deadtime="0" definition="(RNDM1&amp;BGRP0&amp;BGRP3)" trigger_type="10000010" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM1"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="205" partition="1" name="L1_RD2_FILLED" complex_deadtime="0" definition="(RNDM2&amp;BGRP0&amp;BGRP1)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM2"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="206" partition="1" name="L1_RD2_EMPTY" complex_deadtime="0" definition="(RNDM2&amp;BGRP0&amp;BGRP3)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM2"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="207" partition="1" name="L1_RD3_FILLED" complex_deadtime="0" definition="(RNDM3&amp;BGRP0&amp;BGRP1)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="208" partition="1" name="L1_RD3_EMPTY" complex_deadtime="0" definition="(RNDM3&amp;BGRP0&amp;BGRP3)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="209" partition="1" name="L1_RD0_FIRSTEMPTY" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP6)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="210" partition="1" name="L1_RD0_BGRP9" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP9)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="211" partition="1" name="L1_RD0_BGRP11" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP11)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="212" partition="1" name="L1_LUCID" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="213" partition="1" name="L1_LUCID_EMPTY" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="214" partition="1" name="L1_LUCID_UNPAIRED_ISO" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="215" partition="1" name="L1_LUCID_A_C_EMPTY" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+        <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="216" partition="1" name="L1_LUCID_A_C_UNPAIRED_ISO" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+        <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="217" partition="1" name="L1_LUCID_A_C_UNPAIRED_NONISO" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+        <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="218" partition="1" name="L1_TRT_FILLED" complex_deadtime="0" definition="(NIMTRT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMTRT_x1" triggerthreshold="NIMTRT"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="219" partition="1" name="L1_TRT_EMPTY" complex_deadtime="0" definition="(NIMTRT[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMTRT_x1" triggerthreshold="NIMTRT"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="220" partition="1" name="L1_TGC_BURST" complex_deadtime="0" definition="(NIMTGC[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMTGC_x1" triggerthreshold="NIMTGC"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="221" partition="1" name="L1_LHCF" complex_deadtime="0" definition="(NIMLHCF[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMLHCF_x1" triggerthreshold="NIMLHCF"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="222" partition="1" name="L1_BCM_Wide_BGRP0" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="223" partition="1" name="L1_BCM_AC_CA_BGRP0" complex_deadtime="0" definition="((BCM_AtoC[x1]|BCM_CtoA[x1])&amp;BGRP0)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+          <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="224" partition="1" name="L1_BCM_Wide_EMPTY" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="225" partition="1" name="L1_BCM_Wide_UNPAIRED_ISO" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="226" partition="1" name="L1_MBTS_1" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="227" partition="1" name="L1_MBTS_2" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="228" partition="1" name="L1_MBTS_1_1" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="229" partition="1" name="L1_BCM_CA_UNPAIRED_ISO" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10100000" monitor="LF:000|HF:111">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="230" partition="1" name="L1_BCM_AC_UNPAIRED_NONISO" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="231" partition="1" name="L1_BCM_CA_UNPAIRED_NONISO" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="232" partition="1" name="L1_BCM_AC_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP8)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="233" partition="1" name="L1_BCM_CA_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP8)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="234" partition="1" name="L1_BCM_Wide_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0&amp;BGRP8)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="235" partition="1" name="L1_BCM_AC_CALIB" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP2"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="236" partition="1" name="L1_BCM_CA_CALIB" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP2"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="237" partition="1" name="L1_BCM_Wide_CALIB" complex_deadtime="0" definition="(BCM_Wide[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_Wide_x1" triggerthreshold="BCM_Wide"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP2"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="238" partition="1" name="L1_BTAG-MU4J15" complex_deadtime="0" definition="(0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="240" partition="1" name="L1_ZB" complex_deadtime="0" definition="(ZB_EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ZB_EM15_x1" triggerthreshold="ZB_EM15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="241" partition="1" name="L1_BPTX0_BGRP0" complex_deadtime="0" definition="(BPTX0[x1]&amp;BGRP0)" trigger_type="10000001" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BPTX0_x1" triggerthreshold="BPTX0"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="242" partition="1" name="L1_BPTX1_BGRP0" complex_deadtime="0" definition="(BPTX1[x1]&amp;BGRP0)" trigger_type="10000001" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BPTX1_x1" triggerthreshold="BPTX1"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="243" partition="1" name="L1_BTAG-MU6J20" complex_deadtime="0" definition="(0DR04-MU6ab-CJ20ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR04-MU6ab-CJ20ab_x1" triggerthreshold="0DR04-MU6ab-CJ20ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="245" partition="1" name="L1_J40_XE50_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;XE50[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="246" partition="1" name="L1_3J15_BTAG-MU4J15" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
+        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="247" partition="1" name="L1_3J15_BTAG-MU4J30" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ30ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
+        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ30ab_x1" triggerthreshold="0DR04-MU4ab-CJ30ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="248" partition="1" name="L1_3J15_BTAG-MU6J25" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU6ab-CJ25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
+        <TriggerCondition multi="1" name="0DR04-MU6ab-CJ25ab_x1" triggerthreshold="0DR04-MU6ab-CJ25ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="249" partition="1" name="L1_3J20_BTAG-MU4J20" complex_deadtime="0" definition="(J20[x3]&amp;0DR04-MU4ab-CJ20ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ20ab_x1" triggerthreshold="0DR04-MU4ab-CJ20ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="250" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="252" partition="1" name="L1_J40_DPHI-J20XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20ab-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20ab-XE50_x1" triggerthreshold="10MINDPHI-J20ab-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="253" partition="1" name="L1_J40_DPHI-CJ20XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-CJ20ab-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="10MINDPHI-CJ20ab-XE50_x1" triggerthreshold="10MINDPHI-CJ20ab-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="254" partition="1" name="L1_TAU40_2TAU20IM" complex_deadtime="0" definition="(HA40[x1]&amp;HA20IM[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="255" partition="1" name="L1_MU10_2J15_J20" complex_deadtime="0" definition="(MU10[x1]&amp;J15[x2]&amp;J20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="2" name="J15_x2" triggerthreshold="J15"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="256" partition="1" name="L1_MU11" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="257" partition="1" name="L1_MU4_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="258" partition="1" name="L1_HT190-J15.ETA21" complex_deadtime="0" definition="(HT190-AJ15all.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT190-AJ15all.ETA21_x1" triggerthreshold="HT190-AJ15all.ETA21"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="259" partition="1" name="L1_HT190-J15s5.ETA21" complex_deadtime="0" definition="(HT190-J15s5.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT190-J15s5.ETA21_x1" triggerthreshold="HT190-J15s5.ETA21"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="260" partition="1" name="L1_HT150-J20.ETA31" complex_deadtime="0" definition="(HT150-AJ20all.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-AJ20all.ETA31_x1" triggerthreshold="HT150-AJ20all.ETA31"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="261" partition="1" name="L1_HT150-J20s5.ETA31" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-J20s5.ETA31_x1" triggerthreshold="HT150-J20s5.ETA31"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="262" partition="1" name="L1_JPSI-1M5" complex_deadtime="0" definition="(1INVM5-EMs1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1INVM5-EMs1-EMs6_x1" triggerthreshold="1INVM5-EMs1-EMs6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="263" partition="1" name="L1_JPSI-1M5-EM7" complex_deadtime="0" definition="(1INVM5-EM7s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1INVM5-EM7s1-EMs6_x1" triggerthreshold="1INVM5-EM7s1-EMs6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="264" partition="1" name="L1_JPSI-1M5-EM12" complex_deadtime="0" definition="(1INVM5-EM12s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1INVM5-EM12s1-EMs6_x1" triggerthreshold="1INVM5-EM12s1-EMs6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="266" partition="1" name="L1_KF-XE50" complex_deadtime="0" definition="(KF-XE50-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="KF-XE50-AJall_x1" triggerthreshold="KF-XE50-AJall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="267" partition="1" name="L1_KF-XE55" complex_deadtime="0" definition="(KF-XE55-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="KF-XE55-AJall_x1" triggerthreshold="KF-XE55-AJall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="268" partition="1" name="L1_KF-XE60" complex_deadtime="0" definition="(KF-XE60-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="KF-XE60-AJall_x1" triggerthreshold="KF-XE60-AJall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="269" partition="1" name="L1_KF-XE65" complex_deadtime="0" definition="(KF-XE65-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="KF-XE65-AJall_x1" triggerthreshold="KF-XE65-AJall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="270" partition="1" name="L1_KF-XE75" complex_deadtime="0" definition="(KF-XE75-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="KF-XE75-AJall_x1" triggerthreshold="KF-XE75-AJall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="271" partition="1" name="L1_2MU4_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x2]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="272" partition="1" name="L1_HT150-J20s5.ETA31_MJJ-400" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-J20s5.ETA31_x1" triggerthreshold="HT150-J20s5.ETA31"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="273" partition="1" name="L1_HT150-J20s5.ETA31_MJJ-400-CF" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-J20s5.ETA31_x1" triggerthreshold="HT150-J20s5.ETA31"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49_x1" triggerthreshold="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="275" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="276" partition="1" name="L1_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="277" partition="1" name="L1_W-05RO-XEHT-0" complex_deadtime="0" definition="(05RATIO-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="05RATIO-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="05RATIO-XE0-HT0-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="278" partition="1" name="L1_MU10_2J20" complex_deadtime="0" definition="(MU10[x1]&amp;J20[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="279" partition="1" name="L1_W-90RO2-XEHT-0" complex_deadtime="0" definition="(90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="280" partition="1" name="L1_W-250RO2-XEHT-0" complex_deadtime="0" definition="(250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="281" partition="1" name="L1_W-HT20-JJ15.ETA49" complex_deadtime="0" definition="(HT20-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT20-AJj15all.ETA49_x1" triggerthreshold="HT20-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="282" partition="1" name="L1_W-NOMATCH" complex_deadtime="0" definition="(NOT-02MATCH-EM10s1-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NOT-02MATCH-EM10s1-AJj15all.ETA49_x1" triggerthreshold="NOT-02MATCH-EM10s1-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="283" partition="1" name="L1_AFP_A" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="285" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS40[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="286" partition="1" name="L1_EM15_W-MT35" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="288" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="290" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="291" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM20VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="292" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM22VHI[x1]&amp;XS40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/>
+        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="293" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="294" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="295" partition="1" name="L1_EM22VHIM" complex_deadtime="0" definition="(EM22VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM22VHIM_x1" triggerthreshold="EM22VHIM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="299" partition="1" name="L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;0DR22-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="0DR22-MU6ab-MU4ab_x1" triggerthreshold="0DR22-MU6ab-MU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="300" partition="1" name="L1_BPH-2M9-2MU6_BPH-2DR15-2MU6" complex_deadtime="0" definition="(2INVM9-2MU6ab[x1]&amp;2DR15-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="2INVM9-2MU6ab_x1" triggerthreshold="2INVM9-2MU6ab"/>
+        <TriggerCondition multi="1" name="2DR15-2MU6ab_x1" triggerthreshold="2DR15-2MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="301" partition="1" name="L1_BPH-8M15-2MU6_BPH-0DR22-2MU6" complex_deadtime="0" definition="(8INVM15-2MU6ab[x1]&amp;0DR22-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-2MU6ab_x1" triggerthreshold="8INVM15-2MU6ab"/>
+        <TriggerCondition multi="1" name="0DR22-2MU6ab_x1" triggerthreshold="0DR22-2MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="302" partition="1" name="L1_MU6MU4-BO" complex_deadtime="0" definition="(MULT-CMU4ab[x2]&amp;MULT-CMU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MULT-CMU4ab_x2" triggerthreshold="MULT-CMU4ab"/>
+        <TriggerCondition multi="1" name="MULT-CMU6ab_x1" triggerthreshold="MULT-CMU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="303" partition="1" name="L1_2MU4-B" complex_deadtime="0" definition="(MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="304" partition="1" name="L1_2MU6-B" complex_deadtime="0" definition="(MU6[x2]&amp;MULT-CMU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU6_x2" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="MULT-CMU6ab_x1" triggerthreshold="MULT-CMU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="305" partition="1" name="L1_J15.0ETA25_2J15.31ETA49" complex_deadtime="0" definition="(J15.0ETA25[x1]&amp;J15.31ETA49[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J15.0ETA25_x1" triggerthreshold="J15.0ETA25"/>
+        <TriggerCondition multi="2" name="J15.31ETA49_x2" triggerthreshold="J15.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="308" partition="1" name="L1_AFP_C" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="309" partition="1" name="L1_AFP_A_AND_C_MBTS_2" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="312" partition="1" name="L1_2MU4-BO" complex_deadtime="0" definition="(MULT-CMU4ab[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MULT-CMU4ab_x2" triggerthreshold="MULT-CMU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="313" partition="1" name="L1_2MU6-BO" complex_deadtime="0" definition="(MULT-CMU6ab[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MULT-CMU6ab_x2" triggerthreshold="MULT-CMU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="314" partition="1" name="L1_MU6_2MU4-B" complex_deadtime="0" definition="(MU6[x1]&amp;MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="315" partition="1" name="L1_DY-DR-2MU4" complex_deadtime="0" definition="(2DR99-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="2DR99-2MU4ab_x1" triggerthreshold="2DR99-2MU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="316" partition="1" name="L1_EM15VH_2EM8VH_MU6" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x2]&amp;MU6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="2" name="EM8VH_x2" triggerthreshold="EM8VH"/>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="317" partition="1" name="L1_AFP_A_OR_C_MBTS_2" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
+        </OR>
+        <OR>
+          <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
+          <TriggerCondition multi="2" name="MBTS_C_x2" triggerthreshold="MBTS_C"/>
+          <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="318" partition="1" name="L1_DY-BOX-2MU6" complex_deadtime="0" definition="(5DETA99-5DPHI99-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="5DETA99-5DPHI99-2MU6ab_x1" triggerthreshold="5DETA99-5DPHI99-2MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="319" partition="1" name="L1_LFV-MU" complex_deadtime="0" definition="(0DR10-MU10ab-MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR10-MU10ab-MU6ab_x1" triggerthreshold="0DR10-MU10ab-MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="320" partition="1" name="L1_LFV-EM8I" complex_deadtime="0" definition="(0DETA04-EM8abi-MU10ab[x1]&amp;0DPHI03-EM8abi-MU10ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DETA04-EM8abi-MU10ab_x1" triggerthreshold="0DETA04-EM8abi-MU10ab"/>
+        <TriggerCondition multi="1" name="0DPHI03-EM8abi-MU10ab_x1" triggerthreshold="0DPHI03-EM8abi-MU10ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="321" partition="1" name="L1_LFV-EM15I" complex_deadtime="0" definition="(0DETA04-EM15abi-MUab[x1]&amp;0DPHI03-EM15abi-MUab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DETA04-EM15abi-MUab_x1" triggerthreshold="0DETA04-EM15abi-MUab"/>
+        <TriggerCondition multi="1" name="0DPHI03-EM15abi-MUab_x1" triggerthreshold="0DPHI03-EM15abi-MUab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="322" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="323" partition="1" name="L1_DPHI-J20s2XE50" complex_deadtime="0" definition="(10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="324" partition="1" name="L1_DPHI-J20XE50" complex_deadtime="0" definition="(10MINDPHI-J20ab-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="10MINDPHI-J20ab-XE50_x1" triggerthreshold="10MINDPHI-J20ab-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="325" partition="1" name="L1_DPHI-CJ20XE50" complex_deadtime="0" definition="(10MINDPHI-CJ20ab-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="10MINDPHI-CJ20ab-XE50_x1" triggerthreshold="10MINDPHI-CJ20ab-XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="326" partition="1" name="L1_MJJ-900" complex_deadtime="0" definition="(900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="327" partition="1" name="L1_MJJ-800" complex_deadtime="0" definition="(800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="328" partition="1" name="L1_MJJ-700" complex_deadtime="0" definition="(700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="329" partition="1" name="L1_MJJ-400" complex_deadtime="0" definition="(400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="330" partition="1" name="L1_MU4_J50_XE40" complex_deadtime="0" definition="(MU4[x1]&amp;J50[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="332" partition="1" name="L1_LFV-MU6" complex_deadtime="0" definition="(0DR15-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR15-2MU6ab_x1" triggerthreshold="0DR15-2MU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="333" partition="1" name="L1_MJJ-100" complex_deadtime="0" definition="(100INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="100INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="100INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="334" partition="1" name="L1_HT150-JJ15.ETA49" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="335" partition="1" name="L1_J25.0ETA23_2J15.31ETA49" complex_deadtime="0" definition="(J25.0ETA23[x1]&amp;J15.31ETA49[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J25.0ETA23_x1" triggerthreshold="J25.0ETA23"/>
+        <TriggerCondition multi="2" name="J15.31ETA49_x2" triggerthreshold="J15.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="336" partition="1" name="L1_J4-MATCH" complex_deadtime="0" definition="(0MATCH-4AJ20.ETA31-4AJj15.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0MATCH-4AJ20.ETA31-4AJj15.ETA31_x1" triggerthreshold="0MATCH-4AJ20.ETA31-4AJj15.ETA31"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="337" partition="1" name="L1_DR25-TAU20ITAU12I" complex_deadtime="0" definition="(0DR25-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR25-TAU20abi-TAU12abi_x1" triggerthreshold="0DR25-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="338" partition="1" name="L1_LLP-RO" complex_deadtime="0" definition="(100RATIO-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="100RATIO-0MATCH-TAU30si2-EMall_x1" triggerthreshold="100RATIO-0MATCH-TAU30si2-EMall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="339" partition="1" name="L1_LLP-NOMATCH" complex_deadtime="0" definition="(NOT-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NOT-0MATCH-TAU30si2-EMall_x1" triggerthreshold="NOT-0MATCH-TAU30si2-EMall"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="340" partition="1" name="L1_DR-MU10TAU12I" complex_deadtime="0" definition="(0DR28-MU10ab-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR28-MU10ab-TAU12abi_x1" triggerthreshold="0DR28-MU10ab-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="341" partition="1" name="L1_TAU30_EMPTY" complex_deadtime="0" definition="(HA30[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA30_x1" triggerthreshold="HA30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="342" partition="1" name="L1_2EM15VHI" complex_deadtime="0" definition="(EM15VHI[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM15VHI_x2" triggerthreshold="EM15VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="343" partition="1" name="L1_TAU30_UNPAIRED_ISO" complex_deadtime="0" definition="(HA30[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA30_x1" triggerthreshold="HA30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="344" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="345" partition="1" name="L1_EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-EM15his2-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-EM15his2-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-EM15his2-TAU12abi-J25ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="346" partition="1" name="L1_DR-EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-EM15his2-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="347" partition="1" name="L1_TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-TAU20abi-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-TAU20abi-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-TAU20abi-TAU12abi-J25ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="348" partition="1" name="L1_DR-TAU20ITAU12I" complex_deadtime="0" definition="(0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="0DR28-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="349" partition="1" name="L1_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="350" partition="1" name="L1_DR-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="351" partition="1" name="L1_LAR-EM" complex_deadtime="0" definition="(LAR-EM50s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LAR-EM50s1_x1" triggerthreshold="LAR-EM50s1"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="352" partition="1" name="L1_LAR-J" complex_deadtime="0" definition="(LAR-J100s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LAR-J100s1_x1" triggerthreshold="LAR-J100s1"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="353" partition="1" name="L1_DR-EM15TAU12I" complex_deadtime="0" definition="(DISAMB-0DR28-EM15his2-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="DISAMB-0DR28-EM15his2-TAU12abi_x1" triggerthreshold="DISAMB-0DR28-EM15his2-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="354" partition="1" name="L1_LATE-MU10_XE50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="355" partition="1" name="L1_LATE-MU10_J50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="356" partition="1" name="L1_SC111-CJ15" complex_deadtime="0" definition="(SC111-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="SC111-CJ15ab.ETA26_x1" triggerthreshold="SC111-CJ15ab.ETA26"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="357" partition="1" name="L1_SC85-CJ15" complex_deadtime="0" definition="(SC85-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="SC85-CJ15ab.ETA26_x1" triggerthreshold="SC85-CJ15ab.ETA26"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="358" partition="1" name="L1_MU6_MJJ-200" complex_deadtime="0" definition="(MU6[x1]&amp;200INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="200INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="200INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="362" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-400" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="363" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-700" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="364" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-800" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="365" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-900" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="366" partition="1" name="L1_3J20_4J20.0ETA49_MJJ-400" complex_deadtime="0" definition="(J20[x3]&amp;J20.0ETA49[x4]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="367" partition="1" name="L1_3J20_4J20.0ETA49_MJJ-700" complex_deadtime="0" definition="(J20[x3]&amp;J20.0ETA49[x4]&amp;700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="368" partition="1" name="L1_3J20_4J20.0ETA49_MJJ-800" complex_deadtime="0" definition="(J20[x3]&amp;J20.0ETA49[x4]&amp;800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="369" partition="1" name="L1_3J20_4J20.0ETA49_MJJ-900" complex_deadtime="0" definition="(J20[x3]&amp;J20.0ETA49[x4]&amp;900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="370" partition="1" name="L1_XE35_MJJ-200" complex_deadtime="0" definition="(XE35[x1]&amp;200INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
+        <TriggerCondition multi="1" name="200INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="200INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="371" partition="1" name="L1_EM7_FIRSTEMPTY" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="372" partition="1" name="L1_RD0_ABORTGAPNOTCALIB" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP8)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP8"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="373" partition="1" name="L1_3J25.0ETA23" complex_deadtime="0" definition="(J25.0ETA23[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J25.0ETA23_x3" triggerthreshold="J25.0ETA23"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="374" partition="1" name="L1_TE20" complex_deadtime="0" definition="(TE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE20_x1" triggerthreshold="TE20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="375" partition="1" name="L1_TE10.0ETA24" complex_deadtime="0" definition="(TE10.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE10.0ETA24_x1" triggerthreshold="TE10.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="376" partition="1" name="L1_TE20.0ETA24" complex_deadtime="0" definition="(TE20.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE20.0ETA24_x1" triggerthreshold="TE20.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="377" partition="1" name="L1_MU10_TAU20IM_J25_2J20" complex_deadtime="0" definition="(MU10[x1]&amp;HA20IM[x1]&amp;J25[x1]&amp;J20[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="378" partition="1" name="L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA20IM[x1]&amp;HA15[x2]&amp;J25[x1]&amp;J20[x2]&amp;J15[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA15_x2" triggerthreshold="HA15"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="379" partition="1" name="L1_AFP_A_AND_C_J12" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="380" partition="1" name="L1_J12_BGRP12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP12)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP12"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="381" partition="1" name="L1_J30.31ETA49_BGRP12" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP12)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP12"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="382" partition="1" name="L1_MU6_J30.0ETA49_2J20.0ETA49" complex_deadtime="0" definition="(MU6[x1]&amp;J30.0ETA49[x1]&amp;J20.0ETA49[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="1" name="J30.0ETA49_x1" triggerthreshold="J30.0ETA49"/>
+        <TriggerCondition multi="2" name="J20.0ETA49_x2" triggerthreshold="J20.0ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="383" partition="1" name="L1_4J20.0ETA49" complex_deadtime="0" definition="(J20.0ETA49[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="384" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="385" partition="1" name="L1_EM18VHI_MJJ-300" complex_deadtime="0" definition="(EM18VHI[x1]&amp;300INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM18VHI_x1" triggerthreshold="EM18VHI"/>
+        <TriggerCondition multi="1" name="300INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="300INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="386" partition="1" name="L1_DR25-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="387" partition="1" name="L1_30M-EM20ITAU12" complex_deadtime="0" definition="(DISAMB-30INVM-EM20his2-TAU12ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="DISAMB-30INVM-EM20his2-TAU12ab_x1" triggerthreshold="DISAMB-30INVM-EM20his2-TAU12ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="388" partition="1" name="L1_TAU8_UNPAIRED_ISO" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="389" partition="1" name="L1_EM7_UNPAIRED_ISO" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="390" partition="1" name="L1_RD2_BGRP12" complex_deadtime="0" definition="(RNDM2&amp;BGRP0&amp;BGRP12)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM2"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP12"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="391" partition="1" name="L1_TAU8_FIRSTEMPTY" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="392" partition="1" name="L1_EM24VHI" complex_deadtime="0" definition="(EM24VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM24VHI_x1" triggerthreshold="EM24VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="393" partition="1" name="L1_LHCF_UNPAIRED_ISO" complex_deadtime="0" definition="(NIMLHCF[x1]&amp;BGRP0&amp;BGRP4)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMLHCF_x1" triggerthreshold="NIMLHCF"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP4"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="394" partition="1" name="L1_LHCF_EMPTY" complex_deadtime="0" definition="(NIMLHCF[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="NIMLHCF_x1" triggerthreshold="NIMLHCF"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP3"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="395" partition="1" name="L1_EM15VH_2EM10VH_3EM7" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM10VH[x2]&amp;EM7[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="2" name="EM10VH_x2" triggerthreshold="EM10VH"/>
+        <TriggerCondition multi="3" name="EM7_x3" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="396" partition="1" name="L1_EM15VH_3EM8VH" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="3" name="EM8VH_x3" triggerthreshold="EM8VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="397" partition="1" name="L1_MJJ-400-CF" complex_deadtime="0" definition="(400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49_x1" triggerthreshold="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="398" partition="1" name="L1_TAU25IM_2TAU20IM_2J25_3J20" complex_deadtime="0" definition="(HA25IM[x1]&amp;HA20IM[x2]&amp;J25[x2]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA25IM_x1" triggerthreshold="HA25IM"/>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="J25_x2" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="399" partition="1" name="L1_EM8I_MU10" complex_deadtime="0" definition="(EM8I[x1]&amp;MU10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM8I_x1" triggerthreshold="EM8I"/>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="400" partition="1" name="L1_2EM20VH" complex_deadtime="0" definition="(EM20VH[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM20VH_x2" triggerthreshold="EM20VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="401" partition="1" name="L1_EM15VH_3EM10VH" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM10VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
+        <TriggerCondition multi="3" name="EM10VH_x3" triggerthreshold="EM10VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="402" partition="1" name="L1_EM24VHIM" complex_deadtime="0" definition="(EM24VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM24VHIM_x1" triggerthreshold="EM24VHIM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="403" partition="1" name="L1_MU6_3MU4" complex_deadtime="0" definition="(MU6[x1]&amp;MU4[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <TriggerCondition multi="3" name="MU4_x3" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="404" partition="1" name="L1_2MU6_3MU4" complex_deadtime="0" definition="(MU6[x2]&amp;MU4[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU6_x2" triggerthreshold="MU6"/>
+        <TriggerCondition multi="3" name="MU4_x3" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="405" partition="1" name="L1_BGRP9" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP9)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="406" partition="1" name="L1_MU21_FIRSTEMPTY" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="407" partition="1" name="L1_TE5" complex_deadtime="0" definition="(TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="408" partition="1" name="L1_TAU20IM_2TAU12IM_4J12" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;J12[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="4" name="J12_x4" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="409" partition="1" name="L1_TE25.0ETA24" complex_deadtime="0" definition="(TE25.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE25.0ETA24_x1" triggerthreshold="TE25.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="410" partition="1" name="L1_TE5.0ETA24" complex_deadtime="0" definition="(TE5.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE5.0ETA24_x1" triggerthreshold="TE5.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="411" partition="1" name="L1_EM20VH_FIRSTEMPTY" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="412" partition="1" name="L1_EM22VHI_FIRSTEMPTY" complex_deadtime="0" definition="(EM22VHI[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="413" partition="1" name="L1_MU20_FIRSTEMPTY" complex_deadtime="0" definition="(MU20[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="414" partition="1" name="L1_J100_FIRSTEMPTY" complex_deadtime="0" definition="(J100[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="415" partition="1" name="L1_J100.31ETA49_FIRSTEMPTY" complex_deadtime="0" definition="(J100.31ETA49[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J100.31ETA49_x1" triggerthreshold="J100.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP6"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="416" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="417" partition="1" name="L1_TE70.0ETA24" complex_deadtime="0" definition="(TE70.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE70.0ETA24_x1" triggerthreshold="TE70.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="418" partition="1" name="L1_TE40.0ETA24" complex_deadtime="0" definition="(TE40.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="TE40.0ETA24_x1" triggerthreshold="TE40.0ETA24"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="419" partition="1" name="L1_ZDC_A" complex_deadtime="0" definition="(ZDC_A[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ZDC_A_x1" triggerthreshold="ZDC_A"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="420" partition="1" name="L1_ZDC_C" complex_deadtime="0" definition="(ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ZDC_C_x1" triggerthreshold="ZDC_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="421" partition="1" name="L1_ZDC_AND" complex_deadtime="0" definition="(ZDC_AND[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ZDC_AND_x1" triggerthreshold="ZDC_AND"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="422" partition="1" name="L1_ZDC_A_C" complex_deadtime="0" definition="(ZDC_A[x1]&amp;ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ZDC_A_x1" triggerthreshold="ZDC_A"/>
+        <TriggerCondition multi="1" name="ZDC_C_x1" triggerthreshold="ZDC_C"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="423" partition="1" name="L1_EM15VHI" complex_deadtime="0" definition="(EM15VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="424" partition="1" name="L1_EM15I" complex_deadtime="0" definition="(EM15[x1]&amp;EM8I[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="EM8I_x1" triggerthreshold="EM8I"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="425" partition="1" name="L1_3J35.0ETA23" complex_deadtime="0" definition="(J35.0ETA23[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="3" name="J35.0ETA23_x3" triggerthreshold="J35.0ETA23"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="426" partition="1" name="L1_BPH-2M9-2MU4_BPH-0DR15-2MU4" complex_deadtime="0" definition="(2INVM9-2MU4ab[x1]&amp;0DR15-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="2INVM9-2MU4ab_x1" triggerthreshold="2INVM9-2MU4ab"/>
+        <TriggerCondition multi="1" name="0DR15-2MU4ab_x1" triggerthreshold="0DR15-2MU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="427" partition="1" name="L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4" complex_deadtime="0" definition="(2INVM9-MU6ab-MU4ab[x1]&amp;0DR15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="2INVM9-MU6ab-MU4ab_x1" triggerthreshold="2INVM9-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="0DR15-MU6ab-MU4ab_x1" triggerthreshold="0DR15-MU6ab-MU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="428" partition="1" name="L1_MU20_J40" complex_deadtime="0" definition="(MU20[x1]&amp;J40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="429" partition="1" name="L1_TAU40_2TAU12IM_XE40" complex_deadtime="0" definition="(HA40[x1]&amp;HA12IM[x2]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="430" partition="1" name="L1_MU11_TAU20IM" complex_deadtime="0" definition="(MU11[x1]&amp;HA20IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="431" partition="1" name="L1_EM20VH_3EM10VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;EM10VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <TriggerCondition multi="3" name="EM10VH_x3" triggerthreshold="EM10VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="432" partition="1" name="L1_EM20VH_2EM10VH_3EM8VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;EM10VH[x2]&amp;EM8VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
+        <TriggerCondition multi="2" name="EM10VH_x2" triggerthreshold="EM10VH"/>
+        <TriggerCondition multi="3" name="EM8VH_x3" triggerthreshold="EM8VH"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="433" partition="1" name="L1_MU20_XE30" complex_deadtime="0" definition="(MU20[x1]&amp;XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="434" partition="1" name="L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;EM3[x2]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="436" partition="1" name="L1_AFP_A_OR_C_J12" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="437" partition="1" name="L1_EM3_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="438" partition="1" name="L1_EM3_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="439" partition="1" name="L1_MU4_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="440" partition="1" name="L1_MU4_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="441" partition="1" name="L1_AFP_A_AND_C_TE5" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="442" partition="1" name="L1_AFP_A_OR_C_TE5" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <OR>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+            <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+          </AND>
+          <AND>
+            <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+            <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+          </AND>
+        </OR>
+        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="444" partition="1" name="L1_AFP_A_AND_C_SPECTOF_J50" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
+        <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="446" partition="1" name="L1_AFP_A_AND_C_SPECTOF_J75" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;J75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
+        <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
+        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="448" partition="1" name="L1_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="449" partition="1" name="L1_2MU4_J40_XE50" complex_deadtime="0" definition="(MU4[x2]&amp;J40[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="450" partition="1" name="L1_2MU4_J20_XE40_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x2]&amp;J20[x1]&amp;XE40[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="451" partition="1" name="L1_2MU4_J20_XE50_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x2]&amp;J20[x1]&amp;XE50[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="452" partition="1" name="L1_MU4_J30_XE40_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;J30[x1]&amp;XE40[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="453" partition="1" name="L1_MU4_J50_XE50_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;J50[x1]&amp;XE50[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
+        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="454" partition="1" name="L1_MU4_XE60" complex_deadtime="0" definition="(MU4[x1]&amp;XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="456" partition="1" name="L1_AFP_A_AND_C_SPECTOF" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
+        <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="457" partition="1" name="L1_AFP_A_AND_C_SPECTOF_J100" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;J100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
+        <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
+        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="458" partition="1" name="L1_TAU60_2TAU40" complex_deadtime="0" definition="(HA60[x1]&amp;HA40[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/>
+        <TriggerCondition multi="2" name="HA40_x2" triggerthreshold="HA40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="459" partition="1" name="L1_AFP_NSA_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="460" partition="1" name="L1_AFP_NSC_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="461" partition="1" name="L1_AFP_FSA_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="462" partition="1" name="L1_AFP_FSC_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="463" partition="2" name="L1_RD2_BGRP14" complex_deadtime="0" definition="(RNDM2&amp;BGRP0&amp;BGRP14)" trigger_type="0001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM2"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP14"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="464" partition="3" name="L1_RD3_BGRP15" complex_deadtime="0" definition="(RNDM3&amp;BGRP0&amp;BGRP15)" trigger_type="0001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM3"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP15"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="465" partition="1" name="L1_J40.0ETA25_2J30_J20.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J30[x2]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="2" name="J30_x2" triggerthreshold="J30"/>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="466" partition="1" name="L1_LATE-MU10_XE40" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="467" partition="1" name="L1_TAU8_UNPAIRED_NONISO" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="468" partition="1" name="L1_EM7_UNPAIRED_NONISO" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="469" partition="1" name="L1_MU4_UNPAIRED_NONISO" complex_deadtime="0" definition="(MU4[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP5"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="470" partition="1" name="L1_MU4_TE10" complex_deadtime="0" definition="(MU4[x1]&amp;TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="471" partition="1" name="L1_LUCID_BGRP9" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP9)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="472" partition="1" name="L1_LUCID_BGRP11" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP11)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="473" partition="1" name="L1_RD0_BGRP10" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP10)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP10"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="474" partition="1" name="L1_2EM3_VTE70" complex_deadtime="0" definition="(EM3[x2]&amp;!TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <NOT>
+          <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        </NOT>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="479" partition="1" name="L1_2TAU20IM_J25_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J25[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="480" partition="1" name="L1_J85_3J30" complex_deadtime="0" definition="(J85[x1]&amp;J30[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J85_x1" triggerthreshold="J85"/>
+        <TriggerCondition multi="3" name="J30_x3" triggerthreshold="J30"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="481" partition="1" name="L1_TAU25IM_2TAU12IM_J25_3J12" complex_deadtime="0" definition="(HA25IM[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA25IM_x1" triggerthreshold="HA25IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="482" partition="1" name="L1_MU10_TAU12IM_3J12" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="483" partition="1" name="L1_EM7_MU20" complex_deadtime="0" definition="(EM7[x1]&amp;MU20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="484" partition="1" name="L1_EM8VH_MU20" complex_deadtime="0" definition="(EM8VH[x1]&amp;MU20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM8VH_x1" triggerthreshold="EM8VH"/>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="485" partition="1" name="L1_EM7_MU11" complex_deadtime="0" definition="(EM7[x1]&amp;MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
+        <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="486" partition="1" name="L1_2TAU20IM_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="487" partition="1" name="L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;0DR22-MU6ab-MU4ab[x1]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="0DR22-MU6ab-MU4ab_x1" triggerthreshold="0DR22-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="488" partition="1" name="L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;0DR22-MU6ab-MU4ab[x1]&amp;MULT-CMU4ab[x2]&amp;MULT-CMU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="0DR22-MU6ab-MU4ab_x1" triggerthreshold="0DR22-MU6ab-MU4ab"/>
+        <TriggerCondition multi="2" name="MULT-CMU4ab_x2" triggerthreshold="MULT-CMU4ab"/>
+        <TriggerCondition multi="1" name="MULT-CMU6ab_x1" triggerthreshold="MULT-CMU6ab"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="489" partition="1" name="L1_ALFA_B7L1U" complex_deadtime="0" definition="(ALFA_B7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_B7L1U_x1" triggerthreshold="ALFA_B7L1U"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="490" partition="1" name="L1_ALFA_B7L1L" complex_deadtime="0" definition="(ALFA_B7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_B7L1L_x1" triggerthreshold="ALFA_B7L1L"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="491" partition="1" name="L1_ALFA_A7L1U" complex_deadtime="0" definition="(ALFA_A7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_A7L1U_x1" triggerthreshold="ALFA_A7L1U"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="492" partition="1" name="L1_ALFA_A7L1L" complex_deadtime="0" definition="(ALFA_A7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_A7L1L_x1" triggerthreshold="ALFA_A7L1L"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="493" partition="1" name="L1_ALFA_A7R1U" complex_deadtime="0" definition="(ALFA_A7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_A7R1U_x1" triggerthreshold="ALFA_A7R1U"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="494" partition="1" name="L1_ALFA_A7R1L" complex_deadtime="0" definition="(ALFA_A7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_A7R1L_x1" triggerthreshold="ALFA_A7R1L"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="495" partition="1" name="L1_ALFA_B7R1U" complex_deadtime="0" definition="(ALFA_B7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_B7R1U_x1" triggerthreshold="ALFA_B7R1U"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="496" partition="1" name="L1_ALFA_B7R1L" complex_deadtime="0" definition="(ALFA_B7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="ALFA_B7R1L_x1" triggerthreshold="ALFA_B7R1L"/>
+        <InternalTrigger name="BGRP0"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="497" partition="1" name="L1_MU21_FTK" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="498" partition="1" name="L1_MU20_TAU12IM_FTK" complex_deadtime="0" definition="(MU20[x1]&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="499" partition="1" name="L1_MU6_FTK" complex_deadtime="0" definition="(MU6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="500" partition="1" name="L1_MU20_FTK" complex_deadtime="0" definition="(MU20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="501" partition="1" name="L1_TAU12IM_FTK" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="502" partition="1" name="L1_TAU20IM_2TAU12IM_J25_2J20_3J12_FTK" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J20[x2]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="503" partition="1" name="L1_DR-TAU20ITAU12I-J25_FTK" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="504" partition="1" name="L1_4J20_FTK" complex_deadtime="0" definition="(J20[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J20_x4" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="505" partition="1" name="L1_4J15.0ETA25_FTK" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="4" name="J15.0ETA25_x4" triggerthreshold="J15.0ETA25"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="506" partition="1" name="L1_J15_FTK" complex_deadtime="0" definition="(J15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J15_x1" triggerthreshold="J15"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="507" partition="1" name="L1_J40_FTK" complex_deadtime="0" definition="(J40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="508" partition="1" name="L1_J100_FTK" complex_deadtime="0" definition="(J100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="511" partition="1" name="L1_CALREQ2" complex_deadtime="0" definition="(CAL2[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="00110100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="CAL2_x1" triggerthreshold="CAL2"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP2"/>
+      </AND>
+    </TriggerItem>
+  </TriggerMenu>
+  <PrescaleSet name="MC_PhaseII_default_prescale" type="Physics" menuPartition="0">
+    <Prescale ctpid="0" cut="000001" value="1"/>
+    <Prescale ctpid="1" cut="000001" value="1"/>
+    <Prescale ctpid="2" cut="000001" value="1"/>
+    <Prescale ctpid="3" cut="000001" value="1"/>
+    <Prescale ctpid="4" cut="000001" value="1"/>
+    <Prescale ctpid="5" cut="000001" value="1"/>
+    <Prescale ctpid="6" cut="000001" value="1"/>
+    <Prescale ctpid="7" cut="000001" value="1"/>
+    <Prescale ctpid="8" cut="000001" value="1"/>
+    <Prescale ctpid="9" cut="000001" value="1"/>
+    <Prescale ctpid="10" cut="000001" value="1"/>
+    <Prescale ctpid="11" cut="000001" value="1"/>
+    <Prescale ctpid="12" cut="000001" value="1"/>
+    <Prescale ctpid="13" cut="000001" value="1"/>
+    <Prescale ctpid="14" cut="000001" value="1"/>
+    <Prescale ctpid="15" cut="000001" value="1"/>
+    <Prescale ctpid="16" cut="000001" value="1"/>
+    <Prescale ctpid="17" cut="000001" value="1"/>
+    <Prescale ctpid="18" cut="000001" value="1"/>
+    <Prescale ctpid="19" cut="000001" value="1"/>
+    <Prescale ctpid="20" cut="000001" value="1"/>
+    <Prescale ctpid="21" cut="000001" value="1"/>
+    <Prescale ctpid="22" cut="000001" value="1"/>
+    <Prescale ctpid="23" cut="000001" value="1"/>
+    <Prescale ctpid="24" cut="000001" value="1"/>
+    <Prescale ctpid="25" cut="000001" value="1"/>
+    <Prescale ctpid="26" cut="000001" value="1"/>
+    <Prescale ctpid="27" cut="000001" value="1"/>
+    <Prescale ctpid="28" cut="000001" value="1"/>
+    <Prescale ctpid="29" cut="000001" value="1"/>
+    <Prescale ctpid="30" cut="000001" value="1"/>
+    <Prescale ctpid="31" cut="000001" value="1"/>
+    <Prescale ctpid="32" cut="000001" value="1"/>
+    <Prescale ctpid="33" cut="000001" value="1"/>
+    <Prescale ctpid="34" cut="000001" value="1"/>
+    <Prescale ctpid="35" cut="000001" value="1"/>
+    <Prescale ctpid="36" cut="000001" value="1"/>
+    <Prescale ctpid="37" cut="000001" value="1"/>
+    <Prescale ctpid="38" cut="000001" value="1"/>
+    <Prescale ctpid="39" cut="000001" value="1"/>
+    <Prescale ctpid="40" cut="000001" value="1"/>
+    <Prescale ctpid="41" cut="000001" value="1"/>
+    <Prescale ctpid="42" cut="000001" value="1"/>
+    <Prescale ctpid="43" cut="000001" value="1"/>
+    <Prescale ctpid="44" cut="000001" value="1"/>
+    <Prescale ctpid="45" cut="000001" value="1"/>
+    <Prescale ctpid="46" cut="000001" value="1"/>
+    <Prescale ctpid="47" cut="000001" value="1"/>
+    <Prescale ctpid="48" cut="000001" value="1"/>
+    <Prescale ctpid="49" cut="000001" value="1"/>
+    <Prescale ctpid="50" cut="000001" value="1"/>
+    <Prescale ctpid="51" cut="000001" value="1"/>
+    <Prescale ctpid="52" cut="000001" value="1"/>
+    <Prescale ctpid="53" cut="000001" value="1"/>
+    <Prescale ctpid="54" cut="000001" value="1"/>
+    <Prescale ctpid="55" cut="000001" value="1"/>
+    <Prescale ctpid="56" cut="000001" value="1"/>
+    <Prescale ctpid="57" cut="000001" value="1"/>
+    <Prescale ctpid="58" cut="000001" value="1"/>
+    <Prescale ctpid="59" cut="000001" value="1"/>
+    <Prescale ctpid="60" cut="000001" value="1"/>
+    <Prescale ctpid="61" cut="000001" value="1"/>
+    <Prescale ctpid="62" cut="000001" value="1"/>
+    <Prescale ctpid="63" cut="000001" value="1"/>
+    <Prescale ctpid="64" cut="000001" value="1"/>
+    <Prescale ctpid="65" cut="000001" value="1"/>
+    <Prescale ctpid="66" cut="000001" value="1"/>
+    <Prescale ctpid="67" cut="000001" value="1"/>
+    <Prescale ctpid="68" cut="000001" value="1"/>
+    <Prescale ctpid="69" cut="000001" value="1"/>
+    <Prescale ctpid="70" cut="000001" value="1"/>
+    <Prescale ctpid="71" cut="000001" value="1"/>
+    <Prescale ctpid="72" cut="000001" value="1"/>
+    <Prescale ctpid="73" cut="000001" value="1"/>
+    <Prescale ctpid="74" cut="000001" value="1"/>
+    <Prescale ctpid="75" cut="000001" value="1"/>
+    <Prescale ctpid="76" cut="000001" value="1"/>
+    <Prescale ctpid="77" cut="-000001" value="-1"/>
+    <Prescale ctpid="78" cut="000001" value="1"/>
+    <Prescale ctpid="79" cut="-000001" value="-1"/>
+    <Prescale ctpid="80" cut="-000001" value="-1"/>
+    <Prescale ctpid="81" cut="000001" value="1"/>
+    <Prescale ctpid="82" cut="000001" value="1"/>
+    <Prescale ctpid="83" cut="000001" value="1"/>
+    <Prescale ctpid="84" cut="000001" value="1"/>
+    <Prescale ctpid="85" cut="000001" value="1"/>
+    <Prescale ctpid="86" cut="000001" value="1"/>
+    <Prescale ctpid="87" cut="000001" value="1"/>
+    <Prescale ctpid="88" cut="000001" value="1"/>
+    <Prescale ctpid="89" cut="000001" value="1"/>
+    <Prescale ctpid="90" cut="000001" value="1"/>
+    <Prescale ctpid="91" cut="000001" value="1"/>
+    <Prescale ctpid="92" cut="000001" value="1"/>
+    <Prescale ctpid="93" cut="000001" value="1"/>
+    <Prescale ctpid="94" cut="000001" value="1"/>
+    <Prescale ctpid="95" cut="000001" value="1"/>
+    <Prescale ctpid="96" cut="000001" value="1"/>
+    <Prescale ctpid="97" cut="000001" value="1"/>
+    <Prescale ctpid="98" cut="000001" value="1"/>
+    <Prescale ctpid="99" cut="000001" value="1"/>
+    <Prescale ctpid="100" cut="000001" value="1"/>
+    <Prescale ctpid="101" cut="000001" value="1"/>
+    <Prescale ctpid="102" cut="000001" value="1"/>
+    <Prescale ctpid="103" cut="000001" value="1"/>
+    <Prescale ctpid="104" cut="000001" value="1"/>
+    <Prescale ctpid="105" cut="000001" value="1"/>
+    <Prescale ctpid="106" cut="000001" value="1"/>
+    <Prescale ctpid="107" cut="000001" value="1"/>
+    <Prescale ctpid="108" cut="-000001" value="-1"/>
+    <Prescale ctpid="109" cut="000001" value="1"/>
+    <Prescale ctpid="110" cut="000001" value="1"/>
+    <Prescale ctpid="111" cut="000001" value="1"/>
+    <Prescale ctpid="112" cut="000001" value="1"/>
+    <Prescale ctpid="113" cut="000001" value="1"/>
+    <Prescale ctpid="114" cut="000001" value="1"/>
+    <Prescale ctpid="115" cut="000001" value="1"/>
+    <Prescale ctpid="116" cut="000001" value="1"/>
+    <Prescale ctpid="117" cut="000001" value="1"/>
+    <Prescale ctpid="118" cut="000001" value="1"/>
+    <Prescale ctpid="119" cut="000001" value="1"/>
+    <Prescale ctpid="120" cut="000001" value="1"/>
+    <Prescale ctpid="121" cut="000001" value="1"/>
+    <Prescale ctpid="122" cut="000001" value="1"/>
+    <Prescale ctpid="123" cut="000001" value="1"/>
+    <Prescale ctpid="124" cut="-000001" value="-1"/>
+    <Prescale ctpid="125" cut="000001" value="1"/>
+    <Prescale ctpid="126" cut="000001" value="1"/>
+    <Prescale ctpid="127" cut="-000001" value="-1"/>
+    <Prescale ctpid="128" cut="000001" value="1"/>
+    <Prescale ctpid="129" cut="-000001" value="-1"/>
+    <Prescale ctpid="130" cut="000001" value="1"/>
+    <Prescale ctpid="131" cut="000001" value="1"/>
+    <Prescale ctpid="132" cut="000001" value="1"/>
+    <Prescale ctpid="133" cut="000001" value="1"/>
+    <Prescale ctpid="134" cut="-000001" value="-1"/>
+    <Prescale ctpid="135" cut="000001" value="1"/>
+    <Prescale ctpid="136" cut="000001" value="1"/>
+    <Prescale ctpid="137" cut="000001" value="1"/>
+    <Prescale ctpid="138" cut="000001" value="1"/>
+    <Prescale ctpid="139" cut="000001" value="1"/>
+    <Prescale ctpid="140" cut="000001" value="1"/>
+    <Prescale ctpid="141" cut="000001" value="1"/>
+    <Prescale ctpid="142" cut="000001" value="1"/>
+    <Prescale ctpid="143" cut="000001" value="1"/>
+    <Prescale ctpid="144" cut="000001" value="1"/>
+    <Prescale ctpid="145" cut="000001" value="1"/>
+    <Prescale ctpid="146" cut="000001" value="1"/>
+    <Prescale ctpid="147" cut="000001" value="1"/>
+    <Prescale ctpid="148" cut="000001" value="1"/>
+    <Prescale ctpid="149" cut="000001" value="1"/>
+    <Prescale ctpid="150" cut="000001" value="1"/>
+    <Prescale ctpid="151" cut="000001" value="1"/>
+    <Prescale ctpid="152" cut="-000001" value="-1"/>
+    <Prescale ctpid="153" cut="-000001" value="-1"/>
+    <Prescale ctpid="154" cut="000001" value="1"/>
+    <Prescale ctpid="155" cut="000001" value="1"/>
+    <Prescale ctpid="156" cut="-000001" value="-1"/>
+    <Prescale ctpid="157" cut="000001" value="1"/>
+    <Prescale ctpid="158" cut="000001" value="1"/>
+    <Prescale ctpid="159" cut="000001" value="1"/>
+    <Prescale ctpid="160" cut="000001" value="1"/>
+    <Prescale ctpid="161" cut="000001" value="1"/>
+    <Prescale ctpid="162" cut="000001" value="1"/>
+    <Prescale ctpid="163" cut="000001" value="1"/>
+    <Prescale ctpid="164" cut="000001" value="1"/>
+    <Prescale ctpid="165" cut="000001" value="1"/>
+    <Prescale ctpid="166" cut="000001" value="1"/>
+    <Prescale ctpid="167" cut="000001" value="1"/>
+    <Prescale ctpid="168" cut="000001" value="1"/>
+    <Prescale ctpid="169" cut="000001" value="1"/>
+    <Prescale ctpid="170" cut="000001" value="1"/>
+    <Prescale ctpid="171" cut="000001" value="1"/>
+    <Prescale ctpid="172" cut="000001" value="1"/>
+    <Prescale ctpid="173" cut="000001" value="1"/>
+    <Prescale ctpid="174" cut="000001" value="1"/>
+    <Prescale ctpid="175" cut="000001" value="1"/>
+    <Prescale ctpid="176" cut="000001" value="1"/>
+    <Prescale ctpid="177" cut="000001" value="1"/>
+    <Prescale ctpid="178" cut="-000001" value="-1"/>
+    <Prescale ctpid="179" cut="000001" value="1"/>
+    <Prescale ctpid="180" cut="000001" value="1"/>
+    <Prescale ctpid="181" cut="000001" value="1"/>
+    <Prescale ctpid="182" cut="000001" value="1"/>
+    <Prescale ctpid="183" cut="000001" value="1"/>
+    <Prescale ctpid="184" cut="000001" value="1"/>
+    <Prescale ctpid="185" cut="000001" value="1"/>
+    <Prescale ctpid="186" cut="000001" value="1"/>
+    <Prescale ctpid="187" cut="000001" value="1"/>
+    <Prescale ctpid="188" cut="000001" value="1"/>
+    <Prescale ctpid="189" cut="000001" value="1"/>
+    <Prescale ctpid="190" cut="000001" value="1"/>
+    <Prescale ctpid="191" cut="000001" value="1"/>
+    <Prescale ctpid="192" cut="000001" value="1"/>
+    <Prescale ctpid="193" cut="000001" value="1"/>
+    <Prescale ctpid="194" cut="000001" value="1"/>
+    <Prescale ctpid="195" cut="000001" value="1"/>
+    <Prescale ctpid="196" cut="000001" value="1"/>
+    <Prescale ctpid="197" cut="000001" value="1"/>
+    <Prescale ctpid="198" cut="000001" value="1"/>
+    <Prescale ctpid="199" cut="000001" value="1"/>
+    <Prescale ctpid="200" cut="000001" value="1"/>
+    <Prescale ctpid="201" cut="000001" value="1"/>
+    <Prescale ctpid="202" cut="000001" value="1"/>
+    <Prescale ctpid="203" cut="000001" value="1"/>
+    <Prescale ctpid="204" cut="000001" value="1"/>
+    <Prescale ctpid="205" cut="000001" value="1"/>
+    <Prescale ctpid="206" cut="000001" value="1"/>
+    <Prescale ctpid="207" cut="000001" value="1"/>
+    <Prescale ctpid="208" cut="000001" value="1"/>
+    <Prescale ctpid="209" cut="000001" value="1"/>
+    <Prescale ctpid="210" cut="000001" value="1"/>
+    <Prescale ctpid="211" cut="000001" value="1"/>
+    <Prescale ctpid="212" cut="000001" value="1"/>
+    <Prescale ctpid="213" cut="000001" value="1"/>
+    <Prescale ctpid="214" cut="000001" value="1"/>
+    <Prescale ctpid="215" cut="000001" value="1"/>
+    <Prescale ctpid="216" cut="000001" value="1"/>
+    <Prescale ctpid="217" cut="000001" value="1"/>
+    <Prescale ctpid="218" cut="000001" value="1"/>
+    <Prescale ctpid="219" cut="000001" value="1"/>
+    <Prescale ctpid="220" cut="000001" value="1"/>
+    <Prescale ctpid="221" cut="000001" value="1"/>
+    <Prescale ctpid="222" cut="000001" value="1"/>
+    <Prescale ctpid="223" cut="000001" value="1"/>
+    <Prescale ctpid="224" cut="000001" value="1"/>
+    <Prescale ctpid="225" cut="000001" value="1"/>
+    <Prescale ctpid="226" cut="000001" value="1"/>
+    <Prescale ctpid="227" cut="000001" value="1"/>
+    <Prescale ctpid="228" cut="000001" value="1"/>
+    <Prescale ctpid="229" cut="000001" value="1"/>
+    <Prescale ctpid="230" cut="000001" value="1"/>
+    <Prescale ctpid="231" cut="000001" value="1"/>
+    <Prescale ctpid="232" cut="000001" value="1"/>
+    <Prescale ctpid="233" cut="000001" value="1"/>
+    <Prescale ctpid="234" cut="000001" value="1"/>
+    <Prescale ctpid="235" cut="000001" value="1"/>
+    <Prescale ctpid="236" cut="000001" value="1"/>
+    <Prescale ctpid="237" cut="000001" value="1"/>
+    <Prescale ctpid="238" cut="000001" value="1"/>
+    <Prescale ctpid="239" cut="-000001" value="-1"/>
+    <Prescale ctpid="240" cut="000001" value="1"/>
+    <Prescale ctpid="241" cut="000001" value="1"/>
+    <Prescale ctpid="242" cut="000001" value="1"/>
+    <Prescale ctpid="243" cut="000001" value="1"/>
+    <Prescale ctpid="244" cut="-000001" value="-1"/>
+    <Prescale ctpid="245" cut="000001" value="1"/>
+    <Prescale ctpid="246" cut="000001" value="1"/>
+    <Prescale ctpid="247" cut="000001" value="1"/>
+    <Prescale ctpid="248" cut="000001" value="1"/>
+    <Prescale ctpid="249" cut="000001" value="1"/>
+    <Prescale ctpid="250" cut="000001" value="1"/>
+    <Prescale ctpid="251" cut="000001" value="1"/>
+    <Prescale ctpid="252" cut="000001" value="1"/>
+    <Prescale ctpid="253" cut="000001" value="1"/>
+    <Prescale ctpid="254" cut="000001" value="1"/>
+    <Prescale ctpid="255" cut="000001" value="1"/>
+    <Prescale ctpid="256" cut="000001" value="1"/>
+    <Prescale ctpid="257" cut="000001" value="1"/>
+    <Prescale ctpid="258" cut="000001" value="1"/>
+    <Prescale ctpid="259" cut="000001" value="1"/>
+    <Prescale ctpid="260" cut="000001" value="1"/>
+    <Prescale ctpid="261" cut="000001" value="1"/>
+    <Prescale ctpid="262" cut="000001" value="1"/>
+    <Prescale ctpid="263" cut="000001" value="1"/>
+    <Prescale ctpid="264" cut="000001" value="1"/>
+    <Prescale ctpid="265" cut="-000001" value="-1"/>
+    <Prescale ctpid="266" cut="000001" value="1"/>
+    <Prescale ctpid="267" cut="000001" value="1"/>
+    <Prescale ctpid="268" cut="000001" value="1"/>
+    <Prescale ctpid="269" cut="000001" value="1"/>
+    <Prescale ctpid="270" cut="000001" value="1"/>
+    <Prescale ctpid="271" cut="000001" value="1"/>
+    <Prescale ctpid="272" cut="000001" value="1"/>
+    <Prescale ctpid="273" cut="000001" value="1"/>
+    <Prescale ctpid="274" cut="-000001" value="-1"/>
+    <Prescale ctpid="275" cut="000001" value="1"/>
+    <Prescale ctpid="276" cut="000001" value="1"/>
+    <Prescale ctpid="277" cut="000001" value="1"/>
+    <Prescale ctpid="278" cut="000001" value="1"/>
+    <Prescale ctpid="279" cut="000001" value="1"/>
+    <Prescale ctpid="280" cut="000001" value="1"/>
+    <Prescale ctpid="281" cut="000001" value="1"/>
+    <Prescale ctpid="282" cut="000001" value="1"/>
+    <Prescale ctpid="283" cut="000001" value="1"/>
+    <Prescale ctpid="284" cut="-000001" value="-1"/>
+    <Prescale ctpid="285" cut="000001" value="1"/>
+    <Prescale ctpid="286" cut="000001" value="1"/>
+    <Prescale ctpid="287" cut="-000001" value="-1"/>
+    <Prescale ctpid="288" cut="000001" value="1"/>
+    <Prescale ctpid="289" cut="-000001" value="-1"/>
+    <Prescale ctpid="290" cut="000001" value="1"/>
+    <Prescale ctpid="291" cut="000001" value="1"/>
+    <Prescale ctpid="292" cut="000001" value="1"/>
+    <Prescale ctpid="293" cut="000001" value="1"/>
+    <Prescale ctpid="294" cut="000001" value="1"/>
+    <Prescale ctpid="295" cut="000001" value="1"/>
+    <Prescale ctpid="296" cut="-000001" value="-1"/>
+    <Prescale ctpid="297" cut="-000001" value="-1"/>
+    <Prescale ctpid="298" cut="-000001" value="-1"/>
+    <Prescale ctpid="299" cut="000001" value="1"/>
+    <Prescale ctpid="300" cut="000001" value="1"/>
+    <Prescale ctpid="301" cut="000001" value="1"/>
+    <Prescale ctpid="302" cut="000001" value="1"/>
+    <Prescale ctpid="303" cut="000001" value="1"/>
+    <Prescale ctpid="304" cut="000001" value="1"/>
+    <Prescale ctpid="305" cut="000001" value="1"/>
+    <Prescale ctpid="306" cut="-000001" value="-1"/>
+    <Prescale ctpid="307" cut="-000001" value="-1"/>
+    <Prescale ctpid="308" cut="000001" value="1"/>
+    <Prescale ctpid="309" cut="000001" value="1"/>
+    <Prescale ctpid="310" cut="-000001" value="-1"/>
+    <Prescale ctpid="311" cut="-000001" value="-1"/>
+    <Prescale ctpid="312" cut="000001" value="1"/>
+    <Prescale ctpid="313" cut="000001" value="1"/>
+    <Prescale ctpid="314" cut="000001" value="1"/>
+    <Prescale ctpid="315" cut="000001" value="1"/>
+    <Prescale ctpid="316" cut="000001" value="1"/>
+    <Prescale ctpid="317" cut="000001" value="1"/>
+    <Prescale ctpid="318" cut="000001" value="1"/>
+    <Prescale ctpid="319" cut="000001" value="1"/>
+    <Prescale ctpid="320" cut="000001" value="1"/>
+    <Prescale ctpid="321" cut="000001" value="1"/>
+    <Prescale ctpid="322" cut="000001" value="1"/>
+    <Prescale ctpid="323" cut="000001" value="1"/>
+    <Prescale ctpid="324" cut="000001" value="1"/>
+    <Prescale ctpid="325" cut="000001" value="1"/>
+    <Prescale ctpid="326" cut="000001" value="1"/>
+    <Prescale ctpid="327" cut="000001" value="1"/>
+    <Prescale ctpid="328" cut="000001" value="1"/>
+    <Prescale ctpid="329" cut="000001" value="1"/>
+    <Prescale ctpid="330" cut="000001" value="1"/>
+    <Prescale ctpid="331" cut="-000001" value="-1"/>
+    <Prescale ctpid="332" cut="000001" value="1"/>
+    <Prescale ctpid="333" cut="000001" value="1"/>
+    <Prescale ctpid="334" cut="000001" value="1"/>
+    <Prescale ctpid="335" cut="000001" value="1"/>
+    <Prescale ctpid="336" cut="000001" value="1"/>
+    <Prescale ctpid="337" cut="000001" value="1"/>
+    <Prescale ctpid="338" cut="000001" value="1"/>
+    <Prescale ctpid="339" cut="000001" value="1"/>
+    <Prescale ctpid="340" cut="000001" value="1"/>
+    <Prescale ctpid="341" cut="000001" value="1"/>
+    <Prescale ctpid="342" cut="000001" value="1"/>
+    <Prescale ctpid="343" cut="000001" value="1"/>
+    <Prescale ctpid="344" cut="000001" value="1"/>
+    <Prescale ctpid="345" cut="000001" value="1"/>
+    <Prescale ctpid="346" cut="000001" value="1"/>
+    <Prescale ctpid="347" cut="000001" value="1"/>
+    <Prescale ctpid="348" cut="000001" value="1"/>
+    <Prescale ctpid="349" cut="000001" value="1"/>
+    <Prescale ctpid="350" cut="000001" value="1"/>
+    <Prescale ctpid="351" cut="000001" value="1"/>
+    <Prescale ctpid="352" cut="000001" value="1"/>
+    <Prescale ctpid="353" cut="000001" value="1"/>
+    <Prescale ctpid="354" cut="000001" value="1"/>
+    <Prescale ctpid="355" cut="000001" value="1"/>
+    <Prescale ctpid="356" cut="000001" value="1"/>
+    <Prescale ctpid="357" cut="000001" value="1"/>
+    <Prescale ctpid="358" cut="000001" value="1"/>
+    <Prescale ctpid="359" cut="-000001" value="-1"/>
+    <Prescale ctpid="360" cut="-000001" value="-1"/>
+    <Prescale ctpid="361" cut="-000001" value="-1"/>
+    <Prescale ctpid="362" cut="000001" value="1"/>
+    <Prescale ctpid="363" cut="000001" value="1"/>
+    <Prescale ctpid="364" cut="000001" value="1"/>
+    <Prescale ctpid="365" cut="000001" value="1"/>
+    <Prescale ctpid="366" cut="000001" value="1"/>
+    <Prescale ctpid="367" cut="000001" value="1"/>
+    <Prescale ctpid="368" cut="000001" value="1"/>
+    <Prescale ctpid="369" cut="000001" value="1"/>
+    <Prescale ctpid="370" cut="000001" value="1"/>
+    <Prescale ctpid="371" cut="000001" value="1"/>
+    <Prescale ctpid="372" cut="000001" value="1"/>
+    <Prescale ctpid="373" cut="000001" value="1"/>
+    <Prescale ctpid="374" cut="000001" value="1"/>
+    <Prescale ctpid="375" cut="000001" value="1"/>
+    <Prescale ctpid="376" cut="000001" value="1"/>
+    <Prescale ctpid="377" cut="000001" value="1"/>
+    <Prescale ctpid="378" cut="000001" value="1"/>
+    <Prescale ctpid="379" cut="000001" value="1"/>
+    <Prescale ctpid="380" cut="000001" value="1"/>
+    <Prescale ctpid="381" cut="000001" value="1"/>
+    <Prescale ctpid="382" cut="000001" value="1"/>
+    <Prescale ctpid="383" cut="000001" value="1"/>
+    <Prescale ctpid="384" cut="000001" value="1"/>
+    <Prescale ctpid="385" cut="000001" value="1"/>
+    <Prescale ctpid="386" cut="000001" value="1"/>
+    <Prescale ctpid="387" cut="000001" value="1"/>
+    <Prescale ctpid="388" cut="000001" value="1"/>
+    <Prescale ctpid="389" cut="000001" value="1"/>
+    <Prescale ctpid="390" cut="000001" value="1"/>
+    <Prescale ctpid="391" cut="000001" value="1"/>
+    <Prescale ctpid="392" cut="000001" value="1"/>
+    <Prescale ctpid="393" cut="000001" value="1"/>
+    <Prescale ctpid="394" cut="000001" value="1"/>
+    <Prescale ctpid="395" cut="000001" value="1"/>
+    <Prescale ctpid="396" cut="000001" value="1"/>
+    <Prescale ctpid="397" cut="000001" value="1"/>
+    <Prescale ctpid="398" cut="000001" value="1"/>
+    <Prescale ctpid="399" cut="000001" value="1"/>
+    <Prescale ctpid="400" cut="000001" value="1"/>
+    <Prescale ctpid="401" cut="000001" value="1"/>
+    <Prescale ctpid="402" cut="000001" value="1"/>
+    <Prescale ctpid="403" cut="000001" value="1"/>
+    <Prescale ctpid="404" cut="000001" value="1"/>
+    <Prescale ctpid="405" cut="000001" value="1"/>
+    <Prescale ctpid="406" cut="000001" value="1"/>
+    <Prescale ctpid="407" cut="000001" value="1"/>
+    <Prescale ctpid="408" cut="000001" value="1"/>
+    <Prescale ctpid="409" cut="000001" value="1"/>
+    <Prescale ctpid="410" cut="000001" value="1"/>
+    <Prescale ctpid="411" cut="000001" value="1"/>
+    <Prescale ctpid="412" cut="000001" value="1"/>
+    <Prescale ctpid="413" cut="000001" value="1"/>
+    <Prescale ctpid="414" cut="000001" value="1"/>
+    <Prescale ctpid="415" cut="000001" value="1"/>
+    <Prescale ctpid="416" cut="000001" value="1"/>
+    <Prescale ctpid="417" cut="000001" value="1"/>
+    <Prescale ctpid="418" cut="000001" value="1"/>
+    <Prescale ctpid="419" cut="000001" value="1"/>
+    <Prescale ctpid="420" cut="000001" value="1"/>
+    <Prescale ctpid="421" cut="000001" value="1"/>
+    <Prescale ctpid="422" cut="000001" value="1"/>
+    <Prescale ctpid="423" cut="000001" value="1"/>
+    <Prescale ctpid="424" cut="000001" value="1"/>
+    <Prescale ctpid="425" cut="000001" value="1"/>
+    <Prescale ctpid="426" cut="000001" value="1"/>
+    <Prescale ctpid="427" cut="000001" value="1"/>
+    <Prescale ctpid="428" cut="000001" value="1"/>
+    <Prescale ctpid="429" cut="000001" value="1"/>
+    <Prescale ctpid="430" cut="000001" value="1"/>
+    <Prescale ctpid="431" cut="000001" value="1"/>
+    <Prescale ctpid="432" cut="000001" value="1"/>
+    <Prescale ctpid="433" cut="000001" value="1"/>
+    <Prescale ctpid="434" cut="000001" value="1"/>
+    <Prescale ctpid="435" cut="-000001" value="-1"/>
+    <Prescale ctpid="436" cut="000001" value="1"/>
+    <Prescale ctpid="437" cut="000001" value="1"/>
+    <Prescale ctpid="438" cut="000001" value="1"/>
+    <Prescale ctpid="439" cut="000001" value="1"/>
+    <Prescale ctpid="440" cut="000001" value="1"/>
+    <Prescale ctpid="441" cut="000001" value="1"/>
+    <Prescale ctpid="442" cut="000001" value="1"/>
+    <Prescale ctpid="443" cut="-000001" value="-1"/>
+    <Prescale ctpid="444" cut="000001" value="1"/>
+    <Prescale ctpid="445" cut="-000001" value="-1"/>
+    <Prescale ctpid="446" cut="000001" value="1"/>
+    <Prescale ctpid="447" cut="-000001" value="-1"/>
+    <Prescale ctpid="448" cut="000001" value="1"/>
+    <Prescale ctpid="449" cut="000001" value="1"/>
+    <Prescale ctpid="450" cut="000001" value="1"/>
+    <Prescale ctpid="451" cut="000001" value="1"/>
+    <Prescale ctpid="452" cut="000001" value="1"/>
+    <Prescale ctpid="453" cut="000001" value="1"/>
+    <Prescale ctpid="454" cut="000001" value="1"/>
+    <Prescale ctpid="455" cut="-000001" value="-1"/>
+    <Prescale ctpid="456" cut="000001" value="1"/>
+    <Prescale ctpid="457" cut="000001" value="1"/>
+    <Prescale ctpid="458" cut="000001" value="1"/>
+    <Prescale ctpid="459" cut="000001" value="1"/>
+    <Prescale ctpid="460" cut="000001" value="1"/>
+    <Prescale ctpid="461" cut="000001" value="1"/>
+    <Prescale ctpid="462" cut="000001" value="1"/>
+    <Prescale ctpid="463" cut="000001" value="1"/>
+    <Prescale ctpid="464" cut="000001" value="1"/>
+    <Prescale ctpid="465" cut="000001" value="1"/>
+    <Prescale ctpid="466" cut="000001" value="1"/>
+    <Prescale ctpid="467" cut="000001" value="1"/>
+    <Prescale ctpid="468" cut="000001" value="1"/>
+    <Prescale ctpid="469" cut="000001" value="1"/>
+    <Prescale ctpid="470" cut="000001" value="1"/>
+    <Prescale ctpid="471" cut="000001" value="1"/>
+    <Prescale ctpid="472" cut="000001" value="1"/>
+    <Prescale ctpid="473" cut="000001" value="1"/>
+    <Prescale ctpid="474" cut="000001" value="1"/>
+    <Prescale ctpid="475" cut="-000001" value="-1"/>
+    <Prescale ctpid="476" cut="-000001" value="-1"/>
+    <Prescale ctpid="477" cut="-000001" value="-1"/>
+    <Prescale ctpid="478" cut="-000001" value="-1"/>
+    <Prescale ctpid="479" cut="000001" value="1"/>
+    <Prescale ctpid="480" cut="000001" value="1"/>
+    <Prescale ctpid="481" cut="000001" value="1"/>
+    <Prescale ctpid="482" cut="000001" value="1"/>
+    <Prescale ctpid="483" cut="000001" value="1"/>
+    <Prescale ctpid="484" cut="000001" value="1"/>
+    <Prescale ctpid="485" cut="000001" value="1"/>
+    <Prescale ctpid="486" cut="000001" value="1"/>
+    <Prescale ctpid="487" cut="000001" value="1"/>
+    <Prescale ctpid="488" cut="000001" value="1"/>
+    <Prescale ctpid="489" cut="000001" value="1"/>
+    <Prescale ctpid="490" cut="000001" value="1"/>
+    <Prescale ctpid="491" cut="000001" value="1"/>
+    <Prescale ctpid="492" cut="000001" value="1"/>
+    <Prescale ctpid="493" cut="000001" value="1"/>
+    <Prescale ctpid="494" cut="000001" value="1"/>
+    <Prescale ctpid="495" cut="000001" value="1"/>
+    <Prescale ctpid="496" cut="000001" value="1"/>
+    <Prescale ctpid="497" cut="000001" value="1"/>
+    <Prescale ctpid="498" cut="000001" value="1"/>
+    <Prescale ctpid="499" cut="000001" value="1"/>
+    <Prescale ctpid="500" cut="000001" value="1"/>
+    <Prescale ctpid="501" cut="000001" value="1"/>
+    <Prescale ctpid="502" cut="000001" value="1"/>
+    <Prescale ctpid="503" cut="000001" value="1"/>
+    <Prescale ctpid="504" cut="000001" value="1"/>
+    <Prescale ctpid="505" cut="000001" value="1"/>
+    <Prescale ctpid="506" cut="000001" value="1"/>
+    <Prescale ctpid="507" cut="000001" value="1"/>
+    <Prescale ctpid="508" cut="000001" value="1"/>
+    <Prescale ctpid="509" cut="-000001" value="-1"/>
+    <Prescale ctpid="510" cut="-000001" value="-1"/>
+    <Prescale ctpid="511" cut="000001" value="1"/>
+  </PrescaleSet>
+  <TriggerCounterList>
+    <TriggerCounter name="1AFP_FSA_LOG" type="CTPIN">
+      <TriggerCondition name="1AFP_FSA_LOG" triggerthreshold="AFP_FSA_LOG" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_FSA_SIT" type="CTPIN">
+      <TriggerCondition name="1AFP_FSA_SIT" triggerthreshold="AFP_FSA_SIT" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_FSA_TOF" type="CTPIN">
+      <TriggerCondition name="1AFP_FSA_TOF" triggerthreshold="AFP_FSA_TOF" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_FSC_LOG" type="CTPIN">
+      <TriggerCondition name="1AFP_FSC_LOG" triggerthreshold="AFP_FSC_LOG" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_FSC_SIT" type="CTPIN">
+      <TriggerCondition name="1AFP_FSC_SIT" triggerthreshold="AFP_FSC_SIT" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_FSC_TOF" type="CTPIN">
+      <TriggerCondition name="1AFP_FSC_TOF" triggerthreshold="AFP_FSC_TOF" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_NSA" type="CTPIN">
+      <TriggerCondition name="1AFP_NSA" triggerthreshold="AFP_NSA" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1AFP_NSC" type="CTPIN">
+      <TriggerCondition name="1AFP_NSC" triggerthreshold="AFP_NSC" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BCM_AtoC" type="CTPIN">
+      <TriggerCondition name="1BCM_AtoC" triggerthreshold="BCM_AtoC" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BCM_Comb" type="CTPIN">
+      <TriggerCondition name="1BCM_Comb" triggerthreshold="BCM_Comb" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2BCM_Comb" type="CTPIN">
+      <TriggerCondition name="2BCM_Comb" triggerthreshold="BCM_Comb" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3BCM_Comb" type="CTPIN">
+      <TriggerCondition name="3BCM_Comb" triggerthreshold="BCM_Comb" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4BCM_Comb" type="CTPIN">
+      <TriggerCondition name="4BCM_Comb" triggerthreshold="BCM_Comb" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5BCM_Comb" type="CTPIN">
+      <TriggerCondition name="5BCM_Comb" triggerthreshold="BCM_Comb" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6BCM_Comb" type="CTPIN">
+      <TriggerCondition name="6BCM_Comb" triggerthreshold="BCM_Comb" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7BCM_Comb" type="CTPIN">
+      <TriggerCondition name="7BCM_Comb" triggerthreshold="BCM_Comb" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BCM_CtoA" type="CTPIN">
+      <TriggerCondition name="1BCM_CtoA" triggerthreshold="BCM_CtoA" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BCM_Wide" type="CTPIN">
+      <TriggerCondition name="1BCM_Wide" triggerthreshold="BCM_Wide" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BPTX0" type="CTPIN">
+      <TriggerCondition name="1BPTX0" triggerthreshold="BPTX0" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1BPTX1" type="CTPIN">
+      <TriggerCondition name="1BPTX1" triggerthreshold="BPTX1" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1CAL0" type="CTPIN">
+      <TriggerCondition name="1CAL0" triggerthreshold="CAL0" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1CAL1" type="CTPIN">
+      <TriggerCondition name="1CAL1" triggerthreshold="CAL1" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1CAL2" type="CTPIN">
+      <TriggerCondition name="1CAL2" triggerthreshold="CAL2" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM10VH" type="CTPIN">
+      <TriggerCondition name="1EM10VH" triggerthreshold="EM10VH" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM10VH" type="CTPIN">
+      <TriggerCondition name="2EM10VH" triggerthreshold="EM10VH" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM10VH" type="CTPIN">
+      <TriggerCondition name="3EM10VH" triggerthreshold="EM10VH" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM10VH" type="CTPIN">
+      <TriggerCondition name="4EM10VH" triggerthreshold="EM10VH" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM10VH" type="CTPIN">
+      <TriggerCondition name="5EM10VH" triggerthreshold="EM10VH" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM10VH" type="CTPIN">
+      <TriggerCondition name="6EM10VH" triggerthreshold="EM10VH" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM10VH" type="CTPIN">
+      <TriggerCondition name="7EM10VH" triggerthreshold="EM10VH" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM12" type="CTPIN">
+      <TriggerCondition name="1EM12" triggerthreshold="EM12" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM12" type="CTPIN">
+      <TriggerCondition name="2EM12" triggerthreshold="EM12" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM12" type="CTPIN">
+      <TriggerCondition name="3EM12" triggerthreshold="EM12" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM12" type="CTPIN">
+      <TriggerCondition name="4EM12" triggerthreshold="EM12" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM12" type="CTPIN">
+      <TriggerCondition name="5EM12" triggerthreshold="EM12" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM12" type="CTPIN">
+      <TriggerCondition name="6EM12" triggerthreshold="EM12" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM12" type="CTPIN">
+      <TriggerCondition name="7EM12" triggerthreshold="EM12" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM15" type="CTPIN">
+      <TriggerCondition name="1EM15" triggerthreshold="EM15" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM15" type="CTPIN">
+      <TriggerCondition name="2EM15" triggerthreshold="EM15" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM15" type="CTPIN">
+      <TriggerCondition name="3EM15" triggerthreshold="EM15" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM15" type="CTPIN">
+      <TriggerCondition name="4EM15" triggerthreshold="EM15" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM15" type="CTPIN">
+      <TriggerCondition name="5EM15" triggerthreshold="EM15" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM15" type="CTPIN">
+      <TriggerCondition name="6EM15" triggerthreshold="EM15" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM15" type="CTPIN">
+      <TriggerCondition name="7EM15" triggerthreshold="EM15" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM15VH" type="CTPIN">
+      <TriggerCondition name="1EM15VH" triggerthreshold="EM15VH" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM15VH" type="CTPIN">
+      <TriggerCondition name="2EM15VH" triggerthreshold="EM15VH" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM15VH" type="CTPIN">
+      <TriggerCondition name="3EM15VH" triggerthreshold="EM15VH" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM15VH" type="CTPIN">
+      <TriggerCondition name="4EM15VH" triggerthreshold="EM15VH" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM15VH" type="CTPIN">
+      <TriggerCondition name="5EM15VH" triggerthreshold="EM15VH" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM15VH" type="CTPIN">
+      <TriggerCondition name="6EM15VH" triggerthreshold="EM15VH" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM15VH" type="CTPIN">
+      <TriggerCondition name="7EM15VH" triggerthreshold="EM15VH" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM15VHI" type="CTPIN">
+      <TriggerCondition name="1EM15VHI" triggerthreshold="EM15VHI" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM15VHI" type="CTPIN">
+      <TriggerCondition name="2EM15VHI" triggerthreshold="EM15VHI" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM15VHI" type="CTPIN">
+      <TriggerCondition name="3EM15VHI" triggerthreshold="EM15VHI" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM15VHI" type="CTPIN">
+      <TriggerCondition name="4EM15VHI" triggerthreshold="EM15VHI" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM15VHI" type="CTPIN">
+      <TriggerCondition name="5EM15VHI" triggerthreshold="EM15VHI" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM15VHI" type="CTPIN">
+      <TriggerCondition name="6EM15VHI" triggerthreshold="EM15VHI" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM15VHI" type="CTPIN">
+      <TriggerCondition name="7EM15VHI" triggerthreshold="EM15VHI" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM18VHI" type="CTPIN">
+      <TriggerCondition name="1EM18VHI" triggerthreshold="EM18VHI" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM18VHI" type="CTPIN">
+      <TriggerCondition name="2EM18VHI" triggerthreshold="EM18VHI" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM18VHI" type="CTPIN">
+      <TriggerCondition name="3EM18VHI" triggerthreshold="EM18VHI" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM18VHI" type="CTPIN">
+      <TriggerCondition name="4EM18VHI" triggerthreshold="EM18VHI" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM18VHI" type="CTPIN">
+      <TriggerCondition name="5EM18VHI" triggerthreshold="EM18VHI" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM18VHI" type="CTPIN">
+      <TriggerCondition name="6EM18VHI" triggerthreshold="EM18VHI" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM18VHI" type="CTPIN">
+      <TriggerCondition name="7EM18VHI" triggerthreshold="EM18VHI" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM20VH" type="CTPIN">
+      <TriggerCondition name="1EM20VH" triggerthreshold="EM20VH" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM20VH" type="CTPIN">
+      <TriggerCondition name="2EM20VH" triggerthreshold="EM20VH" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM20VH" type="CTPIN">
+      <TriggerCondition name="3EM20VH" triggerthreshold="EM20VH" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM20VH" type="CTPIN">
+      <TriggerCondition name="4EM20VH" triggerthreshold="EM20VH" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM20VH" type="CTPIN">
+      <TriggerCondition name="5EM20VH" triggerthreshold="EM20VH" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM20VH" type="CTPIN">
+      <TriggerCondition name="6EM20VH" triggerthreshold="EM20VH" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM20VH" type="CTPIN">
+      <TriggerCondition name="7EM20VH" triggerthreshold="EM20VH" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM20VHI" type="CTPIN">
+      <TriggerCondition name="1EM20VHI" triggerthreshold="EM20VHI" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM20VHI" type="CTPIN">
+      <TriggerCondition name="2EM20VHI" triggerthreshold="EM20VHI" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM20VHI" type="CTPIN">
+      <TriggerCondition name="3EM20VHI" triggerthreshold="EM20VHI" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM20VHI" type="CTPIN">
+      <TriggerCondition name="4EM20VHI" triggerthreshold="EM20VHI" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM20VHI" type="CTPIN">
+      <TriggerCondition name="5EM20VHI" triggerthreshold="EM20VHI" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM20VHI" type="CTPIN">
+      <TriggerCondition name="6EM20VHI" triggerthreshold="EM20VHI" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM20VHI" type="CTPIN">
+      <TriggerCondition name="7EM20VHI" triggerthreshold="EM20VHI" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM22VHI" type="CTPIN">
+      <TriggerCondition name="1EM22VHI" triggerthreshold="EM22VHI" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM22VHI" type="CTPIN">
+      <TriggerCondition name="2EM22VHI" triggerthreshold="EM22VHI" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM22VHI" type="CTPIN">
+      <TriggerCondition name="3EM22VHI" triggerthreshold="EM22VHI" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM22VHI" type="CTPIN">
+      <TriggerCondition name="4EM22VHI" triggerthreshold="EM22VHI" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM22VHI" type="CTPIN">
+      <TriggerCondition name="5EM22VHI" triggerthreshold="EM22VHI" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM22VHI" type="CTPIN">
+      <TriggerCondition name="6EM22VHI" triggerthreshold="EM22VHI" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM22VHI" type="CTPIN">
+      <TriggerCondition name="7EM22VHI" triggerthreshold="EM22VHI" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM22VHIM" type="CTPIN">
+      <TriggerCondition name="1EM22VHIM" triggerthreshold="EM22VHIM" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM22VHIM" type="CTPIN">
+      <TriggerCondition name="2EM22VHIM" triggerthreshold="EM22VHIM" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM22VHIM" type="CTPIN">
+      <TriggerCondition name="3EM22VHIM" triggerthreshold="EM22VHIM" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM22VHIM" type="CTPIN">
+      <TriggerCondition name="4EM22VHIM" triggerthreshold="EM22VHIM" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM22VHIM" type="CTPIN">
+      <TriggerCondition name="5EM22VHIM" triggerthreshold="EM22VHIM" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM22VHIM" type="CTPIN">
+      <TriggerCondition name="6EM22VHIM" triggerthreshold="EM22VHIM" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM22VHIM" type="CTPIN">
+      <TriggerCondition name="7EM22VHIM" triggerthreshold="EM22VHIM" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM24VHI" type="CTPIN">
+      <TriggerCondition name="1EM24VHI" triggerthreshold="EM24VHI" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM24VHI" type="CTPIN">
+      <TriggerCondition name="2EM24VHI" triggerthreshold="EM24VHI" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM24VHI" type="CTPIN">
+      <TriggerCondition name="3EM24VHI" triggerthreshold="EM24VHI" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM24VHI" type="CTPIN">
+      <TriggerCondition name="4EM24VHI" triggerthreshold="EM24VHI" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM24VHI" type="CTPIN">
+      <TriggerCondition name="5EM24VHI" triggerthreshold="EM24VHI" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM24VHI" type="CTPIN">
+      <TriggerCondition name="6EM24VHI" triggerthreshold="EM24VHI" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM24VHI" type="CTPIN">
+      <TriggerCondition name="7EM24VHI" triggerthreshold="EM24VHI" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM24VHIM" type="CTPIN">
+      <TriggerCondition name="1EM24VHIM" triggerthreshold="EM24VHIM" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM24VHIM" type="CTPIN">
+      <TriggerCondition name="2EM24VHIM" triggerthreshold="EM24VHIM" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM24VHIM" type="CTPIN">
+      <TriggerCondition name="3EM24VHIM" triggerthreshold="EM24VHIM" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM24VHIM" type="CTPIN">
+      <TriggerCondition name="4EM24VHIM" triggerthreshold="EM24VHIM" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM24VHIM" type="CTPIN">
+      <TriggerCondition name="5EM24VHIM" triggerthreshold="EM24VHIM" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM24VHIM" type="CTPIN">
+      <TriggerCondition name="6EM24VHIM" triggerthreshold="EM24VHIM" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM24VHIM" type="CTPIN">
+      <TriggerCondition name="7EM24VHIM" triggerthreshold="EM24VHIM" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM3" type="CTPIN">
+      <TriggerCondition name="1EM3" triggerthreshold="EM3" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM3" type="CTPMON">
+      <TriggerCondition name="1EM3" triggerthreshold="EM3" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM3" type="CTPIN">
+      <TriggerCondition name="2EM3" triggerthreshold="EM3" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM3" type="CTPIN">
+      <TriggerCondition name="3EM3" triggerthreshold="EM3" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM3" type="CTPIN">
+      <TriggerCondition name="4EM3" triggerthreshold="EM3" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM3" type="CTPIN">
+      <TriggerCondition name="5EM3" triggerthreshold="EM3" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM3" type="CTPIN">
+      <TriggerCondition name="6EM3" triggerthreshold="EM3" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM3" type="CTPIN">
+      <TriggerCondition name="7EM3" triggerthreshold="EM3" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM7" type="CTPIN">
+      <TriggerCondition name="1EM7" triggerthreshold="EM7" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM7" type="CTPIN">
+      <TriggerCondition name="2EM7" triggerthreshold="EM7" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM7" type="CTPIN">
+      <TriggerCondition name="3EM7" triggerthreshold="EM7" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM7" type="CTPIN">
+      <TriggerCondition name="4EM7" triggerthreshold="EM7" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM7" type="CTPIN">
+      <TriggerCondition name="5EM7" triggerthreshold="EM7" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM7" type="CTPIN">
+      <TriggerCondition name="6EM7" triggerthreshold="EM7" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM7" type="CTPIN">
+      <TriggerCondition name="7EM7" triggerthreshold="EM7" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM8I" type="CTPIN">
+      <TriggerCondition name="1EM8I" triggerthreshold="EM8I" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM8I" type="CTPIN">
+      <TriggerCondition name="2EM8I" triggerthreshold="EM8I" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM8I" type="CTPIN">
+      <TriggerCondition name="3EM8I" triggerthreshold="EM8I" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM8I" type="CTPIN">
+      <TriggerCondition name="4EM8I" triggerthreshold="EM8I" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM8I" type="CTPIN">
+      <TriggerCondition name="5EM8I" triggerthreshold="EM8I" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM8I" type="CTPIN">
+      <TriggerCondition name="6EM8I" triggerthreshold="EM8I" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM8I" type="CTPIN">
+      <TriggerCondition name="7EM8I" triggerthreshold="EM8I" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1EM8VH" type="CTPIN">
+      <TriggerCondition name="1EM8VH" triggerthreshold="EM8VH" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2EM8VH" type="CTPIN">
+      <TriggerCondition name="2EM8VH" triggerthreshold="EM8VH" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3EM8VH" type="CTPIN">
+      <TriggerCondition name="3EM8VH" triggerthreshold="EM8VH" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4EM8VH" type="CTPIN">
+      <TriggerCondition name="4EM8VH" triggerthreshold="EM8VH" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5EM8VH" type="CTPIN">
+      <TriggerCondition name="5EM8VH" triggerthreshold="EM8VH" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6EM8VH" type="CTPIN">
+      <TriggerCondition name="6EM8VH" triggerthreshold="EM8VH" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7EM8VH" type="CTPIN">
+      <TriggerCondition name="7EM8VH" triggerthreshold="EM8VH" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA100" type="CTPIN">
+      <TriggerCondition name="1HA100" triggerthreshold="HA100" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA100" type="CTPIN">
+      <TriggerCondition name="2HA100" triggerthreshold="HA100" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA100" type="CTPIN">
+      <TriggerCondition name="3HA100" triggerthreshold="HA100" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA100" type="CTPIN">
+      <TriggerCondition name="4HA100" triggerthreshold="HA100" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA100" type="CTPIN">
+      <TriggerCondition name="5HA100" triggerthreshold="HA100" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA100" type="CTPIN">
+      <TriggerCondition name="6HA100" triggerthreshold="HA100" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA100" type="CTPIN">
+      <TriggerCondition name="7HA100" triggerthreshold="HA100" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA12" type="CTPIN">
+      <TriggerCondition name="1HA12" triggerthreshold="HA12" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA12" type="CTPIN">
+      <TriggerCondition name="2HA12" triggerthreshold="HA12" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA12" type="CTPIN">
+      <TriggerCondition name="3HA12" triggerthreshold="HA12" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA12" type="CTPIN">
+      <TriggerCondition name="4HA12" triggerthreshold="HA12" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA12" type="CTPIN">
+      <TriggerCondition name="5HA12" triggerthreshold="HA12" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA12" type="CTPIN">
+      <TriggerCondition name="6HA12" triggerthreshold="HA12" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA12" type="CTPIN">
+      <TriggerCondition name="7HA12" triggerthreshold="HA12" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA12IL" type="CTPIN">
+      <TriggerCondition name="1HA12IL" triggerthreshold="HA12IL" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA12IL" type="CTPIN">
+      <TriggerCondition name="2HA12IL" triggerthreshold="HA12IL" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA12IL" type="CTPIN">
+      <TriggerCondition name="3HA12IL" triggerthreshold="HA12IL" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA12IL" type="CTPIN">
+      <TriggerCondition name="4HA12IL" triggerthreshold="HA12IL" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA12IL" type="CTPIN">
+      <TriggerCondition name="5HA12IL" triggerthreshold="HA12IL" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA12IL" type="CTPIN">
+      <TriggerCondition name="6HA12IL" triggerthreshold="HA12IL" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA12IL" type="CTPIN">
+      <TriggerCondition name="7HA12IL" triggerthreshold="HA12IL" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA12IM" type="CTPIN">
+      <TriggerCondition name="1HA12IM" triggerthreshold="HA12IM" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA12IM" type="CTPIN">
+      <TriggerCondition name="2HA12IM" triggerthreshold="HA12IM" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA12IM" type="CTPIN">
+      <TriggerCondition name="3HA12IM" triggerthreshold="HA12IM" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA12IM" type="CTPIN">
+      <TriggerCondition name="4HA12IM" triggerthreshold="HA12IM" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA12IM" type="CTPIN">
+      <TriggerCondition name="5HA12IM" triggerthreshold="HA12IM" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA12IM" type="CTPIN">
+      <TriggerCondition name="6HA12IM" triggerthreshold="HA12IM" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA12IM" type="CTPIN">
+      <TriggerCondition name="7HA12IM" triggerthreshold="HA12IM" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA12IT" type="CTPIN">
+      <TriggerCondition name="1HA12IT" triggerthreshold="HA12IT" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA12IT" type="CTPIN">
+      <TriggerCondition name="2HA12IT" triggerthreshold="HA12IT" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA12IT" type="CTPIN">
+      <TriggerCondition name="3HA12IT" triggerthreshold="HA12IT" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA12IT" type="CTPIN">
+      <TriggerCondition name="4HA12IT" triggerthreshold="HA12IT" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA12IT" type="CTPIN">
+      <TriggerCondition name="5HA12IT" triggerthreshold="HA12IT" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA12IT" type="CTPIN">
+      <TriggerCondition name="6HA12IT" triggerthreshold="HA12IT" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA12IT" type="CTPIN">
+      <TriggerCondition name="7HA12IT" triggerthreshold="HA12IT" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA15" type="CTPIN">
+      <TriggerCondition name="1HA15" triggerthreshold="HA15" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA15" type="CTPIN">
+      <TriggerCondition name="2HA15" triggerthreshold="HA15" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA15" type="CTPIN">
+      <TriggerCondition name="3HA15" triggerthreshold="HA15" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA15" type="CTPIN">
+      <TriggerCondition name="4HA15" triggerthreshold="HA15" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA15" type="CTPIN">
+      <TriggerCondition name="5HA15" triggerthreshold="HA15" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA15" type="CTPIN">
+      <TriggerCondition name="6HA15" triggerthreshold="HA15" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA15" type="CTPIN">
+      <TriggerCondition name="7HA15" triggerthreshold="HA15" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA20" type="CTPIN">
+      <TriggerCondition name="1HA20" triggerthreshold="HA20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA20" type="CTPIN">
+      <TriggerCondition name="2HA20" triggerthreshold="HA20" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA20" type="CTPIN">
+      <TriggerCondition name="3HA20" triggerthreshold="HA20" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA20" type="CTPIN">
+      <TriggerCondition name="4HA20" triggerthreshold="HA20" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA20" type="CTPIN">
+      <TriggerCondition name="5HA20" triggerthreshold="HA20" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA20" type="CTPIN">
+      <TriggerCondition name="6HA20" triggerthreshold="HA20" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA20" type="CTPIN">
+      <TriggerCondition name="7HA20" triggerthreshold="HA20" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA20IL" type="CTPIN">
+      <TriggerCondition name="1HA20IL" triggerthreshold="HA20IL" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA20IL" type="CTPIN">
+      <TriggerCondition name="2HA20IL" triggerthreshold="HA20IL" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA20IL" type="CTPIN">
+      <TriggerCondition name="3HA20IL" triggerthreshold="HA20IL" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA20IL" type="CTPIN">
+      <TriggerCondition name="4HA20IL" triggerthreshold="HA20IL" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA20IL" type="CTPIN">
+      <TriggerCondition name="5HA20IL" triggerthreshold="HA20IL" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA20IL" type="CTPIN">
+      <TriggerCondition name="6HA20IL" triggerthreshold="HA20IL" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA20IL" type="CTPIN">
+      <TriggerCondition name="7HA20IL" triggerthreshold="HA20IL" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA20IM" type="CTPIN">
+      <TriggerCondition name="1HA20IM" triggerthreshold="HA20IM" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA20IM" type="CTPIN">
+      <TriggerCondition name="2HA20IM" triggerthreshold="HA20IM" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA20IM" type="CTPIN">
+      <TriggerCondition name="3HA20IM" triggerthreshold="HA20IM" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA20IM" type="CTPIN">
+      <TriggerCondition name="4HA20IM" triggerthreshold="HA20IM" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA20IM" type="CTPIN">
+      <TriggerCondition name="5HA20IM" triggerthreshold="HA20IM" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA20IM" type="CTPIN">
+      <TriggerCondition name="6HA20IM" triggerthreshold="HA20IM" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA20IM" type="CTPIN">
+      <TriggerCondition name="7HA20IM" triggerthreshold="HA20IM" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA20IT" type="CTPIN">
+      <TriggerCondition name="1HA20IT" triggerthreshold="HA20IT" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA20IT" type="CTPIN">
+      <TriggerCondition name="2HA20IT" triggerthreshold="HA20IT" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA20IT" type="CTPIN">
+      <TriggerCondition name="3HA20IT" triggerthreshold="HA20IT" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA20IT" type="CTPIN">
+      <TriggerCondition name="4HA20IT" triggerthreshold="HA20IT" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA20IT" type="CTPIN">
+      <TriggerCondition name="5HA20IT" triggerthreshold="HA20IT" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA20IT" type="CTPIN">
+      <TriggerCondition name="6HA20IT" triggerthreshold="HA20IT" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA20IT" type="CTPIN">
+      <TriggerCondition name="7HA20IT" triggerthreshold="HA20IT" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA25" type="CTPIN">
+      <TriggerCondition name="1HA25" triggerthreshold="HA25" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA25" type="CTPIN">
+      <TriggerCondition name="2HA25" triggerthreshold="HA25" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA25" type="CTPIN">
+      <TriggerCondition name="3HA25" triggerthreshold="HA25" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA25" type="CTPIN">
+      <TriggerCondition name="4HA25" triggerthreshold="HA25" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA25" type="CTPIN">
+      <TriggerCondition name="5HA25" triggerthreshold="HA25" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA25" type="CTPIN">
+      <TriggerCondition name="6HA25" triggerthreshold="HA25" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA25" type="CTPIN">
+      <TriggerCondition name="7HA25" triggerthreshold="HA25" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA25IM" type="CTPIN">
+      <TriggerCondition name="1HA25IM" triggerthreshold="HA25IM" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA25IM" type="CTPIN">
+      <TriggerCondition name="2HA25IM" triggerthreshold="HA25IM" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA25IM" type="CTPIN">
+      <TriggerCondition name="3HA25IM" triggerthreshold="HA25IM" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA25IM" type="CTPIN">
+      <TriggerCondition name="4HA25IM" triggerthreshold="HA25IM" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA25IM" type="CTPIN">
+      <TriggerCondition name="5HA25IM" triggerthreshold="HA25IM" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA25IM" type="CTPIN">
+      <TriggerCondition name="6HA25IM" triggerthreshold="HA25IM" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA25IM" type="CTPIN">
+      <TriggerCondition name="7HA25IM" triggerthreshold="HA25IM" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA30" type="CTPIN">
+      <TriggerCondition name="1HA30" triggerthreshold="HA30" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA30" type="CTPIN">
+      <TriggerCondition name="2HA30" triggerthreshold="HA30" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA30" type="CTPIN">
+      <TriggerCondition name="3HA30" triggerthreshold="HA30" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA30" type="CTPIN">
+      <TriggerCondition name="4HA30" triggerthreshold="HA30" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA30" type="CTPIN">
+      <TriggerCondition name="5HA30" triggerthreshold="HA30" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA30" type="CTPIN">
+      <TriggerCondition name="6HA30" triggerthreshold="HA30" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA30" type="CTPIN">
+      <TriggerCondition name="7HA30" triggerthreshold="HA30" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA40" type="CTPIN">
+      <TriggerCondition name="1HA40" triggerthreshold="HA40" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA40" type="CTPIN">
+      <TriggerCondition name="2HA40" triggerthreshold="HA40" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA40" type="CTPIN">
+      <TriggerCondition name="3HA40" triggerthreshold="HA40" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA40" type="CTPIN">
+      <TriggerCondition name="4HA40" triggerthreshold="HA40" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA40" type="CTPIN">
+      <TriggerCondition name="5HA40" triggerthreshold="HA40" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA40" type="CTPIN">
+      <TriggerCondition name="6HA40" triggerthreshold="HA40" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA40" type="CTPIN">
+      <TriggerCondition name="7HA40" triggerthreshold="HA40" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA60" type="CTPIN">
+      <TriggerCondition name="1HA60" triggerthreshold="HA60" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA60" type="CTPIN">
+      <TriggerCondition name="2HA60" triggerthreshold="HA60" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA60" type="CTPIN">
+      <TriggerCondition name="3HA60" triggerthreshold="HA60" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA60" type="CTPIN">
+      <TriggerCondition name="4HA60" triggerthreshold="HA60" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA60" type="CTPIN">
+      <TriggerCondition name="5HA60" triggerthreshold="HA60" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA60" type="CTPIN">
+      <TriggerCondition name="6HA60" triggerthreshold="HA60" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA60" type="CTPIN">
+      <TriggerCondition name="7HA60" triggerthreshold="HA60" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1HA8" type="CTPIN">
+      <TriggerCondition name="1HA8" triggerthreshold="HA8" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2HA8" type="CTPIN">
+      <TriggerCondition name="2HA8" triggerthreshold="HA8" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3HA8" type="CTPIN">
+      <TriggerCondition name="3HA8" triggerthreshold="HA8" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4HA8" type="CTPIN">
+      <TriggerCondition name="4HA8" triggerthreshold="HA8" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5HA8" type="CTPIN">
+      <TriggerCondition name="5HA8" triggerthreshold="HA8" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6HA8" type="CTPIN">
+      <TriggerCondition name="6HA8" triggerthreshold="HA8" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7HA8" type="CTPIN">
+      <TriggerCondition name="7HA8" triggerthreshold="HA8" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J100" type="CTPIN">
+      <TriggerCondition name="1J100" triggerthreshold="J100" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J100" type="CTPIN">
+      <TriggerCondition name="2J100" triggerthreshold="J100" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J100" type="CTPIN">
+      <TriggerCondition name="3J100" triggerthreshold="J100" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J100.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J100.31ETA49" triggerthreshold="J100.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J100.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J100.31ETA49" triggerthreshold="J100.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J100.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J100.31ETA49" triggerthreshold="J100.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J12" type="CTPIN">
+      <TriggerCondition name="1J12" triggerthreshold="J12" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J12" type="CTPIN">
+      <TriggerCondition name="2J12" triggerthreshold="J12" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J12" type="CTPIN">
+      <TriggerCondition name="3J12" triggerthreshold="J12" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J12" type="CTPIN">
+      <TriggerCondition name="4J12" triggerthreshold="J12" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J12" type="CTPIN">
+      <TriggerCondition name="5J12" triggerthreshold="J12" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J12" type="CTPIN">
+      <TriggerCondition name="6J12" triggerthreshold="J12" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J12" type="CTPIN">
+      <TriggerCondition name="7J12" triggerthreshold="J12" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J120" type="CTPIN">
+      <TriggerCondition name="1J120" triggerthreshold="J120" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J120" type="CTPIN">
+      <TriggerCondition name="2J120" triggerthreshold="J120" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J120" type="CTPIN">
+      <TriggerCondition name="3J120" triggerthreshold="J120" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J15" type="CTPIN">
+      <TriggerCondition name="1J15" triggerthreshold="J15" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J15" type="CTPIN">
+      <TriggerCondition name="2J15" triggerthreshold="J15" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J15" type="CTPIN">
+      <TriggerCondition name="3J15" triggerthreshold="J15" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J15" type="CTPIN">
+      <TriggerCondition name="4J15" triggerthreshold="J15" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J15" type="CTPIN">
+      <TriggerCondition name="5J15" triggerthreshold="J15" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J15" type="CTPIN">
+      <TriggerCondition name="6J15" triggerthreshold="J15" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J15" type="CTPIN">
+      <TriggerCondition name="7J15" triggerthreshold="J15" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="1J15.0ETA25" triggerthreshold="J15.0ETA25" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="2J15.0ETA25" triggerthreshold="J15.0ETA25" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="3J15.0ETA25" triggerthreshold="J15.0ETA25" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="4J15.0ETA25" triggerthreshold="J15.0ETA25" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="5J15.0ETA25" triggerthreshold="J15.0ETA25" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="6J15.0ETA25" triggerthreshold="J15.0ETA25" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J15.0ETA25" type="CTPIN">
+      <TriggerCondition name="7J15.0ETA25" triggerthreshold="J15.0ETA25" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J15.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J15.31ETA49" triggerthreshold="J15.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J15.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J15.31ETA49" triggerthreshold="J15.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J15.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J15.31ETA49" triggerthreshold="J15.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J20" type="CTPIN">
+      <TriggerCondition name="1J20" triggerthreshold="J20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J20" type="CTPIN">
+      <TriggerCondition name="2J20" triggerthreshold="J20" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J20" type="CTPIN">
+      <TriggerCondition name="3J20" triggerthreshold="J20" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J20" type="CTPIN">
+      <TriggerCondition name="4J20" triggerthreshold="J20" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J20" type="CTPIN">
+      <TriggerCondition name="5J20" triggerthreshold="J20" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J20" type="CTPIN">
+      <TriggerCondition name="6J20" triggerthreshold="J20" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J20" type="CTPIN">
+      <TriggerCondition name="7J20" triggerthreshold="J20" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J20.28ETA31" type="CTPIN">
+      <TriggerCondition name="1J20.28ETA31" triggerthreshold="J20.28ETA31" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J20.28ETA31" type="CTPIN">
+      <TriggerCondition name="2J20.28ETA31" triggerthreshold="J20.28ETA31" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J20.28ETA31" type="CTPIN">
+      <TriggerCondition name="3J20.28ETA31" triggerthreshold="J20.28ETA31" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J20.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J20.31ETA49" triggerthreshold="J20.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J20.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J20.31ETA49" triggerthreshold="J20.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J20.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J20.31ETA49" triggerthreshold="J20.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J25" type="CTPIN">
+      <TriggerCondition name="1J25" triggerthreshold="J25" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J25" type="CTPIN">
+      <TriggerCondition name="2J25" triggerthreshold="J25" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J25" type="CTPIN">
+      <TriggerCondition name="3J25" triggerthreshold="J25" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J25" type="CTPIN">
+      <TriggerCondition name="4J25" triggerthreshold="J25" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J25" type="CTPIN">
+      <TriggerCondition name="5J25" triggerthreshold="J25" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J25" type="CTPIN">
+      <TriggerCondition name="6J25" triggerthreshold="J25" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J25" type="CTPIN">
+      <TriggerCondition name="7J25" triggerthreshold="J25" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="1J25.0ETA23" triggerthreshold="J25.0ETA23" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="2J25.0ETA23" triggerthreshold="J25.0ETA23" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="3J25.0ETA23" triggerthreshold="J25.0ETA23" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="4J25.0ETA23" triggerthreshold="J25.0ETA23" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="5J25.0ETA23" triggerthreshold="J25.0ETA23" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="6J25.0ETA23" triggerthreshold="J25.0ETA23" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J25.0ETA23" type="CTPIN">
+      <TriggerCondition name="7J25.0ETA23" triggerthreshold="J25.0ETA23" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J30" type="CTPIN">
+      <TriggerCondition name="1J30" triggerthreshold="J30" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J30" type="CTPIN">
+      <TriggerCondition name="2J30" triggerthreshold="J30" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J30" type="CTPIN">
+      <TriggerCondition name="3J30" triggerthreshold="J30" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J30" type="CTPIN">
+      <TriggerCondition name="4J30" triggerthreshold="J30" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J30" type="CTPIN">
+      <TriggerCondition name="5J30" triggerthreshold="J30" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J30" type="CTPIN">
+      <TriggerCondition name="6J30" triggerthreshold="J30" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J30" type="CTPIN">
+      <TriggerCondition name="7J30" triggerthreshold="J30" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J30.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J30.31ETA49" triggerthreshold="J30.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J30.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J30.31ETA49" triggerthreshold="J30.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J30.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J30.31ETA49" triggerthreshold="J30.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J35.0ETA23" type="CTPIN">
+      <TriggerCondition name="1J35.0ETA23" triggerthreshold="J35.0ETA23" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J35.0ETA23" type="CTPIN">
+      <TriggerCondition name="2J35.0ETA23" triggerthreshold="J35.0ETA23" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J35.0ETA23" type="CTPIN">
+      <TriggerCondition name="3J35.0ETA23" triggerthreshold="J35.0ETA23" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J40" type="CTPIN">
+      <TriggerCondition name="1J40" triggerthreshold="J40" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J40" type="CTPIN">
+      <TriggerCondition name="2J40" triggerthreshold="J40" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J40" type="CTPIN">
+      <TriggerCondition name="3J40" triggerthreshold="J40" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4J40" type="CTPIN">
+      <TriggerCondition name="4J40" triggerthreshold="J40" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5J40" type="CTPIN">
+      <TriggerCondition name="5J40" triggerthreshold="J40" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6J40" type="CTPIN">
+      <TriggerCondition name="6J40" triggerthreshold="J40" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7J40" type="CTPIN">
+      <TriggerCondition name="7J40" triggerthreshold="J40" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J40.0ETA25" type="CTPIN">
+      <TriggerCondition name="1J40.0ETA25" triggerthreshold="J40.0ETA25" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J40.0ETA25" type="CTPIN">
+      <TriggerCondition name="2J40.0ETA25" triggerthreshold="J40.0ETA25" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J40.0ETA25" type="CTPIN">
+      <TriggerCondition name="3J40.0ETA25" triggerthreshold="J40.0ETA25" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J400" type="CTPIN">
+      <TriggerCondition name="1J400" triggerthreshold="J400" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J400" type="CTPIN">
+      <TriggerCondition name="2J400" triggerthreshold="J400" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J400" type="CTPIN">
+      <TriggerCondition name="3J400" triggerthreshold="J400" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J50" type="CTPIN">
+      <TriggerCondition name="1J50" triggerthreshold="J50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J50" type="CTPIN">
+      <TriggerCondition name="2J50" triggerthreshold="J50" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J50" type="CTPIN">
+      <TriggerCondition name="3J50" triggerthreshold="J50" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J50.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J50.31ETA49" triggerthreshold="J50.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J50.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J50.31ETA49" triggerthreshold="J50.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J50.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J50.31ETA49" triggerthreshold="J50.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J75" type="CTPIN">
+      <TriggerCondition name="1J75" triggerthreshold="J75" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J75" type="CTPIN">
+      <TriggerCondition name="2J75" triggerthreshold="J75" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J75" type="CTPIN">
+      <TriggerCondition name="3J75" triggerthreshold="J75" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J75.31ETA49" type="CTPIN">
+      <TriggerCondition name="1J75.31ETA49" triggerthreshold="J75.31ETA49" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J75.31ETA49" type="CTPIN">
+      <TriggerCondition name="2J75.31ETA49" triggerthreshold="J75.31ETA49" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J75.31ETA49" type="CTPIN">
+      <TriggerCondition name="3J75.31ETA49" triggerthreshold="J75.31ETA49" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1J85" type="CTPIN">
+      <TriggerCondition name="1J85" triggerthreshold="J85" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2J85" type="CTPIN">
+      <TriggerCondition name="2J85" triggerthreshold="J85" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3J85" type="CTPIN">
+      <TriggerCondition name="3J85" triggerthreshold="J85" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="1LUCID_A" type="CTPIN">
+      <TriggerCondition name="1LUCID_A" triggerthreshold="LUCID_A" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1LUCID_C" type="CTPIN">
+      <TriggerCondition name="1LUCID_C" triggerthreshold="LUCID_C" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A" type="CTPIN">
+      <TriggerCondition name="1MBTS_A" triggerthreshold="MBTS_A" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A" type="CTPMON">
+      <TriggerCondition name="1MBTS_A" triggerthreshold="MBTS_A" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MBTS_A" type="CTPIN">
+      <TriggerCondition name="2MBTS_A" triggerthreshold="MBTS_A" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MBTS_A" type="CTPIN">
+      <TriggerCondition name="3MBTS_A" triggerthreshold="MBTS_A" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MBTS_A" type="CTPIN">
+      <TriggerCondition name="4MBTS_A" triggerthreshold="MBTS_A" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MBTS_A" type="CTPIN">
+      <TriggerCondition name="5MBTS_A" triggerthreshold="MBTS_A" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MBTS_A" type="CTPIN">
+      <TriggerCondition name="6MBTS_A" triggerthreshold="MBTS_A" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MBTS_A" type="CTPIN">
+      <TriggerCondition name="7MBTS_A" triggerthreshold="MBTS_A" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A0" type="CTPIN">
+      <TriggerCondition name="1MBTS_A0" triggerthreshold="MBTS_A0" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A1" type="CTPIN">
+      <TriggerCondition name="1MBTS_A1" triggerthreshold="MBTS_A1" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A10" type="CTPIN">
+      <TriggerCondition name="1MBTS_A10" triggerthreshold="MBTS_A10" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A12" type="CTPIN">
+      <TriggerCondition name="1MBTS_A12" triggerthreshold="MBTS_A12" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A14" type="CTPIN">
+      <TriggerCondition name="1MBTS_A14" triggerthreshold="MBTS_A14" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A2" type="CTPIN">
+      <TriggerCondition name="1MBTS_A2" triggerthreshold="MBTS_A2" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A3" type="CTPIN">
+      <TriggerCondition name="1MBTS_A3" triggerthreshold="MBTS_A3" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A4" type="CTPIN">
+      <TriggerCondition name="1MBTS_A4" triggerthreshold="MBTS_A4" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A5" type="CTPIN">
+      <TriggerCondition name="1MBTS_A5" triggerthreshold="MBTS_A5" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A6" type="CTPIN">
+      <TriggerCondition name="1MBTS_A6" triggerthreshold="MBTS_A6" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A7" type="CTPIN">
+      <TriggerCondition name="1MBTS_A7" triggerthreshold="MBTS_A7" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_A8" type="CTPIN">
+      <TriggerCondition name="1MBTS_A8" triggerthreshold="MBTS_A8" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C" type="CTPIN">
+      <TriggerCondition name="1MBTS_C" triggerthreshold="MBTS_C" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C" type="CTPMON">
+      <TriggerCondition name="1MBTS_C" triggerthreshold="MBTS_C" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MBTS_C" type="CTPIN">
+      <TriggerCondition name="2MBTS_C" triggerthreshold="MBTS_C" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MBTS_C" type="CTPIN">
+      <TriggerCondition name="3MBTS_C" triggerthreshold="MBTS_C" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MBTS_C" type="CTPIN">
+      <TriggerCondition name="4MBTS_C" triggerthreshold="MBTS_C" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MBTS_C" type="CTPIN">
+      <TriggerCondition name="5MBTS_C" triggerthreshold="MBTS_C" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MBTS_C" type="CTPIN">
+      <TriggerCondition name="6MBTS_C" triggerthreshold="MBTS_C" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MBTS_C" type="CTPIN">
+      <TriggerCondition name="7MBTS_C" triggerthreshold="MBTS_C" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C0" type="CTPIN">
+      <TriggerCondition name="1MBTS_C0" triggerthreshold="MBTS_C0" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C1" type="CTPIN">
+      <TriggerCondition name="1MBTS_C1" triggerthreshold="MBTS_C1" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C10" type="CTPIN">
+      <TriggerCondition name="1MBTS_C10" triggerthreshold="MBTS_C10" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C12" type="CTPIN">
+      <TriggerCondition name="1MBTS_C12" triggerthreshold="MBTS_C12" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C14" type="CTPIN">
+      <TriggerCondition name="1MBTS_C14" triggerthreshold="MBTS_C14" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C2" type="CTPIN">
+      <TriggerCondition name="1MBTS_C2" triggerthreshold="MBTS_C2" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C3" type="CTPIN">
+      <TriggerCondition name="1MBTS_C3" triggerthreshold="MBTS_C3" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C4" type="CTPIN">
+      <TriggerCondition name="1MBTS_C4" triggerthreshold="MBTS_C4" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C5" type="CTPIN">
+      <TriggerCondition name="1MBTS_C5" triggerthreshold="MBTS_C5" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C6" type="CTPIN">
+      <TriggerCondition name="1MBTS_C6" triggerthreshold="MBTS_C6" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C7" type="CTPIN">
+      <TriggerCondition name="1MBTS_C7" triggerthreshold="MBTS_C7" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MBTS_C8" type="CTPIN">
+      <TriggerCondition name="1MBTS_C8" triggerthreshold="MBTS_C8" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU10" type="CTPIN">
+      <TriggerCondition name="1MU10" triggerthreshold="MU10" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU10" type="CTPIN">
+      <TriggerCondition name="2MU10" triggerthreshold="MU10" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU10" type="CTPIN">
+      <TriggerCondition name="3MU10" triggerthreshold="MU10" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU10" type="CTPIN">
+      <TriggerCondition name="4MU10" triggerthreshold="MU10" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU10" type="CTPIN">
+      <TriggerCondition name="5MU10" triggerthreshold="MU10" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU10" type="CTPIN">
+      <TriggerCondition name="6MU10" triggerthreshold="MU10" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU10" type="CTPIN">
+      <TriggerCondition name="7MU10" triggerthreshold="MU10" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU11" type="CTPIN">
+      <TriggerCondition name="1MU11" triggerthreshold="MU11" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU11" type="CTPIN">
+      <TriggerCondition name="2MU11" triggerthreshold="MU11" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU11" type="CTPIN">
+      <TriggerCondition name="3MU11" triggerthreshold="MU11" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU11" type="CTPIN">
+      <TriggerCondition name="4MU11" triggerthreshold="MU11" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU11" type="CTPIN">
+      <TriggerCondition name="5MU11" triggerthreshold="MU11" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU11" type="CTPIN">
+      <TriggerCondition name="6MU11" triggerthreshold="MU11" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU11" type="CTPIN">
+      <TriggerCondition name="7MU11" triggerthreshold="MU11" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU20" type="CTPIN">
+      <TriggerCondition name="1MU20" triggerthreshold="MU20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU20" type="CTPIN">
+      <TriggerCondition name="2MU20" triggerthreshold="MU20" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU20" type="CTPIN">
+      <TriggerCondition name="3MU20" triggerthreshold="MU20" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU20" type="CTPIN">
+      <TriggerCondition name="4MU20" triggerthreshold="MU20" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU20" type="CTPIN">
+      <TriggerCondition name="5MU20" triggerthreshold="MU20" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU20" type="CTPIN">
+      <TriggerCondition name="6MU20" triggerthreshold="MU20" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU20" type="CTPIN">
+      <TriggerCondition name="7MU20" triggerthreshold="MU20" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU21" type="CTPIN">
+      <TriggerCondition name="1MU21" triggerthreshold="MU21" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU21" type="CTPIN">
+      <TriggerCondition name="2MU21" triggerthreshold="MU21" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU21" type="CTPIN">
+      <TriggerCondition name="3MU21" triggerthreshold="MU21" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU21" type="CTPIN">
+      <TriggerCondition name="4MU21" triggerthreshold="MU21" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU21" type="CTPIN">
+      <TriggerCondition name="5MU21" triggerthreshold="MU21" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU21" type="CTPIN">
+      <TriggerCondition name="6MU21" triggerthreshold="MU21" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU21" type="CTPIN">
+      <TriggerCondition name="7MU21" triggerthreshold="MU21" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU4" type="CTPIN">
+      <TriggerCondition name="1MU4" triggerthreshold="MU4" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU4" type="CTPIN">
+      <TriggerCondition name="2MU4" triggerthreshold="MU4" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU4" type="CTPIN">
+      <TriggerCondition name="3MU4" triggerthreshold="MU4" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU4" type="CTPIN">
+      <TriggerCondition name="4MU4" triggerthreshold="MU4" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU4" type="CTPIN">
+      <TriggerCondition name="5MU4" triggerthreshold="MU4" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU4" type="CTPIN">
+      <TriggerCondition name="6MU4" triggerthreshold="MU4" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU4" type="CTPIN">
+      <TriggerCondition name="7MU4" triggerthreshold="MU4" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1MU6" type="CTPIN">
+      <TriggerCondition name="1MU6" triggerthreshold="MU6" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="2MU6" type="CTPIN">
+      <TriggerCondition name="2MU6" triggerthreshold="MU6" multi="2"/>
+    </TriggerCounter>
+    <TriggerCounter name="3MU6" type="CTPIN">
+      <TriggerCondition name="3MU6" triggerthreshold="MU6" multi="3"/>
+    </TriggerCounter>
+    <TriggerCounter name="4MU6" type="CTPIN">
+      <TriggerCondition name="4MU6" triggerthreshold="MU6" multi="4"/>
+    </TriggerCounter>
+    <TriggerCounter name="5MU6" type="CTPIN">
+      <TriggerCondition name="5MU6" triggerthreshold="MU6" multi="5"/>
+    </TriggerCounter>
+    <TriggerCounter name="6MU6" type="CTPIN">
+      <TriggerCondition name="6MU6" triggerthreshold="MU6" multi="6"/>
+    </TriggerCounter>
+    <TriggerCounter name="7MU6" type="CTPIN">
+      <TriggerCondition name="7MU6" triggerthreshold="MU6" multi="7"/>
+    </TriggerCounter>
+    <TriggerCounter name="1NIML1A" type="CTPIN">
+      <TriggerCondition name="1NIML1A" triggerthreshold="NIML1A" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1NIMLHCF" type="CTPIN">
+      <TriggerCondition name="1NIMLHCF" triggerthreshold="NIMLHCF" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1NIMRPC" type="CTPIN">
+      <TriggerCondition name="1NIMRPC" triggerthreshold="NIMRPC" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1NIMTGC" type="CTPIN">
+      <TriggerCondition name="1NIMTGC" triggerthreshold="NIMTGC" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1NIMTRT" type="CTPIN">
+      <TriggerCondition name="1NIMTRT" triggerthreshold="NIMTRT" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE10" type="CTPIN">
+      <TriggerCondition name="1TE10" triggerthreshold="TE10" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE10.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE10.0ETA24" triggerthreshold="TE10.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE15.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE15.0ETA24" triggerthreshold="TE15.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE20" type="CTPIN">
+      <TriggerCondition name="1TE20" triggerthreshold="TE20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE20.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE20.0ETA24" triggerthreshold="TE20.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE25.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE25.0ETA24" triggerthreshold="TE25.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE30" type="CTPIN">
+      <TriggerCondition name="1TE30" triggerthreshold="TE30" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE30.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE30.0ETA24" triggerthreshold="TE30.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE40" type="CTPIN">
+      <TriggerCondition name="1TE40" triggerthreshold="TE40" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE40.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE40.0ETA24" triggerthreshold="TE40.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE5" type="CTPIN">
+      <TriggerCondition name="1TE5" triggerthreshold="TE5" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE5.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE5.0ETA24" triggerthreshold="TE5.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE50" type="CTPIN">
+      <TriggerCondition name="1TE50" triggerthreshold="TE50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE60" type="CTPIN">
+      <TriggerCondition name="1TE60" triggerthreshold="TE60" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE70" type="CTPIN">
+      <TriggerCondition name="1TE70" triggerthreshold="TE70" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE70.0ETA24" type="CTPIN">
+      <TriggerCondition name="1TE70.0ETA24" triggerthreshold="TE70.0ETA24" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE10" type="CTPIN">
+      <TriggerCondition name="1XE10" triggerthreshold="XE10" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE150" type="CTPIN">
+      <TriggerCondition name="1XE150" triggerthreshold="XE150" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE20" type="CTPIN">
+      <TriggerCondition name="1XE20" triggerthreshold="XE20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE25" type="CTPIN">
+      <TriggerCondition name="1XE25" triggerthreshold="XE25" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE30" type="CTPIN">
+      <TriggerCondition name="1XE30" triggerthreshold="XE30" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE300" type="CTPIN">
+      <TriggerCondition name="1XE300" triggerthreshold="XE300" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE35" type="CTPIN">
+      <TriggerCondition name="1XE35" triggerthreshold="XE35" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE40" type="CTPIN">
+      <TriggerCondition name="1XE40" triggerthreshold="XE40" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE45" type="CTPIN">
+      <TriggerCondition name="1XE45" triggerthreshold="XE45" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE50" type="CTPIN">
+      <TriggerCondition name="1XE50" triggerthreshold="XE50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE55" type="CTPIN">
+      <TriggerCondition name="1XE55" triggerthreshold="XE55" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE60" type="CTPIN">
+      <TriggerCondition name="1XE60" triggerthreshold="XE60" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE65" type="CTPIN">
+      <TriggerCondition name="1XE65" triggerthreshold="XE65" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE70" type="CTPIN">
+      <TriggerCondition name="1XE70" triggerthreshold="XE70" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE75" type="CTPIN">
+      <TriggerCondition name="1XE75" triggerthreshold="XE75" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XE80" type="CTPIN">
+      <TriggerCondition name="1XE80" triggerthreshold="XE80" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS20" type="CTPIN">
+      <TriggerCondition name="1XS20" triggerthreshold="XS20" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS30" type="CTPIN">
+      <TriggerCondition name="1XS30" triggerthreshold="XS30" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS40" type="CTPIN">
+      <TriggerCondition name="1XS40" triggerthreshold="XS40" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS45" type="CTPIN">
+      <TriggerCondition name="1XS45" triggerthreshold="XS45" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS50" type="CTPIN">
+      <TriggerCondition name="1XS50" triggerthreshold="XS50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS55" type="CTPIN">
+      <TriggerCondition name="1XS55" triggerthreshold="XS55" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS60" type="CTPIN">
+      <TriggerCondition name="1XS60" triggerthreshold="XS60" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1XS65" type="CTPIN">
+      <TriggerCondition name="1XS65" triggerthreshold="XS65" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1ZB_EM15" type="CTPIN">
+      <TriggerCondition name="1ZB_EM15" triggerthreshold="ZB_EM15" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1ZDC_A" type="CTPIN">
+      <TriggerCondition name="1ZDC_A" triggerthreshold="ZDC_A" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1ZDC_AND" type="CTPIN">
+      <TriggerCondition name="1ZDC_AND" triggerthreshold="ZDC_AND" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1ZDC_C" type="CTPIN">
+      <TriggerCondition name="1ZDC_C" triggerthreshold="ZDC_C" multi="1"/>
+    </TriggerCounter>
+  </TriggerCounterList>
+  <TriggerThresholdList>
+    <TriggerThreshold active="1" bitnum="1" id="1" mapping="2" name="ALFA_B7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="2" range_end="2" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="2" mapping="3" name="ALFA_A7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="3" range_end="3" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="3" mapping="4" name="ALFA_A7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="4" range_end="4" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="4" mapping="5" name="ALFA_B7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="5" range_end="5" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="5" mapping="8" name="ALFA2_B7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="8" range_end="8" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="6" mapping="9" name="ALFA2_A7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="9" range_end="9" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="7" mapping="10" name="ALFA2_A7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="10" range_end="10" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="8" mapping="11" name="ALFA2_B7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="11" range_end="11" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="9" mapping="14" name="ALFA3_B7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="14" range_end="14" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="10" mapping="15" name="ALFA3_A7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="15" range_end="15" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="11" mapping="16" name="ALFA3_A7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="16" range_end="16" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="12" mapping="17" name="ALFA3_B7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="17" range_end="17" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="13" mapping="20" name="ALFA4_B7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="20" range_end="20" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="14" mapping="21" name="ALFA4_A7R1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="21" range_end="21" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="15" mapping="22" name="ALFA4_A7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="22" range_end="22" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="16" mapping="23" name="ALFA4_B7L1L" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="23" range_end="23" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="17" mapping="34" name="ALFA_B7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="2" range_end="2" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="18" mapping="35" name="ALFA_A7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="3" range_end="3" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="19" mapping="36" name="ALFA_A7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="4" range_end="4" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="20" mapping="37" name="ALFA_B7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="5" range_end="5" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="21" mapping="40" name="ALFA2_B7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="8" range_end="8" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="22" mapping="41" name="ALFA2_A7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="9" range_end="9" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="23" mapping="42" name="ALFA2_A7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="10" range_end="10" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="24" mapping="43" name="ALFA2_B7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="11" range_end="11" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="25" mapping="46" name="ALFA3_B7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="14" range_end="14" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="26" mapping="47" name="ALFA3_A7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="15" range_end="15" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="27" mapping="48" name="ALFA3_A7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="16" range_end="16" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="28" mapping="49" name="ALFA3_B7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="17" range_end="17" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="29" mapping="52" name="ALFA4_B7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="20" range_end="20" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="30" mapping="53" name="ALFA4_A7R1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="21" range_end="21" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="31" mapping="54" name="ALFA4_A7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="22" range_end="22" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="32" mapping="55" name="ALFA4_B7L1U" type="ALFA" input="ctpcore" version="1">
+      <Cable connector="CON0" input="CTPCORE" name="ALFA">
+        <Signal range_begin="23" range_end="23" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="33" mapping="0" name="BCM_AtoC" type="BCM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BCM_AtoCfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="BCM" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="0" range_end="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="34" mapping="1" name="BCM_CtoA" type="BCM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BCM_CtoAfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="BCM" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="1" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="35" mapping="2" name="BCM_Wide" type="BCM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BCM_Widefull" phimin="0" phimax="64" priority="0" thresholdval="40" type="BCM" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="2" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="36" mapping="0" name="BCM_Comb" type="BCMCMB" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BCM_Combfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="BCMCMB" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="37" mapping="0" name="BPTX0" type="BPTX" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BPTX0full" phimin="0" phimax="64" priority="0" thresholdval="40" type="BPTX" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="17" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="38" mapping="1" name="BPTX1" type="BPTX" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="BPTX1full" phimin="0" phimax="64" priority="0" thresholdval="40" type="BPTX" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="18" range_end="18"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="39" mapping="0" name="CAL0" type="CALREQ" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="CAL0full" phimin="0" phimax="64" priority="0" thresholdval="40" type="CALREQ" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="28" range_end="28"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="40" mapping="1" name="CAL1" type="CALREQ" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="CAL1full" phimin="0" phimax="64" priority="0" thresholdval="40" type="CALREQ" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="29" range_end="29"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="41" mapping="2" name="CAL2" type="CALREQ" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="CAL2full" phimin="0" phimax="64" priority="0" thresholdval="40" type="CALREQ" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="30" range_end="30"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="42" mapping="0" name="EM3" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="EM3full" phimin="0" phimax="64" priority="1" thresholdval="3" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="0" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="43" mapping="1" name="EM7" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="EM7full" phimin="0" phimax="64" priority="1" thresholdval="7" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="44" mapping="2" name="EM8VH" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="1" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-18" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="8" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-18" etamax="-15" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="5" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-11" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="6" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="0" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="8" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="14" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="6" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="5" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="18" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="18" etamax="25" had_isolation="63" had_veto="99" isobits="00001" name="EM8VHfull" phimin="0" phimax="64" priority="2" thresholdval="8" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="6" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="45" mapping="3" name="EM8I" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00010" name="EM8Ifull" phimin="0" phimax="64" priority="1" thresholdval="8" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="9" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="46" mapping="4" name="EM10VH" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="1" thresholdval="11" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-18" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="10" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-18" etamax="-15" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-11" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="8" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="0" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="11" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="8" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="11" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="14" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="8" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="7" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="18" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="9" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="18" etamax="25" had_isolation="63" had_veto="99" isobits="00001" name="EM10VHfull" phimin="0" phimax="64" priority="2" thresholdval="10" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="12" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="47" mapping="5" name="EM12" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="EM12full" phimin="0" phimax="64" priority="1" thresholdval="12" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="15" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="48" mapping="6" name="EM15" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="EM15full" phimin="0" phimax="64" priority="1" thresholdval="15" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="18" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="49" mapping="7" name="EM15VH" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="1" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="13" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-12" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="14" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-12" etamax="-9" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-9" etamax="-7" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="9" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="9" etamax="12" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="12" etamax="14" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="14" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="13" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00001" name="EM15VHfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="21" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="50" mapping="8" name="EM15VHI" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="1" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="13" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-12" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="14" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-12" etamax="-9" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-9" etamax="-7" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="9" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="9" etamax="12" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="12" etamax="14" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="14" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="13" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00100" name="EM15VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="0" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="51" mapping="9" name="EM18VHI" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="1" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="16" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="15" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00100" name="EM18VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="52" mapping="10" name="EM20VH" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="1" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00001" name="EM20VHfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="6" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="53" mapping="11" name="EM20VHI" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="1" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="18" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="17" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00100" name="EM20VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="9" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="54" mapping="12" name="EM22VHI" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="1" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00100" name="EM22VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="12" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="55" mapping="13" name="EM22VHIM" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="1" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="20" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="19" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="01000" name="EM22VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="15" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="56" mapping="14" name="EM24VHI" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="1" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="26" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="26" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="00100" name="EM24VHIfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="18" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="57" mapping="15" name="EM24VHIM" type="EM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="1" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="-17" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-17" etamax="-15" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-15" etamax="-14" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-14" etamax="-13" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-13" etamax="-11" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-11" etamax="-8" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-8" etamax="-7" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-7" etamax="0" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="26" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="0" etamax="7" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="26" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="7" etamax="8" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="8" etamax="11" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="24" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="11" etamax="13" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="13" etamax="14" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="22" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="14" etamax="15" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="21" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="15" etamax="17" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="23" type="EM" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="17" etamax="25" had_isolation="63" had_veto="99" isobits="01000" name="EM24VHIMfull" phimin="0" phimax="64" priority="2" thresholdval="25" type="EM" window="0"/>
+      <Cable connector="CON1" input="SLOT7" name="EM2">
+        <Signal range_begin="21" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="58" mapping="0" name="J12" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J12full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J12full" phimin="0" phimax="64" priority="1" thresholdval="12" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="0" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="59" mapping="1" name="J15" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J15full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J15full" phimin="0" phimax="64" priority="1" thresholdval="15" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="60" mapping="2" name="J15.0ETA25" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J15.0ETA25full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="25" had_isolation="63" had_veto="63" name="J15.0ETA25full" phimin="0" phimax="64" priority="1" thresholdval="15" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="6" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="61" mapping="3" name="J20" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J20full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J20full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="9" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="62" mapping="4" name="J25" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J25full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J25full" phimin="0" phimax="64" priority="1" thresholdval="25" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="12" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="63" mapping="5" name="J25.0ETA23" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J25.0ETA23full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-23" etamax="23" had_isolation="63" had_veto="63" name="J25.0ETA23full" phimin="0" phimax="64" priority="1" thresholdval="25" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="15" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="64" mapping="6" name="J30" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J30full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J30full" phimin="0" phimax="64" priority="1" thresholdval="30" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="18" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="65" mapping="7" name="J40" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J40full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J40full" phimin="0" phimax="64" priority="1" thresholdval="40" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="21" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="66" mapping="8" name="J20.0ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J20.0ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J20.0ETA49full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="24" range_end="26"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="67" mapping="9" name="J30.0ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J30.0ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J30.0ETA49full" phimin="0" phimax="64" priority="1" thresholdval="30" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON0" input="SLOT8" name="JET1">
+        <Signal range_begin="27" range_end="29"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="68" mapping="10" name="J35.0ETA23" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J35.0ETA23full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-23" etamax="23" had_isolation="63" had_veto="63" name="J35.0ETA23full" phimin="0" phimax="64" priority="1" thresholdval="35" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="0" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="69" mapping="11" name="J40.0ETA25" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J40.0ETA25full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-25" etamax="25" had_isolation="63" had_veto="63" name="J40.0ETA25full" phimin="0" phimax="64" priority="1" thresholdval="40" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="2" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="70" mapping="12" name="J20.28ETA31" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J20.28ETA31full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="-28" had_isolation="63" had_veto="63" name="J20.28ETA31full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="28" etamax="31" had_isolation="63" had_veto="63" name="J20.28ETA31full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="4" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="71" mapping="13" name="J50" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J50full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J50full" phimin="0" phimax="64" priority="1" thresholdval="50" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="6" range_end="7"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="72" mapping="14" name="J75" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J75full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J75full" phimin="0" phimax="64" priority="1" thresholdval="75" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="8" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="73" mapping="15" name="J85" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J85full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J85full" phimin="0" phimax="64" priority="1" thresholdval="85" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="10" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="74" mapping="16" name="J100" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J100full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J100full" phimin="0" phimax="64" priority="1" thresholdval="100" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="12" range_end="13"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="75" mapping="17" name="J120" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J120full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J120full" phimin="0" phimax="64" priority="1" thresholdval="120" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="14" range_end="15"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="76" mapping="18" name="J400" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J400full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-31" etamax="31" had_isolation="63" had_veto="63" name="J400full" phimin="0" phimax="64" priority="1" thresholdval="400" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="16" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="77" mapping="19" name="J15.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J15.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J15.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="15" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J15.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="15" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="18" range_end="19"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="78" mapping="20" name="J20.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J20.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J20.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J20.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="20" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="20" range_end="21"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="79" mapping="21" name="J30.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J30.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J30.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="30" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J30.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="30" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="22" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="80" mapping="22" name="J50.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J50.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J50.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="50" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J50.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="50" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="24" range_end="25"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="81" mapping="23" name="J75.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J75.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J75.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="75" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J75.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="75" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="26" range_end="27"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="82" mapping="24" name="J100.31ETA49" type="JET" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="J100.31ETA49full" phimin="0" phimax="64" priority="0" thresholdval="1023" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="-31" had_isolation="63" had_veto="63" name="J100.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="100" type="JET" window="8" windowSize="LARGE"/>
+      <TriggerThresholdValue em_isolation="63" etamin="31" etamax="49" had_isolation="63" had_veto="63" name="J100.31ETA49full" phimin="0" phimax="64" priority="1" thresholdval="100" type="JET" window="8" windowSize="LARGE"/>
+      <Cable connector="CON1" input="SLOT8" name="JET2">
+        <Signal range_begin="28" range_end="29"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="83" mapping="0" name="LUCID_A" type="LUCID" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="LUCID_Afull" phimin="0" phimax="64" priority="0" thresholdval="650" type="LUCID" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="19" range_end="19"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="84" mapping="1" name="LUCID_C" type="LUCID" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="LUCID_Cfull" phimin="0" phimax="64" priority="0" thresholdval="650" type="LUCID" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="20" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="85" mapping="0" name="MBTS_A" type="MBTS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A0full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A10full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A11full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A12full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A13full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A14full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A15full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A1full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A2full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A3full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A4full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A5full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A6full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A7full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A8full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A9full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="16" range_end="18"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="86" mapping="1" name="MBTS_C" type="MBTS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C0full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C10full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C11full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C12full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C13full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C14full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C15full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C1full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C2full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C3full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C4full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C5full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C6full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C7full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C8full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C9full" phimin="0" phimax="64" priority="0" thresholdval="0" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="16" range_end="18"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="87" mapping="0" name="MBTS_A0" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A0full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="0" range_end="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="88" mapping="1" name="MBTS_A1" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A1full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="1" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="89" mapping="2" name="MBTS_A2" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A2full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="2" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="90" mapping="3" name="MBTS_A3" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A3full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="3" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="91" mapping="4" name="MBTS_A4" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A4full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="4" range_end="4"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="92" mapping="5" name="MBTS_A5" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A5full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="5" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="93" mapping="6" name="MBTS_A6" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A6full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="6" range_end="6"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="94" mapping="7" name="MBTS_A7" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A7full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="7" range_end="7"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="95" mapping="8" name="MBTS_A8" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A8full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="8" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="96" mapping="9" name="MBTS_A10" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A10full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="9" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="97" mapping="10" name="MBTS_A12" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A12full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="10" range_end="10"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="98" mapping="11" name="MBTS_A14" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_A14full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="11" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="99" mapping="12" name="MBTS_C0" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C0full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="0" range_end="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="100" mapping="13" name="MBTS_C1" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C1full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="1" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="101" mapping="14" name="MBTS_C2" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C2full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="2" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="102" mapping="15" name="MBTS_C3" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C3full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="3" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="103" mapping="16" name="MBTS_C4" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C4full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="4" range_end="4"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="104" mapping="17" name="MBTS_C5" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C5full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="5" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="105" mapping="18" name="MBTS_C6" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C6full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="6" range_end="6"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="106" mapping="19" name="MBTS_C7" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C7full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="7" range_end="7"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="107" mapping="20" name="MBTS_C8" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C8full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="8" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="108" mapping="21" name="MBTS_C10" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C10full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="9" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="109" mapping="22" name="MBTS_C12" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C12full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="10" range_end="10"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="110" mapping="23" name="MBTS_C14" type="MBTSSI" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MBTS_C14full" phimin="0" phimax="64" priority="0" thresholdval="100" type="MBTSSI" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="11" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="111" mapping="0" name="MU4" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU4full" phimin="0" phimax="64" priority="0" thresholdval="4" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="1" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="112" mapping="1" name="MU6" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU6full" phimin="0" phimax="64" priority="0" thresholdval="6" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="4" range_end="6"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="113" mapping="2" name="MU10" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU10full" phimin="0" phimax="64" priority="0" thresholdval="10" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="7" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="114" mapping="3" name="MU11" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU11full" phimin="0" phimax="64" priority="0" thresholdval="11" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="10" range_end="12"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="115" mapping="4" name="MU20" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="13" range_end="15"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="116" mapping="5" name="MU21" type="MUON" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="MU21full" phimin="0" phimax="64" priority="0" thresholdval="21" type="MUON" window="0"/>
+      <Cable connector="CON0" input="SLOT9" name="MUCTPI">
+        <Signal range_begin="16" range_end="18"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="117" mapping="0" name="NIML1A" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="NIML1Afull" phimin="0" phimax="64" priority="0" thresholdval="40" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="19" range_end="19"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="118" mapping="1" name="NIMLHCF" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="NIMLHCFfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="20" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="119" mapping="2" name="AFP_NSC" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_NSCfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="21" range_end="21"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="120" mapping="3" name="AFP_NSA" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_NSAfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="22" range_end="22"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="121" mapping="4" name="AFP_FSA_SIT" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSA_SITfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="23" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="122" mapping="5" name="AFP_FSA_TOF" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSA_TOFfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="24" range_end="24"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="123" mapping="6" name="AFP_FSA_LOG" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSA_LOGfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="25" range_end="25"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="124" mapping="7" name="AFP_FSC_SIT" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSC_SITfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="26" range_end="26"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="125" mapping="8" name="AFP_FSC_LOG" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSC_LOGfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="27" range_end="27"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="126" mapping="9" name="AFP_FSC_TOF" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="AFP_FSC_TOFfull" phimin="0" phimax="64" priority="0" thresholdval="50" type="NIM" window="0"/>
+      <Cable connector="CON2" input="SLOT9" name="NIM1">
+        <Signal range_begin="28" range_end="28"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="127" mapping="12" name="NIMTGC" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="NIMTGCfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="NIM" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="19" range_end="19"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="128" mapping="13" name="NIMRPC" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="NIMRPCfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="NIM" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="20" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="129" mapping="14" name="NIMTRT" type="NIM" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="NIMTRTfull" phimin="0" phimax="64" priority="0" thresholdval="40" type="NIM" window="0"/>
+      <Cable connector="CON3" input="SLOT9" name="NIM2">
+        <Signal range_begin="21" range_end="21"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="130" mapping="0" name="HA8" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA8full" phimin="0" phimax="64" priority="1" thresholdval="8" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="0" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="131" mapping="1" name="HA12" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA12full" phimin="0" phimax="64" priority="1" thresholdval="12" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="132" mapping="2" name="HA12IL" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="HA12ILfull" phimin="0" phimax="64" priority="1" thresholdval="12" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="6" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="133" mapping="3" name="HA12IM" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00010" name="HA12IMfull" phimin="0" phimax="64" priority="1" thresholdval="12" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="9" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="134" mapping="4" name="HA12IT" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="HA12ITfull" phimin="0" phimax="64" priority="1" thresholdval="12" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="12" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="135" mapping="5" name="HA15" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA15full" phimin="0" phimax="64" priority="1" thresholdval="15" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="15" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="136" mapping="6" name="HA20" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA20full" phimin="0" phimax="64" priority="1" thresholdval="20" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="18" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="137" mapping="7" name="HA20IL" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00001" name="HA20ILfull" phimin="0" phimax="64" priority="1" thresholdval="20" type="TAU" window="0"/>
+      <Cable connector="CON2" input="SLOT7" name="TAU1">
+        <Signal range_begin="21" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="138" mapping="8" name="HA20IM" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00010" name="HA20IMfull" phimin="0" phimax="64" priority="1" thresholdval="20" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="0" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="139" mapping="9" name="HA20IT" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00100" name="HA20ITfull" phimin="0" phimax="64" priority="1" thresholdval="20" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="3" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="140" mapping="10" name="HA25" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA25full" phimin="0" phimax="64" priority="1" thresholdval="25" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="6" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="141" mapping="11" name="HA25IM" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00010" name="HA25IMfull" phimin="0" phimax="64" priority="1" thresholdval="25" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="9" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="142" mapping="12" name="HA30" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA30full" phimin="0" phimax="64" priority="1" thresholdval="30" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="12" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="143" mapping="13" name="HA40" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA40full" phimin="0" phimax="64" priority="1" thresholdval="40" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="15" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="144" mapping="14" name="HA60" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA60full" phimin="0" phimax="64" priority="1" thresholdval="60" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="18" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="3" id="145" mapping="15" name="HA100" type="TAU" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="99" isobits="00000" name="HA100full" phimin="0" phimax="64" priority="1" thresholdval="100" type="TAU" window="0"/>
+      <Cable connector="CON3" input="SLOT7" name="TAU2">
+        <Signal range_begin="21" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="146" mapping="0" name="TE5" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE5full" phimin="0" phimax="64" priority="0" thresholdval="5" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="0" range_end="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="147" mapping="1" name="TE10" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE10full" phimin="0" phimax="64" priority="0" thresholdval="10" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="1" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="148" mapping="2" name="TE20" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="2" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="149" mapping="3" name="TE30" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="3" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="150" mapping="4" name="TE40" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="4" range_end="4"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="151" mapping="5" name="TE50" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE50full" phimin="0" phimax="64" priority="0" thresholdval="50" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="5" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="152" mapping="6" name="TE60" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE60full" phimin="0" phimax="64" priority="0" thresholdval="60" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="6" range_end="6"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="153" mapping="7" name="TE70" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE70full" phimin="0" phimax="64" priority="0" thresholdval="70" type="TE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="7" range_end="7"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="154" mapping="8" name="TE5.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE5.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE5.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="5" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="0" range_end="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="155" mapping="9" name="TE10.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE10.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE10.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="10" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="1" range_end="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="156" mapping="10" name="TE15.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE15.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE15.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="15" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="2" range_end="2"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="157" mapping="11" name="TE20.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE20.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="20" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="3" range_end="3"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="158" mapping="12" name="TE25.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE25.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE25.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="25" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="4" range_end="4"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="159" mapping="13" name="TE30.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE30.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="30" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="5" range_end="5"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="160" mapping="14" name="TE40.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE40.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="40" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="6" range_end="6"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="161" mapping="15" name="TE70.0ETA24" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE70.0ETA24full" phimin="0" phimax="64" priority="0" thresholdval="32767" type="TE" window="0"/>
+      <TriggerThresholdValue em_isolation="63" etamin="-24" etamax="24" had_isolation="63" had_veto="63" name="TE70.0ETA24full" phimin="0" phimax="64" priority="1" thresholdval="70" type="TE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="7" range_end="7"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="162" mapping="0" name="900INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="0" range_end="0" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="163" mapping="1" name="800INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="1" range_end="1" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="164" mapping="2" name="700INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="2" range_end="2" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="165" mapping="3" name="500INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="3" range_end="3" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="166" mapping="4" name="400INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="4" range_end="4" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="167" mapping="5" name="300INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="5" range_end="5" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="168" mapping="6" name="200INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="6" range_end="6" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="169" mapping="7" name="100INVM9999-AJ30s6-AJ20s6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="7" range_end="7" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="170" mapping="9" name="HT150-J20s5.ETA31" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="9" range_end="9" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="171" mapping="10" name="HT190-J15s5.ETA21" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="10" range_end="10" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="172" mapping="11" name="1INVM5-EMs1-EMs6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="11" range_end="11" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="173" mapping="12" name="1INVM5-EM7s1-EMs6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="12" range_end="12" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="174" mapping="13" name="1INVM5-EM12s1-EMs6" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="13" range_end="13" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="175" mapping="14" name="05MINDPHI-EM12s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="14" range_end="14" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="176" mapping="15" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="15" range_end="15" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="177" mapping="18" name="1DISAMB-EM15his2-TAU12abi-J25ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="18" range_end="18" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="178" mapping="19" name="1DISAMB-J25ab-0DR28-EM15his2-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="19" range_end="19" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="179" mapping="20" name="2INVM9-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="20" range_end="20" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="180" mapping="22" name="2INVM8-ONEBARREL-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="22" range_end="22" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="181" mapping="24" name="5DETA99-5DPHI99-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="24" range_end="24" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="182" mapping="25" name="5DETA99-5DPHI99-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="25" range_end="25" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="183" mapping="26" name="1DISAMB-TAU20abi-TAU12abi-J25ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="26" range_end="26" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="184" mapping="27" name="0DR28-MU10ab-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="27" range_end="27" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="185" mapping="28" name="0DETA20-0DPHI20-TAU20abi-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="28" range_end="28" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="186" mapping="31" name="DISAMB-0DR28-EM15his2-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="31" range_end="31" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="187" mapping="32" name="05MINDPHI-EM15s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="0" range_end="0" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="188" mapping="33" name="25MT-EM12s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="1" range_end="1" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="189" mapping="35" name="35MT-EM15s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="3" range_end="3" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="190" mapping="37" name="10MINDPHI-J20s2-XE30" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="5" range_end="5" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="191" mapping="38" name="10MINDPHI-J20s2-XE50" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="6" range_end="6" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="192" mapping="39" name="100RATIO-0MATCH-TAU30si2-EMall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="7" range_end="7" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="193" mapping="40" name="NOT-0MATCH-TAU30si2-EMall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="8" range_end="8" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="194" mapping="41" name="LAR-EM50s1" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="9" range_end="9" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="195" mapping="42" name="LAR-J100s1" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="10" range_end="10" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="196" mapping="43" name="NOT-02MATCH-EM10s1-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="11" range_end="11" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="197" mapping="45" name="35MT-EM12s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="13" range_end="13" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="198" mapping="46" name="15MINDPHI-EM12s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="14" range_end="14" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="199" mapping="47" name="15MINDPHI-EM15s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="15" range_end="15" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="200" mapping="48" name="DISAMB-30INVM-EM20his2-TAU12ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="16" range_end="16" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="201" mapping="52" name="0DR22-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="20" range_end="20" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="202" mapping="53" name="7INVM15-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="21" range_end="21" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="203" mapping="54" name="0DR22-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="22" range_end="22" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="204" mapping="55" name="0DR15-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="23" range_end="23" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="205" mapping="56" name="0DR24-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="24" range_end="24" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="206" mapping="57" name="0DR15-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="25" range_end="25" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="207" mapping="58" name="2INVM9-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="26" range_end="26" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="208" mapping="59" name="2INVM9-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON1" input="CTPCORE" name="TOPO1">
+        <Signal range_begin="27" range_end="27" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="209" mapping="64" name="05MINDPHI-AJj10s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="0" range_end="0" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="210" mapping="65" name="10MINDPHI-AJj10s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="1" range_end="1" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="211" mapping="66" name="15MINDPHI-AJj10s6-XE0" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="2" range_end="2" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="212" mapping="67" name="0DR04-MU4ab-CJ15ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="3" range_end="3" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="213" mapping="68" name="0DR04-MU4ab-CJ20ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="4" range_end="4" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="214" mapping="69" name="0DR04-MU4ab-CJ30ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="5" range_end="5" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="215" mapping="70" name="0DR04-MU6ab-CJ20ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="6" range_end="6" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="216" mapping="71" name="0DR04-MU6ab-CJ25ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="7" range_end="7" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="217" mapping="72" name="10MINDPHI-CJ20ab-XE50" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="8" range_end="8" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="218" mapping="73" name="0DR24-2CMU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="9" range_end="9" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="219" mapping="75" name="MULT-CMU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="11" range_end="12" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="2" id="220" mapping="77" name="MULT-CMU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="13" range_end="14" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="221" mapping="80" name="KF-XE40-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="16" range_end="16" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="222" mapping="81" name="KF-XE50-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="17" range_end="17" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="223" mapping="82" name="KF-XE55-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="18" range_end="18" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="224" mapping="83" name="KF-XE60-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="19" range_end="19" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="225" mapping="84" name="KF-XE65-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="20" range_end="20" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="226" mapping="85" name="KF-XE75-AJall" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="21" range_end="21" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="227" mapping="86" name="0MATCH-4AJ20.ETA31-4AJj15.ETA31" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="22" range_end="22" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="228" mapping="87" name="HT190-AJ15all.ETA21" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="23" range_end="23" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="229" mapping="88" name="HT150-AJ20all.ETA31" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="24" range_end="24" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="230" mapping="89" name="HT150-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="25" range_end="25" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="231" mapping="90" name="HT20-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="26" range_end="26" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="232" mapping="93" name="05RATIO-XE0-HT0-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="29" range_end="29" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="233" mapping="95" name="90RATIO2-XE0-HT0-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="31" range_end="31" clock="0"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="234" mapping="99" name="0DETA04-EM8abi-MU10ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="3" range_end="3" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="235" mapping="100" name="0DETA04-EM15abi-MUab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="4" range_end="4" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="236" mapping="101" name="0DR24-CMU4ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="5" range_end="5" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="237" mapping="102" name="0DPHI03-EM8abi-MU10ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="6" range_end="6" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="238" mapping="103" name="2INVM8-CMU4ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="7" range_end="7" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="239" mapping="104" name="0DPHI03-EM15abi-MUab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="8" range_end="8" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="240" mapping="105" name="10MINDPHI-AJ20s2-XE50" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="9" range_end="9" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="241" mapping="106" name="LATE-MU10s1" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="10" range_end="10" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="242" mapping="107" name="SC111-CJ15ab.ETA26" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="11" range_end="11" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="243" mapping="108" name="SC85-CJ15ab.ETA26" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="12" range_end="12" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="244" mapping="112" name="250RATIO2-XE0-HT0-AJj15all.ETA49" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="16" range_end="16" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="245" mapping="113" name="10MINDPHI-J20ab-XE50" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="17" range_end="17" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="246" mapping="114" name="0DR28-TAU20abi-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="18" range_end="18" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="247" mapping="115" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="19" range_end="19" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="248" mapping="116" name="1DISAMB-TAU12abi-J25ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="20" range_end="20" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="249" mapping="117" name="0DR10-MU10ab-MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="21" range_end="21" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="250" mapping="118" name="2DR99-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="22" range_end="22" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="251" mapping="119" name="0DR34-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="23" range_end="23" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="252" mapping="120" name="2DR15-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="24" range_end="24" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="253" mapping="121" name="0DR15-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="25" range_end="25" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="254" mapping="122" name="0DR25-TAU20abi-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="26" range_end="26" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="255" mapping="123" name="1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="27" range_end="27" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="256" mapping="124" name="8INVM15-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="28" range_end="28" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="257" mapping="125" name="8INVM15-2MU6ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="29" range_end="29" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="258" mapping="126" name="2INVM8-2MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="30" range_end="30" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="259" mapping="127" name="2INVM8-MU6ab-MU4ab" type="TOPO" input="ctpcore" version="1">
+      <Cable connector="CON2" input="CTPCORE" name="TOPO2">
+        <Signal range_begin="31" range_end="31" clock="1"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="260" mapping="0" name="XE10" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE10full" phimin="0" phimax="64" priority="0" thresholdval="10" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="8" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="261" mapping="1" name="XE20" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="9" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="262" mapping="2" name="XE25" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE25full" phimin="0" phimax="64" priority="0" thresholdval="25" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="10" range_end="10"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="263" mapping="3" name="XE30" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="11" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="264" mapping="4" name="XE35" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE35full" phimin="0" phimax="64" priority="0" thresholdval="35" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="12" range_end="12"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="265" mapping="5" name="XE40" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="13" range_end="13"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="266" mapping="6" name="XE45" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE45full" phimin="0" phimax="64" priority="0" thresholdval="45" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="14" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="267" mapping="7" name="XE50" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE50full" phimin="0" phimax="64" priority="0" thresholdval="50" type="XE" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="15" range_end="15"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="268" mapping="8" name="XE55" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE55full" phimin="0" phimax="64" priority="0" thresholdval="55" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="8" range_end="8"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="269" mapping="9" name="XE60" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE60full" phimin="0" phimax="64" priority="0" thresholdval="60" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="9" range_end="9"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="270" mapping="10" name="XE65" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE65full" phimin="0" phimax="64" priority="0" thresholdval="65" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="10" range_end="10"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="271" mapping="11" name="XE70" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE70full" phimin="0" phimax="64" priority="0" thresholdval="70" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="11" range_end="11"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="272" mapping="12" name="XE75" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE75full" phimin="0" phimax="64" priority="0" thresholdval="75" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="12" range_end="12"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="273" mapping="13" name="XE80" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE80full" phimin="0" phimax="64" priority="0" thresholdval="80" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="13" range_end="13"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="274" mapping="14" name="XE150" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE150full" phimin="0" phimax="64" priority="0" thresholdval="150" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="14" range_end="14"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="275" mapping="15" name="XE300" type="XE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XE300full" phimin="0" phimax="64" priority="0" thresholdval="300" type="XE" window="0"/>
+      <Cable connector="CON3" input="SLOT8" name="EN2">
+        <Signal range_begin="15" range_end="15"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="276" mapping="0" name="XS20" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="16" range_end="16"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="277" mapping="1" name="XS30" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="17" range_end="17"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="278" mapping="2" name="XS40" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="18" range_end="18"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="279" mapping="3" name="XS45" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS45full" phimin="0" phimax="64" priority="0" thresholdval="45" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="19" range_end="19"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="280" mapping="4" name="XS50" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS50full" phimin="0" phimax="64" priority="0" thresholdval="50" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="20" range_end="20"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="281" mapping="5" name="XS55" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS55full" phimin="0" phimax="64" priority="0" thresholdval="55" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="21" range_end="21"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="282" mapping="6" name="XS60" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS60full" phimin="0" phimax="64" priority="0" thresholdval="60" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="22" range_end="22"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="283" mapping="7" name="XS65" type="XS" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="XS65full" phimin="0" phimax="64" priority="0" thresholdval="65" type="XS" window="0"/>
+      <Cable connector="CON2" input="SLOT8" name="EN1">
+        <Signal range_begin="23" range_end="23"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="284" mapping="0" name="ZB_EM15" type="ZB" input="ctpin" seed="EM15" seed_multi="1" bcdelay="3564" version="1">
+      <Cable connector="CON0" input="SLOT7" name="EM1">
+        <Signal range_begin="30" range_end="30"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="285" mapping="0" name="ZDC_A" type="ZDC" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="ZDC_Afull" phimin="0" phimax="64" priority="0" thresholdval="250" type="ZDC" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="25" range_end="25"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="286" mapping="1" name="ZDC_C" type="ZDC" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="ZDC_Cfull" phimin="0" phimax="64" priority="0" thresholdval="250" type="ZDC" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="26" range_end="26"/>
+      </Cable>
+    </TriggerThreshold>
+    <TriggerThreshold active="1" bitnum="1" id="287" mapping="2" name="ZDC_AND" type="ZDC" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="ZDC_ANDfull" phimin="0" phimax="64" priority="0" thresholdval="250" type="ZDC" window="0"/>
+      <Cable connector="CON1" input="SLOT9" name="CTPCAL">
+        <Signal range_begin="27" range_end="27"/>
+      </Cable>
+    </TriggerThreshold>
+  </TriggerThresholdList>
+  <Random name0="Random0" cut0="1" name1="Random1" cut1="1" name2="Random2" cut2="1" name3="Random3" cut3="1"/>
+  <BunchGroupSet name="MC" menuPartition="0">
+    <BunchGroup internalNumber="0" name="BCRVeto">
+      <Bunch bunchNumber="1"/>
+    </BunchGroup>
+    <BunchGroup internalNumber="1" name="Paired">
+      <Bunch bunchNumber="1"/>
+    </BunchGroup>
+    <BunchGroup internalNumber="2" name="CalReq"/>
+    <BunchGroup internalNumber="3" name="Empty"/>
+    <BunchGroup internalNumber="4" name="IsolatedUnpaired"/>
+    <BunchGroup internalNumber="5" name="NonIsolatedUnpaired"/>
+    <BunchGroup internalNumber="6" name="EmptyAfterPaired"/>
+    <BunchGroup internalNumber="7" name="InTrain">
+      <Bunch bunchNumber="1"/>
+    </BunchGroup>
+    <BunchGroup internalNumber="8" name="AbortGapNotCalReq"/>
+    <BunchGroup internalNumber="9" name="VdM"/>
+    <BunchGroup internalNumber="10" name="ALFA"/>
+    <BunchGroup internalNumber="11" name="EmptyBeforePaired"/>
+    <BunchGroup internalNumber="12" name="EmptyAndPaired"/>
+    <BunchGroup internalNumber="13" name="NotUsed"/>
+    <BunchGroup internalNumber="14" name="NotUsed"/>
+    <BunchGroup internalNumber="15" name="NotUsed"/>
+  </BunchGroupSet>
+  <PrescaledClock clock1="10" clock2="100" name="psc01"/>
+  <CaloInfo name="CaloInfo" global_em_scale="2" global_jet_scale="1">
+    <METSignificance xeMin="11" xeMax="63" teSqrtMin="4" teSqrtMax="63" xsSigmaScale="1150" xsSigmaOffset="1640"/>
+    <Isolation thrtype="HAIsoForEMthr">
+      <Parametrization isobit="1" offset="-2" slope="230" mincut="10" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="2" offset="0" slope="0" mincut="0" upperlimit="0" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="3" offset="-2" slope="230" mincut="10" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="4" offset="-2" slope="230" mincut="10" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="5" offset="-2" slope="230" mincut="10" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+    </Isolation>
+    <Isolation thrtype="EMIsoForEMthr">
+      <Parametrization isobit="1" offset="0" slope="0" mincut="0" upperlimit="0" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="2" offset="-18" slope="80" mincut="20" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="3" offset="-18" slope="80" mincut="20" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="4" offset="-20" slope="80" mincut="10" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="5" offset="-18" slope="80" mincut="15" upperlimit="50" etamin="-49" etamax="49" priority="0"/>
+    </Isolation>
+    <Isolation thrtype="EMIsoForTAUthr">
+      <Parametrization isobit="1" offset="30" slope="100" mincut="0" upperlimit="60" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="2" offset="20" slope="100" mincut="0" upperlimit="60" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="3" offset="15" slope="100" mincut="0" upperlimit="60" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="4" offset="40" slope="0" mincut="0" upperlimit="124" etamin="-49" etamax="49" priority="0"/>
+      <Parametrization isobit="5" offset="30" slope="100" mincut="0" upperlimit="60" etamin="-49" etamax="49" priority="0"/>
+    </Isolation>
+    <MinimumTOBPt thrtype="EM" ptmin="3" etamin="-49" etamax="49" priority="0"/>
+    <MinimumTOBPt thrtype="TAU" ptmin="8" etamin="-49" etamax="49" priority="0"/>
+    <MinimumTOBPt thrtype="JETS" window="4" ptmin="12" etamin="-49" etamax="49" priority="0"/>
+    <MinimumTOBPt thrtype="JETL" window="8" ptmin="12" etamin="-49" etamax="49" priority="0"/>
+  </CaloInfo>
+  <MuctpiInfo name="muctpi" low_pt="1" high_pt="1" max_cand="13"/>
+</LVL1Config>
diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml
index 4c842330a290fc9cd80a4f362f9104dffb3d81ca..7ffb5c558f22ad8293a0ec7d484940766c93fb04 100644
--- a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml
+++ b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml
@@ -3,9 +3,9 @@
 <LVL1Config name="MC_pp_v7" ctpVersion="4" l1Version="1">
   <!--File is generated by TriggerMenu-->
   <!--No. L1 thresholds defined: 287-->
-  <!--No. L1 items defined: 495-->
+  <!--No. L1 items defined: 467-->
   <TriggerMenu name="MC_pp_v7" phase="lumi">
-    <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
         <InternalTrigger name="BGRP0"/>
@@ -19,7 +19,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="2" partition="1" name="L1_EM12" complex_deadtime="0" definition="(EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="2" partition="1" name="L1_EM12" complex_deadtime="0" definition="(EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
         <InternalTrigger name="BGRP0"/>
@@ -70,7 +70,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="9" partition="1" name="L1_EM20VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="9" partition="1" name="L1_EM20VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
         <InternalTrigger name="BGRP0"/>
@@ -126,7 +126,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="17" partition="1" name="L1_MU21" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="17" partition="1" name="L1_MU21" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
         <InternalTrigger name="BGRP0"/>
@@ -301,7 +301,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="41" partition="1" name="L1_4J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="41" partition="1" name="L1_4J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="4" name="J15.0ETA25_x4" triggerthreshold="J15.0ETA25"/>
         <InternalTrigger name="BGRP0"/>
@@ -333,7 +333,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="45" partition="1" name="L1_TAU12" complex_deadtime="0" definition="(HA12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="45" partition="1" name="L1_TAU12" complex_deadtime="0" definition="(HA12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA12_x1" triggerthreshold="HA12"/>
         <InternalTrigger name="BGRP0"/>
@@ -347,20 +347,13 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="47" partition="1" name="L1_TAU12IM" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="47" partition="1" name="L1_TAU12IM" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="48" partition="1" name="L1_TE15.0ETA24" complex_deadtime="0" definition="(TE15.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE15.0ETA24_x1" triggerthreshold="TE15.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="49" partition="1" name="L1_TAU20" complex_deadtime="0" definition="(HA20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
@@ -383,7 +376,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="52" partition="1" name="L1_TAU100" complex_deadtime="0" definition="(HA100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="52" partition="1" name="L1_TAU100" complex_deadtime="0" definition="(HA100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA100_x1" triggerthreshold="HA100"/>
         <InternalTrigger name="BGRP0"/>
@@ -397,14 +390,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="54" partition="1" name="L1_TAU40" complex_deadtime="0" definition="(HA40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="54" partition="1" name="L1_TAU40" complex_deadtime="0" definition="(HA40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="55" partition="1" name="L1_TAU60" complex_deadtime="0" definition="(HA60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="55" partition="1" name="L1_TAU60" complex_deadtime="0" definition="(HA60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/>
         <InternalTrigger name="BGRP0"/>
@@ -538,16 +531,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="71" partition="1" name="L1_J25_2J20_3J12_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(J25[x1]&amp;J20[x2]&amp;J12[x3]&amp;0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
-        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="72" partition="1" name="L1_DR-MU10TAU12I_TAU12I-J25" complex_deadtime="0" definition="(0DR28-MU10ab-TAU12abi[x1]&amp;1DISAMB-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR28-MU10ab-TAU12abi_x1" triggerthreshold="0DR28-MU10ab-TAU12abi"/>
@@ -588,17 +571,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="77" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS30[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="78" partition="1" name="L1_EM15VHI_2TAU12IM_XE35" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
@@ -608,28 +580,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="79" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS40[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="80" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="81" partition="1" name="L1_MU10_TAU12IM_XE35" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -639,9 +589,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="82" partition="1" name="L1_TE15" complex_deadtime="0" definition="(TE15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="82" partition="1" name="L1_TE40" complex_deadtime="0" definition="(TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE15_x1" triggerthreshold="TE15"/>
+        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -655,15 +605,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="84" partition="1" name="L1_TAU20_2TAU12_XE35" complex_deadtime="0" definition="(HA20[x1]&amp;HA12[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
-        <TriggerCondition multi="2" name="HA12_x2" triggerthreshold="HA12"/>
-        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="85" partition="1" name="L1_XE30" complex_deadtime="0" definition="(XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
@@ -678,14 +619,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="87" partition="1" name="L1_MU4_J12" complex_deadtime="0" definition="(MU4[x1]&amp;J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="88" partition="1" name="L1_MU6_J20" complex_deadtime="0" definition="(MU6[x1]&amp;J20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
@@ -710,7 +643,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="91" partition="1" name="L1_J12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="91" partition="1" name="L1_J12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:111">
       <AND>
         <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
         <InternalTrigger name="BGRP0"/>
@@ -787,21 +720,21 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="102" partition="1" name="L1_J400" complex_deadtime="0" definition="(J400[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="102" partition="1" name="L1_J400" complex_deadtime="0" definition="(J400[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J400_x1" triggerthreshold="J400"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="103" partition="1" name="L1_J20.31ETA49" complex_deadtime="0" definition="(J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="103" partition="1" name="L1_J20.31ETA49" complex_deadtime="0" definition="(J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="104" partition="1" name="L1_J30.31ETA49" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="104" partition="1" name="L1_J30.31ETA49" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
@@ -815,7 +748,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="106" partition="1" name="L1_J75.31ETA49" complex_deadtime="0" definition="(J75.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="106" partition="1" name="L1_J75.31ETA49" complex_deadtime="0" definition="(J75.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J75.31ETA49_x1" triggerthreshold="J75.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
@@ -829,9 +762,10 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="108" partition="1" name="L1_XE65" complex_deadtime="0" definition="(XE65[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="108" partition="1" name="L1_MU4_TE40" complex_deadtime="0" definition="(MU4[x1]&amp;TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE65_x1" triggerthreshold="XE65"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -941,13 +875,10 @@
         <InternalTrigger name="BGRP8"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="124" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="124" partition="1" name="L1_MU4_TE50" complex_deadtime="0" definition="(MU4[x1]&amp;TE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE50_x1" triggerthreshold="TE50"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -967,13 +898,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="127" partition="1" name="L1_3J20" complex_deadtime="0" definition="(J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="128" partition="1" name="L1_3J40" complex_deadtime="0" definition="(J40[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J40_x3" triggerthreshold="J40"/>
@@ -981,13 +905,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="129" partition="1" name="L1_3J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="J15.0ETA25_x3" triggerthreshold="J15.0ETA25"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="130" partition="1" name="L1_3J50" complex_deadtime="0" definition="(J50[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J50_x3" triggerthreshold="J50"/>
@@ -1009,17 +926,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="133" partition="1" name="L1_J75_XE50" complex_deadtime="0" definition="(J75[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
-        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="134" partition="1" name="L1_XE75" complex_deadtime="0" definition="(XE75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="134" partition="1" name="L1_MBTSA0" complex_deadtime="0" definition="(MBTS_A0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE75_x1" triggerthreshold="XE75"/>
+        <TriggerCondition multi="1" name="MBTS_A0_x1" triggerthreshold="MBTS_A0"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1047,9 +956,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="138" partition="1" name="L1_TE10" complex_deadtime="0" definition="(TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="138" partition="1" name="L1_TE30" complex_deadtime="0" definition="(TE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <TriggerCondition multi="1" name="TE30_x1" triggerthreshold="TE30"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1088,9 +997,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="143" partition="1" name="L1_TE25" complex_deadtime="0" definition="(TE25[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="143" partition="1" name="L1_TE50" complex_deadtime="0" definition="(TE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE25_x1" triggerthreshold="TE25"/>
+        <TriggerCondition multi="1" name="TE50_x1" triggerthreshold="TE50"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1130,7 +1039,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="149" partition="1" name="L1_XE60" complex_deadtime="0" definition="(XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="149" partition="1" name="L1_XE60" complex_deadtime="0" definition="(XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
         <InternalTrigger name="BGRP0"/>
@@ -1144,23 +1053,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="151" partition="1" name="L1_XE80" complex_deadtime="0" definition="(XE80[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="151" partition="1" name="L1_XE80" complex_deadtime="0" definition="(XE80[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE80_x1" triggerthreshold="XE80"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="152" partition="1" name="L1_XS20" complex_deadtime="0" definition="(XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="152" partition="1" name="L1_TE70" complex_deadtime="0" definition="(TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
+        <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="153" partition="1" name="L1_XS30" complex_deadtime="0" definition="(XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="153" partition="1" name="L1_MBTSA2" complex_deadtime="0" definition="(MBTS_A2[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
+        <TriggerCondition multi="1" name="MBTS_A2_x1" triggerthreshold="MBTS_A2"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1181,37 +1090,37 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="156" partition="1" name="L1_XE150" complex_deadtime="0" definition="(XE150[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="156" partition="1" name="L1_MBTSA3" complex_deadtime="0" definition="(MBTS_A3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE150_x1" triggerthreshold="XE150"/>
+        <TriggerCondition multi="1" name="MBTS_A3_x1" triggerthreshold="MBTS_A3"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="157" partition="1" name="L1_TE30" complex_deadtime="0" definition="(TE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="157" partition="1" name="L1_TE5" complex_deadtime="0" definition="(TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE30_x1" triggerthreshold="TE30"/>
+        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="158" partition="1" name="L1_TE40" complex_deadtime="0" definition="(TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="158" partition="1" name="L1_TE10" complex_deadtime="0" definition="(TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="159" partition="1" name="L1_TE70" complex_deadtime="0" definition="(TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="159" partition="1" name="L1_TE20" complex_deadtime="0" definition="(TE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        <TriggerCondition multi="1" name="TE20_x1" triggerthreshold="TE20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="160" partition="1" name="L1_TE30.0ETA24" complex_deadtime="0" definition="(TE30.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="160" partition="1" name="L1_TE60" complex_deadtime="0" definition="(TE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE30.0ETA24_x1" triggerthreshold="TE30.0ETA24"/>
+        <TriggerCondition multi="1" name="TE60_x1" triggerthreshold="TE60"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1338,7 +1247,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="174" partition="1" name="L1_AFP_A_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="174" partition="1" name="L1_AFP_A_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
         <InternalTrigger name="BGRP0"/>
@@ -1368,9 +1277,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="178" partition="1" name="L1_BPH-2M8-2MU4" complex_deadtime="0" definition="(2INVM8-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="178" partition="1" name="L1_MBTSA4" complex_deadtime="0" definition="(MBTS_A4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-2MU4ab_x1" triggerthreshold="2INVM8-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_A4_x1" triggerthreshold="MBTS_A4"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1449,7 +1358,7 @@
         <InternalTrigger name="BGRP10"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="189" partition="1" name="L1_AFP_C_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSC_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="189" partition="1" name="L1_AFP_C_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSC_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
         <InternalTrigger name="BGRP0"/>
@@ -1699,7 +1608,7 @@
         <InternalTrigger name="BGRP4"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="215" partition="1" name="L1_LUCID_A_C_EMPTY" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="215" partition="1" name="L1_LUCID_A_C_EMPTY" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
         <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
@@ -1737,7 +1646,7 @@
         <InternalTrigger name="BGRP3"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="220" partition="1" name="L1_TGC_BURST" complex_deadtime="0" definition="(NIMTGC[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="220" partition="1" name="L1_TGC_BURST" complex_deadtime="0" definition="(NIMTGC[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="NIMTGC_x1" triggerthreshold="NIMTGC"/>
         <InternalTrigger name="BGRP0"/>
@@ -1779,7 +1688,7 @@
         <InternalTrigger name="BGRP4"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="226" partition="1" name="L1_MBTS_1" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="226" partition="1" name="L1_MBTS_1" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <OR>
           <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
@@ -1789,7 +1698,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="227" partition="1" name="L1_MBTS_2" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="227" partition="1" name="L1_MBTS_2" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <OR>
           <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
@@ -1805,7 +1714,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="228" partition="1" name="L1_MBTS_1_1" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="228" partition="1" name="L1_MBTS_1_1" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
         <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
@@ -1876,21 +1785,21 @@
         <InternalTrigger name="BGRP2"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="238" partition="1" name="L1_BTAG-MU4J15" complex_deadtime="0" definition="(0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="238" partition="1" name="L1_BTAG-MU4J15" complex_deadtime="0" definition="(0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="239" partition="1" name="L1_BTAG-MU4J30" complex_deadtime="0" definition="(0DR04-MU4ab-CJ30ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="239" partition="1" name="L1_MBTSA5" complex_deadtime="0" definition="(MBTS_A5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ30ab_x1" triggerthreshold="0DR04-MU4ab-CJ30ab"/>
+        <TriggerCondition multi="1" name="MBTS_A5_x1" triggerthreshold="MBTS_A5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="240" partition="1" name="L1_ZB" complex_deadtime="0" definition="(ZB_EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="240" partition="1" name="L1_ZB" complex_deadtime="0" definition="(ZB_EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZB_EM15_x1" triggerthreshold="ZB_EM15"/>
         <InternalTrigger name="BGRP0"/>
@@ -1916,9 +1825,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="244" partition="1" name="L1_BTAG-MU6J25" complex_deadtime="0" definition="(0DR04-MU6ab-CJ25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="244" partition="1" name="L1_MBTSA6" complex_deadtime="0" definition="(MBTS_A6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="0DR04-MU6ab-CJ25ab_x1" triggerthreshold="0DR04-MU6ab-CJ25ab"/>
+        <TriggerCondition multi="1" name="MBTS_A6_x1" triggerthreshold="MBTS_A6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1932,7 +1841,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="246" partition="1" name="L1_3J15_BTAG-MU4J15" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="246" partition="1" name="L1_3J15_BTAG-MU4J15" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
         <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
@@ -1964,16 +1873,18 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="250" partition="1" name="L1_J40.0ETA25_2J30_J20.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J30[x2]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="250" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
-        <TriggerCondition multi="2" name="J30_x2" triggerthreshold="J30"/>
-        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
         <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
@@ -2014,23 +1925,13 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="256" partition="1" name="L1_MU11" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="256" partition="1" name="L1_MU11" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="257" partition="1" name="L1_MU4_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
-        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="258" partition="1" name="L1_HT190-J15.ETA21" complex_deadtime="0" definition="(HT190-AJ15all.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT190-AJ15all.ETA21_x1" triggerthreshold="HT190-AJ15all.ETA21"/>
@@ -2038,51 +1939,51 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="259" partition="1" name="L1_HT190-J15s5.ETA21" complex_deadtime="0" definition="(HT190-J15s5.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="259" partition="1" name="L1_HT190-J15s5.ETA21" complex_deadtime="0" definition="(HT190-J15s5.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT190-J15s5.ETA21_x1" triggerthreshold="HT190-J15s5.ETA21"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="260" partition="1" name="L1_HT150-J20.ETA31" complex_deadtime="0" definition="(HT150-AJ20all.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="260" partition="1" name="L1_HT150-J20.ETA31" complex_deadtime="0" definition="(HT150-AJ20all.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT150-AJ20all.ETA31_x1" triggerthreshold="HT150-AJ20all.ETA31"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="261" partition="1" name="L1_HT150-J20s5.ETA31" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="261" partition="1" name="L1_HT150-J20s5.ETA31" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT150-J20s5.ETA31_x1" triggerthreshold="HT150-J20s5.ETA31"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="262" partition="1" name="L1_JPSI-1M5" complex_deadtime="0" definition="(1INVM5-EMs1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="262" partition="1" name="L1_JPSI-1M5" complex_deadtime="0" definition="(1INVM5-EMs1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EMs1-EMs6_x1" triggerthreshold="1INVM5-EMs1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="263" partition="1" name="L1_JPSI-1M5-EM7" complex_deadtime="0" definition="(1INVM5-EM7s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="263" partition="1" name="L1_JPSI-1M5-EM7" complex_deadtime="0" definition="(1INVM5-EM7s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EM7s1-EMs6_x1" triggerthreshold="1INVM5-EM7s1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="264" partition="1" name="L1_JPSI-1M5-EM12" complex_deadtime="0" definition="(1INVM5-EM12s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="264" partition="1" name="L1_JPSI-1M5-EM12" complex_deadtime="0" definition="(1INVM5-EM12s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EM12s1-EMs6_x1" triggerthreshold="1INVM5-EM12s1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="265" partition="1" name="L1_KF-XE40" complex_deadtime="0" definition="(KF-XE40-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="265" partition="1" name="L1_MBTSA7" complex_deadtime="0" definition="(MBTS_A7[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="KF-XE40-AJall_x1" triggerthreshold="KF-XE40-AJall"/>
+        <TriggerCondition multi="1" name="MBTS_A7_x1" triggerthreshold="MBTS_A7"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2094,7 +1995,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="267" partition="1" name="L1_KF-XE55" complex_deadtime="0" definition="(KF-XE55-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="267" partition="1" name="L1_KF-XE55" complex_deadtime="0" definition="(KF-XE55-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="KF-XE55-AJall_x1" triggerthreshold="KF-XE55-AJall"/>
         <InternalTrigger name="BGRP0"/>
@@ -2148,24 +2049,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="274" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="275" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="274" partition="1" name="L1_MBTSA8" complex_deadtime="0" definition="(MBTS_A8[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="MBTS_A8_x1" triggerthreshold="MBTS_A8"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2237,24 +2123,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="284" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="284" partition="1" name="L1_MBTSA10" complex_deadtime="0" definition="(MBTS_A10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="285" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS40[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="MBTS_A10_x1" triggerthreshold="MBTS_A10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2267,78 +2138,38 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="287" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS40[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="288" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="289" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="290" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM10VH[x1]&amp;XS50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/>
-        <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="291" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="287" partition="1" name="L1_MBTSA12" complex_deadtime="0" definition="(MBTS_A12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <TriggerCondition multi="1" name="MBTS_A12_x1" triggerthreshold="MBTS_A12"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="292" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM20VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="289" partition="1" name="L1_MBTSA14" complex_deadtime="0" definition="(MBTS_A14[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <TriggerCondition multi="1" name="MBTS_A14_x1" triggerthreshold="MBTS_A14"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="293" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM22VHI[x1]&amp;XS40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="293" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
+        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
+        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="294" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="294" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
         <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
         <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
         <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2350,26 +2181,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="296" partition="1" name="L1_BPH-2M8-2MU4_BPH-0DR15-2MU4" complex_deadtime="0" definition="(2INVM8-2MU4ab[x1]&amp;0DR15-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="296" partition="1" name="L1_MBTSC0" complex_deadtime="0" definition="(MBTS_C0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-2MU4ab_x1" triggerthreshold="2INVM8-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-2MU4ab_x1" triggerthreshold="0DR15-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C0_x1" triggerthreshold="MBTS_C0"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="297" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="297" partition="1" name="L1_MBTSC1" complex_deadtime="0" definition="(MBTS_C1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2MU4ab_x1" triggerthreshold="0DR24-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C1_x1" triggerthreshold="MBTS_C1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="298" partition="1" name="L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4" complex_deadtime="0" definition="(2INVM8-MU6ab-MU4ab[x1]&amp;0DR15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="298" partition="1" name="L1_MBTSC2" complex_deadtime="0" definition="(MBTS_C2[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-MU6ab-MU4ab_x1" triggerthreshold="2INVM8-MU6ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-MU6ab-MU4ab_x1" triggerthreshold="0DR15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C2_x1" triggerthreshold="MBTS_C2"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2406,7 +2234,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="303" partition="1" name="L1_2MU4-B" complex_deadtime="0" definition="(MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="303" partition="1" name="L1_2MU4-B" complex_deadtime="0" definition="(MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
         <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
@@ -2430,19 +2258,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="306" partition="1" name="L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4" complex_deadtime="0" definition="(2INVM8-CMU4ab-MU4ab[x1]&amp;0DR15-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="306" partition="1" name="L1_MBTSC3" complex_deadtime="0" definition="(MBTS_C3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-CMU4ab-MU4ab_x1" triggerthreshold="2INVM8-CMU4ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-2MU4ab_x1" triggerthreshold="0DR15-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C3_x1" triggerthreshold="MBTS_C3"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="307" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2MU4ab[x1]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="307" partition="1" name="L1_MBTSC4" complex_deadtime="0" definition="(MBTS_C4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2MU4ab_x1" triggerthreshold="0DR24-2MU4ab"/>
-        <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C4_x1" triggerthreshold="MBTS_C4"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2475,18 +2300,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="310" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="310" partition="1" name="L1_MBTSC5" complex_deadtime="0" definition="(MBTS_C5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2CMU4ab_x1" triggerthreshold="0DR24-2CMU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C5_x1" triggerthreshold="MBTS_C5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="311" partition="1" name="L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4" complex_deadtime="0" definition="(2INVM8-ONEBARREL-MU6ab-MU4ab[x1]&amp;0DR15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="311" partition="1" name="L1_MBTSC6" complex_deadtime="0" definition="(MBTS_C6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-ONEBARREL-MU6ab-MU4ab_x1" triggerthreshold="2INVM8-ONEBARREL-MU6ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-MU6ab-MU4ab_x1" triggerthreshold="0DR15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C6_x1" triggerthreshold="MBTS_C6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2521,15 +2344,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="316" partition="1" name="L1_EM15VH_2EM8VH_MU6" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x2]&amp;MU6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="2" name="EM8VH_x2" triggerthreshold="EM8VH"/>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="317" partition="1" name="L1_AFP_A_OR_C_MBTS_2" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
@@ -2556,14 +2370,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="318" partition="1" name="L1_DY-BOX-2MU6" complex_deadtime="0" definition="(5DETA99-5DPHI99-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="318" partition="1" name="L1_DY-BOX-2MU6" complex_deadtime="0" definition="(5DETA99-5DPHI99-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="5DETA99-5DPHI99-2MU6ab_x1" triggerthreshold="5DETA99-5DPHI99-2MU6ab"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="319" partition="1" name="L1_LFV-MU" complex_deadtime="0" definition="(0DR10-MU10ab-MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="319" partition="1" name="L1_LFV-MU" complex_deadtime="0" definition="(0DR10-MU10ab-MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR10-MU10ab-MU6ab_x1" triggerthreshold="0DR10-MU10ab-MU6ab"/>
         <InternalTrigger name="BGRP0"/>
@@ -2586,13 +2400,12 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="322" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="322" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
         <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
         <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
         <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2618,13 +2431,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="326" partition="1" name="L1_MJJ-900" complex_deadtime="0" definition="(900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="327" partition="1" name="L1_MJJ-800" complex_deadtime="0" definition="(800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
@@ -2632,13 +2438,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="328" partition="1" name="L1_MJJ-700" complex_deadtime="0" definition="(700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="329" partition="1" name="L1_MJJ-400" complex_deadtime="0" definition="(400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
@@ -2646,20 +2445,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="330" partition="1" name="L1_MU4_J50_XE40" complex_deadtime="0" definition="(MU4[x1]&amp;J50[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="331" partition="1" name="L1_MBTSC7" complex_deadtime="0" definition="(MBTS_C7[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
-        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="331" partition="1" name="L1_2MU4_J40_XE20" complex_deadtime="0" definition="(MU4[x2]&amp;J40[x1]&amp;XE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
-        <TriggerCondition multi="1" name="XE20_x1" triggerthreshold="XE20"/>
+        <TriggerCondition multi="1" name="MBTS_C7_x1" triggerthreshold="MBTS_C7"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2714,7 +2502,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="339" partition="1" name="L1_LLP-NOMATCH" complex_deadtime="0" definition="(NOT-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="339" partition="1" name="L1_LLP-NOMATCH" complex_deadtime="0" definition="(NOT-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="NOT-0MATCH-TAU30si2-EMall_x1" triggerthreshold="NOT-0MATCH-TAU30si2-EMall"/>
         <InternalTrigger name="BGRP0"/>
@@ -2749,17 +2537,18 @@
         <InternalTrigger name="BGRP4"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="344" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="344" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
+        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
+        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="345" partition="1" name="L1_EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-EM15his2-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="345" partition="1" name="L1_EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-EM15his2-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1DISAMB-EM15his2-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-EM15his2-TAU12abi-J25ab"/>
         <InternalTrigger name="BGRP0"/>
@@ -2787,28 +2576,21 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="349" partition="1" name="L1_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="350" partition="1" name="L1_DR-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="350" partition="1" name="L1_DR-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="351" partition="1" name="L1_LAR-EM" complex_deadtime="0" definition="(LAR-EM50s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="351" partition="1" name="L1_LAR-EM" complex_deadtime="0" definition="(LAR-EM50s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LAR-EM50s1_x1" triggerthreshold="LAR-EM50s1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="352" partition="1" name="L1_LAR-J" complex_deadtime="0" definition="(LAR-J100s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="352" partition="1" name="L1_LAR-J" complex_deadtime="0" definition="(LAR-J100s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LAR-J100s1_x1" triggerthreshold="LAR-J100s1"/>
         <InternalTrigger name="BGRP0"/>
@@ -2830,7 +2612,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="355" partition="1" name="L1_LATE-MU10_J50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="355" partition="1" name="L1_LATE-MU10_J50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
         <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
@@ -2845,7 +2627,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="357" partition="1" name="L1_SC85-CJ15" complex_deadtime="0" definition="(SC85-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="357" partition="1" name="L1_SC85-CJ15" complex_deadtime="0" definition="(SC85-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="SC85-CJ15ab.ETA26_x1" triggerthreshold="SC85-CJ15ab.ETA26"/>
         <InternalTrigger name="BGRP0"/>
@@ -2860,66 +2642,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="359" partition="1" name="L1_MU6_MJJ-300" complex_deadtime="0" definition="(MU6[x1]&amp;300INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="300INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="300INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="360" partition="1" name="L1_MU6_MJJ-400" complex_deadtime="0" definition="(MU6[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="361" partition="1" name="L1_MU6_MJJ-500" complex_deadtime="0" definition="(MU6[x1]&amp;500INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="500INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="500INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="362" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-400" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="363" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-700" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="359" partition="1" name="L1_MBTSC8" complex_deadtime="0" definition="(MBTS_C8[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C8_x1" triggerthreshold="MBTS_C8"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="364" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-800" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="360" partition="1" name="L1_MBTSC10" complex_deadtime="0" definition="(MBTS_C10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C10_x1" triggerthreshold="MBTS_C10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="365" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-900" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="361" partition="1" name="L1_MBTSC12" complex_deadtime="0" definition="(MBTS_C12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C12_x1" triggerthreshold="MBTS_C12"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2960,14 +2699,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="370" partition="1" name="L1_XE35_MJJ-200" complex_deadtime="0" definition="(XE35[x1]&amp;200INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
-        <TriggerCondition multi="1" name="200INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="200INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="371" partition="1" name="L1_EM7_FIRSTEMPTY" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
@@ -2989,27 +2720,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="374" partition="1" name="L1_TE20" complex_deadtime="0" definition="(TE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE20_x1" triggerthreshold="TE20"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="375" partition="1" name="L1_TE10.0ETA24" complex_deadtime="0" definition="(TE10.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE10.0ETA24_x1" triggerthreshold="TE10.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="376" partition="1" name="L1_TE20.0ETA24" complex_deadtime="0" definition="(TE20.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE20.0ETA24_x1" triggerthreshold="TE20.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="377" partition="1" name="L1_MU10_TAU20IM_J25_2J20" complex_deadtime="0" definition="(MU10[x1]&amp;HA20IM[x1]&amp;J25[x1]&amp;J20[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -3073,13 +2783,12 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="384" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="384" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
         <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
         <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
         <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3134,7 +2843,7 @@
         <InternalTrigger name="BGRP6"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="392" partition="1" name="L1_EM24VHI" complex_deadtime="0" definition="(EM24VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="392" partition="1" name="L1_EM24VHI" complex_deadtime="0" definition="(EM24VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM24VHI_x1" triggerthreshold="EM24VHI"/>
         <InternalTrigger name="BGRP0"/>
@@ -3155,23 +2864,6 @@
         <InternalTrigger name="BGRP3"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="395" partition="1" name="L1_EM15VH_2EM10VH_3EM7" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM10VH[x2]&amp;EM7[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="2" name="EM10VH_x2" triggerthreshold="EM10VH"/>
-        <TriggerCondition multi="3" name="EM7_x3" triggerthreshold="EM7"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="396" partition="1" name="L1_EM15VH_3EM8VH" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="3" name="EM8VH_x3" triggerthreshold="EM8VH"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="397" partition="1" name="L1_MJJ-400-CF" complex_deadtime="0" definition="(400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49_x1" triggerthreshold="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49"/>
@@ -3212,7 +2904,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="402" partition="1" name="L1_EM24VHIM" complex_deadtime="0" definition="(EM24VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="402" partition="1" name="L1_EM24VHIM" complex_deadtime="0" definition="(EM24VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM24VHIM_x1" triggerthreshold="EM24VHIM"/>
         <InternalTrigger name="BGRP0"/>
@@ -3249,13 +2941,6 @@
         <InternalTrigger name="BGRP6"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="407" partition="1" name="L1_TE5" complex_deadtime="0" definition="(TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="408" partition="1" name="L1_TAU20IM_2TAU12IM_4J12" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;J12[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
@@ -3265,20 +2950,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="409" partition="1" name="L1_TE25.0ETA24" complex_deadtime="0" definition="(TE25.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE25.0ETA24_x1" triggerthreshold="TE25.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="410" partition="1" name="L1_TE5.0ETA24" complex_deadtime="0" definition="(TE5.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE5.0ETA24_x1" triggerthreshold="TE5.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="411" partition="1" name="L1_EM20VH_FIRSTEMPTY" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
@@ -3314,45 +2985,29 @@
         <InternalTrigger name="BGRP6"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="416" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="416" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="417" partition="1" name="L1_TE70.0ETA24" complex_deadtime="0" definition="(TE70.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE70.0ETA24_x1" triggerthreshold="TE70.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="418" partition="1" name="L1_TE40.0ETA24" complex_deadtime="0" definition="(TE40.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE40.0ETA24_x1" triggerthreshold="TE40.0ETA24"/>
+        <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/>
+        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="419" partition="1" name="L1_ZDC_A" complex_deadtime="0" definition="(ZDC_A[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="419" partition="1" name="L1_ZDC_A" complex_deadtime="0" definition="(ZDC_A[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_A_x1" triggerthreshold="ZDC_A"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="420" partition="1" name="L1_ZDC_C" complex_deadtime="0" definition="(ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="420" partition="1" name="L1_ZDC_C" complex_deadtime="0" definition="(ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_C_x1" triggerthreshold="ZDC_C"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="421" partition="1" name="L1_ZDC_AND" complex_deadtime="0" definition="(ZDC_AND[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="421" partition="1" name="L1_ZDC_AND" complex_deadtime="0" definition="(ZDC_AND[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_AND_x1" triggerthreshold="ZDC_AND"/>
         <InternalTrigger name="BGRP0"/>
@@ -3455,23 +3110,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="434" partition="1" name="L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;EM3[x2]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="435" partition="1" name="L1_MBTSC14" complex_deadtime="0" definition="(MBTS_C14[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
-        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
-        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="435" partition="1" name="L1_3EM3_J40_XE50_DPHI-J20s2XE50" complex_deadtime="0" definition="(EM3[x3]&amp;J40[x1]&amp;XE50[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="EM3_x3" triggerthreshold="EM3"/>
-        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
-        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
+        <TriggerCondition multi="1" name="MBTS_C14_x1" triggerthreshold="MBTS_C14"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3493,7 +3134,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="437" partition="1" name="L1_AFP_A_AND_C_EM3" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="437" partition="1" name="L1_EM3_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
@@ -3504,7 +3145,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="438" partition="1" name="L1_AFP_A_OR_C_EM3" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="438" partition="1" name="L1_EM3_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
           <AND>
@@ -3521,7 +3162,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="439" partition="1" name="L1_AFP_A_AND_C_MU4" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="439" partition="1" name="L1_MU4_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
@@ -3532,7 +3173,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="440" partition="1" name="L1_AFP_A_OR_C_MU4" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="440" partition="1" name="L1_MU4_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
           <AND>
@@ -3577,15 +3218,11 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="443" partition="1" name="L1_AFP_A_AND_C_J50" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="443" partition="1" name="L1_J12_UNPAIREDB1" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP13)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
         <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
+        <InternalTrigger name="BGRP13"/>
       </AND>
     </TriggerItem>
     <TriggerItem ctpid="444" partition="1" name="L1_AFP_A_AND_C_SPECTOF_J50" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
@@ -3597,13 +3234,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="445" partition="1" name="L1_AFP_A_AND_C_J75" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="445" partition="1" name="L1_MBTSA1" complex_deadtime="0" definition="(MBTS_A1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <TriggerCondition multi="1" name="MBTS_A1_x1" triggerthreshold="MBTS_A1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3617,15 +3250,11 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="447" partition="1" name="L1_AFP_A_AND_C_J100" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="447" partition="1" name="L1_BCM_AC_UNPAIREDB1" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP13)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
         <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
+        <InternalTrigger name="BGRP13"/>
       </AND>
     </TriggerItem>
     <TriggerItem ctpid="448" partition="1" name="L1_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
@@ -3695,14 +3324,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="455" partition="1" name="L1_2MU4_XE60" complex_deadtime="0" definition="(MU4[x2]&amp;XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="456" partition="1" name="L1_AFP_A_AND_C_SPECTOF" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
@@ -3728,34 +3349,43 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="459" partition="1" name="L1_AFP_NSA_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="459" partition="1" name="L1_AFP_NSA_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="460" partition="1" name="L1_AFP_NSC_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="460" partition="1" name="L1_AFP_NSC_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="461" partition="1" name="L1_AFP_FSA_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="461" partition="1" name="L1_AFP_FSA_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="462" partition="1" name="L1_AFP_FSC_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="462" partition="1" name="L1_AFP_FSC_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="463" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="465" partition="1" name="L1_J40.0ETA25_2J30_J20.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J30[x2]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="2" name="J30_x2" triggerthreshold="J30"/>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="466" partition="1" name="L1_LATE-MU10_XE40" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3781,6 +3411,74 @@
         <InternalTrigger name="BGRP5"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="470" partition="1" name="L1_MU4_TE10" complex_deadtime="0" definition="(MU4[x1]&amp;TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="471" partition="1" name="L1_LUCID_BGRP9" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP9)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="472" partition="1" name="L1_LUCID_BGRP11" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP11)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="473" partition="1" name="L1_RD0_BGRP10" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP10)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP10"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="474" partition="1" name="L1_2EM3_VTE70" complex_deadtime="0" definition="(EM3[x2]&amp;!TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <NOT>
+          <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        </NOT>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="475" partition="2" name="L1_BCM_CA_UNPAIREDB2" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP14)" trigger_type="0000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP14"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="476" partition="2" name="L1_J12_UNPAIREDB2" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP14)" trigger_type="0100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP14"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="479" partition="1" name="L1_2TAU20IM_J25_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J25[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="480" partition="1" name="L1_J85_3J30" complex_deadtime="0" definition="(J85[x1]&amp;J30[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J85_x1" triggerthreshold="J85"/>
@@ -3789,6 +3487,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="481" partition="1" name="L1_TAU25IM_2TAU12IM_J25_3J12" complex_deadtime="0" definition="(HA25IM[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA25IM_x1" triggerthreshold="HA25IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="482" partition="1" name="L1_MU10_TAU12IM_3J12" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -3822,6 +3530,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="486" partition="1" name="L1_2TAU20IM_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="487" partition="1" name="L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;0DR22-MU6ab-MU4ab[x1]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
@@ -3841,49 +3557,49 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="489" partition="1" name="L1_ALFA_B7L1U" complex_deadtime="0" definition="(ALFA_B7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="489" partition="1" name="L1_ALFA_B7L1U" complex_deadtime="0" definition="(ALFA_B7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7L1U_x1" triggerthreshold="ALFA_B7L1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="490" partition="1" name="L1_ALFA_B7L1L" complex_deadtime="0" definition="(ALFA_B7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="490" partition="1" name="L1_ALFA_B7L1L" complex_deadtime="0" definition="(ALFA_B7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7L1L_x1" triggerthreshold="ALFA_B7L1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="491" partition="1" name="L1_ALFA_A7L1U" complex_deadtime="0" definition="(ALFA_A7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="491" partition="1" name="L1_ALFA_A7L1U" complex_deadtime="0" definition="(ALFA_A7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7L1U_x1" triggerthreshold="ALFA_A7L1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="492" partition="1" name="L1_ALFA_A7L1L" complex_deadtime="0" definition="(ALFA_A7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="492" partition="1" name="L1_ALFA_A7L1L" complex_deadtime="0" definition="(ALFA_A7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7L1L_x1" triggerthreshold="ALFA_A7L1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="493" partition="1" name="L1_ALFA_A7R1U" complex_deadtime="0" definition="(ALFA_A7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="493" partition="1" name="L1_ALFA_A7R1U" complex_deadtime="0" definition="(ALFA_A7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7R1U_x1" triggerthreshold="ALFA_A7R1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="494" partition="1" name="L1_ALFA_A7R1L" complex_deadtime="0" definition="(ALFA_A7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="494" partition="1" name="L1_ALFA_A7R1L" complex_deadtime="0" definition="(ALFA_A7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7R1L_x1" triggerthreshold="ALFA_A7R1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="495" partition="1" name="L1_ALFA_B7R1U" complex_deadtime="0" definition="(ALFA_B7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="495" partition="1" name="L1_ALFA_B7R1U" complex_deadtime="0" definition="(ALFA_B7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7R1U_x1" triggerthreshold="ALFA_B7R1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="496" partition="1" name="L1_ALFA_B7R1L" complex_deadtime="0" definition="(ALFA_B7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="496" partition="1" name="L1_ALFA_B7R1L" complex_deadtime="0" definition="(ALFA_B7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7R1L_x1" triggerthreshold="ALFA_B7R1L"/>
         <InternalTrigger name="BGRP0"/>
@@ -3896,12 +3612,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="498" partition="1" name="L1_MU21_TAU12IM_FTK" complex_deadtime="0" definition="((MU20[x1]|MU21[x1])&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="498" partition="1" name="L1_MU20_TAU12IM_FTK" complex_deadtime="0" definition="(MU20[x1]&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <OR>
-          <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
-          <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
-        </OR>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
         <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
@@ -3946,9 +3659,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="504" partition="1" name="L1_4J15_FTK" complex_deadtime="0" definition="(J15[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="504" partition="1" name="L1_4J20_FTK" complex_deadtime="0" definition="(J20[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="4" name="J15_x4" triggerthreshold="J15"/>
+        <TriggerCondition multi="4" name="J20_x4" triggerthreshold="J20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3981,7 +3694,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="511" partition="1" name="L1_CALREQ2" complex_deadtime="0" definition="(CAL2[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="00110100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="511" partition="1" name="L1_CALREQ2" complex_deadtime="0" definition="(CAL2[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="00110100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="CAL2_x1" triggerthreshold="CAL2"/>
         <InternalTrigger name="BGRP0"/>
@@ -4038,7 +3751,7 @@
     <Prescale ctpid="45" cut="000001" value="1"/>
     <Prescale ctpid="46" cut="000001" value="1"/>
     <Prescale ctpid="47" cut="000001" value="1"/>
-    <Prescale ctpid="48" cut="000001" value="1"/>
+    <Prescale ctpid="48" cut="-000001" value="-1"/>
     <Prescale ctpid="49" cut="000001" value="1"/>
     <Prescale ctpid="50" cut="000001" value="1"/>
     <Prescale ctpid="51" cut="000001" value="1"/>
@@ -4061,23 +3774,23 @@
     <Prescale ctpid="68" cut="000001" value="1"/>
     <Prescale ctpid="69" cut="000001" value="1"/>
     <Prescale ctpid="70" cut="000001" value="1"/>
-    <Prescale ctpid="71" cut="000001" value="1"/>
+    <Prescale ctpid="71" cut="-000001" value="-1"/>
     <Prescale ctpid="72" cut="000001" value="1"/>
     <Prescale ctpid="73" cut="000001" value="1"/>
     <Prescale ctpid="74" cut="000001" value="1"/>
     <Prescale ctpid="75" cut="000001" value="1"/>
     <Prescale ctpid="76" cut="000001" value="1"/>
-    <Prescale ctpid="77" cut="000001" value="1"/>
+    <Prescale ctpid="77" cut="-000001" value="-1"/>
     <Prescale ctpid="78" cut="000001" value="1"/>
-    <Prescale ctpid="79" cut="000001" value="1"/>
-    <Prescale ctpid="80" cut="000001" value="1"/>
+    <Prescale ctpid="79" cut="-000001" value="-1"/>
+    <Prescale ctpid="80" cut="-000001" value="-1"/>
     <Prescale ctpid="81" cut="000001" value="1"/>
     <Prescale ctpid="82" cut="000001" value="1"/>
     <Prescale ctpid="83" cut="000001" value="1"/>
-    <Prescale ctpid="84" cut="000001" value="1"/>
+    <Prescale ctpid="84" cut="-000001" value="-1"/>
     <Prescale ctpid="85" cut="000001" value="1"/>
     <Prescale ctpid="86" cut="000001" value="1"/>
-    <Prescale ctpid="87" cut="000001" value="1"/>
+    <Prescale ctpid="87" cut="-000001" value="-1"/>
     <Prescale ctpid="88" cut="000001" value="1"/>
     <Prescale ctpid="89" cut="000001" value="1"/>
     <Prescale ctpid="90" cut="000001" value="1"/>
@@ -4117,13 +3830,13 @@
     <Prescale ctpid="124" cut="000001" value="1"/>
     <Prescale ctpid="125" cut="000001" value="1"/>
     <Prescale ctpid="126" cut="000001" value="1"/>
-    <Prescale ctpid="127" cut="000001" value="1"/>
+    <Prescale ctpid="127" cut="-000001" value="-1"/>
     <Prescale ctpid="128" cut="000001" value="1"/>
-    <Prescale ctpid="129" cut="000001" value="1"/>
+    <Prescale ctpid="129" cut="-000001" value="-1"/>
     <Prescale ctpid="130" cut="000001" value="1"/>
     <Prescale ctpid="131" cut="000001" value="1"/>
     <Prescale ctpid="132" cut="000001" value="1"/>
-    <Prescale ctpid="133" cut="000001" value="1"/>
+    <Prescale ctpid="133" cut="-000001" value="-1"/>
     <Prescale ctpid="134" cut="000001" value="1"/>
     <Prescale ctpid="135" cut="000001" value="1"/>
     <Prescale ctpid="136" cut="000001" value="1"/>
@@ -4247,7 +3960,7 @@
     <Prescale ctpid="254" cut="000001" value="1"/>
     <Prescale ctpid="255" cut="000001" value="1"/>
     <Prescale ctpid="256" cut="000001" value="1"/>
-    <Prescale ctpid="257" cut="000001" value="1"/>
+    <Prescale ctpid="257" cut="-000001" value="-1"/>
     <Prescale ctpid="258" cut="000001" value="1"/>
     <Prescale ctpid="259" cut="000001" value="1"/>
     <Prescale ctpid="260" cut="000001" value="1"/>
@@ -4265,7 +3978,7 @@
     <Prescale ctpid="272" cut="000001" value="1"/>
     <Prescale ctpid="273" cut="000001" value="1"/>
     <Prescale ctpid="274" cut="000001" value="1"/>
-    <Prescale ctpid="275" cut="000001" value="1"/>
+    <Prescale ctpid="275" cut="-000001" value="-1"/>
     <Prescale ctpid="276" cut="000001" value="1"/>
     <Prescale ctpid="277" cut="000001" value="1"/>
     <Prescale ctpid="278" cut="000001" value="1"/>
@@ -4275,14 +3988,14 @@
     <Prescale ctpid="282" cut="000001" value="1"/>
     <Prescale ctpid="283" cut="000001" value="1"/>
     <Prescale ctpid="284" cut="000001" value="1"/>
-    <Prescale ctpid="285" cut="000001" value="1"/>
+    <Prescale ctpid="285" cut="-000001" value="-1"/>
     <Prescale ctpid="286" cut="000001" value="1"/>
     <Prescale ctpid="287" cut="000001" value="1"/>
-    <Prescale ctpid="288" cut="000001" value="1"/>
+    <Prescale ctpid="288" cut="-000001" value="-1"/>
     <Prescale ctpid="289" cut="000001" value="1"/>
-    <Prescale ctpid="290" cut="000001" value="1"/>
-    <Prescale ctpid="291" cut="000001" value="1"/>
-    <Prescale ctpid="292" cut="000001" value="1"/>
+    <Prescale ctpid="290" cut="-000001" value="-1"/>
+    <Prescale ctpid="291" cut="-000001" value="-1"/>
+    <Prescale ctpid="292" cut="-000001" value="-1"/>
     <Prescale ctpid="293" cut="000001" value="1"/>
     <Prescale ctpid="294" cut="000001" value="1"/>
     <Prescale ctpid="295" cut="000001" value="1"/>
@@ -4306,7 +4019,7 @@
     <Prescale ctpid="313" cut="000001" value="1"/>
     <Prescale ctpid="314" cut="000001" value="1"/>
     <Prescale ctpid="315" cut="000001" value="1"/>
-    <Prescale ctpid="316" cut="000001" value="1"/>
+    <Prescale ctpid="316" cut="-000001" value="-1"/>
     <Prescale ctpid="317" cut="000001" value="1"/>
     <Prescale ctpid="318" cut="000001" value="1"/>
     <Prescale ctpid="319" cut="000001" value="1"/>
@@ -4316,11 +4029,11 @@
     <Prescale ctpid="323" cut="000001" value="1"/>
     <Prescale ctpid="324" cut="000001" value="1"/>
     <Prescale ctpid="325" cut="000001" value="1"/>
-    <Prescale ctpid="326" cut="000001" value="1"/>
+    <Prescale ctpid="326" cut="-000001" value="-1"/>
     <Prescale ctpid="327" cut="000001" value="1"/>
-    <Prescale ctpid="328" cut="000001" value="1"/>
+    <Prescale ctpid="328" cut="-000001" value="-1"/>
     <Prescale ctpid="329" cut="000001" value="1"/>
-    <Prescale ctpid="330" cut="000001" value="1"/>
+    <Prescale ctpid="330" cut="-000001" value="-1"/>
     <Prescale ctpid="331" cut="000001" value="1"/>
     <Prescale ctpid="332" cut="000001" value="1"/>
     <Prescale ctpid="333" cut="000001" value="1"/>
@@ -4339,7 +4052,7 @@
     <Prescale ctpid="346" cut="000001" value="1"/>
     <Prescale ctpid="347" cut="000001" value="1"/>
     <Prescale ctpid="348" cut="000001" value="1"/>
-    <Prescale ctpid="349" cut="000001" value="1"/>
+    <Prescale ctpid="349" cut="-000001" value="-1"/>
     <Prescale ctpid="350" cut="000001" value="1"/>
     <Prescale ctpid="351" cut="000001" value="1"/>
     <Prescale ctpid="352" cut="000001" value="1"/>
@@ -4352,21 +4065,21 @@
     <Prescale ctpid="359" cut="000001" value="1"/>
     <Prescale ctpid="360" cut="000001" value="1"/>
     <Prescale ctpid="361" cut="000001" value="1"/>
-    <Prescale ctpid="362" cut="000001" value="1"/>
-    <Prescale ctpid="363" cut="000001" value="1"/>
-    <Prescale ctpid="364" cut="000001" value="1"/>
-    <Prescale ctpid="365" cut="000001" value="1"/>
+    <Prescale ctpid="362" cut="-000001" value="-1"/>
+    <Prescale ctpid="363" cut="-000001" value="-1"/>
+    <Prescale ctpid="364" cut="-000001" value="-1"/>
+    <Prescale ctpid="365" cut="-000001" value="-1"/>
     <Prescale ctpid="366" cut="000001" value="1"/>
     <Prescale ctpid="367" cut="000001" value="1"/>
     <Prescale ctpid="368" cut="000001" value="1"/>
     <Prescale ctpid="369" cut="000001" value="1"/>
-    <Prescale ctpid="370" cut="000001" value="1"/>
+    <Prescale ctpid="370" cut="-000001" value="-1"/>
     <Prescale ctpid="371" cut="000001" value="1"/>
     <Prescale ctpid="372" cut="000001" value="1"/>
     <Prescale ctpid="373" cut="000001" value="1"/>
-    <Prescale ctpid="374" cut="000001" value="1"/>
-    <Prescale ctpid="375" cut="000001" value="1"/>
-    <Prescale ctpid="376" cut="000001" value="1"/>
+    <Prescale ctpid="374" cut="-000001" value="-1"/>
+    <Prescale ctpid="375" cut="-000001" value="-1"/>
+    <Prescale ctpid="376" cut="-000001" value="-1"/>
     <Prescale ctpid="377" cut="000001" value="1"/>
     <Prescale ctpid="378" cut="000001" value="1"/>
     <Prescale ctpid="379" cut="000001" value="1"/>
@@ -4385,8 +4098,8 @@
     <Prescale ctpid="392" cut="000001" value="1"/>
     <Prescale ctpid="393" cut="000001" value="1"/>
     <Prescale ctpid="394" cut="000001" value="1"/>
-    <Prescale ctpid="395" cut="000001" value="1"/>
-    <Prescale ctpid="396" cut="000001" value="1"/>
+    <Prescale ctpid="395" cut="-000001" value="-1"/>
+    <Prescale ctpid="396" cut="-000001" value="-1"/>
     <Prescale ctpid="397" cut="000001" value="1"/>
     <Prescale ctpid="398" cut="000001" value="1"/>
     <Prescale ctpid="399" cut="000001" value="1"/>
@@ -4397,18 +4110,18 @@
     <Prescale ctpid="404" cut="000001" value="1"/>
     <Prescale ctpid="405" cut="000001" value="1"/>
     <Prescale ctpid="406" cut="000001" value="1"/>
-    <Prescale ctpid="407" cut="000001" value="1"/>
+    <Prescale ctpid="407" cut="-000001" value="-1"/>
     <Prescale ctpid="408" cut="000001" value="1"/>
-    <Prescale ctpid="409" cut="000001" value="1"/>
-    <Prescale ctpid="410" cut="000001" value="1"/>
+    <Prescale ctpid="409" cut="-000001" value="-1"/>
+    <Prescale ctpid="410" cut="-000001" value="-1"/>
     <Prescale ctpid="411" cut="000001" value="1"/>
     <Prescale ctpid="412" cut="000001" value="1"/>
     <Prescale ctpid="413" cut="000001" value="1"/>
     <Prescale ctpid="414" cut="000001" value="1"/>
     <Prescale ctpid="415" cut="000001" value="1"/>
     <Prescale ctpid="416" cut="000001" value="1"/>
-    <Prescale ctpid="417" cut="000001" value="1"/>
-    <Prescale ctpid="418" cut="000001" value="1"/>
+    <Prescale ctpid="417" cut="-000001" value="-1"/>
+    <Prescale ctpid="418" cut="-000001" value="-1"/>
     <Prescale ctpid="419" cut="000001" value="1"/>
     <Prescale ctpid="420" cut="000001" value="1"/>
     <Prescale ctpid="421" cut="000001" value="1"/>
@@ -4424,7 +4137,7 @@
     <Prescale ctpid="431" cut="000001" value="1"/>
     <Prescale ctpid="432" cut="000001" value="1"/>
     <Prescale ctpid="433" cut="000001" value="1"/>
-    <Prescale ctpid="434" cut="000001" value="1"/>
+    <Prescale ctpid="434" cut="-000001" value="-1"/>
     <Prescale ctpid="435" cut="000001" value="1"/>
     <Prescale ctpid="436" cut="000001" value="1"/>
     <Prescale ctpid="437" cut="000001" value="1"/>
@@ -4445,7 +4158,7 @@
     <Prescale ctpid="452" cut="000001" value="1"/>
     <Prescale ctpid="453" cut="000001" value="1"/>
     <Prescale ctpid="454" cut="000001" value="1"/>
-    <Prescale ctpid="455" cut="000001" value="1"/>
+    <Prescale ctpid="455" cut="-000001" value="-1"/>
     <Prescale ctpid="456" cut="000001" value="1"/>
     <Prescale ctpid="457" cut="000001" value="1"/>
     <Prescale ctpid="458" cut="000001" value="1"/>
@@ -4453,30 +4166,30 @@
     <Prescale ctpid="460" cut="000001" value="1"/>
     <Prescale ctpid="461" cut="000001" value="1"/>
     <Prescale ctpid="462" cut="000001" value="1"/>
-    <Prescale ctpid="463" cut="000001" value="1"/>
+    <Prescale ctpid="463" cut="-000001" value="-1"/>
     <Prescale ctpid="464" cut="-000001" value="-1"/>
-    <Prescale ctpid="465" cut="-000001" value="-1"/>
-    <Prescale ctpid="466" cut="-000001" value="-1"/>
+    <Prescale ctpid="465" cut="000001" value="1"/>
+    <Prescale ctpid="466" cut="000001" value="1"/>
     <Prescale ctpid="467" cut="000001" value="1"/>
     <Prescale ctpid="468" cut="000001" value="1"/>
     <Prescale ctpid="469" cut="000001" value="1"/>
-    <Prescale ctpid="470" cut="-000001" value="-1"/>
-    <Prescale ctpid="471" cut="-000001" value="-1"/>
-    <Prescale ctpid="472" cut="-000001" value="-1"/>
-    <Prescale ctpid="473" cut="-000001" value="-1"/>
-    <Prescale ctpid="474" cut="-000001" value="-1"/>
-    <Prescale ctpid="475" cut="-000001" value="-1"/>
-    <Prescale ctpid="476" cut="-000001" value="-1"/>
+    <Prescale ctpid="470" cut="000001" value="1"/>
+    <Prescale ctpid="471" cut="000001" value="1"/>
+    <Prescale ctpid="472" cut="000001" value="1"/>
+    <Prescale ctpid="473" cut="000001" value="1"/>
+    <Prescale ctpid="474" cut="000001" value="1"/>
+    <Prescale ctpid="475" cut="000001" value="1"/>
+    <Prescale ctpid="476" cut="000001" value="1"/>
     <Prescale ctpid="477" cut="-000001" value="-1"/>
     <Prescale ctpid="478" cut="-000001" value="-1"/>
-    <Prescale ctpid="479" cut="-000001" value="-1"/>
+    <Prescale ctpid="479" cut="000001" value="1"/>
     <Prescale ctpid="480" cut="000001" value="1"/>
-    <Prescale ctpid="481" cut="-000001" value="-1"/>
+    <Prescale ctpid="481" cut="000001" value="1"/>
     <Prescale ctpid="482" cut="000001" value="1"/>
     <Prescale ctpid="483" cut="000001" value="1"/>
     <Prescale ctpid="484" cut="000001" value="1"/>
     <Prescale ctpid="485" cut="000001" value="1"/>
-    <Prescale ctpid="486" cut="-000001" value="-1"/>
+    <Prescale ctpid="486" cut="000001" value="1"/>
     <Prescale ctpid="487" cut="000001" value="1"/>
     <Prescale ctpid="488" cut="000001" value="1"/>
     <Prescale ctpid="489" cut="000001" value="1"/>
@@ -5824,9 +5537,6 @@
     <TriggerCounter name="1TE10.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE10.0ETA24" triggerthreshold="TE10.0ETA24" multi="1"/>
     </TriggerCounter>
-    <TriggerCounter name="1TE15" type="CTPIN">
-      <TriggerCondition name="1TE15" triggerthreshold="TE15" multi="1"/>
-    </TriggerCounter>
     <TriggerCounter name="1TE15.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE15.0ETA24" triggerthreshold="TE15.0ETA24" multi="1"/>
     </TriggerCounter>
@@ -5836,9 +5546,6 @@
     <TriggerCounter name="1TE20.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE20.0ETA24" triggerthreshold="TE20.0ETA24" multi="1"/>
     </TriggerCounter>
-    <TriggerCounter name="1TE25" type="CTPIN">
-      <TriggerCondition name="1TE25" triggerthreshold="TE25" multi="1"/>
-    </TriggerCounter>
     <TriggerCounter name="1TE25.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE25.0ETA24" triggerthreshold="TE25.0ETA24" multi="1"/>
     </TriggerCounter>
@@ -5860,6 +5567,12 @@
     <TriggerCounter name="1TE5.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE5.0ETA24" triggerthreshold="TE5.0ETA24" multi="1"/>
     </TriggerCounter>
+    <TriggerCounter name="1TE50" type="CTPIN">
+      <TriggerCondition name="1TE50" triggerthreshold="TE50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE60" type="CTPIN">
+      <TriggerCondition name="1TE60" triggerthreshold="TE60" multi="1"/>
+    </TriggerCounter>
     <TriggerCounter name="1TE70" type="CTPIN">
       <TriggerCondition name="1TE70" triggerthreshold="TE70" multi="1"/>
     </TriggerCounter>
@@ -7028,32 +6741,32 @@
         <Signal range_begin="1" range_end="1"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="148" mapping="2" name="TE15" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE15full" phimin="0" phimax="64" priority="0" thresholdval="15" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="148" mapping="2" name="TE20" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="2" range_end="2"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="149" mapping="3" name="TE20" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="149" mapping="3" name="TE30" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="3" range_end="3"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="150" mapping="4" name="TE25" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE25full" phimin="0" phimax="64" priority="0" thresholdval="25" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="150" mapping="4" name="TE40" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="4" range_end="4"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="151" mapping="5" name="TE30" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="151" mapping="5" name="TE50" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE50full" phimin="0" phimax="64" priority="0" thresholdval="50" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="5" range_end="5"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="152" mapping="6" name="TE40" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="152" mapping="6" name="TE60" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE60full" phimin="0" phimax="64" priority="0" thresholdval="60" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="6" range_end="6"/>
       </Cable>
diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml
index 6f3672b5bdeaaae2297ee5eec3b8893169185d5c..07dea0837e59e94ae40d955d8444f28713c40f38 100644
--- a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml
+++ b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml
@@ -3,9 +3,9 @@
 <LVL1Config name="Physics_pp_v7" ctpVersion="4" l1Version="1">
   <!--File is generated by TriggerMenu-->
   <!--No. L1 thresholds defined: 287-->
-  <!--No. L1 items defined: 496-->
+  <!--No. L1 items defined: 469-->
   <TriggerMenu name="Physics_pp_v7" phase="lumi">
-    <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM3_x1" triggerthreshold="EM3"/>
         <InternalTrigger name="BGRP0"/>
@@ -19,7 +19,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="2" partition="1" name="L1_EM12" complex_deadtime="0" definition="(EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="2" partition="1" name="L1_EM12" complex_deadtime="0" definition="(EM12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
         <InternalTrigger name="BGRP0"/>
@@ -70,7 +70,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="9" partition="1" name="L1_EM20VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="9" partition="1" name="L1_EM20VH" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
         <InternalTrigger name="BGRP0"/>
@@ -126,7 +126,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="17" partition="1" name="L1_MU21" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="17" partition="1" name="L1_MU21" complex_deadtime="0" definition="(MU21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
         <InternalTrigger name="BGRP0"/>
@@ -301,7 +301,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="41" partition="1" name="L1_4J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="41" partition="1" name="L1_4J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="4" name="J15.0ETA25_x4" triggerthreshold="J15.0ETA25"/>
         <InternalTrigger name="BGRP0"/>
@@ -333,7 +333,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="45" partition="1" name="L1_TAU12" complex_deadtime="0" definition="(HA12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="45" partition="1" name="L1_TAU12" complex_deadtime="0" definition="(HA12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA12_x1" triggerthreshold="HA12"/>
         <InternalTrigger name="BGRP0"/>
@@ -347,20 +347,13 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="47" partition="1" name="L1_TAU12IM" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="47" partition="1" name="L1_TAU12IM" complex_deadtime="0" definition="(HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="48" partition="1" name="L1_TE15.0ETA24" complex_deadtime="0" definition="(TE15.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE15.0ETA24_x1" triggerthreshold="TE15.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="49" partition="1" name="L1_TAU20" complex_deadtime="0" definition="(HA20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
@@ -383,7 +376,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="52" partition="1" name="L1_TAU100" complex_deadtime="0" definition="(HA100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="52" partition="1" name="L1_TAU100" complex_deadtime="0" definition="(HA100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA100_x1" triggerthreshold="HA100"/>
         <InternalTrigger name="BGRP0"/>
@@ -397,14 +390,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="54" partition="1" name="L1_TAU40" complex_deadtime="0" definition="(HA40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="54" partition="1" name="L1_TAU40" complex_deadtime="0" definition="(HA40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA40_x1" triggerthreshold="HA40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="55" partition="1" name="L1_TAU60" complex_deadtime="0" definition="(HA60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="55" partition="1" name="L1_TAU60" complex_deadtime="0" definition="(HA60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/>
         <InternalTrigger name="BGRP0"/>
@@ -538,16 +531,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="71" partition="1" name="L1_J25_2J20_3J12_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(J25[x1]&amp;J20[x2]&amp;J12[x3]&amp;0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
-        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="72" partition="1" name="L1_DR-MU10TAU12I_TAU12I-J25" complex_deadtime="0" definition="(0DR28-MU10ab-TAU12abi[x1]&amp;1DISAMB-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR28-MU10ab-TAU12abi_x1" triggerthreshold="0DR28-MU10ab-TAU12abi"/>
@@ -588,17 +571,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="77" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS30[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="78" partition="1" name="L1_EM15VHI_2TAU12IM_XE35" complex_deadtime="0" definition="(EM15VHI[x1]&amp;HA12IM[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM15VHI_x1" triggerthreshold="EM15VHI"/>
@@ -608,28 +580,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="79" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS40[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="80" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="81" partition="1" name="L1_MU10_TAU12IM_XE35" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -639,9 +589,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="82" partition="1" name="L1_TE15" complex_deadtime="0" definition="(TE15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="82" partition="1" name="L1_TE40" complex_deadtime="0" definition="(TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE15_x1" triggerthreshold="TE15"/>
+        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -655,15 +605,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="84" partition="1" name="L1_TAU20_2TAU12_XE35" complex_deadtime="0" definition="(HA20[x1]&amp;HA12[x2]&amp;XE35[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="HA20_x1" triggerthreshold="HA20"/>
-        <TriggerCondition multi="2" name="HA12_x2" triggerthreshold="HA12"/>
-        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="85" partition="1" name="L1_XE30" complex_deadtime="0" definition="(XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
@@ -678,14 +619,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="87" partition="1" name="L1_MU4_J12" complex_deadtime="0" definition="(MU4[x1]&amp;J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="88" partition="1" name="L1_MU6_J20" complex_deadtime="0" definition="(MU6[x1]&amp;J20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
@@ -710,7 +643,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="91" partition="1" name="L1_J12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="91" partition="1" name="L1_J12" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:111">
       <AND>
         <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
         <InternalTrigger name="BGRP0"/>
@@ -787,21 +720,21 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="102" partition="1" name="L1_J400" complex_deadtime="0" definition="(J400[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="102" partition="1" name="L1_J400" complex_deadtime="0" definition="(J400[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J400_x1" triggerthreshold="J400"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="103" partition="1" name="L1_J20.31ETA49" complex_deadtime="0" definition="(J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="103" partition="1" name="L1_J20.31ETA49" complex_deadtime="0" definition="(J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="104" partition="1" name="L1_J30.31ETA49" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="104" partition="1" name="L1_J30.31ETA49" complex_deadtime="0" definition="(J30.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J30.31ETA49_x1" triggerthreshold="J30.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
@@ -815,7 +748,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="106" partition="1" name="L1_J75.31ETA49" complex_deadtime="0" definition="(J75.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="106" partition="1" name="L1_J75.31ETA49" complex_deadtime="0" definition="(J75.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J75.31ETA49_x1" triggerthreshold="J75.31ETA49"/>
         <InternalTrigger name="BGRP0"/>
@@ -829,9 +762,10 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="108" partition="1" name="L1_XE65" complex_deadtime="0" definition="(XE65[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="108" partition="1" name="L1_MU4_TE40" complex_deadtime="0" definition="(MU4[x1]&amp;TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE65_x1" triggerthreshold="XE65"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -941,13 +875,10 @@
         <InternalTrigger name="BGRP8"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="124" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM12s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="124" partition="1" name="L1_MU4_TE50" complex_deadtime="0" definition="(MU4[x1]&amp;TE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE50_x1" triggerthreshold="TE50"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -967,13 +898,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="127" partition="1" name="L1_3J20" complex_deadtime="0" definition="(J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="128" partition="1" name="L1_3J40" complex_deadtime="0" definition="(J40[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J40_x3" triggerthreshold="J40"/>
@@ -981,13 +905,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="129" partition="1" name="L1_3J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="J15.0ETA25_x3" triggerthreshold="J15.0ETA25"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="130" partition="1" name="L1_3J50" complex_deadtime="0" definition="(J50[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J50_x3" triggerthreshold="J50"/>
@@ -1009,17 +926,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="133" partition="1" name="L1_J75_XE50" complex_deadtime="0" definition="(J75[x1]&amp;XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
-        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="134" partition="1" name="L1_XE75" complex_deadtime="0" definition="(XE75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="134" partition="1" name="L1_MBTSA0" complex_deadtime="0" definition="(MBTS_A0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE75_x1" triggerthreshold="XE75"/>
+        <TriggerCondition multi="1" name="MBTS_A0_x1" triggerthreshold="MBTS_A0"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1047,9 +956,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="138" partition="1" name="L1_TE10" complex_deadtime="0" definition="(TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="138" partition="1" name="L1_TE30" complex_deadtime="0" definition="(TE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <TriggerCondition multi="1" name="TE30_x1" triggerthreshold="TE30"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1088,9 +997,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="143" partition="1" name="L1_TE25" complex_deadtime="0" definition="(TE25[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="143" partition="1" name="L1_TE50" complex_deadtime="0" definition="(TE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE25_x1" triggerthreshold="TE25"/>
+        <TriggerCondition multi="1" name="TE50_x1" triggerthreshold="TE50"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1130,7 +1039,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="149" partition="1" name="L1_XE60" complex_deadtime="0" definition="(XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="149" partition="1" name="L1_XE60" complex_deadtime="0" definition="(XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
         <InternalTrigger name="BGRP0"/>
@@ -1144,23 +1053,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="151" partition="1" name="L1_XE80" complex_deadtime="0" definition="(XE80[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="151" partition="1" name="L1_XE80" complex_deadtime="0" definition="(XE80[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="XE80_x1" triggerthreshold="XE80"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="152" partition="1" name="L1_XS20" complex_deadtime="0" definition="(XS20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="152" partition="1" name="L1_TE70" complex_deadtime="0" definition="(TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/>
+        <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="153" partition="1" name="L1_XS30" complex_deadtime="0" definition="(XS30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="153" partition="1" name="L1_MBTSA2" complex_deadtime="0" definition="(MBTS_A2[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/>
+        <TriggerCondition multi="1" name="MBTS_A2_x1" triggerthreshold="MBTS_A2"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1181,37 +1090,37 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="156" partition="1" name="L1_XE150" complex_deadtime="0" definition="(XE150[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="156" partition="1" name="L1_MBTSA3" complex_deadtime="0" definition="(MBTS_A3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="XE150_x1" triggerthreshold="XE150"/>
+        <TriggerCondition multi="1" name="MBTS_A3_x1" triggerthreshold="MBTS_A3"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="157" partition="1" name="L1_TE30" complex_deadtime="0" definition="(TE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="157" partition="1" name="L1_TE5" complex_deadtime="0" definition="(TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE30_x1" triggerthreshold="TE30"/>
+        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="158" partition="1" name="L1_TE40" complex_deadtime="0" definition="(TE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="158" partition="1" name="L1_TE10" complex_deadtime="0" definition="(TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE40_x1" triggerthreshold="TE40"/>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="159" partition="1" name="L1_TE70" complex_deadtime="0" definition="(TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="159" partition="1" name="L1_TE20" complex_deadtime="0" definition="(TE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        <TriggerCondition multi="1" name="TE20_x1" triggerthreshold="TE20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="160" partition="1" name="L1_TE30.0ETA24" complex_deadtime="0" definition="(TE30.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="160" partition="1" name="L1_TE60" complex_deadtime="0" definition="(TE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="TE30.0ETA24_x1" triggerthreshold="TE30.0ETA24"/>
+        <TriggerCondition multi="1" name="TE60_x1" triggerthreshold="TE60"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1338,7 +1247,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="174" partition="1" name="L1_AFP_A_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="174" partition="1" name="L1_AFP_A_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
         <InternalTrigger name="BGRP0"/>
@@ -1368,9 +1277,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="178" partition="1" name="L1_BPH-2M8-2MU4" complex_deadtime="0" definition="(2INVM8-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="178" partition="1" name="L1_MBTSA4" complex_deadtime="0" definition="(MBTS_A4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-2MU4ab_x1" triggerthreshold="2INVM8-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_A4_x1" triggerthreshold="MBTS_A4"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1449,7 +1358,7 @@
         <InternalTrigger name="BGRP10"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="189" partition="1" name="L1_AFP_C_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSC_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="189" partition="1" name="L1_AFP_C_SPECTOF_BGRP0" complex_deadtime="0" definition="(AFP_FSC_TOF[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSC_TOF_x1" triggerthreshold="AFP_FSC_TOF"/>
         <InternalTrigger name="BGRP0"/>
@@ -1699,7 +1608,7 @@
         <InternalTrigger name="BGRP4"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="215" partition="1" name="L1_LUCID_A_C_EMPTY" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="215" partition="1" name="L1_LUCID_A_C_EMPTY" complex_deadtime="0" definition="(LUCID_A[x1]&amp;LUCID_C[x1]&amp;BGRP0&amp;BGRP3)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
         <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
@@ -1737,7 +1646,7 @@
         <InternalTrigger name="BGRP3"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="220" partition="1" name="L1_TGC_BURST" complex_deadtime="0" definition="(NIMTGC[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="220" partition="1" name="L1_TGC_BURST" complex_deadtime="0" definition="(NIMTGC[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="NIMTGC_x1" triggerthreshold="NIMTGC"/>
         <InternalTrigger name="BGRP0"/>
@@ -1779,7 +1688,7 @@
         <InternalTrigger name="BGRP4"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="226" partition="1" name="L1_MBTS_1" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="226" partition="1" name="L1_MBTS_1" complex_deadtime="0" definition="((MBTS_A[x1]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <OR>
           <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
@@ -1789,7 +1698,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="227" partition="1" name="L1_MBTS_2" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="227" partition="1" name="L1_MBTS_2" complex_deadtime="0" definition="((MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <OR>
           <TriggerCondition multi="2" name="MBTS_A_x2" triggerthreshold="MBTS_A"/>
@@ -1805,7 +1714,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="228" partition="1" name="L1_MBTS_1_1" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:111">
+    <TriggerItem ctpid="228" partition="1" name="L1_MBTS_1_1" complex_deadtime="0" definition="(MBTS_A[x1]&amp;MBTS_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:111">
       <AND>
         <TriggerCondition multi="1" name="MBTS_A_x1" triggerthreshold="MBTS_A"/>
         <TriggerCondition multi="1" name="MBTS_C_x1" triggerthreshold="MBTS_C"/>
@@ -1876,21 +1785,21 @@
         <InternalTrigger name="BGRP2"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="238" partition="1" name="L1_BTAG-MU4J15" complex_deadtime="0" definition="(0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="238" partition="1" name="L1_BTAG-MU4J15" complex_deadtime="0" definition="(0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="239" partition="1" name="L1_BTAG-MU4J30" complex_deadtime="0" definition="(0DR04-MU4ab-CJ30ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="239" partition="1" name="L1_MBTSA5" complex_deadtime="0" definition="(MBTS_A5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="0DR04-MU4ab-CJ30ab_x1" triggerthreshold="0DR04-MU4ab-CJ30ab"/>
+        <TriggerCondition multi="1" name="MBTS_A5_x1" triggerthreshold="MBTS_A5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="240" partition="1" name="L1_ZB" complex_deadtime="0" definition="(ZB_EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="240" partition="1" name="L1_ZB" complex_deadtime="0" definition="(ZB_EM15[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000010" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZB_EM15_x1" triggerthreshold="ZB_EM15"/>
         <InternalTrigger name="BGRP0"/>
@@ -1916,9 +1825,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="244" partition="1" name="L1_BTAG-MU6J25" complex_deadtime="0" definition="(0DR04-MU6ab-CJ25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="244" partition="1" name="L1_MBTSA6" complex_deadtime="0" definition="(MBTS_A6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="0DR04-MU6ab-CJ25ab_x1" triggerthreshold="0DR04-MU6ab-CJ25ab"/>
+        <TriggerCondition multi="1" name="MBTS_A6_x1" triggerthreshold="MBTS_A6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -1932,7 +1841,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="246" partition="1" name="L1_3J15_BTAG-MU4J15" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="246" partition="1" name="L1_3J15_BTAG-MU4J15" complex_deadtime="0" definition="(J15[x3]&amp;0DR04-MU4ab-CJ15ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="3" name="J15_x3" triggerthreshold="J15"/>
         <TriggerCondition multi="1" name="0DR04-MU4ab-CJ15ab_x1" triggerthreshold="0DR04-MU4ab-CJ15ab"/>
@@ -1975,7 +1884,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
         <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
@@ -2016,23 +1925,13 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="256" partition="1" name="L1_MU11" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="256" partition="1" name="L1_MU11" complex_deadtime="0" definition="(MU11[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU11_x1" triggerthreshold="MU11"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="257" partition="1" name="L1_MU4_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
-        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="258" partition="1" name="L1_HT190-J15.ETA21" complex_deadtime="0" definition="(HT190-AJ15all.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT190-AJ15all.ETA21_x1" triggerthreshold="HT190-AJ15all.ETA21"/>
@@ -2040,51 +1939,51 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="259" partition="1" name="L1_HT190-J15s5.ETA21" complex_deadtime="0" definition="(HT190-J15s5.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="259" partition="1" name="L1_HT190-J15s5.ETA21" complex_deadtime="0" definition="(HT190-J15s5.ETA21[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT190-J15s5.ETA21_x1" triggerthreshold="HT190-J15s5.ETA21"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="260" partition="1" name="L1_HT150-J20.ETA31" complex_deadtime="0" definition="(HT150-AJ20all.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="260" partition="1" name="L1_HT150-J20.ETA31" complex_deadtime="0" definition="(HT150-AJ20all.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT150-AJ20all.ETA31_x1" triggerthreshold="HT150-AJ20all.ETA31"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="261" partition="1" name="L1_HT150-J20s5.ETA31" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="261" partition="1" name="L1_HT150-J20s5.ETA31" complex_deadtime="0" definition="(HT150-J20s5.ETA31[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HT150-J20s5.ETA31_x1" triggerthreshold="HT150-J20s5.ETA31"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="262" partition="1" name="L1_JPSI-1M5" complex_deadtime="0" definition="(1INVM5-EMs1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="262" partition="1" name="L1_JPSI-1M5" complex_deadtime="0" definition="(1INVM5-EMs1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EMs1-EMs6_x1" triggerthreshold="1INVM5-EMs1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="263" partition="1" name="L1_JPSI-1M5-EM7" complex_deadtime="0" definition="(1INVM5-EM7s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="263" partition="1" name="L1_JPSI-1M5-EM7" complex_deadtime="0" definition="(1INVM5-EM7s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EM7s1-EMs6_x1" triggerthreshold="1INVM5-EM7s1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="264" partition="1" name="L1_JPSI-1M5-EM12" complex_deadtime="0" definition="(1INVM5-EM12s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="264" partition="1" name="L1_JPSI-1M5-EM12" complex_deadtime="0" definition="(1INVM5-EM12s1-EMs6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1INVM5-EM12s1-EMs6_x1" triggerthreshold="1INVM5-EM12s1-EMs6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="265" partition="1" name="L1_KF-XE40" complex_deadtime="0" definition="(KF-XE40-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="265" partition="1" name="L1_MBTSA7" complex_deadtime="0" definition="(MBTS_A7[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="KF-XE40-AJall_x1" triggerthreshold="KF-XE40-AJall"/>
+        <TriggerCondition multi="1" name="MBTS_A7_x1" triggerthreshold="MBTS_A7"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2096,7 +1995,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="267" partition="1" name="L1_KF-XE55" complex_deadtime="0" definition="(KF-XE55-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="267" partition="1" name="L1_KF-XE55" complex_deadtime="0" definition="(KF-XE55-AJall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="KF-XE55-AJall_x1" triggerthreshold="KF-XE55-AJall"/>
         <InternalTrigger name="BGRP0"/>
@@ -2150,24 +2049,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="274" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="274" partition="1" name="L1_MBTSA8" complex_deadtime="0" definition="(MBTS_A8[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="275" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="MBTS_A8_x1" triggerthreshold="MBTS_A8"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2239,24 +2123,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="284" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS40[x1]&amp;15MINDPHI-AJj10s6-XE0[x1]&amp;15MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="285" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS40[x1]&amp;05MINDPHI-AJj10s6-XE0[x1]&amp;05MINDPHI-EM15s6-XE0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="284" partition="1" name="L1_MBTSA10" complex_deadtime="0" definition="(MBTS_A10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
-        <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/>
-        <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/>
+        <TriggerCondition multi="1" name="MBTS_A10_x1" triggerthreshold="MBTS_A10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2269,56 +2138,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="287" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM12[x1]&amp;XS50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/>
-        <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="288" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="289" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&amp;EM10VH[x1]&amp;XS50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/>
-        <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/>
-        <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="290" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM15VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="291" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM20VH[x1]&amp;XS60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="287" partition="1" name="L1_MBTSA12" complex_deadtime="0" definition="(MBTS_A12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
-        <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/>
+        <TriggerCondition multi="1" name="MBTS_A12_x1" triggerthreshold="MBTS_A12"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="292" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&amp;EM22VHI[x1]&amp;XS40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="289" partition="1" name="L1_MBTSA14" complex_deadtime="0" definition="(MBTS_A14[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/>
-        <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/>
-        <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/>
+        <TriggerCondition multi="1" name="MBTS_A14_x1" triggerthreshold="MBTS_A14"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2352,26 +2181,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="296" partition="1" name="L1_BPH-2M8-2MU4_BPH-0DR15-2MU4" complex_deadtime="0" definition="(2INVM8-2MU4ab[x1]&amp;0DR15-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="296" partition="1" name="L1_MBTSC0" complex_deadtime="0" definition="(MBTS_C0[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-2MU4ab_x1" triggerthreshold="2INVM8-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-2MU4ab_x1" triggerthreshold="0DR15-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C0_x1" triggerthreshold="MBTS_C0"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="297" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="297" partition="1" name="L1_MBTSC1" complex_deadtime="0" definition="(MBTS_C1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2MU4ab_x1" triggerthreshold="0DR24-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C1_x1" triggerthreshold="MBTS_C1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="298" partition="1" name="L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4" complex_deadtime="0" definition="(2INVM8-MU6ab-MU4ab[x1]&amp;0DR15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="298" partition="1" name="L1_MBTSC2" complex_deadtime="0" definition="(MBTS_C2[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-MU6ab-MU4ab_x1" triggerthreshold="2INVM8-MU6ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-MU6ab-MU4ab_x1" triggerthreshold="0DR15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C2_x1" triggerthreshold="MBTS_C2"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2408,7 +2234,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="303" partition="1" name="L1_2MU4-B" complex_deadtime="0" definition="(MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="303" partition="1" name="L1_2MU4-B" complex_deadtime="0" definition="(MU4[x2]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
         <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
@@ -2432,19 +2258,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="306" partition="1" name="L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4" complex_deadtime="0" definition="(2INVM8-CMU4ab-MU4ab[x1]&amp;0DR15-2MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="306" partition="1" name="L1_MBTSC3" complex_deadtime="0" definition="(MBTS_C3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-CMU4ab-MU4ab_x1" triggerthreshold="2INVM8-CMU4ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-2MU4ab_x1" triggerthreshold="0DR15-2MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C3_x1" triggerthreshold="MBTS_C3"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="307" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2MU4ab[x1]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="307" partition="1" name="L1_MBTSC4" complex_deadtime="0" definition="(MBTS_C4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2MU4ab_x1" triggerthreshold="0DR24-2MU4ab"/>
-        <TriggerCondition multi="1" name="MULT-CMU4ab_x1" triggerthreshold="MULT-CMU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C4_x1" triggerthreshold="MBTS_C4"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2477,18 +2300,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="310" partition="1" name="L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO" complex_deadtime="0" definition="(7INVM15-2MU4ab[x1]&amp;0DR24-2CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="310" partition="1" name="L1_MBTSC5" complex_deadtime="0" definition="(MBTS_C5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="7INVM15-2MU4ab_x1" triggerthreshold="7INVM15-2MU4ab"/>
-        <TriggerCondition multi="1" name="0DR24-2CMU4ab_x1" triggerthreshold="0DR24-2CMU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C5_x1" triggerthreshold="MBTS_C5"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="311" partition="1" name="L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4" complex_deadtime="0" definition="(2INVM8-ONEBARREL-MU6ab-MU4ab[x1]&amp;0DR15-MU6ab-MU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="311" partition="1" name="L1_MBTSC6" complex_deadtime="0" definition="(MBTS_C6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="2INVM8-ONEBARREL-MU6ab-MU4ab_x1" triggerthreshold="2INVM8-ONEBARREL-MU6ab-MU4ab"/>
-        <TriggerCondition multi="1" name="0DR15-MU6ab-MU4ab_x1" triggerthreshold="0DR15-MU6ab-MU4ab"/>
+        <TriggerCondition multi="1" name="MBTS_C6_x1" triggerthreshold="MBTS_C6"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2523,15 +2344,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="316" partition="1" name="L1_EM15VH_2EM8VH_MU6" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x2]&amp;MU6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="2" name="EM8VH_x2" triggerthreshold="EM8VH"/>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="317" partition="1" name="L1_AFP_A_OR_C_MBTS_2" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_A[x1])&amp;(MBTS_A[x2]|MBTS_C[x2]|MBTS_C[x1])&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
@@ -2558,14 +2370,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="318" partition="1" name="L1_DY-BOX-2MU6" complex_deadtime="0" definition="(5DETA99-5DPHI99-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="318" partition="1" name="L1_DY-BOX-2MU6" complex_deadtime="0" definition="(5DETA99-5DPHI99-2MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="5DETA99-5DPHI99-2MU6ab_x1" triggerthreshold="5DETA99-5DPHI99-2MU6ab"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="319" partition="1" name="L1_LFV-MU" complex_deadtime="0" definition="(0DR10-MU10ab-MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="319" partition="1" name="L1_LFV-MU" complex_deadtime="0" definition="(0DR10-MU10ab-MU6ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="0DR10-MU10ab-MU6ab_x1" triggerthreshold="0DR10-MU10ab-MU6ab"/>
         <InternalTrigger name="BGRP0"/>
@@ -2619,13 +2431,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="326" partition="1" name="L1_MJJ-900" complex_deadtime="0" definition="(900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="327" partition="1" name="L1_MJJ-800" complex_deadtime="0" definition="(800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
@@ -2633,13 +2438,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="328" partition="1" name="L1_MJJ-700" complex_deadtime="0" definition="(700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="329" partition="1" name="L1_MJJ-400" complex_deadtime="0" definition="(400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
@@ -2647,20 +2445,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="330" partition="1" name="L1_MU4_J50_XE40" complex_deadtime="0" definition="(MU4[x1]&amp;J50[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
-        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="331" partition="1" name="L1_2MU4_J40_XE20" complex_deadtime="0" definition="(MU4[x2]&amp;J40[x1]&amp;XE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="331" partition="1" name="L1_MBTSC7" complex_deadtime="0" definition="(MBTS_C7[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
-        <TriggerCondition multi="1" name="XE20_x1" triggerthreshold="XE20"/>
+        <TriggerCondition multi="1" name="MBTS_C7_x1" triggerthreshold="MBTS_C7"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2715,7 +2502,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="339" partition="1" name="L1_LLP-NOMATCH" complex_deadtime="0" definition="(NOT-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="339" partition="1" name="L1_LLP-NOMATCH" complex_deadtime="0" definition="(NOT-0MATCH-TAU30si2-EMall[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="NOT-0MATCH-TAU30si2-EMall_x1" triggerthreshold="NOT-0MATCH-TAU30si2-EMall"/>
         <InternalTrigger name="BGRP0"/>
@@ -2761,7 +2548,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="345" partition="1" name="L1_EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-EM15his2-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="345" partition="1" name="L1_EM15TAU12I-J25" complex_deadtime="0" definition="(1DISAMB-EM15his2-TAU12abi-J25ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1DISAMB-EM15his2-TAU12abi-J25ab_x1" triggerthreshold="1DISAMB-EM15his2-TAU12abi-J25ab"/>
         <InternalTrigger name="BGRP0"/>
@@ -2789,28 +2576,21 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="349" partition="1" name="L1_BOX-TAU20ITAU12I" complex_deadtime="0" definition="(0DETA20-0DPHI20-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="0DETA20-0DPHI20-TAU20abi-TAU12abi_x1" triggerthreshold="0DETA20-0DPHI20-TAU20abi-TAU12abi"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="350" partition="1" name="L1_DR-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="350" partition="1" name="L1_DR-TAU20ITAU12I-J25" complex_deadtime="0" definition="(1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="351" partition="1" name="L1_LAR-EM" complex_deadtime="0" definition="(LAR-EM50s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="351" partition="1" name="L1_LAR-EM" complex_deadtime="0" definition="(LAR-EM50s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LAR-EM50s1_x1" triggerthreshold="LAR-EM50s1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="352" partition="1" name="L1_LAR-J" complex_deadtime="0" definition="(LAR-J100s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="352" partition="1" name="L1_LAR-J" complex_deadtime="0" definition="(LAR-J100s1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10010000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LAR-J100s1_x1" triggerthreshold="LAR-J100s1"/>
         <InternalTrigger name="BGRP0"/>
@@ -2832,7 +2612,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="355" partition="1" name="L1_LATE-MU10_J50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="355" partition="1" name="L1_LATE-MU10_J50" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
         <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
@@ -2847,7 +2627,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="357" partition="1" name="L1_SC85-CJ15" complex_deadtime="0" definition="(SC85-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="357" partition="1" name="L1_SC85-CJ15" complex_deadtime="0" definition="(SC85-CJ15ab.ETA26[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="SC85-CJ15ab.ETA26_x1" triggerthreshold="SC85-CJ15ab.ETA26"/>
         <InternalTrigger name="BGRP0"/>
@@ -2862,66 +2642,23 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="359" partition="1" name="L1_MU6_MJJ-300" complex_deadtime="0" definition="(MU6[x1]&amp;300INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="359" partition="1" name="L1_MBTSC8" complex_deadtime="0" definition="(MBTS_C8[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="300INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="300INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C8_x1" triggerthreshold="MBTS_C8"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="360" partition="1" name="L1_MU6_MJJ-400" complex_deadtime="0" definition="(MU6[x1]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="360" partition="1" name="L1_MBTSC10" complex_deadtime="0" definition="(MBTS_C10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C10_x1" triggerthreshold="MBTS_C10"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="361" partition="1" name="L1_MU6_MJJ-500" complex_deadtime="0" definition="(MU6[x1]&amp;500INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="361" partition="1" name="L1_MBTSC12" complex_deadtime="0" definition="(MBTS_C12[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU6_x1" triggerthreshold="MU6"/>
-        <TriggerCondition multi="1" name="500INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="500INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="362" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-400" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;400INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="363" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-700" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;700INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="700INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="700INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="364" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-800" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;800INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="800INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="800INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="365" partition="1" name="L1_J30_2J20_4J20.0ETA49_MJJ-900" complex_deadtime="0" definition="(J30[x1]&amp;J20[x2]&amp;J20.0ETA49[x4]&amp;900INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="J30_x1" triggerthreshold="J30"/>
-        <TriggerCondition multi="2" name="J20_x2" triggerthreshold="J20"/>
-        <TriggerCondition multi="4" name="J20.0ETA49_x4" triggerthreshold="J20.0ETA49"/>
-        <TriggerCondition multi="1" name="900INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="900INVM9999-AJ30s6-AJ20s6"/>
+        <TriggerCondition multi="1" name="MBTS_C12_x1" triggerthreshold="MBTS_C12"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -2962,14 +2699,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="370" partition="1" name="L1_XE35_MJJ-200" complex_deadtime="0" definition="(XE35[x1]&amp;200INVM9999-AJ30s6-AJ20s6[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="XE35_x1" triggerthreshold="XE35"/>
-        <TriggerCondition multi="1" name="200INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="200INVM9999-AJ30s6-AJ20s6"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="371" partition="1" name="L1_EM7_FIRSTEMPTY" complex_deadtime="0" definition="(EM7[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM7_x1" triggerthreshold="EM7"/>
@@ -2991,27 +2720,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="374" partition="1" name="L1_TE20" complex_deadtime="0" definition="(TE20[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE20_x1" triggerthreshold="TE20"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="375" partition="1" name="L1_TE10.0ETA24" complex_deadtime="0" definition="(TE10.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE10.0ETA24_x1" triggerthreshold="TE10.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="376" partition="1" name="L1_TE20.0ETA24" complex_deadtime="0" definition="(TE20.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE20.0ETA24_x1" triggerthreshold="TE20.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="377" partition="1" name="L1_MU10_TAU20IM_J25_2J20" complex_deadtime="0" definition="(MU10[x1]&amp;HA20IM[x1]&amp;J25[x1]&amp;J20[x2]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -3135,7 +2843,7 @@
         <InternalTrigger name="BGRP6"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="392" partition="1" name="L1_EM24VHI" complex_deadtime="0" definition="(EM24VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="392" partition="1" name="L1_EM24VHI" complex_deadtime="0" definition="(EM24VHI[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM24VHI_x1" triggerthreshold="EM24VHI"/>
         <InternalTrigger name="BGRP0"/>
@@ -3156,23 +2864,6 @@
         <InternalTrigger name="BGRP3"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="395" partition="1" name="L1_EM15VH_2EM10VH_3EM7" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM10VH[x2]&amp;EM7[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="2" name="EM10VH_x2" triggerthreshold="EM10VH"/>
-        <TriggerCondition multi="3" name="EM7_x3" triggerthreshold="EM7"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="396" partition="1" name="L1_EM15VH_3EM8VH" complex_deadtime="0" definition="(EM15VH[x1]&amp;EM8VH[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/>
-        <TriggerCondition multi="3" name="EM8VH_x3" triggerthreshold="EM8VH"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="397" partition="1" name="L1_MJJ-400-CF" complex_deadtime="0" definition="(400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49_x1" triggerthreshold="400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49"/>
@@ -3213,7 +2904,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="402" partition="1" name="L1_EM24VHIM" complex_deadtime="0" definition="(EM24VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="402" partition="1" name="L1_EM24VHIM" complex_deadtime="0" definition="(EM24VHIM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM24VHIM_x1" triggerthreshold="EM24VHIM"/>
         <InternalTrigger name="BGRP0"/>
@@ -3250,13 +2941,6 @@
         <InternalTrigger name="BGRP6"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="407" partition="1" name="L1_TE5" complex_deadtime="0" definition="(TE5[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE5_x1" triggerthreshold="TE5"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="408" partition="1" name="L1_TAU20IM_2TAU12IM_4J12" complex_deadtime="0" definition="(HA20IM[x1]&amp;HA12IM[x2]&amp;J12[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA20IM_x1" triggerthreshold="HA20IM"/>
@@ -3266,20 +2950,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="409" partition="1" name="L1_TE25.0ETA24" complex_deadtime="0" definition="(TE25.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE25.0ETA24_x1" triggerthreshold="TE25.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="410" partition="1" name="L1_TE5.0ETA24" complex_deadtime="0" definition="(TE5.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE5.0ETA24_x1" triggerthreshold="TE5.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="411" partition="1" name="L1_EM20VH_FIRSTEMPTY" complex_deadtime="0" definition="(EM20VH[x1]&amp;BGRP0&amp;BGRP6)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/>
@@ -3323,35 +2993,21 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="417" partition="1" name="L1_TE70.0ETA24" complex_deadtime="0" definition="(TE70.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE70.0ETA24_x1" triggerthreshold="TE70.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="418" partition="1" name="L1_TE40.0ETA24" complex_deadtime="0" definition="(TE40.0ETA24[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="1" name="TE40.0ETA24_x1" triggerthreshold="TE40.0ETA24"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="419" partition="1" name="L1_ZDC_A" complex_deadtime="0" definition="(ZDC_A[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="419" partition="1" name="L1_ZDC_A" complex_deadtime="0" definition="(ZDC_A[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_A_x1" triggerthreshold="ZDC_A"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="420" partition="1" name="L1_ZDC_C" complex_deadtime="0" definition="(ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="420" partition="1" name="L1_ZDC_C" complex_deadtime="0" definition="(ZDC_C[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_C_x1" triggerthreshold="ZDC_C"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="421" partition="1" name="L1_ZDC_AND" complex_deadtime="0" definition="(ZDC_AND[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="421" partition="1" name="L1_ZDC_AND" complex_deadtime="0" definition="(ZDC_AND[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ZDC_AND_x1" triggerthreshold="ZDC_AND"/>
         <InternalTrigger name="BGRP0"/>
@@ -3454,23 +3110,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="434" partition="1" name="L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&amp;EM3[x2]&amp;J20[x1]&amp;XE30[x1]&amp;10MINDPHI-J20s2-XE30[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="435" partition="1" name="L1_MBTSC14" complex_deadtime="0" definition="(MBTS_C14[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
-        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
-        <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/>
-        <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
-    <TriggerItem ctpid="435" partition="1" name="L1_3EM3_J40_XE50_DPHI-J20s2XE50" complex_deadtime="0" definition="(EM3[x3]&amp;J40[x1]&amp;XE50[x1]&amp;10MINDPHI-J20s2-XE50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="3" name="EM3_x3" triggerthreshold="EM3"/>
-        <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/>
-        <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/>
-        <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/>
+        <TriggerCondition multi="1" name="MBTS_C14_x1" triggerthreshold="MBTS_C14"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3492,7 +3134,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="437" partition="1" name="L1_AFP_A_AND_C_EM3" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="437" partition="1" name="L1_EM3_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
@@ -3503,7 +3145,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="438" partition="1" name="L1_AFP_A_OR_C_EM3" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="438" partition="1" name="L1_EM3_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;EM3[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
           <AND>
@@ -3520,7 +3162,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="439" partition="1" name="L1_AFP_A_AND_C_MU4" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="439" partition="1" name="L1_MU4_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
@@ -3531,7 +3173,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="440" partition="1" name="L1_AFP_A_OR_C_MU4" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="440" partition="1" name="L1_MU4_AFP_A_OR_C" complex_deadtime="0" definition="(((AFP_NSA[x1]&amp;AFP_FSA_SIT[x1])|(AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]))&amp;MU4[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <OR>
           <AND>
@@ -3576,15 +3218,11 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="443" partition="1" name="L1_AFP_A_AND_C_J50" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="443" partition="1" name="L1_J12_UNPAIREDB1" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP13)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J50_x1" triggerthreshold="J50"/>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
         <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
+        <InternalTrigger name="BGRP13"/>
       </AND>
     </TriggerItem>
     <TriggerItem ctpid="444" partition="1" name="L1_AFP_A_AND_C_SPECTOF_J50" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;J50[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
@@ -3596,13 +3234,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="445" partition="1" name="L1_AFP_A_AND_C_J75" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J75[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="445" partition="1" name="L1_MBTSA1" complex_deadtime="0" definition="(MBTS_A1[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J75_x1" triggerthreshold="J75"/>
+        <TriggerCondition multi="1" name="MBTS_A1_x1" triggerthreshold="MBTS_A1"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3616,15 +3250,11 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="447" partition="1" name="L1_AFP_A_AND_C_J100" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;J100[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="447" partition="1" name="L1_BCM_AC_UNPAIREDB1" complex_deadtime="0" definition="(BCM_AtoC[x1]&amp;BGRP0&amp;BGRP13)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
-        <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
-        <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
-        <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
-        <TriggerCondition multi="1" name="J100_x1" triggerthreshold="J100"/>
+        <TriggerCondition multi="1" name="BCM_AtoC_x1" triggerthreshold="BCM_AtoC"/>
         <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
+        <InternalTrigger name="BGRP13"/>
       </AND>
     </TriggerItem>
     <TriggerItem ctpid="448" partition="1" name="L1_AFP_A_AND_C" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;AFP_FSA_SIT[x1]&amp;AFP_NSC[x1]&amp;AFP_FSC_SIT[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
@@ -3694,14 +3324,6 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="455" partition="1" name="L1_2MU4_XE60" complex_deadtime="0" definition="(MU4[x2]&amp;XE60[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
-      <AND>
-        <TriggerCondition multi="2" name="MU4_x2" triggerthreshold="MU4"/>
-        <TriggerCondition multi="1" name="XE60_x1" triggerthreshold="XE60"/>
-        <InternalTrigger name="BGRP0"/>
-        <InternalTrigger name="BGRP1"/>
-      </AND>
-    </TriggerItem>
     <TriggerItem ctpid="456" partition="1" name="L1_AFP_A_AND_C_SPECTOF" complex_deadtime="0" definition="(AFP_FSA_TOF[x1]&amp;AFP_FSC_TOF[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_TOF_x1" triggerthreshold="AFP_FSA_TOF"/>
@@ -3727,25 +3349,25 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="459" partition="1" name="L1_AFP_NSA_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="459" partition="1" name="L1_AFP_NSA_BGRP0" complex_deadtime="0" definition="(AFP_NSA[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSA_x1" triggerthreshold="AFP_NSA"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="460" partition="1" name="L1_AFP_NSC_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="460" partition="1" name="L1_AFP_NSC_BGRP0" complex_deadtime="0" definition="(AFP_NSC[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="461" partition="1" name="L1_AFP_FSA_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="461" partition="1" name="L1_AFP_FSA_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSA_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSA_SIT_x1" triggerthreshold="AFP_FSA_SIT"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="462" partition="1" name="L1_AFP_FSC_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="462" partition="1" name="L1_AFP_FSC_SIT_BGRP0" complex_deadtime="0" definition="(AFP_FSC_SIT[x1]&amp;BGRP0)" trigger_type="10000000" monitor="LF:111|HF:000">
       <AND>
         <TriggerCondition multi="1" name="AFP_FSC_SIT_x1" triggerthreshold="AFP_FSC_SIT"/>
         <InternalTrigger name="BGRP0"/>
@@ -3765,6 +3387,23 @@
         <InternalTrigger name="BGRP15"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="465" partition="1" name="L1_J40.0ETA25_2J30_J20.31ETA49" complex_deadtime="0" definition="(J40.0ETA25[x1]&amp;J30[x2]&amp;J20.31ETA49[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J40.0ETA25_x1" triggerthreshold="J40.0ETA25"/>
+        <TriggerCondition multi="2" name="J30_x2" triggerthreshold="J30"/>
+        <TriggerCondition multi="1" name="J20.31ETA49_x1" triggerthreshold="J20.31ETA49"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="466" partition="1" name="L1_LATE-MU10_XE40" complex_deadtime="0" definition="(LATE-MU10s1[x1]&amp;XE40[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="LATE-MU10s1_x1" triggerthreshold="LATE-MU10s1"/>
+        <TriggerCondition multi="1" name="XE40_x1" triggerthreshold="XE40"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="467" partition="1" name="L1_TAU8_UNPAIRED_NONISO" complex_deadtime="0" definition="(HA8[x1]&amp;BGRP0&amp;BGRP5)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="HA8_x1" triggerthreshold="HA8"/>
@@ -3786,6 +3425,74 @@
         <InternalTrigger name="BGRP5"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="470" partition="1" name="L1_MU4_TE10" complex_deadtime="0" definition="(MU4[x1]&amp;TE10[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/>
+        <TriggerCondition multi="1" name="TE10_x1" triggerthreshold="TE10"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="471" partition="1" name="L1_LUCID_BGRP9" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP9)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP9"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="472" partition="1" name="L1_LUCID_BGRP11" complex_deadtime="0" definition="((LUCID_A[x1]|LUCID_C[x1])&amp;BGRP0&amp;BGRP11)" trigger_type="10100000" monitor="LF:111|HF:000">
+      <AND>
+        <OR>
+          <TriggerCondition multi="1" name="LUCID_A_x1" triggerthreshold="LUCID_A"/>
+          <TriggerCondition multi="1" name="LUCID_C_x1" triggerthreshold="LUCID_C"/>
+        </OR>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP11"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="473" partition="1" name="L1_RD0_BGRP10" complex_deadtime="0" definition="(RNDM0&amp;BGRP0&amp;BGRP10)" trigger_type="10000001" monitor="LF:000|HF:000">
+      <AND>
+        <InternalTrigger name="RNDM0"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP10"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="474" partition="1" name="L1_2EM3_VTE70" complex_deadtime="0" definition="(EM3[x2]&amp;!TE70[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/>
+        <NOT>
+          <TriggerCondition multi="1" name="TE70_x1" triggerthreshold="TE70"/>
+        </NOT>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="475" partition="2" name="L1_BCM_CA_UNPAIREDB2" complex_deadtime="0" definition="(BCM_CtoA[x1]&amp;BGRP0&amp;BGRP14)" trigger_type="0000" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="BCM_CtoA_x1" triggerthreshold="BCM_CtoA"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP14"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="476" partition="2" name="L1_J12_UNPAIREDB2" complex_deadtime="0" definition="(J12[x1]&amp;BGRP0&amp;BGRP14)" trigger_type="0100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="J12_x1" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP14"/>
+      </AND>
+    </TriggerItem>
+    <TriggerItem ctpid="479" partition="1" name="L1_2TAU20IM_J25_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J25[x1]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="480" partition="1" name="L1_J85_3J30" complex_deadtime="0" definition="(J85[x1]&amp;J30[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="J85_x1" triggerthreshold="J85"/>
@@ -3794,6 +3501,16 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="481" partition="1" name="L1_TAU25IM_2TAU12IM_J25_3J12" complex_deadtime="0" definition="(HA25IM[x1]&amp;HA12IM[x2]&amp;J25[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="1" name="HA25IM_x1" triggerthreshold="HA25IM"/>
+        <TriggerCondition multi="2" name="HA12IM_x2" triggerthreshold="HA12IM"/>
+        <TriggerCondition multi="1" name="J25_x1" triggerthreshold="J25"/>
+        <TriggerCondition multi="3" name="J12_x3" triggerthreshold="J12"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="482" partition="1" name="L1_MU10_TAU12IM_3J12" complex_deadtime="0" definition="(MU10[x1]&amp;HA12IM[x1]&amp;J12[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="MU10_x1" triggerthreshold="MU10"/>
@@ -3827,6 +3544,14 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
+    <TriggerItem ctpid="486" partition="1" name="L1_2TAU20IM_3J20" complex_deadtime="0" definition="(HA20IM[x2]&amp;J20[x3]&amp;BGRP0&amp;BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000">
+      <AND>
+        <TriggerCondition multi="2" name="HA20IM_x2" triggerthreshold="HA20IM"/>
+        <TriggerCondition multi="3" name="J20_x3" triggerthreshold="J20"/>
+        <InternalTrigger name="BGRP0"/>
+        <InternalTrigger name="BGRP1"/>
+      </AND>
+    </TriggerItem>
     <TriggerItem ctpid="487" partition="1" name="L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-B" complex_deadtime="0" definition="(8INVM15-MU6ab-MU4ab[x1]&amp;0DR22-MU6ab-MU4ab[x1]&amp;MULT-CMU4ab[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="8INVM15-MU6ab-MU4ab_x1" triggerthreshold="8INVM15-MU6ab-MU4ab"/>
@@ -3846,49 +3571,49 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="489" partition="1" name="L1_ALFA_B7L1U" complex_deadtime="0" definition="(ALFA_B7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="489" partition="1" name="L1_ALFA_B7L1U" complex_deadtime="0" definition="(ALFA_B7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7L1U_x1" triggerthreshold="ALFA_B7L1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="490" partition="1" name="L1_ALFA_B7L1L" complex_deadtime="0" definition="(ALFA_B7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="490" partition="1" name="L1_ALFA_B7L1L" complex_deadtime="0" definition="(ALFA_B7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7L1L_x1" triggerthreshold="ALFA_B7L1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="491" partition="1" name="L1_ALFA_A7L1U" complex_deadtime="0" definition="(ALFA_A7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="491" partition="1" name="L1_ALFA_A7L1U" complex_deadtime="0" definition="(ALFA_A7L1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7L1U_x1" triggerthreshold="ALFA_A7L1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="492" partition="1" name="L1_ALFA_A7L1L" complex_deadtime="0" definition="(ALFA_A7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="492" partition="1" name="L1_ALFA_A7L1L" complex_deadtime="0" definition="(ALFA_A7L1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7L1L_x1" triggerthreshold="ALFA_A7L1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="493" partition="1" name="L1_ALFA_A7R1U" complex_deadtime="0" definition="(ALFA_A7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="493" partition="1" name="L1_ALFA_A7R1U" complex_deadtime="0" definition="(ALFA_A7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7R1U_x1" triggerthreshold="ALFA_A7R1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="494" partition="1" name="L1_ALFA_A7R1L" complex_deadtime="0" definition="(ALFA_A7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="494" partition="1" name="L1_ALFA_A7R1L" complex_deadtime="0" definition="(ALFA_A7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_A7R1L_x1" triggerthreshold="ALFA_A7R1L"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="495" partition="1" name="L1_ALFA_B7R1U" complex_deadtime="0" definition="(ALFA_B7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="495" partition="1" name="L1_ALFA_B7R1U" complex_deadtime="0" definition="(ALFA_B7R1U[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7R1U_x1" triggerthreshold="ALFA_B7R1U"/>
         <InternalTrigger name="BGRP0"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="496" partition="1" name="L1_ALFA_B7R1L" complex_deadtime="0" definition="(ALFA_B7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:001|HF:000">
+    <TriggerItem ctpid="496" partition="1" name="L1_ALFA_B7R1L" complex_deadtime="0" definition="(ALFA_B7R1L[x1]&amp;BGRP0)" trigger_type="11000000" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="ALFA_B7R1L_x1" triggerthreshold="ALFA_B7R1L"/>
         <InternalTrigger name="BGRP0"/>
@@ -3901,12 +3626,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="498" partition="1" name="L1_MU21_TAU12IM_FTK" complex_deadtime="0" definition="((MU20[x1]|MU21[x1])&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="498" partition="1" name="L1_MU20_TAU12IM_FTK" complex_deadtime="0" definition="(MU20[x1]&amp;HA12IM[x1]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <OR>
-          <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
-          <TriggerCondition multi="1" name="MU21_x1" triggerthreshold="MU21"/>
-        </OR>
+        <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/>
         <TriggerCondition multi="1" name="HA12IM_x1" triggerthreshold="HA12IM"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
@@ -3951,9 +3673,9 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="504" partition="1" name="L1_4J15_FTK" complex_deadtime="0" definition="(J15[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
+    <TriggerItem ctpid="504" partition="1" name="L1_4J20_FTK" complex_deadtime="0" definition="(J20[x4]&amp;BGRP0&amp;BGRP1)" trigger_type="10100000" monitor="LF:000|HF:000">
       <AND>
-        <TriggerCondition multi="4" name="J15_x4" triggerthreshold="J15"/>
+        <TriggerCondition multi="4" name="J20_x4" triggerthreshold="J20"/>
         <InternalTrigger name="BGRP0"/>
         <InternalTrigger name="BGRP1"/>
       </AND>
@@ -3986,7 +3708,7 @@
         <InternalTrigger name="BGRP1"/>
       </AND>
     </TriggerItem>
-    <TriggerItem ctpid="511" partition="1" name="L1_CALREQ2" complex_deadtime="0" definition="(CAL2[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="00110100" monitor="LF:111|HF:000">
+    <TriggerItem ctpid="511" partition="1" name="L1_CALREQ2" complex_deadtime="0" definition="(CAL2[x1]&amp;BGRP0&amp;BGRP2)" trigger_type="00110100" monitor="LF:000|HF:000">
       <AND>
         <TriggerCondition multi="1" name="CAL2_x1" triggerthreshold="CAL2"/>
         <InternalTrigger name="BGRP0"/>
@@ -4043,7 +3765,7 @@
     <Prescale ctpid="45" cut="000001" value="1"/>
     <Prescale ctpid="46" cut="000001" value="1"/>
     <Prescale ctpid="47" cut="000001" value="1"/>
-    <Prescale ctpid="48" cut="000001" value="1"/>
+    <Prescale ctpid="48" cut="-000001" value="-1"/>
     <Prescale ctpid="49" cut="000001" value="1"/>
     <Prescale ctpid="50" cut="000001" value="1"/>
     <Prescale ctpid="51" cut="000001" value="1"/>
@@ -4066,23 +3788,23 @@
     <Prescale ctpid="68" cut="000001" value="1"/>
     <Prescale ctpid="69" cut="000001" value="1"/>
     <Prescale ctpid="70" cut="000001" value="1"/>
-    <Prescale ctpid="71" cut="000001" value="1"/>
+    <Prescale ctpid="71" cut="-000001" value="-1"/>
     <Prescale ctpid="72" cut="000001" value="1"/>
     <Prescale ctpid="73" cut="000001" value="1"/>
     <Prescale ctpid="74" cut="000001" value="1"/>
     <Prescale ctpid="75" cut="000001" value="1"/>
     <Prescale ctpid="76" cut="000001" value="1"/>
-    <Prescale ctpid="77" cut="000001" value="1"/>
+    <Prescale ctpid="77" cut="-000001" value="-1"/>
     <Prescale ctpid="78" cut="000001" value="1"/>
-    <Prescale ctpid="79" cut="000001" value="1"/>
-    <Prescale ctpid="80" cut="000001" value="1"/>
+    <Prescale ctpid="79" cut="-000001" value="-1"/>
+    <Prescale ctpid="80" cut="-000001" value="-1"/>
     <Prescale ctpid="81" cut="000001" value="1"/>
     <Prescale ctpid="82" cut="000001" value="1"/>
     <Prescale ctpid="83" cut="000001" value="1"/>
-    <Prescale ctpid="84" cut="000001" value="1"/>
+    <Prescale ctpid="84" cut="-000001" value="-1"/>
     <Prescale ctpid="85" cut="000001" value="1"/>
     <Prescale ctpid="86" cut="000001" value="1"/>
-    <Prescale ctpid="87" cut="000001" value="1"/>
+    <Prescale ctpid="87" cut="-000001" value="-1"/>
     <Prescale ctpid="88" cut="000001" value="1"/>
     <Prescale ctpid="89" cut="000001" value="1"/>
     <Prescale ctpid="90" cut="000001" value="1"/>
@@ -4122,13 +3844,13 @@
     <Prescale ctpid="124" cut="000001" value="1"/>
     <Prescale ctpid="125" cut="000001" value="1"/>
     <Prescale ctpid="126" cut="000001" value="1"/>
-    <Prescale ctpid="127" cut="000001" value="1"/>
+    <Prescale ctpid="127" cut="-000001" value="-1"/>
     <Prescale ctpid="128" cut="000001" value="1"/>
-    <Prescale ctpid="129" cut="000001" value="1"/>
+    <Prescale ctpid="129" cut="-000001" value="-1"/>
     <Prescale ctpid="130" cut="000001" value="1"/>
     <Prescale ctpid="131" cut="000001" value="1"/>
     <Prescale ctpid="132" cut="000001" value="1"/>
-    <Prescale ctpid="133" cut="000001" value="1"/>
+    <Prescale ctpid="133" cut="-000001" value="-1"/>
     <Prescale ctpid="134" cut="000001" value="1"/>
     <Prescale ctpid="135" cut="000001" value="1"/>
     <Prescale ctpid="136" cut="000001" value="1"/>
@@ -4252,7 +3974,7 @@
     <Prescale ctpid="254" cut="000001" value="1"/>
     <Prescale ctpid="255" cut="000001" value="1"/>
     <Prescale ctpid="256" cut="000001" value="1"/>
-    <Prescale ctpid="257" cut="000001" value="1"/>
+    <Prescale ctpid="257" cut="-000001" value="-1"/>
     <Prescale ctpid="258" cut="000001" value="1"/>
     <Prescale ctpid="259" cut="000001" value="1"/>
     <Prescale ctpid="260" cut="000001" value="1"/>
@@ -4270,7 +3992,7 @@
     <Prescale ctpid="272" cut="000001" value="1"/>
     <Prescale ctpid="273" cut="000001" value="1"/>
     <Prescale ctpid="274" cut="000001" value="1"/>
-    <Prescale ctpid="275" cut="000001" value="1"/>
+    <Prescale ctpid="275" cut="-000001" value="-1"/>
     <Prescale ctpid="276" cut="000001" value="1"/>
     <Prescale ctpid="277" cut="000001" value="1"/>
     <Prescale ctpid="278" cut="000001" value="1"/>
@@ -4280,14 +4002,14 @@
     <Prescale ctpid="282" cut="000001" value="1"/>
     <Prescale ctpid="283" cut="000001" value="1"/>
     <Prescale ctpid="284" cut="000001" value="1"/>
-    <Prescale ctpid="285" cut="000001" value="1"/>
+    <Prescale ctpid="285" cut="-000001" value="-1"/>
     <Prescale ctpid="286" cut="000001" value="1"/>
     <Prescale ctpid="287" cut="000001" value="1"/>
-    <Prescale ctpid="288" cut="000001" value="1"/>
+    <Prescale ctpid="288" cut="-000001" value="-1"/>
     <Prescale ctpid="289" cut="000001" value="1"/>
-    <Prescale ctpid="290" cut="000001" value="1"/>
-    <Prescale ctpid="291" cut="000001" value="1"/>
-    <Prescale ctpid="292" cut="000001" value="1"/>
+    <Prescale ctpid="290" cut="-000001" value="-1"/>
+    <Prescale ctpid="291" cut="-000001" value="-1"/>
+    <Prescale ctpid="292" cut="-000001" value="-1"/>
     <Prescale ctpid="293" cut="000001" value="1"/>
     <Prescale ctpid="294" cut="000001" value="1"/>
     <Prescale ctpid="295" cut="000001" value="1"/>
@@ -4311,7 +4033,7 @@
     <Prescale ctpid="313" cut="000001" value="1"/>
     <Prescale ctpid="314" cut="000001" value="1"/>
     <Prescale ctpid="315" cut="000001" value="1"/>
-    <Prescale ctpid="316" cut="000001" value="1"/>
+    <Prescale ctpid="316" cut="-000001" value="-1"/>
     <Prescale ctpid="317" cut="000001" value="1"/>
     <Prescale ctpid="318" cut="000001" value="1"/>
     <Prescale ctpid="319" cut="000001" value="1"/>
@@ -4321,11 +4043,11 @@
     <Prescale ctpid="323" cut="000001" value="1"/>
     <Prescale ctpid="324" cut="000001" value="1"/>
     <Prescale ctpid="325" cut="000001" value="1"/>
-    <Prescale ctpid="326" cut="000001" value="1"/>
+    <Prescale ctpid="326" cut="-000001" value="-1"/>
     <Prescale ctpid="327" cut="000001" value="1"/>
-    <Prescale ctpid="328" cut="000001" value="1"/>
+    <Prescale ctpid="328" cut="-000001" value="-1"/>
     <Prescale ctpid="329" cut="000001" value="1"/>
-    <Prescale ctpid="330" cut="000001" value="1"/>
+    <Prescale ctpid="330" cut="-000001" value="-1"/>
     <Prescale ctpid="331" cut="000001" value="1"/>
     <Prescale ctpid="332" cut="000001" value="1"/>
     <Prescale ctpid="333" cut="000001" value="1"/>
@@ -4344,7 +4066,7 @@
     <Prescale ctpid="346" cut="000001" value="1"/>
     <Prescale ctpid="347" cut="000001" value="1"/>
     <Prescale ctpid="348" cut="000001" value="1"/>
-    <Prescale ctpid="349" cut="000001" value="1"/>
+    <Prescale ctpid="349" cut="-000001" value="-1"/>
     <Prescale ctpid="350" cut="000001" value="1"/>
     <Prescale ctpid="351" cut="000001" value="1"/>
     <Prescale ctpid="352" cut="000001" value="1"/>
@@ -4357,21 +4079,21 @@
     <Prescale ctpid="359" cut="000001" value="1"/>
     <Prescale ctpid="360" cut="000001" value="1"/>
     <Prescale ctpid="361" cut="000001" value="1"/>
-    <Prescale ctpid="362" cut="000001" value="1"/>
-    <Prescale ctpid="363" cut="000001" value="1"/>
-    <Prescale ctpid="364" cut="000001" value="1"/>
-    <Prescale ctpid="365" cut="000001" value="1"/>
+    <Prescale ctpid="362" cut="-000001" value="-1"/>
+    <Prescale ctpid="363" cut="-000001" value="-1"/>
+    <Prescale ctpid="364" cut="-000001" value="-1"/>
+    <Prescale ctpid="365" cut="-000001" value="-1"/>
     <Prescale ctpid="366" cut="000001" value="1"/>
     <Prescale ctpid="367" cut="000001" value="1"/>
     <Prescale ctpid="368" cut="000001" value="1"/>
     <Prescale ctpid="369" cut="000001" value="1"/>
-    <Prescale ctpid="370" cut="000001" value="1"/>
+    <Prescale ctpid="370" cut="-000001" value="-1"/>
     <Prescale ctpid="371" cut="000001" value="1"/>
     <Prescale ctpid="372" cut="000001" value="1"/>
     <Prescale ctpid="373" cut="000001" value="1"/>
-    <Prescale ctpid="374" cut="000001" value="1"/>
-    <Prescale ctpid="375" cut="000001" value="1"/>
-    <Prescale ctpid="376" cut="000001" value="1"/>
+    <Prescale ctpid="374" cut="-000001" value="-1"/>
+    <Prescale ctpid="375" cut="-000001" value="-1"/>
+    <Prescale ctpid="376" cut="-000001" value="-1"/>
     <Prescale ctpid="377" cut="000001" value="1"/>
     <Prescale ctpid="378" cut="000001" value="1"/>
     <Prescale ctpid="379" cut="000001" value="1"/>
@@ -4390,8 +4112,8 @@
     <Prescale ctpid="392" cut="000001" value="1"/>
     <Prescale ctpid="393" cut="000001" value="1"/>
     <Prescale ctpid="394" cut="000001" value="1"/>
-    <Prescale ctpid="395" cut="000001" value="1"/>
-    <Prescale ctpid="396" cut="000001" value="1"/>
+    <Prescale ctpid="395" cut="-000001" value="-1"/>
+    <Prescale ctpid="396" cut="-000001" value="-1"/>
     <Prescale ctpid="397" cut="000001" value="1"/>
     <Prescale ctpid="398" cut="000001" value="1"/>
     <Prescale ctpid="399" cut="000001" value="1"/>
@@ -4402,18 +4124,18 @@
     <Prescale ctpid="404" cut="000001" value="1"/>
     <Prescale ctpid="405" cut="000001" value="1"/>
     <Prescale ctpid="406" cut="000001" value="1"/>
-    <Prescale ctpid="407" cut="000001" value="1"/>
+    <Prescale ctpid="407" cut="-000001" value="-1"/>
     <Prescale ctpid="408" cut="000001" value="1"/>
-    <Prescale ctpid="409" cut="000001" value="1"/>
-    <Prescale ctpid="410" cut="000001" value="1"/>
+    <Prescale ctpid="409" cut="-000001" value="-1"/>
+    <Prescale ctpid="410" cut="-000001" value="-1"/>
     <Prescale ctpid="411" cut="000001" value="1"/>
     <Prescale ctpid="412" cut="000001" value="1"/>
     <Prescale ctpid="413" cut="000001" value="1"/>
     <Prescale ctpid="414" cut="000001" value="1"/>
     <Prescale ctpid="415" cut="000001" value="1"/>
     <Prescale ctpid="416" cut="000001" value="1"/>
-    <Prescale ctpid="417" cut="000001" value="1"/>
-    <Prescale ctpid="418" cut="000001" value="1"/>
+    <Prescale ctpid="417" cut="-000001" value="-1"/>
+    <Prescale ctpid="418" cut="-000001" value="-1"/>
     <Prescale ctpid="419" cut="000001" value="1"/>
     <Prescale ctpid="420" cut="000001" value="1"/>
     <Prescale ctpid="421" cut="000001" value="1"/>
@@ -4429,7 +4151,7 @@
     <Prescale ctpid="431" cut="000001" value="1"/>
     <Prescale ctpid="432" cut="000001" value="1"/>
     <Prescale ctpid="433" cut="000001" value="1"/>
-    <Prescale ctpid="434" cut="000001" value="1"/>
+    <Prescale ctpid="434" cut="-000001" value="-1"/>
     <Prescale ctpid="435" cut="000001" value="1"/>
     <Prescale ctpid="436" cut="000001" value="1"/>
     <Prescale ctpid="437" cut="000001" value="1"/>
@@ -4450,7 +4172,7 @@
     <Prescale ctpid="452" cut="000001" value="1"/>
     <Prescale ctpid="453" cut="000001" value="1"/>
     <Prescale ctpid="454" cut="000001" value="1"/>
-    <Prescale ctpid="455" cut="000001" value="1"/>
+    <Prescale ctpid="455" cut="-000001" value="-1"/>
     <Prescale ctpid="456" cut="000001" value="1"/>
     <Prescale ctpid="457" cut="000001" value="1"/>
     <Prescale ctpid="458" cut="000001" value="1"/>
@@ -4460,28 +4182,28 @@
     <Prescale ctpid="462" cut="000001" value="1"/>
     <Prescale ctpid="463" cut="000001" value="1"/>
     <Prescale ctpid="464" cut="000001" value="1"/>
-    <Prescale ctpid="465" cut="-000001" value="-1"/>
-    <Prescale ctpid="466" cut="-000001" value="-1"/>
+    <Prescale ctpid="465" cut="000001" value="1"/>
+    <Prescale ctpid="466" cut="000001" value="1"/>
     <Prescale ctpid="467" cut="000001" value="1"/>
     <Prescale ctpid="468" cut="000001" value="1"/>
     <Prescale ctpid="469" cut="000001" value="1"/>
-    <Prescale ctpid="470" cut="-000001" value="-1"/>
-    <Prescale ctpid="471" cut="-000001" value="-1"/>
-    <Prescale ctpid="472" cut="-000001" value="-1"/>
-    <Prescale ctpid="473" cut="-000001" value="-1"/>
-    <Prescale ctpid="474" cut="-000001" value="-1"/>
-    <Prescale ctpid="475" cut="-000001" value="-1"/>
-    <Prescale ctpid="476" cut="-000001" value="-1"/>
+    <Prescale ctpid="470" cut="000001" value="1"/>
+    <Prescale ctpid="471" cut="000001" value="1"/>
+    <Prescale ctpid="472" cut="000001" value="1"/>
+    <Prescale ctpid="473" cut="000001" value="1"/>
+    <Prescale ctpid="474" cut="000001" value="1"/>
+    <Prescale ctpid="475" cut="000001" value="1"/>
+    <Prescale ctpid="476" cut="000001" value="1"/>
     <Prescale ctpid="477" cut="-000001" value="-1"/>
     <Prescale ctpid="478" cut="-000001" value="-1"/>
-    <Prescale ctpid="479" cut="-000001" value="-1"/>
+    <Prescale ctpid="479" cut="000001" value="1"/>
     <Prescale ctpid="480" cut="000001" value="1"/>
-    <Prescale ctpid="481" cut="-000001" value="-1"/>
+    <Prescale ctpid="481" cut="000001" value="1"/>
     <Prescale ctpid="482" cut="000001" value="1"/>
     <Prescale ctpid="483" cut="000001" value="1"/>
     <Prescale ctpid="484" cut="000001" value="1"/>
     <Prescale ctpid="485" cut="000001" value="1"/>
-    <Prescale ctpid="486" cut="-000001" value="-1"/>
+    <Prescale ctpid="486" cut="000001" value="1"/>
     <Prescale ctpid="487" cut="000001" value="1"/>
     <Prescale ctpid="488" cut="000001" value="1"/>
     <Prescale ctpid="489" cut="000001" value="1"/>
@@ -5829,9 +5551,6 @@
     <TriggerCounter name="1TE10.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE10.0ETA24" triggerthreshold="TE10.0ETA24" multi="1"/>
     </TriggerCounter>
-    <TriggerCounter name="1TE15" type="CTPIN">
-      <TriggerCondition name="1TE15" triggerthreshold="TE15" multi="1"/>
-    </TriggerCounter>
     <TriggerCounter name="1TE15.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE15.0ETA24" triggerthreshold="TE15.0ETA24" multi="1"/>
     </TriggerCounter>
@@ -5841,9 +5560,6 @@
     <TriggerCounter name="1TE20.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE20.0ETA24" triggerthreshold="TE20.0ETA24" multi="1"/>
     </TriggerCounter>
-    <TriggerCounter name="1TE25" type="CTPIN">
-      <TriggerCondition name="1TE25" triggerthreshold="TE25" multi="1"/>
-    </TriggerCounter>
     <TriggerCounter name="1TE25.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE25.0ETA24" triggerthreshold="TE25.0ETA24" multi="1"/>
     </TriggerCounter>
@@ -5865,6 +5581,12 @@
     <TriggerCounter name="1TE5.0ETA24" type="CTPIN">
       <TriggerCondition name="1TE5.0ETA24" triggerthreshold="TE5.0ETA24" multi="1"/>
     </TriggerCounter>
+    <TriggerCounter name="1TE50" type="CTPIN">
+      <TriggerCondition name="1TE50" triggerthreshold="TE50" multi="1"/>
+    </TriggerCounter>
+    <TriggerCounter name="1TE60" type="CTPIN">
+      <TriggerCondition name="1TE60" triggerthreshold="TE60" multi="1"/>
+    </TriggerCounter>
     <TriggerCounter name="1TE70" type="CTPIN">
       <TriggerCondition name="1TE70" triggerthreshold="TE70" multi="1"/>
     </TriggerCounter>
@@ -7033,32 +6755,32 @@
         <Signal range_begin="1" range_end="1"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="148" mapping="2" name="TE15" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE15full" phimin="0" phimax="64" priority="0" thresholdval="15" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="148" mapping="2" name="TE20" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="2" range_end="2"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="149" mapping="3" name="TE20" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE20full" phimin="0" phimax="64" priority="0" thresholdval="20" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="149" mapping="3" name="TE30" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="3" range_end="3"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="150" mapping="4" name="TE25" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE25full" phimin="0" phimax="64" priority="0" thresholdval="25" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="150" mapping="4" name="TE40" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="4" range_end="4"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="151" mapping="5" name="TE30" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE30full" phimin="0" phimax="64" priority="0" thresholdval="30" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="151" mapping="5" name="TE50" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE50full" phimin="0" phimax="64" priority="0" thresholdval="50" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="5" range_end="5"/>
       </Cable>
     </TriggerThreshold>
-    <TriggerThreshold active="1" bitnum="1" id="152" mapping="6" name="TE40" type="TE" input="ctpin" version="1">
-      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE40full" phimin="0" phimax="64" priority="0" thresholdval="40" type="TE" window="0"/>
+    <TriggerThreshold active="1" bitnum="1" id="152" mapping="6" name="TE60" type="TE" input="ctpin" version="1">
+      <TriggerThresholdValue em_isolation="63" etamin="-49" etamax="49" had_isolation="63" had_veto="63" name="TE60full" phimin="0" phimax="64" priority="0" thresholdval="60" type="TE" window="0"/>
       <Cable connector="CON2" input="SLOT8" name="EN1">
         <Signal range_begin="6" range_end="6"/>
       </Cable>
diff --git a/Trigger/TriggerRelease/python/Modifiers.py b/Trigger/TriggerRelease/python/Modifiers.py
index a95669097776d58d18772a19ca078f6efb4a6c97..227bac482d3f16f625b0887d62e713c881b9dabb 100644
--- a/Trigger/TriggerRelease/python/Modifiers.py
+++ b/Trigger/TriggerRelease/python/Modifiers.py
@@ -846,8 +846,6 @@ class rerunLVL1(_modifier):
         topSequence.L1Muctpi_on_RDO.CTPOutputLocID = "/Run/L1MuCTPItoCTPLocation"
         topSequence.L1Muctpi_on_RDO.RoIOutputLocID = "/Run/L1MuCTPItoRoIBLocation"
 
-        topSequence.L1Muctpi_on_RDO.OverlapStrategyName = "NULL"    
-
         # Add L1TopoSimulation if it was not already added, e.g. by L1TopoROBMonitor
         topSequenceAlgNames=[alg.getName() for alg in topSequence.getChildren()]
         if 'L1TopoSimulation' not in topSequenceAlgNames:
@@ -947,8 +945,6 @@ class rerunDMLVL1(_modifier):
          topSequence.L1Muctpi_on_RDO.CTPOutputLocID = "/Run/L1MuCTPItoCTPLocation"
          topSequence.L1Muctpi_on_RDO.RoIOutputLocID = "/Run/L1MuCTPItoRoIBLocation"
 
-         topSequence.L1Muctpi_on_RDO.OverlapStrategyName = "NULL"    
-
          from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__DeriveSimulationInputs as DeriveSimulationInputs
          topSequence += DeriveSimulationInputs(do_MuCTPI_input=True,
                                                do_L1Calo_input=False,
@@ -1654,6 +1650,14 @@ class LumiRegionZmax168(_modifier):
         from AthenaCommon.SystemOfUnits import mm 
         RegSelSvc.DeltaZ = 168* mm
 
+class useDynamicAlignFolders(_modifier):
+    """
+    enable the new (2016-) alignment scheme
+    """
+    def preSetup(self):
+        from AtlasGeoModel.InDetGMJobProperties import GeometryFlags;
+        GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
+
     
 ###############################################################
 # Modifiers believed to be obsolete.
diff --git a/Trigger/TriggerRelease/share/runHLT_standalone.py b/Trigger/TriggerRelease/share/runHLT_standalone.py
index 20a9781bd856fb12f00f9f943a1f63b4b7233d2f..6365aa5c027b736a38d543d4d060524dcf16bfdf 100755
--- a/Trigger/TriggerRelease/share/runHLT_standalone.py
+++ b/Trigger/TriggerRelease/share/runHLT_standalone.py
@@ -120,7 +120,10 @@ menuMap={
          'PhysicsV1':       ('Physics_pp_v1',           'TriggerMenuXML/LVL1config_Physics_pp_v1.xml'),
          'MCV1':            ('MC_pp_v1',                'TriggerMenuXML/LVL1config_Physics_pp_v1.xml'),
          'CosmicPPV1':      ('Physics_pp_v1_cosmics_prescale','TriggerMenuXML/LVL1config_Physics_pp_v1.xml'),
-}
+
+         #Upgrade menus:       menu name                   L1 xml file
+         'MCPhaseII':       ('MC_PhaseII',           'TriggerMenuXML/LVL1config_MC_PhaseII.xml'),
+         }
 
 # Useful in job options beyond our control to always run the latest menu via 'testCurrentMenu=True'
 menuMap['CurrentMenu'] = menuMap['PhysicsV7']
@@ -253,6 +256,7 @@ else:           # More data modifiers
                                 #'ignoreL1Vetos',  #also run L2 prescaled and disabled L1 items
                                 #'disablePixels',
                                 #'disableSCTBarrel',
+                                'useDynamicAlignFolders',
     ]
 
 #make some more common trig cost operations easier to setup