Changeset 8434 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 04/23/07 20:11:25 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalib.cc
r8369 r8434 48 48 // - fPulsePosCheck to kFALSE 49 49 // 50 MJCalib::MJCalib() : fDataFlag(kIsUseRawData), fStorage(0), 51 fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE)/*, 52 fIsHiLoCalibration(kFALSE)*/ 50 MJCalib::MJCalib() : fStorage(0), fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE) 53 51 { 54 52 SetUseBlindPixel(kFALSE); 55 53 SetUsePINDiode(kFALSE); 56 54 57 55 SetCheckedPixId(); 58 56 } … … 63 61 SetPulsePosCheck(GetEnv("PulsePosCheck", fIsPulsePosCheck)); 64 62 SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId)); 65 //SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));66 63 67 64 if (HasEnv("StorageType")) … … 81 78 return kTRUE; 82 79 83 TString dat = GetEnv("DataType", "");84 dat = dat.Strip(TString::kBoth);85 dat.ToLower();86 87 if (dat == (TString)"raw")88 SetUseRawData();89 90 if (dat == (TString)"mc" || dat == (TString)"montecarlo")91 SetUseMC();92 93 if (dat == (TString)"root")94 SetUseRootData();95 96 80 return kTRUE; 97 81 } -
trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc
r8245 r8434 287 287 if (fSequence.IsValid()) 288 288 { 289 if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)289 if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 290 290 return kFALSE; 291 291 } … … 369 369 read.DisableAutoScheme(); 370 370 371 if ( IsUseRawData())371 if (!fSequence.IsMonteCarlo()) 372 372 rawread.AddFiles(iter); 373 373 else -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8428 r8434 80 80 #include "MCalibCalcFromPast.h" 81 81 82 #include "MReadReports.h"83 82 #include "MReadMarsFile.h" 84 83 #include "MRawFileRead.h" … … 90 89 #include "MGeomApply.h" 91 90 #include "MPedestalSubtract.h" 92 //#include "MMcPedestalCopy.h"93 91 #include "MPointingPosCalc.h" 94 92 #include "MPedCalcFromLoGain.h" … … 102 100 #include "MCalibrateData.h" 103 101 #include "MCalibrateRelTimes.h" 104 //#include "MBadPixelsMerge.h"105 102 #include "MBadPixelsCalc.h" 106 103 #include "MBadPixelsTreat.h" … … 248 245 if (fSequence.IsValid()) 249 246 { 250 if (fSequence.SetupDatRuns(iter, 0, IsUseRawData())<=0)247 if (fSequence.SetupDatRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 251 248 return kFALSE; 252 249 } … … 362 359 plist.AddToList(&tlist); 363 360 364 MReadReports readreal;365 readreal.AddTree("Events", "MTime.", MReadReports::kMaster);366 readreal.AddTree("Trigger");367 readreal.AddTree("Camera");368 readreal.AddTree("Drive");369 readreal.AddTree("CC");370 readreal.AddTree("Currents");371 372 361 MReadMarsFile readmc("Events"); 373 362 readmc.DisableAutoScheme(); … … 375 364 MRawFileRead rawread(NULL); 376 365 377 MRead *read = 0; 378 switch (GetDataFlag()) 379 { 380 case kIsUseRawData: read = &rawread; break; 381 case kIsUseMC: read = &readmc; break; 382 case kIsUseRootData: read = &readreal; break; 383 } 366 MRead *read = fSequence.IsMonteCarlo() ? (MRead*)&readmc : (MRead*)&rawread; 384 367 read->AddFiles(iter); 385 368 386 369 const TString fname(Form("%s{s/_D_/_Y_}{s/\\.raw$/.root}{s/\\.raw\\.gz$/.root}", fPathOut.Data())); 387 370 388 389 371 // Skips MC which have no contents. This are precisely the 390 372 // events which fullfilled the MC Lvl1 trigger and an … … 808 790 movwrite.SetFilter(&movfilt); 809 791 810 MTaskList tlistmov ;792 MTaskList tlistmov("MovieEncoder"); 811 793 tlistmov.AddToList(&movprep); 812 794 tlistmov.AddToList(&movfilt); … … 835 817 tlist.AddToList(read); 836 818 837 if (IsUseMC()) 838 { 839 tlist.AddToList(&writemc); 819 if (fSequence.IsMonteCarlo()) 820 { 821 if (!fIsMovieMode) 822 tlist.AddToList(&writemc); 840 823 tlist.AddToList(&contmc); 841 824 } … … 843 826 //if (IsUseRootData()) 844 827 // tlist2.AddToList(&pextr); 845 tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All");846 847 //if ( IsUseMC())828 tlist.AddToList(&tlist2, fSequence.IsMonteCarlo() ? "Events" : "Alls"); 829 830 //if (fSequence.IsMonteCarlo()) 848 831 // tlist.AddToList(&pcalc, "Drive"); 849 832 850 tlist.AddToList(&write); 833 if (!fIsMovieMode) 834 tlist.AddToList(&write); 851 835 852 836 // Create and setup the eventloop … … 901 885 902 886 if (!WriteResult(interlacedcont)) 903 return kFALSE;887 return kFALSE; 904 888 905 889 // return if job went ok -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8428 r8434 1458 1458 1459 1459 // Defined resource id 1460 const TString id = IsUseMC() ? "MC" : Form("%02d", period);1460 const TString id = fSequence.IsMonteCarlo() ? "MC" : Form("%02d", period); 1461 1461 1462 1462 // Check for a valid entry for the correct period … … 1707 1707 1708 1708 MDirIter iter; 1709 if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)1709 if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 1710 1710 return kFALSE; 1711 1711 … … 1746 1746 MRawFileRead rawread(NULL); 1747 1747 1748 if ( IsUseRawData())1748 if (!fSequence.IsMonteCarlo()) 1749 1749 { 1750 1750 rawread.AddFiles(iter); … … 1948 1948 SetUsePINDiode(kFALSE); 1949 1949 1950 const Int_t numexec = IsUseRawData() ? rawread.GetNumExecutions() : read.GetNumExecutions();1950 const Int_t numexec = !fSequence.IsMonteCarlo() ? rawread.GetNumExecutions() : read.GetNumExecutions(); 1951 1951 if (numexec>0) 1952 1952 { -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r8323 r8434 119 119 } 120 120 121 Bool_t MJStar::Process( Bool_t ismc)121 Bool_t MJStar::Process() 122 122 { 123 123 if (!fSequence.IsValid()) … … 275 275 write.AddContainer("MMuonSetup", "RunHeaders"); 276 276 277 if ( ismc)277 if (fSequence.IsMonteCarlo()) 278 278 { 279 279 // Monte Carlo Data … … 311 311 writem.AddContainer("MRawEvtHeader", "Muons"); 312 312 writem.AddContainer("MPointingPos", "Muons"); 313 if ( ismc)313 if (fSequence.IsMonteCarlo()) 314 314 { 315 315 // Monte Carlo Data … … 318 318 } 319 319 320 if ( ismc)320 if (fSequence.IsMonteCarlo()) 321 321 if (fMuonAnalysis) 322 322 writem.AddCopySource("OriginalMC"); … … 326 326 MTaskList tlist2("Events"); 327 327 tlist2.AddToList(&apply); 328 if (! ismc)328 if (!fSequence.IsMonteCarlo()) 329 329 tlist2.AddToList(&cont); 330 330 tlist2.AddToList(&contsw); 331 if (! ismc)331 if (!fSequence.IsMonteCarlo()) 332 332 { 333 333 // Calibration events don't enter star at all. … … 450 450 // ------------------------------------------------------------ 451 451 452 tlist.AddToList( ismc? (MTask*)&readmc : (MTask*)&readreal);453 tlist.AddToList(&pcalc, ismc? "Events" : "Drive");452 tlist.AddToList(fSequence.IsMonteCarlo() ? (MTask*)&readmc : (MTask*)&readreal); 453 tlist.AddToList(&pcalc, fSequence.IsMonteCarlo() ? "Events" : "Drive"); 454 454 //tlist.AddToList(&filltst, "Events"); 455 455 tlist.AddToList(&tlist2, "Events"); 456 if (! ismc)456 if (!fSequence.IsMonteCarlo()) 457 457 { 458 458 // initiate task list -
trunk/MagicSoft/Mars/mjobs/MJStar.h
r6993 r8434 21 21 22 22 // Process 23 Bool_t Process( Bool_t ismc=kFALSE);23 Bool_t Process(); 24 24 25 25 ClassDef(MJStar, 0) // Tool to create a pedestal file (MPedestalCam) -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r8371 r8434 118 118 // seq.SetupPedRuns(iter, "/mypath", "[DPC]"); 119 119 // 120 // =========================================================================== 121 // 122 // Class Version 2: 123 // + fMonteCarlo 124 // 120 125 ///////////////////////////////////////////////////////////////////////////// 121 126 #include "MSequence.h" … … 220 225 switch (type) 221 226 { 222 case kRawDat: 227 case kRawDat: // rawdata 223 228 case kRawPed: 224 229 case kRawCal: 225 230 case kRawAll: 226 d += "rawfiles/"; 227 d += fNight.GetStringFmt("%Y/%m/%d"); 228 break; 229 case kRootDat: 231 case kRootDat: // mcdata 230 232 case kRootPed: 231 233 case kRootCal: 232 234 case kRootAll: 233 d += " merpp/";235 d += "rawfiles/"; 234 236 d += fNight.GetStringFmt("%Y/%m/%d"); 235 237 break; … … 253 255 // Changes to read the DAQ numbering format. Changes takes place 254 256 // between runs 35487 and 00035488 (2004_08_30) 255 const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";257 const char *fmt = arr[i]>35487 || fMonteCarlo ? "%08d_%s_*_E" : "%05d_%s_*_E"; 256 258 257 259 TString n; … … 447 449 fTriggerTable = env.GetValue("TriggerTable", ""); 448 450 fHvSettings = env.GetValue("HvSettings", ""); 451 fMonteCarlo = env.GetValue("MonteCarlo", kFALSE); 449 452 450 453 str = env.GetValue("Runs", ""); … … 488 491 } 489 492 gLog << "Sequence: " << fSequence << endl; 493 if (fMonteCarlo) 494 gLog << "MonteCarlo: Yes" << endl; 490 495 gLog << "Period: " << fPeriod << endl; 491 496 gLog << "Night: " << fNight << endl << endl; … … 646 651 fPeriod = MAstro::GetMagicPeriod(fNight.GetMjd()); 647 652 } 653 654 // -------------------------------------------------------------------------- 655 // 656 // If the sequence name seq is just a digit it is inflated to a full 657 // path following the datacenter standard. 658 // 659 // Returns if file accessible or not. 660 // 661 Bool_t MSequence::InflatePath(TString &seq, Bool_t ismc) 662 { 663 if (seq.IsDigit()) 664 { 665 const Int_t numseq = seq.Atoi(); 666 seq = "/magic/"; 667 if (ismc) 668 seq += "montecarlo/"; 669 seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 670 gLog << inf << "Inflated sequence file: " << seq << endl; 671 } 672 673 if (!gSystem->AccessPathName(seq, kFileExists)) 674 return kTRUE; 675 676 gLog << err << "Sorry, sequence file '" << seq << "' doesn't exist." << endl; 677 return kFALSE; 678 } -
trunk/MagicSoft/Mars/mjobs/MSequence.h
r8398 r8434 51 51 TArrayI fDatRuns; 52 52 53 Bool_t fMonteCarlo; 54 53 55 //TExMap fFileNames; 54 56 … … 65 67 public: 66 68 MSequence() : fSequence((UInt_t)-1), fLastRun((UInt_t)-1), 67 fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1) { }69 fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fMonteCarlo(kFALSE) { } 68 70 MSequence(const char *fname, const char *path=""); 69 71 MSequence(const MSequence &s) : fSequence(s.fSequence), fStart(s.fStart), … … 72 74 fTriggerTable(s.fTriggerTable), fHvSettings(s.fHvSettings), 73 75 fRuns(s.fRuns), fCalRuns(s.fCalRuns), fPedRuns(s.fPedRuns), 74 fDatRuns(s.fDatRuns) { }76 fDatRuns(s.fDatRuns), fMonteCarlo(s.fMonteCarlo) { } 75 77 ~MSequence(); 76 78 … … 80 82 // Genaral interface 81 83 Bool_t IsValid() const { return fSequence!=(UInt_t)-1; } 84 Bool_t IsMonteCarlo() const { return fMonteCarlo; } 85 86 void SetMonteCarlo(Bool_t ismc=kTRUE) { fMonteCarlo=ismc; } 82 87 83 88 UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; … … 115 120 const TString &GetSource() const { return fSource; } 116 121 117 const TString GetStandardPath() const { return "/magic/data/"; }122 const TString GetStandardPath() const { return fMonteCarlo?"/magic/montecarlo/":"/magic/data/"; } 118 123 119 124 const TString &GetFileName() const { return fFileName; } … … 133 138 UInt_t AddDatRuns(UInt_t num) { return AddDatRuns(num, num); } 134 139 135 ClassDef(MSequence, 1) 140 static Bool_t InflatePath(TString &seq, Bool_t ismc=kFALSE); 141 142 ClassDef(MSequence, 2) 136 143 }; 137 144
Note:
See TracChangeset
for help on using the changeset viewer.