Changeset 6500


Ignore:
Timestamp:
02/15/05 18:44:43 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6496 r6500  
    4040
    4141
     42
    4243 2005/02/15 Thomas Bretz
    4344
     
    6970       parameters
    7071     - added a flag to keep single core pixels
     72
     73   * manalysis/MMatrixLoop.[h,cc], mfileio/MReadReports.[h,cc],
     74     mfileio/MReadRflFile.[h,cc], mfileio/MReadTree.[h,cc],
     75     mraw/MRawFileRead.[h,cc], mraw/MRawSocketRead.h:
     76     - renamed GetFileName to GetFullFileName
     77
     78   * mbase/MInputStreamID.h:
     79     - added new member function HasStreamId
     80
     81   * mbase/MParContainer.[h,cc]:
     82     - added a static list to keep track of all created
     83       TMathodCall objects
     84
     85   * mbase/MTask.cc:
     86     - enhanced PrintStatistics
     87
     88   * mfileio/MRead.[h,cc]:
     89     - new abstract function GetFullFileName
     90     - added implementatio of GetFileName based on GetFullFileName
     91
     92   * mfileio/MWriteRootFile.[h,cc]:
     93     - moved open of a new file to new common member function
     94       OpenFile
     95     - allow to use an already existing file also when using rules
     96     - added a new option which can be used to copy an existing
     97       tree (without any change) from the old file into the new file.
     98       (in principal you can also do this for some of its branches only)
     99       This is done by AddCopySource
     100
     101   * mjobs/MJCalibrateSignal.cc:
     102     - in case of MonteCarlo files write an independant tree
     103       'MonteCarlo' for 'MMcEvtBasic'
     104
     105   * mjobs/MJStar.cc:
     106     - copy tree 'MonteCarlo' from old into new files
    71107
    72108
  • trunk/MagicSoft/Mars/NEWS

    r6252 r6500  
    7878      (MFSupercuts) && (MHillas.fSize>100)
    7979
     80    - fixed a lot of stuff to allow all programs to process MonteCarlo
     81      camera files.
     82
    8083
    8184
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r6253 r6500  
    8080using namespace std;
    8181
     82TObjArray MParContainer::fgListMethodCall;
     83
    8284MParContainer::MParContainer(const char *name, const char *title) :
    8385    fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE)
    8486{
     87    fgListMethodCall.SetOwner();
    8588}
    8689
     
    8891    fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE)
    8992{
     93    fgListMethodCall.SetOwner();
    9094}
    9195
     
    630634    }
    631635
    632     *fLog << warn << "No standard access for '" << part1 << "' in ";
     636    *fLog << inf << "No standard access for '" << part1 << "' in ";
    633637    *fLog << GetDescriptor() << " or one of its base classes." << endl;
    634638
    635639    TMethodCall *call = NULL;
    636640
    637     *fLog << warn << "Trying to find MethodCall '" << ClassName();
    638     *fLog << "::Get" << part1 << "' instead <LEAKS MEMORY>" << endl;
     641    *fLog << "Trying to find MethodCall '" << ClassName();
     642    *fLog << "::Get" << part1 << "' instead..." << flush;
    639643    call = new TMethodCall(IsA(), (TString)"Get"+part1, "");
    640644    if (call->GetMethod())
     645    {
     646        fgListMethodCall.Add(call);
     647        *fLog << "found." << endl;
    641648        return call;
     649    }
     650    *fLog << endl;
    642651
    643652    delete call;
    644653
    645     *fLog << warn << "Trying to find MethodCall '" << ClassName();
    646     *fLog << "::" << part1 << "' instead <LEAKS MEMORY>" << endl;
     654    *fLog << "Trying to find MethodCall '" << ClassName();
     655    *fLog << "::" << part1 << "' instead..." << flush;
    647656    call = new TMethodCall(IsA(), part1, "");
    648657    if (call->GetMethod())
     658    {
     659        fgListMethodCall.Add(call);
     660        *fLog << "found." << endl;
    649661        return call;
     662    }
     663    *fLog << endl;
    650664
    651665    delete call;
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r5994 r6500  
    3434class MParContainer : public TObject
    3535{
     36private:
     37    static TObjArray fgListMethodCall; //!
     38
    3639protected:
    3740    TString fName;        // parameter container identifier (name)
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r5875 r6500  
    428428    else
    429429        *fLog << "       ";
     430
     431    if (HasStreamId())
     432        *fLog << GetStreamId() << ":";
    430433    *fLog << GetDescriptor() << "\t";
    431434    *fLog << dec << GetNumExecutions();
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r6499 r6500  
    116116    {
    117117        file = new TFile(name, option, title, comp);
     118        if (!file->IsOpen())
     119        {
     120            delete file;
     121            return NULL;
     122        }
     123
    118124        file->SetOption(option); // IMPORTANT!
    119125        ResetBit(kIsNotOwner);
     
    873879// TTree::CloneTree()
    874880//
    875 void MWriteRootFile::CopyTree(TTree &t)
     881void MWriteRootFile::CopyTree(TTree &t) const
    876882{
    877883    *fLog << "Copy of tree " << t.GetName() << " in progress..." << flush;
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h

    r6499 r6500  
    9696    Bool_t  ChangeFile(const char *fname);
    9797    TFile  *OpenFile(const char *name, Option_t *option, const char *title, Int_t comp);
    98     void    CopyTree(TTree &t);
     98    void    CopyTree(TTree &t) const;
    9999    Bool_t  MakeCopies(const char *oldname) const;
    100100
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6466 r6500  
    357357    MRawFileRead rawread(NULL);
    358358
     359    MRead *read = 0;
    359360    switch (GetDataFlag())
    360361    {
    361     case kIsUseRawData:
    362         rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    363         break;
    364     case kIsUseMC:
    365         readmc.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    366         break;
    367     case kIsUseRootData:
    368         readreal.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    369         break;
    370     }
     362    case kIsUseRawData:  read = &rawread;  break;
     363    case kIsUseMC:       read = &readmc;   break;
     364    case kIsUseRootData: read = &readreal; break;
     365    }
     366    read->AddFiles(fSequence.IsValid() ? iter : *fRuns);
     367
     368    const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()));
     369
     370    // Write the special MC tree
     371    MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
     372    writemc.SetName("WriteMC");
     373    writemc.AddContainer("MMcEvtBasic", "MonteCarlo");
     374
     375    // Skips empty MC events (Not necessary, but faster!)
     376    MContinue contmc("MRawEvtData.GetNumPixels<0.5", "ContEmptyMC");
    371377
    372378    MPointingPosInterpolate pextr;
     
    563569
    564570    // The second rule is for the case reading raw-files!
    565     MWriteRootFile write(2, Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()), fOverwrite?"RECREATE":"NEW");
     571    MWriteRootFile write(2, fname, fOverwrite?"RECREATE":"NEW");
    566572    // Run Header
    567573    write.AddContainer("MRawRunHeader",             "RunHeaders");
     
    682688
    683689    // Now setup main tasklist
    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);
     690    tlist.AddToList(read);
     691    if (IsUseMC())
     692        tlist.AddToList(&writemc);
     693    tlist.AddToList(&contmc);
     694
    697695    if (IsUseRootData())
    698696      tlist2.AddToList(&pextr);
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r6459 r6500  
    273273        write.AddContainer("MMcConfigRunHeader",   "RunHeaders");
    274274        write.AddContainer("MMcCorsikaRunHeader",  "RunHeaders");
     275        write.AddCopySource("MonteCarlo");
    275276    }
    276277    else
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r6459 r6500  
    259259// Return file name of current file.
    260260//
    261 TString MRawFileRead::GetFileName() const
     261TString MRawFileRead::GetFullFileName() const
    262262{
    263263    const TObject *file = fFileNames->At(fNumFile-1);
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.h

    r6456 r6500  
    3838    void SetInterleave(UInt_t i) { fInterleave = i; }
    3939
    40     TString GetFileName() const;
     40    TString GetFullFileName() const;
    4141
    4242    Int_t  AddFile(const char *fname, Int_t entries=-1);
  • trunk/MagicSoft/Mars/mraw/MRawSocketRead.h

    r4701 r6500  
    3131    void SetPort(int port) { fPort = port; }
    3232
    33     TString GetFileName() const { return "<socket>"; }
     33    TString GetFullFileName() const { return "<socket>"; }
    3434
    3535    ClassDef(MRawSocketRead, 0) //Task to read DAQ binary data from tcp/ip socket
Note: See TracChangeset for help on using the changeset viewer.