[Solved] Fit TH1D with Poisson Function

I think the problem is in the “x range” of your histogram. From your picture, I can see that “x_max = 10.e-6” and the Poisson distribution expects “x_max >= 1” (so, in principle you should also have “mean >= 0.5”).
You could try to “scale” your “x range”:

{
  double xmin = 0.;
  double xmax = 10.e-6;
  TF1 *f = new TF1("f", "[0] * TMath::Poisson((x/[2]), ([1]/[2]))", xmin, xmax);
  double constant = 160.;
  double mean = 1.5e-6;
  double xscaling = 2.e-7;
  f->SetParameters(constant, mean, xscaling);
  f->SetParNames("Constant", "Mean", "XScaling");
  f->SetNpx(1000);
  f->Draw();
  double integral = f->Integral(xmin, xmax);
  std::cout << "integral = " << integral << std::endl;
  std::cout << "scaled integral (constant) = " << integral / xscaling << std::endl;
}