Ignore:
Timestamp:
11/18/04 15:35:43 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhbase/MH3.cc

    r5300 r5429  
    166166}
    167167
     168MH3::MH3(const TH1 &h1) : fDimension(1)
     169{
     170    if (h1.InheritsFrom(TH3::Class()))
     171        fDimension = 3;
     172    if (h1.InheritsFrom(TH2::Class()))
     173        fDimension = 2;
     174
     175    fData[0] = NULL;
     176    fData[1] = NULL;
     177    fData[2] = NULL;
     178
     179    switch (fDimension)
     180    {
     181    case 3:
     182        fData[2] = new MDataChain(h1.GetZaxis()->GetTitle());
     183    case 2:
     184        fData[1] = new MDataChain(h1.GetYaxis()->GetTitle());
     185    case 1:
     186        fData[0] = new MDataChain(h1.GetXaxis()->GetTitle());
     187    }
     188
     189    fName  = gsDefName;
     190    fTitle = gsDefTitle;
     191
     192    fHist = (TH1*)h1.Clone();
     193    fHist->SetDirectory(NULL);
     194
     195    fScale[0] = 1;
     196    fScale[1] = 1;
     197    fScale[2] = 1;
     198}
     199
    168200// --------------------------------------------------------------------------
    169201//
  • trunk/MagicSoft/Mars/mhbase/MH3.h

    r4933 r5429  
    3939public:
    4040    MH3(const unsigned int dim=0);
     41    MH3(const TH1 &h1);
    4142    MH3(const char *memberx);
    4243    MH3(const char *memberx, const char *membery);
Note: See TracChangeset for help on using the changeset viewer.