_ROOT Version: 6.10.04-x86_64-slc6-gcc62-opt
_Platform: CentOS7, SL6 (same behavior on both)
_Compiler: pyROOT macro (with python 2.7.13-x86_64-slc6-gcc62)
I realised I am using a TChain in what may be a quite special case so I would like to check with you the expected behavior:
mychain = TChain(mytreename) for i in sorted_input_files: mychain.AddFile(i.filename, -1, mytreename)
In each file, the tree “mytreename” has a friend tree already defined, and depending on the file the branch “mybranch” is defined either in “mytreename” or in the friend tree, which is located elsewhere (“mytreename” knows about it) I will call it “myfriendtreename”.
Afterwards, I use TChain::Project to fill up some histograms, the command includes “mybranch”, used as a weight. I observe what appears to be a random behavior to me:
either mybranch is read correctly throughout the files, i.e. in “mytreename” or in “myfriendtreename” depending on the file, and the histogram is filled correctly
sometimes it seems “mybranch” is read only in “myfriendtreename” such that for the files where it is defined in “mytreename” it is set to 0, and the histograms is missing data
My question is:
- is this an expected behavior and one should not use TChain this way?
- what is your suggestion to fix the code (ideally in a minimal way, as this is part of a large software and any modification may break other things) and get histograms properly filled at all time?
Looking forward to hearing from your advice and suggestions