Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:59

0001 #ifndef GlobalTrigger_L1GlobalTriggerFunctions_h
0002 #define GlobalTrigger_L1GlobalTriggerFunctions_h
0003 
0004 #include <string>
0005 #include <vector>
0006 
0007 #include <fstream>
0008 #include <iostream>
0009 #include <sstream>
0010 
0011 /// factorial function
0012 int factorial(int n);
0013 
0014 /// convert a hex string to a vector of 64-bit integers,
0015 /// with the vector size depending on the string size
0016 /// return false in case of error
0017 bool hexStringToInt64(const std::string &, std::vector<unsigned long long> &);
0018 
0019 /// convert a string to a integer-type number
0020 /// the third parameter of stringToNumber should be
0021 /// one of std::hex, std::dec or std::oct
0022 template <class T>
0023 bool stringToNumber(T &tmpl, const std::string &str, std::ios_base &(*f)(std::ios_base &)) {
0024   std::istringstream iss(str);
0025   return !(iss >> f >> tmpl).fail();
0026 }
0027 
0028 #endif /*GlobalTrigger_L1GlobalTriggerFunctions_h*/