Changeset 2698


Ignore:
Timestamp:
12/17/03 17:40:35 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2696 r2698  
    4242     - tried to make fUseOrigDistrib-stuff working again
    4343
     44   * mhist/MHCamera.[h,cc]:
     45     - implemented kVariance
    4446
    4547
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2678 r2698  
    3333// To change the scale to a logarithmic scale SetLogy() of the Pad.
    3434//
     35// Be carefull: Entries in this context means Entries/bin or Events
     36//
    3537////////////////////////////////////////////////////////////////////////////
    3638#include "MHCamera.h"
     
    288290    sq  /= n;
    289291
    290     return Profile(sqrt(sq-sum*sum));
     292    return Profile(TMath::Sqrt(sq-sum*sum));
    291293}
    292294
     
    758760}
    759761
    760 
     762Stat_t MHCamera::GetBinError(Int_t bin) const
     763{
     764    Double_t rc = 0;
     765    if (TestBit(kVariance) && GetEntries()>0) // error on the mean
     766    {
     767        const Double_t error = fSumw2.fArray[bin]/GetEntries();
     768        const Double_t val   = fArray[bin]/GetEntries();
     769        rc = TMath::Sqrt(error - val*val);
     770    }
     771    else
     772        rc = TH1D::GetBinError(bin);
     773
     774    return Profile(rc);
     775}
    761776
    762777// ------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2642 r2698  
    3232        kProfile  = BIT(18), // FIXME: When changing change max/min!
    3333        kFreezed  = BIT(19),
    34         kNoLegend = BIT(20)
     34        kNoLegend = BIT(20),
     35        kVariance = BIT(21)
    3536    };
    3637private:
     
    133134    Stat_t   GetBinContent(Int_t binx, Int_t biny) const { return GetBinContent(binx); }
    134135    Stat_t   GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return GetBinContent(binx); }
    135     Stat_t   GetBinError(Int_t bin) const { return Profile(TH1D::GetBinError(bin)); }
     136    Stat_t   GetBinError(Int_t bin) const;
    136137    Stat_t   GetBinError(Int_t binx, Int_t biny) const { return GetBinError(binx); }
    137138    Stat_t   GetBinError(Int_t binx, Int_t biny, Int_t binz) const { return GetBinError(binx); }
Note: See TracChangeset for help on using the changeset viewer.