Changeset 6047


Ignore:
Timestamp:
01/27/05 14:34:12 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6038 r6047  
    113113// Default constructor.
    114114//
    115 // Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
     115// Sets fRuns to 0, fExtractor to NULL,
    116116//
    117117MJCalibrateSignal::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)
    120119{
    121120    fName  = name  ? name  : "MJCalibrateSignal";
    122121    fTitle = title ? title : "Tool to calibrate data";
     122
     123    SetRootData();
    123124}
    124125
     
    198199//
    199200// MJCalibration allows to setup several option by a resource file:
    200 //   MJCalibrateSignal.DataCheck: yes,no
     201//   MJCalibrateSignal.RawData: yes,no
    201202//
    202203// For more details see the class description and the corresponding Getters
     
    205206{
    206207
    207     SetDataCheck(GetEnv("DataCheck", IsDataCheck()));
    208208    SetInterlaced(GetEnv("Interlaced", fIsInterlaced));
    209209    SetRelTimesUpdate(GetEnv("RelTimesUpdate", fIsRelTimesUpdate));
    210210    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    }
    211225
    212226    return kTRUE;
     
    238252
    239253    MDirIter iter;
    240     const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsDataCheck());
     254    const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsRawData());
    241255    const Int_t n1 = fSequence.GetNumDatRuns();
    242256    if (n0==0)
     
    345359    plist.AddToList(&tlist);
    346360
    347     // FIXME: Move this to an intermediate class MJMagic
    348     Byte_t filetype = 2;
    349361    /*
    350362    TString name = iter.Next();
     
    357369        return kFALSE;
    358370    } */
    359     // 1 = raw-file
    360     // 2 = raw-root file
    361     // 3 = mc-raw file
    362371
    363372    MReadReports readreal;
     
    372381    //read.DisableAutoScheme();
    373382    MRawFileRead rawread(NULL);
    374     if (IsDataCheck())
     383    if (IsRawData())
    375384        rawread.AddFiles(iter);
    376385    else
     
    466475
    467476    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
    469484    {
    470485        calib.SetCalibrationMode(MCalibrateData::kFfactor);
     
    533548    MHCamEvent evt1(2, "PedRmsFLG",   "Pedestal RMS from Lo Gain;;\\sigma_{p} [fadc/sl]");
    534549    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]");
    538553    MHCamEvent evt6(2, "Unsuitable",  "Fraction of unsuitable events per Pixel;;[1]");
    539554    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]");
    542556
    543557    evt0.EnableVariance();
     
    549563    evt7.EnableVariance();
    550564    //    evt8.EnableVariance();
    551     //    evt9.EnableVariance();
    552565
    553566    MFillH fill0(&evt0, "MPedestalFundamental",   "FillPedFLG");
     
    559572    MFillH fill6(&evt6, "MBadPixelsCam",          "FillUnsuitable");
    560573    MFillH fill7(&evt7, "MArrivalTime",           "FillTimes");
     574    MFillH fill8(&evt8, "MCalibrateData",         "FillConv");
    561575
    562576    // The second rule is for the case reading raw-files!
     
    612626    tlist2.AddToList(&apply);
    613627    tlist2.AddToList(&merge);
    614     if (filetype==3)
     628    if (IsMC())
    615629        tlist2.AddToList(&pcopy);
    616630    else
     
    670684    tlist2.AddToList(&fill5);
    671685    if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge"))
    672         tlist2.AddToList(&fill7);
     686      tlist2.AddToList(&fill7);
     687
     688    //    if (fIsInterlaced)
     689    tlist2.AddToList(&fill8);
    673690
    674691    // Setup List for Drive-tree
     
    676693
    677694    // Now setup main tasklist
    678     tlist.AddToList(IsDataCheck() ? (MTask*)&rawread : (MTask*)&readreal);
    679     if (!IsDataCheck())
     695    tlist.AddToList(IsRawData() ? (MTask*)&rawread : (MTask*)&readreal);
     696    if (IsRootData())
    680697      tlist2.AddToList(&pextr);
    681     tlist.AddToList(&tlist2, IsDataCheck()?"All":"Events");
     698    tlist.AddToList(&tlist2, IsRootData() ? "Events" : "All");
    682699
    683700    //
    684701    // !!! Replaced by MInterpolatePointingPos !!!
    685702    //
    686     //    if (!IsDataCheck())
     703    //    if (IsRootData())
    687704    //        tlist.AddToList(&pcalc, "Drive");
    688705
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r6035 r6047  
    2121private:
    2222
    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
    2430    Bool_t fIsInterlaced;               // Distinguish interlaced from other calibration
    2531    Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
     
    3440                           MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
    3541
    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);       }
    3849
    3950public:
Note: See TracChangeset for help on using the changeset viewer.