38 ifstream existingChannels(
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/existing_channels.txt");
40 set<DTWireId> wireMap;
44 while (getline(existingChannels,lineMap)) {
45 if( lineMap ==
"" || lineMap[0] ==
'#' )
continue;
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 ==
"" || line[0] ==
'#' )
continue;
68 linestr >> ddu >> ros >> wheel >> station >> sector;
69 cout <<
"DDU: " << ddu << endl
70 <<
"ROS: " << ros << endl
71 <<
"Connected to chamber in Wh: " << wheel <<
" St: " << station <<
" Sec: " << sector << endl;
78 nameTmp <<
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/templates/MB" << station <<
"_" << sector <<
".map";
80 ifstream chamberMap(fileName.c_str());
82 string lineChamberMap;
83 while (getline(chamberMap,lineChamberMap)) {
84 if( lineChamberMap ==
"" || lineChamberMap[0] ==
'#' )
continue;
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;
133 if(robCounter == 3 || robCounter == 4 ) {
136 outRob = robCounter + 18;
137 }
else if(sector == 13) {
138 if(robCounter == 3 || robCounter == 4) {
140 }
else if(robCounter == 0) {
143 outRob = robCounter + 21;
145 }
else if(sector == 11 || sector == 9) {
146 outRob = robCounter + 18;
147 if(robCounter == 3) {
153 outRob = robCounter + 18;
159 outputMap << ddu <<
" " std::string outputMapName
bool checkWireExist(const std::set< DTWireId > &wireMap, int wheel, int station, int sector, int sl, int layer, int wire)