00001
00002 void exec1()
00003 {
00004
00005
00006
00007
00008
00009
00010
00011
00012 int event = gPad->GetEvent();
00013 if (event != 11) return;
00014 int px = gPad->GetEventX();
00015 TObject *select = gPad->GetSelected();
00016 if (!select) return;
00017 if (select->InheritsFrom(TH1::Class())) {
00018 TH1 *h = (TH1*)select;
00019 Float_t xx = gPad->AbsPixeltoX(px);
00020 Float_t x = gPad->PadtoX(xx);
00021 Int_t binx = h->GetXaxis()->FindBin(x);
00022 printf("event=%d, hist:%s, bin=%d, content=%f\n",event,h->GetName(),binx,h->GetBinContent(binx));
00023 }
00024 }
00025