TH1D * myHist = 0; double test(double in = 0) { if (!myHist) return 0; return myHist->GetBinContent(myHist->FindBin(in)); }