From 7443fc17a9046d8a3c19011fe061edf413856ba2 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 22 Feb 2019 20:28:01 +0100
Subject: [PATCH] CaloIdentifier: Remove references to
 ExpandedIdentifier::last_error.

Error handling using ExpandedIdentifier::last_error is largely useless,
as there are hardly any errors that are actually reported, and is not
thread-safe.  Remove this error handling.  Remaining error cases
will be changed in ExpandedIdentifier to use exceptions.
---
 Calorimeter/CaloIdentifier/src/CaloDM_ID.cxx  | 41 +---------
 .../CaloIdentifier/src/CaloLVL1_ID.cxx        | 43 +----------
 .../CaloIdentifier/src/CaloNeighbours.cxx     |  7 +-
 .../CaloIdentifier/src/JGTowerBase_ID.cxx     | 28 +------
 .../CaloIdentifier/src/LArEM_Base_ID.cxx      | 18 +----
 .../CaloIdentifier/src/LArFCAL_Base_ID.cxx    | 17 +---
 .../CaloIdentifier/src/LArHEC_Base_ID.cxx     | 28 +------
 .../CaloIdentifier/src/LArMiniFCAL_ID.cxx     | 21 +----
 Calorimeter/CaloIdentifier/src/TTOnlineID.cxx | 28 +------
 Calorimeter/CaloIdentifier/src/TileTBID.cxx   | 33 +-------
 .../CaloIdentifier/src/Tile_Base_ID.cxx       | 77 +------------------
 11 files changed, 17 insertions(+), 324 deletions(-)

