35 TH1D* backgroundHist =
new TH1D(
"background",
"The expected background",30,-4,4);
36 TH1D* signalHist =
new TH1D(
"signal",
"the expected signal",30,-4,4);
37 TH1D* dataHist =
new TH1D(
"data",
"some fake data points",30,-4,4);
42 backgroundHist->
Sumw2();
48 for (
Int_t i = 0; i < 25000; i++) {
51 backgroundHist->
Fill(bg,0.02);
52 signalHist->
Fill(sig,0.001);
54 for (
Int_t i = 0; i < 500; i++) {
58 THStack *hs =
new THStack(
"hs",
"Signal and background compared to data...");
59 hs->
Add(backgroundHist);
62 dataHist->
Draw(
"PE1,Same");
65 c1->GetFrame()->SetFillColor(21);
66 c1->GetFrame()->SetBorderSize(6);
67 c1->GetFrame()->SetBorderMode(-1);
73 cout <<
"Computing limits... " << endl;
76 cout <<
"CLs : " << myconfidence->
CLs() << endl;
77 cout <<
"CLsb : " << myconfidence->
CLsb() << endl;
78 cout <<
"CLb : " << myconfidence->
CLb() << endl;
84 cout << endl <<
"Computing limits with stat systematics... " << endl;
86 cout <<
"CLs : " << mystatconfidence->
CLs() << endl;
87 cout <<
"CLsb : " << mystatconfidence->
CLsb() << endl;
88 cout <<
"CLb : " << mystatconfidence->
CLb() << endl;
94 cout << endl <<
"Computing limits with systematics... " << endl;
107 mynewdatasource->
AddChannel(signalHist,backgroundHist,dataHist,&errors,&errorb,names);
109 cout <<
"CLs : " << mynewconfidence->
CLs() << endl;
110 cout <<
"CLsb : " << mynewconfidence->
CLsb() << endl;
111 cout <<
"CLb : " << mynewconfidence->
CLb() << endl;
120 myconfidence->
Draw();
125 delete mystatconfidence;
126 delete mynewconfidence;
127 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).