This program demonstrates the computation of 95 % C.L.
limits. It uses a set of randomly created histograms.
Processing /mnt/vdb/lsf/workspace/root-makedoc/rootspi/rdoc/src/master/tutorials/math/limit.C...
Computing limits...
CLs : 0.0179535
CLsb : 0.00930313
CLb : 0.51818
< CLs > : 0.0165344
< CLsb > : 0.00826754
< CLb > : 0.50002
Computing limits with stat systematics...
CLs : 0.0189723
CLsb : 0.00989482
CLb : 0.52154
< CLs > : 0.0172591
< CLsb > : 0.00862989
< CLb > : 0.50002
Computing limits with systematics...
CLs : 0.0352037
CLsb : 0.0184327
CLb : 0.5236
< CLs > : 0.0328702
< CLsb > : 0.0164358
< CLb > : 0.50002
#include <iostream>
using std::cout;
using std::endl;
void limit() {
TCanvas *c1 =
new TCanvas(
"c1",
"Dynamic Filling Example",200,10,700,500);
TH1D* signal =
new TH1D(
"signal",
"the expected signal",30,-4,4);
TH1D* data =
new TH1D(
"data",
"some fake data points",30,-4,4);
for (
Int_t i = 0; i < 25000; i++) {
background->
Fill(bg,0.02);
}
for (
Int_t i = 0; i < 500; i++) {
}
THStack *hs =
new THStack(
"hs",
"Signal and background compared to data...");
cout << "Computing limits... " << endl;
cout <<
"CLs : " << myconfidence->
CLs() << endl;
cout <<
"CLsb : " << myconfidence->
CLsb() << endl;
cout <<
"CLb : " << myconfidence->
CLb() << endl;
cout << endl << "Computing limits with stat systematics... " << endl;
cout <<
"CLs : " << mystatconfidence->
CLs() << endl;
cout <<
"CLsb : " << mystatconfidence->
CLsb() << endl;
cout <<
"CLb : " << mystatconfidence->
CLb() << endl;
cout << endl << "Computing limits with systematics... " << endl;
errorb[0]=0.05;
errorb[1]=0;
cout <<
"CLs : " << mynewconfidence->
CLs() << endl;
cout <<
"CLsb : " << mynewconfidence->
CLsb() << endl;
cout <<
"CLb : " << mynewconfidence->
CLb() << endl;
delete myconfidence;
delete mydatasource;
delete mystatconfidence;
delete mynewconfidence;
delete mynewdatasource;
}
- Author
- Christophe Delaere
Definition in file limit.C.