ROOT Version: 6.24/02
Platform: Linux/Fedora 34
Compiler: gcc version 11.3.1 20220421
Hello,
I have a std::vector<ROOT::RDF::RResultPtr<TH1D>>
type function which returns histograms as histosR
. I am trying to write those histograms to a file using:
fop->WriteTObject(histosR[i].GetPtr());
This works fast. But, the resulting file contains histograms from different cycles. This is unwanted. Therefore, I used second method.
fop->WriteTObject(histosR[i].GetPtr(),"","Overwrite");
But, this takes considerably longer (22 seconds) when the code is executed the second time (compared to 1.6 seconds the first time), as shown below.
root [0] .L Tree2Histo_rdf.C++
Info in <TUnixSystem::ACLiC>: creating shared library /home/..../Downloads/./Tree2Histo_rdf_C.so
root [1] Tree2Histo_rdf("run169.root", "f169_170_RH.root")
Number of branches in the tree : 385
Number of events to be processed: 30000
10000 : events processed
20000 : events processed
30000 : events processed
Elapsed time : 00h:00m:1.65s
root [2] Tree2Histo_rdf("run170.root", "f169_170_RH.root")
Number of branches in the tree : 385
Number of events to be processed: 30000
10000 : events processed
20000 : events processed
30000 : events processed
Elapsed time : 00h:00m:21.99s
Why adding "Overwrite"
option to WriteTObject
results in so much increased time of execution?
Regards,
Ajay