Combining ntuples

Update: problem solved. This thread can be deleted.

Hi all,

I’m new to ROOT, and I’m trying to take ntuples from a number of files, combine them into a single one, and make a histogram from one of the variables. I’m attempting to do this by running ntp1->MakeClass(“myclass”) (where ntp1 is of course the ntuple) and then modifying the constructor in myclass.h. However, when I attempt to load MyClass.C (before changing the constructor) by means of .L myclass.C and then try to instantiate it by myclass *a = new myclass(), it throws the error

[quote]Error: Symbol ClHBD is not defined in current scope FILE:myclass.h LINE:547
Error: operator ‘/’ divided by zero FILE:myclass.h LINE:547[/quote]

Which is due to this line:

[quote] Char_t ClHBD/B0ToPi0Pi0; [/quote]/nfs/farm/g/ec/u08/users/mallen/analysis30/tclfiles/Data/B0ToPi0Pi0_R18/

When I try to replace the ‘/’ with an ‘_,’ the interpreter doesn’t seem to like that, either. What should I do?

Danny Neumann, lost summer intern

By “which is due to this line” I mean “which is due to this variable.”

I do not understand thsi posting. Could you give a concrete script with the data files (or pointers) to data files.
Note that if you simply want to combine two files into one, you should do
hadd -f result.root file1.root file2.root
where hadd is an executable in $ROOTSYS/bin/hadd


Char_t ClHBD/B0ToPi0Pi0;This problem is most likely due to the name you gave to the branch. Eventhough all characters can be used to name a branch, using characters that are illegal within a C++ variable name (/,+,*,-, etc …) will prevent the use of the branch within the automated tools (TTree::Draw, MakeClass, etc.).