diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/PixelID.h b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/PixelID.h index b7fa6b0491f30b2e166dc09c67c68e0e60f7c92d..2a9531b4ecef396ea45c73d2941cdd2747b8bf8d 100755 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/PixelID.h +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/PixelID.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETIDENTIFIER_PIXELID_H @@ -97,6 +97,11 @@ public: int layer_disk, int phi_module, int eta_module ) const; + Identifier wafer_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + bool checks) const; /// For a single crystal from a pixel id - DO NOT USE wafer id as /// input @@ -112,6 +117,13 @@ public: int eta_module, int phi_index, int eta_index) const; + Identifier pixel_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int phi_index, + int eta_index, + bool checks) const; Identifier pixel_id ( const Identifier& id, int phi_index, int eta_index) const; @@ -235,6 +247,7 @@ public: /// Create pixel Identifier from expanded id, which is returned by the /// id_iterators Identifier pixel_id (const ExpandedIdentifier& pixel_id) const; + Identifier pixel_id (const ExpandedIdentifier& pixel_id, bool checks) const; /// Create expanded id from compact id (return == 0 for OK) void get_expanded_id (const Identifier& id, @@ -332,7 +345,8 @@ inline Identifier PixelID::wafer_id ( int barrel_ec, int layer_disk, int phi_module, - int eta_module ) const + int eta_module, + bool checks) const { // Build identifier @@ -347,13 +361,22 @@ PixelID::wafer_id ( int barrel_ec, m_eta_mod_impl.pack (eta_module, result); // Do checks - if(m_do_checks) { + if(checks) { wafer_id_checks ( barrel_ec, layer_disk, phi_module, eta_module ); } return result; } +inline Identifier +PixelID::wafer_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module ) const +{ + return wafer_id (barrel_ec, layer_disk, phi_module, eta_module, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier PixelID::wafer_id ( const Identifier& pixel_id ) const @@ -391,7 +414,8 @@ PixelID::pixel_id ( int barrel_ec, int phi_module, int eta_module, int phi_index, - int eta_index) const + int eta_index, + bool checks) const { // Build identifier @@ -405,7 +429,7 @@ PixelID::pixel_id ( int barrel_ec, m_phi_index_impl.pack (phi_index, result); m_eta_index_impl.pack (eta_index, result); - if(m_do_checks) { + if(checks) { pixel_id_checks ( barrel_ec, layer_disk, @@ -418,11 +442,24 @@ PixelID::pixel_id ( int barrel_ec, return result; } +inline Identifier +PixelID::pixel_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int phi_index, + int eta_index) const +{ + return pixel_id (barrel_ec, layer_disk, phi_module, eta_module, + phi_index, eta_index, do_checks()); +} + /// Create pixel Identifier from expanded id, which is returned by the /// id_iterators //---------------------------------------------------------------------------- inline Identifier -PixelID::pixel_id (const ExpandedIdentifier& id) const +PixelID::pixel_id (const ExpandedIdentifier& id, + bool checks) const { Identifier result; result = pixel_id(id[m_BARREL_EC_INDEX], @@ -432,7 +469,7 @@ PixelID::pixel_id (const ExpandedIdentifier& id) const id[m_PHI_INDEX_INDEX], id[m_ETA_INDEX_INDEX]); - if(m_do_checks) { + if(checks) { pixel_id_checks (id[m_BARREL_EC_INDEX], id[m_LAYER_DISK_INDEX], id[m_PHI_MODULE_INDEX], @@ -444,6 +481,12 @@ PixelID::pixel_id (const ExpandedIdentifier& id) const return (result); } +inline Identifier +PixelID::pixel_id (const ExpandedIdentifier& id) const +{ + return pixel_id (id, do_checks()); +} + //---------------------------------------------------------------------------- diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/SCT_ID.h b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/SCT_ID.h index 4ede16c7f72a7cf70fb388dc58201f83eaf87805..b56ad7508c2e4b2fb26e9fbf754eedc55e4c01da 100755 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/SCT_ID.h +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/SCT_ID.h @@ -91,9 +91,14 @@ public: //@{ /// For a single crystal Identifier module_id ( int barrel_ec, - int layer_disk, - int phi_module, - int eta_module ) const; + int layer_disk, + int phi_module, + int eta_module ) const; + Identifier module_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + bool checks) const; /// For a module from a wafer id Identifier module_id ( const Identifier& wafer_id ) const; @@ -104,6 +109,12 @@ public: int phi_module, int eta_module, int side ) const; + Identifier wafer_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side, + bool checks) const; /// For a single crystal from a strip id Identifier wafer_id ( const Identifier& strip_id ) const; @@ -118,6 +129,13 @@ public: int eta_module, int side, int strip) const; + Identifier strip_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side, + int strip, + bool check) const; Identifier strip_id ( int barrel_ec, int layer_disk, @@ -126,6 +144,14 @@ public: int side, int row, int strip) const; + Identifier strip_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side, + int row, + int strip, + bool checks) const; @@ -345,7 +371,8 @@ inline Identifier SCT_ID::module_id ( int barrel_ec, int layer_disk, int phi_module, - int eta_module ) const + int eta_module, + bool checks) const { // Build identifier @@ -360,13 +387,22 @@ SCT_ID::module_id ( int barrel_ec, m_eta_mod_impl.pack (eta_module, result); // Do checks - if(m_do_checks) { + if(checks) { wafer_id_checks ( barrel_ec, layer_disk, phi_module, eta_module, 0 ); } return result; } +inline Identifier +SCT_ID::module_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module ) const +{ + return module_id (barrel_ec, layer_disk, phi_module, eta_module, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier SCT_ID::module_id ( const Identifier& wafer_id ) const @@ -384,7 +420,8 @@ SCT_ID::wafer_id ( int barrel_ec, int layer_disk, int phi_module, int eta_module, - int side ) const + int side, + bool checks) const { // Build identifier @@ -400,13 +437,24 @@ SCT_ID::wafer_id ( int barrel_ec, m_side_impl.pack (side, result); // Do checks - if(m_do_checks) { + if(checks) { wafer_id_checks ( barrel_ec, layer_disk, phi_module, eta_module, side ); } return result; } +inline Identifier +SCT_ID::wafer_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side ) const +{ + return wafer_id (barrel_ec, layer_disk, phi_module, eta_module, side, + do_checks()); +} + //---------------------------------------------------------------------------- @@ -446,7 +494,8 @@ SCT_ID::strip_id ( int barrel_ec, int phi_module, int eta_module, int side, - int strip) const + int strip, + bool checks) const { // Build identifier Identifier result((Identifier::value_type)0); @@ -462,12 +511,25 @@ SCT_ID::strip_id ( int barrel_ec, m_strip_impl.pack (strip, result); // Do checks - if(m_do_checks) { + if(checks) { strip_id_checks ( barrel_ec, layer_disk, phi_module, eta_module, side, strip ); } return result; } +inline Identifier +SCT_ID::strip_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side, + int strip) const +{ + return strip_id (barrel_ec, layer_disk, phi_module, eta_module, side, strip, + do_checks()); +} + + //---------------------------------------------------------------------------- @@ -478,7 +540,8 @@ SCT_ID::strip_id ( int barrel_ec, int eta_module, int side, int row, - int strip) const + int strip, + bool checks) const { // Build identifier @@ -500,7 +563,7 @@ SCT_ID::strip_id ( int barrel_ec, // Do checks - if(m_do_checks) { + if(checks) { if ( m_hasRows ) strip_id_checks ( barrel_ec, layer_disk, phi_module, eta_module, side, row, strip ); else strip_id_checks ( barrel_ec, layer_disk, phi_module, eta_module, side, strip ); } @@ -508,7 +571,21 @@ SCT_ID::strip_id ( int barrel_ec, return result; } - + +inline Identifier +SCT_ID::strip_id ( int barrel_ec, + int layer_disk, + int phi_module, + int eta_module, + int side, + int row, + int strip) const +{ + return strip_id (barrel_ec, layer_disk, phi_module, eta_module, + side, row, strip, do_checks()); +} + + diff --git a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/TRT_ID.h b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/TRT_ID.h index ce7b35b674a3ee9ebc6888ee781d2c7bd788ca27..813178666d36a546aaa88ef9dbe5b1fcedf48014 100755 --- a/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/TRT_ID.h +++ b/InnerDetector/InDetDetDescr/InDetIdentifier/InDetIdentifier/TRT_ID.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETIDENTIFIER_TRT_ID_H @@ -114,11 +114,16 @@ public: //@{ /// For +/-barrel or +/-endcap id Identifier barrel_ec_id( int barrel_ec ) const; + Identifier barrel_ec_id( int barrel_ec, bool checks ) const; /// For an individual module phi sector Identifier module_id ( int barrel_ec, int phi_module, int layer_or_wheel ) const; + Identifier module_id ( int barrel_ec, + int phi_module, + int layer_or_wheel, + bool checks) const; /// From hash - optimized, no checks Identifier module_id ( IdentifierHash module_hash ) const; @@ -128,6 +133,11 @@ public: int phi_module, int layer_or_wheel, int straw_layer ) const; + Identifier layer_id ( int barrel_ec, + int phi_module, + int layer_or_wheel, + int straw_layer, + bool checks) const; /// From hash - optimized, no checks Identifier layer_id ( IdentifierHash straw_layer_hash ) const; @@ -135,6 +145,9 @@ public: /// For an individual straw layer Identifier layer_id ( const Identifier& module_id, int straw_layer ) const; + Identifier layer_id ( const Identifier& module_id, + int straw_layer, + bool checks) const; /// For an individual straw layer from straw id Identifier layer_id ( const Identifier& straw_id ) const; @@ -145,13 +158,26 @@ public: int layer_or_wheel, int straw_layer, int straw ) const; + Identifier straw_id ( int barrel_ec, + int phi_module, + int layer_or_wheel, + int straw_layer, + int straw, + bool checks) const; Identifier straw_id (const Identifier& module_id, int straw_layer, int straw ) const; + Identifier straw_id (const Identifier& module_id, + int straw_layer, + int straw, + bool checks) const; Identifier straw_id (const Identifier& layer_id, int straw ) const; + Identifier straw_id (const Identifier& layer_id, + int straw, + bool checks) const; /// Access to straw id from hash - must have done /// init_straw_hash_vector before using this @@ -384,7 +410,7 @@ TRT_ID::is_valid() const //---------------------------------------------------------------------------- inline Identifier -TRT_ID::barrel_ec_id( int barrel_ec ) const +TRT_ID::barrel_ec_id( int barrel_ec, bool checks ) const { // Check if TRT_ID is valid for this layout @@ -398,18 +424,25 @@ TRT_ID::barrel_ec_id( int barrel_ec ) const m_trt_impl.pack (trt_field_value(), result); m_bec_impl.pack (barrel_ec, result); - if(m_do_checks) { + if(checks) { barrel_ec_id_checks ( barrel_ec ); } return result; } +inline Identifier +TRT_ID::barrel_ec_id( int barrel_ec ) const +{ + return barrel_ec_id (barrel_ec, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::module_id ( int barrel_ec, int phi_module, - int layer_or_wheel ) const + int layer_or_wheel, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -424,13 +457,21 @@ TRT_ID::module_id ( int barrel_ec, m_phi_mod_impl.pack (phi_module, result); m_lay_wheel_impl.pack(layer_or_wheel, result); - if(m_do_checks) { + if(checks) { module_id_checks ( barrel_ec, phi_module, layer_or_wheel ); } return result; } +inline Identifier +TRT_ID::module_id ( int barrel_ec, + int phi_module, + int layer_or_wheel ) const +{ + return module_id (barrel_ec, phi_module, layer_or_wheel, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::module_id ( IdentifierHash module_hash ) const @@ -456,7 +497,8 @@ inline Identifier TRT_ID::layer_id ( int barrel_ec, int phi_module, int layer_or_wheel, - int straw_layer ) const + int straw_layer, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -472,17 +514,28 @@ TRT_ID::layer_id ( int barrel_ec, m_lay_wheel_impl.pack(layer_or_wheel, result); m_str_lay_impl.pack (straw_layer, result); - if(m_do_checks) { + if(checks) { layer_id_checks ( barrel_ec, phi_module, layer_or_wheel, straw_layer ); } return result; } +inline Identifier +TRT_ID::layer_id ( int barrel_ec, + int phi_module, + int layer_or_wheel, + int straw_layer ) const +{ + return layer_id (barrel_ec, phi_module, layer_or_wheel, straw_layer, + do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::layer_id ( const Identifier& module_id, - int straw_layer ) const + int straw_layer, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -494,7 +547,7 @@ TRT_ID::layer_id ( const Identifier& module_id, m_str_lay_impl.reset (result); m_str_lay_impl.pack (straw_layer, result); - if(m_do_checks) { + if(checks) { layer_id_checks ( barrel_ec(module_id), phi_module(module_id), layer_or_wheel(module_id), @@ -503,6 +556,13 @@ TRT_ID::layer_id ( const Identifier& module_id, return result; } +inline Identifier +TRT_ID::layer_id ( const Identifier& module_id, + int straw_layer ) const +{ + return layer_id (module_id, straw_layer, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::layer_id ( const Identifier& straw_id ) const @@ -522,7 +582,8 @@ TRT_ID::straw_id ( int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, - int straw ) const + int straw, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -539,13 +600,24 @@ TRT_ID::straw_id ( int barrel_ec, m_str_lay_impl.pack (straw_layer, result); m_straw_impl.pack (straw, result); - if(m_do_checks) { + if(checks) { straw_id_checks ( barrel_ec, phi_module, layer_or_wheel, straw_layer, straw ); } return result; } +inline Identifier +TRT_ID::straw_id ( int barrel_ec, + int phi_module, + int layer_or_wheel, + int straw_layer, + int straw ) const +{ + return straw_id (barrel_ec, phi_module, layer_or_wheel, straw_layer, straw, + do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::straw_id (const ExpandedIdentifier& id) const @@ -568,7 +640,8 @@ TRT_ID::straw_id (const ExpandedIdentifier& id) const inline Identifier TRT_ID::straw_id(const Identifier& module_id, int straw_layer, - int straw ) const + int straw, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -582,7 +655,7 @@ TRT_ID::straw_id(const Identifier& module_id, m_str_lay_impl.pack (straw_layer, result); m_straw_impl.pack (straw, result); - if(m_do_checks) { + if(checks) { straw_id_checks ( barrel_ec(module_id), phi_module(module_id), layer_or_wheel(module_id), @@ -592,10 +665,19 @@ TRT_ID::straw_id(const Identifier& module_id, return result; } +inline Identifier +TRT_ID::straw_id(const Identifier& module_id, + int straw_layer, + int straw ) const +{ + return straw_id (module_id, straw_layer, straw, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::straw_id(const Identifier& layer_id, - int straw ) const + int straw, + bool checks) const { // Check if TRT_ID is valid for this layout if (!m_is_valid) invalidMessage(); @@ -607,7 +689,7 @@ TRT_ID::straw_id(const Identifier& layer_id, m_straw_impl.reset (result); m_straw_impl.pack (straw, result); - if(m_do_checks) { + if(checks) { straw_id_checks ( barrel_ec(layer_id), phi_module(layer_id), layer_or_wheel(layer_id), @@ -617,6 +699,13 @@ TRT_ID::straw_id(const Identifier& layer_id, return result; } +inline Identifier +TRT_ID::straw_id(const Identifier& layer_id, + int straw ) const +{ + return straw_id (layer_id, straw, do_checks()); +} + //---------------------------------------------------------------------------- inline Identifier TRT_ID::straw_id ( IdentifierHash straw_hash ) const