jal
December 7, 2011, 9:57am
1
Hi - I’m trying to loop over a bunch of rootfiles containing histograms.
The histograms are stored in a THashList
I get this error in the macro attached -
THashList.h:43: error: ‘THashList& THashList::operator=(const THashList&)’ is private
everything is fine if I do the steps in the command line. Any thoughts?
mope.cpp (1.06 KB)
pcanal
December 9, 2011, 5:09pm
2
THashList last;
....
last = (THashList*)gDirectory->Get("allhists");
is wrong (and CINT is being to permissive. You meant to use:
THashList *last;
last = (THashList*)gDirectory->Get("allhists");
Cheers,
Philippe.
jal
December 9, 2011, 5:20pm
3
Hi Philippe, thank you for taking a look at that.
I have already done what I wanted (in a less elegant way), but to understand better I tested your change; I now find the error:
g++ -c mope.cpp -I$ROOTSYS/include -pthread -m64 -I/…/include
mope.cpp:35: error: ‘allhists’ was not declared in this scope
I attach two input files if you would like to test.
Regards.
hists_0269ab.root (31 KB)
hists_0268ab.root (30.9 KB)
pcanal
December 9, 2011, 5:29pm
4
[quote]mope.cpp:35: error: ‘allhists’ was not declared in this scope[/quote]What’s on line 35? Is alllists used as a C++ variable when it should be used as a quoted string?
Philippe.
jal
December 9, 2011, 5:36pm
5
THashList last;
last = (THashList )gDirectory->Get(“allhists”);
pcanal
December 9, 2011, 5:41pm
6
HI,
There is something I can not understand. If line 35 is either of those 2 lines, I don’t see anyway for g++ to complain about allhists being not declared.
Thanks,
Philippe.