Using `AddProgressBar` and `RunGraphs` together

Dear ROOT experts,

I’ve been starting to use RDataFrame and I’m finding it very useful. As the impatient person that I am, I also find very useful the ROOT::RDF::Experimental::AddProgressBar, that works perfectly. In the documentation, I see that one can attach the progress bar to nodes or to the RDataFrame object. However, I have a slightly more complicated workflow, using RunGraphs (see dummy example below). Of course, I understand I can add a progress bar for each of the RDFs, but I was wondering if I could unify everything in a single progress bar?

import ROOT as r
r.EnableImplicitMT(16)
#rdf1=r.RDataFrame("Events", file1) # this creates two progress bars
#rdf2=r.RDataFrame("Events", file2)

r.RDF.Experimental.AddProgressBar(rdf1)
r.RDF.Experimental.AddProgressBar(rdf2)


histo1=rdf1.Histo1D( "LepGood_pt" )
histo2=rdf2.Histo1D( "LepGood_pt" )
histo3=rdf1.Histo1D( "LepGood_eta" )

print( r.RDF.RunGraphs([histo1, histo2, histo3]) )

Thanks in advance

First, welcome to the ROOT Forum!
Then, let’s ask @mczurylo and @vpadulan

1 Like

Hi @spontiak,

Sorry for a delayed response, it’s great you are using the progress bar and you are finding it useful!

What you see is expected for now progress bar is only attached to a single RDF, since this is an experimental feature, we are very happy to hear the feedback and explore how to improve it further.

What I could suggest you do instead is to create a single RDF from multiple files, using FromSpec method as is shown in the tutorial: ROOT: tutorials/dataframe/df106_HiggsToFourLeptons.py File Reference (and the attached json file in the tutorial folder).

Please let me know in case you have any further questions.

Cheers,
Marta

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.