limits. It uses a set of randomly created histograms.
#include <iostream>
using std::cout;
using std::endl;
void limit() {
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");
c1->GetFrame()->SetFillColor(21);
c1->GetFrame()->SetBorderSize(6);
c1->GetFrame()->SetBorderMode(-1);
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;
}
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
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.
void Draw(const Option_t *option="")
Display sort of a "canonical" -2lnQ plot.
1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
The Histogram stack class.
virtual void Draw(Option_t *chopt="")
Draw this multihist with its current attributes.
virtual void Add(TH1 *h, Option_t *option="")
add a new histogram to the list Only 1-d and 2-d histograms currently supported.
This class serves as interface to feed data into the TLimit routines.
virtual void AddChannel(TH1 *, TH1 *, TH1 *)
static TConfidenceLevel * ComputeLimit(TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=0)
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
Collectable string class.
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).