Changeset 6047
- Timestamp:
- 01/27/05 14:34:12 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6038 r6047 113 113 // Default constructor. 114 114 // 115 // Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE115 // Sets fRuns to 0, fExtractor to NULL, 116 116 // 117 117 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title) 118 : fIsDataCheck(kFALSE), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), 119 fIsHiLoCalibration(kTRUE) 118 : fDataFlag(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE) 120 119 { 121 120 fName = name ? name : "MJCalibrateSignal"; 122 121 fTitle = title ? title : "Tool to calibrate data"; 122 123 SetRootData(); 123 124 } 124 125 … … 198 199 // 199 200 // MJCalibration allows to setup several option by a resource file: 200 // MJCalibrateSignal. DataCheck: yes,no201 // MJCalibrateSignal.RawData: yes,no 201 202 // 202 203 // For more details see the class description and the corresponding Getters … … 205 206 { 206 207 207 SetDataCheck(GetEnv("DataCheck", IsDataCheck()));208 208 SetInterlaced(GetEnv("Interlaced", fIsInterlaced)); 209 209 SetRelTimesUpdate(GetEnv("RelTimesUpdate", fIsRelTimesUpdate)); 210 210 SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration)); 211 212 SetRootData(); 213 214 if (HasEnv("RawData")) 215 { 216 fDataFlag = 0; 217 SetRawData(); 218 } 219 220 if (HasEnv("MC")) 221 { 222 fDataFlag = 0; 223 SetMC(); 224 } 211 225 212 226 return kTRUE; … … 238 252 239 253 MDirIter iter; 240 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", Is DataCheck());254 const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsRawData()); 241 255 const Int_t n1 = fSequence.GetNumDatRuns(); 242 256 if (n0==0) … … 345 359 plist.AddToList(&tlist); 346 360 347 // FIXME: Move this to an intermediate class MJMagic348 Byte_t filetype = 2;349 361 /* 350 362 TString name = iter.Next(); … … 357 369 return kFALSE; 358 370 } */ 359 // 1 = raw-file360 // 2 = raw-root file361 // 3 = mc-raw file362 371 363 372 MReadReports readreal; … … 372 381 //read.DisableAutoScheme(); 373 382 MRawFileRead rawread(NULL); 374 if (Is DataCheck())383 if (IsRawData()) 375 384 rawread.AddFiles(iter); 376 385 else … … 466 475 467 476 MCalibrateData calib; 468 if (filetype==3) // MC file 477 // 478 // This is new calibration to eff. photo-electrons, hard-coded as decided 479 // at the Wuerzburg software meeting 26.01.05 480 // 481 calib.SetSignalType(MCalibrateData::kPhe); 482 483 if (IsMC()) // MC file 469 484 { 470 485 calib.SetCalibrationMode(MCalibrateData::kFfactor); … … 533 548 MHCamEvent evt1(2, "PedRmsFLG", "Pedestal RMS from Lo Gain;;\\sigma_{p} [fadc/sl]"); 534 549 MHCamEvent evt2(0, "Extra'd", "Extracted Signal;;S [fadc/sl]"); 535 // MHCamEvent evt3(4, "PedPhot", "Calibrated Pedestal;;P [ \\gamma]");536 MHCamEvent evt4(5, "PedRMS", "Calibrated Pedestal RMS;;\\sigma_{p} [ \\gamma]");537 MHCamEvent evt5(0, "Interp'd", "Interpolated Signal;;S [ \\gamma]");550 // MHCamEvent evt3(4, "PedPhot", "Calibrated Pedestal;;P [phe]"); 551 MHCamEvent evt4(5, "PedRMS", "Calibrated Pedestal RMS;;\\sigma_{p} [phe]"); 552 MHCamEvent evt5(0, "Interp'd", "Interpolated Signal;;S [phe]"); 538 553 MHCamEvent evt6(2, "Unsuitable", "Fraction of unsuitable events per Pixel;;[1]"); 539 554 MHCamEvent evt7(0, "Times", "Arrival Time;;T [slice]"); 540 // MHCamEvent evt8(0, "HiLoConv", "Ratio Hi-Lo Gain Signal;;Ratio [1]"); 541 // MHCamEvent evt9(5, "HiLoDiff", "Time Diff. Hi-Lo Gain Signal;;\\Delta T [3.33ns]"); 555 MHCamEvent evt8(0, "Conv", "Calibration Conv. Factors;;[phe/fadc sl]"); 542 556 543 557 evt0.EnableVariance(); … … 549 563 evt7.EnableVariance(); 550 564 // evt8.EnableVariance(); 551 // evt9.EnableVariance();552 565 553 566 MFillH fill0(&evt0, "MPedestalFundamental", "FillPedFLG"); … … 559 572 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable"); 560 573 MFillH fill7(&evt7, "MArrivalTime", "FillTimes"); 574 MFillH fill8(&evt8, "MCalibrateData", "FillConv"); 561 575 562 576 // The second rule is for the case reading raw-files! … … 612 626 tlist2.AddToList(&apply); 613 627 tlist2.AddToList(&merge); 614 if ( filetype==3)628 if (IsMC()) 615 629 tlist2.AddToList(&pcopy); 616 630 else … … 670 684 tlist2.AddToList(&fill5); 671 685 if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge")) 672 tlist2.AddToList(&fill7); 686 tlist2.AddToList(&fill7); 687 688 // if (fIsInterlaced) 689 tlist2.AddToList(&fill8); 673 690 674 691 // Setup List for Drive-tree … … 676 693 677 694 // Now setup main tasklist 678 tlist.AddToList(Is DataCheck() ? (MTask*)&rawread : (MTask*)&readreal);679 if ( !IsDataCheck())695 tlist.AddToList(IsRawData() ? (MTask*)&rawread : (MTask*)&readreal); 696 if (IsRootData()) 680 697 tlist2.AddToList(&pextr); 681 tlist.AddToList(&tlist2, Is DataCheck()?"All":"Events");698 tlist.AddToList(&tlist2, IsRootData() ? "Events" : "All"); 682 699 683 700 // 684 701 // !!! Replaced by MInterpolatePointingPos !!! 685 702 // 686 // if ( !IsDataCheck())703 // if (IsRootData()) 687 704 // tlist.AddToList(&pcalc, "Drive"); 688 705 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
r6035 r6047 21 21 private: 22 22 23 Bool_t fIsDataCheck; 23 enum DataType_t { 24 kIsRawData, 25 kIsRootData, 26 kIsMC 27 }; 28 29 Byte_t fDataFlag; // Bit-field to store the data type 24 30 Bool_t fIsInterlaced; // Distinguish interlaced from other calibration 25 31 Bool_t fIsRelTimesUpdate; // Choose to update relative times from interlaced … … 34 40 MExtractor* &ext1, MExtractor* &ext2, TString &geom) const; 35 41 36 Bool_t IsDataCheck() const { return fIsDataCheck; } 37 void SetDataCheck(Bool_t b) { fIsDataCheck = b; } 42 Bool_t IsRawData() const { return TESTBIT(fDataFlag,kIsRawData); } 43 Bool_t IsRootData() const { return TESTBIT(fDataFlag,kIsRootData); } 44 Bool_t IsMC() const { return TESTBIT(fDataFlag,kIsMC); } 45 46 void SetRawData ( const Bool_t b=kTRUE ) { b ? SETBIT(fDataFlag,kIsRawData) : CLRBIT(fDataFlag,kIsRawData); } 47 void SetRootData( const Bool_t b=kTRUE ) { b ? SETBIT(fDataFlag,kIsRootData) : CLRBIT(fDataFlag,kIsRootData); } 48 void SetMC ( const Bool_t b=kTRUE ) { b ? SETBIT(fDataFlag,kIsMC) : CLRBIT(fDataFlag,kIsMC); } 38 49 39 50 public:
Note:
See TracChangeset
for help on using the changeset viewer.