9 #include <unordered_map> 15 : name_(
name), settings_(settings), globals_(global) {}
29 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
"nbits: power = " <<
power;
34 string subname =
name_.substr(
pos, 2);
37 if (subname.substr(0, 1) ==
"L")
38 layer = stoi(subname.substr(1, 1));
39 else if (subname.substr(0, 1) ==
"D")
40 disk = stoi(subname.substr(1, 1));
42 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" " <<
name_ <<
" subname = " << subname <<
" " 43 << layer <<
" " << disk;
49 layerdisk = layer - 1;
67 if (
name_.substr(0, 3) ==
"TE_") {
68 if (
name_[3] ==
'L') {
69 layerdisk1 =
name_[4] -
'1';
70 }
else if (
name_[3] ==
'D') {
73 if (
name_[11] ==
'L') {
74 layerdisk2 =
name_[12] -
'1';
75 }
else if (
name_[11] ==
'D') {
77 }
else if (
name_[12] ==
'L') {
78 layerdisk2 =
name_[13] -
'1';
79 }
else if (
name_[12] ==
'D') {
84 if ((
name_.substr(0, 3) ==
"TC_") || (
name_.substr(0, 3) ==
"TP_")) {
85 if (
name_[3] ==
'L') {
86 layerdisk1 =
name_[4] -
'1';
87 }
else if (
name_[3] ==
'D') {
90 if (
name_[5] ==
'L') {
91 layerdisk2 =
name_[6] -
'1';
92 }
else if (
name_[5] ==
'D') {
114 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" layerdisk1 " << layerdisk1 <<
" layerdisk2 " 120 unsigned int& layerdisk2,
121 unsigned int& layerdisk3,
122 unsigned int& iSeed) {
127 if (
name_.substr(0, 4) ==
"TPD_") {
129 layerdisk1 =
name_[5] -
'1';
130 else if (
name_[4] ==
'D')
133 layerdisk2 =
name_[7] -
'1';
134 else if (
name_[6] ==
'D')
137 layerdisk3 =
name_[9] -
'1';
138 else if (
name_[8] ==
'D')
151 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" layerdisk1 " << layerdisk1 <<
" layerdisk2 " 152 << layerdisk2 <<
" layerdisk3 " << layerdisk3;
157 std::size_t
pos =
name.find(
'_');
159 pos = name1.find(
'_');
162 unordered_map<string, unsigned int> seedmap = {
163 {
"L1L2", 0}, {
"L2L3", 1}, {
"L3L4", 2}, {
"L5L6", 3}, {
"D1D2", 4}, {
"D3D4", 5}, {
"L1D1", 6},
164 {
"L2D1", 7}, {
"L1L2XX", 0}, {
"L2L3XX", 1}, {
"L3L4XX", 2}, {
"L5L6XX", 3}, {
"D1D2XX", 4}, {
"D3D4XX", 5},
165 {
"L1D1XX", 6}, {
"L2D1XX", 7}, {
"L3L4L2", 8}, {
"L5L6L4", 9}, {
"L2L3D1", 10}, {
"D1D2L2", 11}};
167 if (
found != seedmap.end())
168 return found->second;
171 <<
" - " << name1 <<
" - " <<
name2;
void initLayerDisksandISeed(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
void initLayerDisksandISeedDisp(unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &layerdisk3, unsigned int &iSeed)
ProcessBase(std::string name, Settings const &settings, Globals *global)
unsigned int nbits(unsigned int power)
void initLayerDisk(unsigned int pos, int &layer, int &disk)
unsigned int getISeed(const std::string &name)
std::string const & getName() const