12 using FourVectors = std::vector<FourVector>;
17 void fill_tree(
const char *treeName,
const char *fileName)
21 d.Define(
"b1", [&i]() {
return (
double)i; })
28 .Snapshot(treeName, fileName);
35 auto fileName =
"df004_cutFlowReport.root";
36 auto treeName =
"myTree";
37 fill_tree(treeName, fileName);
44 auto cut1 = [](
double b1) {
return b1 > 25.; };
45 auto cut2 = [](
int b2) {
return 0 == b2 % 2; };
49 auto filtered1 =
d.Filter(cut1, {
"b1"},
"Cut1");
50 auto filtered2 =
d.Filter(cut2, {
"b2"},
"Cut2");
52 auto augmented1 = filtered2.Define(
"b3", [](
double b1,
int b2) {
return b1 / b2; });
53 auto cut3 = [](
double x) {
return x < .5; };
54 auto filtered3 = augmented1.Filter(cut3, {
"b3"},
"Cut3");
65 std::cout <<
"Cut3 stats:" << std::endl;
66 filtered3.Report()->Print();
70 std::cout <<
"All stats:" << std::endl;
71 auto allCutsReport =
d.Report();
72 allCutsReport->Print();
75 std::cout <<
"Name\tAll\tPass\tEfficiency" << std::endl;
76 for (
auto &&cutInfo : allCutsReport) {
77 std::cout << cutInfo.GetName() <<
"\t" << cutInfo.GetAll() <<
"\t" << cutInfo.GetPass() <<
"\t" 78 << cutInfo.GetEff() <<
" %" << std::endl;
82 auto cutName =
"Cut1";
83 auto cut = allCutsReport->At(
"Cut1");
84 std::cout << cutName <<
" efficiency is " << cut.GetEff() <<
" %" << std::endl;
DisplacementVector3D< CylindricalEta3D< double >, DefaultCoordinateSystemTag > RhoEtaPhiVector
3D Vector based on the eta based cylindrical coordinates rho, eta, phi in double precision.
LorentzVector< PxPyPzE4D< double > > XYZTVector
LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in double precision with metric (-...
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees, CSV's and other data formats.