TMath::Poisson function

I’m trying to create a macro to generate a histogram using a Poisson function using a user defined mean. I can get the program to let the user define the mean, however when plugging the mean into the predefined function
"TMath::Poisson(x,mean)", it says that the parameter doesn’t exist. I cannot get the function to recognize the user defined mean as a numerical value. I’ve tried all the ways I could think of to fix the code and i feel that I’m missing just one small detail that’s keeping me from getting the macro to work correctly. Help is greatly appreciated. This is the code I’ve come up with that I keep coming back to because my changes do not work.

Double_t dr = 0.0;
cout << "Enter Mean " << endl;
cin >> dr;
cout << "Mean = " << dr << endl;
		TF1 *f1 = new TF1("f1","TMath::Poisson(x,dr)",0,200);
		TH1F *h1 = new TH1F("h1","Poisson",1000,0,200);
	return 0;

Everything works fine up to defining the function f1. Thanks for the help.


if you want to mass the mean as a parameter to the TF1 do:

TF1 *f1 = new TF1("f1","TMath::Poisson(x,[0])",0,200);