37 ifstream existingChannels(
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/existing_channels.txt");
39 set<DTWireId> wireMap;
43 while (getline(existingChannels, lineMap)) {
44 if (lineMap.empty() || lineMap[0] ==
'#')
48 int wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx;
49 linestr >> wheelEx >> sectorEx >> stationEx >> slEx >> layerEx >> wireEx;
50 DTWireId wireIdEx(wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx);
51 wireMap.insert(wireIdEx);
53 cout <<
"Map size: " << wireMap.size() << endl;
63 while (getline(skeletonMap, line)) {
64 if (line.empty() || line[0] ==
'#')
68 int ddu, ros, wheel,
station, sector;
69 linestr >> ddu >> ros >> wheel >> station >> sector;
70 cout <<
"DDU: " << ddu << endl
71 <<
"ROS: " << ros << endl
72 <<
"Connected to chamber in Wh: " << wheel <<
" St: " << station <<
" Sec: " << sector << endl;
79 nameTmp <<
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/templates/MB" << station <<
"_" << sector <<
".map";
81 ifstream chamberMap(fileName.c_str());
83 string lineChamberMap;
84 while (getline(chamberMap, lineChamberMap)) {
85 if (lineChamberMap.empty() || lineChamberMap[0] ==
'#')
87 stringstream chamberMapStr;
88 chamberMapStr << lineChamberMap;
90 int rob, tdc, tdcChannel, sl,
layer, wire;
91 int unusedRos, unusedChamberCode;
93 chamberMapStr >> unusedRos >> rob >> tdc >> tdcChannel >> unusedChamberCode >> sl >> layer >> wire;
96 if (!
checkWireExist(wireMap, wheel, station, sector, sl, layer, wire))
99 if (rob > previousROB) {
102 }
else if (rob < previousROB) {
103 cout <<
"Error: ROB number is not uniformly increasing!" << endl;
110 }
else if (station == 2) {
111 outRob = robCounter + 6;
112 }
else if (station == 3) {
114 outRob = robCounter + 12;
115 else if (robCounter == 3)
117 else if (robCounter > 3)
118 outRob = robCounter + 11;
119 }
else if (station == 4) {
121 if (robCounter == 3) {
124 outRob = robCounter + 18;
125 }
else if (sector == 10) {
126 if (robCounter == 3) {
128 }
else if (robCounter == 0) {
131 outRob = robCounter + 21;
135 if (robCounter == 3 || robCounter == 4) {
138 outRob = robCounter + 18;
139 }
else if (sector == 13) {
140 if (robCounter == 3 || robCounter == 4) {
142 }
else if (robCounter == 0) {
145 outRob = robCounter + 21;
147 }
else if (sector == 11 || sector == 9) {
148 outRob = robCounter + 18;
149 if (robCounter == 3) {
155 outRob = robCounter + 18;
161 outputMap << ddu <<
" " << ros <<
" " << outRob <<
" " << tdc <<
" " << tdcChannel <<
" " << wheel <<
" "
162 << station <<
" " << sector <<
" " << sl <<
" " << layer <<
" " << wire << endl;
std::string outputMapName
bool checkWireExist(const std::set< DTWireId > &wireMap, int wheel, int station, int sector, int sl, int layer, int wire)
constexpr std::array< uint8_t, layerIndexSize > layer