Hi everyone,
I am having an issue that is literally making me go crazy as I have absolutely no idea why it is happening. Basically, I plot 3 TGraph2D on the same canvas using this simple piece of code:
TH3F *frame3d = new TH3F("frame3d","",10,-1.2,1.2,10,-1.2,1.2,10,-1,max_npe);
frame3d->Draw();
// draw pixels
TGraph2D *g1 = new TGraph2D("pixels","",size_vec,x_arr,y_arr,npe_arr);
g1->SetMarkerStyle(20);
g1->Draw("PCOLZ SAME");
//draw COG
TGraph2D *g2 = new TGraph2D(1);
g2->SetPoint(0, 0.5, 0.5, max_npe);
g2->SetMarkerStyle(2);
g2->Draw("P SAME");
which gives me this plot:
where TGraph2D *g1
gives me the colored points and TGraph2D *g2
gives me the cross. So far so good.
However, if I change g2->SetPoint(0, 0.5, 0.5, max_npe);
to g2->SetPoint(0, -0.5, 0.5, max_npe);
or basically changes any of the x or y coordinate value of my point to a negative value, the cross is not plotted anymore. How is it possible that a simple change of sign causes such issue? I do not get any error message from ROOT so I am a bit clueless now. I thought it my be a problem of defined axis limits but those are already specified in the TH3F object. Could it be due to the binning of that histogram?
Thanks in advance