TTree::MakeClass example at Root user's manual

Hi, I’m very new with Root and I need to work with a tree generated from a Pythia+Delphes simulation.
So I was following the example … emakeclass, but I have found that there are several issues with it. First, I had to modify the .h file (I had to #define fMaxftracks 614), because it was giving to me this error:

/home/keiser/root/test/MyClass.h:49:38: error: use of undeclared identifier 'kMaxfTracks' UInt_t fTracks_fUniqueID[kMaxfTracks]; //[fTracks_]

And then, when I modify the Loop() method in the way that is done in the example, I got only one histogram (not two) and in addition the one I got is completely different to the histogram in the example. Could you help with this. I would also like to understand how the tree works, I mean, in the documentation, as far as I understand “entry” means event? but, what if I need to loop inside each event? How can I do that? so far, I haven’t found any good example that explain me this.

Thanks in advance