23 using FourVectors = std::vector<FourVector>;
28 void fill_tree(
const char *filename,
const char *treeName)
30 TFile f(filename,
"RECREATE");
31 TTree t(treeName, treeName);
36 for (
int i = 0; i < 50; ++i) {
50 auto fileName =
"tdf004_cutFlowReport.root";
51 auto treeName =
"myTree";
52 fill_tree(fileName, treeName);
59 auto cut1 = [](
double b1) {
return b1 > 25.; };
60 auto cut2 = [](
int b2) {
return 0 == b2 % 2; };
64 auto filtered1 = d.
Filter(cut1, {
"b1"},
"Cut1");
65 auto filtered2 = d.Filter(cut2, {
"b2"},
"Cut2");
67 auto augmented1 = filtered2.Define(
"b3", [](
double b1,
int b2) {
return b1 / b2; });
68 auto cut3 = [](
double x) {
return x < .5; };
69 auto filtered3 = augmented1.Filter(cut3, {
"b3"},
"Cut3");
79 std::cout <<
"Cut3 stats:" << std::endl;
81 std::cout <<
"All stats:" << std::endl;
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
DisplacementVector3D< CylindricalEta3D< double >, DefaultCoordinateSystemTag > RhoEtaPhiVector
3D Vector based on the eta based cylindrical coordinates rho, eta, phi in double precision.
TInterface< TFilterBase > Filter(F f, const ColumnNames_t &bn={}, std::string_view name="")
Append a filter to the call graph.
LorentzVector< PxPyPzE4D< double > > XYZTVector
LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in double precision with metric (-...
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.
int main(int argc, char **argv)