diff --git a/Calorimeter/CaloIdentifier/src/CaloDM_ID.cxx b/Calorimeter/CaloIdentifier/src/CaloDM_ID.cxx
index 41970aed3bc..797b01d8f05 100755
--- a/Calorimeter/CaloIdentifier/src/CaloDM_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/CaloDM_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/CaloDM_ID.h"
@@ -545,14 +545,6 @@ void CaloDM_ID::lar_region_id_checks (int pos_neg_z, int dmat, int sampling, int
   ExpandedIdentifier id(calo_exp());
   id << pos_neg_z << dmat << sampling << region ;
   
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in CaloDM_ID::lar_region_id(field values), did not build, " +
-      strformat ("pos_neg_z: %d , dmat: %d, sampling: %d, region: %d ", 
-                 pos_neg_z , dmat, sampling , region);
-    throw CaloID_Exception(errorMessage , 3);
-  }
-
   if (!m_full_lar_region_range.match(id)) { 
     std::string errorMessage = "CaloDM_ID::lar_region_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_lar_zone_range;
@@ -566,14 +558,6 @@ void CaloDM_ID::tile_region_id_checks (int pos_neg_z, int dmat, int sampling, in
   ExpandedIdentifier id(calo_exp());
   id << pos_neg_z << dmat << sampling << region ;
   
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in CaloDM_ID::tile_region_id(field values), did not build, " +
-      strformat ("pos_neg_z: %d , dmat: %d, sampling: %d, region: %d ", 
-                 pos_neg_z , dmat, sampling , region);
-    throw CaloID_Exception(errorMessage , 3);
-  }
-
   if (!m_full_tile_region_range.match(id)) { 
     std::string errorMessage = "CaloDM_ID::tile_region_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_tile_zone_range;
@@ -590,14 +574,6 @@ void CaloDM_ID::tile_region_id_checks (int pos_neg_z, int dmat, int sampling, in
   ExpandedIdentifier id(calo_exp());
   id << pos_neg_z << dmat << sampling << region << eta << phi;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in CaloDM_ID::lar_zone_id(field values), did not build, " +
-      strformat ("pos_neg_z: %d , dmat: %d, sampling: %d, region: %d , eta: %d , phi: %d ", 
-                 pos_neg_z , dmat, sampling , region, eta, phi);
-    throw CaloID_Exception(errorMessage , 4);
-  }
-
   if (!m_full_lar_zone_range.match(id)) { 
     std::string errorMessage = "CaloDM_ID::lar_zone_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_lar_zone_range;
@@ -612,14 +588,6 @@ void CaloDM_ID::tile_region_id_checks (int pos_neg_z, int dmat, int sampling, in
   ExpandedIdentifier id(calo_exp());
   id << pos_neg_z << dmat << sampling << region << eta << phi;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in CaloDM_ID::tile_zone_id(field values), did not build, " +
-      strformat ("pos_neg_z: %d , dmat: %d, sampling: %d, region: %d , eta: %d , phi: %d ", 
-                 pos_neg_z , dmat, sampling , region, eta, phi);
-    throw CaloID_Exception(errorMessage , 4);
-  }
-
   if (!m_full_tile_zone_range.match(id)) { 
     std::string errorMessage = "CaloDM_ID::tile_zone_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_tile_zone_range;
@@ -643,13 +611,6 @@ void CaloDM_ID::zone_id_checks   ( const Identifier& regionId,
 
     id << eta << phi;
 
-    if( id.last_error () != ExpandedIdentifier::none) {
-      std::string errorMessage =
-        "Error in CaloDM_ID::zone_id(regionId,field values), values ok but did not build, " +
-        strformat ("eta: %d , phi: %d ", eta, phi);
-      throw CaloID_Exception(errorMessage , 4);
-    }
-    
     if(is_lar(regionId)) {
       if (!m_full_lar_zone_range.match(id)) {
 	std::string errorMessage = "CaloDM_ID::zone_id(regionId) result is not OK: ID, range = "
diff --git a/Calorimeter/CaloIdentifier/src/CaloLVL1_ID.cxx b/Calorimeter/CaloIdentifier/src/CaloLVL1_ID.cxx
index 2a37a9e3b81..5b8a65acabb 100755
--- a/Calorimeter/CaloIdentifier/src/CaloLVL1_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/CaloLVL1_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/CaloLVL1_ID.h"
@@ -609,14 +609,6 @@ void CaloLVL1_ID::tower_id_checks   ( int pos_neg_z, int sampling, int region,
   ExpandedIdentifier id(calo_exp());
   id << pos_neg_z << sampling << region << eta << phi;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in CaloLVL1_ID::tower_id(field values), did not build, " +
-      strformat("pos_neg_z: %d , sampling: %d, region: %d , eta: %d , phi: %d ",
-                pos_neg_z, sampling, region, eta, phi);
-    throw CaloID_Exception(errorMessage , 2);
-  }
-
   if (!m_full_tower_range.match(id)) { 
     std::string errorMessage = "CaloLVL1_ID::tower_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_tower_range;
@@ -640,16 +632,6 @@ void CaloLVL1_ID::tower_id_checks   ( const Identifier regionId,
 
     id << eta << phi;
 
-    if( id.last_error () != ExpandedIdentifier::none) {
-    
-      std::string errorMessage =
-        "Error in CaloLVL1_ID::tower_id(regionId,field values), values ok but did not build, " +
-        strformat ("eta: %d , phi: %d ", 
-                   eta, phi);
-      throw CaloID_Exception(errorMessage , 2);
-    }
-
-
     if (!m_full_tower_range.match(id)) {
       std::string errorMessage = "CaloLVL1_ID::tower_id(regionId,field values) result is not OK: ID, range = "
                                 + std::string(id) + " , " + (std::string)m_full_tower_range;
@@ -663,14 +645,6 @@ void CaloLVL1_ID::region_id_checks (int pos_neg_z, int sampling, int region)cons
     ExpandedIdentifier id(calo_exp());
     id << pos_neg_z << sampling << region ;
 
-    if( id.last_error () != ExpandedIdentifier::none) {
-      std::string errorMessage =
-        "Error in CaloLVL1_ID::region_id(field values), did not build, " +
-        strformat ("pos_neg_z: %d , sampling: %d, region: %d ", 
-                   pos_neg_z , sampling , region);
-      throw CaloID_Exception(errorMessage , 2);
-    }
-
     if (!m_full_region_range.match(id)) { 
       std::string errorMessage = "CaloLVL1_ID::region_id() result is not OK: ID, range = "
 	+ std::string(id) + " , " + (std::string)m_full_region_range;
@@ -685,14 +659,6 @@ void CaloLVL1_ID::layer_id_checks   ( int pos_neg_z, int sampling, int region,
     ExpandedIdentifier id(calo_exp());
     id << pos_neg_z << sampling << region << eta << phi << layer;
 
-    if( id.last_error () != ExpandedIdentifier::none) {
-      std::string errorMessage =
-        "Error in CaloLVL1_ID::layer_id(field values), did not build, " +
-        strformat ("pos_neg_z: %d , sampling: %d, region: %d , eta: %d , phi: %d , layer: %d ", 
-                   pos_neg_z , sampling , region, eta, phi, layer);
-      throw CaloID_Exception(errorMessage , 2);
-    }
-
     if (!m_full_layer_range.match(id)) { 
       std::string errorMessage = "CaloLVL1_ID::layer_id(field values) result is not OK: ID, range = "
                                 + std::string(id) + " , " + (std::string)m_full_layer_range;
@@ -715,13 +681,6 @@ void CaloLVL1_ID::layer_id_checks   ( const Identifier towerId,
 
     id << layer;
 
-    if( id.last_error () != ExpandedIdentifier::none) {
-      std::string errorMessage =
-        "Error in CaloLVL1_ID::layer_id(towerId,layer), values ok but did not build, " +
-        strformat ("layer: %d  ", layer);
-      throw CaloID_Exception(errorMessage , 2);
-    }
-
     if (!m_full_layer_range.match(id)) {
       std::string errorMessage = "CaloLVL1_ID::layer_id(towerId) result is not OK: ID, range = "
                                 + (std::string)id + " , " + (std::string)m_full_layer_range;
diff --git a/Calorimeter/CaloIdentifier/src/CaloNeighbours.cxx b/Calorimeter/CaloIdentifier/src/CaloNeighbours.cxx
index ca2bd808565..ceed400254e 100755
--- a/Calorimeter/CaloIdentifier/src/CaloNeighbours.cxx
+++ b/Calorimeter/CaloIdentifier/src/CaloNeighbours.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //-----------------------------------------------------------------------
@@ -177,12 +177,15 @@ int CaloNeighbourRegion::getId(ExpandedIdentifier& id, Identifier &rID, const Ra
   }
   else if ( m_calo_id->is_tile(id) ) {
     subCalo = CaloCell_ID::TILE;
+    ExpandedIdentifier::element_type sampl = 0;
+    if (id.fields() > TILESAMPL)
+      sampl = id[TILESAMPL];
     rID = m_calo_id->cell_id(subCalo,
 			     id[TILESECTION],
 			     id[SIDE],
 			     id[TILEPHI],
 			     id[TILEETA],
-			     id[TILESAMPL]);
+			     sampl);
   }
   else {
     std::cout << "CaloNeighbours::get_id ERROR: " << (std::string)id << " is not in the LAr or Tile calorimeters" << std::endl;
diff --git a/Calorimeter/CaloIdentifier/src/JGTowerBase_ID.cxx b/Calorimeter/CaloIdentifier/src/JGTowerBase_ID.cxx
index f77b954832a..f98cb9b666f 100644
--- a/Calorimeter/CaloIdentifier/src/JGTowerBase_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/JGTowerBase_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/JGTowerBase_ID.h"
@@ -583,14 +583,6 @@ void JGTowerBase_ID::tower_id_checks   ( int pos_neg, int sampling, int region,
   id << pos_neg << sampling <<
     region << eta << phi;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in JGTowerBase_ID::tower_id(field values), did not build, " +
-      strformat("pos_neg: %d , sampling: %d, region: %d , eta: %d , phi: %d ",
-                pos_neg, sampling, region, eta, phi);
-    throw CaloID_Exception(errorMessage , 2);
-  }
-
   if (!m_full_tower_range.match(id)) { 
     std::string errorMessage = "JGTowerBase_ID::tower_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_tower_range;
@@ -613,16 +605,6 @@ void JGTowerBase_ID::tower_id_checks   ( const Identifier regionId,
 
   id << eta << phi;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    
-    std::string errorMessage =
-      "Error in JGTowerBase_ID::tower_id(regionId,field values), values ok but did not build, " +
-      strformat ("eta: %d , phi: %d ", 
-		 eta, phi);
-    throw CaloID_Exception(errorMessage , 2);
-  }
-
-
   if (!m_full_tower_range.match(id)) {
     std::string errorMessage = "JGTowerBase_ID::tower_id(regionId,field values) result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_tower_range;
@@ -636,14 +618,6 @@ void JGTowerBase_ID::region_id_checks (int pos_neg, int sampling, int region)con
   ExpandedIdentifier id(calo_exp());
   id << pos_neg << sampling << region ;
 
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in JGTowerBase_ID::region_id(field values), did not build, " +
-      strformat ("pos_neg: %d , sampling: %d, region: %d ", 
-		 pos_neg , sampling , region);
-    throw CaloID_Exception(errorMessage , 2);
-  }
-
   if (!m_full_reg_range.match(id)) { 
     std::string errorMessage = "JGTowerBase_ID::region_id() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_reg_range;
diff --git a/Calorimeter/CaloIdentifier/src/LArEM_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/LArEM_Base_ID.cxx
index 8fe249f3b6e..13e3c294195 100644
--- a/Calorimeter/CaloIdentifier/src/LArEM_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/LArEM_Base_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -150,14 +150,6 @@ void LArEM_Base_ID::region_id_checks   ( int barrel_ec, int sampling, int region
   ExpandedIdentifier expId(lar_em_exp());
   expId << barrel_ec << sampling << region ;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in LArEM_Base_ID::region_id_checks, " +
-      strformat ("barrel_ec: %d , sampling: %d, region: %d ",
-                 barrel_ec , sampling , region);
-    throw LArID_Exception(errorMessage , 5);
-  }
-  
   if (!m_full_region_range.match(expId)) { 
     std::string errorMessage = "LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -175,14 +167,6 @@ void LArEM_Base_ID::channel_id_checks   ( int barrel_ec, int sampling, int regio
     ExpandedIdentifier expId(lar_em_exp());
     expId << barrel_ec << sampling << region << eta << phi << m_slar ;
 
-    if( expId.last_error () != ExpandedIdentifier::none) {
-	std::string errorMessage = 
-          "Error in LArEM_Base_ID::channel_id_checks(field values), " + 
-          strformat ("barrel_ec: %d , sampling: %d, region: %d , eta: %d , phi: %d ",
-                     barrel_ec , sampling , region, eta, phi);
-	throw LArID_Exception(errorMessage , 6);
-    }
-
     if (!m_full_em_range.match(expId)) { 
 	std::string errorMessage = "LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
 	    + std::string(expId) + " , " + (std::string)m_full_em_range;
diff --git a/Calorimeter/CaloIdentifier/src/LArFCAL_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/LArFCAL_Base_ID.cxx
index 66a646f4965..552ad48abce 100755
--- a/Calorimeter/CaloIdentifier/src/LArFCAL_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/LArFCAL_Base_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/LArFCAL_Base_ID.h"
@@ -256,13 +256,6 @@ void LArFCAL_Base_ID::module_id_checks ( int pos_neg, int module ) const
   ExpandedIdentifier expId(lar_fcal_exp());
   expId << pos_neg << module;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in LArFCAL_Base_ID::module_id, " + 
-      strformat ("pos_neg: %d , module: %d", pos_neg , module);
-    throw LArID_Exception(errorMessage , 9);
-  }
-
   if (!m_full_module_range.match(expId)) { 
     std::string errorMessage = "LArFCAL_Base_ID::module_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_module_range;
@@ -278,14 +271,6 @@ void LArFCAL_Base_ID::channel_id_checks ( int pos_neg, int module, int eta, int
   ExpandedIdentifier expId(lar_fcal_exp());
   expId << pos_neg << module << eta << phi << m_slar ;
 
-  if( expId.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in LArFCAL_Base_ID::channel_id, " +
-      strformat ("pos_neg: %d , module: %d, eta: %d, phi: %d ",
-                 pos_neg , module , eta , phi);
-    throw LArID_Exception(errorMessage , 10);
-  }
-
   if (!m_full_channel_range.match(expId)) { 
     std::string errorMessage = "LArFCAL_Base_ID::channel_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_channel_range;
diff --git a/Calorimeter/CaloIdentifier/src/LArHEC_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/LArHEC_Base_ID.cxx
index b5fc8ab1fc5..a33151b60cf 100755
--- a/Calorimeter/CaloIdentifier/src/LArHEC_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/LArHEC_Base_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -399,14 +399,6 @@ void LArHEC_Base_ID::region_id_checks   ( int pos_neg, int sampling, int region
   ExpandedIdentifier expId(lar_hec_exp());
   expId << pos_neg << sampling << region ;
       
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in LArHEC_Base_ID::region_id, " +
-      strformat ("pos_neg: %d , sampling: %d, region: %d ",
-                 pos_neg , sampling , region);
-    throw LArID_Exception(errorMessage , 7);
-  }
-
   if (!m_full_region_range.match(expId)) { 
     std::string errorMessage = "LArHEC_Base_ID::region_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -424,14 +416,6 @@ void LArHEC_Base_ID::channel_id_checks   ( int pos_neg, int sampling, int region
   ExpandedIdentifier expId(lar_hec_exp());
   expId << pos_neg << sampling << region << eta << phi << m_slar ;
 
-  if( expId.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage = 
-      "Error in LArHEC_Base_ID::channel_id(field values), " +
-      strformat ("pos_neg: %d , sampling: %d, region: %d , eta: %d , phi: %d ",
-                 pos_neg , sampling , region, eta, phi);
-    throw LArID_Exception(errorMessage , 8);
-  }
-
   if (!m_full_channel_range.match(expId)) { 
     std::string errorMessage = "LArHEC_Base_ID::channel_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_channel_range;
@@ -456,16 +440,6 @@ void LArHEC_Base_ID::channel_id_checks   ( const Identifier regionId,
 
   expId << eta << phi << m_slar;
       
-  if ( expId.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage = 
-      "Error in LArHEC_Base_ID::channel_id(region id , field values), " +
-      strformat ("pos_neg: %d , sampling: %d, region: %d , eta: %d , phi: %d ",
-                 this->pos_neg(regionId) , 
-                 this->sampling(regionId), 
-                 this->region(regionId), eta, phi);
-    throw LArID_Exception(errorMessage , 8);
-  }
-      
   if (!m_full_channel_range.match(expId)) { 
     std::string errorMessage = "LArHEC_Base_ID::channel_id(regId) result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_channel_range;
diff --git a/Calorimeter/CaloIdentifier/src/LArMiniFCAL_ID.cxx b/Calorimeter/CaloIdentifier/src/LArMiniFCAL_ID.cxx
index 4336ec1523d..909376d2351 100644
--- a/Calorimeter/CaloIdentifier/src/LArMiniFCAL_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/LArMiniFCAL_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/LArMiniFCAL_ID.h"
@@ -350,7 +350,7 @@ int  LArMiniFCAL_ID::initialize_from_dictionary (const IdDictMgr& dict_mgr)
 
 }
 
-void LArMiniFCAL_ID::module_id_checks ( int pos_neg, int module ) const
+void LArMiniFCAL_ID::module_id_checks ( int pos_neg, int /*module*/ ) const
 {
 	
   // Check that id is within allowed range
@@ -359,13 +359,6 @@ void LArMiniFCAL_ID::module_id_checks ( int pos_neg, int module ) const
   //expId << pos_neg << module;
   expId << pos_neg << 0;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in LArMiniFCAL_ID::module_id, " +
-      strformat ("pos_neg: %d , module: %d", pos_neg , module);
-    throw LArID_Exception(errorMessage , 9);
-  }
-
   if (!m_full_module_range.match(expId)) { 
     std::string errorMessage = "LArMiniFCAL_ID::module_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_module_range;
@@ -373,7 +366,7 @@ void LArMiniFCAL_ID::module_id_checks ( int pos_neg, int module ) const
   }
 }
 
-void LArMiniFCAL_ID::channel_id_checks ( int pos_neg, int module, int depth, int eta, int phi) const
+void LArMiniFCAL_ID::channel_id_checks ( int pos_neg, int /*module*/, int depth, int eta, int phi) const
 {
 	
   // Check that id is within allowed range
@@ -382,14 +375,6 @@ void LArMiniFCAL_ID::channel_id_checks ( int pos_neg, int module, int depth, int
   //expId << pos_neg << module << depth << eta << phi ;
   expId << pos_neg << 0 << depth << eta << phi ;
 
-  if( expId.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in LArMiniFCAL_ID::channel_id, " +
-      strformat ("pos_neg: %d , module: %d, depth: %d,eta: %d, phi: %d ",
-                 pos_neg , module , depth, eta , phi);
-    throw LArID_Exception(errorMessage , 10);
-  }
-
   if (!m_full_channel_range.match(expId)) { 
     std::string errorMessage = "LArMiniFCAL_ID::channel_id() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_channel_range;
diff --git a/Calorimeter/CaloIdentifier/src/TTOnlineID.cxx b/Calorimeter/CaloIdentifier/src/TTOnlineID.cxx
index 3fbbfa455c0..55e8de72806 100755
--- a/Calorimeter/CaloIdentifier/src/TTOnlineID.cxx
+++ b/Calorimeter/CaloIdentifier/src/TTOnlineID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloIdentifier/TTOnlineID.h"
@@ -235,13 +235,6 @@ void TTOnlineID::channel_Id_checks   ( int crate, int module, int submodule, int
   // Fill expanded id
   ExpandedIdentifier id(calo_exp());
   id << detzside_field_value() << crate << module << submodule << channel;
-  if( id.last_error () != ExpandedIdentifier::none) {
-    std::string errorMessage =
-      "Error in TTOnlineID::channel_Id_checks(field values), did not build, " +
-      strformat ("crate: %d , module: %d, submodule: %d , channel: %d ",
-                 crate , module , submodule, channel);
-    throw CaloID_Exception(errorMessage , 2);
-  }
   if (!m_full_channel_range.match(id)) {
     std::string errorMessage = "[TTOnlineID]::channnelId() result is not OK: ID, range = "
       + std::string(id) + " , " + (std::string)m_full_channel_range;
@@ -324,13 +317,6 @@ void TTOnlineID::submodule_Id_checks( int crate, int module, int submodule ) con
   ExpandedIdentifier expId(calo_exp());
   expId << detzside_field_value() << crate <<  module << submodule;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in TTOnlineID::submodule_Id_checks, values ok but did not build, "+
-      strformat ("crate: %d , module: %d , submodule: %d",
-                 crate , module, submodule);
-    throw CaloID_Exception(errorMessage , 99);
-  }
   if (!m_full_submodule_range.match(expId)) { std::string errorMessage = "TTOnlineID::submodule_Id_checks() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_submodule_range;
     throw CaloID_Exception(errorMessage , 99);
@@ -346,12 +332,6 @@ void TTOnlineID::module_Id_checks( int crate, int module ) const
   ExpandedIdentifier expId(calo_exp());
   expId << detzside_field_value() << crate << module;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in TTOnlineID::module_Id_checks, values ok but did not build, " +
-      strformat ("crate: %d , module: %d", crate , module);
-    throw CaloID_Exception(errorMessage , 99);
-  }
   if (!m_full_module_range.match(expId)) { std::string errorMessage = "TTOnlineID::module_Id_checks() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_module_range;
     throw CaloID_Exception(errorMessage , 99);
@@ -367,12 +347,6 @@ void TTOnlineID::crate_Id_checks( int crate ) const
   ExpandedIdentifier expId(calo_exp());
   expId << detzside_field_value() << crate;
 
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    std::string errorMessage =
-      "Error in TTOnlineID::crate_Id_checks, values ok but did not build, " +
-      strformat ("crate: %d", crate);
-    throw CaloID_Exception(errorMessage , 99);
-  }
   if (!m_full_crate_range.match(expId)) { std::string errorMessage = "TTOnlineID::crate_Id_checks() result is not OK: ID, range = "
       + std::string(expId) + " , " + (std::string)m_full_crate_range;
     throw CaloID_Exception(errorMessage , 99);
diff --git a/Calorimeter/CaloIdentifier/src/TileTBID.cxx b/Calorimeter/CaloIdentifier/src/TileTBID.cxx
index 69c16637aad..8e2399fd622 100755
--- a/Calorimeter/CaloIdentifier/src/TileTBID.cxx
+++ b/Calorimeter/CaloIdentifier/src/TileTBID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
@@ -117,14 +117,6 @@ TileTBID::type_id       ( int type )      const
 	ExpandedIdentifier expId(tile_exp());
 	expId << TileTBID::TILE_TESTBEAM << type;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in TileTBID::type_id , values ok but did not build, " +
-              strformat ("testbeam: %d, type: %d ",
-                         TileTBID::TILE_TESTBEAM, type);
-	    throw TileID_Exception(errorMessage , 2);
-	}
-
 	if (!m_full_type_range.match(expId)) { 
 	    std::string errorMessage = "TileTBID::type_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_type_range;
@@ -151,14 +143,6 @@ TileTBID::module_id       ( int type, int module )       const
 	ExpandedIdentifier expId(tile_exp());
 	expId << TileTBID::TILE_TESTBEAM << type << module;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in TileTBID::module_id , values ok but did not build, " +
-              strformat ("testbeam: %d, type: %d, module: %d ",
-                         TileTBID::TILE_TESTBEAM, type, module);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_module_range.match(expId)) { 
 	    std::string errorMessage = "TileTBID::module_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_type_range;
@@ -189,14 +173,6 @@ TileTBID::channel_id ( int type, int module, int channel ) const
 	ExpandedIdentifier expId(tile_exp());
 	expId << TileTBID::TILE_TESTBEAM << type << module << channel;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in TileTBID::channel_id , values ok but did not build, " +
-              strformat ("testbeam: %d, type: %d, module: %d, channel: %d ",
-                         TileTBID::TILE_TESTBEAM, type, module, channel);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_channel_range.match(expId)) { 
 	    std::string errorMessage = "TileTBID::channel_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_type_range;
@@ -248,13 +224,6 @@ TileTBID::channel_id    ( const Identifier & module_id,
 
 	expId << channel;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in TileTBID::channel_id , values ok but did not build, " +
-              strformat ("channel: %d ", channel);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_channel_range.match(expId)) { 
 	    std::string errorMessage = "TileTBID::channel_id() result is not OK: ID, range = "
 		+ (std::string)expId + " , " + (std::string)m_full_type_range;
diff --git a/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
index 21c78f22449..e00dc907111 100755
--- a/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -378,13 +378,6 @@ Tile_Base_ID::tile_det        ( int section )        const
 	// Fill expanded id
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) ;
-
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::tile_det , values ok but did not build, "+
-              strformat("section: %d ", section);
-	    throw TileID_Exception(errorMessage , 1);
-	}
     }
 
     Identifier result;
@@ -425,13 +418,6 @@ Tile_Base_ID::region_id       ( int section, int side )      const
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::region_id, values ok but did not build, "+
-              strformat ("section: %d, side: %d ", section, side);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_region_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::region_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -478,14 +464,6 @@ Tile_Base_ID::module_id       ( int section, int side,
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side << module;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::module_id, values ok but did not build, "+
-              strformat ("section: %d, side: %d, module: %d ",
-                         section, side, module);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_module_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::module_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -533,14 +511,6 @@ Tile_Base_ID::tower_id        ( int section, int side,
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side << module << tower;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::tower_id, values ok but did not build, "+
-              strformat ("section: %d, side: %d, module: %d, tower: %d ",
-                         section, side, module, tower);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_tower_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::tower_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -602,14 +572,6 @@ Tile_Base_ID::cell_id         ( int section, int side,
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side << module << tower << sample;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::cell_id, values ok but did not build, " +
-              strformat ("section: %d, side: %d, module: %d, tower: %d, sample: %d ",
-                         section, side, module, tower, sample);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_cell_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::cell_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_cell_range;
@@ -684,13 +646,6 @@ Tile_Base_ID::pmt_id          ( const Identifier & cell_id,
 
 	expId << pmt;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::pmt_id, values ok but did not build, " +
-              strformat ("pmt: %d ", pmt);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_pmt_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::pmt_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -714,14 +669,6 @@ Tile_Base_ID::pmt_id          ( int section, int side,
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side << module << tower << sample << pmt;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::pmt_id, values ok but did not build, " +
-              strformat ("section: %d, side: %d, module: %d, tower: %d, sample: %d, pmt: %d ",
-                         section, side, module, tower, sample, pmt);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_pmt_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::pmt_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -786,13 +733,6 @@ Tile_Base_ID::adc_id          ( const Identifier & cell_id,
 
 	expId << pmt << adc;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::adc_id, values ok but did not build, " +
-              strformat ("pmt: %d, adc: %d ", pmt, adc);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_adc_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -840,13 +780,6 @@ Tile_Base_ID::adc_id          ( const Identifier & pmt_id,
 
 	expId << adc;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::adc_id, values ok but did not build, " +
-              strformat ("adc: %d ", adc);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_adc_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
@@ -870,14 +803,6 @@ Tile_Base_ID::adc_id          ( int section, int side,
 	ExpandedIdentifier expId(tile_exp());
 	expId << encode_section (section) << side << module << tower << sample << pmt << adc;
 
-	if(  expId.last_error () != ExpandedIdentifier::none ){
-	    std::string errorMessage =
-              "Error in Tile_Base_ID::adc_id, values ok but did not build, " +
-              strformat ("section: %d, side: %d, module: %d, tower: %d, sample: %d, pmt: %d, adc: %d ",
-                         section, side, module, tower, sample, pmt, adc);
-	    throw TileID_Exception(errorMessage , 1);
-	}
-
 	if (!m_full_adc_range.match(expId)) { 
 	    std::string errorMessage = "Tile_Base_ID::adc_id() result is not OK: ID, range = "
 		+ std::string(expId) + " , " + (std::string)m_full_region_range;
-- 
GitLab