Issues with trees with ROOT version > 6.08

Dear ROOT experts,

Our analysis groups have a specific framework that converts miniAOD to
TTree format. Recently, I’ve launched it in CMSSW_8_0_26_patch1 which is
linked to ROOT 6.06/01. If I open my tree there, I see nearly all
variables in “EventTree” filled with events.

However, if I open this tree with newer version of ROOT, like 6.09 and
6.10 a lot of those variables are shown “Empty”. I tried this on both
MAC and Linux. If I reinstall older versions (tested with 6.06 and 6.08)
it works fine.

Any idea why? You can find a small (~21MB) version of this tree here:
~hdelanno/public/HyperNewsROOT/tree.root

Thanks,

Hugo

NB: This is a duplicate of https://hypernews.cern.ch/HyperNews/CMS/get/root/217.html if you have access to CMS hypernews.

I have no problems reading your tree:

epsft-53 ~ $ ls *.root
tree.root
epsft-53 ~ $ root
   -------------------------------------------------------------------
  | Welcome to ROOT 6.11/01                       http://root.cern.ch |
  |                                      (c) 1995-2017, The ROOT Team |
  | Built for linuxx8664gcc                                           |
  | From heads/local@v6-09-02-2966-gc9b7225514, Oct 06 2017, 09:10:40 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'        |
   -------------------------------------------------------------------

root [0] TFile f("tree.root", "read");
root [1] f.ls()
TFile**		tree.root	
 TFile*		tree.root	
  KEY: TDirectoryFile	tupel;1	tupel
root [2] TDirectoryFile* d = (TDirectoryFile*) f.Get("tupel"); 
root [3] d->ls()
TDirectoryFile*		tupel	tupel
 KEY: TTree	Header;1	Header
 KEY: TTree	Description;1	Description
 KEY: TTree	BitFields;1	BitFields
 KEY: TTree	BonzaiHeader;1	BonzaiHeader
 KEY: TTree	EventTree;1	 EventTree
root [4] TTree* t = (TTree*) d->Get("EventTree");
root [5] t->ls()
OBJ: TTree	EventTree	 EventTree : 0 at: 0x39daee0
root [6] t->Print()
******************************************************************************
*Tree    :EventTree :  EventTree                                             *
*Entries :     3945 : Total =        44488570 bytes  File  Size =   21935252 *
*        :          : Tree compression factor =   1.36                       *
******************************************************************************
*Br    0 :EvtIsRealData : EvtIsRealData/I                                    *
*Entries :     3945 : Total  Size=      16472 bytes  One basket in memory    *
*Baskets :        0 : Basket Size=      27136 bytes  Compression=   1.00     *
*............................................................................*
*Br    1 :EvtNum    : EvtNum/i                                               *
*Entries :     3945 : Total  Size=      16430 bytes  One basket in memory    *
*Baskets :        0 : Basket Size=      27136 bytes  Compression=   1.00     *
*............................................................................*
*Br    2 :EvtRunNum : EvtRunNum/i                                            *
*Entries :     3945 : Total  Size=      16448 bytes  One basket in memory    *
*Baskets :        0 : Basket Size=      27136 bytes  Compression=   1.00     *
*............................................................................*
*Br    3 :EvtLumiNum : EvtLumiNum/I                                          *
*Entries :     3945 : Total  Size=      16454 bytes  One basket in memory    *
*Baskets :        0 : Basket Size=      27136 bytes  Compression=   1.00     *
*............................................................................*
*Br    4 :EvtBxNum  : EvtBxNum/I                                             *
*Entries :     3945 : Total  Size=      16442 bytes  One basket in memory    *
*Baskets :        0 : Basket Size=      27136 bytes  Compression=   1.00     *
*............................................................................*
<MANY OTHER BRANCHES>
*............................................................................*
root [7] 

Dear amadio,

Thanks for your test and reply. I realize I forget to precise one important point: I see this issue with the TBrowser.
Indeed if I open the tree like you did, I see everything filled like it should be.
However, if I navigate through the tree thanks to a TBrowser, then I have a lot of “Empty” histograms for ROOT verions 6.09 and 6.10 (didn’t test on 6.11).

Best,

Hugo

Hi Hugo,

I’ll investigate and let you know.

Cheers, Bertrand.

Hi,

So I tried, and the problem is not related to the TBrowser, but trying to draw some of the branches already fails, For example, this:

root [0] TFile f("tree.root", "read");
root [1] TDirectoryFile* d = (TDirectoryFile*) f.Get("tupel");
root [2] TTree* t = (TTree*) d->Get("EventTree");
root [3] t->Draw("METsigy2")
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [4]

Gives an “Empty” histogram. Maybe @pcanal or @Axel could help with this issue

Cheers, Bertrand.

Hi Bertrand,

Ok, thanks for investigating! Fixing this will be useful for at least 15 people :slight_smile:

Cheers,

Hugo

Hi Hugo,

The underlying problem is solved in the master and v6.10 patch branch (i.e. the upcoming 6.12/00 and 6.10/10.

The trigger for this problem is the fact that the TTree (very very oddly) was stored after being put in MakeClass mode; this is odd as TTree is MakeClass mode usually do not work very well for output/writing. [It is even odder as many of the branches, for example those containing a vector, do not work in MakeClass mode …]

Nonetheless the MakeClass-ness of the branch is supposed to be transient (but was not until the fix I made).

To work around the problem do:

t->SetMakeClass(false);

before doing anything with the TTree object.

Cheers,
Philippe.

Hi Philippe,

It’s working well with this workaround. Thanks for taking care of this!

Best,

Hugo

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