Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TLimit Class Reference

Legacy Code

TLimit is a legacy interface: there will be no bug fixes nor new developments. Therefore it is not recommended to use it in new long-term production code. But, depending on the context, using TLimit might still be a valid solution. Consider switching to RooStats.

Algorithm to compute 95% CL limits using the Likelihood ratio semi-bayesian method.

Implemented by C. Delaere from the mclimit code written by Tom Junk [HEP-EX/9902006]. See http://cern.ch/thomasj/searchlimits/ecl.html for more details.

It takes signal, background and data histograms wrapped in a TLimitDataSource as input and runs a set of Monte Carlo experiments in order to compute the limits. If needed, inputs are fluctuated according to systematics. The output is a TConfidenceLevel.

The class TLimitDataSource takes the signal, background and data histograms as well as different systematics sources to form the TLimit input.

The class TConfidenceLevel represents the final result of the TLimit algorithm. It is created just after the time-consuming part and can be stored in a TFile for further processing. It contains light methods to return CLs, CLb and other interesting quantities.

The actual algorithm...

From an input (TLimitDataSource) it produces an output TConfidenceLevel. For this, nmc Monte Carlo experiments are performed. As usual, the larger this number, the longer the compute time, but the better the result.

Supposing that there is a plotfile.root file containing 3 histograms (signal, background and data), you can imagine doing things like:

