21 Error(
"exec1",
"gPad is null, you are not supposed to run this macro");
25 int event = gPad->GetEvent();
26 if (event != 11)
return;
27 int px = gPad->GetEventX();
28 TObject *select = gPad->GetSelected();
30 if (select->InheritsFrom(TH1::Class())) {
31 TH1 *h = (TH1*)select;
32 Float_t xx = gPad->AbsPixeltoX(px);
33 Float_t x = gPad->PadtoX(xx);
34 Int_t binx = h->GetXaxis()->FindBin(x);
35 printf(
"event=%d, hist:%s, bin=%d, content=%f\n",event,h->GetName(),binx,h->GetBinContent(binx));