a plot ready for publication is a set of histos + legends + labels. So far I always used a TCanvas to save all these “final-plots” into a .root file.
So in my compiled c++ code I used the Draw() method over all objects, and then I saved the whole Canvas in the .root file.
But this plotting to a canvas is the step of my algorithm which takes the most of the running time. And as I have to loop over thousands of histos, I wanted to ask you if there is another better or, maybe, faster object to use, instead of the TCanvas.
Thanks a lot for your help, and have a nice day,
Are you doing this in batch or interactive mode ?
in batch, in compiled code.
I cannot think of something faster.
I also looked at all ROOT classes, without finding another container class similar to TCanvas.
Could you describe what you are expecting? what you call slow: ms, seconds, hours?
Why do you write canvas.root instead of canvas.png?
no no, “slow” is relative the order of magnitude is 0.01 seconds actually, but being the Canvas part the slowest in my agorithm, and being very high the number of histos I have to loop over, I was just wondering if there was an alternative to the TCanvas container.
I use TCanvas instead of converting to .png because it’s an automated tool looping over thousands of plots, preparing also all final plots with legends, labels and so on. And it stores everything in a unique .root file.
In end the user scans the outcome for interesting plots, and he converts manually to .png or .eps only the plots he needs.
Does it make sense, or maybe you could suggest me a different approach?