Problem with MakeClass

Hi,

I am using MakeClass option in root and named “Zee” to loop over the Zee ntuples. I get Zee.C and Zee.h. But When I do
root>.L Zee.C
root>Zee t
Warning in TClass::TClass: no dictionary for class AttributeListLayout is available
Warning in TClass::TClass: no dictionary for class pair<string,string> is available
no. of entries in fullreco (after file 1) 1250

*********upto this it is showing me the number of evts

root [2] t.Loop()
In function Loop nentries 1250
Events processed = 0
Error: Incorrect use of operator[] Zee.C:1375:
*** Interpreter error recovered ***
The thing is that Line 1375 in Zee.C is commented already. Its in commented region. Then why root reads that. What could be the reason??

Hi,

Try with .L Zee.C+

Cheers,
Philippe

Hi,

after doing .L Zee.C+ it is giving me the error

after some warnings of unused variables,

/afs/cern.ch/user/b/bawa/test/./Zee.h: At global scope:
/afs/cern.ch/user/b/bawa/test/./Zee.h:3021: warning: unused parameter 'entry’
g++: /afs/cern.ch/user/b/bawa/test/./Zee_C_ACLiC_dict.o: No such file or directory
Error in : Compilation failed!

But .L Zee.C is fine only when I run over the loop it is objecting about the commented lines. I am using rootv5.22 in lxplus

Hi,

You might be omitting part of the error message.

Anyway, just let me know where you root file and makeclass file are on lxplus and I willl take a look.

Cheers,
Philippe.

Hi,

The “.L Zee.C+” does indeed point to the error. When looking at the beginning of the output you will see:

scratch1/pcanal/test/bana/test/./Zee.h: In constructor `Zee::Zee(TTree*)': /scratch1/pcanal/test/bana/test/./Zee.h:1802: error: `cout' is not a member of `std' /scratch1/pcanal/test/bana/test/./Zee.h:1802: error: `FullReco0' undeclared (first use this function) /scratch1/pcanal/test/bana/test/./Zee.h:1802: error: (Each undeclared identifier is reported only once for each function it appears in.) /scratch1/pcanal/test/bana/test/./Zee.h: At global scope: /scratch1/pcanal/test/bana/test/./Zee.h:3021: warning: unused parameter 'entry' In file included from /scratch1/pcanal/test/bana/test/./Zee_C_ACLiC_dict.h:33, from /scratch1/pcanal/test/bana/test/./Zee_C_ACLiC_dict.cxx:16: /scratch1/pcanal/test/bana/test/./Zee.C: In member function `virtual void Zee::Loop()': /scratch1/pcanal/test/bana/test/./Zee.C:1324: error: `cout' is not a member of `std' /scratch1/pcanal/test/bana/test/./Zee.C:1330: error: `cout' undeclared (first use this function) /scratch1/pcanal/test/bana/test/./Zee.C:1444: error: `Ph_E' undeclared (first use this function) /scratch1/pcanal/test/bana/test/./Zee.C:1445: error: `Ph_p_T' undeclared (first use this function) /scratch1/pcanal/test/bana/test/./Zee.C:1446: error: `Ph_phi' undeclared (first use this function)

The first few errors are solved by adding #include
Then there is one use of a CINT shortcut (where you use FullReco0 to refer to the tree, which is okay in CINT but no okay with the compiler).

More importantly is the line:/scratch1/pcanal/test/bana/test/./Zee.C:1444: error: `Ph_E' undeclared (first use this function)

And indeed I do not see Ph_E defined anyway in your code or the MakeClass code. The only related name I see is Ph_Egamma which is not an array. Similarly, There is a lot more use of Ph_?? and Mu_??? which refers to non-existent entities.

Cheers,
Philippe.

PS. And yes CINT does indeed get the line of the error wrong. To improve the diagnosis disable CINT’s optimization by doing:

thanks