9 #include <unordered_map>
15 : name_(
name), settings_(settings), globals_(global) {
41 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
"nbits: power = " << power;
46 string subname =
name_.substr(
pos, 2);
49 if (subname.substr(0, 1) ==
"L")
50 layer = stoi(subname.substr(1, 1));
51 else if (subname.substr(0, 1) ==
"D")
52 disk = stoi(subname.substr(1, 1));
54 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" " <<
name_ <<
" subname = " << subname <<
" "
55 << layer <<
" " << disk;
61 layerdisk = layer - 1;
79 if (
name_.substr(0, 3) ==
"TE_") {
80 if (
name_[3] ==
'L') {
81 layerdisk1 =
name_[4] -
'1';
82 }
else if (
name_[3] ==
'D') {
83 layerdisk1 = 6 +
name_[4] -
'1';
85 if (
name_[11] ==
'L') {
86 layerdisk2 =
name_[12] -
'1';
87 }
else if (
name_[11] ==
'D') {
88 layerdisk2 = 6 +
name_[12] -
'1';
89 }
else if (
name_[12] ==
'L') {
90 layerdisk2 =
name_[13] -
'1';
91 }
else if (
name_[12] ==
'D') {
92 layerdisk2 = 6 +
name_[13] -
'1';
96 if ((
name_.substr(0, 3) ==
"TC_") || (
name_.substr(0, 3) ==
"TP_")) {
97 if (
name_[3] ==
'L') {
98 layerdisk1 =
name_[4] -
'1';
99 }
else if (
name_[3] ==
'D') {
100 layerdisk1 = 6 +
name_[4] -
'1';
102 if (
name_[5] ==
'L') {
103 layerdisk2 =
name_[6] -
'1';
104 }
else if (
name_[5] ==
'D') {
105 layerdisk2 = 6 +
name_[6] -
'1';
109 if (layerdisk1 == 0 && layerdisk2 == 1)
111 else if (layerdisk1 == 1 && layerdisk2 == 2)
113 else if (layerdisk1 == 2 && layerdisk2 == 3)
115 else if (layerdisk1 == 4 && layerdisk2 == 5)
117 else if (layerdisk1 == 6 && layerdisk2 == 7)
119 else if (layerdisk1 == 8 && layerdisk2 == 9)
121 else if (layerdisk1 == 0 && layerdisk2 == 6)
123 else if (layerdisk1 == 1 && layerdisk2 == 6)
126 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" layerdisk1 " << layerdisk1 <<
" layerdisk2 "
132 std::size_t
pos =
name.find(
"_");
134 pos = name1.find(
"_");
137 unordered_map<string, unsigned int> seedmap = {
138 {
"L1L2", 0}, {
"L2L3", 1}, {
"L3L4", 2}, {
"L5L6", 3}, {
"D1D2", 4}, {
"D3D4", 5}, {
"L1D1", 6},
139 {
"L2D1", 7}, {
"L1L2XX", 0}, {
"L2L3XX", 1}, {
"L3L4XX", 2}, {
"L5L6XX", 3}, {
"D1D2XX", 4}, {
"D3D4XX", 5},
140 {
"L1D1XX", 6}, {
"L2D1XX", 7}, {
"L3L4L2", 8}, {
"L5L6L4", 9}, {
"L2L3D1", 10}, {
"D1D2L2", 11}};
142 if (
found != seedmap.end())
143 return found->second;
146 <<
" - " << name1 <<
" - " <<
name2;