22 dataFrame.Filter([](
float md0_d) {
return TMath::Abs(md0_d - 1.8646) < 0.04; }, {
"md0_d"})
23 .Filter([](
float ptds_d) {
return ptds_d > 2.5; }, {
"ptds_d"})
24 .Filter([](
float etads_d) {
return TMath::Abs(etads_d) < 1.5; }, {
"etads_d"})
25 .Filter([](
int ik,
int ipi, std::array_view<int> nhitrp) {
return nhitrp[ik - 1] * nhitrp[ipi - 1] > 1; },
26 {
"ik",
"ipi",
"nhitrp"})
27 .Filter([](
int ik, std::array_view<float> rstart,
28 std::array_view<float> rend) {
return rend[ik - 1] - rstart[ik - 1] > 22; },
29 {
"ik",
"rstart",
"rend"})
30 .Filter([](
int ipi, std::array_view<float> rstart,
31 std::array_view<float> rend) {
return rend[ipi - 1] - rstart[ipi - 1] > 22; },
32 {
"ipi",
"rstart",
"rend"})
33 .Filter([](
int ik, std::array_view<float> nlhk) {
return nlhk[ik - 1] > 0.1; }, {
"ik",
"nlhk"})
34 .Filter([](
int ipi, std::array_view<float> nlhpi) {
return nlhpi[ipi - 1] > 0.1; }, {
"ipi",
"nlhpi"})
35 .Filter([](
int ipis, std::array_view<float> nlhpi) {
return nlhpi[ipis - 1] > 0.1; }, {
"ipis",
"nlhpi"})
36 .Filter([](
int njets) {
return njets >= 1; }, {
"njets"});
46 if (x <= 0.13957)
return 0;
47 Double_t xp3 = (x - par[3]) * (x - par[3]);
49 dxbin * (par[0] *
pow(x - 0.13957, par[1]) + par[2] / 2.5066 / par[4] *
exp(-xp3 / 2 / par[4] / par[4]));
57 if (x <= 0.13957)
return 0;
58 Double_t xp3 = (x - 0.1454) * (x - 0.1454);
59 Double_t res = dxbin * (par[0] *
pow(x - 0.13957, 0.25) + par[1] / 2.5066 / sigma *
exp(-xp3 / 2 / sigma / sigma));
63 void FitAndPlotHdmd(
TH1 &hdmd)
73 if (
gROOT->GetListOfFunctions()->FindObject(
"f5"))
delete gROOT->GetFunction(
"f5");
85 void FitAndPlotH2(
TH2 &h2)
98 if (
gROOT->GetListOfFunctions()->FindObject(
"f2"))
delete gROOT->GetFunction(
"f2");
112 void tdf101_h1Analysis()
115 chain.Add(
"http://root.cern.ch/files/h1/dstarmb.root");
116 chain.Add(
"http://root.cern.ch/files/h1/dstarp1a.root");
117 chain.Add(
"http://root.cern.ch/files/h1/dstarp1b.root");
118 chain.Add(
"http://root.cern.ch/files/h1/dstarp2.root");
121 auto selected = Select(dataFrame);
123 auto hdmdARP = selected.Histo1D(
TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17),
"dm_d");
124 auto selectedAddedBranch = selected.Define(
125 "h2_y", [](
float rpd0_t,
float ptd0_d) {
return rpd0_t / 0.029979f * 1.8646f / ptd0_d; }, {
"rpd0_t",
"ptd0_d"});
126 auto h2ARP = selectedAddedBranch.Histo2D<float,
float>(
TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6),
129 FitAndPlotHdmd(*hdmdARP);
130 FitAndPlotH2(*h2ARP);
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 void SetParameters(const Double_t *params)
R__EXTERN TStyle * gStyle
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Double_t fdm2(Double_t *xx, Double_t *par)
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The histogram statistics painter class.
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)
double pow(double, double)
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
Service class for 2-Dim histogram classes.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void FitSlicesX(TF1 *f1=0, Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=0)
Project slices along X in case of a 2-D histogram, then fit each slice with function f1 and make a hi...
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)}
Double_t fdm5(Double_t *xx, Double_t *par)
Double_t GetUymax() const
double f2(const double *x)
ROOT's TDataFrame offers a high level interface for analyses of data stored in TTrees.
A chain is a collection of files containing TTree objects.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
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
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.