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");
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;
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Double_t GetExpectedCLb_b(Int_t sigma=0) const
Get the expected Confidence Level for the background only if there is only background.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
The Histogram stack class.
Collectable string class.
virtual void SetBorderMode(Short_t bordermode)
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
This class serves as interface to feed data into the TLimit routines.
virtual void Draw(Option_t *chopt="")
Draw this multihist with its current attributes.
TFrame * GetFrame()
Get frame.
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...
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetBorderSize(Short_t bordersize)
Double_t GetExpectedCLs_b(Int_t sigma=0) const
virtual void AddChannel(TH1 *, TH1 *, TH1 *)
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
static TConfidenceLevel * ComputeLimit(TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=0)
Class to compute 95% CL limits.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
Double_t CLb(bool use_sMC=kFALSE) const
Get the Confidence Level for the background only.
void Draw(const Option_t *option="")
Display sort of a "canonical" -2lnQ plot.
Double_t CLsb(bool use_sMC=kFALSE) const
Get the Confidence Level for the signal plus background hypothesis.
virtual void Add(TH1 *h, Option_t *option="")
add a new histogram to the list Only 1-d and 2-d histograms currently supported.
Double_t CLs(bool use_sMC=kFALSE) const
Get the Confidence Level defined by CLs = CLsb/CLb.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
virtual void Update()
Update canvas pad buffers.
void Modified(Bool_t flag=1)