I am trying to make my own root tree and fill it with some numbers. But it doesn’t seem to fill with the numbers I assign. I have attached the code below :
What is it am I doing wrong?
[code]//
// Sample for accessing the Picasso data
//
// Sujeewa Kumaratunga 07/06/2008
//
//
Ideally I would like to have my code like this (as Int_t main) without a name, because I will eventually compile them all using a Makefile. But even if I give the macro a name and run it with ACLiC I still get an error as in this time the tree doesn’t properly fill - it seems to take the first number that was assigned to the first leaf and assign it to all subsequent leaves.
Please note that since you are using a class, you must generate a dictionary for that class and compile the class. Note that ACliC will do that for you.
I can not reproduce your problem when using ACLiC. After renaming your function simple01 and the file simple01.C, I did and got:
[code][pcanal@hennequeville tmp]$ root.exe -b -l
root [0] .x simple01.C++
Info in TUnixSystem::ACLiC: creating shared library /var/tmp/./simple01_C.so
/var/tmp/./simple01.C: In function ‘int simple01()’:
/var/tmp/./simple01.C:64: warning: control reaches end of non-void function
ii = 0
ii = 1
ii = 2
ii = 3
ii = 4
ii = 5
ii = 6
ii = 7
ii = 8
ii = 9
*Tree :StreeVarPhy: Stuple tree Variables, Physics *
*Entries : 10 : Total = 2535 bytes File Size = 0 *
: : Tree compression factor = 1.00 *
*Branch :PhysVariables *
*Entries : 10 : BranchElement (see below) * …
*Br 0 :Smaxamp : *
*Entries : 10 : Total Size= 696 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 * …
*Br 1 :Smaxampbin : *
*Entries : 10 : Total Size= 714 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 * …
(int)6693
root [1] .q
[pcanal@hennequeville tmp]$ root.exe -b -l TreeTest.root
root [0]
Attaching file TreeTest.root as _file0…
Warning in TClass::TClass: no dictionary for class STKPhy is available
root [1] StreeVarPhy->Scan()
Ok, yes you are right, when given a name and ACliCed it will work.
But I also found another way around, ie, to “generate a dictionary for that class and compile the class” as you said without ACliCing the whole macro. I just put my class in a separate header file and loaded that with an ACliC, ie .L Var.C++ and then just ran my macro without ACliCing.
My problem was I could not ACliC my macro. Because the actual code I use relies on existing libraries, and if I try to compile my macro stand alone, as in ACliC it, it will throw a million errors about the existing libraries. And if I try to compile it together with the existing framework using a make install, the whole make install will fault.