Changeset 1003 for trunk/MagicSoft


Ignore:
Timestamp:
10/29/01 11:15:53 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Makefile.rules

    r991 r1003  
    55
    66$(LIB): $(OBJS) $(HEADERS) $(CINT)Cint.o
    7         @echo " - Building Library lib$(LIB) ... "
     7        @echo " - Building Library lib$(LIB)"
    88        $(AR) $(LIB) *.o
    99
    1010$(CINT)Cint.cc: $(HEADERS)
    11         @echo " - Generating dictionary $(CINT)Cint.cc ..."
     11        @echo " - Generating dictionary $(CINT)Cint.cc"
    1212
    1313        $(ROOTSYS)/bin/rootcint -f $(CINT)Cint.cc \
     
    1515
    1616.cxx.o:
    17         @echo " - Compiling " $<
     17        @echo " - Compiling" $<
    1818        $(CXX) $(CXXFLAGS) -c $< -o $@
    1919
    2020.cc.o: 
    21         @echo " - Compiling " $<
     21        @echo " - Compiling" $<
    2222        $(CXX) $(CXXFLAGS) -c $< -o $@
    2323
    2424.c.o:   
    25         @echo " - Compiling " $<
     25        @echo " - Compiling" $<
    2626        $(CC) $(CFLAGS) -c $< -o $@
    2727#
  • trunk/MagicSoft/Mars/macros/rootlogon.C

    r948 r1003  
    3333        cout << "error." << endl;
    3434    else
     35    {
     36        MParContainer::Class()->IgnoreTObjectStreamer();
    3537        cout << "done." << endl;
     38    }
    3639
    3740    cout << endl;
  • trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc

    r959 r1003  
    4343#include <fstream.h>
    4444
    45 #include <TArrayC.h>
     45#include <TList.h>
    4646
    4747#include "MLog.h"
     
    6565    : fIn(NULL)
    6666{
    67     *fName  = name  ? name  : "MCT1ReadAscii";
    68     *fTitle = title ? title : "Task to loop over events in CT1 ascii file";
     67    fName  = name  ? name  : "MCT1ReadAscii";
     68    fTitle = title ? title : "Task to loop over events in CT1 ascii file";
    6969
    7070    //
    7171    // remember file name for opening the file in the preprocessor
    7272    //
    73     fFileNames = new TArrayC;
     73    fFileNames = new TList;
     74    fFileNames->SetOwner();
     75
    7476    if (fname)
    7577        AddFile(fname);
     
    9395void MCT1ReadAscii::AddFile(const char *txt)
    9496{
    95     const int sz  = fFileNames->GetSize();
    96     const int tsz = strlen(txt)+1;
    97 
    98     fFileNames->Set(sz+tsz);
    99 
    100     memcpy(fFileNames->GetArray()+sz, txt, tsz);
     97    TNamed *name = new TNamed(txt, "");
     98    fFileNames->AddLast(name);
    10199}
    102100
     
    114112    fIn = NULL;
    115113
    116     const int arrsz = fFileNames->GetSize();
    117 
    118     if (arrsz<1)
     114    //
     115    // Check for the existance of a next file to read
     116    //
     117    TNamed *file = (TNamed*)fFileNames->First();
     118    if (!file)
    119119        return kFALSE;
    120120
     
    122122    // open the file which is the first one in the chain
    123123    //
    124     const char *name = fFileNames->GetArray();
     124    const char *name = file->GetName();
    125125
    126126    fIn = new ifstream(name);
    127     if (!(*fIn))
    128     {
     127
     128    const Bool_t noexist = !(*fIn);
     129
     130    if (noexist)
    129131        *fLog << dbginf << "Cannot open file '" << name << "'" << endl;
    130         return kFALSE;
    131     }
    132 
    133     //
    134     // remove the first entry from the chain
    135     //
    136     *fLog << "Open file: '" << name << "'" << endl;
    137 
    138     //
    139     // create the new char array containing the filenames to process
    140     //
    141     const int sz  = strlen(name)+1;
    142 
    143     char *dummy = new char[arrsz-sz];
    144     memcpy(dummy, name+sz, arrsz-sz);
    145 
    146     //
    147     // dummy will be deleted by the destructor of fFileNames
    148     //
    149     fFileNames->Adopt(arrsz-sz, dummy);
    150 
    151     return kTRUE;
    152 
     132    else
     133        *fLog << "Open file: '" << name << "'" << endl;
     134
     135    //
     136    // Remove this file from the list of pending files
     137    //
     138    fFileNames->Remove(file);
     139
     140    return !noexist;
    153141}
    154142
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r857 r1003  
    5858MCerPhotCalc::MCerPhotCalc(const char *name, const char *title)
    5959{
    60     *fName  = name  ? name  : "MCerPhotCalc";
    61     *fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
     60    fName  = name  ? name  : "MCerPhotCalc";
     61    fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
    6262}
    6363
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r991 r1003  
    4545{
    4646
    47   *fName  = name  ? name  : "MCerPhotEvt";
    48   *fTitle = title ? title : "(Number of Photon)-Event Information";
     47  fName  = name  ? name  : "MCerPhotEvt";
     48  fTitle = title ? title : "(Number of Photon)-Event Information";
    4949 
    5050  fPixels = new TClonesArray ("MCerPhotPix", 577) ;
  • trunk/MagicSoft/Mars/manalysis/MHillas.cc

    r991 r1003  
    6060MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)
    6161{
    62     *fName  = name  ? name  : "MHillas";
    63     *fTitle = title ? title : "Storage container for Hillas parameter of one event";
     62    fName  = name  ? name  : "MHillas";
     63    fTitle = title ? title : "Storage container for Hillas parameter of one event";
    6464
    6565    Reset();
  • trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc

    r857 r1003  
    5656MHillasCalc::MHillasCalc(const char *name, const char *title)
    5757{
    58     *fName  = name  ? name  : "MHillasCalc";
    59     *fTitle = title ? title : "Task to calculate Hillas parameters";
     58    fName  = name  ? name  : "MHillasCalc";
     59    fTitle = title ? title : "Task to calculate Hillas parameters";
    6060}
    6161
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc

    r977 r1003  
    6666    : fCleanLvl1(lvl1), fCleanLvl2(lvl2)
    6767{
    68     *fName  = name  ? name  : "MImgCleanStd";
    69     *fTitle = title ? title : "Task which does a standard image cleaning";
     68    fName  = name  ? name  : "MImgCleanStd";
     69    fTitle = title ? title : "Task which does a standard image cleaning";
    7070
    7171    *fLog << "Cleaning initialized. Using noise level " << lvl1 << " and " << lvl2 << endl;
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r993 r1003  
    4949MMcPedestalCopy::MMcPedestalCopy(const char *name, const char *title)
    5050{
    51     *fName  = name  ? name  : "MMcPedestalCopy";
    52     *fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
     51    fName  = name  ? name  : "MMcPedestalCopy";
     52    fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
    5353}
    5454
  • trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc

    r857 r1003  
    5353MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
    5454{
    55     *fName  = name  ? name  : "MPedCalcPedRun";
    56     *fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
     55    fName  = name  ? name  : "MPedCalcPedRun";
     56    fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
    5757}
    5858
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r857 r1003  
    4242MPedestalCam::MPedestalCam(const char *name, const char *title)
    4343{
    44     *fName  = name  ? name  : "MPedestalCam";
    45     *fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
     44    fName  = name  ? name  : "MPedestalCam";
     45    fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
    4646
    4747    fArray = new TClonesArray("MPedestalPix", 577);
  • trunk/MagicSoft/Mars/mbase/MArray.h

    r654 r1003  
    1212#ifndef MAGIC_H
    1313#include "MAGIC.h"
    14 #endif
    15 
    16 #ifndef ROOT_TObject
    17 #include <TObject.h>
    1814#endif
    1915
  • trunk/MagicSoft/Mars/mbase/MArrayB.h

    r654 r1003  
    1515
    1616#include <string.h>
    17 
    1817
    1918class MArrayB : public MArray
  • trunk/MagicSoft/Mars/mbase/MClone.cc

    r991 r1003  
    6666void MClone::Init(const char *name, const char *title)
    6767{
    68     *fName  = name  ? name  : "MClone";
    69     *fTitle = title ? title : "Task to clone a parameter container for later usage";
     68    fName  = name  ? name  : "MClone";
     69    fTitle = title ? title : "Task to clone a parameter container for later usage";
    7070
    7171    fClone  = NULL;
  • trunk/MagicSoft/Mars/mbase/MInputStreamID.cc

    r752 r1003  
    4444MInputStreamID::MInputStreamID(const char *name, const char *title)
    4545{
    46     *fName = name ? name : ClassName();
    47     *fTitle = title;
     46    fName = name ? name : ClassName();
     47    fTitle = title;
    4848
    49     fStreamId = new char[4];
    50     strcpy(fStreamId, "All");
     49    fStreamId = "All"; //new char[4];
     50    //strcpy(fStreamId, "All");
    5151}
    5252
  • trunk/MagicSoft/Mars/mbase/MInputStreamID.h

    r458 r1003  
    1919{
    2020private:
    21     char *fStreamId;            //! which type of task should be processed?
     21    TString fStreamId;  //! which type of task should be processed?
    2222
    2323public:
    2424    MInputStreamID(const char *name=NULL, const char *title=NULL);
    2525
    26     const char *GetStreamId()
     26    const TString &GetStreamId() const { return fStreamId; }
     27    void SetStreamId(const char *t)    { fStreamId = t; }
     28
     29    Bool_t operator==(MInputStreamID &id) const
    2730    {
    28         return (const char *)fStreamId;
    29     }
    30     void SetStreamId(const char *t)
    31     {
    32         delete fStreamId;
    33         fStreamId = new char[strlen(t)+1];
    34         strcpy(fStreamId, t);
     31        return fStreamId == id.fStreamId;
    3532    }
    3633
    37     ClassDef(MInputStreamID, 1) //Assigns an ID to tasks or a task list
     34    Bool_t operator!=(MInputStreamID &id) const
     35    {
     36        return fStreamId != id.fStreamId;
     37    }
     38
     39    ClassDef(MInputStreamID, 0) //Assigns an Id to tasks or a task list
    3840};
    3941
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r986 r1003  
    5151MParContainer::MParContainer(const MParContainer &named)
    5252{
    53     *fName  = *(named.fName);
    54     *fTitle = *(named.fTitle);
     53    fName  = named.fName;
     54    fTitle = named.fTitle;
    5555
    5656    fLog = named.fLog;
     
    7070    TObject::operator=(rhs);
    7171
    72     *fName  = *(rhs.fName);
    73     *fTitle = *(rhs.fTitle);
     72    fName  = rhs.fName;
     73    fTitle = rhs.fTitle;
    7474
    7575    fLog         = rhs.fLog;
     
    8181// --------------------------------------------------------------------------
    8282//
     83// Make a clone of an object using the Streamer facility.
     84// If newname is specified, this will be the name of the new object
     85//
     86TObject *MParContainer::Clone(const char *newname) const
     87{
     88
     89   MParContainer *named = (MParContainer*)TObject::Clone(newname);
     90   if (newname && strlen(newname)) named->SetName(newname);
     91   return named;
     92}
     93
     94// --------------------------------------------------------------------------
     95//
    8396//  Compare two MParContainer objects. Returns 0 when equal, -1 when this is
    8497//  smaller and +1 when bigger (like strcmp).
    8598//
    86 Int_t MParContainer::Compare(TObject *obj)
     99Int_t MParContainer::Compare(const TObject *obj) const
    87100{
    88101    if (this == obj) return 0;
    89     return fName->CompareTo(obj->GetName());
     102    return fName.CompareTo(obj->GetName());
    90103}
    91104
     
    100113    TObject::Copy(obj);
    101114
    102     *cont.fName  = *fName;
    103     *cont.fTitle = *fTitle;
     115    cont.fName  = fName;
     116    cont.fTitle = fTitle;
    104117
    105118    cont.fLog         = fLog;
     
    113126void MParContainer::FillBuffer(char *&buffer)
    114127{
    115     fName->FillBuffer(buffer);
    116     fTitle->FillBuffer(buffer);
     128    fName.FillBuffer(buffer);
     129    fTitle.FillBuffer(buffer);
    117130}
    118131
     
    121134//  List MParContainer name and title.
    122135//
    123 void MParContainer::ls(Option_t *)
     136void MParContainer::ls(Option_t *) const
    124137{
    125138    TROOT::IndentLevel();
     
    147160void MParContainer::SetName(const char *name)
    148161{
    149     *fName = name;
     162    fName = name;
    150163    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    151164}
     
    158171void MParContainer::SetObject(const char *name, const char *title)
    159172{
    160     *fName  = name;
    161     *fTitle = title;
     173    fName  = name;
     174    fTitle = title;
    162175    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    163176}
     
    169182void MParContainer::SetTitle(const char *title)
    170183{
    171     *fTitle = title;
     184    fTitle = title;
    172185    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    173186}
     
    179192Int_t MParContainer::Sizeof() const
    180193{
    181     Int_t nbytes = fName->Sizeof() + fTitle->Sizeof();
     194    Int_t nbytes = fName.Sizeof() + fTitle.Sizeof();
    182195    return nbytes;
    183196}
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r986 r1003  
    2222class ofstream;
    2323class ifstream;
    24 
     24/*
    2525class MParContainer : public TObject
    2626{
     
    3232        fTitle = new TString;
    3333        (*fTitle) = title;
     34
     35        cout << " <***> " << flush;
    3436    }
    3537
     
    5355      //delete fName; delete fTitle;
    5456    }
    55     virtual Int_t    Compare(TObject *obj);
     57    virtual TObject *Clone(const char *newname) const;
     58    virtual Int_t    Compare(const TObject *obj) const;
    5659    virtual void     Copy(TObject &named);
    5760    virtual void     FillBuffer(char *&buffer);
     
    6366    virtual void     SetObject(const char *name, const char *title);
    6467    virtual void     SetTitle(const char *title=""); // *MENU*
    65     virtual void     ls(Option_t *option="");
     68    virtual void     ls(Option_t *option="") const;
    6669    virtual void     Print(Option_t *option="") const;
    6770    virtual Int_t    Sizeof() const;
     
    7780    ClassDef(MParContainer, 1)  //The basis for all parameter containers
    7881};
     82*/
    7983
     84class MParContainer : public TObject
     85{
     86protected:
     87    TString fName;        // parameter container identifier (name)
     88    TString fTitle;       // parameter container title
     89
     90    MLog   *fLog;         // The general log facility for this object, initialized with the global object
     91
     92private:
     93    Bool_t  fReadyToSave; // should be set to true if the contents of the container is changed somehow
     94
     95public:
     96    MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) {  }
     97    MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) {  }
     98    MParContainer(const MParContainer &named);
     99    MParContainer& operator=(const MParContainer& rhs);
     100
     101    void SetLogStream(MLog *lg) { fLog = lg; }
     102
     103    virtual TObject *Clone(const char *newname="") const;
     104    virtual Int_t    Compare(const TObject *obj) const;
     105    virtual void     Copy(TObject &named);
     106    virtual void     FillBuffer(char *&buffer);
     107    virtual const char  *GetName() const  { return fName.Data(); }
     108    virtual const char  *GetTitle() const { return fTitle.Data(); }
     109    virtual ULong_t  Hash()               { return fName.Hash(); }
     110    virtual Bool_t   IsSortable() const   { return kTRUE; }
     111    virtual void     SetName(const char *name); // *MENU*
     112    virtual void     SetObject(const char *name, const char *title);
     113    virtual void     SetTitle(const char *title=""); // *MENU*
     114    virtual void     ls(Option_t *option="") const;
     115    virtual void     Print(Option_t *option="") const;
     116    virtual Int_t    Sizeof() const;
     117
     118    virtual void     Reset() {  }
     119
     120    virtual Bool_t IsReadyToSave()                   { return fReadyToSave; }
     121    virtual void   SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
     122
     123    virtual void AsciiRead(ifstream &fin);
     124    virtual void AsciiWrite(ofstream &fout) const;
     125
     126    ClassDef(MParContainer, 0)  //The basis for all parameter containers
     127};
     128
     129/*
     130class MParContainer : public TNamed
     131{
     132protected:
     133    MLog    *fLog;         //! The general log facility for this object, initialized with the global object
     134
     135private:
     136    Bool_t   fReadyToSave; //! should be set to true if the contents of the container is changed somehow
     137
     138public:
     139    MParContainer(const char *name="", const char *title="") : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
     140    MParContainer(const TString &name, const TString &title) : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
     141
     142    void SetLogStream(MLog *lg)                      { fLog = lg; }
     143
     144    virtual void   Reset()                           {  }
     145
     146    virtual Bool_t IsReadyToSave()                   { return fReadyToSave; }
     147    virtual void   SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
     148
     149    virtual void AsciiRead(ifstream &fin);
     150    virtual void AsciiWrite(ofstream &fout) const;
     151
     152    ClassDef(MParContainer, 0)  //The basis for all parameter containers
     153};
     154*/
    80155#endif
    81156
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r986 r1003  
    4343#include <TNamed.h>
    4444#include <TClass.h>
    45 #include <TObjArray.h>
     45#include <TOrdCollection.h>
    4646
    4747#include "MLog.h"
     
    5757MParList::MParList(const char *name, const char *title)
    5858{
    59     *fName  = name  ? name  : "MParList";
    60     *fTitle = title ? title : "A list of Parameter Containers";
     59    fName  = name  ? name  : "MParList";
     60    fTitle = title ? title : "A list of Parameter Containers";
    6161
    6262    //
     
    6464    // that the destructor of the list deletes all it's objects
    6565    //
    66     fAutodelete.SetOwner();
     66    fContainer  = new TOrdCollection;
     67    fAutodelete = new TOrdCollection;
     68
     69    fAutodelete->SetOwner();
    6770}
    6871
     
    7679MParList::MParList(MParList &ts)
    7780{
    78     fContainer.AddAll(&ts.fContainer);
     81    fContainer->AddAll(ts.fContainer);
    7982}
    8083
     
    8790{
    8891    if (TestBit(kIsOwner))
    89         fContainer.SetOwner();
     92        fContainer->SetOwner();
     93
     94    delete fContainer;
     95    delete fAutodelete;
    9096}
    9197
     
    107113void MParList::SetLogStream(MLog *log)
    108114{
    109     TIter Next(&fContainer);
     115    TIter Next(fContainer);
    110116
    111117    MParContainer *cont=NULL;
     
    143149    // Check if the new container is already existing in the list
    144150    //
    145     const TObject *objn = fContainer.FindObject(name);
    146     const TObject *objt = fContainer.FindObject(cont);
     151    const TObject *objn = fContainer->FindObject(name);
     152    const TObject *objt = fContainer->FindObject(cont);
    147153
    148154    if (objn || objt)
     
    172178    if (where)
    173179    {
    174         if (!fContainer.FindObject(where))
     180        if (!fContainer->FindObject(where))
    175181        {
    176182            *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
     
    181187    *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
    182188
    183     fContainer.Add(cont);
     189    fContainer->Add(cont);
    184190    *fLog << "Done." << endl;
    185191
     
    204210    while ((cont=(MParContainer*)Next()))
    205211    {
    206         //
     212        AddToList(cont);
     213/*        //
    207214        // Get Name of new container
    208215        //
     
    212219        // Check if the new container is already existing in the list
    213220        //
    214         const TObject *objn = fContainer.FindObject(name);
    215         const TObject *objt = fContainer.FindObject(cont);
     221        const TObject *objn = fContainer->FindObject(name);
     222        const TObject *objt = fContainer->FindObject(cont);
    216223
    217224        if (objn || objt)
     
    237244        *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
    238245
    239         fContainer.Add(cont);
    240 
    241         *fLog << "Done." << endl;
     246        fContainer->Add(cont);
     247
     248        *fLog << "Done." << endl;*/
    242249    }
    243250}
     
    250257TObject *MParList::FindObject(const char *name) const
    251258{
    252     return fContainer.FindObject(name);
     259    return fContainer->FindObject(name);
    253260}
    254261
     
    259266TObject *MParList::FindObject(TObject *obj) const
    260267{
    261     return fContainer.FindObject(obj);
     268    return fContainer->FindObject(obj);
    262269}
    263270
     
    358365    // if object is not existing in the list try to create one
    359366    //
    360     *fLog << dbginf << "Object '" << oname << "' [" << cname << "] not found... creating." << endl;
     367    *fLog << "Object '" << oname << "' [" << cname << "] not yet in " << GetName() << "... creating." << endl;
    361368
    362369    //
     
    393400    // object is deleted together with the list
    394401    //
    395     fAutodelete.Add(pcont);
     402    fAutodelete->Add(pcont);
    396403
    397404    //
     
    419426void MParList::SetReadyToSave(Bool_t flag)
    420427{
    421     TIter Next(&fContainer);
     428    TIter Next(fContainer);
    422429
    423430    MParContainer *cont=NULL;
     
    438445void MParList::Reset()
    439446{
    440     TIter Next(&fContainer);
     447    TIter Next(fContainer);
    441448
    442449    MParContainer *cont=NULL;
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r986 r1003  
    1414#endif
    1515
    16 #ifndef ROOT_TOrdCollection
    17 #include "TOrdCollection.h"
     16#ifndef ROOT_TObjArray
     17#include <TObjArray.h>
    1818#endif
    1919#ifndef MPARCONTAINER_H
     
    2121#endif
    2222
    23 #include <TObjArray.h>
     23class TOrdCollection;
    2424
    2525class MLog;
     
    2828{
    2929private:
    30     TOrdCollection fContainer;  // Collection of Parameter and Data Containers
    31     TOrdCollection fAutodelete; // All what this list contains is deleted in the destructor
     30    TOrdCollection *fContainer; // Collection of Parameter and Data Containers
     31    TOrdCollection *fAutodelete; // All what this list contains is deleted in the destructor
    3232
    3333    static TString GetClassName(const char *classname);
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r991 r1003  
    5454void MPrint::Init(const char *name, const char *title)
    5555{
    56     *fName  = name  ? name  : "MPrint";
    57     *fTitle = title ? title : "Task to print a parameter container";
     56    fName  = name  ? name  : "MPrint";
     57    fTitle = title ? title : "Task to print a parameter container";
    5858
    5959    fObject = NULL;
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r991 r1003  
    5353#include <fstream.h>
    5454
    55 #include <TFile.h>
    5655#include <TChain.h>
    57 #include <TArrayC.h>
    58 #include <TObjArray.h>
    5956#include <TChainElement.h>
     57#include <TOrdCollection.h>
    6058
    6159#include "MLog.h"
     
    6462#include "MTime.h"
    6563#include "MParList.h"
     64#include "MTaskList.h"
    6665
    6766ClassImp(MReadTree);
     
    7776MReadTree::MReadTree(const char *tname, const char *fname,
    7877                     const char *name, const char *title)
    79     : fNumEntry(0), fLeafEnabled(kFALSE)
    80 {
    81     *fName  = name  ? name  : "MReadTree";
    82     *fTitle = title ? title : "Task to loop over all events in one single tree";
    83 
    84     fVetoList = new TArrayC;
     78    : fNumEntry(0), fBranchChoosing(kFALSE), fAutoEnable(kTRUE)
     79{
     80    fName  = name  ? name  : "MReadTree";
     81    fTitle = title ? title : "Task to loop over all events in one single tree";
     82
     83    fVetoList = new TOrdCollection;
     84    fVetoList->SetOwner();
    8585
    8686    //
     
    138138}
    139139
    140 // --------------------------------------------------------------------------
    141 //
    142 // The first time this function is called all leafes/branches are disabled
    143 // and the given branch/leaf is enabled. By enabling only the branches you
     140void MReadTree::EnableBranchChoosing()
     141{
     142    if (fBranchChoosing)
     143        return;
     144
     145    *fLog << "Branch choosing method enabled (only enabled branches are read)." << endl;
     146    fChain->SetBranchStatus("*", kFALSE);
     147    fBranchChoosing = kTRUE;
     148}
     149
     150// --------------------------------------------------------------------------
     151//
     152// The first time this function is called all branches are disabled.
     153// The given branch is enabled. By enabling only the branches you
    144154// are processing you can speed up your calculation many times (up to
    145155// a factor of 10 or 20)
    146156//
    147 void MReadTree::UseLeaf(const char *name)
    148 {
    149     if (!fLeafEnabled)
    150     {
    151         *fLog << "Leaf choosing method enabled (only enabled leaves are read)." << endl;
    152         fChain->SetBranchStatus("*", kFALSE);
    153         fLeafEnabled = kTRUE;
    154     }
    155 
     157void MReadTree::EnableBranch(const char *name)
     158{
     159    EnableBranchChoosing();
    156160    fChain->SetBranchStatus(name, kTRUE);
     161}
     162
     163// --------------------------------------------------------------------------
     164//
     165// This is the implementation of the Auto Enabling Scheme.
     166// For more information see MTask::AddBranchToList.
     167// This function loops over all tasks in the tasklist and enables
     168// all branches which are requested by the tasks.
     169//
     170// To enable 'unknown' branches which are not in the Branchlist of
     171// the tasks you can call EnableBranch
     172//
     173void MReadTree::EnableBranches(MParList *plist)
     174{
     175    //
     176    // if auto enabling is off reject the request
     177    //
     178    if (!fAutoEnable)
     179        return;
     180
     181    //
     182    // check whether branch choosing must be switched on
     183    //
     184    EnableBranchChoosing();
     185
     186    //
     187    // request the tasklist from the parameter list.
     188    // FIXME: Tasklist can have a different name
     189    //
     190    const MTaskList *tlist = (MTaskList*)plist->FindObject("MTaskList");
     191    if (!tlist)
     192    {
     193        *fLog << "Cannot use auto enabeling scheme for branches. 'MTaskList' not found." << endl;
     194        return;
     195    }
     196
     197    //
     198    // Loo over all tasks in the task list.
     199    //
     200    MTask *task;
     201    TIter NextTask(tlist->GetList());
     202    while ((task=(MTask*)NextTask()))
     203    {
     204        //
     205        // Loop over all branches of this task
     206        //
     207        TNamed *branch;
     208        TIter NextBranch(task->GetListOfBranches());
     209        while ((branch=(TNamed*)NextBranch()))
     210        {
     211            //
     212            // Get branch name to enable and enable the branch
     213            //
     214            const char *name = branch->GetName();
     215
     216            *fLog << "Enabeling '" << name << "'." << endl;
     217
     218            fChain->SetBranchStatus(name, kTRUE);
     219        }
     220    }
    157221}
    158222
     
    208272        // Check if enabeling the branch is allowed
    209273        //
    210         if (HasVeto(name))
     274        if (fVetoList->FindObject(name))
    211275        {
    212276            *fLog << "Branch " << name << " has veto... skipped." << endl;
     
    242306        fChain->SetBranchAddress(name, pcont);
    243307
    244         *fLog << "Branch " << name << " enabled for reading." << endl;
     308        *fLog << "Branch " << name << " setup for reading." << endl;
    245309
    246310        num++;
    247311    }
    248312
    249     *fLog << "MReadTree will read " << num << " branches." << endl;
     313    *fLog << "MReadTree setup " << num << " branches." << endl;
     314
     315    EnableBranches(pList);
    250316
    251317    return kTRUE;
     
    261327Bool_t MReadTree::Process()
    262328{
    263     return fChain->GetEntry(fNumEntry++) == 0 ? kFALSE : kTRUE;
     329    return fChain->GetEntry(fNumEntry++) != 0;
    264330}
    265331
     
    270336Bool_t MReadTree::GetEvent()
    271337{
    272     return fChain->GetEntry(fNumEntry) == 0 ? kFALSE : kTRUE;
     338    return fChain->GetEntry(fNumEntry) != 0;
    273339}
    274340
     
    338404// --------------------------------------------------------------------------
    339405//
    340 // This function checks if the Branch Name is part of the Veto List.
    341 // This means, that the preprocess doesn't enable the branch.
    342 //
    343 Bool_t MReadTree::HasVeto(const char *name) const
    344 {
    345     const size_t nlen = strlen(name)+1;
    346 
    347     char  *pos = fVetoList->GetArray();
    348     size_t len = fVetoList->GetSize();
    349 
    350     //
    351     // now we compare the 'strings' in the list word by word
    352     // (string or word in this context means a zero terminated
    353     // array of chars
    354     //
    355 
    356     for (;;)
    357     {
    358         //
    359         // Search for the first byte of the name
    360         //
    361         char *c = (char*)memchr(pos, name[0], len);
    362 
    363         //
    364         // if we don't find the first byte, the list cannot contain 'name'
    365         //
    366         if (!c)
    367             return kFALSE;
    368 
    369         //
    370         // calculate and check how many bytes remains in the list
    371         //
    372         len -= c-pos;
    373 
    374         //
    375         // if there are not enough bytes to match the query we are done
    376         //
    377         if (len<nlen)
    378             return kFALSE;
    379 
    380         //
    381         // check if the next 'nlen' byte (including the trailing '\0'
    382         // are matching
    383         //
    384         if (!memcmp(c, name, nlen))
    385             return kTRUE;
    386 
    387         //
    388         // we didn't find the string, goto the next 'string'
    389         //
    390         pos = (char*)memchr(c, '\0', len);
    391 
    392         //
    393         // check if there is a 'next' string really
    394         //
    395         if (!pos)
    396             return kFALSE;
    397 
    398         //
    399         // calculate the remaining length
    400         //
    401         len -= pos-c;
    402 
    403         //
    404         // if there are not enough bytes to match the query we are done
    405         //
    406         if (len<nlen)
    407             return kFALSE;
    408     }
    409 }
    410 
    411 
    412 // --------------------------------------------------------------------------
    413 //
    414 // If you don't want that a branch is enabled within the PreProcess you
    415 // can set a veto for enabeling the branch. (This means also the
    416 // corresponding object won't be created automatically)
    417 //
    418 // This functionality is for experienced users which don't want to
    419 // read in branches which are not processed in the program (for
    420 // speed reasons)
     406// If you don't want that an object is created for this branch
     407// and/or the branch address is set in the Preprocessing of
     408// MReadTree use VetoBranch. This saves mainly memory space.
    421409//
    422410void MReadTree::VetoBranch(const char *name)
    423411{
    424     //
    425     // Add this file as the last entry of the list
    426     // (including the trailing '\0')
    427     //
    428     const int sz  = fVetoList->GetSize();
    429     const int tsz = strlen(name)+1;
    430 
    431     fVetoList->Set(sz+tsz);
    432 
    433     memcpy(fVetoList->GetArray()+sz, name, tsz);
    434 }
     412    TNamed *branch = new TNamed(name, "");
     413    fVetoList->Add(branch);
     414}
  • trunk/MagicSoft/Mars/mbase/MReadTree.h

    r965 r1003  
    66#endif
    77
    8 class TFile;
    98class TChain;
    10 class TArrayC;
    119
    1210class MReadTree : public MTask
    1311{
    1412private:
    15     TFile   *fFile;       // Pointer to file
    16     TChain  *fChain;      // Pointer to tree
     13    TChain *fChain;            // Pointer to tree
    1714
    18     TArrayC *fVetoList;   // List of Branches which are not allowed to get enabled
     15    UInt_t  fNumEntry;         // Number of actual entry
     16    UInt_t  fNumEntries;       // Number of Events in Tree
    1917
    20     UInt_t   fNumEntry;   // Number of actual entry
    21     UInt_t   fNumEntries; // Number of Events in Tree
     18    Bool_t  fBranchChoosing;   // Flag for branch choosing method
     19    Bool_t  fAutoEnable;       // Flag for auto enabeling scheme
    2220
    23     Bool_t   fLeafEnabled; // Flag whether UseLeaf is called the first time or not
     21    TOrdCollection *fVetoList; // List of Branches which are not allowed to get enabled
    2422
    25     Bool_t HasVeto(const char *name) const;
     23    void EnableBranches(MParList *plist);
     24    void EnableBranchChoosing();
    2625
    2726public:
     
    3231    Bool_t Process();
    3332
    34     Int_t AddFile(const char *fname);
    35     void  VetoBranch(const char *name);
     33    Int_t  AddFile(const char *fname);
     34    void   VetoBranch(const char *name);
    3635
    37     void UseLeaf(const char *name);
     36    void   EnableBranch(const char *name);
    3837
    3938    Bool_t GetEvent();
     
    4645    UInt_t GetEntries() const  { return fNumEntries; }
    4746
     47    void   DisableAutoScheme() { fAutoEnable = kFALSE; }
     48
    4849    ClassDef(MReadTree, 0)      // Reads one tree
    4950};
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r988 r1003  
    6767#include "MTask.h"
    6868
     69#include <TOrdCollection.h>
     70
    6971#include "MLog.h"
    7072#include "MLogManip.h"
     
    7577
    7678MTask::MTask(const char *name, const char *title)
    77     : fFilter(NULL), fIsPreprocessed(kFALSE), fNumExecutions()
    78 {
    79     *fName  = name  ? name  : "MTask";
    80     *fTitle = title ? title : "Base class for all tasks (dummy task).";
     79    : fFilter(NULL), fIsPreprocessed(kFALSE), fNumExecutions(0)
     80{
     81    fName  = name  ? name  : "MTask";
     82    fTitle = title ? title : "Base class for all tasks (dummy task).";
     83
     84    fListOfBranches = new TOrdCollection;
     85    fListOfBranches->SetOwner();
     86}
     87
     88MTask::~MTask()
     89{
     90    delete fListOfBranches;
     91}
     92
     93// --------------------------------------------------------------------------
     94//
     95// This adds a branch to the list for the auto enabeling schmeme.
     96// This makes it possible for MReadTree to decide which branches
     97// are really needed for the eventloop. Only the necessary branches
     98// are read from disk which speeds up the calculation enormously.
     99//
     100// You can use TRegExp expressions like "*.fEnergy", but the
     101// recommended method is to call this function for exactly all
     102// branches you want to have, eg:
     103//  AddToBranchList("MMcTrig;1.fNumFirstLevel");
     104//  AddToBranchList("MMcTrig;2.fNumFirstLevel");
     105//
     106// We agreed on the convetion, that all branches are stored with
     107// a trailing dot '.' so that always the Master Branch name
     108// (eg. MMcTrig) is part of the branch name.
     109//
     110// Remark: The common place to call AddToBranchList is the
     111//         constructor of the derived classes (tasks)
     112//
     113void MTask::AddToBranchList(const char *b)
     114{
     115    TNamed *name = new TNamed(b, "");
     116    fListOfBranches->Add(name);
     117}
     118
     119// --------------------------------------------------------------------------
     120//
     121// Copy constructor.
     122//
     123MTask::MTask(MTask &t)
     124{
     125    fFilter = t.fFilter;
     126    fListOfBranches->AddAll(t.fListOfBranches);
    81127}
    82128
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r988 r1003  
    1414#endif
    1515
     16class TOrdCollection;
     17
    1618class MFilter;
    1719class MParList;
     
    2022{
    2123private:
    22     const MFilter *fFilter;
     24    TOrdCollection *fListOfBranches; // List of Branch names for auto enabeling scheme
    2325
    24     Bool_t fIsPreprocessed; // Indicates the success of the PreProcessing (set by MTaskList)
    25     UInt_t fNumExecutions;  // Number of Excutions
     26    const MFilter *fFilter;          // Filter for conditional task execution
     27
     28    Bool_t fIsPreprocessed;          // Indicates the success of the PreProcessing (set by MTaskList)
     29    UInt_t fNumExecutions;           // Number of Excutions
    2630
    2731    virtual Bool_t PreProcess(MParList *pList);
     
    2933    virtual Bool_t PostProcess();
    3034
     35protected:
     36    void AddToBranchList(const char *b);
     37    void AddToBranchList(const TString &str)
     38    {
     39        AddToBranchList((const char*)str);
     40    }
     41
    3142public:
    3243    MTask(const char *name=NULL, const char *title=NULL);
    33     virtual ~MTask()
    34     {
    35     }
     44    MTask(MTask &t);
     45    virtual ~MTask();
    3646
    3747    void SetFilter(const MFilter *filter) { fFilter=filter; }
     
    4252    Bool_t CallPostProcess();
    4353
     54    const TOrdCollection *GetListOfBranches() const { return fListOfBranches; }
     55
    4456    ClassDef(MTask, 0)          //Abstract base class for a task
    4557};
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r988 r1003  
    4747#include "MTaskList.h"
    4848
     49#include <TOrdCollection.h>
     50
    4951#include "MLog.h"
    5052#include "MLogManip.h"
     
    6365MTaskList::MTaskList(const char *name, const char *title)
    6466{
    65     *fName  = name  ? name  : "MTaskList";
    66     *fTitle = title ? title : "A list for tasks to be executed";
     67    fName  = name  ? name  : "MTaskList";
     68    fTitle = title ? title : "A list for tasks to be executed";
     69
     70    fTasks = new TOrdCollection;
    6771}
    6872
     
    7579MTaskList::MTaskList(MTaskList &ts)
    7680{
    77     fTasks.AddAll(&ts.fTasks);
     81    fTasks->AddAll(ts.fTasks);
    7882}
    7983
     
    8690{
    8791    if (TestBit(kIsOwner))
    88         fTasks.SetOwner();
     92        fTasks->SetOwner();
     93
     94    delete fTasks;
    8995}
    9096
     
    110116    // create the Iterator over the tasklist
    111117    //
    112     TIter Next(&fTasks);
     118    TIter Next(fTasks);
    113119
    114120    MTask *task=NULL;
     
    147153    // Check if the new task is already existing in the list
    148154    //
    149     const TObject *objn = fTasks.FindObject(name);
    150     const TObject *objt = fTasks.FindObject(task);
     155    const TObject *objn = fTasks->FindObject(name);
     156    const TObject *objt = fTasks->FindObject(task);
    151157
    152158    if (objn || objt)
     
    165171        // Otherwise add it to the list, but print a warning message
    166172        //
    167         *fLog << dbginf << "Warning: Task with the same name '" << task->GetName();
     173        *fLog << dbginf << "Warning: Task '" << task->GetName();
    168174        *fLog << "' already existing in '" << GetName() << "'." << endl;
    169175        *fLog << "You may not be able to get a pointer to this task by name." << endl;
     
    172178    if (where)
    173179    {
    174         if (!fTasks.FindObject(where))
     180        if (!fTasks->FindObject(where))
    175181        {
    176182            *fLog << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl;
     
    182188
    183189    task->SetStreamId(type);
    184     fTasks.Add(task);
     190    fTasks->Add(task);
    185191
    186192    *fLog << "Done." << endl;
     
    196202TObject *MTaskList::FindObject(const char *name) const
    197203{
    198     return fTasks.FindObject(name);
     204    return fTasks->FindObject(name);
    199205}
    200206
     
    205211TObject *MTaskList::FindObject(TObject *obj) const
    206212{
    207     return fTasks.FindObject(obj);
     213    return fTasks->FindObject(obj);
    208214}
    209215
     
    221227    //  create the Iterator over the tasklist
    222228    //
    223     TIter Next(&fTasks);
     229    TIter Next(fTasks);
    224230
    225231    MTask *task=NULL;
     
    260266    //  create the Iterator for the TaskList
    261267    //
    262     TIter Next(&fTasks);
     268    TIter Next(fTasks);
    263269    MTask *task=NULL;
    264270
     
    271277        // if the task has the wrong stream id skip it.
    272278        //
    273         if (strcmp(GetStreamId(), task->GetStreamId()) &&
    274             strcmp(task->GetStreamId(), "All"))
     279        if (GetStreamId() != task->GetStreamId() &&
     280            task->GetStreamId() !=  "All")
    275281            continue;
    276282
     
    331337    //  create the Iterator for the TaskList
    332338    //
    333     TIter Next(&fTasks);
     339    TIter Next(fTasks);
    334340
    335341    MTask *task=NULL;
     
    377383    //  create the Iterator for the TaskList
    378384    //
    379     TIter Next(&fTasks);
     385    TIter Next(fTasks);
    380386
    381387    MTask *task=NULL;
     
    396402    *fLog << "TaskList: " << GetName() << " <" << GetTitle() << ">" << endl;
    397403
    398     fTasks.Print();
     404    fTasks->Print();
    399405
    400406    *fLog << endl;
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r988 r1003  
    1010///////////////////////////////////////////////////////////////////////
    1111
    12 #ifndef ROOT_TOrdCollection
    13 #include <TOrdCollection.h>
    14 #endif
    1512#ifndef MTASK_H
    1613#include "MTask.h"
     
    2421{
    2522private:
    26     TOrdCollection fTasks;      // Container for the ordered list of different tasks
    27     MParList      *fParList;
     23    TOrdCollection *fTasks;     // Container for the ordered list of different tasks
     24    MParList       *fParList;
    2825
    2926    UInt_t *fCntContinue;
     
    5350    void SetOwner(Bool_t enable=kTRUE);
    5451
     52    const TOrdCollection *GetList() const { return fTasks; }
     53
    5554    ClassDef(MTaskList, 0)      //collection of tasks to be performed in the eventloop
    5655};
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r986 r1003  
    2424    MTime(const char *name=NULL, const char *title=NULL)
    2525    {
    26         *fName = name ? name : ClassName();
    27         *fTitle = title;
     26        fName = name ? name : ClassName();
     27        fTitle = title;
    2828
    29         SetTime(0,0);
     29        SetTime(0, 0);
    3030    }
    3131
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r858 r1003  
    5959    : fOut(NULL), fContainer(NULL)
    6060{
    61     *fName  = name  ? name  : "MWriteAsciiFile";
    62     *fTitle = title ? title : "Task to write one container to an ascii file";
     61    fName  = name  ? name  : "MWriteAsciiFile";
     62    fTitle = title ? title : "Task to write one container to an ascii file";
    6363
    6464    fNameFile      = filename;
     
    7777    : fOut(NULL), fContainer(cont)
    7878{
    79     *fName  = name  ? name  : "MWriteAsciiFile";
    80     *fTitle = title ? title : "Task to write one container to an ascii file";
     79    fName  = name  ? name  : "MWriteAsciiFile";
     80    fTitle = title ? title : "Task to write one container to an ascii file";
    8181
    8282    fNameFile      = filename;
  • trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc

    r995 r1003  
    4646ClassImp(MWriteRootFile);
    4747
    48 #define kSaveNow BIT(1)
     48#define kFillTree BIT(1)
    4949
    5050// --------------------------------------------------------------------------
     
    6262                               const char *title)
    6363{
    64     *fName  = name  ? name  : "MWriteRootFile";
    65     *fTitle = title ? title : "Task which writes a root-output file";
     64    fName  = name  ? name  : "MWriteRootFile";
     65    fTitle = title ? title : "Task which writes a root-output file";
    6666
    6767    //
     
    113113
    114114    TTree *t;
    115     TObjArrayIter Next(&fTrees);
     115    TIter Next(&fTrees);
    116116    while ((t=(TTree*)Next()))
    117117        cout << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl;
     
    177177    // loop over all branches which are 'marked' as branches to get written.
    178178    //
    179     TObjArrayIter Next(&fBranches);
     179    TIter Next(&fBranches);
    180180    while ((entry=(MRootFileBranch*)Next()))
    181181    {
     
    244244        //
    245245        TObject *obj;
    246         TObjArrayIter NextTree(&fTrees);
     246        TIter NextTree(&fTrees);
    247247        while ((obj=NextTree()))
    248248        {
     
    270270        // The containers should be written in Splitlevel=1
    271271        //
    272         branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress(), 32000, 1);
     272        branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress());
    273273
    274274        *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
     
    302302    // Loop over all branch entries
    303303    //
    304     TObjArrayIter NextBranch(&fBranches);
     304    TIter NextBranch(&fBranches);
    305305    while ((obj=NextBranch()))
    306306    {
     
    317317        // the corresponding tree entry.
    318318        //
    319         b->GetTree()->SetBit(kSaveNow);
     319        b->GetTree()->SetBit(kFillTree);
    320320    }
    321321
     
    323323    // Loop over all tree entries
    324324    //
    325     TObjArrayIter NextTree(&fTrees);
     325    TIter NextTree(&fTrees);
    326326    while ((obj=NextTree()))
    327327    {
     
    331331        // Check the write flag of the tree
    332332        //
    333         if (!t->TestBit(kSaveNow))
     333        if (!t->TestBit(kFillTree))
    334334            continue;
    335335
     
    340340        //
    341341        t->Fill();
    342         t->ResetBit(kSaveNow);
     342        t->ResetBit(kFillTree);
    343343    }
    344344}
  • trunk/MagicSoft/Mars/mgui/MGeomCam.cc

    r986 r1003  
    5252    : fNumPixels(npix)
    5353{
    54     *fName  = name  ? name  : "MGeomCam";
    55     *fTitle = title ? title : "Storage container for  a camera geometry";
     54    fName  = name  ? name  : "MGeomCam";
     55    fTitle = title ? title : "Storage container for  a camera geometry";
    5656
    5757    fPixels = new TObjArray(npix);
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r888 r1003  
    4040#include "MH.h"
    4141
     42#include <TCanvas.h>
     43
    4244ClassImp(MH);
    4345
     
    5254    //   set the name and title of this object
    5355    //
    54     *fName  = name  ? name  : "MH" ;
    55     *fTitle = title ? title : "Base class for Mars histograms" ;
     56    fName  = name  ? name  : "MH" ;
     57    fTitle = title ? title : "Base class for Mars histograms" ;
    5658}
    5759
     60TCanvas *MH::MakeDefCanvas(const char *name, const char *title,
     61                           const UInt_t w, const UInt_t h)
     62{
     63    const TList *list = (TList*)gROOT->GetListOfCanvases();
     64
     65    const char *def = name ? name : gROOT->GetDefCanvasName();
     66
     67    TCanvas *c;
     68    if (list->FindObject(def))
     69    {
     70        const char *n = StrDup(Form("%s <%d>", def, list->GetSize()+1));
     71        c = new TCanvas(n, title, w, h);
     72        delete [] n;
     73    }
     74    else
     75        c = new TCanvas(def, title, w, h);
     76
     77    return c;
     78}
     79
     80TCanvas *MH::MakeDefCanvas(const TObject *obj,
     81                           const UInt_t w, const UInt_t h)
     82{
     83    return MakeDefCanvas(obj->GetName(), obj->GetTitle(), w, h);
     84}
Note: See TracChangeset for help on using the changeset viewer.