Changeset 8696


Ignore:
Timestamp:
08/22/07 19:23:06 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8695 r8696  
    6262   * mmuon/MHMuonPar.cc:
    6363     - enable all grids
     64
     65   * mimage/MNewImagePar.cc:
     66     - Set fConcCOG to 0 if smaller 0. This produces at least a defined
     67       value (-inf) when the logarithm is calculated, which is better
     68       than an undefined one (NaN).
    6469
    6570
  • trunk/MagicSoft/Mars/mhbase/MH.cc

    r8679 r8696  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.34 2007-08-19 21:36:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.35 2007-08-22 18:22:49 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    14161416    hi = 1;
    14171417
    1418     for (int i=2; i<=h.GetNbinsX(); i++)
     1418    for (int i=1; i<=h.GetNbinsX(); i++)
    14191419    {
    14201420        if (lo==0 && h.GetBinContent(i)>0)
     
    14381438    lo = h.GetBinLowEdge(f);
    14391439    hi = h.GetBinLowEdge(l+1);
     1440}
     1441
     1442// --------------------------------------------------------------------------
     1443//
     1444// Return the first and last column (x-bin) of the histogram which is not 0.
     1445// Therefor a proper projection is produced if the argument is a TH2.
     1446//
     1447// TH3 are not yet supported
     1448//
     1449void MH::GetRangeX(const TH1 &hist, Int_t &lo, Int_t &hi)
     1450{
     1451    if (hist.InheritsFrom(TH3::Class()))
     1452        return;
     1453
     1454    if (hist.InheritsFrom(TH2::Class()))
     1455    {
     1456        TH1 *pro = static_cast<const TH2&>(hist).ProjectionX();
     1457        GetRange(*pro, lo, hi);
     1458        delete pro;
     1459        return;
     1460    }
     1461
     1462    GetRange(hist, lo, hi);
     1463}
     1464
     1465// --------------------------------------------------------------------------
     1466//
     1467// Return the first and last row (y-bin) of the histogram which is not 0.
     1468// Therefor a proper projection is produced if the argument is a TH2.
     1469//
     1470// TH3 are not yet supported
     1471//
     1472void MH::GetRangeY(const TH1 &hist, Int_t &lo, Int_t &hi)
     1473{
     1474    if (hist.InheritsFrom(TH3::Class()))
     1475        return;
     1476
     1477    if (hist.InheritsFrom(TH2::Class()))
     1478    {
     1479        TH1 *pro = static_cast<const TH2&>(hist).ProjectionY();
     1480        GetRange(*pro, lo, hi);
     1481        delete pro;
     1482    }
     1483}
     1484
     1485// --------------------------------------------------------------------------
     1486//
     1487// Return the lower edge of the first and the upper edge of the last bin
     1488// of the histogram h returned by GetRangeX
     1489//
     1490void MH::GetRangeUserX(const TH1 &h, Axis_t &lo, Axis_t &hi)
     1491{
     1492    Int_t f, l;
     1493    GetRangeX(h, f, l);
     1494
     1495    lo = h.GetXaxis()->GetBinLowEdge(f);
     1496    hi = h.GetXaxis()->GetBinLowEdge(l+1);
     1497}
     1498
     1499// --------------------------------------------------------------------------
     1500//
     1501// Return the lower edge of the first and the upper edge of the last bin
     1502// of the histogram h returned by GetRangeY
     1503//
     1504void MH::GetRangeUserY(const TH1 &h, Axis_t &lo, Axis_t &hi)
     1505{
     1506    Int_t f, l;
     1507    GetRangeY(h, f, l);
     1508
     1509    lo = h.GetYaxis()->GetBinLowEdge(f);
     1510    hi = h.GetYaxis()->GetBinLowEdge(l+1);
    14401511}
    14411512
  • trunk/MagicSoft/Mars/mhbase/MH.h

    r8679 r8696  
    120120
    121121    static void GetRangeUser(const TH1 &hist, Axis_t &lo, Axis_t &hi);
     122    static void GetRangeUserX(const TH1 &hist, Axis_t &lo, Axis_t &hi);
     123    static void GetRangeUserY(const TH1 &hist, Axis_t &lo, Axis_t &hi);
    122124    static void GetRange(const TH1 &hist, Int_t &lo, Int_t &hi);
     125    static void GetRangeX(const TH1 &hist, Int_t &lo, Int_t &hi);
     126    static void GetRangeY(const TH1 &hist, Int_t &lo, Int_t &hi);
    123127
    124128    static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL);
    125129
    126     static void SetPalette(TString paletteName, Int_t ncol=50);
     130    static void SetPalette(TString paletteName="pretty", Int_t ncol=50);
    127131
    128132    ClassDef(MH, 2) //A base class for Mars histograms
Note: See TracChangeset for help on using the changeset viewer.