How to use complex numbers in ROOT minuit fitting?

Dear friends,

I have recently started to use ROOT. I am fitting some data to some theoretical expressions which have complex entries. When i use MINUIT, it gives some error which is following:

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x may3113pra6.C
Error: cannot open file “Tcomplex.h” may3113pra6.C:12:
*** Interpreter error recovered ***

I am attaching my code with this message. I shall be much obliged if anybody help me to remove this error.

Thanks and regards,

Gauhar
may3113pra6.C (681 KB)

#include “TComplex.h” // why do you put it here if you do NOT use the TComplex class at all?
#include // std::abs
#include // std::log, std::pow, std::sqrt
#include // std::complex

Also, in your source code, change “abs” into “std::abs”, “log” into “std::log”, “pow” into “std::pow”, “complex” into “std::complex”, “Log” into “TMath::Log” (or better into “std::log”) and “Sqrt” into “TMath::Sqrt” (or better into “std::sqrt”).

Dear friend Wile E. Coyote,

Many thanks for your help. The code is running now. Actually i know little about ROOT and C++. Thanks again!

Best regards,

Gauhar