45 hbiasNorm.
Add(
new TH1D(
"h0Norm",
"Bias Histogram fit",100,-5,5));
46 hbiasNorm.
Add(
new TH1D(
"h1Norm",
"Bias Binomial fit",100,-5,5));
48 hbiasThreshold.
Add(
new TH1D(
"h0Threshold",
"Bias Histogram fit",100,-5,5));
49 hbiasThreshold.
Add(
new TH1D(
"h1Threshold",
"Bias Binomial fit",100,-5,5));
51 hbiasWidth.
Add(
new TH1D(
"h0Width",
"Bias Histogram fit",100,-5,5));
52 hbiasWidth.
Add(
new TH1D(
"h1Width",
"Bias Binomial fit",100,-5,5));
53 TH1D* hChisquared =
new TH1D(
"hChisquared",
54 "#chi^{2} probability (Baker-Cousins)", 200, 0.0, 1.0);
70 TH1D* hM2D =
new TH1D(
"hM2D",
"x^(-2) denominator distribution",
72 TH1D* hM2N =
new TH1D(
"hM2N",
"x^(-2) numerator distribution",
74 TH1D* hM2E =
new TH1D(
"hM2E",
"x^(-2) efficiency",
77 TF1* fM2D =
new TF1(
"fM2D",
"(1-[0]/(1+exp(([1]-x)/[2])))/(x*x)",
79 TF1* fM2N =
new TF1(
"fM2N",
"[0]/(1+exp(([1]-x)/[2]))/(x*x)",
81 TF1* fM2Fit =
new TF1(
"fM2Fit",
"[0]/(1+exp(([1]-x)/[2]))",
102 Double_t fracN = integralN/(integralN+integralD);
104 Int_t nevtsD = nevts - nevtsN;
106 std::cout << nevtsN <<
" " << nevtsD << std::endl;
111 for (
int iloop = 0; iloop < nloop; ++iloop) {
122 hM2E->
Divide(hM2N, hM2D, 1, 1,
"b");
146 Form(
"plots for experiment %d", iloop),
155 for (
int fit = 0; fit < 2; ++fit) {
195 std::cerr <<
"Error performing binomial efficiency fit, result = "
196 << status << std::endl;
210 if (status != 0)
break;
228 TH1D*
h =
dynamic_cast<TH1D*
>(hbiasNorm[fit]);
229 h->
Fill((fnorm-norm)/enorm);
230 h =
dynamic_cast<TH1D*
>(hbiasThreshold[fit]);
231 h->
Fill((fthreshold-threshold)/ethreshold);
232 h =
dynamic_cast<TH1D*
>(hbiasWidth[fit]);
233 h->
Fill((fwidth-width)/ewidth);
239 "Efficiency fit biases",10,10,1000,800);
244 h0 =
dynamic_cast<TH1D*
>(hbiasNorm[0]);
246 h1 =
dynamic_cast<TH1D*
>(hbiasNorm[1]);
248 h1->
Draw(
"HIST SAMES");
250 "plateau parameter",
"ndc");
258 h0 =
dynamic_cast<TH1D*
>(hbiasThreshold[0]);
260 h1 =
dynamic_cast<TH1D*
>(hbiasThreshold[1]);
262 h1->
Draw(
"HIST SAMES");
264 "threshold parameter",
"ndc");
272 h0 =
dynamic_cast<TH1D*
>(hbiasWidth[0]);
274 h1 =
dynamic_cast<TH1D*
>(hbiasWidth[1]);
276 h1->
Draw(
"HIST SAMES");
277 TLegend* l3 =
new TLegend(0.1, 0.75, 0.5, 0.9,
"width parameter",
"ndc");
285 hChisquared->
Draw(
"HIST");
virtual void SetLineWidth(Width_t lwidth)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Random number generator class based on M.
This class displays a legend box (TPaveText) containing several legend entries.
virtual Int_t Binomial(Int_t ntot, Double_t prob)
Generates a random integer N according to the binomial law.
Binomial fitter for the division of two histograms.
R__EXTERN TStyle * gStyle
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
static void SetDefaultFitter(const char *name="")
static: set name of default fitter
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
static void SetDefaultIntegrator(const char *name)
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to vusualize the function.
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
TLine l1(2.5, 4.5, 15.5, 4.5)
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
virtual void Reset(Option_t *option="")
Reset.
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2), errors are also recalculated.
virtual void SetLineColor(Color_t lcolor)
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetParError(Int_t ipar, Double_t error)
Set error for parameter number ipar.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
virtual void SetMarkerStyle(Style_t mstyle=1)
Double_t GetRMS(Int_t axis=1) const
virtual Double_t GetProb() const
Return the fit probability.
1-D histogram with a double per channel (see TH1 documentation)}
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2), errors are also recalculated.
virtual Double_t GetParameter(Int_t ipar) const
virtual void Print(Option_t *option="") const
Print result of the fit, by default chi2, parameter values and errors.
TFitResultPtr Fit(TF1 *f1, Option_t *option="")
Carry out the fit of the given function to the given histograms.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void TestBinomial(int nloop=100, int nevts=100, bool plot=false, bool debug=false, int seed=111)
virtual void SetParameter(Int_t param, Double_t value)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
double norm(double *x, double *p)
virtual TF1 * DrawCopy(Option_t *option="") const
Draw a copy of this function with its current attributes.