Calling Notify() function in MakeClass when the tree is empty

Hi rooters,

for the first time I am facing this kind of problem and I find it very hard to resolve!
I read many files using TChain and MakeClass, each file contains different number of entries (0,1000000).
Every time a new file is opened, the Notify function is called, and there I get the current file read a directory and then retrieve one histogram. The code was okay for a long time but then started to crash because some trees do not have entries and thus Notify function is not called.

I need to call the function even if there are no entires in the tree, since I need the histogram which records the total number of events.

Is there a solution?

Cheers

Hi,

You can capture and check the value TChain::GetTreeNumber, in the case where there is an empty TTree this number will incremented by more than one in between calls to Notify.

Nonetheless, you are right and I updated the source code so that Notify is also called for empty elements. This is available in the master (future v6.08).

Thanks for your report.
Philippe.

thanks a lot Philippe,
could you please post the fix so I can use to adjust my code?
Cheers

Hi,

You can see the patch at https://root.cern.ch/gitweb?p=root.git;a=commitdiff;h=bc8c6929e3a3fb14b52280129da26b0d98882689

Cheers,
Philippe.