Hi,
I upgraded to ROOT v5.24 today and ran into some problems with the TNtuple Class. The problem is that my TNtuple does not seem to get filled when using v5.24. If I am using v5.22 the Ntuple gets filled. Below is the simple code I am using, compiled with both libraries. The program's output is given too. For comparison I also fill a Tree, the filling of the Tree seems to happen without problem.
This is the relevant piece of my code::
cout<< "Reading file :: "<< filename<<endl; datafile = new TFile(outfile,"RECREATE"); datantuple = new TNtuple("datantuple",filebase,"a1"); dattree = new TTree("dattree",filebase); dattree->Branch("a1",&a1); nlines=0; in.open(filename); while (1) { in>> a1 ; if (!in.good()) break; datantuple->Fill(a1); dattree->Fill(); nlines++; } printf(" found %d points\n",nlines); cout<< dattree->GetEntries()<< " Tree entries"<<endl; cout<< datantuple->GetEntries()<< " Ntuple entries"<<endl;
I compile it using:
g++ -Wall -W -g -DDEBUG -fPIC -Wall -W -g -DDEBUG -fPIC -pthread
-m64 -I/home/products/root/root_v5.24.00/include -O3
-L/home/products/root/root_v5.24.00/lib -lCore -lCint -lRIO -lNet -lHist
-lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics
-lMathCore -lThread -lGui -pthread -lm -ldl -rdynamic readdata_deb.C -o
readdata_deb
The output then gives:
./readdata_deb -f ./testt.txt
Reading file :: ./testt.txt
found 1000 points
1000 Tree entries
0 Ntuple entries
--> The Ntuple is empty !
If I compile it using the v5.22 libs::
g++ -Wall -W -g -DDEBUG -fPIC -Wall -W -g -DDEBUG -fPIC -pthread
-m64 -I/home/products/ROOT/new/include/root -O3
-L/home/products/ROOT/new/lib/root -lCore -lCint -lRIO -lNet -lHist
-lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics
-lMathCore -lThread -lGui -pthread -lm -ldl -rdynamic readdata_deb.C -o
readdata_deb
The output now is:
Reading file :: ./testt.txt
found 1000 points
1000 Tree entries
1000 Ntuple entries
--> The Ntuple has 1000 entries
Could somebody explain what is going on ?
Thanks a lot for your time,
Arne. Received on Fri Jul 10 2009 - 19:09:49 CEST
This archive was generated by hypermail 2.2.0 : Fri Jul 10 2009 - 23:50:02 CEST