Dear Root experts,
I have a normalized histogram of my signal that I got it from MC and I would like to use it to fit data.
In my code I create a TF1 as follows:
TF1* PsiSignal = new TF1("J/Psi Signal", "[0]*(h_MCPsiMass->GetBinContent(h_MCPsiMass->FindBin(*X)))", PsiLeftCut, PsiRightCut);
In fact, I would like to use the shape of the signal to fit the data. Here [0] is supposed to be my normalization factor.
I can compile the code but I get the following message when running:
FindBin is unknown.
h_MCPsiMass is unknown.
GetBinContent is unknown.
Error in TFormula::Eval: Formula is invalid and not ready to execute
I am pretty sure I am not doing it right, but I am hoping you should show me the right way to use a normalized histogram to fit data.
As always, thank you in advance
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided