[ROOT] variable size two dimensional array

From: Hajime Nanjyo (nanjyo@icepp.s.u-tokyo.ac.jp)
Date: Thu Jul 08 2004 - 23:11:36 MEST

Dear ROOTers,

I have a trouble concerning a variable size two dimensional array.

I defined a class A with a member 'int    *aa[3];  //[n]'.
(A mamber 'int    n;' also included in the class A.)
A shared library was construced successfully for the ROOT I/O.
I could write or read a TTree in a TFile successfully
with the shared library but could not draw a histogram
with TTree::Draw("aa[][]") correctly in a ROOT interactive session.

Please help me to solve the problem.

By the way, I think it was useful if a syntax like
'int  (*aa)[3];//[n]' was supported in rootcint.
Is it possible?

Best Regards,


I used the ROOT at /afs/cern.ch/sw/root/v4.00.06/rh73_gcc32/root
under Red Hat Linux 7.3 with gcc version 3.2.

The simple code to illustrate the problem was attached.
Files listed below was included in it.
  A.h,A.C,ALinkDef.h  // for class A
  write.C             // to write class A to TFile
  read.C              // to read the TFile
  make.sh             // make shell scrip
  run.C               // for '.x run.C' in ROOT session

The content of the file make.sh was as follows.
rootcint -f ADict.C -c A.h ALinkDef.h

g++ -g --shared `root-config --cflags` `root-config --libs` \
-I. \
-o libData.so \
A.C ADict.C 

g++ -g -o write `root-config --cflags` `root-config --libs` \
write.C -L. -lData
g++ -g -o read `root-config --cflags` `root-config --libs` \
read.C -L. -lData

Run as follows.
source make.sh 
./write test.root
./read  test.root
#--> succesfully operated

ROOT [0] .x test.C
#--> 'tree->Draw("aa[][]");' didn't work.

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET