Changeset 2604 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/05/03 11:34:19 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
2 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2603 r2604  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6 2003/12/05: Thomas Bretz
     7
     8   * mpointing/*:
     9     - added
     10
     11   * Makefile:
     12     - added mpointing
     13
     14   * NEWS:
     15     - updated
     16
     17   * mbase/MTime.[h,cc]:
     18     - complere rewrite of the data members
     19     - ClassDef=3
     20
     21   * mfileio/MCT1ReadPreProc.cc, mfileio/MReadCurrents.cc,
     22     mfileio/MReadReports.cc, mhist/MHPixVsTime.cc,
     23     mhist/MHVsTime.cc, mmain/MOnlineDump.cc,
     24     mmontecarlo/MMcTimeGenerate.cc, mreport/MReport.cc
     25
     26     - adapted to new MTime
     27
     28   * mfileio/MReadReports.[h,cc]:
     29     - added the possibility to enable Auto Scheme
     30     - delete the TChains when removed
     31
     32   * mfileio/MWriteRootFile.[h,cc]:
     33     - automaticalle create title for Trees
     34     - added a 'Must-Have' flag for the added containers
     35
     36   * mreport/MReportCamera.h:
     37     - added //! to all pointers
     38
     39   * mtools/MAstro.[h,cc]:
     40     - added calculations from and to MJD
     41     - moved to mbase
     42
     43   * mfileio/Makefile, mfileio/FileIOLinkDef.h:
     44     - removed MReadCurrent
     45
     46
     47
    648 2003/12/04: Markus Gaug
    749
    8   * manalysis/MCalibration*
    9      - implemented some of Thomas Bretz suggestions to make the code nicer
    10      - implemented the possibility to have cosmics in the calibration data
    11        and remove it
     50   * manalysis/MCalibration*
     51     - implemented some of Thomas Bretz suggestions to make the code
     52       nicer
     53     - implemented the possibility to have cosmics in the calibration
     54       data and remove it
    1255     - implemented the conversion factors for the blind pixel method
    1356
    14   * mhist/MHCalibration*
    15      - implemented some of Thomas Bretz suggestions to make the code nicer
    16      - implemented the possibility to have cosmics in the calibration data
    17        and still fit it
    18 
    19   * macros/calibration.C
     57   * mhist/MHCalibration*
     58     - implemented some of Thomas Bretz suggestions to make the code
     59       nicer
     60     - implemented the possibility to have cosmics in the calibration
     61       data and still fit it
     62
     63   * macros/calibration.C
    2064     - MStatusDisplay of calibration histograms a little bit more readable
     65
     66
    2167
    2268 2003/12/03: Abelardo Moralejo
     
    2672       time, instead of fmcevt2).
    2773
     74
     75
    2876 2003/12/02: Abelardo Moralejo
    2977
     
    3179     - changed names of variables (removed underscores). Use new
    3280       function MTask::AddSerialNumber  (see below).
     81
     82
    3383
    3484 2003/12/02: Thomas Bretz
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r2494 r2604  
    1717
    1818#pragma link C++ class MIter+;
     19#pragma link C++ class MAstro+;
    1920#pragma link C++ class MDirIter+;
    2021
  • trunk/MagicSoft/Mars/mbase/Makefile

    r2506 r2604  
    2121
    2222INCLUDES = -I. -I../mfileio -I../mfilter
    23 # mfileio:  MRead (MEvtLoop)
    24 # mfilter:  MF (MContinue)
     23# mfileio:  MRead  (MEvtLoop)
     24# mfilter:  MF     (MContinue)
    2525
    2626# @code
     
    3636           MLog.cc \
    3737           MArgs.cc \
     38           MAstro.cc \
    3839           MParContainer.cc \
    3940           MParList.cc \
  • trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h

    r2556 r2604  
    1010#pragma link C++ class MReadReports+;
    1111#pragma link C++ class MReadMarsFile+;
    12 #pragma link C++ class MReadCurrents+;
    1312#pragma link C++ class MReadRflFile+;
    1413
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r2461 r2604  
    905905    //  int   isecs_since_midday; // seconds passed since midday before sunset (JD of run start)
    906906    //  int   isecfrac_200ns;     // fractional part of isecs_since_midday
    907     fTime->SetCT1Time(event.isecfrac_200ns, event.isecs_since_midday);
    908     fTime->SetDuration((Int_t)fRawRunHeader->GetMJD());
     907    fTime->SetCT1Time((UInt_t)fRawRunHeader->GetMJD(), event.isecfrac_200ns, event.isecs_since_midday);
    909908    fTime->SetReadyToSave();
    910909
  • trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc

    r2377 r2604  
    223223    Int_t h, m, s, ms;
    224224    *fIn >> h >> m >> s >> ms;
    225     fTime->SetTime(h, m, s, ms*1000000);
     225    fTime->Set(0, 0, 0, h, m, s, ms);
    226226
    227227    for (int i=0; i<fNumPixel; i++)
  • trunk/MagicSoft/Mars/mfileio/MReadReports.cc

    r2590 r2604  
    8282// Call SetOwner for fTrees and fChains
    8383//
    84 MReadReports::MReadReports()
     84MReadReports::MReadReports() : fEnableAutoScheme(kFALSE)
    8585{
    8686    fName  = "MRead";
     
    140140    t->SetTitle(time?time:"");
    141141
     142    if (!fEnableAutoScheme)
     143        t->DisableAutoScheme();
     144
    142145    //FIXME!
    143146    //t->DisableAutoScheme();
     
    257260            MTime &t = **GetTime(c);
    258261
    259             if (t.GetHour()<12)
    260                 t.SetTime((Byte_t)(t.GetHour()+24), t.GetMin(), t.GetSec(), t.GetNanoSec());
    261 
    262262            if (i==0)
    263263                tmin = t;
     
    276276
    277277        // FIXME: Use Stream ID and call CallProcess() ?
    278         if (((MTask*)fTrees->GetList()->At(nmin))->CallProcess())
     278        Bool_t rc = ((MTask*)fTrees->GetList()->At(nmin))->CallProcess();
     279        if (rc)
    279280        {
    280             /*
    281              *fLog << dbg << ((MReadTree*)fTrees->At(nmin))->GetTreeName() << " " << flush;
    282 
    283              if (tmin.GetHour()>=24)
    284              tmin.SetTime((Byte_t)(tmin.GetHour()-24), tmin.GetMin(), tmin.GetSec(), tmin.GetNanoSec());
    285              tmin.Print();
    286              */
    287 
    288281            fList->SetStreamId(fTrees->GetList()->At(nmin)->GetName());
    289282            return kTRUE;
     
    292285        delete *GetTime(chain);
    293286        delete  GetTime(chain);
    294         // FIXME: Is it really deleted?
    295         fChains->Remove(chain);
     287        delete fChains->Remove(chain);
    296288    }
    297289
  • trunk/MagicSoft/Mars/mfileio/MReadReports.h

    r2590 r2604  
    2424    MTask     *fList;   // pointer to the task list to set the stream id
    2525
     26    Bool_t     fEnableAutoScheme;
     27
    2628    MTime** GetTime(TChain *c) const;
    2729
     
    4244    void  PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
    4345
     46    void  EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; }
     47
    4448    ClassDef(MReadReports, 0) // Reads events and reports from a root file ordered in time
    4549};
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r2556 r2604  
    192192// is the name of the tree.
    193193//
    194 void MWriteRootFile::AddContainer(const char *cname, const char *tname, const char *ttitle)
     194void MWriteRootFile::AddContainer(const char *cname, const char *tname, Bool_t must)
    195195{
    196196    //
     
    198198    // add the entry to the list.
    199199    //
    200     MRootFileBranch *entry = new MRootFileBranch(cname, tname, ttitle);
     200    MRootFileBranch *entry = new MRootFileBranch(cname, tname, must);
    201201    fBranches.AddLast(entry);
    202202
     
    216216//
    217217void MWriteRootFile::AddContainer(MParContainer *cont, const char *tname,
    218                                   const char *ttitle)
     218                                  Bool_t must)
    219219{
    220220    //
     
    222222    // add the entry to the list.
    223223    //
    224     MRootFileBranch *entry = new MRootFileBranch(cont, tname, ttitle);
     224    MRootFileBranch *entry = new MRootFileBranch(cont, tname, must);
    225225    fBranches.AddLast(entry);
    226226}
     
    264264                // No corresponding container is found
    265265                //
    266                 *fLog << err << "Cannot find parameter container '" << cname << "'." << endl;
    267                 return kFALSE;
     266                if (entry->MustHave())
     267                {
     268                    *fLog << err << "Cannot find parameter container '" << cname << "'." << endl;
     269                    return kFALSE;
     270                }
     271
     272                *fLog << inf << "Unnecessary parameter container '" << cname << "' not found..." << endl;
     273                delete fBranches.Remove(entry);
     274                continue;
    268275            }
     276
    269277            //
    270278            // The container is found. Put the pointer into the entry.
     
    276284        // Get container name, tree name and tree title of this entry.
    277285        //
    278         const char *cname  = cont->GetName();
    279         const char *tname  = entry->GetName();
    280         const char *ttitle = entry->GetTitle();
     286        const char *cname = cont->GetName();
     287        const char *tname = entry->GetName();
     288        const TString ttitle(Form("Tree containing %s", cont->GetDescriptor()));
    281289
    282290        //
     
    301309            fOut->cd();
    302310
    303             tree = new TTree(tname, ttitle ? ttitle : tname);
     311            tree = new TTree(tname, ttitle);
    304312            fTrees.AddLast(tree);
    305313
     
    494502
    495503        out << ", \"" << entry->GetName() << "\"";
    496         if ((TString)entry->GetTitle()!="")
    497             out << ", \"" << entry->GetTitle() << "\"";
     504        if (!entry->MustHave())
     505            out << ", kFALSE";
    498506
    499507        out <<");" << endl;
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h

    r2470 r2604  
    2222    TString        fContName;
    2323
    24     void Init(const char *name, const char *title)
     24    Bool_t         fMust;
     25
     26    void Init(const char *name, Bool_t must)
    2527    {
    2628        SetName(name?name:"");
    27         SetTitle(title?title:"");
     29        fMust = must;
    2830    }
    2931
    3032public:
    31     MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL)
     33    MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0)
    3234    {
    33         Init(NULL, NULL);
     35        Init(NULL, kFALSE);
    3436        fContName = "";
    3537    }
    3638
    37     MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL)
    38         : fTree(NULL), fBranch(NULL), fContainer(NULL)
     39    MRootFileBranch(const char *cname, const char *tname=NULL, Bool_t must=kFALSE)
     40        : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0)
    3941    {
    40         Init(tname, ttitle);
     42        Init(tname, must);
    4143        fContName = cname;
    4244    }
    4345
    44     MRootFileBranch(MParContainer *cont, const char *tname=NULL, const char *ttitle=NULL)
    45         : fTree(NULL), fBranch(NULL), fContName("")
     46    MRootFileBranch(MParContainer *cont, const char *tname=NULL, Bool_t must=kFALSE)
     47        : fTree(NULL), fBranch(NULL), fContName(""), fMust(0)
    4648    {
    47         Init(tname, ttitle);
     49        Init(tname, must);
    4850        fContainer = cont;
    4951    }
     
    5456    TBranch       *GetBranch() const    { return fBranch; }
    5557    const char    *GetContName() const  { return fContName; }
     58    Bool_t         MustHave() const     { return fMust; }
    5659
    5760    void SetContainer(MParContainer *cont) { fContainer = cont; }
     
    98101
    99102
    100     void AddContainer(const char *cname,
    101                       const char *tname=NULL, const char *ttitle=NULL);
    102     void AddContainer(MParContainer *cont,
    103                       const char *tname=NULL, const char *ttitle=NULL);
     103    void AddContainer(const char *cname,   const char *tname=NULL, Bool_t must=kTRUE);
     104    void AddContainer(MParContainer *cont, const char *tname=NULL, Bool_t must=kTRUE);
    104105
    105106
  • trunk/MagicSoft/Mars/mfileio/Makefile

    r2556 r2604  
    3636           MReadTree.cc \
    3737           MReadReports.cc \
    38            MReadCurrents.cc \
    3938           MReadMarsFile.cc \
    4039           MReadRflFile.cc \
  • trunk/MagicSoft/Mars/mhist/MHPixVsTime.cc

    r2572 r2604  
    150150    Double_t t = 0;
    151151    if (fUseEventTime)
    152         t = (*fTime);
     152        t = fTime->GetTime();
    153153    else
    154154        t = fHeader ? fHeader->GetDAQEvtNumber() : fGraph.GetN();
  • trunk/MagicSoft/Mars/mhist/MHVsTime.cc

    r2571 r2604  
    165165            return kFALSE;
    166166        }
    167         const Double_t T = (*tm);///3600;
    168         t = T>12*3600?T-24*3600:T;
     167        t = tm->GetTime();
    169168    }
    170169
  • trunk/MagicSoft/Mars/mmain/MOnlineDump.cc

    r2578 r2604  
    4040    if (*fEvtTime==0)
    4141    {
    42         fEvtTime->SetTime((ULong_t)gSystem->Now());
     42        fEvtTime->Now();
    4343        set = kTRUE;
    4444    }
     
    5454
    5555    if (set)
    56         fEvtTime->SetTime((ULong_t)0);
     56        fEvtTime->Reset();
    5757}
    5858
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTimeGenerate.cc

    r2462 r2604  
    8484    while (dt < fDeadTime);
    8585
    86     fTime->SetTime(*fTime+dt/1e4); // [0.1ms]
     86#warning SetTime not valid anymore!
     87//    fTime->SetTime(*fTime+dt/1e4); // [0.1ms]
    8788
    8889    return kTRUE;
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r2591 r2604  
    5656{
    5757    int len, state;
    58     int hor, min, sec, ms;
     58    int yea, mon, day, hor, min, sec, ms;
    5959
    6060    int n = sscanf(str.Data(),
    6161                   fHasReportTime ?
    62                    " %d %*d %*d %*d %d %d %d %d "
     62                   " %d %d %d %d %d %d %d %d "
    6363                   "%*d %*d %*d %*d %*d %*d %*d %*d %n" :
    6464                   " %d %*d %*d %*d %d %d %d %d ",
    65                    &state, &hor, &min, &sec, &ms, &len);
    66     if (n!=5)
     65                   &state, &yea, &mon, &day, &hor, &min, &sec, &ms, &len);
     66    if (n!=8)
    6767    {
    6868        *fLog << err << "ERROR - Cannot interprete Body of " << fIdentifier << endl;
     
    7272    fState=state;
    7373    if (fTime)
    74         fTime->SetTime(hor, min, sec, ms*1000000);
     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        }
    7581
    7682    str.Remove(0, len);
  • trunk/MagicSoft/Mars/mreport/MReportCamera.h

    r2592 r2604  
    1919    Byte_t fStatusDC; // CaCo monitored status of the DC currents (0-9), Cam.DC_state
    2020
    21     MCameraCooling     *fCooling;
    22     MCameraLids        *fLids;
    23     MCameraAUX         *fAUX;
    24     MCameraHV          *fHV;
    25     MCameraLV          *fLV;
    26     MCameraCalibration *fCalibration;
     21    MCameraCooling     *fCooling;     //!
     22    MCameraLids        *fLids;        //!
     23    MCameraAUX         *fAUX;         //!
     24    MCameraHV          *fHV;          //!
     25    MCameraLV          *fLV;          //!
     26    MCameraCalibration *fCalibration; //!
    2727
    2828    Bool_t SetupReading(MParList &plist);
  • trunk/MagicSoft/Mars/mtools/Makefile

    r2553 r2604  
    3434           MagicDomino.cc \
    3535           MagicCivilization.cc \
    36            MAstro.cc \
    3736           MineSweeper.cc
    3837
  • trunk/MagicSoft/Mars/mtools/ToolsLinkDef.h

    r2553 r2604  
    55#pragma link off all functions;
    66
    7 #pragma link C++ class MAstro+;
    87#pragma link C++ class MChisqEval+;
    98#pragma link C++ class MineSweeper+;
Note: See TracChangeset for help on using the changeset viewer.