15 std::cout <<
"checkH1 >>> Test failure: output list not found\n";
20 auto hdmd =
dynamic_cast<out->FindObject(
"hdmd"));
22 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo not found\n";
25 if ((
Int_t)(hdmd->GetEntries()) != 7525) {
26 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo: wrong number"
28 << (
Int_t)(hdmd->GetEntries()) <<
": expected 7525) \n";
31 if (
TMath::Abs((hdmd->GetMean() - 0.15512023) / 0.15512023) > 0.001) {
32 std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo: wrong mean (" << hdmd->
GetMean()
33 <<
": expected 0.15512023) \n";
37 auto out->FindObject(
"h2"));
39 std::cout <<
"checkH1 >>> Test failure: 'h2' histo not found\n";
42 if ((h2->GetEntries()) != 7525) {
43 std::cout <<
"checkH1 >>> Test failure: 'h2' histo: wrong number"
45 << (h2->GetEntries()) <<
": expected 7525) \n";
48 if (h2->GetMean() - 0.15245688) / 0.15245688) > 0.001) {
49 std::cout <<
"checkH1 >>> Test failure: 'h2' histo: wrong mean (" << h2->GetMean() <<
": expected 0.15245688) \n";
58auto doFit = [](Int_t {
64 auto hdmd =
dynamic_cast<out->FindObject(
"hdmd"));
65 auto out->FindObject(
"h2"));
68 if (hdmd == 0 || h2 == 0) {
69 std::cout <<
"doFit: hdmd = " << hdmd <<
" , h2 = " << h2 <<
"\n";
78 c1->SetBottomMargin(0.15);
79 hdmd->GetXaxis()->SetTitle(
"m_{K#pi#pi} - m_{K#pi}[GeV/c^{2}]");
80 hdmd->GetXaxis()->SetTitleOffset(1.4);
83 if (
gROOT->GetListOfFunctions()->FindObject(
"f5"))
84 delete gROOT->GetFunction(
"f5");
93 par[2] / 2.5066 / par[4] *
TMath::Exp(-
xp3 / 2 / par[4] / par[4]));
97 auto f5 =
new TF1(
"f5",
fdm5, 0.139, 0.17, 5);
98 f5->SetParameters(1000000, .25, 2000, .1454, .001);
99 hdmd->Fit(
"f5",
"lr");
103 for (
int i : {0, 1, 2, 3}) {
105 std::cout <<
"\n >>> Test failure: fit to 'f5': parameter '" << f5->GetParName(i) <<
"' has wrong value ("
106 << (f5->GetParameters())[i] <<
": expected" <<
ref_f5[i] <<
") \n";
116 auto c2 =
new TCanvas(
"c2",
"tauD0", 100, 100, 800, 600);
118 c2->SetBottomMargin(0.15);
124 if (
gROOT->GetListOfFunctions()->FindObject(
"f2"))
125 delete gROOT->GetFunction(
"f2");
128 const auto dxbin = (0.17 - 0.13) / 40;
129 const auto sigma = 0.0012;
133 auto xp3 = (
x - 0.1454) * (
x - 0.1454);
139 auto f2 =
new TF1(
"f2",
fdm2, 0.139, 0.17, 2);
140 f2->SetParameters(10000, 10);
143 std::cout <<
"doFit: restricting fit to two bins only in this example...\n";
145 h2->FitSlicesX(f2, 10, 20, 10,
"g5 l");
149 for (
int i : {0, 1}) {
151 std::cout <<
"\n >>> Test failure: fit to 'f2': parameter '" << f2->GetParName(i) <<
"' has wrong value ("
152 << (f2->GetParameters())[i] <<
": expected" <<
ref_f2[i] <<
") \n";
160 h2_1->GetXaxis()->SetTitle(
"#tau[ps]");
161 h2_1->SetMarkerStyle(21);
169 auto psdmd = (
TPaveStats *)hdmd->GetListOfFunctions()->FindObject(
"stats");
170 psdmd->SetOptStat(1110);
183 auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
184 auto TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
214 if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
217 if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
219 if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
221 if (fNlhk.At(*fIk) <= 0.1)
223 if (fNlhpi.At(*fIpi) <= 0.1)
226 if (fNlhpi.At(*fIpis) <= 0.1)
233 h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
249 auto elist =
new TEntryList(
"elist",
"H1 selection from Cut");
276 if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
279 if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
281 if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
283 if (fNlhk.At(*fIk) <= 0.1)
285 if (fNlhpi.At(*fIpi) <= 0.1)
288 if (fNlhpi.At(*fIpis) <= 0.1)
294 elist->Enter(
reader.GetCurrentEntry(),
reader.GetTree());
304 auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
305 auto TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
314 h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
A List of entry numbers in a TTree or TChain.
1-D histogram with a double per channel (see TH1 documentation)
1-D histogram with a float per channel (see TH1 documentation)
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.
2-D histogram with a float per channel (see TH1 documentation)
Use the TLine constructor to create a simple line.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The histogram statistics painter class.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr)
Redirect standard output (stdout, stderr) to the specified file.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Double_t fdm5(Double_t *xx, Double_t *par)
Double_t fdm2(Double_t *xx, Double_t *par)
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.