Alkass
1
Hello there
I am trying to get the ProjectionY, but I am facing an error ROOT message
Can’t call TH1::ProjectionY
although, I
#include "TH1.h"
in the begining of my code
My syntax is
TH1D* px = MetvsJetsTtbar->ProjectionY(“px”, 160, 180); // where firstYbin = 160 and lastYbin = 180
where MetvsJetsTtbar is a TH2D one
Any ideas?
Thanks
Alexis
brun
2
Are you really sure that MetvsJetsTtbar is a TH2D and not a TH1 ?
Rene
Alkass
3
Yes, I am absolutely sure .
For the history, I am using ROOT v 5.17/04
brun
4
Could you post the shortest possible RUNNING script reproducing the problem?
Rene
Alkass
5
Ok - I am attaching the .root and .cc files
Thanks in advance
Projection.cpp (593 Bytes)
test.root (54.5 KB)
Alkass
6
Oops - I posted wrong .cpp file. Here is the correct one
Sorry for that!
Projection.cpp (531 Bytes)
Alkass
7
I just found the problem
it is
TH2 MetvsJetsTtbar = (TH2)b->Get (“NJETSvsMETTtbar”);
and not
TH1 MetvsJetsTtbar = (TH1)b->Get (“NJETSvsMETTtbar”);
as I wrote…
Sorry for the trouble…
brun
8
I requested a RUNNINg script. Please post your data file too.
Rene
Alkass
9
My data file is the .root one I posted above. But as I said, I found the problem
Thanks again!