15 auto ret = dataFrame.Filter(
"TMath::Abs(md0_d - 1.8646) < 0.04")
16 .Filter(
"ptds_d > 2.5")
17 .Filter(
"TMath::Abs(etads_d) < 1.5")
18 .Filter([](
int ik,
int ipi, Iarray_t& nhitrp) {
return nhitrp[ik - 1] * nhitrp[ipi - 1] > 1; },
19 {
"ik",
"ipi",
"nhitrp"})
20 .
Filter([](
int ik, Farray_t& rstart, Farray_t& rend) {
return rend[ik - 1] - rstart[ik - 1] > 22; },
21 {
"ik",
"rstart",
"rend"})
22 .
Filter([](
int ipi, Farray_t& rstart, Farray_t& rend) {
return rend[ipi - 1] - rstart[ipi - 1] > 22; },
23 {
"ipi",
"rstart",
"rend"})
24 .
Filter([](
int ik, Farray_t& nlhk) {
return nlhk[ik - 1] > 0.1; }, {
"ik",
"nlhk"})
25 .
Filter([](
int ipi, Farray_t& nlhpi) {
return nlhpi[ipi - 1] > 0.1; }, {
"ipi",
"nlhpi"})
26 .
Filter([](
int ipis, Farray_t& nlhpi) {
return nlhpi[ipis - 1] > 0.1; }, {
"ipis",
"nlhpi"})
39 Double_t xp3 = (x - par[3]) * (x - par[3]);
41 dxbin * (par[0] *
pow(x - 0.13957, par[1]) + par[2] / 2.5066 / par[4] *
exp(-xp3 / 2 / par[4] / par[4]));
51 Double_t xp3 = (x - 0.1454) * (x - 0.1454);
52 Double_t res = dxbin * (par[0] *
pow(x - 0.13957, 0.25) + par[1] / 2.5066 / sigma *
exp(-xp3 / 2 / sigma / sigma));
56 void FitAndPlotHdmd(
TH1 &hdmd)
60 auto c1 =
new TCanvas(
"c1",
"h1analysis analysis", 10, 10, 800, 600);
65 auto f5 =
new TF1(
"f5",
fdm5, 0.139, 0.17, 5);
66 f5->SetParameters(1000000, .25, 2000, .1454, .001);
72 void FitAndPlotH2(
TH2 &h2)
75 auto c2 =
new TCanvas(
"c2",
"tauD0", 100, 100, 800, 600);
78 c2->SetBottomMargin(0.15);
84 auto f2 =
new TF1(
"f2",
fdm2, 0.139, 0.17, 2);
85 f2->SetParameters(10000, 10);
90 h2_1->GetXaxis()->SetTitle(
"#tau [ps]");
91 h2_1->SetMarkerStyle(21);
99 void df101_h1Analysis()
102 chain.Add(
"http://root.cern.ch/files/h1/dstarmb.root");
103 chain.Add(
"http://root.cern.ch/files/h1/dstarp1a.root");
104 chain.Add(
"http://root.cern.ch/files/h1/dstarp1b.root");
105 chain.Add(
"http://root.cern.ch/files/h1/dstarp2.root");
110 auto selected = Select(dataFrame);
111 auto hdmdARP = selected.Histo1D({
"hdmd",
"Dm_d", 40, 0.13, 0.17},
"dm_d");
112 auto selectedAddedBranch = selected.Define(
"h2_y",
"rpd0_t / 0.029979f * 1.8646f / ptd0_d");
113 auto h2ARP = selectedAddedBranch.Histo2D({
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6},
"dm_d",
"h2_y");
115 FitAndPlotHdmd(*hdmdARP);
116 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 TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad...
R__EXTERN TStyle * gStyle
Double_t fdm2(Double_t *xx, Double_t *par)
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
double pow(double, double)
RVec< T > Filter(const RVec< T > &v, F &&f)
Create a new collection with the elements passing the filter expressed by the predicate.
A "std::vector"-like collection of values implementing handy operation to analyse them...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Service class for 2-Dim histogram classes.
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 ...
1-D histogram with a double per channel (see TH1 documentation)}
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees, CSV's and other data formats.
Double_t fdm5(Double_t *xx, Double_t *par)
A chain is a collection of files containing TTree objects.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
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.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...