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 134 of file L1GtDefinitions.cc.

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

References BoardNull, and mps_fire::result.

◆ l1GtBoardTypeStringToEnum()

L1GtBoardType l1GtBoardTypeStringToEnum ( const std::string &  label)

Definition at line 120 of file L1GtDefinitions.cc.

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

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

◆ l1GtConditionCategoryEnumToString()

std::string l1GtConditionCategoryEnumToString ( const L1GtConditionCategory conditionCategory)

Definition at line 227 of file L1GtDefinitions.cc.

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

References CondNull, and mps_fire::result.

Referenced by L1GtHwValidation::excludedAlgoList().

◆ l1GtConditionCategoryStringToEnum()

L1GtConditionCategory l1GtConditionCategoryStringToEnum ( const std::string &  label)

Definition at line 209 of file L1GtDefinitions.cc.

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

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

Referenced by L1GtHwValidation::L1GtHwValidation().

◆ l1GtConditionTypeEnumToString()

std::string l1GtConditionTypeEnumToString ( const L1GtConditionType conditionType)

Definition at line 197 of file L1GtDefinitions.cc.

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

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

Referenced by L1GtHwValidation::excludedAlgoList().

◆ l1GtConditionTypeStringToEnum()

L1GtConditionType l1GtConditionTypeStringToEnum ( const std::string &  label)

Definition at line 178 of file L1GtDefinitions.cc.

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

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

Referenced by L1GtHwValidation::L1GtHwValidation().

◆ l1GtPsbQuadEnumToString()

std::string l1GtPsbQuadEnumToString ( const L1GtPsbQuad psbQuad)

Definition at line 165 of file L1GtDefinitions.cc.

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

References PsbQuadNull, and mps_fire::result.

◆ l1GtPsbQuadStringToEnum()

L1GtPsbQuad l1GtPsbQuadStringToEnum ( const std::string &  label)

Definition at line 149 of file L1GtDefinitions.cc.

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

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