Ignore:
Timestamp:
01/30/07 14:16:45 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
3 edited

Legend:

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

    r7832 r8279  
    9090//
    9191MHCamEvent::MHCamEvent(const char *name, const char *title)
    92     : fSum(NULL), fEvt(NULL), fType(0), fThreshold(0), fUseThreshold(0)
     92    : fSum(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
    9393{
    9494    Init(name, title);
     
    100100//
    101101MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title)
    102     : fSum(NULL), fEvt(NULL), fType(type), fThreshold(0), fUseThreshold(0)
     102    : fSum(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
    103103{
    104104    Init(name, title);
     
    156156        fSum->SetYTitle("a.u.");
    157157    fSum->SetBit(MHCamera::kProfile);
     158    if (!fErrorSpread)
     159        fSum->SetBit(MHCamera::kErrorMean);
    158160
    159161    fSum->SetXTitle("Pixel Idx");
     
    282284    MHCamera *cam = new MHCamera(*fSum->GetGeometry());
    283285    cam->SetName(Form("%s;err", fName.Data()));
    284     cam->SetTitle("Sqrt(Variance)");
     286    cam->SetTitle(fErrorSpread?"Sqrt(Variance)":"Sqrt(Variance)/Sqrt(n_{i})");
    285287    cam->SetYTitle(fSum->GetYaxis()->GetTitle());
    286288    cam->SetCamContent(*fSum, 1);
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r7035 r8279  
    2323
    2424    Int_t fType;           // Type to used for calling GetPixelContent
     25    Bool_t fErrorSpread;   // kFALSE==mean, kTRUE==spread
    2526
    2627    Float_t fThreshold;    // Count pixel above/below this threshold
     
    5152
    5253    void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
     54    void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; }
    5355
    54     ClassDef(MHCamEvent, 1) // Histogram to sum camera events
     56    ClassDef(MHCamEvent, 2) // Histogram to sum camera events
    5557};
    5658
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r8106 r8279  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.95 2006-10-17 17:16:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.96 2007-01-30 14:16:45 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    13331333}
    13341334
     1335// ------------------------------------------------------------------------
     1336//
     1337// In the case the kProfile flag is set the spread of the bin is returned.
     1338// If you want to have the mean error instead set the kErrorMean bit via
     1339//  SetBit(kErrorMean) first.
     1340//
    13351341Stat_t MHCamera::GetBinError(Int_t bin) const
    13361342{
     
    13461352    const Double_t val = fArray[bin]        / n;
    13471353
    1348     return sqr>val*val ? TMath::Sqrt(sqr - val*val) / n : 0;
     1354    const Double_t spread = sqr>val*val ? TMath::Sqrt(sqr - val*val);
     1355
     1356    return TestBit(kErrorMean) ? spread/TMath::Sqrt(n) : spread;
    13491357
    13501358    /*
Note: See TracChangeset for help on using the changeset viewer.