35 ifstream existingChannels(
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/existing_channels.txt");
37 set<DTWireId> wireMap;
41 while (getline(existingChannels, lineMap)) {
42 if (lineMap.empty() || lineMap[0] ==
'#')
46 int wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx;
47 linestr >> wheelEx >> sectorEx >> stationEx >> slEx >> layerEx >> wireEx;
48 DTWireId wireIdEx(wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx);
49 wireMap.insert(wireIdEx);
51 cout <<
"Map size: " << wireMap.size() << endl;
61 while (getline(skeletonMap, line)) {
62 if (line.empty() || line[0] ==
'#')
66 int ddu, ros, wheel,
station, sector;
67 linestr >> ddu >> ros >> wheel >> station >> sector;
68 cout <<
"DDU: " << ddu << endl
69 <<
"ROS: " << ros << endl
70 <<
"Connected to chamber in Wh: " << wheel <<
" St: " << station <<
" Sec: " << sector << endl;
77 nameTmp <<
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/templates/MB" << station <<
"_" << sector <<
".map";
79 ifstream chamberMap(fileName.c_str());
81 string lineChamberMap;
82 while (getline(chamberMap, lineChamberMap)) {
83 if (lineChamberMap.empty() || lineChamberMap[0] ==
'#')
85 stringstream chamberMapStr;
86 chamberMapStr << lineChamberMap;
88 int rob, tdc, tdcChannel, sl,
layer, wire;
89 int unusedRos, unusedChamberCode;
91 chamberMapStr >> unusedRos >> rob >> tdc >> tdcChannel >> unusedChamberCode >> sl >> layer >> wire;
94 if (!
checkWireExist(wireMap, wheel, station, sector, sl, layer, wire))
97 if (rob > previousROB) {
100 }
else if (rob < previousROB) {
101 cout <<
"Error: ROB number is not uniformly increasing!" << endl;
108 }
else if (station == 2) {
109 outRob = robCounter + 6;
110 }
else if (station == 3) {
112 outRob = robCounter + 12;
113 else if (robCounter == 3)
115 else if (robCounter > 3)
116 outRob = robCounter + 11;
117 }
else if (station == 4) {
119 if (robCounter == 3) {
122 outRob = robCounter + 18;
123 }
else if (sector == 10) {
124 if (robCounter == 3) {
126 }
else if (robCounter == 0) {
129 outRob = robCounter + 21;
131 }
else if (sector == 4) {
132 if (robCounter == 3 || robCounter == 4) {
135 outRob = robCounter + 18;
136 }
else if (sector == 13) {
137 if (robCounter == 3 || robCounter == 4) {
139 }
else if (robCounter == 0) {
142 outRob = robCounter + 21;
144 }
else if (sector == 11 || sector == 9) {
145 outRob = robCounter + 18;
146 if (robCounter == 3) {
152 outRob = robCounter + 18;
158 outputMap << ddu <<
" " << ros <<
" " << outRob <<
" " << tdc <<
" " << tdcChannel <<
" " << wheel <<
" "
159 << 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