30 TCanvas *c1 =
new TCanvas(
"c1",
"Dynamic Filling Example",200,10,700,500);
34 TH1D* background =
new TH1D(
"background",
"The expected background",30,-4,4);
35 TH1D* signal =
new TH1D(
"signal",
"the expected signal",30,-4,4);
36 TH1D* data =
new TH1D(
"data",
"some fake data points",30,-4,4);
47 for (
Int_t i = 0; i < 25000; i++) {
50 background->
Fill(bg,0.02);
51 signal->
Fill(sig,0.001);
53 for (
Int_t i = 0; i < 500; i++) {
57 THStack *hs =
new THStack(
"hs",
"Signal and background compared to data...");
61 data->
Draw(
"PE1,Same");
72 cout <<
"Computing limits... " << endl;
75 cout <<
"CLs : " << myconfidence->
CLs() << endl;
76 cout <<
"CLsb : " << myconfidence->
CLsb() << endl;
77 cout <<
"CLb : " << myconfidence->
CLb() << endl;
83 cout << endl <<
"Computing limits with stat systematics... " << endl;
85 cout <<
"CLs : " << mystatconfidence->
CLs() << endl;
86 cout <<
"CLsb : " << mystatconfidence->
CLsb() << endl;
87 cout <<
"CLb : " << mystatconfidence->
CLb() << endl;
93 cout << endl <<
"Computing limits with systematics... " << endl;
108 cout <<
"CLs : " << mynewconfidence->
CLs() << endl;
109 cout <<
"CLsb : " << mynewconfidence->
CLsb() << endl;
110 cout <<
"CLb : " << mynewconfidence->
CLb() << endl;
119 myconfidence->
Draw();
124 delete mystatconfidence;
125 delete mynewconfidence;
126 delete mynewdatasource;
Double_t CLs(bool use_sMC=kFALSE) const
Get the Confidence Level defined by CLs = CLsb/CLb.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Double_t GetExpectedCLs_b(Int_t sigma=0) const
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.
Double_t GetExpectedCLb_b(Int_t sigma=0) const
Get the expected Confidence Level for the background only if there is only background.
TFrame * GetFrame()
Get frame.
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetBorderSize(Short_t bordersize)
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)
virtual void SetMarkerStyle(Style_t mstyle=1)
static TConfidenceLevel * ComputeLimit(TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=0)
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...
Class to compute 95% CL limits.
1-D histogram with a double per channel (see TH1 documentation)}
void Draw(const Option_t *option="")
Display sort of a "canonical" -2lnQ plot.
virtual void Add(TH1 *h, Option_t *option="")
add a new histogram to the list Only 1-d and 2-d histograms currently supported.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
std::vector< double > errors
virtual void Update()
Update canvas pad buffers.
Double_t CLsb(bool use_sMC=kFALSE) const
Get the Confidence Level for the signal plus background hypothesis.
void Modified(Bool_t flag=1)
Double_t CLb(bool use_sMC=kFALSE) const
Get the Confidence Level for the background only.