Strange behaviour when TChain mupliple root files

Hello

I have encountered a strange problem. While running on data .root files (skims from nAOD), I fill as usual my histograms, but then it looks like some events are getting either a zero or negative weight ie if I compare the GetEntries() with GetSumOfWeights() of the histo, these numbers do not agree, and given that I do not apply any weight to data, they should match.

However, that happens only when when I TChain`` all .root files in one go, which is in total ~600 files, with a simple chain_events.Add(file_location)```.

But, if I split the task and chain just 100 files every time, I do get the expected behaviour and the histograms are properly filled. Any ideas how to get to the bottom of it? Maybe there is some limitations with the TChain am I missing?

Thanks
Alex

edit: I don’t know if this is relevant, but I actually Project directly from the input TTree

Maybe @pcanal has an idea of what could be the issue here

One potential issue is that the ‘one go’ case does not actually load all the files. Checking by calling ls() on the resulting chain to see the actual list of files.

I also tried

.- hadd all files
. instead of TChain in one go, I do a loop and chain every single file

in both of the cases, I still run into the same problem. And again, it looks like the one-go TChain still gets the right/total number of events, it is when filling the histogram that some events get a non-unity weight (as this is data). When I do split the jobs as explained, the sum of histos is properly filled… So the only difference is how many files are TChained/hadd together apparently? Is there any other way I can check while filling the histogram while calling the Project method?

Thanks
-a

Make sure you use “TH[123]D”, not “TH[123]F” (also check that you have “Hist.Precision.[123]D: double”).

Also, check how many entries you have in underflow and overflow bins (usually, “entries” = “integral” + “underflows” + “overflows”).

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