Dear Philippe,
As I have already mentioned, there seems to be a problem with tree->DropBaskets() in root_v5.26/00 and the patch release 5.26/00a.
After a very long testing time where I could often not even reproduce the problem, and after a lot of trial and error, I can finally
reproduce the conditions under which I get the error.
As I have already mentioned, when I keep the line “datatree->DropBaskets();” in method “XGCProcesSet::FillDataArrays()” shown earlier,
I get the following debugging output:
normalizing data using method <quantile>...
------XGCProcesSet::FillDataArrays------..
2:i= 2001 x= 111 y= 15 inten= 704.3
2:i= 2002 x= 112 y= 15 inten= 852.3
2:i= 2003 x= 113 y= 15 inten= 908.8
2:i= 2004 x= 114 y= 15 inten= 721.5
2:i= 2005 x= 115 y= 15 inten= 3913.3
2:i= 2006 x= 116 y= 15 inten= 1804.8
2:i= 2007 x= 117 y= 15 inten= 798.9
2:i= 2008 x= 118 y= 15 inten= 776.1
2:i= 2009 x= 119 y= 15 inten= 1370.1
2:i= 2010 x= 120 y= 15 inten= 765.4
2:i= 2011 x= 121 y= 15 inten= 1027.1
2:i= 2012 x= 122 y= 15 inten= 983.9
2:i= 2013 x= 123 y= 15 inten= 837.1
2:i= 2014 x= 124 y= 15 inten= 737.1
2:i= 2015 x= 125 y= 15 inten= 1052
2:i= 2016 x= 0 y= 16 inten= 20181.1
2:i= 2017 x= 1 y= 16 inten= 7760.5
2:i= 2018 x= 2 y= 16 inten= 948.7
2:i= 2019 x= 3 y= 16 inten= 912.6
1:k= 0 *datatree[k]= 0x6316dc0 datatree[k]= TestA1.cel
...
finished filling <4> arrays.
computing common mean...
2:k= 0 *datatree[k]= 0x6316dc0 datatree[k]= TestA1.cel
------XGCProcesSet::FillDataTree(newtree)------
*oldtree= 0x6316dc0 oldtree= TestA1.cel
*newtree= 0x635ca70 newtree= TestA1.cqu
i= 2001 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2002 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2003 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2004 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2005 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2006 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2007 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2008 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2009 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2010 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2011 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2012 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2013 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2014 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2015 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2016 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2017 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2018 x= 8 y= -1 inten= -1 inten[ij]= 0
i= 2019 x= 8 y= -1 inten= -1 inten[ij]= 0
------XPreProcesSet::AddDataTreeInfo------
As you see I cannot fill “newtree” with “inten[ij]” since there is a problem with “oldtree” which is identical to “datatree[0]”.
However, when I delete the line “datatree->DropBaskets();” in method “XGCProcesSet::FillDataArrays()” I get the following correct
debugging output:
normalizing data using method <quantile>...
------XGCProcesSet::FillDataArrays------..
2:i= 2001 x= 111 y= 15 inten= 704.3
2:i= 2002 x= 112 y= 15 inten= 852.3
2:i= 2003 x= 113 y= 15 inten= 908.8
2:i= 2004 x= 114 y= 15 inten= 721.5
2:i= 2005 x= 115 y= 15 inten= 3913.3
2:i= 2006 x= 116 y= 15 inten= 1804.8
2:i= 2007 x= 117 y= 15 inten= 798.9
2:i= 2008 x= 118 y= 15 inten= 776.1
2:i= 2009 x= 119 y= 15 inten= 1370.1
2:i= 2010 x= 120 y= 15 inten= 765.4
2:i= 2011 x= 121 y= 15 inten= 1027.1
2:i= 2012 x= 122 y= 15 inten= 983.9
2:i= 2013 x= 123 y= 15 inten= 837.1
2:i= 2014 x= 124 y= 15 inten= 737.1
2:i= 2015 x= 125 y= 15 inten= 1052
2:i= 2016 x= 0 y= 16 inten= 20181.1
2:i= 2017 x= 1 y= 16 inten= 7760.5
2:i= 2018 x= 2 y= 16 inten= 948.7
2:i= 2019 x= 3 y= 16 inten= 912.6
1:k= 0 *datatree[k]= 0x6319850 datatree[k]= TestA1.cel
...
finished filling <4> arrays.
computing common mean...
2:k= 0 *datatree[k]= 0x6319850 datatree[k]= TestA1.cel
------XGCProcesSet::FillDataTree(newtree)------
*oldtree= 0x6319850 oldtree= TestA1.cel
*newtree= 0x6358640 newtree= TestA1.cqu
i= 2001 x= 111 y= 15 inten= 704.3 inten[ij]= 430.7
i= 2002 x= 112 y= 15 inten= 852.3 inten[ij]= 663.8
i= 2003 x= 113 y= 15 inten= 908.8 inten[ij]= 730.55
i= 2004 x= 114 y= 15 inten= 721.5 inten[ij]= 462.175
i= 2005 x= 115 y= 15 inten= 3913.3 inten[ij]= 3228.88
i= 2006 x= 116 y= 15 inten= 1804.8 inten[ij]= 1468.62
i= 2007 x= 117 y= 15 inten= 798.9 inten[ij]= 593.725
i= 2008 x= 118 y= 15 inten= 776.1 inten[ij]= 556.1
i= 2009 x= 119 y= 15 inten= 1370.1 inten[ij]= 1118.15
i= 2010 x= 120 y= 15 inten= 765.4 inten[ij]= 538.15
i= 2011 x= 121 y= 15 inten= 1027.1 inten[ij]= 836
i= 2012 x= 122 y= 15 inten= 983.9 inten[ij]= 802.425
i= 2013 x= 123 y= 15 inten= 837.1 inten[ij]= 645.35
i= 2014 x= 124 y= 15 inten= 737.1 inten[ij]= 489.925
i= 2015 x= 125 y= 15 inten= 1052 inten[ij]= 0
i= 2016 x= 0 y= 16 inten= 20181.1 inten[ij]= 0
i= 2017 x= 1 y= 16 inten= 7760.5 inten[ij]= 0
i= 2018 x= 2 y= 16 inten= 948.7 inten[ij]= 0
i= 2019 x= 3 y= 16 inten= 912.6 inten[ij]= 0
For a very long time I did not understand why I get these different results, so I looked at the differences in the source code for
TTree.cxx and TBranch.cxx between root_v5.26/00a and root_v5.24/00. I realized that some member variables of TBranch have been removed,
so I had the idea that the problem could be related to the fact that “datatree” was reading the trees from a ROOT file which I have
created with root_v5.20/00. This file is named “DataTest3_cel.root”. For this reason I have re-created this file with root_v5.26/00a
with the name “DataTest3_52600a_cel.root”. And indeed, using this new data file I can now use “datatree->DropBaskets();” and get the
correct results.
If this interpretation turns out to be correct, then there is a severe problem when using code containing “tree->DropBaskets()” to
read trees from ROOT files which were created with earlier versions of ROOT.
Since I am not sure if it is possible to demonstrate this problem with a simple macro, I have decided to attach the relevant files
and the source code in a zipped directory “dropbaskets.tar.gz”. After unzipping the directory you need first to change to subdirectory
“src” and compile the source code by typing “make”. Afterwards, go back to directory “dropbaskets” and start root_v5.26/00a.
Within root you need to type the following (which is also shown in macro “macro4XPSTest3.C”):
.L macro4XPSTest3.C
Init()
RMATest3("tmp_Test3A_rma", "DataTest3_cel.root")
RMATest3("tmp_Test3B_rma", "DataTest3_52600a_cel.root")
Since the source code “XPSPreProcessing.cxx” contains debugging code you should get the same output shown above.
Please let me know if you can reproduce my findings.
Furthermore, if this turns out to be a root problem and not a problem with my code, I would really appreciate if you could find
a solution so that trees from old ROOT files could be read with code using “tree->DropBaskets()”.
Best regards
Christian
dropbaskets.tar.gz (1.32 MB)