Hi,
I have two trees in two different files that I am trying to read. Both the trees have equal entries because they were created together. Both the trees have some similar branches but some different as well. I load both of them:
auto df_lam =
ROOT::RDataFrame("v0", "./xi_lambda.root");
auto df_xi =
ROOT::RDataFrame("xi", "./xi.root");
// define cuts
auto ev_cuts = [](float primVx, float primVy, float primVz, int ntofMatch) {
return (fabs(primVz) < 40 && ntofMatch > 2.0 &&
fabs(primVx * primVx + primVy * primVy) < 4.0);
};
auto df_lam_cut = df_lam.Filter(
ev_cuts, {"primvertexX", "primvertexY", "primvertexZ", "ntofmatched"});
auto nentries = df_lam_cut.Count();
// do all the takes for event branches
auto primVX = df_lam_cut.Take<Float_t>("primvertexX");
auto primVY = df_lam_cut.Take<Float_t>("primvertexY");
auto primVZ = df_lam_cut.Take<Float_t>("primvertexZ");
and then I do, for example this:
auto nmcXi = *df_xi.Take<Int_t>("nmcxi");
for (ULong64_t n = 0; n < *nentries; ++n) {
Int_t nmcXi = nmcXi;
cout << "nmcXi = " << nmcXi << endl;
}
seems to cout wrong values. I tried to do this as well:
auto nmcXi = df_xi.Take<Int_t>("nmcxi");
for (ULong64_t n = 0; n < *nentries; ++n) {
Int_t nmcXi = nmcXi;
cout << "nmcXi = " << nmcXi << endl;
}
but it just prints 0.
ROOT Version: 6.30/02
Compiler: gcc version 13.2.1