21 string subname =
name_.substr(
pos, 2);
25 if (subname.substr(0, 1) ==
"L")
26 layer = stoi(subname.substr(1, 1));
27 else if (subname.substr(0, 1) ==
"D")
28 disk = stoi(subname.substr(1, 1));
30 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" name = " <<
name_ <<
" subname = " << subname
31 <<
" " << layer <<
" " << disk;
50 static const std::set<char> overlapset = {
51 'X',
'Y',
'W',
'Q',
'R',
'S',
'T',
'Z',
'x',
'y',
'w',
'q',
'r',
's',
't',
'z'};
52 overlap = overlapset.find(subname) != overlapset.end();
54 static const std::set<char> extraset = {
'I',
'J',
'K',
'L'};
55 extra = extraset.find(subname) != extraset.end();
57 static const std::set<char> extendedset = {
58 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'x',
'y',
'z',
'w',
'q',
'r',
's',
't'};
59 extended = extendedset.find(subname) != extendedset.end();
64 size_t pos =
data.find(toSearch);
67 while (
pos != std::string::npos) {
69 data.replace(
pos, toSearch.size(), replaceStr);
71 pos =
data.find(toSearch,
pos + replaceStr.size());
96 out_ <<
"BX = " << (bitset<3>)
bx_ <<
" Event : " <<
event_ << endl;
105 size_t found_pos = haystack.find(needle,
pos);
106 if (0 == nth || string::npos == found_pos)
108 return find_nth(haystack, found_pos + 1, needle, nth - 1);
112 std::ostringstream oss;
113 oss <<
"0x" << std::setfill(
'0') << std::setw(2) << hex <<
index <<
dec;
static size_t find_nth(const std::string &haystack, size_t pos, const std::string &needle, size_t nth)
void initSpecialSeeding(unsigned int pos, bool &overlap, bool &extra, bool &extended)
MemoryBase(std::string name, Settings const &settings)
std::string to_string(const V &value)
void openFile(bool first, std::string dirName, std::string filebase)
void findAndReplaceAll(std::string &data, std::string toSearch, std::string replaceStr)
std::string const & getName() const
static std::string hexstr(unsigned int index)
char data[epos_bytes_allocation]
void initLayerDisk(unsigned int pos, int &layer, int &disk)
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)