40 ifstream existingChannels(
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/existing_channels.txt");
42 set<DTWireId> wireMap;
46 while (getline(existingChannels,lineMap)) {
47 if( lineMap ==
"" || lineMap[0] ==
'#' )
continue;
50 int wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx;
51 linestr >> wheelEx >> sectorEx >> stationEx >> slEx >> layerEx >> wireEx;
52 DTWireId wireIdEx(wheelEx, stationEx, sectorEx, slEx, layerEx, wireEx);
53 wireMap.insert(wireIdEx);
55 cout <<
"Map size: " << wireMap.size() << endl;
65 while (getline(skeletonMap,line)) {
66 if( line ==
"" || line[0] ==
'#' )
continue;
69 int ddu, ros, wheel,
station, sector;
70 linestr >> ddu >> ros >> wheel >> station >> sector;
71 cout <<
"DDU: " << ddu << endl
72 <<
"ROS: " << ros << endl
73 <<
"Connected to chamber in Wh: " << wheel <<
" St: " << station <<
" Sec: " << sector << endl;
80 nameTmp <<
"/afs/cern.ch/cms/Physics/muon/CMSSW/DT/channelsMaps/templates/MB" << station <<
"_" << sector <<
".map";
82 ifstream chamberMap(fileName.c_str());
84 string lineChamberMap;
85 while (getline(chamberMap,lineChamberMap)) {
86 if( lineChamberMap ==
"" || lineChamberMap[0] ==
'#' )
continue;
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 <<
" "
std::string outputMapName
bool checkWireExist(const std::set< DTWireId > &wireMap, int wheel, int station, int sector, int sl, int layer, int wire)