CMS 3D CMS Logo

Functions
L1GlobalTriggerFunctions.cc File Reference
#include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerFunctions.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Functions

int factorial (int n)
 factorial function More...
 
bool hexStringToInt64 (const std::string &hexString, std::vector< unsigned long long > &vecInt64)
 

Function Documentation

int factorial ( int  n)
bool hexStringToInt64 ( const std::string &  ,
std::vector< unsigned long long > &   
)

convert a hex string to a vector of 64-bit integers, with the vector size depending on the string size return false in case of error

Definition at line 16 of file L1GlobalTriggerFunctions.cc.

References TauDecayModes::dec, and LogTrace.

Referenced by L1GtCorrelationCondition::evaluateCondition().

17  {
18 
19  int iVec = 0;
20  size_t initialPos = 0;
21  unsigned long long iValue = 0ULL;
22 
23  do {
24 
25  iValue = 0ULL;
26 
27  if (stringToNumber<unsigned long long>(
28  iValue, hexString.substr(initialPos, 16), std::hex)) {
29 
30  LogTrace("L1GlobalTrigger")
31  << "\n String " << hexString.substr(initialPos, 16)
32  << " converted to hex value 0x" << std::hex << iValue << std::dec
33  << std::endl;
34 
35  vecInt64[iVec] = iValue;
36  } else {
37  LogTrace("L1GlobalTrigger")
38  << "\nstringToNumber failed to convert string "
39  << hexString.substr(initialPos, 16) << std::endl;
40 
41  return false;
42  }
43 
44  initialPos = +16;
45  iVec++;
46  } while (hexString.size() >= (initialPos + 16));
47 
48  return true;
49 }
#define LogTrace(id)