How to write multiple histograms in output file

Hi all,
I have created multiple histograms in a loop. Now I need to write them in a output file. If I am trying to write them inside the loop there is error that multiple output file is opening. How do I can write the histograms ?

Thank you

You should open the output root file (TFile) before the loop. Then inside the loop you write as many histograms as you want inside that file and, finally, once the loop in over, you close the root file.

Thank you.

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