Ignore:
Timestamp:
12/05/05 16:36:41 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhflux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r7392 r7442  
    4747
    4848#include <TRandom.h>
     49#include <TFeldmanCousins.h>
    4950
    5051#include <TLine.h>
     
    256257
    257258    return kTRUE;
     259}
     260
     261// --------------------------------------------------------------------------
     262//
     263// Calculate the upper limit for fEventsSignal number of observed events
     264// and fEventsBackground number of background events.
     265//
     266// Therefor TFeldmanCousin is used.
     267//
     268// The Feldman-Cousins method as described in PRD V57 #7, p3873-3889
     269//
     270Double_t MAlphaFitter::CalcUpperLimit() const
     271{
     272    // get a FeldmanCousins calculation object with the default limits
     273    // of calculating a 90% CL with the minimum signal value scanned
     274    // = 0.0 and the maximum signal value scanned of 50.0
     275    TFeldmanCousins f;
     276    f.SetMuStep(0.05);
     277    f.SetMuMax(100);
     278    return f.CalculateUpperLimit(fEventsSignal, fEventsBackground);
    258279}
    259280
     
    315336    TF1 *fcn = f.fFunc;
    316337    f.fFunc = new TF1(*fFunc);
     338    f.fFunc->SetName("Dummy");
    317339    gROOT->GetListOfFunctions()->Remove(f.fFunc);
    318     f.fFunc->SetName("Dummy");
    319340    delete fcn;
    320341}
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h

    r7392 r7442  
    5353    SignalFunc_t fSignalFunc;   // Type of signal function
    5454    // Result
    55     Double_t fSignificance;     // significance of signal
    56     Double_t fSignificanceExc;  // significance of excess
     55    Double_t fSignificance;     // significance of an unknown signal (Li/Ma 17)
     56    Double_t fSignificanceExc;  // significance of a known excess    (Li/Ma 5)
    5757    Double_t fEventsExcess;     // calculated number of excess events (signal-bg)
    5858    Double_t fEventsSignal;     // calculated number of signal events
     
    8888        fTitle = title ? title : "Fit alpha";
    8989
     90        fFunc->SetName("Dummy");
    9091        gROOT->GetListOfFunctions()->Remove(fFunc);
    91         fFunc->SetName("Dummy");
    9292
    9393        Clear();
     
    147147        }
    148148        fSignalFunc=func;
     149        fFunc->SetName("Dummy");
    149150        gROOT->GetListOfFunctions()->Remove(fFunc);
    150         fFunc->SetName("Dummy");
    151151        fCoefficients.Set(3+fPolynomOrder+1);
    152152        fCoefficients.Reset();
     
    175175    Double_t Eval(Double_t d) const { return fFunc ? fFunc->Eval(d) : 0; }
    176176
     177    Double_t CalcUpperLimit() const;
     178
    177179    // Interface to fit
    178180    Bool_t Fit(TH1D &h, Bool_t paint=kFALSE);
Note: See TracChangeset for help on using the changeset viewer.