CMS 3D CMS Logo

Functions
L1GtDefinitions.cc File Reference
#include "CondFormats/L1TObjects/interface/L1GtDefinitions.h"
#include <cstring>
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Functions

std::string l1GtBoardTypeEnumToString (const L1GtBoardType &boardType)
 
L1GtBoardType l1GtBoardTypeStringToEnum (const std::string &label)
 
std::string l1GtConditionCategoryEnumToString (const L1GtConditionCategory &conditionCategory)
 
L1GtConditionCategory l1GtConditionCategoryStringToEnum (const std::string &label)
 
std::string l1GtConditionTypeEnumToString (const L1GtConditionType &conditionType)
 
L1GtConditionType l1GtConditionTypeStringToEnum (const std::string &label)
 
std::string l1GtPsbQuadEnumToString (const L1GtPsbQuad &psbQuad)
 
L1GtPsbQuad l1GtPsbQuadStringToEnum (const std::string &label)
 

Function Documentation

◆ l1GtBoardTypeEnumToString()

std::string l1GtBoardTypeEnumToString ( const L1GtBoardType boardType)

Definition at line 132 of file L1GtDefinitions.cc.

132  {
133  char const* result = valueToKey(boardType, l1GtBoardTypeStringToEnumMap);
134  if (boardType == BoardNull) {
135  edm::LogInfo("L1GtDefinitions") << "\n BoardNull means no valid board type defined!";
136  }
137  if (!result) {
138  edm::LogInfo("L1GtDefinitions") << "\n '" << boardType << "' is not a recognized L1GtBoardType. "
139  << "\n Return BoardNull, which means no valid board type defined!";
140  return "BoardNull";
141  }
142  return result;
143 }

References BoardNull, and mps_fire::result.

◆ l1GtBoardTypeStringToEnum()

L1GtBoardType l1GtBoardTypeStringToEnum ( const std::string &  label)

Definition at line 118 of file L1GtDefinitions.cc.

118  {
119  L1GtBoardType value = keyToValue(label.c_str(), l1GtBoardTypeStringToEnumMap);
120  if (value == (L1GtBoardType)-1) {
121  edm::LogInfo("L1GtDefinitions") << "\n '" << label << "' is not a recognized L1GtBoardType. \n Return BoardNull.";
122  value = BoardNull;
123  }
124 
125  if (value == BoardNull) {
126  edm::LogInfo("L1GtDefinitions") << "\n BoardNull means no valid board type defined!";
127  }
128 
129  return value;
130 }

References BoardNull, l1t::BoardNull, label, and relativeConstraints::value.

◆ l1GtConditionCategoryEnumToString()

std::string l1GtConditionCategoryEnumToString ( const L1GtConditionCategory conditionCategory)

Definition at line 225 of file L1GtDefinitions.cc.

225  {
226  char const* result = valueToKey(conditionCategory, l1GtConditionCategoryStringToEnumMap);
227  if (conditionCategory == CondNull)
228  edm::LogInfo("L1GtDefinitions") << "\n Return CondNull, which means no valid condition category defined!";
229 
230  if (!result) {
231  result = "CondNull";
232  edm::LogInfo("L1GtDefinitions") << "\n '" << conditionCategory << "' is not a recognized L1GtConditionCategory. "
233  << "\n Return CondNull, which means no valid condition category defined!";
234  }
235 
236  return result;
237 }

References CondNull, and mps_fire::result.

Referenced by L1GtHwValidation::excludedAlgoList().

◆ l1GtConditionCategoryStringToEnum()

L1GtConditionCategory l1GtConditionCategoryStringToEnum ( const std::string &  label)

Definition at line 207 of file L1GtDefinitions.cc.

207  {
208  L1GtConditionCategory value = keyToValue(label.c_str(), l1GtConditionCategoryStringToEnumMap);
209  // in case of unrecognized L1GtConditionCategory, return CondNull
210  // to be dealt by the corresponding module
211  if (value == (L1GtConditionCategory)-1) {
212  edm::LogInfo("L1GtDefinitions") << "\n '" << label
213  << "' is not a recognized L1GtConditionCategory. \n Return CondNull.";
214 
215  value = CondNull;
216  }
217 
218  if (value == CondNull) {
219  edm::LogInfo("L1GtDefinitions") << "\n CondNull means no valid condition category defined!";
220  }
221 
222  return value;
223 }

References CondNull, l1t::CondNull, label, and relativeConstraints::value.

Referenced by L1GtHwValidation::L1GtHwValidation().

◆ l1GtConditionTypeEnumToString()

std::string l1GtConditionTypeEnumToString ( const L1GtConditionType conditionType)

