This program demonstrates the computation of 95 % C.L.
limits. It uses a set of randomly created histograms.
Processing /mnt/build/workspace/root-makedoc-v612/rootspi/rdoc/src/v6-12-00-patches/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* backgroundHist =
new TH1D(
"background",
"The expected background",30,-4,4);
TH1D* signalHist =
new TH1D(
"signal",
"the expected signal",30,-4,4);
TH1D* dataHist =
new TH1D(
"data",
"some fake data points",30,-4,4);
for (
Int_t i = 0; i < 25000; i++) {
backgroundHist->
Fill(bg,0.02);
signalHist->
Fill(sig,0.001);
}
for (
Int_t i = 0; i < 500; i++) {
}
THStack *hs =
new THStack(
"hs",
"Signal and background compared to data...");
dataHist->
Draw(
"PE1,Same");
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;
errors[0]=0;
errors[1]=0.01;
mynewdatasource->
AddChannel(signalHist,backgroundHist,dataHist,&errors,&errorb,names);
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.