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

Legend:

Unmodified
Added
Removed
  • 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 \
Note: See TracChangeset for help on using the changeset viewer.