Changeset 1472 for trunk/MagicSoft


Ignore:
Timestamp:
08/01/02 15:22:34 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1471 r1472  
    99     mfileio/MWriteRootFile.[h,cc], mhist/MFillH.[h,cc]:
    1010     - added SavePrimitive
     11
     12   * mbase/MEvtLoop.h, mbase/MParList.h, mbase/MTaskList.h,
     13     mfileio/MReadMarsFile.h, mfileio/MReadTree.h,
     14     mfileio/MWriteRootFile.h, mhist/MFillH.h:
     15     - changed from ClassVersion 0 to ClassVersion 1
     16   
     17   * mfileio/FileIOLinkDef.h:
     18     - added MChain
     19
     20   * mfileio/MReadMarsFile.cc, mfileio/MReadTree.cc,
     21     mfileio/MWriteRootFile.cc, mhist/MFillH.cc:
     22     - added default constructor
     23
     24   * mfileio/MReadTree.cc:
     25     - moved MChain to its own file
     26
     27   * mfileio/MWriteRootFile.cc:
     28     - added default constructor to MRootFileBranch
     29     - changed Version number from 0 to 1
     30
     31   * mfileio/Makefile, mfileio/FileIOLinkDef.h:
     32     - MChain added
     33
     34   * mfileio/MChain.[h,cc]:
     35     - added (from MReadTree.cc)
    1136
    1237   * manalysis/MHillas.[h,cc]:
  • trunk/MagicSoft/Mars/NEWS

    r1466 r1472  
    6464   - added possibility to use interpolated pixel values for blind pixels
    6565     instead of removing it completely from the analysis
     66
     67   - started a first implementation to be able to write the eventloop/
     68     eventloop setup to a file (root-file, root-macro)
    6669
    6770
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.h

    r1471 r1472  
    2222private:
    2323    MParList  *fParList;
    24     MTaskList *fTaskList;
     24    MTaskList *fTaskList;      //!
    2525
    26     TGProgressBar *fProgress;
     26    TGProgressBar *fProgress;  //!
    2727
    2828    enum { kIsOwner = BIT(14) };
     
    4848    void SavePrimitive(ofstream &out, Option_t *o="");
    4949
    50     ClassDef(MEvtLoop, 0) // Class to execute the tasks in a tasklist
     50    ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
    5151};
    5252
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r1471 r1472  
    2626private:
    2727    TOrdCollection *fContainer;  // Collection of Parameter and Data Containers
    28     TOrdCollection *fAutodelete; // All what this list contains is deleted in the destructor
     28    TOrdCollection *fAutodelete; //! All what this list contains is deleted in the destructor
    2929
    3030    static TString GetClassName(const char *classname);
     
    8080    void SavePrimitive(ofstream &out, Option_t *o="");
    8181
    82     ClassDef(MParList, 0) // list of parameter containers (MParContainer)
     82    ClassDef(MParList, 1) // list of parameter containers (MParContainer)
    8383};
    8484
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r1471 r1472  
    2121{
    2222private:
    23     TList    *fTasks;   // Container for the ordered list of different tasks
     23    TList    *fTasks;       // Container for the ordered list of different tasks
    2424    TList    fTasksProcess; //!
    25     MParList *fParList;
     25    MParList *fParList;     //!
    2626
    27     UInt_t *fCntContinue;
    28     UInt_t *fCntTrue;
     27    UInt_t *fCntContinue;   //!
     28    UInt_t *fCntTrue;       //!
    2929
    3030    enum { kIsOwner = BIT(14) };
     
    6060    const TList *GetList() const { return fTasks; }
    6161
    62     ClassDef(MTaskList, 0)      //collection of tasks to be performed in the eventloop
     62    ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop
    6363};
    6464
  • trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h

    r1382 r1472  
    55#pragma link off all functions;
    66
     7#pragma link C++ class MChain+;
    78#pragma link C++ class MReadTree+;
    89#pragma link C++ class MReadMarsFile+;
  • trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc

    r1381 r1472  
    5050// --------------------------------------------------------------------------
    5151//
     52//  Default constructor. Don't use it.
     53//
     54MReadMarsFile::MReadMarsFile() : fRun(NULL)
     55{
     56    fName  = "MReadMarsFile";
     57    fTitle = "Task to loop over all events in a tree of a Mars file.";
     58}
     59
     60// --------------------------------------------------------------------------
     61//
    5262//  Default constructor. It creates a MReadTree object to read the
    5363//  RunHeaders and disables Auto Scheme for this tree.
  • trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h

    r1381 r1472  
    2020 
    2121public:
     22    MReadMarsFile();
    2223    MReadMarsFile(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
    2324    ~MReadMarsFile();
     
    2526    Int_t AddFile(const char *fname);
    2627
    27     ClassDef(MReadMarsFile, 0)  // Reads a tree from file(s)
     28    ClassDef(MReadMarsFile, 1)  // Reads a tree from file(s)
    2829};
    2930
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r1471 r1472  
    5454
    5555#include <TFile.h>           // TFile::GetName
    56 #include <TChain.h>
    5756#include <TSystem.h>         // gSystem->ExpandPath
    5857#include <TGProgressBar.h>
     
    6362#include "MLogManip.h"
    6463
    65 #include "MTime.h"
     64#include "MChain.h"
    6665#include "MFilter.h"
    6766#include "MParList.h"
     
    7069ClassImp(MReadTree);
    7170
    72 class MChain : public TChain
    73 {
    74 private:
    75     Bool_t fNotified;
    76 
    77 public:
    78     MChain() : TChain(), fNotified(kFALSE) {}
    79     MChain(const char *name, const char *title="") : TChain(name, title), fNotified(kFALSE) {}
    80 
    81     void ResetTree() { fTree = 0; }
    82 
    83     virtual Bool_t Notify() { fNotified = kTRUE; return kTRUE; }
    84     virtual void   SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; }
    85 
    86     Int_t LoadTree(Int_t entry)
    87     {
    88         //
    89         // This is the code from TChain::LoadTree but skips the
    90         // notification in LoadTree. If LoadTree raises the notification
    91         // a flag is set and the notification is done by hand. This
    92         // is done to be able to catch the return value from Notify. If
    93         // it has not been successfull -15 is returned.
    94         // This is to support return values from Notify()/Reinit()
    95         //
    96         TObject *notify = GetNotify();
    97 
    98         SetNotify(this);
    99 
    100         Int_t rc = TChain::LoadTree(entry);
    101 
    102         if (rc >= 0 && fNotified && notify)
    103             if (!notify->Notify())
    104                 rc = -15;
    105 
    106         SetNotify(notify);
    107 
    108         return rc;
    109     }
    110 };
    111 
    112 // --------------------------------------------------------------------------
    113 //
    114 //  Default constructor. It creates an TChain instance which represents the
     71// --------------------------------------------------------------------------
     72//
     73//  Default constructor. Don't use it.
     74//
     75MReadTree::MReadTree()
     76    : fNumEntry(0), fBranchChoosing(kFALSE), fAutoEnable(kTRUE), fProgress(NULL)
     77{
     78    fName  = "MReadTree";
     79    fTitle = "Task to loop over all events in one single tree";
     80
     81    fVetoList = NULL;
     82    fNotify = NULL;
     83
     84    fChain = NULL;
     85}
     86
     87// --------------------------------------------------------------------------
     88//
     89//  Constructor. It creates an TChain instance which represents the
    11590//  the Tree you want to read and adds the given file (if you gave one).
    11691//  More files can be added using MReadTree::AddFile.
     
    806781    TString name = ToLower(fName);
    807782
    808     out << "   " << ClassName() << " " << name << "(";
    809     out << fChain->GetName() << ", \"" << fName << "\", \"" << fTitle << "\");" << endl;
     783    out << "   " << ClassName() << " " << name << "(\"";
     784    out << fChain->GetName() << "\", \"" << fName << "\", \"" << fTitle << "\");" << endl;
    810785
    811786    TIter Next(fChain->GetListOfFiles());
  • trunk/MagicSoft/Mars/mfileio/MReadTree.h

    r1471 r1472  
    4040
    4141public:
     42    MReadTree();
    4243    MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
    4344    ~MReadTree();
     
    7374    virtual void   SavePrimitive(ofstream &out, Option_t *o="");
    7475
    75     ClassDef(MReadTree, 0)      // Reads a tree from file(s)
     76    ClassDef(MReadTree, 1)      // Reads a tree from file(s)
    7677};
    7778
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r1471 r1472  
    5151// --------------------------------------------------------------------------
    5252//
     53// Default constructor. It is there to support some root stuff.
     54// Don't use it.
     55//
     56MWriteRootFile::MWriteRootFile() : fOut(NULL)
     57{
     58    fName  = "MWriteRootFile";
     59    fTitle = "Task which writes a root-output file";
     60
     61    fBranches.SetOwner();
     62}
     63
     64// --------------------------------------------------------------------------
     65//
    5366// Specify the name of the root file. You can also give an option ("UPDATE"
    5467// and "RECREATE" would make sense only) as well as the file title and
     
    391404    out << fOut->GetTitle() << "\", ";
    392405    out << fOut->GetCompressionLevel() << ", \"";
    393     out << fName << "\", " << fTitle << "\");" << endl;;
     406    out << fName << "\", \"" << fTitle << "\");" << endl;;
    394407
    395408    MRootFileBranch *entry;
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h

    r1471 r1472  
    1616{
    1717private:
    18     TTree         *fTree;
    19     TBranch       *fBranch;
     18    TTree         *fTree;       //!
     19    TBranch       *fBranch;     //!
    2020
    21     MParContainer *fContainer;
     21    MParContainer *fContainer;  //!
    2222    TString        fContName;
    2323
     
    2929
    3030public:
     31    MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL)
     32    {
     33        Init(NULL, NULL);
     34        fContName = "";
     35    }
     36
    3137    MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL)
    3238        : fTree(NULL), fBranch(NULL), fContainer(NULL)
     
    5258    void SetTree(TTree *tree)              { fTree = tree; }
    5359
    54     ClassDef(MRootFileBranch, 0) // Storage container for MWriteRootFile to store TBranch informations
     60    ClassDef(MRootFileBranch, 1) // Storage container for MWriteRootFile to store TBranch informations
    5561};
    5662
     
    6167
    6268    TObjArray fBranches;
    63     TObjArray fTrees;
     69    TObjArray fTrees;     //!
    6470
    6571    void        CheckAndWrite() const;
     
    6975
    7076public:
     77    MWriteRootFile();
    7178    MWriteRootFile(const char *fname,
    7279                   const Option_t *opt="RECREATE",
     
    8794    void SavePrimitive(ofstream &out, Option_t *o="");
    8895
    89     ClassDef(MWriteRootFile, 0) // Class to write one container to a root file
     96    ClassDef(MWriteRootFile, 1) // Class to write one container to a root file
    9097};
    9198
  • trunk/MagicSoft/Mars/mfileio/Makefile

    r1382 r1472  
    3131.SUFFIXES: .c .cc .cxx .h .hxx .o
    3232
    33 SRCFILES = MReadTree.cc \
     33SRCFILES = MChain.cc \
     34           MReadTree.cc \
    3435           MReadMarsFile.cc \
    3536           MWriteFile.cc \
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1471 r1472  
    8989    fTitle = title ? title : "Task to fill Mars histograms";
    9090
    91     fH                = NULL;
    92     fParContainer     = NULL;
     91    fH            = NULL;
     92    fParContainer = NULL;
     93}
     94
     95// --------------------------------------------------------------------------
     96//
     97// Default Constructor. This is to support some root-stuff.
     98// Never try to use it yourself!
     99//
     100MFillH::MFillH()
     101{
     102    Init(NULL, NULL);
    93103}
    94104
  • trunk/MagicSoft/Mars/mhist/MFillH.h

    r1471 r1472  
    1212{
    1313private:
    14     const MParContainer *fParContainer;
     14    const MParContainer *fParContainer; //!
    1515    TString fParContainerName;
    1616
    17     MH* fH;
     17    MH* fH;                             //!
    1818    TString fHName;
    1919
     
    2424
    2525public:
     26    MFillH();
    2627    MFillH(const char *hist, const char *par=NULL,     const char *name=NULL, const char *title=NULL);
    2728    MFillH(const char *hist, const MParContainer *par, const char *name=NULL, const char *title=NULL);
     
    3536    void SavePrimitive(ofstream &out, Option_t *o="");
    3637
    37     ClassDef(MFillH, 0) // Task to fill a histogram with data from a parameter container
     38    ClassDef(MFillH, 1) // Task to fill a histogram with data from a parameter container
    3839};
    3940   
Note: See TracChangeset for help on using the changeset viewer.