Ignore:
Timestamp:
08/06/07 15:44:16 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
2 edited

Legend:

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

    r8238 r8657  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.32 2007-01-10 12:58:25 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.33 2007-08-06 14:44:13 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    619619}
    620620
     621Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h)
     622{
     623    const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x);
     624    if (!binsx)
     625    {
     626        gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl;
     627        return kFALSE;
     628    }
     629    const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y);
     630    if (!binsy)
     631    {
     632        gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl;
     633        return kFALSE;
     634    }
     635
     636    if (binsx->IsDefault() && binsy->IsDefault())
     637        return kTRUE;
     638
     639    // -------------------------
     640    /*
     641     MBinning binsx, binsy, binsz;
     642     binsx.SetEdges(fHist, 'x');
     643     binsy.SetEdges(fHist, 'y');
     644     binsz.SetEdges(fHist, 'z');
     645     */
     646    // -------------------------
     647
     648    SetBinning(h, binsx, binsy);
     649
     650    return kTRUE;
     651}
     652
     653Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h)
     654{
     655    const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x);
     656    if (!binsx)
     657    {
     658        gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl;
     659        return kFALSE;
     660    }
     661    const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y);
     662    if (!binsy)
     663    {
     664        gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl;
     665        return kFALSE;
     666    }
     667    const MBinning *binsz = (MBinning*)plist.FindObject("Binning"+z);
     668    if (!binsz)
     669    {
     670        gLog << inf << "Object 'Binning" << z << "' [MBinning] not found... no binning applied." << endl;
     671        return kFALSE;
     672    }
     673
     674    if (binsx->IsDefault() && binsy->IsDefault() && binsz->IsDefault())
     675        return kTRUE;
     676
     677    SetBinning(h, binsx, binsy, binsz);
     678    return kTRUE;
     679}
     680
    621681void MH::FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
    622682{
  • trunk/MagicSoft/Mars/mhbase/MH.h

    r8047 r8657  
    8080    static void RemoveFirstBin(TH1 &h);
    8181
    82     static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h);
     82    static Bool_t ApplyBinning(const MParList &plist, TString x, TH1 *h);
     83    static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h);
     84    static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h);
    8385
    8486    static void    ScaleArray(TArrayD &bins, Double_t f);
Note: See TracChangeset for help on using the changeset viewer.