Definition at line 195 of file L1GtDefinitions.cc.

195  {
196  const char* result = valueToKey(conditionType, l1GtConditionTypeStringToEnumMap);
197  if (conditionType == TypeNull)
198  edm::LogInfo("L1GtDefinitions") << "\n Return TypeNull, which means no valid condition type defined!";
199  if (!result) {
200  result = "TypeNull";
201  edm::LogInfo("L1GtDefinitions") << "\n '" << conditionType << "' is not a recognized L1GtConditionType. "
202  << "\n Return TypeNull, which means no valid condition type defined!";
203  }
204  return result;
205 }

References writeEcalDQMStatus::conditionType, mps_fire::result, and TypeNull.

Referenced by L1GtHwValidation::excludedAlgoList().

◆ l1GtConditionTypeStringToEnum()

L1GtConditionType l1GtConditionTypeStringToEnum ( const std::string &  label)

Definition at line 176 of file L1GtDefinitions.cc.

176  {
177  L1GtConditionType value = keyToValue(label.c_str(), l1GtConditionTypeStringToEnumMap);
178 
179  // in case of unrecognized L1GtConditionType, return TypeNull
180  // to be dealt by the corresponding module
181  if (value == (L1GtConditionType)-1) {
182  edm::LogInfo("L1GtDefinitions") << "\n '" << label
183  << "' is not a recognized L1GtConditionType. \n Return TypeNull.";
184 
185  value = TypeNull;
186  }
187 
188  if (value == TypeNull) {
189  edm::LogInfo("L1GtDefinitions") << "\n TypeNull means no valid condition type defined!";
190  }
191 
192  return value;
193 }

References label, TypeNull, l1t::TypeNull, and relativeConstraints::value.

Referenced by L1GtHwValidation::L1GtHwValidation().

◆ l1GtPsbQuadEnumToString()

std::string l1GtPsbQuadEnumToString ( const L1GtPsbQuad psbQuad)

Definition at line 163 of file L1GtDefinitions.cc.

163  {
164  char const* result = valueToKey(psbQuad, l1GtPsbQuadStringToEnumMap);
165  if (psbQuad == PsbQuadNull)
166  edm::LogInfo("L1GtDefinitions") << "\n PsbQuadNull means no valid PSB quadruplet defined!";
167  if (!result) {
168  result = "PsbQuadNull";
169  edm::LogInfo("L1GtDefinitions") << "\n '" << psbQuad << "' is not a recognized L1GtPsbQuad. "
170  << "\n Return PsbQuadNull, which means no valid PSB quadruplet defined!";
171  }
172 
173  return result;
174 }

References PsbQuadNull, and mps_fire::result.

◆ l1GtPsbQuadStringToEnum()

L1GtPsbQuad l1GtPsbQuadStringToEnum ( const std::string &  label)

Definition at line 147 of file L1GtDefinitions.cc.

147  {
148  L1GtPsbQuad value = keyToValue(label.c_str(), l1GtPsbQuadStringToEnumMap);
149  // in case of unrecognized L1GtPsbQuad, return PsbQuadNull
150  // to be dealt by the corresponding module
151  if (value == (L1GtPsbQuad)-1) {
152  edm::LogInfo("L1GtDefinitions") << "\n '" << label << "' is not a recognized L1GtPsbQuad. \n Return PsbQuadNull.";
153  value = PsbQuadNull;
154  }
155 
156  if (value == PsbQuadNull) {
157  edm::LogInfo("L1GtDefinitions") << "\n PsbQuadNull means no valid PSB quadruplet defined!";
158  }
159 
160  return value;
161 }

References label, PsbQuadNull, and relativeConstraints::value.

edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
writeEcalDQMStatus.conditionType
conditionType
Definition: writeEcalDQMStatus.py:52
L1GtConditionCategory
L1GtConditionCategory
condition categories
Definition: L1GtDefinitions.h:26
CondNull
Definition: L1GtDefinitions.h:27
L1GtConditionType
L1GtConditionType
Definition: L1GtDefinitions.h:4
value
Definition: value.py:1
relativeConstraints.value
value
Definition: relativeConstraints.py:53
BoardNull
Definition: L1GtDefinitions.h:28
PsbQuadNull
Definition: L1GtDefinitions.h:65
mps_fire.result
result
Definition: mps_fire.py:311
TypeNull
Definition: L1GtDefinitions.h:5
L1GtBoardType
L1GtBoardType
board types in GT
Definition: L1GtDefinitions.h:28
label
const char * label
Definition: PFTauDecayModeTools.cc:11
L1GtPsbQuad
L1GtPsbQuad
quadruples sent to GT via PSB
Definition: L1GtDefinitions.h:39