- Timestamp:
- 01/31/12 11:24:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mjobs/MSequence.cc
r11410 r12795 181 181 // + fTelescope 182 182 // 183 // Class Version 7: 184 // ---------------- 185 // + fDrsRuns 186 // + fDrsRunsSub 187 // + fDrsFiles 188 // + fDrsFilesSub 189 // + fDrsSequence 190 // 183 191 ///////////////////////////////////////////////////////////////////////////// 184 192 #include "MSequenceSQL.h" … … 417 425 switch (type&kFilePaths) 418 426 { 427 case kDrs: 428 case kFits: 429 d += "raw/"; 430 d += fNight.GetStringFmt("%Y/%m/%d"); 431 break; 419 432 case kRaw: // rawdata 420 433 case kRoot: // mcdata … … 455 468 // /magic/simulated/ceres/001/000/0001/cer123456 456 469 return MString::Format("cer%06d", -run); 470 } 471 472 TString n; 473 474 if ((type&kRunType)==kDrsFile) 475 { 476 n += night.GetStringFmt("%Y%m%d_"); 477 n += MString::Format("%03d", run); 478 n += ".drs.fits.?g?z?"; 479 return n; 480 } 481 if ((type&kFileType)==kFits) 482 { 483 n += night.GetStringFmt("%Y%m%d_"); 484 n += MString::Format("%03d", run); 485 n += ".fits.?g?z?"; 486 return n; 457 487 } 458 488 … … 489 519 490 520 // ------------- Create file name -------------- 491 TString n;492 493 521 if (night) 494 522 n += night.GetStringFmt("%Y%m%d_"); … … 667 695 } 668 696 697 UInt_t MSequence::GetDrsFile() const 698 { 699 if (fDrsRuns.GetSize()==0) 700 return fDrsFiles[0]; 701 702 UInt_t rc = 0; 703 for (int i=0; i<fDrsFiles.GetSize(); i++) 704 { 705 for (int j=0; j<fPedRuns.GetSize(); j++) 706 { 707 if (fDrsFiles[i]==fPedRuns[j]) 708 rc = fDrsFiles[i]; 709 } 710 } 711 712 return rc; 713 } 714 669 715 // -------------------------------------------------------------------------- 670 716 // … … 675 721 TString MSequence::GetFileName(UInt_t i, const TArrayI &arr, const TArrayI &sub, FileType_t type, const char *path) const 676 722 { 723 if (i>=(UInt_t)arr.GetSize()) 724 return ""; 725 677 726 if (IsExcluded(arr[i], sub[i])) 678 727 return "0"; … … 693 742 switch ((RunType_t)(type&(kRunType|kExcl))) 694 743 { 744 case kDrsRun: 745 r = &fDrsRuns; 746 f = &fDrsRunsSub; 747 break; 748 case kDrsFile: 749 r = &fDrsFiles; 750 f = &fDrsFilesSub; 751 break; 695 752 case kPed: 696 753 r = &fPedRuns; … … 913 970 fLastRun = GetEnvValue2(env, prefix, "LastRun", -1); 914 971 fNumEvents = GetEnvValue2(env, prefix, "NumEvents", -1); 972 fDrsSequence = GetEnvValue2(env, prefix, "DrsSequence", 0); 915 973 916 974 TString str; … … 935 993 Split(env, prefix, "PedRuns", fPedRuns, fPedRunsSub); 936 994 Split(env, prefix, "DatRuns", fDatRuns, fDatRunsSub); 995 Split(env, prefix, "DrsRuns", fDrsRuns, fDrsRunsSub); 996 Split(env, prefix, "DrsFiles",fDrsFiles, fDrsFilesSub); 937 997 Split(env, prefix, "Exclude", fExclRuns, fExclRunsSub); 998 999 if (fDrsRuns.GetSize()==0 && fDrsFiles.GetSize()>1) 1000 gLog << warn << "WARNING - In a data sequence only one DrsFiles entry makes sense." << endl; 938 1001 939 1002 // Dummies: … … 1089 1152 // fDatRuns 1090 1153 // fDatRunsSub 1154 // fDrsRuns 1155 // fDrsRunsSub 1091 1156 // fExclRuns 1092 1157 // fExclRunsSub … … 1104 1169 fPedRuns == s.fPedRuns && 1105 1170 fDatRuns == s.fDatRuns && 1171 fDrsRuns == s.fDrsRuns && 1106 1172 fExclRuns == s.fExclRuns && 1107 1173 … … 1109 1175 Check(fPedRunsSub, s.fPedRunsSub) && 1110 1176 Check(fDatRunsSub, s.fDatRunsSub) && 1177 Check(fDrsRunsSub, s.fDrsRunsSub) && 1111 1178 Check(fExclRunsSub, s.fExclRunsSub); 1112 1179 } … … 1397 1464 if (fLastRun!=(UInt_t)-1) 1398 1465 out << pre << "LastRun: " << fLastRun << endl; 1466 if (fDrsSequence) 1467 out << pre << "DrsSequence: " << fDrsSequence << endl; 1399 1468 if (fNumEvents!=(UInt_t)-1) 1400 1469 out << pre << "NumEvents: " << fNumEvents << endl; … … 1416 1485 PrintRunsClassic(out, pre, "PedRuns: ", fPedRuns); 1417 1486 PrintRunsClassic(out, pre, "DataRuns: ", fDatRuns); 1487 PrintRunsClassic(out, pre, "DrsRuns: ", fDrsRuns); 1488 PrintRunsClassic(out, pre, "DrsFiles: ", fDrsFiles); 1418 1489 PrintRunsClassic(out, pre, "Exclude: ", fExclRuns); 1419 1490 } … … 1425 1496 // Should we add a check forbidding the same run in 1426 1497 // Cal/Ped/Data? What about the Exclude? 1427 /*str +=*/ PrintRuns(out, pre, "Runs: ", fRuns, fRunsSub); 1428 str += PrintRuns(out, pre, "CalRuns: ", fCalRuns, fCalRunsSub); 1429 str += PrintRuns(out, pre, "PedRuns: ", fPedRuns, fPedRunsSub); 1430 str += PrintRuns(out, pre, "DatRuns: ", fDatRuns, fDatRunsSub); 1431 str += PrintRuns(out, pre, "Exclude: ", fExclRuns, fExclRunsSub); 1498 /*str +=*/ PrintRuns(out, pre, "Runs: ", fRuns, fRunsSub); 1499 str += PrintRuns(out, pre, "CalRuns: ", fCalRuns, fCalRunsSub); 1500 str += PrintRuns(out, pre, "PedRuns: ", fPedRuns, fPedRunsSub); 1501 str += PrintRuns(out, pre, "DatRuns: ", fDatRuns, fDatRunsSub); 1502 str += PrintRuns(out, pre, "DrsRuns: ", fDrsRuns, fDrsRunsSub); 1503 str += PrintRuns(out, pre, "DrsFiles: ", fDrsFiles, fDrsFilesSub); 1504 str += PrintRuns(out, pre, "Exclude: ", fExclRuns, fExclRunsSub); 1432 1505 } 1433 1506 … … 1442 1515 if (!fComment.IsNull()) 1443 1516 out << pre << "Comment: " << fComment << endl; 1517 1518 if (GetDrsFile()) 1519 out << "# DrsFile: " << GetDrsFile() << endl; 1444 1520 } 1445 1521
Note:
See TracChangeset
for help on using the changeset viewer.