I just tried to draw 2D histograms with TCut in command line like:
TH2F *h= new TH2F(“h_foobar”,“h_foobar”,10,0., 600.,10,0.,600.);
TCut tcut = " foo > 600000. && bar > 600000."
tree->Draw(“foo/1000.:bar/1000.”,tcut);
this doesn’t work as I want.
Only when “foo” and “bar” are plotted, they must be divided by 1000. , but it seems they are also divided by 1000. in the evaluation of TCut.
i.e. actual cut executed in root is “foo/1000. > 600000. && bar/1000. > 600000.” .
On the other hand, when you draw 1D histogram like:
Thank you for your reply but I’m not sure your code can be the validation.
If the cut become “px/1000./1000.>0 && py /1000./1000. > 0.” or not your TCut make no difference.
[quote=“couet”]with the ntuple generate by simple.C I tried:
Sorry but I totally misunderstood the situation.
It doesn’t seem from the TCut.
With removing the variable from TCut the situation is the same.
My code automatically generate TCut and hisgtograms so I can’t upload my codes.
But I can reproduce the situation in command line.
Open the tree which name is “tmva” and
root [17] TCut tcut="(((region>=4)&&(IsNoLepton>=1)&&(30000.<=mT)&&(mT<=100000.)))*(weight)";
root [18] TH1F *h1 = new TH1F(“h1”,“h1”, 10,160.,1160.);
root [19] tmva->Draw(“MET_E/1000.>>h1”,tcut);
This success with the proper distribution.
root [20] TH2F *h = new TH2F(“h”,“h”, 10,160.,1160.,10,1800.,3800.);
root [21] tmva->Draw(“MET_E/1000.:meff/1000.>>h”,tcut);
This fails and all the MET_E are filled in overflow bin.
So it seems the /1000. doesn’t work in my situation