Dear all,
I think I have a problem with the lazy Snapshots in RDataFrame.
I’m trying to divide my TChain with all events in 3 TTrees using RDataFrame and filters. I book 3 Snaphots and trigger event loop with Count().GetValue(). But I’m getting 3 warnings:
Warning in : A lazy Snapshot action was booked but never triggered.
And no files are created. If set opts.fLazy = false, all 3 files are created and everything seems all right, but it triggers 3 event loops, which is not good for big data volumes.
Printed result of d.Count().GetValue() is good, and RDataFrame successfully opens my files with TTrees - I check it by printing the first column name.
What is wrong with my code?
Here is part of my code where I do this. I also attached a simple reproducer of what I’m doing. reproducer.C (871 Bytes)
Thank you for your help!
//lambdas for filters are created here
ROOT::RDataFrame d("data",dataframename);
ROOT::RDF::RSnapshotOptions opts;
opts.fLazy = true;
std::string filename = "SF.root";
std::string treename = "SF";
d.Filter(sf_filter,{"energy_front_sum","energy_back_sum", "energy_side_sum", "energy_front_side_sum", "camera1"}).
Snapshot(treename,filename,d.GetColumnNames(),opts);
filename = "ER.root";
treename = "ER";
d.Filter(er_filter,{"energy_front_sum","energy_back_sum", "energy_side_sum", "energy_front_side_sum", "camera1"}).
Snapshot(treename,filename,d.GetColumnNames(),opts);
filename = "alpha.root";
treename = "alpha";
d.Filter(alpha_filter,{"energy_front_sum","energy_back_sum", "energy_side_sum", "energy_front_side_sum", "camera1"}).
Snapshot(treename,filename,d.GetColumnNames(),opts);
std::cout << d.Count().GetValue() << std::endl;
ROOT Version: 6.24/02
Platform: Linux Mint
Compiler: gcc