14using FourVectors = std::vector<FourVector>;
19void fill_tree(
const char *treeName,
const char *fileName)
23 d.Define(
"b1", [&i]() {
return (
double)i; })
30 .Snapshot(treeName, fileName);
37 auto fileName =
"df004_cutFlowReport.root";
38 auto treeName =
"myTree";
39 fill_tree(treeName, fileName);
46 auto cut1 = [](
double b1) {
return b1 > 25.; };
47 auto cut2 = [](
int b2) {
return 0 == b2 % 2; };
51 auto filtered1 =
d.Filter(cut1, {
"b1"},
"Cut1");
52 auto filtered2 =
d.Filter(cut2, {
"b2"},
"Cut2");
54 auto augmented1 = filtered2.Define(
"b3", [](
double b1,
int b2) {
return b1 / b2; });
55 auto cut3 = [](
double x) {
return x < .5; };
56 auto filtered3 = augmented1.Filter(cut3, {
"b3"},
"Cut3");
67 std::cout <<
"Cut3 stats:" << std::endl;
68 filtered3.Report()->Print();
72 std::cout <<
"All stats:" << std::endl;
73 auto allCutsReport =
d.Report();
74 allCutsReport->Print();
77 std::cout <<
"Name\tAll\tPass\tEfficiency" << std::endl;
78 for (
auto &&cutInfo : allCutsReport) {
79 std::cout << cutInfo.GetName() <<
"\t" << cutInfo.GetAll() <<
"\t" << cutInfo.GetPass() <<
"\t"
80 << cutInfo.GetEff() <<
" %" << std::endl;
84 auto cutName =
"Cut1";
85 auto cut = allCutsReport->At(
"Cut1");
86 std::cout << cutName <<
" efficiency is " << cut.GetEff() <<
" %" << std::endl;
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
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 (-,...