Ignore:
Timestamp:
05/10/07 13:16:56 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

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

    r8423 r8484  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.103 2007-04-20 08:55:19 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.104 2007-05-10 12:14:54 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    514514// ------------------------------------------------------------------------
    515515//
     516// Return the number of bins (excluding under- and overflow) for which
     517// GetBinContent returns a value > t
     518//
     519Int_t MHCamera::GetNumBinsAboveThreshold(Double_t t) const
     520{
     521    Int_t n = 0;
     522    for (Int_t i=0; i<fNcells-2; i++)
     523        if (GetBinContent(i+1)>t)
     524            n++;
     525
     526    return n;
     527}
     528
     529// ------------------------------------------------------------------------
     530//
     531// Return the number of bins (excluding under- and overflow) for which
     532// GetBinContent returns a value < t
     533//
     534Int_t MHCamera::GetNumBinsBelowThreshold(Double_t t) const
     535{
     536    Int_t n = 0;
     537    for (Int_t i=0; i<fNcells-2; i++)
     538        if (GetBinContent(i+1)>t)
     539            n++;
     540
     541    return n;
     542}
     543
     544// ------------------------------------------------------------------------
     545//
    516546// Call this function to draw the camera layout into your canvas.
    517547// Setup a drawing canvas. Add this object and all child objects
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r8284 r8484  
    11/* ======================================================================== *\
    2 !  $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.63 2007-02-01 14:42:02 tbretz Exp $
     2!  $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.64 2007-05-10 12:14:54 tbretz Exp $
    33\* ======================================================================== */
    44#ifndef MARS_MHCamera
     
    4040public:
    4141    enum {
     42        // DO NOT USE BIT(14) (MStatusArray WORKAROUND!)
     43        // BIT(15)/BIT(16)/BIT(17) used by TH1
    4244        kProfile            = BIT(18), // FIXME: When changing change max/min!
    4345        kFreezed            = BIT(19),
     
    4547        kNoScale            = BIT(21),
    4648        kNoUnused           = BIT(22),
    47         kErrorMean          = BIT(23)/*,
     49        kErrorMean          = BIT(23)/*,  // NO MORE BITS ALLOWED!
    4850        kSqrtVariance       = BIT(21),
    4951        kSinglePixelProfile = BIT(22)*/
     
    197199    Double_t GetMinimumSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t ball=kFALSE) const;
    198200    Double_t GetMaximumSectors(const TArrayI &sector, const TArrayI &aidx, Bool_t ball=kFALSE) const;
     201
     202    Int_t    GetNumBinsAboveThreshold(Double_t t=0) const;
     203    Int_t    GetNumBinsBelowThreshold(Double_t t=0) const;
    199204
    200205    void     SetLevels(const TArrayF &arr);
Note: See TracChangeset for help on using the changeset viewer.