#include <string>
Go to the source code of this file.
Classes | |
struct | L1GtObjectStringToEnum |
the string to enum and enum to string conversions for L1GtObject More... | |
Enumerations | |
enum | L1GtObject { Mu, NoIsoEG, IsoEG, CenJet, ForJet, TauJet, ETM, ETT, HTT, HTM, JetCounts, HfBitCounts, HfRingEtSums, TechTrig, Castor, BPTX, GtExternal, ObjNull } |
Functions | |
std::string | l1GtObjectEnumToString (const L1GtObject &) |
L1GtObject | l1GtObjectStringToEnum (const std::string &) |
enum L1GtObject |
L1 GT objects ObjNull catch all errors
Mu | |
NoIsoEG | |
IsoEG | |
CenJet | |
ForJet | |
TauJet | |
ETM | |
ETT | |
HTT | |
HTM | |
JetCounts | |
HfBitCounts | |
HfRingEtSums | |
TechTrig | |
Castor | |
BPTX | |
GtExternal | |
ObjNull |
Definition at line 30 of file L1GtObject.h.
std::string l1GtObjectEnumToString | ( | const L1GtObject & | ) |
Definition at line 76 of file L1GtObject.cc.
References BPTX, CenJet, ETM, ETT, ForJet, GtExternal, HfBitCounts, HfRingEtSums, HTM, HTT, IsoEG, JetCounts, Mu, NoIsoEG, ObjNull, TauJet, and TechTrig.
{ std::string gtObjectString; switch (gtObject) { case Mu: { gtObjectString = "Mu"; } break; case NoIsoEG: { gtObjectString = "NoIsoEG"; } break; case IsoEG: { gtObjectString = "IsoEG"; } break; case CenJet: { gtObjectString = "CenJet"; } break; case ForJet: { gtObjectString = "ForJet"; } break; case TauJet: { gtObjectString = "TauJet"; } break; case ETM: { gtObjectString = "ETM"; } break; case ETT: { gtObjectString = "ETT"; } break; case HTT: { gtObjectString = "HTT"; } break; case HTM: { gtObjectString = "HTM"; } break; case JetCounts: { gtObjectString = "JetCounts"; } break; case HfBitCounts: { gtObjectString = "HfBitCounts"; } break; case HfRingEtSums: { gtObjectString = "HfRingEtSums"; } break; case TechTrig: { gtObjectString = "TechTrig"; } break; case Castor: { gtObjectString = "Castor"; } break; case BPTX: { gtObjectString = "BPTX"; } break; case GtExternal: { gtObjectString = "GtExternal"; } break; case ObjNull: { gtObjectString = "ObjNull"; edm::LogInfo("L1GtObject") << "\n ObjNull means no valid L1GtObject defined!"; } break; default: { edm::LogInfo("L1GtObject") << "\n '" << gtObject << "' is not a recognized L1GtObject. " << "\n Return ObjNull, which means no valid L1GtObject defined!"; gtObjectString = "ObjNull"; } break; } return gtObjectString; }
L1GtObject l1GtObjectStringToEnum | ( | const std::string & | ) |
Definition at line 26 of file L1GtObject.cc.
References BPTX, CenJet, ETM, ETT, ForJet, newFWLiteAna::found, GtExternal, HfBitCounts, HfRingEtSums, HTM, HTT, i, IsoEG, JetCounts, L1GtObjectStringToEnum::label, Mu, NoIsoEG, ObjNull, TauJet, TechTrig, L1GtObjectStringToEnum::value, and relativeConstraints::value.
{ static L1GtObjectStringToEnum l1GtObjectStringToEnumMap[] = { {"Mu", Mu}, {"NoIsoEG", NoIsoEG}, {"IsoEG", IsoEG}, {"CenJet", CenJet}, {"ForJet", ForJet}, {"TauJet", TauJet}, {"ETM", ETM}, {"ETT", ETT}, {"HTT", HTT}, {"HTM", HTM}, {"JetCounts", JetCounts}, {"HfBitCounts", HfBitCounts}, {"HfRingEtSums", HfRingEtSums}, {"TechTrig", TechTrig}, {"Castor", Castor}, {"BPTX", BPTX}, {"GtExternal", GtExternal}, {"ObjNull", ObjNull}, {0, (L1GtObject) - 1} }; L1GtObject value = (L1GtObject) - 1; bool found = false; for (int i = 0; l1GtObjectStringToEnumMap[i].label && (!found); ++i) if (!std::strcmp(label.c_str(), l1GtObjectStringToEnumMap[i].label)) { found = true; value = l1GtObjectStringToEnumMap[i].value; } // in case of unrecognized L1GtObject, returns Mu // and write a warning (to not throw an exception) if (!found) { edm::LogInfo("L1GtObject") << "\n '" << label << "' is not a recognized L1GtObject. \n Return ObjNull."; value = ObjNull; } if (value == ObjNull) { edm::LogInfo("L1GtObject") << "\n ObjNull means no valid L1GtObject defined!"; } return value; }