TFile* infile=new TFile("plotfile.root","READ");
infile->cd();
TH1* sh=(TH1*)infile->Get("signal");
TH1* bh=(TH1*)infile->Get("background");
TH1* dh=(TH1*)infile->Get("data");
TLimitDataSource* mydatasource = new TLimitDataSource(sh,bh,dh);
TConfidenceLevel *myconfidence = TLimit::ComputeLimit(mydatasource,50000);
std::cout << " CLs : " << myconfidence->CLs() << std::endl;
std::cout << " CLsb : " << myconfidence->CLsb() << std::endl;
std::cout << " CLb : " << myconfidence->CLb() << std::endl;
std::cout << "< CLs > : " << myconfidence->GetExpectedCLs_b() << std::endl;
std::cout << "< CLsb > : " << myconfidence->GetExpectedCLsb_b() << std::endl;
std::cout << "< CLb > : " << myconfidence->GetExpectedCLb_b() << std::endl;
delete myconfidence;
delete mydatasource;
infile->Close();
Class to compute 95% CL limits.
Double_t GetExpectedCLs_b(Int_t sigma=0) const
Double_t GetExpectedCLb_b(Int_t sigma=0) const
Get the expected Confidence Level for the background only if there is only background.
Double_t CLsb(bool use_sMC=kFALSE) const
Get the Confidence Level for the signal plus background hypothesis.
Double_t CLb(bool use_sMC=kFALSE) const
Get the Confidence Level for the background only.
Double_t GetExpectedCLsb_b(Int_t sigma=0) const
Get the expected Confidence Level for the signal plus background hypothesis if there is only backgrou...
Double_t CLs(bool use_sMC=kFALSE) const
Get the Confidence Level defined by CLs = CLsb/CLb.
Bool_t cd() override
Change current directory to "this" directory.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:950
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
This class serves as input for the TLimit::ComputeLimit method.
static TConfidenceLevel * ComputeLimit(TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
Definition TLimit.cxx:102

More information can still be found on this page

See also
https://doi.org/10.1088/0954-3899/28/10/313 and https://cds.cern.ch/record/451614/files/open-2000-205.pdf
Note
see note about: "Should I use TRolke, TFeldmanCousins, TLimit?" in the TRolke class description.

Definition at line 19 of file TLimit.h.

Public Member Functions

 TLimit ()
 
virtual ~TLimit ()
 
virtual TClassIsA () const
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static TConfidenceLevelComputeLimit (Double_t s, Double_t b, Int_t d, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
 
static TConfidenceLevelComputeLimit (Double_t s, Double_t b, Int_t d, TVectorD *se, TVectorD *be, TObjArray *, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
 
static TConfidenceLevelComputeLimit (TH1 *s, TH1 *b, TH1 *d, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
 
static TConfidenceLevelComputeLimit (TH1 *s, TH1 *b, TH1 *d, TVectorD *se, TVectorD *be, TObjArray *, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
 
static TConfidenceLevelComputeLimit (TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=nullptr)
 
static const char * DeclFileName ()
 

Static Protected Member Functions

static bool Fluctuate (TLimitDataSource *input, TLimitDataSource *output, bool init, TRandom *, bool stat=false)
 
static Double_t LogLikelihood (Double_t s, Double_t b, Double_t b2, Double_t d)
 

Static Private Attributes

static TOrdCollectionfgSystNames = new TOrdCollection()
 Collection of systematics names.
 
static TArrayDfgTable = new TArrayD(0)
 A log table... just to speed up calculation.
 

#include <TLimit.h>

Constructor & Destructor Documentation

◆ TLimit()

TLimit::TLimit ( )
inline

Definition at line 25 of file TLimit.h.

◆ ~TLimit()

virtual TLimit::~TLimit ( )
inlinevirtual

Definition at line 26 of file TLimit.h.

Member Function Documentation

◆ Class()

static TClass * TLimit::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TLimit::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TLimit::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 52 of file TLimit.h.

◆ ComputeLimit() [1/5]

TConfidenceLevel * TLimit::ComputeLimit ( Double_t  s,
Double_t  b,
Int_t  d,
Int_t  nmc = 50000,
bool  stat = false,
TRandom generator = nullptr 
)
static

Definition at line 361 of file TLimit.cxx.

◆ ComputeLimit() [2/5]

TConfidenceLevel * TLimit::ComputeLimit ( Double_t  s,
Double_t  b,
Int_t  d,
TVectorD se,
TVectorD be,
TObjArray l,
Int_t  nmc = 50000,
bool  stat = false,
TRandom generator = nullptr 
)
static

Definition at line 383 of file TLimit.cxx.

◆ ComputeLimit() [3/5]

TConfidenceLevel * TLimit::ComputeLimit ( TH1 s,
TH1 b,
TH1 d,
Int_t  nmc = 50000,
bool  stat = false,
TRandom generator = nullptr 
)
static

Definition at line 336 of file TLimit.cxx.

◆ ComputeLimit() [4/5]

TConfidenceLevel * TLimit::ComputeLimit ( TH1 s,
TH1 b,
TH1 d,
TVectorD se,
TVectorD be,
TObjArray l,
Int_t  nmc = 50000,
bool  stat = false,
TRandom generator = nullptr 
)
static

Definition at line 348 of file TLimit.cxx.

◆ ComputeLimit() [5/5]

TConfidenceLevel * TLimit::ComputeLimit ( TLimitDataSource data,
Int_t  nmc = 50000,
bool  stat = false,
TRandom generator = nullptr 
)
static

Definition at line 102 of file TLimit.cxx.

◆ DeclFileName()

static const char * TLimit::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 52 of file TLimit.h.

◆ Fluctuate()

bool TLimit::Fluctuate ( TLimitDataSource input,
TLimitDataSource output,
bool  init,
TRandom generator,
bool  stat = false 
)
staticprotected

Definition at line 227 of file TLimit.cxx.

◆ IsA()

virtual TClass * TLimit::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 52 of file TLimit.h.

◆ LogLikelihood()

Double_t TLimit::LogLikelihood ( Double_t  s,
Double_t  b,
Double_t  b2,
Double_t  d 
)
staticprotected

Definition at line 406 of file TLimit.cxx.

◆ Streamer()

virtual void TLimit::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TLimit::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 52 of file TLimit.h.

Member Data Documentation

◆ fgSystNames

TOrdCollection * TLimit::fgSystNames = new TOrdCollection()
staticprivate

Collection of systematics names.

Definition at line 51 of file TLimit.h.

◆ fgTable

TArrayD * TLimit::fgTable = new TArrayD(0)
staticprivate

A log table... just to speed up calculation.

Definition at line 50 of file TLimit.h.

Libraries for TLimit:

The documentation for this class was generated from the following files: