diff --git a/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h b/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h index 5d9178e3453d40af4b30239fe6bc82737765483e..ea10c7de9ab169e3c82b4e6a57cc2cbef9606e82 100755 --- a/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h +++ b/TileCalorimeter/TileIdentifier/TileIdentifier/TileFragHash.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -8,7 +8,8 @@ class TileHWID; -#include <vector> +#include <vector> +#include <string> /** * @class TileFragHash @@ -52,8 +53,13 @@ class TileFragHash { /**return hash type */ TYPE type() const {return m_type;} - - private: + + + /** Printable representation of a type. */ + static std::string typeToString (TYPE type); + + +private: /** total number of IDs */ int m_size; // total number of IDs int m_offset; // different offset for different types of collections diff --git a/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h b/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h index 520847273a6d89e58f2473ec5a721b493f447ca6..5aae15fa879a079e4e983fcdf642516a36501f89 100644 --- a/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h +++ b/TileCalorimeter/TileIdentifier/TileIdentifier/TileRawChannelUnit.h @@ -1,9 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef TILECONDITIONS_TILERAWCHANNELUNIT__H -#define TILECONDITIONS_TILERAWCHANNELUNIT__H +#ifndef TILECONDITIONS_TILERAWCHANNELUNIT_H +#define TILECONDITIONS_TILERAWCHANNELUNIT_H + + +#include <string> + class TileRawChannelUnit { @@ -21,6 +25,10 @@ class TileRawChannelUnit OnlineOffset = 4, Invalid = 99 }; + + + /** Printable representation of a unit. */ + static std::string unitToString (UNIT type); }; #endif diff --git a/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx b/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx index 693b74e8ee0172fcb0260584bcc6420b671c9564..69e58ffdbddcf578931a76349adbe04fa8ee86db 100755 --- a/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx +++ b/TileCalorimeter/TileIdentifier/src/TileFragHash.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -78,3 +78,26 @@ int TileFragHash::hash (const ID& id) const return m_lookup[id]; } + +/** + * @brief Printable representation of a type. + */ +std::string TileFragHash::typeToString (TYPE type) +{ + switch (type) { +#define CASE(X) case TileFragHash::X: return #X + CASE(Digitizer); + CASE(OptFilterDsp); + CASE(OptFilterOffline); + CASE(OptFilterDspCompressed); + CASE(ManyAmps); + CASE(MF); + CASE(FitFilter); + CASE(FitFilterCool); + CASE(FlatFilter); + CASE(Beam); +#undef CASE + default: break; + }; + return "UNKNOWN"; +} diff --git a/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx b/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx new file mode 100644 index 0000000000000000000000000000000000000000..02fe205e4e753acf42c2a2aa91089931502bf347 --- /dev/null +++ b/TileCalorimeter/TileIdentifier/src/TileRawChannelUnit.cxx @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration. + */ + + +#include "TileIdentifier/TileRawChannelUnit.h" + + +/** + * @brief Printable representation of a unit. + */ +std::string TileRawChannelUnit::unitToString (UNIT unit) +{ + switch (unit) { +#define CASE(X) case TileRawChannelUnit::X: return #X + CASE(ADCcounts); + CASE(PicoCoulombs); + CASE(CesiumPicoCoulombs); + CASE(MegaElectronVolts); + CASE(OnlineADCcounts); + CASE(OnlinePicoCoulombs); + CASE(OnlineCesiumPicoCoulombs); + CASE(OnlineMegaElectronVolts); +#undef CASE + default: break; + }; + return "UNKNOWN"; +}