CMS 3D CMS Logo

L1GlobalTriggerFunctions.cc
Go to the documentation of this file.
1 // this class header
3 
4 // system include files
5 
6 // user include files
8 
9 // methods
10 
11 // factorial function
12 
13 int factorial(int n) { return (n <= 0) ? 1 : (n * factorial(n - 1)); }
14 
15 // hex string to a vector of 64-bit integers
16 bool hexStringToInt64(const std::string &hexString, std::vector<unsigned long long> &vecInt64) {
17  int iVec = 0;
18  size_t initialPos = 0;
19  unsigned long long iValue = 0ULL;
20 
21  do {
22  iValue = 0ULL;
23 
24  if (stringToNumber<unsigned long long>(iValue, hexString.substr(initialPos, 16), std::hex)) {
25  LogTrace("L1GlobalTrigger") << "\n String " << hexString.substr(initialPos, 16) << " converted to hex value 0x"
26  << std::hex << iValue << std::dec << std::endl;
27 
28  vecInt64[iVec] = iValue;
29  } else {
30  LogTrace("L1GlobalTrigger") << "\nstringToNumber failed to convert string " << hexString.substr(initialPos, 16)
31  << std::endl;
32 
33  return false;
34  }
35 
36  initialPos = +16;
37  iVec++;
38  } while (hexString.size() >= (initialPos + 16));
39 
40  return true;
41 }
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
factorial
int factorial(int n)
factorial function
Definition: L1GlobalTriggerFunctions.cc:13
hexStringToInt64
bool hexStringToInt64(const std::string &hexString, std::vector< unsigned long long > &vecInt64)
Definition: L1GlobalTriggerFunctions.cc:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
L1GlobalTriggerFunctions.h