Ignore:
Timestamp:
04/25/02 11:21:46 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r1283 r1300  
    5050
    5151#include <TH1.h>
     52#include <TH2.h>
     53#include <TH3.h>
    5254#include <TCanvas.h>
    5355
     
    136138}
    137139
    138 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy)
     140void MH::SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy)
    139141{
    140142    TAxis &x = *h->GetXaxis();
     
    169171}
    170172
    171 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)
     173void MH::SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)
    172174{
    173175    //
     
    214216}
    215217
    216 void MH::SetBinning(TH1 *h, const TArrayD *binsx, const TArrayD *binsy)
     218void MH::SetBinning(TH2 *h, const TArrayD *binsx, const TArrayD *binsy)
    217219{
    218220    MBinning bx;
     
    223225}
    224226
    225 void MH::SetBinning(TH1 *h, const TArrayD *binsx, const TArrayD *binsy, const TArrayD *binsz)
     227void MH::SetBinning(TH3 *h, const TArrayD *binsx, const TArrayD *binsy, const TArrayD *binsz)
    226228{
    227229    MBinning bx;
     
    245247}
    246248
    247 void MH::SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy)
     249void MH::SetBinning(TH2 *h, const TAxis *binsx, const TAxis *binsy)
    248250{
    249251    const Int_t nx = binsx->GetNbins();
     
    260262}
    261263
    262 void MH::SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz)
     264void MH::SetBinning(TH3 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz)
    263265{
    264266    const Int_t nx = binsx->GetNbins();
     
    281283void MH::SetBinning(TH1 *h, TH1 *x)
    282284{
    283     SetBinning(h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis());
    284 }
     285    if (h->InheritsFrom(TH3::Class()) && x->InheritsFrom(TH3::Class()))
     286    {
     287        SetBinning((TH3*)h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis());
     288        return;
     289    }
     290    if (h->InheritsFrom(TH2::Class()) && x->InheritsFrom(TH2::Class()))
     291    {
     292        SetBinning((TH2*)h, x->GetXaxis(), x->GetYaxis());
     293        return;
     294    }
     295    if (h->InheritsFrom(TH1::Class()) && x->InheritsFrom(TH1::Class()))
     296    {
     297        SetBinning(h, x->GetXaxis());
     298        return;
     299    }
     300}
Note: See TracChangeset for help on using the changeset viewer.