I am trying to see if I can replace some code that creates a number of TF1s using RDataFrame in order to take advantage of the lazy execution and parallelism, but it seems like only TH1Ds can be easily created (i.e., double precision instead of single precision). Is that true? This is my first attempt to use RDataFrame.
I think you mean
TF1 is a function object.
It’s true that RDF only has dedicated methods that create
TH*D, but it also has a generic
Fill method that you can use to fill your own
You can see an example usage in our tutorials, specifically
Thanks. I did mean TH1F, of course. I noticed there is no df005_fillAnyObject.py. Can one use the Fill method in PyROOT?
currently not, because the C++ method takes a forwarding reference and those type of function arguments are not supported by pyROOT.
It should become available in the future.
By the way, if I may ask, why is a TH1D not ok for your usecase?
I probably will try that. I was wanting not to change the output format from what is now used so that the changes would be self-contained. I am not sure if the parts reading the root file expect to read TH1Fs or if TH1Ds are also fine. The trees used to fill the histograms are all with floats.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.