1 |
// @(#)root/hist:$Name: $:$Id: TLimit.h,v 1.2 2010/05/03 16:51:17 auterman Exp $
|
2 |
// Author: Christophe.Delaere@cern.ch 21/08/2002
|
3 |
|
4 |
#ifndef ROOT_TLimit
|
5 |
#define ROOT_TLimit
|
6 |
|
7 |
#ifndef ROOT_TObject
|
8 |
#include "TObject.h"
|
9 |
#endif
|
10 |
#ifndef ROOT_TMath
|
11 |
#include "TMath.h"
|
12 |
#endif
|
13 |
|
14 |
class TConfidenceLevel;
|
15 |
class TRandom;
|
16 |
class TLimitDataSource;
|
17 |
class TArrayD;
|
18 |
class TOrdCollection;
|
19 |
|
20 |
//____________________________________________________________________
|
21 |
//
|
22 |
// TLimit
|
23 |
//
|
24 |
// This class computes 95% Confidence Levels using a given statistic.
|
25 |
// By default, the build-in LogLikelihood is used.
|
26 |
//
|
27 |
// Implemented by C. Delaere from the mclimit code written by Tom Junk.
|
28 |
// reference: HEP-EX/9902006
|
29 |
// See http://cern.ch/thomasj/searchlimits/ecl.html for more details.
|
30 |
//____________________________________________________________________
|
31 |
|
32 |
class TLimit {
|
33 |
public:
|
34 |
TLimit() {}
|
35 |
virtual ~TLimit() {}
|
36 |
static TConfidenceLevel *ComputeLimit(TLimitDataSource * data,
|
37 |
Int_t nmc =50000,
|
38 |
bool stat = false,
|
39 |
TRandom * generator = NULL,
|
40 |
Double_t(*statistic) (Double_t, Double_t,Double_t) =&(TLimit::LogLikelihood));
|
41 |
protected:
|
42 |
static TLimitDataSource *Fluctuate(TLimitDataSource * input, bool init,TRandom *, bool stat=false);
|
43 |
inline static Double_t LogLikelihood(Double_t s, Double_t b, Double_t d) { return d * TMath::Log(1 + (s / b)); }
|
44 |
private:
|
45 |
static TArrayD *fgTable; // a log table... just to speed up calculation
|
46 |
static TOrdCollection *fgSystNames; // Collection of systematics names
|
47 |
ClassDef(TLimit, 2) // Class to compute 95% CL limits
|
48 |
};
|
49 |
|
50 |
#endif
|
51 |
|