The aim of this add-on is to perform an easy computation of 95% CL limits with ROOT. Is consists of 3 classes, that have to be integrated or loaded in ROOT. The primary input is a set of TH1F (histograms) and the output an set of values (CLs, CLb, CLs+b, -2lnQ, ...).
The algorithm is the one originaly written by Tom Junk (mclimit.f) in fortran.
It as been completely re-written in C++, using a natural class description of the inputs, outputs and algorithms.
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();
TH1F* sh=(TH1F*)infile->Get("signal");
TH1F* bh=(TH1F*)infile->Get("background");
TH1F* dh=(TH1F*)infile->Get("data");
TLimitDataSource* mydatasource = new TLimitDataSource(sh,bh,dh);
TConfidenceLevel *myconfidence = TLimit::ComputeLimit(mydatasource,50000);
cout << " CLs : " << myconfidence->CLs() << endl;
cout << " CLsb : " << myconfidence->CLsb() << endl;
cout << " CLb : " << myconfidence->CLb() << endl;
cout << "< CLs > : " << myconfidence->GetExpectedCLs_b() << endl;
cout << "< CLsb > : " << myconfidence->GetExpectedCLsb_b() << endl;
cout << "< CLb > : " << myconfidence->GetExpectedCLb_b() << endl;
delete myconfidence;
delete mydatasource;
infile->Close();
TLimit is now documented on the ROOT reference guide. There is also a new tutorial (limit.C).
Here is a first presentation about TLimit...
A more complete (complex?) example combining several channels found in different files.
To add systematics, you must provide 2 additionnal arguments to AddChannel: a TH1F and a TCloneArray< TString >. Each bin of the TH1F is supposed to contain the relative error due to one systematics source, whose name is the corresponding entry in the TCloneArray.