Changeset 5064 for trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
- Timestamp:
- 09/16/04 12:02:45 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r5030 r5064 200 200 MJCalibration::MJCalibration(const char *name, const char *title) 201 201 : fRuns(0), fExtractor(NULL), fTimeExtractor(NULL), 202 fColor(MCalibrationCam::kNONE), fDisplayType(k NormalDisplay),202 fColor(MCalibrationCam::kNONE), fDisplayType(kDataCheckDisplay), 203 203 fGeometry("MGeomCamMagic") 204 204 { … … 1294 1294 } 1295 1295 1296 1297 // --------------------------------------------------------------------------1298 //1299 // Find the colour of the pulsing LED:1300 // - If the run number is smaller than gkIFAEBoxInaugurationRun, take MCalibrationCam::kCT11301 // - Otherwise find the colour out of the run name1302 // - If no colour is found, return kFALSE1303 //1304 Bool_t MJCalibration::FindColor()1305 {1306 if (fColor != MCalibrationCam::kNONE)1307 return kTRUE;1308 1309 if (fSequence.IsValid())1310 {1311 fColor = MCalibrationCam::kCT1;1312 return kTRUE;1313 }1314 1315 const UInt_t nruns = fRuns->GetNumRuns();1316 if (nruns == 0)1317 return kFALSE;1318 1319 fRuns->Reset();1320 1321 TString filenames;1322 while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull())1323 {1324 MCalibrationCam::PulserColor_t newcolor = MCalibrationCam::kNONE;1325 1326 TString number = filenames(TRegexp("[0-9]+_._.+[.]root$"));1327 Int_t num = atoi(number.Data());1328 1329 if (num<gkIFAEBoxInaugurationRun)1330 newcolor = MCalibrationCam::kCT1;1331 1332 switch (num)1333 {1334 case 26402:1335 case 22246:1336 case 22253:1337 newcolor = MCalibrationCam::kBLUE;1338 break;1339 1340 case 30090:1341 case 20660:1342 case 20661:1343 case 26408:1344 case 26409:1345 case 26412:1346 case 26568:1347 case 26924:1348 newcolor = MCalibrationCam::kGREEN;1349 break;1350 1351 case 27474:1352 newcolor = MCalibrationCam::kNONE;1353 *fLog << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl;1354 return kFALSE;1355 1356 default:1357 if (filenames.Contains("green",TString::kIgnoreCase))1358 newcolor = MCalibrationCam::kGREEN;1359 if (filenames.Contains("blue",TString::kIgnoreCase))1360 newcolor = MCalibrationCam::kBLUE;1361 if (filenames.Contains("uv",TString::kIgnoreCase))1362 newcolor = MCalibrationCam::kUV;1363 if (filenames.Contains("ct1",TString::kIgnoreCase))1364 newcolor = MCalibrationCam::kCT1;1365 }1366 1367 if (newcolor==MCalibrationCam::kNONE)1368 {1369 *fLog << err << "No color found for " << filenames << "... abort." << endl;1370 return kFALSE;1371 }1372 1373 if (fColor == MCalibrationCam::kNONE)1374 fColor = newcolor;1375 1376 if (fColor != newcolor)1377 {1378 *fLog << err << "Color mismatch found in " << filenames << "... abort." << endl;1379 return kFALSE;1380 }1381 }1382 1383 *fLog << inf << "Found color: ";1384 switch (fColor)1385 {1386 case MCalibrationCam::kBLUE: *fLog << "kBLUE"; break;1387 case MCalibrationCam::kGREEN: *fLog << "kGREEN"; break;1388 case MCalibrationCam::kUV: *fLog << "kUV"; break;1389 case MCalibrationCam::kCT1: *fLog << "kCT1"; break;1390 default: *fLog << "<none>"; break;1391 }1392 *fLog << endl;1393 1394 if (fColor!=MCalibrationCam::kNONE)1395 return kTRUE;1396 1397 *fLog << "No colour found in: " << fRuns->GetRunsAsString() << "... abort." << endl;1398 return kFALSE;1399 }1400 1401 1296 // -------------------------------------------------------------------------- 1402 1297 // … … 1439 1334 Bool_t MJCalibration::CheckEnvLocal() 1440 1335 { 1441 TString col = GetEnv("Color", "");1442 if (!col.IsNull())1443 {1444 }1445 1446 1336 TString dis = GetEnv("Display", ""); 1447 1337 if (dis.BeginsWith("Full", TString::kIgnoreCase)) … … 1592 1482 fLog->Separator(GetDescriptor()); 1593 1483 1594 // if (!FindColor())1595 // return kFALSE;1596 1597 1484 *fLog << "Calculate MCalibrationCam from "; 1598 1485 if (fSequence.IsValid())
Note:
See TracChangeset
for help on using the changeset viewer.