Changeset 4682 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 08/18/04 14:56:21 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4670 r4682 95 95 #include <TLatex.h> 96 96 #include <TLegend.h> 97 #include <TRegexp.h> 97 98 #include <TPaveText.h> 98 99 #include <TPaveStats.h> … … 1125 1126 Bool_t MJCalibration::FindColor() 1126 1127 { 1127 1128 if (fSequence) 1129 { 1130 fColor = MCalibrationCam::kCT1; 1131 return kTRUE; 1132 } 1133 1134 const UInt_t nruns = fRuns->GetNumRuns(); 1135 1136 if (nruns == 0) 1128 if (fSequence) 1129 { 1130 fColor = MCalibrationCam::kCT1; 1131 return kTRUE; 1132 } 1133 1134 const UInt_t nruns = fRuns->GetNumRuns(); 1135 if (nruns == 0) 1136 return kFALSE; 1137 1138 fRuns->Reset(); 1139 1140 TString filenames; 1141 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull()) 1142 { 1143 MCalibrationCam::PulserColor_t newcolor = MCalibrationCam::kNONE; 1144 1145 TString number = filenames(TRegexp("[0-9]+_._.+[.]root$")); 1146 Int_t num = atoi(number.Data()); 1147 1148 if (num<gkIFAEBoxInaugurationRun) 1149 newcolor = MCalibrationCam::kCT1; 1150 1151 switch (num) 1152 { 1153 case 26402: 1154 newcolor = MCalibrationCam::kBLUE; 1155 break; 1156 1157 case 30090: 1158 case 20660: 1159 case 20661: 1160 case 26408: 1161 case 26409: 1162 case 26412: 1163 case 26568: 1164 case 26924: 1165 newcolor = MCalibrationCam::kGREEN; 1166 break; 1167 1168 case 27474: 1169 newcolor = MCalibrationCam::kNONE; 1170 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl; 1171 return kFALSE; 1172 1173 default: 1174 if (filenames.Contains("green")) 1175 newcolor = MCalibrationCam::kGREEN; 1176 if (filenames.Contains("blue")) 1177 newcolor = MCalibrationCam::kBLUE; 1178 if (filenames.Contains("uv")) 1179 newcolor = MCalibrationCam::kUV; 1180 if (filenames.Contains("ct1")) 1181 newcolor = MCalibrationCam::kCT1; 1182 } 1183 1184 if (newcolor==MCalibrationCam::kNONE) 1185 { 1186 *fLog << err << "No color found for " << filenames << "... abort." << endl; 1187 return kFALSE; 1188 } 1189 1190 if (fColor == MCalibrationCam::kNONE) 1191 fColor = newcolor; 1192 1193 if (fColor != newcolor) 1194 { 1195 *fLog << err << "Color mismatch found in " << filenames << "... abort." << endl; 1196 return kFALSE; 1197 } 1198 } 1199 1200 *fLog << inf << "Found color: "; 1201 switch (fColor) 1202 { 1203 case MCalibrationCam::kBLUE: *fLog << "kBLUE"; break; 1204 case MCalibrationCam::kGREEN: *fLog << "kGREEN"; break; 1205 case MCalibrationCam::kUV: *fLog << "kUV"; break; 1206 case MCalibrationCam::kCT1: *fLog << "kCT1"; break; 1207 default: *fLog << "<none>"; break; 1208 } 1209 *fLog << endl; 1210 1211 if (fColor!=MCalibrationCam::kNONE) 1212 return kTRUE; 1213 1214 *fLog << "No colour found in: " << fRuns->GetRunsAsString() << "... abort." << endl; 1137 1215 return kFALSE; 1138 1139 TArrayI arr = fRuns->GetRuns();1140 1141 if (arr[nruns-1] < gkIFAEBoxInaugurationRun)1142 {1143 *fLog << "Found colour kCT1 in runs: " << fRuns->GetRunsAsString() << endl;1144 fColor = MCalibrationCam::kCT1;1145 return kTRUE;1146 }1147 1148 TString filenames;1149 ((MDirIter*)fRuns)->Reset();1150 1151 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull())1152 {1153 1154 filenames.ToLower();1155 1156 //1157 // Here starts the list of runs where the shifters did not put1158 // a colour, but which have been found out by other means.1159 // FIXME: This list has is only preliminary and has to move into the1160 // database!!1161 //1162 if (filenames.Contains("_30090_"))1163 if (fColor == MCalibrationCam::kNONE)1164 {1165 *fLog << "Found colour: kGREEN in " << filenames << endl;1166 fColor = MCalibrationCam::kGREEN;1167 }1168 else if (fColor != MCalibrationCam::kNONE)1169 {1170 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1171 return kFALSE;1172 }1173 1174 if (filenames.Contains("_27474_"))1175 if (fColor == MCalibrationCam::kNONE)1176 {1177 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! "1178 << "Selected runs were: " << filenames << endl;1179 fColor = MCalibrationCam::kNONE;1180 return kFALSE;1181 }1182 else if (fColor != MCalibrationCam::kNONE)1183 {1184 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1185 return kFALSE;1186 }1187 1188 if (filenames.Contains("_26924_"))1189 if (fColor == MCalibrationCam::kNONE)1190 {1191 *fLog << "Found colour: kGREEN in " << filenames << endl;1192 fColor = MCalibrationCam::kGREEN;1193 }1194 else if (fColor != MCalibrationCam::kGREEN)1195 {1196 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1197 return kFALSE;1198 }1199 1200 1201 if (filenames.Contains("_26568_"))1202 if (fColor == MCalibrationCam::kNONE)1203 {1204 *fLog << "Found colour: kGREEN in " << filenames << endl;1205 fColor = MCalibrationCam::kGREEN;1206 }1207 else if (fColor != MCalibrationCam::kGREEN)1208 {1209 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1210 return kFALSE;1211 }1212 1213 if (filenames.Contains("_26412_"))1214 if (fColor == MCalibrationCam::kNONE)1215 {1216 *fLog << "Found colour: kGREEN in " << filenames << endl;1217 fColor = MCalibrationCam::kGREEN;1218 }1219 else if (fColor != MCalibrationCam::kGREEN)1220 {1221 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1222 return kFALSE;1223 }1224 1225 1226 if (filenames.Contains("_26409_"))1227 if (fColor == MCalibrationCam::kNONE)1228 {1229 *fLog << "Found colour: kGREEN in " << filenames << endl;1230 fColor = MCalibrationCam::kGREEN;1231 }1232 else if (fColor != MCalibrationCam::kGREEN)1233 {1234 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1235 return kFALSE;1236 }1237 1238 if (filenames.Contains("_26408_"))1239 if (fColor == MCalibrationCam::kNONE)1240 {1241 *fLog << "Found colour: kGREEN in " << filenames << endl;1242 fColor = MCalibrationCam::kGREEN;1243 }1244 else if (fColor != MCalibrationCam::kGREEN)1245 {1246 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1247 return kFALSE;1248 }1249 1250 1251 if (filenames.Contains("_26402_"))1252 if (fColor == MCalibrationCam::kNONE)1253 {1254 *fLog << "Found colour: kBLUE in " << filenames << endl;1255 fColor = MCalibrationCam::kBLUE;1256 }1257 else if (fColor != MCalibrationCam::kBLUE)1258 {1259 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1260 return kFALSE;1261 }1262 1263 if (filenames.Contains("_20661_"))1264 if (fColor == MCalibrationCam::kNONE)1265 {1266 *fLog << "Found colour: kGREEN in " << filenames << endl;1267 fColor = MCalibrationCam::kGREEN;1268 }1269 else if (fColor != MCalibrationCam::kGREEN)1270 {1271 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1272 return kFALSE;1273 }1274 1275 if (filenames.Contains("_20660_"))1276 if (fColor == MCalibrationCam::kNONE)1277 {1278 *fLog << "Found colour: kGREEN in " << filenames << endl;1279 fColor = MCalibrationCam::kGREEN;1280 }1281 else if (fColor != MCalibrationCam::kGREEN)1282 {1283 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1284 return kFALSE;1285 }1286 1287 //1288 // Here start the runs where the shifter put1289 // the colour.1290 //1291 if (filenames.Contains("green"))1292 if (fColor == MCalibrationCam::kNONE)1293 {1294 *fLog << "Found colour: kGREEN in " << filenames << endl;1295 fColor = MCalibrationCam::kGREEN;1296 }1297 else if (fColor != MCalibrationCam::kGREEN)1298 {1299 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1300 return kFALSE;1301 }1302 1303 if (filenames.Contains("blue"))1304 if (fColor == MCalibrationCam::kNONE)1305 {1306 *fLog << "Found colour: kBLUE in " << filenames << endl;1307 fColor = MCalibrationCam::kBLUE;1308 }1309 else if (fColor != MCalibrationCam::kBLUE)1310 {1311 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1312 return kFALSE;1313 }1314 1315 if (filenames.Contains("uv"))1316 if (fColor == MCalibrationCam::kNONE)1317 {1318 *fLog << "Found colour: kUV in " << filenames << endl;1319 fColor = MCalibrationCam::kUV;1320 }1321 else if (fColor != MCalibrationCam::kUV)1322 {1323 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1324 return kFALSE;1325 }1326 1327 if (filenames.Contains("ct1"))1328 if (fColor == MCalibrationCam::kNONE)1329 {1330 *fLog << "Found colour: kCT1 in " << filenames << endl;1331 fColor = MCalibrationCam::kCT1;1332 }1333 else if (fColor != MCalibrationCam::kCT1)1334 {1335 *fLog << err << "Different colour found in " << filenames << "... abort" << endl;1336 return kFALSE;1337 }1338 1339 }1340 1341 if (fColor == MCalibrationCam::kNONE)1342 {1343 *fLog << "No colour found in filenames of runs: " << fRuns->GetRunsAsString()1344 << "... abort" << endl;1345 return kFALSE;1346 }1347 1348 1349 return kTRUE;1350 1216 } 1351 1217
Note:
See TracChangeset
for help on using the changeset viewer.