Changeset 2678 for trunk/MagicSoft


Ignore:
Timestamp:
12/15/03 17:29:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2676 r2678  
    1818   * mfilter/MFAntiFilter.[h,cc]:
    1919     - removed. This function is implemented in MFilterList
     20
     21   * merpp.cc:
     22     - enhanced to support start/stop time
     23
     24   * manalysis/MEventRateCalc.cc:
     25     - removed some stuff which was commented out
     26     
     27   * mbase/MTime.cc:
     28     - small change to GetString
     29     
     30   * mhist/MHCamera.cc:
     31     - made the inverse deep blue dea palette the default
     32       (FIXME: Make this a resource)
     33     
     34   * mreport/MReport.[h,cc]:
     35     - added MTime arguments to Interprete
     36     
     37   * mreport/MReportFileRead.[h,cc]:
     38     - added MTime arguments to Interprete
     39     - added fStart/fStop data member
    2040
    2141
  • trunk/MagicSoft/Mars/NEWS

    r2637 r2678  
    1212
    1313   - added support for DC current files from the camera control
     14
     15   - added support for start- and stop-time when merpping report files
    1416
    1517
  • trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc

    r2626 r2678  
    5959//
    6060MEventRateCalc::MEventRateCalc(const char *name, const char *title)
    61     : /*fNumEvents(10000),*/ fTimes(1000)
     61    : fTimes(1000)
    6262{
    6363    fName  = name  ? name  : "MEventRateCalc";
     
    8282    if (!fRate)
    8383        return kFALSE;
    84 
    85     //fEvtNumber = 0;
    8684
    8785    memset(fTimes.GetArray(), 0, sizeof(Double_t)*fTimes.GetSize());
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r2636 r2678  
    229229//
    230230// Return contents as a TString of the form:
    231 //   "[yy]yy/mm/dd [h]h:mm:ss.fff"
     231//   "yyyy/mm/dd hh:mm:ss.fff"
    232232//
    233233TString MTime::GetString() const
     
    239239    GetTime(h, m, s, ms);
    240240
    241     return TString(Form("%2d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms));
     241    return TString(Form("%4d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms));
    242242}
    243243
  • trunk/MagicSoft/Mars/merpp.cc

    r2632 r2678  
    6868    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
    6969    gLog << "     -vn: Verbosity level n [default=2]" << endl;
     70    gLog << "     --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl;
     71    gLog << "     --stop=yyyy-mm-dd/hh:mm:ss.mmm:  Stop  event time for merpping report files" << endl;
    7072    gLog << "     -?/-h: This help" << endl << endl;
    7173    gLog << "   REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl;
    7274}
    7375
     76// FIXME: Move to MTime (maybe 'InterpreteCmdline'
     77MTime AnalyseTime(TString str)
     78{
     79    Int_t y=0, ms=0, mon=0, d=0, h=0, m=0, s=0;
     80
     81    if (7!=sscanf(str.Data(), "%d-%d-%d/%d:%d:%d.%d", &y, &mon, &d, &h, &m, &s, &ms))
     82        return MTime();
     83
     84    MTime t;
     85    t.Set(y, mon, d, h, m, s, ms);
     86    return t;
     87}
     88
    7489int main(const int argc, char **argv)
    7590{
     
    95110    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
    96111
     112    MTime kTimeStart(AnalyseTime(arg.GetStringAndRemove("--start=")));
     113    MTime kTimeStop(AnalyseTime(arg.GetStringAndRemove("--stop=")));
     114    kTimeStart.SetName("MTimeStart");
     115    kTimeStop.SetName("MTimeStop");
     116
     117    if (!kTimeStart)
     118        cout << "No start time!" << endl;
     119    if (!kTimeStop)
     120        cout << "No stop time!" << endl;
     121
    97122    //
    98123    // check for the right usage of the program
     
    172197    //
    173198    // ---- The following is only necessary to supress some output ----
    174     //
     199    /*
    175200    MRawRunHeader runheader;
    176201    plist.AddToList(&runheader);
     
    187212    MTime evttime;
    188213    plist.AddToList(&evttime);
     214    */
    189215
    190216    //
     
    200226    {
    201227        MReportFileRead *r = new MReportFileRead(kNamein);
     228        r->SetTimeStart(kTimeStart);
     229        r->SetTimeStop(kTimeStop);
    202230        if (isdc)
    203231        {
     
    215243
    216244        MWriteRootFile *w = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl);
    217         /*
    218          w->AddContainer("MReportDAQ",         "DAQ");
    219          w->AddContainer("MTimeDAQ",           "DAQ");
    220          w->AddContainer("MReportDrive",       "Drive");
    221          w->AddContainer("MTimeDrive",         "Drive");
    222          */
    223245        if (isdc)
    224246        {
     
    241263            w->AddContainer("MReportDrive",       "Drive");
    242264            w->AddContainer("MTimeDrive",         "Drive");
     265            // w->AddContainer("MReportDAQ",         "DAQ");
     266            // w->AddContainer("MTimeDAQ",           "DAQ");
    243267        }
    244268        write = w;
     
    249273        write = new MRawFileWrite(kNameout, option, "Magic root-file", kComprlvl);
    250274    }
     275
    251276    tasks.AddToList(read);
    252277    tasks.AddToList(write);
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2627 r2678  
    9393    SetPalette(1, 0);
    9494#else
    95     SetPalette(51, 0);
     95    SetInvDeepBlueSeaPalette();
    9696#endif
    9797}
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r2632 r2678  
    5353// While skip are numbers which won't enter the analysis
    5454//
     55// SetupReading must be called successfully before.
     56//
    5557Bool_t MReport::InterpreteHeader(TString &str)
    5658{
     
    7072
    7173    fState=state;
    72     if (fTime)
    73         if (!fTime->Set(yea, mon, day, hor, min, sec, ms))
    74         {
    75             *fLog << err << "ERROR - Event has invalid time: ";
    76             *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms);
    77             *fLog << "... abort." << endl;
    78             return kFALSE;
    79         }
     74    if (!fTime->Set(yea, mon, day, hor, min, sec, ms))
     75    {
     76        *fLog << err << "ERROR - Event has invalid time: ";
     77        *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms);
     78        *fLog << "... abort." << endl;
     79        return kFALSE;
     80    }
    8081
    8182    str.Remove(0, len);
     
    102103// when a corresponding time container exists.
    103104//
    104 Bool_t MReport::Interprete(TString &str)
     105// SetupReading must be called successfully before.
     106//
     107Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop)
    105108{
    106109    if (!InterpreteHeader(str))
    107110        return kFALSE;
     111
     112    if (start && *fTime<start)
     113        return kCONTINUE;
     114    if (stop  && *fTime>stop)
     115        return kCONTINUE;
    108116
    109117    if (!InterpreteBody(str))
     
    111119
    112120    SetReadyToSave();
    113     if (fTime)
    114         fTime->SetReadyToSave();
     121    fTime->SetReadyToSave();
    115122
    116123    return kTRUE;
  • trunk/MagicSoft/Mars/mreport/MReport.h

    r2591 r2678  
    2727    virtual Bool_t InterpreteBody(TString &str);
    2828
    29     Bool_t Interprete(TString &str);
     29    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop);
    3030    Bool_t CheckIdentifier(TString &str) const
    3131    {
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.cc

    r2632 r2678  
    119119    MReport *GetReport() { return fReport; }
    120120    //void SetTime(MTime *t) { fReport->SetTime(t); }
    121     Bool_t Interprete(TString &str)
    122     {
    123         if (!fReport->Interprete(str))
     121    Int_t Interprete(TString &str, const MTime &start, const MTime &stop)
     122    {
     123        const Int_t rc = fReport->Interprete(str, start, stop);
     124
     125        if (rc==kFALSE)
    124126            return kFALSE;
    125127
    126128        fNumReports++;
    127         return kTRUE;
     129        return rc;
    128130    }
    129131    Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); }
     
    289291    while (!GetReport(rep))
    290292    {
    291         // Don't know the reason, but ReadLine and ReadString don't work
    292         // for the (at least: converted) DC files.
    293         str.ReadToDelim(*fIn);
     293        str.ReadLine(*fIn);
    294294        if (!*fIn)
    295295        {
     
    307307    }
    308308
    309     if (!rep->Interprete(str))
     309    const Int_t rc = rep->Interprete(str, fStart, fStop);
     310    if (rc==kFALSE)
    310311    {
    311312        *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl;
     
    313314    }
    314315
    315     return kTRUE;
     316    return rc;
    316317}
    317318
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.h

    r2632 r2678  
    55#include "MTask.h"
    66#endif
     7#ifndef MARS_MTime
     8#include "MTime.h"
     9#endif
    710
    8 // gcc 3.2
     11/*// gcc 3.2
    912//class ifstream;
    1013#include <iosfwd>
     14*/
    1115
    1216class THashTable;
     
    2731    THashTable *fList;
    2832
     33    MTime fStart;            // Time range which should be read from file
     34    MTime fStop;             // Time range which should be read from file
     35
    2936    enum { kHasNoHeader = BIT(14) };
    3037
     
    4350
    4451    void SetHasNoHeader() { SetBit(kHasNoHeader); }
     52    void SetTimeStart(const MTime &tm) { fStart = tm; }
     53    void SetTimeStop(const MTime &tm)  { fStop = tm; }
    4554
    4655    Bool_t AddToList(const char *name) const;
Note: See TracChangeset for help on using the changeset viewer.