Changeset 6466 for trunk/MagicSoft


Ignore:
Timestamp:
02/14/05 19:29:41 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6464 r6466  
    2727     - added some more information to '--help' output
    2828     - replaced MSequences by MDataSet
     29     - implemented new debugging options (maybe not perfect yet)
     30       --print-files and --print-found
    2931
    3032   * mjobs/MJCut.[h,cc]:
     
    3234     - write MEnergyEst
    3335     - recalculate MHillasSrc
     36     - made sure both MWriteRootFile have different names
     37     - don't use "same" option if no off-data
    3438
    3539   * mjobs/MSequences.[h,cc]:
     
    6064     - the same for the calibration factor - with the same argument
    6165     - adapted to change in MWriteRootFile
     66     - use MReadMarsFile for Monte Carlo flag set
    6267
    6368   * mhist/MHCamera.cc:
     
    9297     - added a pattern independant trigger algorithm
    9398
    94    * mjobs/MJCut.cc:
    95      - made sure both MWriteRootFile have different names
    96      - don't use "same" option if no off-data
     99   * mbase/MDirIter.cc:
     100     - implemented option 'dbg' in Print()
     101
     102   * mjobs/MJCalib.h:
     103     - added a getter for data-flag (should be renamed
     104       to 'datatype' soon)
    97105
    98106
  • trunk/MagicSoft/Mars/callisto.cc

    r6453 r6466  
    7676    gLog << "   --print-seq               Print Sequence information" << endl;
    7777    gLog << "   --print-files             Print Files taken from Sequence" << endl;
    78     gLog << "   --print-only              Do not execute anything except print" << endl;
     78    gLog << "   --print-found             Print Files found from Sequence" << endl;
    7979    gLog << "   --use-test                Apply calibration constants to same calibration" << endl;
    8080    gLog << "                             file (for testing, calibration mode only)" << endl;
     
    103103}
    104104
     105static void PrintFiles(const MSequence &seq, const TString &kInpathD, Bool_t raw, Bool_t all)
     106{
     107    const char *prep = all ? "Found" : "Scheduled";
     108
     109    MDirIter Next1, Next2, Next3;
     110    seq.SetupPedRuns(Next1, kInpathD, "P", raw);
     111    seq.SetupCalRuns(Next2, kInpathD, "C", raw);
     112    seq.SetupDatRuns(Next3, kInpathD, "D", raw);
     113
     114    gLog << all;
     115    gLog.Separator(Form("%s Pedestal Files", prep));
     116    Next1.Print(all?"all":"");
     117    gLog << endl;
     118    gLog.Separator(Form("%s Calibration Files", prep));
     119    Next2.Print(all?"all":"");
     120    gLog << endl;
     121    gLog.Separator(Form("%s Data Files", prep));
     122    Next3.Print(all?"all":"");
     123    gLog << endl;
     124}
     125
    105126int main(int argc, char **argv)
    106127{
     
    126147
    127148    const Bool_t  kPrintSeq   = arg.HasOnlyAndRemove("--print-seq");
    128     //const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--print-files");
    129     //const Bool_t  kPrintOnly  = arg.HasOnlyAndRemove("--print-only");
     149    const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--print-files");
     150    const Bool_t  kPrintFound = arg.HasOnlyAndRemove("--print-found");
    130151    const Bool_t  kUseTest    = arg.HasOnlyAndRemove("--use-test");
    131152    const Bool_t  kDebugEnv   = arg.HasOnlyAndRemove("--debug-env");
     
    236257        return -1;
    237258    }
     259
     260    //
     261    // Process print options
     262    //
     263    if (kPrintFiles)
     264        PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kFALSE);
     265    if (kPrintFound)
     266        PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kTRUE);
    238267/*
    239     //
    240     // Process print options
    241     //
    242     if (kPrintFiles)
    243     {
    244         MDirIter Next1, Next2, Next3;
    245         seq.SetupPedRuns(Next1, kInpathD);
    246         seq.SetupCalRuns(Next2, kInpathD);
    247         seq.SetupDatRuns(Next3, kInpathD);
    248 
    249         gLog << all;
    250         gLog.Separator("Pedestal Files");
    251         Next1.Print("all");
    252         gLog << endl;
    253         gLog.Separator("Calibration Files");
    254         Next2.Print("all");
    255         gLog << endl;
    256         gLog.Separator("Data Files");
    257         Next3.Print("all");
    258         gLog << endl;
    259     }
    260 
    261268    //
    262269    // Check for existance of all files
  • trunk/MagicSoft/Mars/mbase/MDirIter.cc

    r5307 r6466  
    351351{
    352352    TString s(o);
     353    if (s.Contains("dbg", TString::kIgnoreCase))
     354        fList.Print();
     355
    353356    if (!s.Contains("all", TString::kIgnoreCase))
    354357    {
  • trunk/MagicSoft/Mars/mjobs/MJCalib.h

    r6282 r6466  
    3131    void SetInput(MRunIter *iter) { fRuns = iter; }
    3232
     33    Byte_t GetDataFlag() const { return fDataFlag; }
     34
    3335    Bool_t IsUseRawData()  const { return fDataFlag==kIsUseRawData;  }
    3436    Bool_t IsUseRootData() const { return fDataFlag==kIsUseRootData; }
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6459 r6466  
    352352    readreal.AddTree("Currents");
    353353
    354     //MReadMarsFile read("Events");
    355     //read.DisableAutoScheme();
     354    MReadMarsFile readmc("Events");
     355    readmc.DisableAutoScheme();
     356
    356357    MRawFileRead rawread(NULL);
    357     if (IsUseRawData())
     358
     359    switch (GetDataFlag())
     360    {
     361    case kIsUseRawData:
    358362        rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    359     else
     363        break;
     364    case kIsUseMC:
     365        readmc.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     366        break;
     367    case kIsUseRootData:
    360368        readreal.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     369        break;
     370    }
    361371
    362372    MPointingPosInterpolate pextr;
     
    672682
    673683    // Now setup main tasklist
    674     tlist.AddToList(IsUseRawData() ? (MTask*)&rawread : (MTask*)&readreal);
     684    switch (GetDataFlag())
     685    {
     686    case kIsUseRawData:
     687        tlist.AddToList(&rawread);
     688        break;
     689    case kIsUseMC:
     690        tlist.AddToList(&readmc);
     691        break;
     692    case kIsUseRootData:
     693        tlist.AddToList(&readreal);
     694        break;
     695    }
     696    //tlist.AddToList(IsUseRawData() ? (MTask*)&rawread : (MTask*)&readreal);
    675697    if (IsUseRootData())
    676698      tlist2.AddToList(&pextr);
  • trunk/MagicSoft/Mars/star.cc

    r6453 r6466  
    6464    gLog << "   --print-seq               Print Sequence information" << endl;
    6565    gLog << "   --print-files             Print Files taken from Sequence" << endl;
    66     gLog << "   --print-only              Do not excute anything except print" << endl;
     66    gLog << "   --print-found             Print Files found from Sequence" << endl;
    6767    gLog << "   --config=star.rc          Resource file [default=star.rc]" << endl;
    6868    gLog << endl;
     
    7171}
    7272
     73static void PrintFiles(const MSequence &seq, const TString &kInpathD, Bool_t allopt)
     74{
     75    const char *prep = allopt ? "Found" : "Scheduled";
     76
     77    MDirIter Next;
     78    seq.SetupDatRuns(Next, kInpathD, "Y");
     79
     80    gLog << all;
     81    gLog.Separator(Form("%s Data Files", prep));
     82    Next.Print(allopt?"all":"");
     83    gLog << endl;
     84}
     85
    7386int main(int argc, char **argv)
    7487{
     
    94107
    95108    const Bool_t  kPrintSeq   = arg.HasOnlyAndRemove("--print-seq");
    96     //const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--print-files");
    97     //const Bool_t  kPrintOnly  = arg.HasOnlyAndRemove("--print-only");
     109    const Bool_t  kPrintFiles = arg.HasOnlyAndRemove("--print-files");
     110    const Bool_t  kPrintFound = arg.HasOnlyAndRemove("--print-found");
    98111    const Bool_t  kDebugEnv   = arg.HasOnlyAndRemove("--debug-env");
    99112    const Bool_t  kDebugMem   = arg.HasOnlyAndRemove("--debug-mem");
     
    156169    // Process print options
    157170    //
    158     /*
    159     MDirIter iter;
    160 
    161     const Int_t n0 = seq.SetupDatRuns(iter, kInpath);
    162     const Int_t n1 = seq.GetNumDatRuns();
    163 
    164171    if (kPrintFiles)
    165     {
    166         gLog << all;
    167         gLog.Separator("Data Files");
    168         iter.Print("all");
    169         gLog << endl;
    170     }
    171 
    172     //
    173     // Check for existance of all files
    174     //
    175     if (n0 != n1)
    176     {
    177         if (kForceExec)
    178             gLog << warn << "WARNING";
    179         else
    180             gLog << err << "ERROR";
    181         gLog << " - " << n1 << " files in sequence defined, but " << n0 << " found in ";
    182         gLog << (kInpath.IsNull() ? "<defaultpath>" : kInpath.Data()) << endl;
    183         if (!kForceExec)
    184             return -1;
    185     }
    186 
    187     if (kPrintOnly)
    188         return 0;
    189         */
     172        PrintFiles(seq, kInpath, kFALSE);
     173    if (kPrintFound)
     174        PrintFiles(seq, kInpath, kTRUE);
    190175
    191176    //
Note: See TracChangeset for help on using the changeset viewer.