12 auto checkH1 = [](
TList *out) {
16 std::cout <<
"checkH1 >>> Test failure: output list not found\n";
21 TH1F *hdmd =
dynamic_cast<TH1F *
>(out->FindObject(
"hdmd"));
23 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo not found\n";
27 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo: wrong number" 33 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo: wrong mean (" << hdmd->
GetMean()
34 <<
": expected 0.15512023) \n";
38 TH2F *h2 =
dynamic_cast<TH2F *
>(out->FindObject(
"h2"));
40 std::cout <<
"checkH1 >>> Test failure: 'h2' histo not found\n";
44 std::cout <<
"checkH1 >>> Test failure: 'h2' histo: wrong number" 50 std::cout <<
"checkH1 >>> Test failure: 'h2' histo: wrong mean (" << h2->
GetMean() <<
": expected 0.15245688) \n";
68 if (hdmd == 0 || h2 == 0) {
69 std::cout <<
"doFit: hdmd = " << hdmd <<
" , h2 = " << h2 <<
"\n";
82 if (
gROOT->GetListOfFunctions()->FindObject(
"f5"))
delete gROOT->GetFunction(
"f5");
87 if (x <= 0.13957)
return 0;
96 hdmd->
Fit(
"f5",
"lr");
99 Double_t ref_f5[4] = {959915.0, 0.351114, 1185.03, 0.145569};
100 for (
int i : {0, 1, 2, 3}) {
102 std::cout <<
"\n >>> Test failure: fit to 'f5': parameter '" << f5->
GetParName(i) <<
"' has wrong value (" 103 << (f5->
GetParameters())[i] <<
": expected" << ref_f5[i] <<
") \n";
120 if (
gROOT->GetListOfFunctions()->FindObject(
"f2"))
delete gROOT->GetFunction(
"f2");
123 const Double_t dxbin = (0.17 - 0.13) / 40;
126 if (x <= 0.13957)
return 0;
127 Double_t xp3 = (x - 0.1454) * (x - 0.1454);
129 par[1] / 2.5066 / sigma *
TMath::Exp(-xp3 / 2 / sigma / sigma));
137 std::cout <<
"doFit: restricting fit to two bins only in this example...\n";
139 h2->FitSlicesX(f2, 10, 20, 10,
"g5 l");
142 Double_t ref_f2[2] = {52432.2, 105.481};
143 for (
int i : {0, 1}) {
145 std::cout <<
"\n >>> Test failure: fit to 'f2': parameter '" << f2->
GetParName(i) <<
"' has wrong value (" 146 << (f2->
GetParameters())[i] <<
": expected" << ref_f2[i] <<
") \n";
175 auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
176 auto h2 =
new TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
197 if (
TMath::Abs(*fMd0_d - 1.8646) >= 0.04)
continue;
198 if (*fPtds_d <= 2.5)
continue;
203 if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
continue;
205 if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
continue;
206 if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
continue;
207 if (fNlhk.At(*fIk) <= 0.1)
continue;
208 if (fNlhpi.At(*fIpi) <= 0.1)
continue;
210 if (fNlhpi.At(*fIpis) <= 0.1)
continue;
211 if (*fNjets < 1)
continue;
215 h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
231 auto elist =
new TEntryList(
"elist",
"H1 selection from Cut");
249 if (
TMath::Abs(*fMd0_d - 1.8646) >= 0.04)
continue;
250 if (*fPtds_d <= 2.5)
continue;
255 if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
continue;
257 if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
continue;
258 if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
continue;
259 if (fNlhk.At(*fIk) <= 0.1)
continue;
260 if (fNlhpi.At(*fIpi) <= 0.1)
continue;
262 if (fNlhpi.At(*fIpis) <= 0.1)
continue;
263 if (*fNjets < 1)
continue;
266 elist->Enter(
reader.GetCurrentEntry(),
reader.GetTree());
276 auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
277 auto h2 =
new TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
286 h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void SetParameters(const Double_t *params)
void doFit(int n, const char *fitter)
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
R__EXTERN TStyle * gStyle
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Double_t fdm2(Double_t *xx, Double_t *par)
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.
tomato 1-D histogram with a float per channel (see TH1 documentation)}
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The histogram statistics painter class.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual const char * GetParName(Int_t ipar) const
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
virtual Double_t GetEntries() const
Return the current number of entries.
Double_t fdm5(Double_t *xx, Double_t *par)
Double_t GetUymax() const
double f2(const double *x)
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
virtual Double_t * GetParameters() const
virtual void Update()
Update canvas pad buffers.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
TList * GetListOfFunctions() const
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
A List of entry numbers in a TTree or TChain.
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.
void Modified(Bool_t flag=1)
void SetOptStat(Int_t stat=1)
Set the stat option.