Please requesting kind assistance with my macro, don’t see nor get the errors.
The macro, read in two histograms one fitted with a normal gaussian + exponential called hdndm and the other with a crystal ball function + exponential called CBh_dndm.
Before the hdndm worked perfectly but now somehow not printing on the canvas.
Also with the addition of the crystal ball + exponential, got crash.
Section by section seems ok but together getting crash. Here is some of the message:
There was a crash (#6 0xf7191d2b in SigHandler(ESignals) #0 0xf76e0425 in __kernel_vsyscall () #1 0xf6d57ee3 in __waitpid_nocancel () from /usr/lib/libc.so.6 #2 0xf6cdda5e in do_system () from /usr/lib/libc.so.6 #3 0xf718bfdb in TUnixSystem::Exec(char const*) ()
I have attached the code and the .root file for your most valuable assistance.
Sorry for the late response. I did compile, wow so many errors came up, eg
/./InitialCBnormfit.C:208:31: error: too many decimal points in number
cbfit->SetParameters(16,1.0,1.5.,3.097,0.07,100.,2.);
^
/./InitialCBnormfit.C:312:31: error: too many decimal points in number
cbfit->SetParameters(16,1.0,1.5.,3.097,0.07,100.,2.);
^
/./InitialCBnormfit.C: In function ‘double CBFunction(double*, double*)’:
/./InitialCBnormfit.C:26:35: error: ‘TMath’ has not been declared
double A = pow(n/fabs(alpha),n)TMath::Exp(-pow(fabs(alpha),2)/2.);
^
/./InitialCBnormfit.C:32:16: error: ‘TMath’ has not been declared
val = normTMath::Exp(-0.5pow(k,2));//val = Norm * exp( -pow(x-x_mean,2) / (2.0pow(sigma,2)));
^
/./InitialCBnormfit.C: In function ‘double CBFunction_bkg(double*, double*)’:
/./InitialCBnormfit.C:50:35: error: ‘TMath’ has not been declared
double A = pow(n/fabs(alpha),n)TMath::Exp(-pow(fabs(alpha),2)/2.);
^
/./InitialCBnormfit.C:56:16: error: ‘TMath’ has not been declared
val = normTMath::Exp(-0.5pow(k,2));//val = Norm * exp( -pow(x-x_mean,2) / (2.0pow(sigma,2)));
^
/./InitialCBnormfit.C:71:7: error: ‘TMath’ has not been declared
if( TMath::IsNaN(val) )
^
/./InitialCBnormfit.C: At global scope:
/./InitialCBnormfit.C:84:54: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
void InitialCBnormfit(const char fname = “hnorm.root”)
^
/./InitialCBnormfit.C:87:3: error: ‘gStyle’ was not declared in this scope
gStyle->SetOptStat(kFALSE);
^
/./InitialCBnormfit.C:91:3: error: ‘TFile’ was not declared in this scope
TFile *file = TFile::Open(“hnorm.root”);
^
/./InitialCBnormfit.C:91:10: error: ‘file’ was not declared in this scope
TFile *file = TFile::Open(“hnorm.root”);
^
/./InitialCBnormfit.C:91:17: error: ‘TFile’ is not a class or namespace
TFile *file = TFile::Open(“hnorm.root”);
But as you suggested I will added in the #includes
I will update after I did it.