22 void fill_tree(
const char *filename,
const char *treeName)
24 TFile f(filename,
"RECREATE");
25 TTree t(treeName, treeName);
30 for (
int i = 0; i < 25000; i++) {
32 pz = px * px + py * py;
40 void tdf003_profiles()
43 auto fileName =
"tdf003_profiles.root";
44 auto treeName =
"myTree";
45 fill_tree(fileName, treeName);
51 auto hprof1d = d.
Profile1D(
TProfile(
"hprof1d",
"Profile of pz versus px", 64, -4, 4));
52 auto hprof2d = d.Profile2D(
TProfile2D(
"hprof2d",
"Profile of pz versus px and py", 40, -4, 4, 40, -4, 4, 0, 20));
55 auto c1 =
new TCanvas(
"c1",
"Profile histogram example", 200, 10, 700, 500);
57 auto c2 =
new TCanvas(
"c2",
"Profile2D histogram example", 200, 10, 700, 500);
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TResultProxy<::TProfile > Profile1D(::TProfile &&model, std::string_view v1Name="", std::string_view v2Name="")
Fill and return a one-dimensional profile (lazy action)
R__EXTERN TRandom * gRandom
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X...
ROOT's TDataFrame offers a high level interface for analyses of data stored in TTrees.
A TTree object has a header with a name and a title.