From 0c3d439a14d8662e59be483ff3027bef70db261e Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Mon, 3 Aug 2020 20:11:26 +0000
Subject: [PATCH] Merge branch '21.3-L1CaloWstotConfig213' into '21.3'

L1 calo eFEX configuration

See merge request atlas/athena!35130

(cherry picked from commit 5f97feee273943dda8a95b4ca3706c231eaff875)

5e005c74 Add eFEX parameter based eEM ROI selection to CTP Emulation
48183e18 Set isolation bits for new eFEX EM thresholds
a1f6b07a Move eFEX paramenter selection configuration to TriggerMenu
2b7b2f71 Change to MSG macros
c4deaad4 Resolve merge conflict, use of MSG macros
---
 .../TrigL1CaloUpgrade/src/LArFex.cxx          |  19 +-
 .../src/SimpleLArDigitsChecks.cxx             |  17 +-
 .../src/SimpleSuperCellChecks.cxx             |  27 +-
 .../src/TrigT1CaloBaseFex.cxx                 | 192 ++++++--------
 .../TrigL1CaloUpgrade/src/TrigT1CaloEFex.cxx  |  17 +-
 .../src/TrigT1CaloRun3TauFex.cxx              |  23 +-
 .../src/TrigT1CaloTauFex.cxx                  |  38 ++-
 .../src/TrigT1CaloforwEFex.cxx                |  23 +-
 .../python/TrigT1CTP_EnableCTPEmulation.py    |   5 +
 Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.cxx | 234 +++++++++++++++++-
 Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.h   |  32 ++-
 .../TriggerMenu/python/l1menu/CaloDef.py      |  24 +-
 .../TriggerMenu/python/l1menu/ThresholdDef.py | 162 ++++++------
 13 files changed, 505 insertions(+), 308 deletions(-)

diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/LArFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/LArFex.cxx
index 7691887f70be..307b2449a99c 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/LArFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/LArFex.cxx
@@ -38,10 +38,9 @@ LArFex::~LArFex(){}
 
 StatusCode LArFex::initialize(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing LArFex" << endreq;
+	ATH_MSG_DEBUG("initializing LArFex" );
         if ( (m_etInSigma > 0 ) && ( m_et > 0 ) )
-        msg << MSG::WARNING << "Configuration issue" << endreq;
+        ATH_MSG_WARNING( "Configuration issue" );
         if ( m_etInSigma > 0 ) m_noiseTool.retrieve().ignore();
         m_counter = 0;
 	if ( m_enableMon ) {
@@ -54,7 +53,7 @@ StatusCode LArFex::initialize(){
 
 	// for cell <-> SCell comparison
 	if ( m_cabling.retrieve().isFailure() ){
-		msg << MSG::ERROR << "cannot perform comparisons between SuperCells and digits" << endreq;
+		ATH_MSG_ERROR( "cannot perform comparisons between SuperCells and digits" );
 	}
 
 	if ( m_enableMon ) {
@@ -72,8 +71,7 @@ StatusCode LArFex::initialize(){
 }
 
 StatusCode LArFex::finalize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing SimpleLArDigitsChecks" << endreq;
+	ATH_MSG_DEBUG("finalizing SimpleLArDigitsChecks" );
 	if ( m_enableMon ) {
 	  m_file->Write();
 	  m_file->Close();
@@ -83,14 +81,13 @@ StatusCode LArFex::finalize(){
 
 StatusCode LArFex::execute(){
 
-        MsgStream msg(msgSvc(), name());
 #ifndef NDEBUG
-	msg << MSG::DEBUG << "execute LArFex" << endreq;
+	ATH_MSG_DEBUG("execute LArFex" );
 #endif
 
 	const CaloCellContainer* allcalocells;
         if ( evtStore()->retrieve(allcalocells,"AllCalo").isFailure() ) {
-                msg << MSG::WARNING << "did not find allcalo container" << endreq;
+                ATH_MSG_WARNING( "did not find allcalo container" );
 		return StatusCode::SUCCESS;
         }
 	CaloCellContainer allcalo(SG::VIEW_ELEMENTS);
@@ -150,11 +147,11 @@ StatusCode LArFex::execute(){
 	clusters->reserve(seeds.size());
         std::string clusterName(m_outputClusterName);
         if ( evtStore()->record(clusters,clusterName).isFailure() ){
-                msg << MSG::ERROR  << "recording was not possible" << endreq;
+                ATH_MSG_ERROR( "recording was not possible" );
                 return StatusCode::FAILURE;
         }
         if ( evtStore()->record(auxclusters,clusterName+"Aux.").isFailure() ){
-                msg << MSG::ERROR << "recording Aux was not possible" << endreq;
+                ATH_MSG_ERROR( "recording Aux was not possible" );
                 return StatusCode::FAILURE;
         }
 	std::vector<float> etasG;
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleLArDigitsChecks.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleLArDigitsChecks.cxx
index d3f9966c2151..0df456c81f77 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleLArDigitsChecks.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleLArDigitsChecks.cxx
@@ -32,8 +32,7 @@ SimpleLArDigitsChecks::~SimpleLArDigitsChecks(){}
 
 StatusCode SimpleLArDigitsChecks::initialize(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing SimpleLArDigitsChecks" << endreq;
+	ATH_MSG_DEBUG("initializing SimpleLArDigitsChecks" );
 	std::string filename=name();
 	filename+=".BasicCheck.root";
         counter=0;
@@ -122,15 +121,14 @@ StatusCode SimpleLArDigitsChecks::initialize(){
 
 	// for cell <-> SCell comparison
 	if ( m_cabling.retrieve().isFailure() ){
-		msg << MSG::ERROR << "cannot perform comparisons between SuperCells and digits" << endreq;
+		ATH_MSG_ERROR( "cannot perform comparisons between SuperCells and digits" );
 	}
 
 	return StatusCode::SUCCESS;
 }
 
 StatusCode SimpleLArDigitsChecks::finalize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing SimpleLArDigitsChecks" << endreq;
+	ATH_MSG_DEBUG("finalizing SimpleLArDigitsChecks" );
 	m_file->Write();
 	m_file->Close();
 	return StatusCode::SUCCESS;
@@ -138,21 +136,20 @@ StatusCode SimpleLArDigitsChecks::finalize(){
 
 StatusCode SimpleLArDigitsChecks::execute(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "execute SimpleLArDigitsChecks" << endreq;
+	ATH_MSG_DEBUG("execute SimpleLArDigitsChecks" );
         const CaloCellContainer* scells;
         const LArDigitContainer* allcalo(NULL);
 	if ( evtStore()->retrieve(scells,"SCell").isFailure() ){
-		msg << MSG::WARNING << "did not find cell container" << endreq;
+		ATH_MSG_WARNING( "did not find cell container" );
 		return StatusCode::SUCCESS;
 	}
 	if ( evtStore()->retrieve(allcalo,"LArDigitSCL1").isFailure() ){
-		msg << MSG::WARNING << "did not find lardigit container for regular cells" << endreq;
+		ATH_MSG_WARNING( "did not find lardigit container for regular cells" );
 		return StatusCode::SUCCESS;
 	}
 	const xAOD::VertexContainer* nvtx(NULL);
 	if ( evtStore()->retrieve(nvtx,"PrimaryVertices").isFailure() ) {
-		msg << MSG::WARNING << "did not find Vectices container" << endreq;
+		ATH_MSG_WARNING( "did not find Vectices container" );
 		return StatusCode::SUCCESS;
 	}
 	unsigned int count_sCells=0;
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleSuperCellChecks.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleSuperCellChecks.cxx
index 01aa103485e3..3edb3abba02d 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleSuperCellChecks.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/SimpleSuperCellChecks.cxx
@@ -33,8 +33,7 @@ SimpleSuperCellChecks::~SimpleSuperCellChecks(){}
 
 StatusCode SimpleSuperCellChecks::initialize(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing SimpleSuperCellChecks" << endreq;
+	ATH_MSG_DEBUG("initializing SimpleSuperCellChecks" );
 	std::string filename=name();
 	filename+=".BasicCheck.root";
         counter=0;
@@ -362,15 +361,14 @@ StatusCode SimpleSuperCellChecks::initialize(){
 
 	// for cell <-> SCell comparison
 	if ( m_scidtool.retrieve().isFailure() ){
-		msg << MSG::ERROR << "cannot perform comparisons between cell and SuperCells" << endreq;
+		ATH_MSG_ERROR( "cannot perform comparisons between cell and SuperCells" );
 	}
 
 	return StatusCode::SUCCESS;
 }
 
 StatusCode SimpleSuperCellChecks::finalize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing SimpleSuperCellChecks" << endreq;
+	ATH_MSG_DEBUG("finalizing SimpleSuperCellChecks" );
 	m_file->Write();
 	m_file->Close();
 	return StatusCode::SUCCESS;
@@ -378,11 +376,10 @@ StatusCode SimpleSuperCellChecks::finalize(){
 
 StatusCode SimpleSuperCellChecks::execute(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "execute SimpleSuperCellChecks" << endreq;
+	ATH_MSG_DEBUG("execute SimpleSuperCellChecks" );
 	const xAOD::EventInfo* evt(0);
 	if ( evtStore()->retrieve(evt,"EventInfo").isFailure() ){
-		msg << MSG::WARNING << "did not find EventInfo container" << endreq;
+		ATH_MSG_WARNING( "did not find EventInfo container" );
 	}
 	long bunch_crossing(-1);
 	long bunch_crossingNor(-1);
@@ -393,16 +390,16 @@ StatusCode SimpleSuperCellChecks::execute(){
         const CaloCellContainer* scells;
         const CaloCellContainer* allcalo(NULL);
 	if ( evtStore()->retrieve(scells,"SCell").isFailure() ){
-		msg << MSG::WARNING << "did not find cell container" << endreq;
+		ATH_MSG_WARNING( "did not find cell container" );
 		return StatusCode::SUCCESS;
 	}
 	if ( evtStore()->retrieve(allcalo,"AllCalo").isFailure() ){
-		msg << MSG::WARNING << "did not find cell container for regular cells, no resolution test possible" << endreq;
+		ATH_MSG_WARNING( "did not find cell container for regular cells, no resolution test possible" );
 	}
 
 	const xAOD::TruthParticleContainer* truth;
         if ( evtStore()->retrieve(truth,"TruthParticles").isFailure() ) {
-                msg << MSG::WARNING << "did not find truth particle container" << endreq;
+                ATH_MSG_WARNING( "did not find truth particle container" );
                 return StatusCode::SUCCESS;
         }
 	std::vector<float> el_etas, el_phis;
@@ -423,7 +420,7 @@ StatusCode SimpleSuperCellChecks::execute(){
 	const xAOD::VertexContainer* nvtx(NULL);
 	int nvtxs=0;
 	if ( evtStore()->retrieve(nvtx,"PrimaryVertices").isFailure() ) {
-		msg << MSG::WARNING << "did not find Vectices container" << endreq;
+		ATH_MSG_WARNING( "did not find Vectices container" );
 		return StatusCode::SUCCESS;
 	}
 	if ( nvtx != NULL) nvtxs = nvtx->size();
@@ -517,12 +514,12 @@ StatusCode SimpleSuperCellChecks::execute(){
 	m_nSCells_perLayer[11]->Fill ( count_sCells_Layer11 );
 
 	if ( !allcalo || !m_scidtool ) { // VERY IMPORTANT
-		msg << MSG::ERROR << "Nothing more to be done, finish here" << endreq;
+		ATH_MSG_ERROR( "Nothing more to be done, finish here" );
 		return StatusCode::SUCCESS;
 	}
 	const CaloIdManager* m_calo_id_manager;
 	if ( (detStore()->retrieve(m_calo_id_manager,"CaloIdManager")).isFailure() ){
-		msg << MSG::ERROR << "Not able to map Calo IDs." << endreq;
+		ATH_MSG_ERROR( "Not able to map Calo IDs." );
 		return StatusCode::SUCCESS;
 	}
 	const CaloCell_SuperCell_ID* calo_sc_id = m_calo_id_manager->getCaloCell_SuperCell_ID();
@@ -531,7 +528,7 @@ StatusCode SimpleSuperCellChecks::execute(){
 	std::vector<std::vector<float> > sc_times; sc_times.resize(40000);
         for(auto cell : *allcalo) {
 		int idx = calo_sc_id->calo_cell_hash( m_scidtool->offlineToSuperCellID ( cell->ID() ) );
-		if ( idx < 0 or idx > 37000 ) { msg << MSG::DEBUG << "Problems with index : " << cell->ID().get_identifier32().get_compact() << " " << m_scidtool->offlineToSuperCellID ( cell->ID() ) << " " << idx << endreq; continue; }
+		if ( idx < 0 or idx > 37000 ) { ATH_MSG_DEBUG("Problems with index : " << cell->ID().get_identifier32().get_compact() << " " << m_scidtool->offlineToSuperCellID ( cell->ID() ) << " " << idx ); continue; }
 		sc_ets[idx] += cell->et();
 		sc_etsk[idx].push_back( cell->et() );
 		sc_times[idx].push_back( cell->time() );
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloBaseFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloBaseFex.cxx
index 883478614961..f245304675d5 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloBaseFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloBaseFex.cxx
@@ -57,16 +57,14 @@ TrigT1CaloBaseFex::TrigT1CaloBaseFex( const std::string& name, ISvcLocator* pSvc
 }
 
 StatusCode TrigT1CaloBaseFex::initialize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing TrigT1CaloBaseFex" << endreq;
+	ATH_MSG_DEBUG("initializing TrigT1CaloBaseFex");
 	m_cellsAboveThr.reserve(200);
 	m_cellsAround.reserve(200);
 	return StatusCode::SUCCESS;
 }
 
 StatusCode TrigT1CaloBaseFex::finalize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing TrigT1CaloBaseFex" << endreq;
+	ATH_MSG_DEBUG("finalizing TrigT1CaloBaseFex");
 	m_cellsAboveThr.clear();
 	m_cellsAround.clear();
 	return StatusCode::SUCCESS;
@@ -74,14 +72,13 @@ StatusCode TrigT1CaloBaseFex::finalize(){
 
 StatusCode TrigT1CaloBaseFex::getContainers(CaloCellContainer*& scells, const xAOD::TriggerTowerContainer*& TTs){
 	
-	MsgStream msg(msgSvc(), name());
         const CaloCellContainer* scells_from_sg;
 	if ( evtStore()->retrieve(scells_from_sg,m_inputCellsName).isFailure() ){
-		msg << MSG::WARNING << "did not find cell container" << endreq;
+		ATH_MSG_WARNING("did not find cell container");
 		return StatusCode::FAILURE;
 	}
 	if ( evtStore()->retrieve(TTs,"xAODTriggerTowers").isFailure() ){
-		msg << MSG::WARNING << "did not find TT container" << endreq;
+		ATH_MSG_WARNING("did not find TT container");
 		return StatusCode::FAILURE;
 	}
 
@@ -102,21 +99,20 @@ StatusCode TrigT1CaloBaseFex::getContainers(CaloCellContainer*& scells, const xA
 #ifndef NDEBUG
         for(auto scell : *scells) {
 		if ( scell->et() < 3e3 ) continue;
-		msg << MSG::DEBUG << "scell : " << scell->et() << " " << scell->eta() << " " << scell->phi() << endreq;
+		ATH_MSG_DEBUG("scell : " << scell->et() << " " << scell->eta() << " " << scell->phi());
 	}
         for(auto TT : *TTs) {
 		if ( TT->pt() < 3 ) continue;
-		msg << MSG::DEBUG << "TT : " << TT->pt() << " " << TT->eta() << " " << TT->phi() << endreq;
+		ATH_MSG_DEBUG("TT : " << TT->pt() << " " << TT->eta() << " " << TT->phi());
 	}
 #endif
 	return StatusCode::SUCCESS;
 }
 
 StatusCode TrigT1CaloBaseFex::getContainersTileCal(CaloCellContainer*& scells, const TileID*& m_tileIDHelper, const CaloCellContainer*& tileCellCon){
-	MsgStream msg(msgSvc(), name());
         const CaloCellContainer* scells_from_sg;
 	if ( evtStore()->retrieve(scells_from_sg, m_inputCellsName).isFailure() ){
-		msg << MSG::WARNING << "did not find cell container" << endreq;
+		ATH_MSG_WARNING("did not find cell container");
 		return StatusCode::FAILURE;
 	}
 	if ( m_useProvenanceSkim ) {
@@ -134,17 +130,17 @@ StatusCode TrigT1CaloBaseFex::getContainersTileCal(CaloCellContainer*& scells, c
 		}
 	}
 	if (getTileIDHelper(m_tileIDHelper).isFailure()){
-		msg << MSG::WARNING << "Could not get Tile ID manager " << endreq;
+		ATH_MSG_WARNING("Could not get Tile ID manager ");
 		return StatusCode::FAILURE;
 	}
 	if (evtStore()->retrieve(tileCellCon, "AllCalo").isFailure()){
-		msg << MSG::WARNING << "Could not find Tile cell container" << endreq;
+		ATH_MSG_WARNING("Could not find Tile cell container");
 		return StatusCode::FAILURE;
 	}
 #ifndef NDEBUG
         for(auto scell : *scells) {
 		if ( scell->et() < 3e3 ) continue;
-		msg << MSG::DEBUG << "scell : " << scell->et() << " " << scell->eta() << " " << scell->phi() << endreq;
+		ATH_MSG_DEBUG("scell : " << scell->et() << " " << scell->eta() << " " << scell->phi());
 	}
 #endif
 	return StatusCode::SUCCESS;
@@ -152,14 +148,13 @@ StatusCode TrigT1CaloBaseFex::getContainersTileCal(CaloCellContainer*& scells, c
 
 StatusCode TrigT1CaloBaseFex::getContainers(CaloCellContainer*& scells, const xAOD::TriggerTowerContainer*& TTs, float etThresholdGeV){
 
-        MsgStream msg(msgSvc(), name());
         const CaloCellContainer* scells_from_sg;
         if ( evtStore()->retrieve(scells_from_sg,m_inputCellsName).isFailure() ){
-                msg << MSG::WARNING << "did not find cell container" << endreq;
+                ATH_MSG_WARNING("did not find cell container");
                 return StatusCode::SUCCESS;
         }
         if ( evtStore()->retrieve(TTs,"xAODTriggerTowers").isFailure() ){
-                msg << MSG::WARNING << "did not find TT container" << endreq;
+                ATH_MSG_WARNING("did not find TT container");
                 return StatusCode::SUCCESS;
         }
 
@@ -192,9 +187,8 @@ StatusCode TrigT1CaloBaseFex::getContainers(CaloCellContainer*& scells, const xA
 
 StatusCode TrigT1CaloBaseFex::getContainers(const xAOD::TruthParticleContainer*& truthContainer){
 
-	MsgStream msg(msgSvc(), name());
         if ( evtStore()->retrieve(truthContainer,"TruthParticles").isFailure() ){
-                msg << MSG::WARNING << "did not find Truth container" << endreq;
+                ATH_MSG_WARNING("did not find Truth container");
                 return StatusCode::SUCCESS;
         }
  
@@ -652,7 +646,6 @@ CaloCell* TrigT1CaloBaseFex::returnCellFromCont(Identifier inputID, const CaloCe
 }
 
 CaloCell* TrigT1CaloBaseFex::NextEtaCell_Barrel(CaloCell* inputCell, bool upwards, const CaloCellContainer* &cellContainer, const CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	const Identifier ithID = inputCell->ID();
         const int ithEta_index = idHelper->eta(ithID);
         const int ithPhi_index = idHelper->phi(ithID);
@@ -668,14 +661,14 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_Barrel(CaloCell* inputCell, bool upward
 		  if (ithSampling == 0) maxEta_index = 14;
 		  else if (ithSampling == 1 || ithSampling == 2) maxEta_index = 55;
 		  else if (ithSampling == 3) maxEta_index = 13;
-		  else msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+		  else ATH_MSG_WARNING("ERROR: " << __LINE__);
         }
         else if (ithRegion==1){
 		  if (ithSampling == 1) maxEta_index =2;
 		  else if (ithSampling == 2) maxEta_index=0;
-		  else msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+		  else ATH_MSG_WARNING("ERROR: " << __LINE__);
         }
-        else msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+        else ATH_MSG_WARNING("ERROR: " << __LINE__);
     
         // Declare next values, default initialisation is the same as cell
         int nextEta_index = ithEta_index;
@@ -705,7 +698,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_Barrel(CaloCell* inputCell, bool upward
 			nextRegion = 0;
 			tracker = 2;
 		  }
-		  else msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+		  else ATH_MSG_WARNING("ERROR: " << __LINE__);
         }
 
         // If last cell in region & moving outwards
@@ -745,7 +738,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_Barrel(CaloCell* inputCell, bool upward
 			nextPos_neg = 2 * ithPos_neg;
 			tracker = 7;
 		  }
-		  else msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+		  else ATH_MSG_WARNING("ERROR: " << __LINE__);
         }
 
         // Otherwise 'simply' next cell along
@@ -753,33 +746,32 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_Barrel(CaloCell* inputCell, bool upward
 		  nextEta_index = ithEta_index + incrementEta;
 		  tracker = 8;
 	    }
-	    //msg << MSG::DEBUG << "B Tracker = " << tracker << endreq;
+	    //ATH_MSG_DEBUG("B Tracker = " << tracker);
         // Form identifier, find cell & return it
         // sub_calo, left_pos_neg, 2, region, eta_index, down_phi_index
         Identifier nextCellID = idHelper->CaloCell_SuperCell_ID::cell_id(nextSub_calo, nextPos_neg, nextSampling, nextRegion, nextEta_index, ithPhi_index);
         CaloCell* nextCell = returnCellFromCont(nextCellID, cellContainer, idHelper);      
         if (nextCell == NULL) {
-		  msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
-		  msg << MSG::WARNING << "Barrel Tracker = " << tracker << endreq;
-		  msg << MSG::WARNING << "from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID << endreq;            
+		  ATH_MSG_WARNING("ERROR: " << __LINE__);
+		  ATH_MSG_WARNING("Barrel Tracker = " << tracker);
+		  ATH_MSG_WARNING("from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID);            
 	    }
         else {
 		Identifier newID = nextCell->ID();
 		int IDsample = idHelper->sampling(nextCell->ID());
 		/// Leave this in for debug purposes, but I now expect it to happen
 		if (IDsample!=ithSampling){
-			msg << MSG::WARNING << "Layer has changed " << " tracker = " << tracker << endreq;
-			msg << MSG::WARNING << "from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID << endreq;
-			msg << MSG::WARNING << "from ID from new cell: "<<idHelper->sub_calo(newID)<<", "<<idHelper->pos_neg(newID)<<", "<<idHelper->sampling(newID)<<", "<<idHelper->region(newID)<<", "<<idHelper->eta(newID)<<", "<<idHelper->phi(newID)<<", "<<idHelper->calo_cell_hash(newID)<<", "<<newID << endreq;
-        		msg << MSG::WARNING << "comp indices: "<< (nextCellID == newID) << endreq;
+			ATH_MSG_WARNING("Layer has changed " << " tracker = " << tracker);
+			ATH_MSG_WARNING("from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID);
+			ATH_MSG_WARNING("from ID from new cell: "<<idHelper->sub_calo(newID)<<", "<<idHelper->pos_neg(newID)<<", "<<idHelper->sampling(newID)<<", "<<idHelper->region(newID)<<", "<<idHelper->eta(newID)<<", "<<idHelper->phi(newID)<<", "<<idHelper->calo_cell_hash(newID)<<", "<<newID);
+        		ATH_MSG_WARNING("comp indices: "<< (nextCellID == newID));
       		}
 	}
-	if (nextCell && (nextCell->ID() != nextCellID)) msg << MSG::WARNING << __LINE__ << " does not match" << endreq;
+	if (nextCell && (nextCell->ID() != nextCellID)) ATH_MSG_WARNING(__LINE__ << " does not match");
 	return nextCell;
 }
 
 CaloCell* TrigT1CaloBaseFex::NextEtaCell_OW(CaloCell*inputCell, bool upwards, const CaloCellContainer* &cellContainer, const  CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	Identifier ithID = inputCell->ID();
         int ithEta_index = idHelper->eta(ithID);
         const int ithPhi_index = idHelper->phi(ithID);
@@ -811,7 +803,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_OW(CaloCell*inputCell, bool upwards, co
               maxEta_index=0;
               break;
             case 1:
-              msg << MSG::WARNING << "ERROR " << __LINE__ << endreq;
+              ATH_MSG_WARNING("ERROR " << __LINE__);
               break;
             case 2:
               maxEta_index=11;
@@ -826,10 +818,10 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_OW(CaloCell*inputCell, bool upwards, co
               maxEta_index=0;
               break;
             default:
-		    msg << MSG::WARNING << "OW region is not covered: " << ithRegion << endreq;
+		    ATH_MSG_WARNING("OW region is not covered: " << ithRegion);
           }
         }        
-        else msg << MSG::WARNING << "ERROR: "<< __LINE__<< endreq;
+        else ATH_MSG_WARNING("ERROR: "<< __LINE__);
         // Calculate the increment for eta: it depends on whether we are moving 'up' & which side we are on
         int incrementEta;
         int ithSide = ithPos_neg / abs(ithPos_neg);
@@ -918,7 +910,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_OW(CaloCell*inputCell, bool upwards, co
                     nextRegion = ithRegion-1;
                     if (nextRegion==0) {
 					    nextEta_index=0;
-					    msg << MSG::WARNING << "ERROR: "<< __LINE__<< endreq;
+					    ATH_MSG_WARNING("ERROR: "<< __LINE__);
                     }
                     else if (nextRegion==1) {
 					    nextRegion = 0;
@@ -938,27 +930,26 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_OW(CaloCell*inputCell, bool upwards, co
         Identifier nextCellID = idHelper->CaloCell_SuperCell_ID::cell_id(nextSub_calo, nextPos_neg, nextSampling, nextRegion, nextEta_index, nextPhi_index);
         CaloCell* nextCell = returnCellFromCont(nextCellID, cellContainer, idHelper);
         if (nextCell == NULL) {
-		msg << MSG::WARNING << "ERROR: "<<__LINE__<< endreq;
-		msg << MSG::WARNING << "OW Tracker = "<<tracker<< endreq;
-		msg << MSG::WARNING << "from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID<< endreq;
-		msg << MSG::WARNING << "Increment eta = "<<incrementEta<<", max_eta = "<<maxEta_index<<", min_eta = "<<minEta_index<< endreq;     
+		ATH_MSG_WARNING("ERROR: "<<__LINE__);
+		ATH_MSG_WARNING("OW Tracker = "<<tracker);
+		ATH_MSG_WARNING("from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID);
+		ATH_MSG_WARNING("Increment eta = "<<incrementEta<<", max_eta = "<<maxEta_index<<", min_eta = "<<minEta_index);     
         }
         else {
           	Identifier newID = nextCell->ID();
           	int IDsample = idHelper->sampling(nextCell->ID());
           	if (IDsample!=ithSampling){
-            		msg << MSG::WARNING << "Layer has changed "<<" tracker = "<<tracker<< endreq;
-			msg << MSG::WARNING << "from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID<< endreq;
-			msg << MSG::WARNING << "from ID from new cell: "<<idHelper->sub_calo(newID)<<", "<<idHelper->pos_neg(newID)<<", "<<idHelper->sampling(newID)<<", "<<idHelper->region(newID)<<", "<<idHelper->eta(newID)<<", "<<idHelper->phi(newID)<<", "<<idHelper->calo_cell_hash(newID)<<", "<<newID<< endreq;
-			msg << MSG::WARNING << "comp indices: "<<(nextCellID == newID) << endreq;
+            		ATH_MSG_WARNING("Layer has changed "<<" tracker = "<<tracker);
+			ATH_MSG_WARNING("from nextCellID: "<<idHelper->sub_calo(nextCellID)<<", "<<idHelper->pos_neg(nextCellID)<<", "<<idHelper->sampling(nextCellID)<<", "<<idHelper->region(nextCellID)<<", "<<idHelper->eta(nextCellID)<<", "<<idHelper->phi(nextCellID)<<", "<<idHelper->calo_cell_hash(nextCellID)<<", "<<nextCellID);
+			ATH_MSG_WARNING("from ID from new cell: "<<idHelper->sub_calo(newID)<<", "<<idHelper->pos_neg(newID)<<", "<<idHelper->sampling(newID)<<", "<<idHelper->region(newID)<<", "<<idHelper->eta(newID)<<", "<<idHelper->phi(newID)<<", "<<idHelper->calo_cell_hash(newID)<<", "<<newID);
+			ATH_MSG_WARNING("comp indices: "<<(nextCellID == newID));
           	}
         }
-        if (nextCell && (nextCell->ID() != nextCellID)) msg << MSG::WARNING <<__LINE__<< " does not match" << endreq;
+        if (nextCell && (nextCell->ID() != nextCellID)) ATH_MSG_WARNING(__LINE__<< " does not match");
         return nextCell;
 }
 
 CaloCell* TrigT1CaloBaseFex::NextEtaCell_IW(CaloCell*inputCell, bool upwards, const CaloCellContainer* &cellContainer, const  CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	const Identifier ithID = inputCell->ID();
 	const int ithEta_index = idHelper->eta(ithID);
         const int ithPhi_index = idHelper->phi(ithID);
@@ -983,7 +974,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_IW(CaloCell*inputCell, bool upwards, co
 		maxEta_index=2;
 		minEta_index=0;
         }
-        else if (ithRegion!=1) msg << MSG::WARNING << "ERROR: " <<__LINE__<< endreq;
+        else if (ithRegion!=1) ATH_MSG_WARNING("ERROR: " <<__LINE__);
 
         // Calculate the increment for eta: it depends on whether we are moving 'up' & which side we are on
         int incrementEta;
@@ -1007,7 +998,7 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_IW(CaloCell*inputCell, bool upwards, co
 				nextRegion=1;
 				nextEta_index=42;
 			}
-			else msg << MSG::WARNING << "ERROR: " <<__LINE__<< endreq;
+			else ATH_MSG_WARNING("ERROR: " <<__LINE__);
               }
               // Goes to IW region 0
               else if (ithRegion == 1){
@@ -1034,12 +1025,11 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell_IW(CaloCell*inputCell, bool upwards, co
         }
         Identifier nextCellID = idHelper->CaloCell_SuperCell_ID::cell_id(nextSub_calo, nextPos_neg, ithSampling, nextRegion, nextEta_index, nextPhi_index);
         CaloCell* nextCell = returnCellFromCont(nextCellID, cellContainer, idHelper);
-        if (nextCell && (nextCell->ID() != nextCellID)) msg << MSG::WARNING <<__LINE__<<" does not match" << endreq;
+        if (nextCell && (nextCell->ID() != nextCellID)) ATH_MSG_WARNING(__LINE__<<" does not match");
         return nextCell;
 }
 
 CaloCell* TrigT1CaloBaseFex::NextEtaCell(CaloCell* inputCell, bool upwards, const CaloCellContainer* &cellContainer, const  CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	if (inputCell==NULL) return NULL;
         Identifier ithID = inputCell->ID();
         int ithSub_calo = idHelper->sub_calo(ithID);
@@ -1055,14 +1045,14 @@ CaloCell* TrigT1CaloBaseFex::NextEtaCell(CaloCell* inputCell, bool upwards, cons
                 else if (abs(ithPos_neg)==3) tempCell = NextEtaCell_IW(inputCell, upwards, cellContainer, idHelper);
                 // Not barrel or end cap
                 else {
-			msg << MSG::WARNING << "Layer 2 cell not passed to specific method at" << inputCell->eta() << " , " << inputCell->phi() << endreq;
+			ATH_MSG_WARNING("Layer 2 cell not passed to specific method at" << inputCell->eta() << " , " << inputCell->phi());
                 	return NULL;
                 }
                 return tempCell;
         }
         // Is FCAL
         else {
-		msg << MSG::WARNING << "Next eta cell called for non-EM SC!" << endreq;
+		ATH_MSG_WARNING("Next eta cell called for non-EM SC!");
 		return NULL;
         }
 }
@@ -1076,7 +1066,6 @@ int TrigT1CaloBaseFex::restrictPhiIndex(int input_index, bool is64){
 }
 
 CaloCell* TrigT1CaloBaseFex::NextPhiCell(CaloCell*inputCell, bool upwards, const CaloCellContainer* &cellContainer, const  CaloCell_SuperCell_ID* &idHelper){
-        MsgStream msg(msgSvc(), name());
 	if (inputCell==NULL) return NULL;
         const Identifier ithID = inputCell->ID();
         const int ithEta_index = idHelper->eta(ithID);
@@ -1097,8 +1086,8 @@ CaloCell* TrigT1CaloBaseFex::NextPhiCell(CaloCell*inputCell, bool upwards, const
         const int nextPhi_index = restrictPhiIndex(ithPhi_index+incrementPhi, is64);
         Identifier nextCellID = idHelper->CaloCell_SuperCell_ID::cell_id(ithSub_calo, ithPos_neg, ithSampling, ithRegion, ithEta_index, nextPhi_index);
         CaloCell* nextCell = returnCellFromCont(nextCellID, cellContainer, idHelper);
-        if (nextCell && (nextCell->ID() != nextCellID)) msg << MSG::WARNING << __LINE__ << " does not match" << endreq;
-        if (nextCell == NULL) msg << MSG::WARNING << "Next phi cell is NULL at " << __LINE__ << endreq;
+        if (nextCell && (nextCell->ID() != nextCellID)) ATH_MSG_WARNING(__LINE__ << " does not match");
+        if (nextCell == NULL) ATH_MSG_WARNING("Next phi cell is NULL at " << __LINE__);
         return nextCell;
 }
 
@@ -1107,14 +1096,13 @@ bool TrigT1CaloBaseFex::localMax(const CaloCellContainer* &inputContainer, CaloC
 }
 
 bool TrigT1CaloBaseFex::localMax(const CaloCellContainer* &inputContainer, CaloCell* inputCell, int numOthers, const CaloCell_SuperCell_ID* &idHelper, float digitScale, float digitThreshold){
-        MsgStream msg(msgSvc(), name());
         if (inputCell == NULL) return false;
         // Get ID info
         const Identifier inputID = inputCell->ID();
         const int sub_calo = idHelper->sub_calo(inputID);
         const int pos_neg = idHelper->pos_neg(inputID);
         if (!(sub_calo == 0 || sub_calo == 1) || !(abs(pos_neg) < 4)){
-	        msg << MSG::WARNING << "ERROR with local max logic" << endreq;
+	        ATH_MSG_WARNING("ERROR with local max logic");
 	        return false;
         }
         double seedCandidateEnergy = CaloCellET(inputCell, digitScale, digitThreshold);
@@ -1176,11 +1164,10 @@ bool TrigT1CaloBaseFex::localMax(const CaloCellContainer* &inputContainer, CaloC
 }
 
 void TrigT1CaloBaseFex::addOnce(CaloCell* inputCell, std::vector<CaloCell*> &outputVector){
-	MsgStream msg(msgSvc(), name());
 	if (inputCell==NULL) return;
         bool alreadyThere = false;
         for (auto oCell : outputVector){
-          if (oCell==NULL) msg << MSG::WARNING << "NULL cell in vector" << endreq;
+          if (oCell==NULL) ATH_MSG_WARNING("NULL cell in vector");
           if (inputCell->ID() == oCell->ID()) alreadyThere=true;
         }
         if (!alreadyThere) outputVector.push_back(inputCell);
@@ -1188,7 +1175,6 @@ void TrigT1CaloBaseFex::addOnce(CaloCell* inputCell, std::vector<CaloCell*> &out
 
 std::vector<CaloCell*> TrigT1CaloBaseFex::L2cluster(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh ){
 	// Forms the central band of cells, spread in phi
-	MsgStream msg(msgSvc(), name());
         std::vector<CaloCell*> centCells;
         centCells.push_back(centreCell);
         CaloCell* upPhiCell = NextPhiCell(centreCell,true,scells,idHelper);
@@ -1202,12 +1188,12 @@ std::vector<CaloCell*> TrigT1CaloBaseFex::L2cluster(CaloCell* centreCell, int et
 		  addOnce(upPhiCell, centCells); //centCells.push_back(upPhiCell);
           addOnce(downPhiCell, centCells); //centCells.push_back(downPhiCell);
         }
-        else if (phiWidth > 3) msg << MSG::WARNING << "ERROR: phiWidth not 2 or 3!!!" << endreq;
+        else if (phiWidth > 3) ATH_MSG_WARNING("ERROR: phiWidth not 2 or 3!!!");
         // Forms the main cluster. Starts with each SC in the central band and spreads outward in eta
         std::vector<CaloCell*> clusCells;
         int halfEtaWidth = (etaWidth-1)/2;
         int backToEta = (2*halfEtaWidth)+1;
-        if (backToEta != etaWidth) msg << MSG::WARNING << "Eta width doesn't match! " << backToEta << " -> " << halfEtaWidth << " -> " << etaWidth << "  " << __LINE__ << endreq;
+        if (backToEta != etaWidth) ATH_MSG_WARNING("Eta width doesn't match! " << backToEta << " -> " << halfEtaWidth << " -> " << etaWidth << "  " << __LINE__);
         for (auto ithCentCell : centCells){
             addOnce(ithCentCell, clusCells); //clusCells.push_back(ithCentCell);
             if (etaWidth > 1){
@@ -1227,7 +1213,6 @@ std::vector<CaloCell*> TrigT1CaloBaseFex::L2cluster(CaloCell* centreCell, int et
 }
 
 void TrigT1CaloBaseFex::fromLayer2toLayer1(const CaloCellContainer* &inputContainer, CaloCell* inputCell, std::vector<CaloCell*> &outputVector, const CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	if (inputCell==NULL) return;
         // Gets ID info
         Identifier inputID = inputCell->ID();
@@ -1315,7 +1300,7 @@ void TrigT1CaloBaseFex::fromLayer2toLayer1(const CaloCellContainer* &inputContai
                         else if (eta_index == 19) offset = 13;
                         else if (eta_index == 22) offset = 12;
                         else {
-                                msg << MSG::WARNING << "ERROR: " << __LINE__ << endreq;
+                                ATH_MSG_WARNING("ERROR: " << __LINE__);
                         }
                         for (unsigned int  i = 0; i < 2; i++){
                           outputEta = i+eta_index - offset;
@@ -1349,12 +1334,11 @@ void TrigT1CaloBaseFex::fromLayer2toLayer1(const CaloCellContainer* &inputContai
                 CaloCell* resultCell = returnCellFromCont(resultID, inputContainer, idHelper);
                 addOnce(resultCell,outputVector);
         }
-        msg << MSG::DEBUG << "L2->L1: sampling = " << sampling << ", region = " << region << ", eta = " << pos_neg*eta_index<< " tracker = " << tracker << endreq;
+        ATH_MSG_DEBUG("L2->L1: sampling = " << sampling << ", region = " << region << ", eta = " << pos_neg*eta_index<< " tracker = " << tracker);
 }
 
 CaloCell* TrigT1CaloBaseFex::fromLayer2toPS(const CaloCellContainer* &inputContainer, CaloCell* inputCell, const CaloCell_SuperCell_ID* &idHelper){
 	// Gets ID info
-	MsgStream msg(msgSvc(), name());
         if (inputCell==NULL) return NULL;
         CaloCell* resultCell = NULL;
         Identifier inputID = inputCell->ID();
@@ -1390,13 +1374,12 @@ CaloCell* TrigT1CaloBaseFex::fromLayer2toPS(const CaloCellContainer* &inputConta
                 resultCell = returnCellFromCont(resultID, inputContainer, idHelper); 
                 tracker = 3;
         }
-        msg << MSG::DEBUG << "L2->PS tracker = " << tracker << endreq;
+        ATH_MSG_DEBUG("L2->PS tracker = " << tracker);
         return resultCell;
 }
 
 CaloCell* TrigT1CaloBaseFex::fromLayer2toLayer3(const CaloCellContainer* &inputContainer, CaloCell* inputCell, const CaloCell_SuperCell_ID* &idHelper){
 	// Gets ID info
-	MsgStream msg(msgSvc(), name());
         if (inputCell==NULL) return NULL;;
         CaloCell* resultCell = NULL;
         Identifier inputID = inputCell->ID();
@@ -1438,14 +1421,12 @@ CaloCell* TrigT1CaloBaseFex::fromLayer2toLayer3(const CaloCellContainer* &inputC
                 resultCell = returnCellFromCont(resultID, inputContainer, idHelper); 
                 tracker = 3;
         }
-        //msg << MSG::DEBUG << "L2->L3 tracker = " << tracker << endreq;
-        msg << MSG::DEBUG << "L2->L3: sampling = " << sampling << ", region = " << region << ", eta = " << pos_neg*eta_index<< " tracker = " << tracker << endreq;
+        ATH_MSG_DEBUG("L2->L3: sampling = " << sampling << ", region = " << region << ", eta = " << pos_neg*eta_index<< " tracker = " << tracker);
         return resultCell;
 }
 
 std::vector<CaloCell*> TrigT1CaloBaseFex::TDR_Clus(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells,const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh){
 	// Find the L2 cells
-	MsgStream msg(msgSvc(), name());
         std::vector<CaloCell*> L2cells = L2cluster(centreCell, etaWidth, phiWidth, scells, idHelper, digitScale, digitThresh);
         // Forms a vector of the centre L2 cells (to be used to find L0/3 SCs)
         std::vector<CaloCell*> centCells;
@@ -1463,7 +1444,7 @@ std::vector<CaloCell*> TrigT1CaloBaseFex::TDR_Clus(CaloCell* centreCell, int eta
                         addOnce(upPhiCell, centCells); //centCells.push_back(upPhiCell);
 			            addOnce(downPhiCell, centCells); //centCells.push_back(downPhiCell);
                 }
-                else if (phiWidth > 3) msg << MSG::WARNING << "ERROR: phiWidth not 2 or 3!!!. Value = " << phiWidth << endreq;
+                else if (phiWidth > 3) ATH_MSG_WARNING("ERROR: phiWidth not 2 or 3!!!. Value = " << phiWidth);
         }
         // The actual cluster is initialised
         std::vector<CaloCell*> fullClus;
@@ -1489,25 +1470,23 @@ double TrigT1CaloBaseFex::sumVectorET(const std::vector<CaloCell*> &inputVector,
 }
 
 bool TrigT1CaloBaseFex::checkDig(float EM_ET, float digitScale, float digitThresh){
-	MsgStream msg(msgSvc(), name());
 	if (EM_ET == 0 || digitScale == 0) return true;
         else {
 		int div = EM_ET / digitScale;
 		if (div * digitScale == EM_ET) return true;
 		else {
-			msg << MSG::WARNING << "ET = " << EM_ET << ", digitThresh = " << digitThresh << " digitScale = " << digitScale << " div = " << div << " " << " -> div * digitScale" << endreq;
+			ATH_MSG_WARNING("ET = " << EM_ET << ", digitThresh = " << digitThresh << " digitScale = " << digitScale << " div = " << div << " " << " -> div * digitScale");
 			return false;
 		}
 	}
 }
 
 double TrigT1CaloBaseFex::EMClusET(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh){
-	MsgStream msg(msgSvc(), name());
 	// Sums the ET of the vector
         std::vector<CaloCell*> fullClus = TDR_Clus(centreCell, etaWidth, phiWidth, scells, idHelper, digitScale,digitThresh);
         double EMcomp = sumVectorET(fullClus, digitScale, digitThresh);  
         bool EMcheck = checkDig(EMcomp, digitScale, digitThresh);
-        if (!EMcheck) msg << MSG::WARNING << "EMcomp not digitised  " << EMcomp << "  " << digitScale << "  " << digitThresh << endreq;
+        if (!EMcheck) ATH_MSG_WARNING("EMcomp not digitised  " << EMcomp << "  " << digitScale << "  " << digitThresh);
         double total = EMcomp;
         return total;
 }
@@ -1554,10 +1533,9 @@ double TrigT1CaloBaseFex::L2clusET(CaloCell* centreCell, int etaWidth, int phiWi
 }
 
 double TrigT1CaloBaseFex::REta(CaloCell* centreCell, int etaWidth1, int phiWidth1, int etaWidth2, int phiWidth2, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh){
-	MsgStream msg(msgSvc(), name());
 	// Check windows sizes are right way round
-        if (etaWidth1 > etaWidth2) msg << MSG::WARNING << "REta ERROR: eta1 = " << etaWidth1 << ", eta2 = " << etaWidth2 << endreq;
-        if (phiWidth1 > phiWidth2) msg << MSG::WARNING << "Rphi ERROR: phi1 = " << phiWidth1 << ", phi2 = " << phiWidth2 << endreq;
+        if (etaWidth1 > etaWidth2) ATH_MSG_WARNING("REta ERROR: eta1 = " << etaWidth1 << ", eta2 = " << etaWidth2);
+        if (phiWidth1 > phiWidth2) ATH_MSG_WARNING("Rphi ERROR: phi1 = " << phiWidth1 << ", phi2 = " << phiWidth2);
         // Finds ET of windows
         double inner_ET = L2clusET(centreCell, etaWidth1, phiWidth1, scells, idHelper, digitScale, digitThresh);
         double outer_ET = L2clusET(centreCell, etaWidth2, phiWidth2, scells, idHelper, digitScale, digitThresh);
@@ -1572,10 +1550,9 @@ double TrigT1CaloBaseFex::REta(CaloCell* centreCell, int etaWidth1, int phiWidth
 }
 
 double TrigT1CaloBaseFex::REtaL12(CaloCell* centreCell, int etaWidth1, int phiWidth1, int etaWidth2, int phiWidth2, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh){
-	MsgStream msg(msgSvc(), name());
 	// Check windows sizes are right way round
-        if (etaWidth1 > etaWidth2) msg << MSG::WARNING << "REta ERROR: eta1 = " << etaWidth1 << ", eta2 = " << etaWidth2 << endreq;
-        if (phiWidth1 > phiWidth2) msg << MSG::WARNING << "Rphi ERROR: phi1 = " << phiWidth1 << ", phi2 = " << phiWidth2 << endreq;
+        if (etaWidth1 > etaWidth2) ATH_MSG_WARNING("REta ERROR: eta1 = " << etaWidth1 << ", eta2 = " << etaWidth2);
+        if (phiWidth1 > phiWidth2) ATH_MSG_WARNING("Rphi ERROR: phi1 = " << phiWidth1 << ", phi2 = " << phiWidth2);
         // Finds ET of windows
         double inner_ET = L2clusET(centreCell, etaWidth1, phiWidth1, scells, idHelper, digitScale, digitThresh);
         double outer_ET = L2clusET(centreCell, etaWidth2, phiWidth2, scells, idHelper, digitScale, digitThresh);
@@ -1603,9 +1580,8 @@ double TrigT1CaloBaseFex::REtaL12(CaloCell* centreCell, int etaWidth1, int phiWi
 }
 
 double TrigT1CaloBaseFex::TT_phi(const xAOD::TriggerTower* &inputTower){
-	MsgStream msg(msgSvc(), name());
 	if (inputTower == NULL){
-		msg << MSG::WARNING << "Tower is NULL in phi transformation!" << endreq;
+		ATH_MSG_WARNING("Tower is NULL in phi transformation!");
 		return 0.;
 	}
 	else {
@@ -1624,7 +1600,6 @@ double TrigT1CaloBaseFex::dR(double eta1, double phi1, double eta2, double phi2)
 }
 
 const xAOD::TriggerTower* TrigT1CaloBaseFex::matchingHCAL_TT(CaloCell* &inputCell, const xAOD::TriggerTowerContainer* &TTContainer){
-	MsgStream msg(msgSvc(), name());
 	std::vector<const xAOD::TriggerTower*> matchingTTs;
         if (TTContainer==NULL) return NULL;
         if (TTContainer->size()==0) return NULL;
@@ -1639,13 +1614,12 @@ const xAOD::TriggerTower* TrigT1CaloBaseFex::matchingHCAL_TT(CaloCell* &inputCel
         }
         if (matchingTTs.size()==1) return matchingTTs[0];
         else if (matchingTTs.size()!=0){	
-		msg << MSG::WARNING << "ERROR: More than one matching HCAL TT!!! (Returned Null)" << endreq;
+		ATH_MSG_WARNING("ERROR: More than one matching HCAL TT!!! (Returned Null)");
 	}
 	return NULL;
 }
 
 CaloCell* TrigT1CaloBaseFex::matchingHCAL_LAr(CaloCell* &inputCell, const CaloCellContainer* &SCContainer, const  CaloCell_SuperCell_ID* &idHelper){
-	MsgStream msg(msgSvc(), name());
 	std::vector<CaloCell*> matchingCells;
         if (inputCell==NULL) return NULL;
         for (auto ithSC : *SCContainer){
@@ -1658,22 +1632,21 @@ CaloCell* TrigT1CaloBaseFex::matchingHCAL_LAr(CaloCell* &inputCell, const CaloCe
         }
         if (matchingCells.size()==1) return matchingCells[0];
         else if (matchingCells.size()==0){
-                msg << MSG::WARNING << "ERROR: No match betweem LAr ECAL SC and LAr HCAL SC!!! Input coords: " << inputCell->eta() << ", " << inputCell->phi() << endreq;
+                ATH_MSG_WARNING("ERROR: No match betweem LAr ECAL SC and LAr HCAL SC!!! Input coords: " << inputCell->eta() << ", " << inputCell->phi());
         }
         else if (matchingCells.size()!=0) {
-                msg << MSG::WARNING << "ERROR: More than one matching LAr HCAL SC!!! (Returned Null)" << endreq;
-                msg << MSG::WARNING << "Input cell coords: " << inputCell->eta() << " x " << inputCell->phi() << endreq;
+                ATH_MSG_WARNING("ERROR: More than one matching LAr HCAL SC!!! (Returned Null)");
+                ATH_MSG_WARNING("Input cell coords: " << inputCell->eta() << " x " << inputCell->phi());
                 for (auto ithMatch : matchingCells){
-                  msg << MSG::WARNING << "    " << ithMatch->eta() << " x " << ithMatch->phi() << ", dR = " << dR(inputCell->eta(), inputCell->phi(), ithMatch->eta(), ithMatch->phi()) << endreq;
+                  ATH_MSG_WARNING("    " << ithMatch->eta() << " x " << ithMatch->phi() << ", dR = " << dR(inputCell->eta(), inputCell->phi(), ithMatch->eta(), ithMatch->phi()));
                 }
         }
         return NULL;
 }
 
 double TrigT1CaloBaseFex::TT_ET(const xAOD::TriggerTower* &inputTower){
-	MsgStream msg(msgSvc(), name());
 	if (inputTower == NULL){
-		msg << MSG::WARNING << "Tower is NULL!" << endreq;
+		ATH_MSG_WARNING("Tower is NULL!");
 		return 0.;
         }
         else if (inputTower->cpET() < 0.) return 0;
@@ -1704,15 +1677,14 @@ double TrigT1CaloBaseFex::HadronicET(std::vector<CaloCell*> inputVector, const C
 }
 
 double TrigT1CaloBaseFex::RHad(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells, const xAOD::TriggerTowerContainer* &TTContainer, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh, float &HadET){
-	MsgStream msg(msgSvc(), name());
 	std::vector<CaloCell*> fullClus = TDR_Clus(centreCell, etaWidth, phiWidth, scells, idHelper, digitScale, digitThresh);
         double EMcomp = sumVectorET(fullClus, digitScale, digitThresh);
         double HCALcomp = HadronicET(L2cluster(centreCell, m_etaHadWidth_RHadIsolation, m_phiHadWidth_RHadIsolation, scells, idHelper, digitScale, digitThresh), scells, TTContainer, idHelper, digitScale, digitThresh);
 	    HadET = HCALcomp/1e3;
         double result = HCALcomp/(EMcomp+HCALcomp);
         if (result < 0. || result > 1.){
-                msg << MSG::WARNING << "RHAD ERROR -> " << etaWidth << " * " << phiWidth << endreq;
-                msg << MSG::WARNING << "fullClus count = " << fullClus.size() << ", EMcomp = " << EMcomp << ", HCALcomp = " << HCALcomp << endreq;
+                ATH_MSG_WARNING("RHAD ERROR -> " << etaWidth << " * " << phiWidth);
+                ATH_MSG_WARNING("fullClus count = " << fullClus.size() << ", EMcomp = " << EMcomp << ", HCALcomp = " << HCALcomp);
         }
         return result;
 }
@@ -1735,7 +1707,6 @@ double TrigT1CaloBaseFex::tileCellEnergyCalib(float eIn, float etaIn, float tile
 }
 
 int TrigT1CaloBaseFex::detRelPos(const float inEta){
-	MsgStream msg(msgSvc(), name());
 	float pos_neg = inEta/fabs(inEta);
 	// Right PMT : inPos = 0, Left PMT : inPos = 1, Both PMTs : inPos = 2
 	int inPos = -1;
@@ -1764,7 +1735,6 @@ int TrigT1CaloBaseFex::detRelPos(const float inEta){
 }
 
 std::vector<double> TrigT1CaloBaseFex::EnergyPerTileLayer(std::vector<CaloCell*> &inputSCVector, const CaloCellContainer* CellCon, const TileID* tileIDHelper, bool isOW, float tileNoiseThresh){
-	MsgStream msg(msgSvc(), name());
 	std::vector<double> layerEnergy;
         if (CellCon==NULL) return layerEnergy;
         if (CellCon->size()==0) return layerEnergy;
@@ -1780,7 +1750,7 @@ std::vector<double> TrigT1CaloBaseFex::EnergyPerTileLayer(std::vector<CaloCell*>
 	  for ( ; fCell != lCell; ++fCell){
 	    const TileCell* tileCell = static_cast<const TileCell*>(*fCell);
 	    if (!tileCell){
-		  msg << MSG::WARNING << "Failed to cast from CaloCell to TileCell" << endreq;
+		  ATH_MSG_WARNING("Failed to cast from CaloCell to TileCell");
 		  return layerEnergy;
 	    }
 	    int layer = tileIDHelper->sample(tileCell->ID());
@@ -1811,7 +1781,7 @@ std::vector<double> TrigT1CaloBaseFex::EnergyPerTileLayer(std::vector<CaloCell*>
 			    int tempPos = detRelPos(ithSCEta);
 			    // Unknown : tempPos = -1, Right PMT : tempPos = 0, Left PMT : tempPos = 1, Both PMTs : tempPos = 2
 			    if (tempPos < 0){
-				    msg << MSG::WARNING << "Unknown behaviour matching Tile cells to the SC" << endreq;
+				    ATH_MSG_WARNING("Unknown behaviour matching Tile cells to the SC");
 				    layerEnergy.clear();
 				    return layerEnergy;
 			    }
@@ -1822,10 +1792,10 @@ std::vector<double> TrigT1CaloBaseFex::EnergyPerTileLayer(std::vector<CaloCell*>
 	    }
 	  }
 	  if ((matchingCells > 3 && !isOW) || (matchingCells > 3 && isOW && fabs(ithSCEta) > 1.42) || (matchingCells > 4 && isOW && fabs(ithSCEta) < 1.42)){
-		    msg << MSG::WARNING << matchingCells << " matching Tile cells:" << endreq;
-		    msg << MSG::WARNING << "Input SC: (eta,phi) = (" << ithSCEta << "," << ithSCPhi << ")" << endreq;
+		    ATH_MSG_WARNING(matchingCells << " matching Tile cells:");
+		    ATH_MSG_WARNING("Input SC: (eta,phi) = (" << ithSCEta << "," << ithSCPhi << ")");
 		    for (auto cell : tileCellVector){
-		      msg << MSG::WARNING << "Tile cell: (eta,phi) = (" << cell->eta() << "," << cell->phi() << ")" << " dR = " << dR(cell->eta(), cell->phi(), ithSCEta, ithSCPhi) << " layer = " << tileIDHelper->sample(cell->ID()) << endreq;
+		      ATH_MSG_WARNING("Tile cell: (eta,phi) = (" << cell->eta() << "," << cell->phi() << ")" << " dR = " << dR(cell->eta(), cell->phi(), ithSCEta, ithSCPhi) << " layer = " << tileIDHelper->sample(cell->ID()));
 		    }
 		    layerEnergy.clear();
 		    return layerEnergy;
@@ -1836,7 +1806,6 @@ std::vector<double> TrigT1CaloBaseFex::EnergyPerTileLayer(std::vector<CaloCell*>
 }
 
 double TrigT1CaloBaseFex::RHadTile(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh, const TileID* m_tileIDHelper, const CaloCellContainer* tileCellCon, float tileNoiseThresh, float &HadronicET){
-	MsgStream msg(msgSvc(), name());
 	std::vector<float> outVec;
 	double HadET = 0.;
 	std::vector<CaloCell*> L2Cells = L2cluster(centreCell, etaWidth, phiWidth, scells, idHelper, digitScale, digitThresh);
@@ -1869,15 +1838,14 @@ double TrigT1CaloBaseFex::RHadTile(CaloCell* centreCell, int etaWidth, int phiWi
 	    double EMcomp = sumVectorET(fullClus, digitScale, digitThresh);
 	    double result = HadET/(EMcomp+HadET);
         if (result < 0. || result > 1.){
-                msg << MSG::WARNING << "RHADTILE ERROR -> " << etaWidth << " * " << phiWidth << endreq;
-                msg << MSG::WARNING << "fullClus count = " << fullClus.size() << ", EMcomp = " << EMcomp << ", HCALcomp = " << HadET << endreq;
+                ATH_MSG_WARNING("RHADTILE ERROR -> " << etaWidth << " * " << phiWidth);
+                ATH_MSG_WARNING("fullClus count = " << fullClus.size() << ", EMcomp = " << EMcomp << ", HCALcomp = " << HadET);
 		return 1.;
         }
         return result;
 }
 
 double TrigT1CaloBaseFex::L1Width(CaloCell* centreCell, int etaWidth, int phiWidth, const CaloCellContainer* scells, const CaloCell_SuperCell_ID* idHelper, float digitScale, float digitThresh){
-        MsgStream msg(msgSvc(), name());
     	// Finds a L2 cluster and the corresponding L1 cells
         std::vector<CaloCell*> L2cells = L2cluster(centreCell, etaWidth, phiWidth, scells, idHelper,digitScale, digitThresh);
 
@@ -1920,7 +1888,7 @@ double TrigT1CaloBaseFex::L1Width(CaloCell* centreCell, int etaWidth, int phiWid
           // Find offset. As a precaution ignore cells where this can't be found, but warn user
           int offset = (cellCount < offsets.size() ? offsets[cellCount] : -999);
           if (offset < -2 || offset > 2) {
-          	msg << MSG::WARNING << "Offset out of range, cell skipped" << endreq;
+          	ATH_MSG_WARNING("Offset out of range, cell skipped");
           	offset = 0;   // This will result in a weight of zero for the cell
           }
 
@@ -1972,7 +1940,6 @@ double TrigT1CaloBaseFex::L1Width(CaloCell* centreCell, int etaWidth, int phiWid
 }
 
 std::vector<std::vector<float>> TrigT1CaloBaseFex::looseAlg(const CaloCellContainer* SCs, const xAOD::TriggerTowerContainer* TTs, const CaloCell_SuperCell_ID* idHelper, const TileID* m_tileIDHelper, const CaloCellContainer* tileCellCon){
-	MsgStream msg(msgSvc(), name());
         std::vector< std::vector<float>> result;
         // Loops through and find L2 SCs that are local maxes and adds to list of local maxes if cluster ET is at least 10GeV
         std::vector<CaloCell*> potentialCentres;
@@ -2032,7 +1999,6 @@ std::vector<std::vector<float>> TrigT1CaloBaseFex::looseAlg(const CaloCellContai
 }
 
 std::vector<std::vector<float>> TrigT1CaloBaseFex::baselineAlg(const CaloCellContainer* scells, const xAOD::TriggerTowerContainer* TTs, const CaloCell_SuperCell_ID* idHelper, const TileID* m_tileIDHelper, const CaloCellContainer* tileCellCon){
-	MsgStream msg(msgSvc(), name());
   	std::vector<std::vector<float>> looseClusters = looseAlg(scells, TTs, idHelper, m_tileIDHelper, tileCellCon);
 	if (! m_apply_BaseLineCuts) return looseClusters;
   	else {
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloEFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloEFex.cxx
index 09882111a7e9..49cce83e83e9 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloEFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloEFex.cxx
@@ -56,7 +56,6 @@ StatusCode TrigT1CaloEFex::initialize(){
 	pass_Run3eFEX_clusterEnergy  = new SG::AuxElement::Accessor<int>("PassRun3ClusterEnergy");
 
 	if ( TrigT1CaloBaseFex::initialize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
         if ( m_enableMon ){
 		std::string histoName(name());
 		histoName+="Algo.root";
@@ -73,8 +72,7 @@ StatusCode TrigT1CaloEFex::initialize(){
 
 StatusCode TrigT1CaloEFex::finalize(){
 	if ( TrigT1CaloBaseFex::finalize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing TrigT1CaloEFex" << endreq;
+	ATH_MSG_DEBUG("finalizing TrigT1CaloEFex" );
 	if ( m_enableMon ) {
 		m_histFile->Write();
 		m_histFile->Close();
@@ -83,20 +81,19 @@ StatusCode TrigT1CaloEFex::finalize(){
 }
 
 StatusCode TrigT1CaloEFex::execute(){
-        MsgStream msg(msgSvc(), name());
 	CaloCellContainer* scells(0);
 	const xAOD::TriggerTowerContainer* TTs(0);
 	const TileID* m_tileIDHelper = nullptr;
 	const CaloCellContainer* tileCellCon(0);
 	if (!m_use_tileCells){
 		if ( getContainers(scells, TTs).isFailure() || (TTs==0) ) {
-			msg << MSG::WARNING << "Could not get containers" << endreq;
+			ATH_MSG_WARNING( "Could not get containers" );
 			return StatusCode::FAILURE;
 		}
 	}
 	else {
 		if ( getContainersTileCal(scells, m_tileIDHelper, tileCellCon).isFailure() ){
-			msg << MSG::WARNING << "Could not get containers and/or Tile ID" << endreq;
+			ATH_MSG_WARNING( "Could not get containers and/or Tile ID" );
 			return StatusCode::FAILURE;
 		}
 	}
@@ -107,18 +104,18 @@ StatusCode TrigT1CaloEFex::execute(){
 	clusters->reserve(100);
 	std::string clusterName(m_outputClusterName);
 	if ( evtStore()->record(clusters, clusterName).isFailure() ) {
-		msg << MSG::ERROR  << "recording was not possible" << endreq;
+		ATH_MSG_ERROR( "recording was not possible" );
 		return StatusCode::FAILURE;
 	}
 	if ( evtStore()->record(auxclusters, clusterName+"Aux.").isFailure() ) {
-		msg << MSG::ERROR << "recording Aux was not possible" << endreq;
+		ATH_MSG_ERROR( "recording Aux was not possible" );
 		return StatusCode::FAILURE;
 	}
 	// Set m_energyWeightedCluster to true if an energy weighted cluster formation should be performed (default:false)
 	if ( !m_energyWeightedCluster ) {
 		const CaloCell_SuperCell_ID* m_idHelper = nullptr;
 		if ( getIDHelper( m_idHelper ).isFailure() ) {
-			msg << MSG::WARNING << "Could not get ID manager " << endreq;
+			ATH_MSG_WARNING( "Could not get ID manager " );
 			return StatusCode::FAILURE;
 		}
 		std::vector<std::vector<float>> clustering = baselineAlg(scells, TTs, m_idHelper, m_tileIDHelper, tileCellCon);
@@ -213,7 +210,7 @@ StatusCode TrigT1CaloEFex::execute(){
 	          }
 	          if ( fabsf(clusterTimeWeight) > 0.1 ) clusterTime /= clusterTimeWeight;
 	          else clusterTime = -999.99;
-	          msg << MSG::DEBUG << "CELL versus CLUSTER : " << cellAbove->eta() << " " << cellAbove->phi() << " " << etaCluster << " " << phiCluster << " " << cellAbove->eta()-etaCluster << " " << cellAbove->phi()-phiCluster << endreq;
+	          ATH_MSG_DEBUG("CELL versus CLUSTER : " << cellAbove->eta() << " " << cellAbove->phi() << " " << etaCluster << " " << phiCluster << " " << cellAbove->eta()-etaCluster << " " << cellAbove->phi()-phiCluster );
 	          // Other cluster sizes for some of the shower shapes
 	          findCellsAround(scells, (const float)etaCluster, (const float)phiCluster, m_cellsAround2, m_deta_clusterFormation_2, m_dphi_clusterFormation_2);
 	          // Include TT (for Tile region only)
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloRun3TauFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloRun3TauFex.cxx
index b25af6f6199b..ce9d6dda44e1 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloRun3TauFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloRun3TauFex.cxx
@@ -49,8 +49,7 @@ TrigT1CaloRun3TauFex::~TrigT1CaloRun3TauFex(){
 StatusCode TrigT1CaloRun3TauFex::initialize(){
 	
 	if ( TrigT1CaloBaseFex::initialize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing TrigT1CaloRun3TauFex" << endreq;
+	ATH_MSG_DEBUG( "initializing TrigT1CaloRun3TauFex");
 	std::string histoName(name());
 	histoName+="Algo.root";
 	m_histFile = new TFile(histoName.c_str(),"RECREATE");
@@ -89,8 +88,7 @@ StatusCode TrigT1CaloRun3TauFex::initialize(){
 
 StatusCode TrigT1CaloRun3TauFex::finalize(){
 	if ( TrigT1CaloBaseFex::finalize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing TrigT1CaloRun3TauFex" << endreq;
+	ATH_MSG_DEBUG( "finalizing TrigT1CaloRun3TauFex");
 	if ( m_enableMon ) {
 		m_histFile->Write();
 		m_histFile->Close();
@@ -109,15 +107,14 @@ StatusCode TrigT1CaloRun3TauFex::finalize(){
 }
 
 StatusCode TrigT1CaloRun3TauFex::execute(){
-        MsgStream msg(msgSvc(), name());
 #ifndef NDEBUG
-	msg << MSG::DEBUG << "execute TrigT1CaloRun3TauFex" << endreq;
+	ATH_MSG_DEBUG( "execute TrigT1CaloRun3TauFex");
 #endif
 
 	CaloCellContainer* scells(0);
 	const xAOD::TriggerTowerContainer* TTs(0);
 	if ( getContainers(scells, TTs).isFailure() || (TTs==0) ) {
-		msg << MSG::WARNING << " Could not get containers" << endreq;
+		ATH_MSG_WARNING( " Could not get containers");
 		return StatusCode::SUCCESS;
 	}
 
@@ -128,11 +125,11 @@ StatusCode TrigT1CaloRun3TauFex::execute(){
 	clustersForTau->reserve(100);
 	std::string clusterName(m_outputClusterName);
 	if ( evtStore()->record(clustersForTau,clusterName).isFailure() ){
-		msg << MSG::ERROR  << "recording was not possible" << endreq;
+		ATH_MSG_ERROR( "recording was not possible");
 		return StatusCode::FAILURE;
 	}
 	if ( evtStore()->record(auxclustersForTau,clusterName+"Aux.").isFailure() ){
-		msg << MSG::ERROR << "recording Aux was not possible" << endreq;
+		ATH_MSG_ERROR( "recording Aux was not possible");
 		return StatusCode::FAILURE;
 	}
 
@@ -264,10 +261,10 @@ StatusCode TrigT1CaloRun3TauFex::execute(){
 	if (msgLvl(MSG::DEBUG)){
 	  for (int i=1;i<m_SupercellMapEM1_coarse->GetNbinsX()+1;i++){
 	    for (int j=1;j<m_SupercellMapEM1_coarse->GetNbinsY()+1;j++){
-	      msg << MSG::DEBUG <<"m_SupercellMapEM1_coarse->GetBinContent(" << i<<","<<j<<") "<< m_SupercellMapEM1_coarse->GetBinContent(i, j) << endmsg;
-	      msg << MSG::DEBUG <<"m_SupercellMapEM2_coarse->GetBinContent(" << i<<","<<j<<") "<< m_SupercellMapEM2_coarse->GetBinContent(i, j) << endmsg;
-	      msg << MSG::DEBUG <<"m_SupercellMapEM2_coarse->GetXaxis()->GetBinCenter("<< i<<") "<< m_SupercellMapEM2_coarse->GetXaxis()->GetBinCenter(i) << endmsg;
-	      msg << MSG::DEBUG <<"m_SupercellMapEM2_coarse->GetYaxis()->GetBinCenter("<< j<<") "<< m_SupercellMapEM2_coarse->GetYaxis()->GetBinCenter(j) << endmsg;
+	      ATH_MSG_DEBUG("m_SupercellMapEM1_coarse->GetBinContent(" << i<<","<<j<<") "<< m_SupercellMapEM1_coarse->GetBinContent(i, j) );
+	      ATH_MSG_DEBUG("m_SupercellMapEM2_coarse->GetBinContent(" << i<<","<<j<<") "<< m_SupercellMapEM2_coarse->GetBinContent(i, j) );
+	      ATH_MSG_DEBUG("m_SupercellMapEM2_coarse->GetXaxis()->GetBinCenter("<< i<<") "<< m_SupercellMapEM2_coarse->GetXaxis()->GetBinCenter(i) );
+	      ATH_MSG_DEBUG("m_SupercellMapEM2_coarse->GetYaxis()->GetBinCenter("<< j<<") "<< m_SupercellMapEM2_coarse->GetYaxis()->GetBinCenter(j) );
 	      }
 	    }
 	  }
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
index bd8b36bef389..424a1d210060 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloTauFex.cxx
@@ -67,8 +67,7 @@ TrigT1CaloTauFex::~TrigT1CaloTauFex(){
 
 StatusCode TrigT1CaloTauFex::initialize(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::INFO << "initialing TrigT1CaloTauFex" << endreq;
+	ATH_MSG_INFO( "initialing TrigT1CaloTauFex" );
 	if ( TrigT1CaloBaseFex::initialize().isFailure() ) return StatusCode::FAILURE;
 	if ( m_enableMon ){
 		std::string histoName(name());
@@ -78,15 +77,15 @@ StatusCode TrigT1CaloTauFex::initialize(){
 		// TODO: add here initialisation of other histos ...
 	}
 
-	msg << MSG::INFO << " REGTEST: TrigT1CaloTauFex configurations: " <<endreq;
-	msg << MSG::INFO << " REGTEST: EnableMonitoring			" << m_enableMon  <<endreq;
-        msg << MSG::INFO << " REGTEST: CellsEtThreholdGeV        	" << m_cellsEtThrehold  << " GeV" << endreq;
-	msg << MSG::INFO << " REGTEST: DoTruth	        		" << m_doTruth  <<endreq;
-	msg << MSG::INFO << " REGTEST: TruthMaxEta          		" << m_truth_maxEta_thr  <<endreq;
-        msg << MSG::INFO << " REGTEST: TruthMinPtGeV                    " << m_truth_minPt_thr << " GeV"  <<endreq;
-	msg << MSG::INFO << " REGTEST: NoiseSignificanceCore  " << m_NoiseSignificanceCore <<endreq;
-	msg << MSG::INFO << " REGTEST: NoiseSignificanceIso   " << m_NoiseSignificanceIso <<endreq;
-	msg << MSG::INFO << " REGTEST: OutputClusterName      " << m_outputClusterName <<endreq;
+	ATH_MSG_INFO( " REGTEST: TrigT1CaloTauFex configurations: ");
+	ATH_MSG_INFO( " REGTEST: EnableMonitoring			" << m_enableMon );
+        ATH_MSG_INFO( " REGTEST: CellsEtThreholdGeV        	" << m_cellsEtThrehold  << " GeV" );
+	ATH_MSG_INFO( " REGTEST: DoTruth	        		" << m_doTruth );
+	ATH_MSG_INFO( " REGTEST: TruthMaxEta          		" << m_truth_maxEta_thr );
+        ATH_MSG_INFO( " REGTEST: TruthMinPtGeV                    " << m_truth_minPt_thr << " GeV" );
+	ATH_MSG_INFO( " REGTEST: NoiseSignificanceCore  " << m_NoiseSignificanceCore);
+	ATH_MSG_INFO( " REGTEST: NoiseSignificanceIso   " << m_NoiseSignificanceIso);
+	ATH_MSG_INFO( " REGTEST: OutputClusterName      " << m_outputClusterName);
 
 	if(m_doTruth){
 	        m_true_nprong.reserve(200);
@@ -99,8 +98,7 @@ StatusCode TrigT1CaloTauFex::initialize(){
 }
 
 StatusCode TrigT1CaloTauFex::finalize(){
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing TrigT1CaloTauFex" << endreq;
+	ATH_MSG_DEBUG( "finalizing TrigT1CaloTauFex" );
 	if ( TrigT1CaloBaseFex::finalize().isFailure() ) return StatusCode::FAILURE;
 	if ( m_enableMon ) {
 		m_histFile->Write();
@@ -119,9 +117,8 @@ StatusCode TrigT1CaloTauFex::finalize(){
 
 StatusCode TrigT1CaloTauFex::execute(){
 	
-        MsgStream msg(msgSvc(), name());
 #ifndef NDEBUG
-	msg << MSG::DEBUG << "execute TrigT1CaloTauFex" << endreq;
+	ATH_MSG_DEBUG( "execute TrigT1CaloTauFex" );
 #endif
 
 	CaloCellContainer* scells(0);
@@ -129,18 +126,18 @@ StatusCode TrigT1CaloTauFex::execute(){
 	const xAOD::TruthParticleContainer *truthContainer(0);
 
 	if ( getContainers(scells, TTs, m_cellsEtThrehold).isFailure() || (TTs==0) || (scells==0) ) {
-		msg << MSG::WARNING << " Could not get scell or TT containers" << endreq;
+		ATH_MSG_WARNING( " Could not get scell or TT containers" );
 		return StatusCode::SUCCESS;
 	}
 
 	if(m_doTruth){ 
 		if ( getContainers(truthContainer).isFailure() || (truthContainer==0) ) {
-                	msg << MSG::WARNING << " Could not get truth containers" << endreq;
+                	ATH_MSG_WARNING( " Could not get truth containers" );
                 	return StatusCode::SUCCESS;
 		}	
         	Truth(truthContainer);
   		if(m_true_vistau.size()!=2){
-        		msg << MSG::WARNING << "Found " << m_true_vistau.size() << " instead of 2, skipping event" << endreq;
+        		ATH_MSG_WARNING( "Found " << m_true_vistau.size() << " instead of 2, skipping event" );
         		return StatusCode::SUCCESS;
   		}
         }
@@ -175,12 +172,12 @@ StatusCode TrigT1CaloTauFex::execute(){
 		// do this check before)
 		///if ( ! isCellEmMaximum ( m_cellsAround, cellAbove ) ) continue;
 		///float et = sumEmCells( m_cellsAround )/TMath::CosH(cellAbove->eta());
-		///msg << MSG::INFO << "Tau found at (eta,phi)=(" << etaCluster << "," << phiCluster << ") with ET of : " << et << endreq;
+		///ATH_MSG_INFO( "Tau found at (eta,phi)=(" << etaCluster << "," << phiCluster << ") with ET of : " << et );
 	}
 #ifndef NDEBUG
 	for (unsigned int i=0; i<m_RoI.size(); i++) {
 	//for( auto RoI : m_RoI ) {
-	  msg << MSG::INFO << "RoI in the loop=" << m_RoI.at(0).at(0) << endreq;
+	  ATH_MSG_INFO( "RoI in the loop=" << m_RoI.at(0).at(0) );
 	}
 #endif
 	return StatusCode::SUCCESS;
@@ -238,7 +235,6 @@ void TrigT1CaloTauFex::ExamineTruthTau(const xAOD::TruthParticle& xTruthParticle
 
 void TrigT1CaloTauFex::Truth(const xAOD::TruthParticleContainer *truthContainer) {
 
-  MsgStream msg(msgSvc(), name());
  
   m_true_vistau.clear();
   m_true_nprong.clear();
diff --git a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloforwEFex.cxx b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloforwEFex.cxx
index ce9057381a5e..078677aa4409 100644
--- a/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloforwEFex.cxx
+++ b/Trigger/TrigL1Upgrade/TrigL1CaloUpgrade/src/TrigT1CaloforwEFex.cxx
@@ -36,8 +36,7 @@ TrigT1CaloforwEFex::~TrigT1CaloforwEFex(){
 StatusCode TrigT1CaloforwEFex::initialize(){
 	
 	if ( TrigT1CaloBaseFex::initialize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "initializing TrigT1CaloforwEFex" << endreq;
+	ATH_MSG_DEBUG( "initializing TrigT1CaloforwEFex" );
         if ( m_enableMon ){
 		std::string histoName(name());
 		histoName+="Algo.root";
@@ -60,8 +59,7 @@ StatusCode TrigT1CaloforwEFex::initialize(){
 
 StatusCode TrigT1CaloforwEFex::finalize(){
 	if ( TrigT1CaloBaseFex::finalize().isFailure() ) return StatusCode::FAILURE;
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "finalizing TrigT1CaloforwEFex" << endreq;
+	ATH_MSG_DEBUG( "finalizing TrigT1CaloforwEFex" );
 	if ( m_enableMon ) {
 		m_histFile->Write();
 		m_histFile->Close();
@@ -71,13 +69,12 @@ StatusCode TrigT1CaloforwEFex::finalize(){
 
 StatusCode TrigT1CaloforwEFex::execute(){
 	
-        MsgStream msg(msgSvc(), name());
-	msg << MSG::DEBUG << "execute TrigT1CaloforwEFex" << endreq;
+	ATH_MSG_DEBUG( "execute TrigT1CaloforwEFex" );
 
 	CaloCellContainer* scells(0);
 	const xAOD::TriggerTowerContainer* TTs(0);
 	if ( getContainers(scells, TTs).isFailure() || (TTs==0) ) {
-		msg << MSG::WARNING << " Could not get containers" << endreq;
+		ATH_MSG_WARNING( " Could not get containers" );
 		return StatusCode::SUCCESS;
 	}
 
@@ -89,11 +86,11 @@ StatusCode TrigT1CaloforwEFex::execute(){
 	clusters->setStore(auxclusters);
 	std::string clusterName(m_outputClusterName);
 	if ( evtStore()->record(clusters,clusterName).isFailure() ){
-		msg << MSG::ERROR  << "recording was not possible" << endreq;
+		ATH_MSG_ERROR( "recording was not possible" );
 		return StatusCode::FAILURE;
 	}
 	if ( evtStore()->record(auxclusters,clusterName+"Aux.").isFailure() ){
-		msg << MSG::ERROR << "recording Aux was not possible" << endreq;
+		ATH_MSG_ERROR( "recording Aux was not possible" );
 		return StatusCode::FAILURE;
 	}
 	// Loop over seed cells, this should give us
@@ -146,8 +143,8 @@ StatusCode TrigT1CaloforwEFex::execute(){
 			else
 			m_testR_FCAL->Fill ( fabsf( zClusterN/zClusterNE ) );
 		}
-		msg << MSG::DEBUG << "CELL versus CLUSTER : " << cellAbove->eta() << " " << cellAbove->phi() << " " << etaCluster << " " << phiCluster << 
- " " << cellAbove->eta()-etaCluster << " " << cellAbove->phi()-phiCluster << endreq;
+		ATH_MSG_DEBUG( "CELL versus CLUSTER : " << cellAbove->eta() << " " << cellAbove->phi() << " " << etaCluster << " " << phiCluster << 
+ " " << cellAbove->eta()-etaCluster << " " << cellAbove->phi()-phiCluster );
 		// if find the cluster position fails, etaCluster=999.0
 		if ( etaCluster > 998.0 ) continue;
 		// other cluster sizes for some of the shower shapes
@@ -158,8 +155,8 @@ StatusCode TrigT1CaloforwEFex::execute(){
 		// do this check before)
 		if ( ! isCellEmMaximum ( m_cellsAround, cellAbove ) ) continue;
 		float et = sumEmCells( m_cellsAround )/TMath::CosH(cellAbove->eta());
-		float clusterEmEnergy32 = sumEmCells2nd( m_cellsAround2 );
-		float clusterEmEnergy72 = sumEmCells2nd( m_cellsAround );
+		//float clusterEmEnergy32 = sumEmCells2nd( m_cellsAround2 );
+		//float clusterEmEnergy72 = sumEmCells2nd( m_cellsAround );
 		float clusterHadEnergy = sumHadCells( m_cellsAround );
 		clusterHadEnergy += sumHadTTs( m_TTsAround );
 		//if ( clusterEmEnergy32 < 10 ) continue;
diff --git a/Trigger/TrigT1/TrigT1CTP/python/TrigT1CTP_EnableCTPEmulation.py b/Trigger/TrigT1/TrigT1CTP/python/TrigT1CTP_EnableCTPEmulation.py
index 3a95b850e769..89021dd65af3 100644
--- a/Trigger/TrigT1/TrigT1CTP/python/TrigT1CTP_EnableCTPEmulation.py
+++ b/Trigger/TrigT1/TrigT1CTP/python/TrigT1CTP_EnableCTPEmulation.py
@@ -21,6 +21,11 @@ def enableCTPEmulation(athSequence, setupOutput=False):
                                           RDOOutputLocation = "CTP_RDO_L1Run3",
                                           IsData = isData )
 
+    from TriggerMenu.l1menu.CaloDef import getRun3EFexParameterSelection
+    ctpEmulation.eFEXREta  = getRun3EFexParameterSelection('reta')
+    ctpEmulation.eFEXRHad  = getRun3EFexParameterSelection('rhad')
+    ctpEmulation.eFEXWStot = getRun3EFexParameterSelection('wstot')
+
     from AthenaCommon.Constants import DEBUG
     if simflags.EnableDebugOutput():
         ctpEmulation.OutputLevel = DEBUG
diff --git a/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.cxx b/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.cxx
index c6cd1ddd75a6..9c5e0bb1f418 100644
--- a/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.cxx
+++ b/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.cxx
@@ -26,9 +26,39 @@
 #include <iomanip>
 #include <algorithm>
 #include <cmath>
+#include <sstream>
+
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
+
 
 using namespace TrigConf;
 
+const LVL1CTP::CTPEmulation::eFEXParWP::WPEntry &
+LVL1CTP::CTPEmulation::eFEXParWP::getWP(int ieta) const {
+   int current_priority = -1;
+   const WPEntry * retVal { nullptr };
+   for( const auto & rv : entries ) {
+      if( ieta >= rv.etamax or ieta < rv.etamin ) // outside the window
+         continue;
+      if(int(rv.priority) < current_priority)
+         continue;
+      if(int(rv.priority) == current_priority) {
+         throw std::runtime_error("CTPEmulation: found two eFEX WP with the same priority " + std::to_string(rv.priority)
+                                  + " for eta = " + std::to_string(ieta));
+      }
+      current_priority = (int)rv.priority;
+      retVal = & rv;
+   }
+   if( retVal == nullptr ) {
+      throw std::runtime_error("CTPEmulation: no eFEX WP found with eta = " + std::to_string(ieta));
+   }
+   return * retVal;
+}
+
+
+
 LVL1CTP::CTPEmulation::CTPEmulation( const std::string& name, ISvcLocator* pSvcLocator ) :
    AthAlgorithm ( name, pSvcLocator ), 
    m_histSvc ("THistSvc", name),
@@ -44,7 +74,7 @@ LVL1CTP::CTPEmulation::CTPEmulation( const std::string& name, ISvcLocator* pSvcL
    declareProperty( "TrigConfigSvc", m_configSvc, "Trigger configuration service");
 
    declareProperty( "UseCTPInputFromData", m_useCTPInput, "Set true if using CTP input objects from the various L1 simulations");
-   declareProperty( "UseCTPInputFromData", m_useROIBOutput, "Set to true the ROIBResult should be used for Run 2 data (not likely)");
+   declareProperty( "UseROIBOutput", m_useROIBOutput, "Set to true the ROIBResult should be used for Run 2 data (not likely)");
 
    // input data
    declareProperty( "gFEXMETPufitInput", m_gFEXMETPufitLoc, "StoreGate location of gFEX PUfit MET input" );
@@ -69,6 +99,10 @@ LVL1CTP::CTPEmulation::CTPEmulation( const std::string& name, ISvcLocator* pSvcL
    declareProperty( "RDOOutputLocation", m_rdoOutputLoc, "StoreGate location of CTP RDO (sim)" );
    declareProperty( "RDOOutputRerunLocation", m_rdoOutputLoc_Rerun, "StoreGate location of rerun CTP RDO (data)" );
 
+   declareProperty( "eFEXREta", m_eFEXREta , "Defines the eEM shower parameter R_eta  selection " );
+   declareProperty( "eFEXRHad", m_eFEXRHad , "Defines the eEM shower parameter R_had selection" );
+   declareProperty( "eFEXWStot", m_eFEXWStot, "Defines the eEM shower parameter W_Stot selection" );
+
    m_decoder = new LVL1::CPRoIDecoder();
    m_jetDecoder = new LVL1::JEPRoIDecoder();
 }
@@ -77,11 +111,62 @@ LVL1CTP::CTPEmulation::CTPEmulation( const std::string& name, ISvcLocator* pSvcL
 LVL1CTP::CTPEmulation::~CTPEmulation()
 {}
 
+StatusCode
+LVL1CTP::CTPEmulation::setEFexConfig(const std::string & prop, std::map<unsigned int, eFEXParWP> & cfgMap) {
+   // fill eFEX selection cuts object
+   cfgMap.clear();
+
+   boost::property_tree::ptree data;
+   std::string _prop(prop);
+   std::replace( _prop.begin(), _prop.end(), '\'', '"');
+   try {
+      std::istringstream is(_prop);
+      boost::property_tree::read_json(is, data);
+   }
+   catch(std::exception & ex) {
+      ATH_MSG_FATAL("Could not read property " << _prop  << ".  "  << ex.what());
+      return StatusCode::FAILURE;
+   }
+
+   try {
+      for( auto & wp : data ) {
+         unsigned int index = 0;
+         
+         if( wp.first == "LOOSE" ) {
+            index = 1;
+         } else if( wp.first == "MEDIUM" ) {
+            index = 2;
+         } else if( wp.first == "TIGHT" ) {
+            index = 3;
+         } else {
+            ATH_MSG_ERROR("WP name must be LOOSE, MEDIUM or TIGHT, but got " << wp.first);
+            return StatusCode::FAILURE;
+         }
+         for( auto & entry : wp.second ) {
+            eFEXParWP::WPEntry e;
+            e.etamin = entry.second.get<int>("etamin");
+            e.etamax = entry.second.get<int>("etamax");
+            e.value = entry.second.get<float>("value");
+            e.maxEt = entry.second.get<unsigned int>("maxEt");
+            cfgMap[index].entries.push_back(e);
+         }
+      }
+   }
+   catch(std::exception & ex) {
+      ATH_MSG_FATAL("Could not interpret property " << _prop  << ".  "  << ex.what());
+      return StatusCode::FAILURE;
+   }
+   return StatusCode::SUCCESS;
+}
 
 StatusCode
 LVL1CTP::CTPEmulation::initialize() {
 
    CHECK(m_configSvc.retrieve());
+
+   CHECK( setEFexConfig(m_eFEXREta , m_reta ) );
+   CHECK( setEFexConfig(m_eFEXRHad , m_rhad ) );
+   CHECK( setEFexConfig(m_eFEXWStot, m_wstot) );
    
    if ( m_useROIBOutput ) {
       CHECK(m_lvl1Tool.retrieve());
@@ -264,16 +349,28 @@ LVL1CTP::CTPEmulation::bookHists() {
    histpath = histBasePath() + "/input/MET/";
    CHECK ( m_histSvc->regHist( histpath + "Pufit",    new TH1I("MET_Pufit","Missing ET from algorithm pufit", 40, 0, 80)) );
    CHECK ( m_histSvc->regHist( histpath + "PufitPhi", new TH1I("MET_PufitPhi","Missing ET PUfit phi", 64, -3.2, 3.2)) );
-   CHECK ( m_histSvc->regHist( histpath + "Rho",      new TH1I("MET_Rho","Missing ET from algorithm rhosub", 40, 0, 80)) );
+   CHECK ( m_histSvc->regHist( histpath + "Rho",      new TH1I("MET_Rho","Missing ET from algorithm rhosub", 40, 0, 80)) ); 
    CHECK ( m_histSvc->regHist( histpath + "RhoPhi",   new TH1I("MET_RhoPhi","Missing ET rhosub phi", 64, -3.2, 3.2)) );
    CHECK ( m_histSvc->regHist( histpath + "JwoJ",     new TH1I("MET_JwoJ","Missing ET from algorithm jet without jets", 40, 0, 80)) );
    CHECK ( m_histSvc->regHist( histpath + "JwoJPhi",  new TH1I("MET_JwoJPhi","Missing ET jet without jet phi", 64, -3.2, 3.2)) );
 
    // cluster
    histpath = histBasePath() + "/input/em/";
-   CHECK ( m_histSvc->regHist( histpath + "et",  new TH1I("et","Cluster et", 40, 0, 40)) );
-   CHECK ( m_histSvc->regHist( histpath + "eta", new TH1I("eta","Cluster eta ", 64, -3.2, 3.2)) );
-   CHECK ( m_histSvc->regHist( histpath + "phi", new TH1I("phi","Cluster phi", 64, -3.2, 3.2)) );
+   CHECK ( m_histSvc->regHist( histpath + "et",  new TH1I("et","eFEX cluster et", 40, 0, 40)) );
+   CHECK ( m_histSvc->regHist( histpath + "eta", new TH1I("eta","eFEX cluster eta ", 64, -3.2, 3.2)) );
+   CHECK ( m_histSvc->regHist( histpath + "phi", new TH1I("phi","eFEX cluster phi", 64, -3.2, 3.2)) );
+   CHECK ( m_histSvc->regHist( histpath + "reta", new TH1I("reta","eFEX Cluster R_{#eta}", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "rhad", new TH1I("rhad","eFEX cluster R_{had}", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "wstot", new TH1I("wstot","eFEX cluster W_{Stot}", 40, 0, 10)) );
+   CHECK ( m_histSvc->regHist( histpath + "retaloose", new TH1I("retaloose","eFEX Cluster R_{#eta} passing loose R_{#eta} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "rhadloose", new TH1I("rhadloose","eFEX cluster R_{had} passing loose R_{had} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "wstotloose", new TH1I("wstotloose","eFEX cluster W_{Stot} passing loose W_{Stot} selection", 40, 0, 10)) );
+   CHECK ( m_histSvc->regHist( histpath + "retamedium", new TH1I("retamedium","eFEX Cluster R_{#eta} passing medium R_{#eta} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "rhadmedium", new TH1I("rhadmedium","eFEX cluster R_{had} passing medium R_{had} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "wstotmedium", new TH1I("wstotmedium","eFEX cluster W_{Stot} passing medium W_{Stot} selection", 40, 0, 10)) );
+   CHECK ( m_histSvc->regHist( histpath + "retatight", new TH1I("retatight","eFEX Cluster R_{#eta} passing tight R_{#eta} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "rhadtight", new TH1I("rhadtight","eFEX cluster R_{had} passing tight R_{had} selection", 44, 0, 1.1)) );
+   CHECK ( m_histSvc->regHist( histpath + "wstottight", new TH1I("wstottight","eFEX cluster W_{Stot} passing tight W_{Stot} selection", 40, 0, 10)) );
 
    // tau
    histpath = histBasePath() + "/input/tau/";
@@ -528,14 +625,79 @@ LVL1CTP::CTPEmulation::fillInputHistograms() {
    CHECK ( m_histSvc->getHist( histBasePath() + "/input/MET/JwoJ", h) ); if(h) h->Fill(m_gFEXMETJwoJ->energyT()/1000.);
    CHECK ( m_histSvc->getHist( histBasePath() + "/input/MET/JwoJPhi", h) ); if(h) h->Fill(atan2(m_gFEXMETJwoJ->energyX(), m_gFEXMETJwoJ->energyY()));
 
-   // EM cluster
-   CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/et", h1) );
-   CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/eta", h2) );
-   CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/phi", h3) );
-   for( const auto & cl : *m_eFEXCluster ) {
-      h1->Fill(cl->et());
-      h2->Fill(cl->eta());
-      h3->Fill(cl->phi());
+   // eFEX EM cluster
+   {
+      static const size_t LOOSE = 1;
+      static const size_t MEDIUM = 2;
+      static const size_t TIGHT = 3;
+      TH1 *hl1 (nullptr ), *hl2 ( nullptr ),  *hl3 ( nullptr ),
+         *hm1 ( nullptr ), *hm2 ( nullptr ), *hm3 ( nullptr ),
+         *ht1 ( nullptr ),  *ht2 ( nullptr ), *ht3 ( nullptr );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/et", h1) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/eta", h2) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/phi", h3) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/reta", h4) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/rhad", h5) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/wstot", h6) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/retaloose", hl1) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/rhadloose", hl2) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/wstotloose", hl3) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/retamedium", hm1) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/rhadmedium", hm2) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/wstotmedium", hm3) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/retatight", ht1) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/rhadtight", ht2) );
+      CHECK ( m_histSvc->getHist( histBasePath() + "/input/em/wstottight", ht3) );
+      const static SG::AuxElement::ConstAccessor<float> retaAcc ("Run3REta");
+      const static SG::AuxElement::ConstAccessor<float> rhadAcc ("Run3RHad");
+      for( const auto & cl : *m_eFEXCluster ) {
+         float reta = retaAcc(*cl);
+         float rhad = rhadAcc(*cl);
+         float eta = cl->eta();
+         int ieta = int((eta + (eta>0 ? 0.005 : -0.005))/0.1);
+         h1->Fill(cl->et());
+         h2->Fill(cl->eta());
+         h3->Fill(cl->phi());
+         h4->Fill(reta);
+         h5->Fill(rhad);
+         h6->Fill(cl->wstot());
+         {
+            auto & wp = m_reta.at(LOOSE).getWP(ieta);
+            if( reta >= wp.value or cl->et() >= wp.maxEt ) { hl1->Fill(reta); }
+         }
+         {
+            auto & wp = m_reta.at(MEDIUM).getWP(ieta);
+            if( reta >= wp.value or cl->et() >= wp.maxEt ) { hm1->Fill(reta); }
+         }
+         {
+            auto & wp = m_reta.at(TIGHT).getWP(ieta);
+            if( reta >= wp.value or cl->et() >= wp.maxEt ) { ht1->Fill(reta); }
+         }
+         {
+            auto & wp = m_rhad.at(LOOSE).getWP(ieta);
+            if( rhad >= wp.value or cl->et() >= wp.maxEt ) { hl2->Fill(rhad); }
+         }
+         {
+            auto & wp = m_rhad.at(MEDIUM).getWP(ieta);
+            if( rhad >= wp.value or cl->et() >= wp.maxEt ) { hm2->Fill(rhad); }
+         }
+         {
+            auto & wp = m_rhad.at(TIGHT).getWP(ieta);
+            if( rhad >= wp.value or cl->et() >= wp.maxEt ) { ht2->Fill(rhad); }
+         }
+         {
+            auto & wp = m_wstot.at(LOOSE).getWP(ieta);
+            if( cl->wstot() >= wp.value or cl->et() >= wp.maxEt ) { hl3->Fill(cl->wstot()); }
+         }
+         {
+            auto & wp = m_wstot.at(MEDIUM).getWP(ieta);
+            if( cl->wstot() >= wp.value or cl->et() >= wp.maxEt ) { hm3->Fill(cl->wstot()); }
+         }
+         {
+            auto & wp = m_wstot.at(TIGHT).getWP(ieta);
+            if( cl->wstot() >= wp.value or cl->et() >= wp.maxEt ) { ht3->Fill(cl->wstot()); }
+         }
+      }
    }
 
    // eFEX Tau
@@ -842,6 +1004,9 @@ unsigned int
 LVL1CTP::CTPEmulation::calculateEMMultiplicity( const TrigConf::TriggerThreshold * confThr ) const {
    unsigned int multiplicity = 0;
 
+   const static SG::AuxElement::ConstAccessor<float> reta ("Run3REta");
+   const static SG::AuxElement::ConstAccessor<float> rhad ("Run3RHad");
+
    if ( confThr->name()[0]=='e' ) { 
       // new EM threshold from eFEX
       for ( const auto & cl : * m_eFEXCluster ) {
@@ -854,6 +1019,49 @@ LVL1CTP::CTPEmulation::calculateEMMultiplicity( const TrigConf::TriggerThreshold
          float scale = 1; // eFEX clusters in 21.3 have an energy scale of 1 GeV
 
          bool clusterPasses = ( ((unsigned int) cl->et()) > thrV->ptcut()*scale ); // need to add cut on isolation and other variables, once available
+         if(clusterPasses) {
+            const TrigConf::ClusterThresholdValue * clThrV = dynamic_cast<const TrigConf::ClusterThresholdValue*> ( thrV );
+            // now check the isolation
+            if ( clThrV && clThrV->isolationMask() > 0) {
+               auto isoMask = clThrV->isolationMask();
+               static const uint16_t BITMASK_OFFSET_RETA = 4; // this is a convetion which is adapted only for 21.3 based studies of the new eFEX EM thresholds
+               static const uint16_t BITMASK_OFFSET_RHAD = 2;
+               static const uint16_t BITMASK_OFFSET_WSTOT = 0;
+
+               unsigned int selection_reta = ((isoMask >> BITMASK_OFFSET_RETA) & 0x3);
+               unsigned int selection_rhad = ((isoMask >> BITMASK_OFFSET_RHAD) & 0x3);
+               unsigned int selection_wstot = ((isoMask >> BITMASK_OFFSET_WSTOT) & 0x3);
+               std::cout << "JOERG new thr " << confThr->name() << " has isolation defined: " << clThrV->isolationMask()
+                         << " reta " << selection_reta << ", rhad " << selection_rhad << ", wstot " << selection_wstot << std::endl;
+               if( selection_reta>0 ) {
+                  auto & wp = m_reta.at(selection_reta).getWP(ieta);
+                  if( (cl->et() < wp.maxEt) && reta(*cl) < wp.value) {
+                     clusterPasses = false;
+                     std::cout << "JOERG Fails reta" << std::endl;
+                  } else {
+                     std::cout << "JOERG Passes reta" << std::endl;
+                  }
+               }
+               if( clusterPasses && selection_rhad>0 ) {
+                  auto & wp = m_rhad.at(selection_rhad).getWP(ieta);
+                  if( (cl->et() < wp.maxEt) && rhad(*cl) < wp.value) {
+                     clusterPasses = false;
+                     std::cout << "JOERG Fails rhad" << std::endl;
+                  } else {
+                     std::cout << "JOERG Passes rhad" << std::endl;
+                  }
+               }
+               if( clusterPasses && selection_wstot>0 ) {
+                  auto & wp = m_wstot.at(selection_wstot).getWP(ieta);
+                  if( (cl->et() < wp.maxEt) && cl->wstot() < wp.value) {
+                     clusterPasses = false;
+                     std::cout << "JOERG Fails wstot" << std::endl;
+                  } else {
+                     std::cout << "JOERG Passes wstot" << std::endl;
+                  }
+               }
+            }
+         }
          multiplicity +=  clusterPasses ? 1 : 0;
       }
    } else {
diff --git a/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.h b/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.h
index 7f0ee1cad14e..e3bfe5cd0d29 100644
--- a/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.h
+++ b/Trigger/TrigT1/TrigT1CTP/src/CTPEmulation.h
@@ -74,6 +74,19 @@ namespace LVL1CTP {
 
       virtual StatusCode bookHists();
 
+   private:
+      struct eFEXParWP {
+         struct WPEntry {
+            int etamin {-49};
+            int etamax {49};
+            float value {0.0};
+            unsigned int maxEt {0};
+            int priority {1};
+         };
+         std::vector<WPEntry> entries;
+         const WPEntry & getWP(int ieta) const;
+      };
+
    private:
 
       // private member functions
@@ -108,6 +121,8 @@ namespace LVL1CTP {
          return "/" + m_histStream + "/CTPEmulation";
       }
 
+      // fill eFEX selection cuts object
+      StatusCode setEFexConfig(const std::string & prop, std::map<unsigned int, eFEXParWP> & cfgMap);
 
       // member variables
 
@@ -123,16 +138,12 @@ namespace LVL1CTP {
       const DataHandle< xAOD::EnergySumRoI >    m_gFEXMETRho;     //!< MET from gFEX
       const DataHandle< xAOD::EnergySumRoI >    m_gFEXMETJwoJ;    //!< MET from gFEX
       const DataHandle< xAOD::JetRoIContainer > m_gJet;           //!< jets from gFEX 
-
       // eFEX
       const DataHandle< xAOD::TrigEMClusterContainer > m_eFEXCluster; //!< cluster from eFEX
       const DataHandle< xAOD::EmTauRoIContainer > m_eFEXTau; //!< taus from eFEX
-
       // jFEX
       const DataHandle< xAOD::JetRoIContainer > m_jJet;           //!< jets from jFEX 
       const DataHandle< xAOD::JetRoIContainer > m_jLJet;          //!< large jets from jFEX 
-
-
       // Inputs from old L1Calo and L1Muon
       // from MC
       const DataHandle< xAOD::MuonRoIContainer > m_muonRoIs;
@@ -142,7 +153,6 @@ namespace LVL1CTP {
       const DataHandle< LVL1::JetCTP >           m_jetCTP;           //!< Jet input
       const DataHandle< LVL1::EnergyCTP >        m_energyCTP;        //!< Energy input
       const DataHandle< LVL1::FrontPanelCTP >    m_topoCTP;          //!< Topo input
-
       // from data
       const ROIB::RoIBResult * m_roibResult { nullptr };
 
@@ -152,7 +162,6 @@ namespace LVL1CTP {
       BooleanProperty m_useROIBOutput { false };
 
       // name of input collections
-
       // new FEX collections
       StringProperty m_gFEXMETPufitLoc {"gXEPUFIT_MET"};
       StringProperty m_gFEXMETRhoLoc {"gXERHO_MET"};
@@ -162,14 +171,12 @@ namespace LVL1CTP {
       StringProperty m_jLJetLoc {"jRoundLargeRJets"};
       StringProperty m_eFEXClusterLoc {"SClusterCl"};
       StringProperty m_eFEXTauLoc {"SClusterTau"};
-
       // name of the CTP input words
       StringProperty m_muonCTPLoc   { LVL1MUCTPI::DEFAULT_MuonCTPLocation};
       StringProperty m_emtauCTPLoc  { LVL1::TrigT1CaloDefs::EmTauCTPLocation };
       StringProperty m_jetCTPLoc    { LVL1::TrigT1CaloDefs::JetCTPLocation };
       StringProperty m_energyCTPLoc { LVL1::TrigT1CaloDefs::EnergyCTPLocation };
       StringProperty m_topoCTPLoc   { LVL1::DEFAULT_L1TopoCTPLocation };
-
       // output locations and control
       BooleanProperty m_isData { false };
       StringProperty m_roiOutputLoc { LVL1CTP::DEFAULT_CTPSLinkLocation };
@@ -177,6 +184,15 @@ namespace LVL1CTP {
       StringProperty m_rdoOutputLoc { LVL1CTP::DEFAULT_RDOOutputLocation };
       StringProperty m_rdoOutputLoc_Rerun { LVL1CTP::DEFAULT_RDOOutputLocation_Rerun };
 
+      // property defining the eFEX parameters
+      StringProperty m_eFEXREta { "" };
+      StringProperty m_eFEXRHad { "" };
+      StringProperty m_eFEXWStot { "" };
+      std::map<unsigned int, eFEXParWP> m_reta;
+      std::map<unsigned int, eFEXParWP> m_rhad;
+      std::map<unsigned int, eFEXParWP> m_wstot;
+
+
       std::string m_histStream {"EXPERT"};
 
       // internal
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
index d6967095d85b..13de789b5dee 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/CaloDef.py
@@ -1,7 +1,29 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
+def getRun3EFexParameterSelection( parameter ):
+    if parameter == 'reta':
+        return str({
+            "LOOSE" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.12, "maxEt" : 60 }],
+            "MEDIUM" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.12, "maxEt" : 60 }],
+            "TIGHT" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.12, "maxEt" : 60 }]
+        })
+    elif parameter == 'rhad':
+        return str({
+            "LOOSE" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.16, "maxEt" : 60 }],
+            "MEDIUM" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.16, "maxEt" : 60 }],
+            "TIGHT" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.16, "maxEt" : 60 }]
+        })
+    elif parameter == 'wstot':
+        return str({
+            "LOOSE" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.02, "maxEt" : 60 }],
+            "MEDIUM" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.02, "maxEt" : 60 }],
+            "TIGHT" : [{ "etamin" : -49, "etamax" : 49, "value" : 0.02, "maxEt" : 60 }]
+        })
+    else:
+        raise RuntimeError("No Run3 EFex settings available for parameter %s" % parameter )
+
 class CaloDef:
 
     @staticmethod
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
index a771104ae33d..76ff5b2510a9 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ThresholdDef.py
@@ -67,15 +67,7 @@ class ThresholdDef:
             .addThrValue(5, -15, -14, priority=2).addThrValue(5, 14, 15, priority=2)\
             .addThrValue(7, -18, -15, priority=2).addThrValue(7, 15, 18, priority=2)\
             .addThrValue(8, -25, -18, priority=2).addThrValue(8, 18, 25, priority=2)
-        
-        tc.registerThr( 'eEM8VH', type='EM', run=3).addThrValue(9, priority=1)\
-            .addThrValue(9, -8, 0, priority=2).addThrValue(9, 0, 8, priority=2)\
-            .addThrValue(7, -11, -8, priority=2).addThrValue(7, 8, 11, priority=2)\
-            .addThrValue(6, -14, -11, priority=2).addThrValue(6, 11, 14, priority=2)\
-            .addThrValue(5, -15, -14, priority=2).addThrValue(5, 14, 15, priority=2)\
-            .addThrValue(7, -18, -15, priority=2).addThrValue(7, 15, 18, priority=2)\
-            .addThrValue(8, -25, -18, priority=2).addThrValue(8, 18, 25, priority=2)
-        
+
         tc.registerThr( 'EM10VH', type='EM').addThrValue(11, priority=1)\
             .addThrValue(11, -8, 0, priority=2).addThrValue(11, 0, 8, priority=2)\
             .addThrValue(9, -11, -8, priority=2).addThrValue(9, 8, 11, priority=2)\
@@ -93,15 +85,7 @@ class ThresholdDef:
                 .addThrValue(7, -15, -14, priority=2).addThrValue(7, 14, 15, priority=2)\
                 .addThrValue(9, -18, -15, priority=2).addThrValue(9, 15, 18, priority=2)\
                 .addThrValue(10, -25, -18, priority=2).addThrValue(10, 18, 25, priority=2)
-        
-        tc.registerThr( 'eEM10VH', type='EM', run=3).addThrValue(11, priority=1)\
-            .addThrValue(11, -8, 0, priority=2).addThrValue(11, 0, 8, priority=2)\
-            .addThrValue(9, -11, -8, priority=2).addThrValue(9, 8, 11, priority=2)\
-            .addThrValue(8, -14, -11, priority=2).addThrValue(8, 11, 14, priority=2)\
-            .addThrValue(7, -15, -14, priority=2).addThrValue(7, 14, 15, priority=2)\
-            .addThrValue(9, -18, -15, priority=2).addThrValue(9, 15, 18, priority=2)\
-            .addThrValue(10, -25, -18, priority=2).addThrValue(10, 18, 25, priority=2)
-        
+
         tc.registerThr( 'EM13VH', type='EM').addThrValue(15, priority=1)\
             .addThrValue(15, -7, 0, priority=2).addThrValue(15, 0, 7, priority=2)\
             .addThrValue(14, -9, -7, priority=2).addThrValue(14, 7, 9, priority=2)\
@@ -119,16 +103,7 @@ class ThresholdDef:
             .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
             .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
             .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)  
-      
-        tc.registerThr( 'eEM15VH', type='EM', run=3).addThrValue(17, priority=1)\
-            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
-            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
-            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
-            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
-            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
-            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
-            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)  
-      
+
         tc.registerThr( 'EM18VH', type='EM').addThrValue(20, priority=1)\
             .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
             .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
@@ -149,16 +124,6 @@ class ThresholdDef:
             .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
             .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)       
 
-        tc.registerThr( 'eEM20VH', type='EM', run=3).addThrValue(22, priority=1)\
-            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
-            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
-            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
-            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
-            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
-            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
-            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
-            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)       
-
         # I section
 
         ThresholdValue.setDefaults('EM', {'isobits' : '00010', 'use_relIso' : True })
@@ -208,15 +173,6 @@ class ThresholdDef:
             .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
             .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
 
-        tc.registerThr( 'eEM15VHI', type='EM', run=3).addThrValue(17, priority=1)\
-            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
-            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
-            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
-            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
-            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
-            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
-            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
-
         for thrV in [15]:
            tc.registerThr('EM%iHI' % thrV, 'EM').addThrValue(thrV)
 
@@ -230,16 +186,6 @@ class ThresholdDef:
             .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
             .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
 
-        tc.registerThr( 'eEM18VHI', type='EM', run=3).addThrValue(20, priority=1)\
-            .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
-            .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
-            .addThrValue(18, -11, -8, priority=2).addThrValue(18, 8, 11, priority=2)\
-            .addThrValue(17, -13, -11, priority=2).addThrValue(17, 11, 13, priority=2)\
-            .addThrValue(16, -14, -13, priority=2).addThrValue(16, 13, 14, priority=2)\
-            .addThrValue(15, -15, -14, priority=2).addThrValue(15, 14, 15, priority=2)\
-            .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
-            .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
-
         tc.registerThr( 'EM20VHI', type='EM').addThrValue(22, priority=1)\
             .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
             .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
@@ -250,16 +196,6 @@ class ThresholdDef:
             .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
             .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
 
-        tc.registerThr( 'eEM20VHI', type='EM', run=3).addThrValue(22, priority=1)\
-            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
-            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
-            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
-            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
-            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
-            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
-            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
-            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
-
         tc.registerThr( 'EM22VHI', type='EM').addThrValue(24, priority=1)\
             .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
             .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
@@ -269,17 +205,7 @@ class ThresholdDef:
             .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
             .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
             .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
-        
-        tc.registerThr( 'eEM22VHI', type='EM', run=3).addThrValue(24, priority=1)\
-            .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
-            .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
-            .addThrValue(22, -11, -8, priority=2).addThrValue(22, 8, 11, priority=2)\
-            .addThrValue(21, -13, -11, priority=2).addThrValue(21, 11, 13, priority=2)\
-            .addThrValue(20, -14, -13, priority=2).addThrValue(20, 13, 14, priority=2)\
-            .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
-            .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
-            .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
-        
+
         tc.registerThr( 'EM24VHI', type='EM').addThrValue(24, priority=1)\
             .addThrValue(26, -7, 0, priority=2).addThrValue(26, 0, 7, priority=2)\
             .addThrValue(25, -8, -7, priority=2).addThrValue(25, 7, 8, priority=2)\
@@ -289,7 +215,7 @@ class ThresholdDef:
             .addThrValue(21, -15, -14, priority=2).addThrValue(21, 14, 15, priority=2)\
             .addThrValue(23, -17, -15, priority=2).addThrValue(23, 15, 17, priority=2)\
             .addThrValue(25, -25, -17, priority=2).addThrValue(25, 17, 25, priority=2)
-       
+
         tc.registerThr( 'EM26VHI', type='EM').addThrValue(26, priority=1)\
             .addThrValue(28, -7, 0, priority=2).addThrValue(28, 0, 7, priority=2)\
             .addThrValue(27, -8, -7, priority=2).addThrValue(27, 7, 8, priority=2)\
@@ -299,7 +225,7 @@ class ThresholdDef:
             .addThrValue(23, -15, -14, priority=2).addThrValue(23, 14, 15, priority=2)\
             .addThrValue(25, -17, -15, priority=2).addThrValue(25, 15, 17, priority=2)\
             .addThrValue(27, -25, -17, priority=2).addThrValue(27, 17, 25, priority=2)
-       
+
         tc.registerThr( 'EM30VHI', type='EM').addThrValue(30, priority=1)\
             .addThrValue(32, -7, 0, priority=2).addThrValue(32, 0, 7, priority=2)\
             .addThrValue(31, -8, -7, priority=2).addThrValue(31, 7, 8, priority=2)\
@@ -313,6 +239,82 @@ class ThresholdDef:
 
         tc.registerThr( 'EM3HI', type='EM').addThrValue(3, priority=1)\
 
+        # eEFEX thresholds
+
+        ThresholdValue.setDefaults('EM', {'isobits' : '000100', 'use_relIso' : True })
+        tc.registerThr( 'eEM8VH', type='EM', run=3).addThrValue(9, priority=1)\
+            .addThrValue(9, -8, 0, priority=2).addThrValue(9, 0, 8, priority=2)\
+            .addThrValue(7, -11, -8, priority=2).addThrValue(7, 8, 11, priority=2)\
+            .addThrValue(6, -14, -11, priority=2).addThrValue(6, 11, 14, priority=2)\
+            .addThrValue(5, -15, -14, priority=2).addThrValue(5, 14, 15, priority=2)\
+            .addThrValue(7, -18, -15, priority=2).addThrValue(7, 15, 18, priority=2)\
+            .addThrValue(8, -25, -18, priority=2).addThrValue(8, 18, 25, priority=2)
+        tc.registerThr( 'eEM10VH', type='EM', run=3).addThrValue(11, priority=1)\
+            .addThrValue(11, -8, 0, priority=2).addThrValue(11, 0, 8, priority=2)\
+            .addThrValue(9, -11, -8, priority=2).addThrValue(9, 8, 11, priority=2)\
+            .addThrValue(8, -14, -11, priority=2).addThrValue(8, 11, 14, priority=2)\
+            .addThrValue(7, -15, -14, priority=2).addThrValue(7, 14, 15, priority=2)\
+            .addThrValue(9, -18, -15, priority=2).addThrValue(9, 15, 18, priority=2)\
+            .addThrValue(10, -25, -18, priority=2).addThrValue(10, 18, 25, priority=2)
+        tc.registerThr( 'eEM15VH', type='EM', run=3).addThrValue(17, priority=1)\
+            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
+            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
+            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
+            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
+            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
+            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
+            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
+        tc.registerThr( 'eEM20VH', type='EM', run=3).addThrValue(22, priority=1)\
+            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
+            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
+            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
+            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
+            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
+            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
+            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
+            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
+
+        ThresholdValue.setDefaults('EM', {'isobits' : '000101', 'use_relIso' : True })
+
+        tc.registerThr( 'eEM15VHI', type='EM', run=3).addThrValue(17, isobits="000101", priority=1)\
+            .addThrValue(17,  -7,   0, isobits="000101", priority=2).addThrValue(17,  0,  7, isobits="000101", priority=2)\
+            .addThrValue(16,  -9,  -7, isobits="000101", priority=2).addThrValue(16,  7,  9, isobits="000101", priority=2)\
+            .addThrValue(15, -12,  -9, isobits="000101", priority=2).addThrValue(15,  9, 12, isobits="000101", priority=2)\
+            .addThrValue(14, -14, -12, isobits="000101", priority=2).addThrValue(14, 12, 14, isobits="000101", priority=2)\
+            .addThrValue(13, -15, -14, isobits="000101", priority=2).addThrValue(13, 14, 15, isobits="000101", priority=2)\
+            .addThrValue(15, -17, -15, isobits="000101", priority=2).addThrValue(15, 15, 17, isobits="000101", priority=2)\
+            .addThrValue(16, -25, -17, isobits="000101", priority=2).addThrValue(16, 17, 25, isobits="000101", priority=2)
+        tc.registerThr( 'eEM18VHI', type='EM', run=3).addThrValue(20, priority=1)\
+            .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
+            .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
+            .addThrValue(18, -11, -8, priority=2).addThrValue(18, 8, 11, priority=2)\
+            .addThrValue(17, -13, -11, priority=2).addThrValue(17, 11, 13, priority=2)\
+            .addThrValue(16, -14, -13, priority=2).addThrValue(16, 13, 14, priority=2)\
+            .addThrValue(15, -15, -14, priority=2).addThrValue(15, 14, 15, priority=2)\
+            .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
+            .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
+        tc.registerThr( 'eEM20VHI', type='EM', run=3).addThrValue(22, priority=1)\
+            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
+            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
+            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
+            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
+            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
+            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
+            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
+            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
+        tc.registerThr( 'eEM22VHI', type='EM', run=3).addThrValue(24, priority=1)\
+            .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
+            .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
+            .addThrValue(22, -11, -8, priority=2).addThrValue(22, 8, 11, priority=2)\
+            .addThrValue(21, -13, -11, priority=2).addThrValue(21, 11, 13, priority=2)\
+            .addThrValue(20, -14, -13, priority=2).addThrValue(20, 13, 14, priority=2)\
+            .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
+            .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
+            .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
+
+
+
+
 
         #ThresholdValue.setDefaults('EM', {'etamin' : 16,'etamax' : 20, 'phimin' : 0,'phimax' : 64, 'isobits' : '00000', 'use_relIso' : True })
         #tc.registerThr('EM20A', 'EM').addThrValue(20)
-- 
GitLab