Skip to content
Snippets Groups Projects
Commit dcbee6fa authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'enumConvert.TileIdentifier-20181020' into 'master'

TileIdentifier: Add string converters for enums.

See merge request atlas/athena!15180
parents 29db2847 6a4b7ee7
1 merge request!20779WIP: Migrate DataQualityTools to ToolHandles
/*
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
......
/*
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
/*
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";
}
/*
* 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";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment