Candidate Function, the one I'm calling, ROOT not processing

Error: Function DQBonn(&q,NULL) is not defined in current scope FILE:GE_from_GQ.C LINE:51
Possible candidates are…
filename line:size busy function type and name
Bonn.C 145:16 0 public:Double_t DQBonn(Double_t* p, Double_t* par);

Well, it looks to me like Root found the function that I’m looking for… So why won’t it process it? My file that I include at the top of the file I’m running is called “Bonn.C” and it is simply a list of variables and functions.
The file that I’m running is simply including the file “Bonn.C” and also includes , , and

I set up and ‘ifstream’ instance to read in values from a file, then I use the values to make calculations with the file that has all my functions…

WHAT THE HECK IS THE PROBLEM???

#include “Bonn.C”
#include

using std::cout;
using std::cin;
using std::ios;
using std::cerr;
using std::endl;

#include

using std::ofstream;
using std::ifstream;
using std::setw;

//gROOT->Reset();
gStyle->SetOptTitle(0);
gStyle->SetFillColor(10);

#include
#include

const Double_t fm2GeV = 0.197;

int GE_from_GQ() {

float q2, g1, g2;

gStyle->SetOptTitle(0);
gStyle->SetFillColor(10);
gStyle->SetOptStat(0);

ifstream inFile1(“GQ_Chi.dat”,ios::in);

if( !inFile1){
cerr<<“File not found, look again”<<endl;
exit(1); }

float *par;
float Q2[9], GQ[9], GQerr[9], GEN[9], GENerr[9]={0.0}, DQ[9], DQerr[9];
float dum1, dum2, dum3, q, dipole;

for (int i=0;i<9>> dum1 >> GQ[i] >> dum2 >>GQerr[i];
q=fm2GeVdum1;
dipole = 1/(1+q
q/0.71)**2;
Q2[i]=qq;
DQ[i]=DQBonn(&q,par);
GEN[i]=2
GQ[i]/DQ[i] - dipole;
GENerr[i]=2*GQerr[i]/DQ[i];
}

TCanvas *c1 = new TCanvas(“c1”,"",100,100,600,700);
c1->SetFillColor(10);
h= new TH2F(“h”,"",100,0,1.8,100,0.,0.1);
h->SetYTitle(“G_{E}^{n}”);
h->SetXTitle(“Q^{2} (GeV/c)^{2}”);
h->Draw();

TGraph* GrGEn = new TGraphErrors(9,Q2,GEN,0,GENerr);

GrGEn->SetMarkerStyle(21); //square closed
GrGEn->Draw(“P”);

return 0;
}

All of this is running on Root v3.10/02 on MAC OSX 10.3.8 or 9

Double_t fm2GeV = 0.197;
Double_t Pi = 3.14;
Double_t md = 1.8756;
Double_t mp = 0.9383;

Double_t C[11] = {0.88472985,-0.26408759,-0.044114404,-14.397512,85.591256,-318.76761,
703.36701,-900.49586,661.45441,-259.58894,0.0};
Double_t D[11] = {0.022623762,-0.50471056,0.56278897,-16.079764,111.26803,-446.6749,
1098.5907,-1611.4995,0,0,0};
Double_t gamma = 0.2315380;
Double_t m0 = 0.9;
Double_t m[13] = {0,0,0,0,0,
0,0,0,0,0,
0,0,0};

Double_t SwaveBonnR(Double_t *r, Double_t *par) {

C[10] = 0.0;
Double_t ur = 0.0;
for (int i = 0; i < 10; i++) C[10] -= C[i];

for (int i = 0; i < 11; i++ ) {
m[i] = gamma + i*m0;
ur += C[i]*exp(-m[i]*r[0]);
}

return ur;

}

Double_t DwaveBonnR(Double_t *r, Double_t *par) {

Double_t wr = 0.0;
Int_t n;
D[8] = D[9] = D[10] = 0.0;

for (int i = 0; i < 13 ; i++)
m[i] = gamma + i*m0;

n = 8;
for (int i = 0; i < n; i++)
D[n] -= m[n]*m[n]/(m[n+2]*m[n+2]-m[n]*m[n])/(m[n+1]*m[n+1]-m[n]m[n])
(m[n+1]*m[n+1]*m[n+2]*m[n+2]*D[i]/m[i]/m[i] -
(m[n+1]*m[n+1]+m[n+2]*m[n+2])*D[i] + D[i]*m[i]*m[i]);

n = 9;
for (int i = 0; i < n-1; i++)
D[n] -= m[n]*m[n]/(m[n]*m[n]-m[n+1]*m[n+1])/(m[n]*m[n]-m[n-1]m[n-1])
(m[n-1]*m[n-1]*m[n+1]*m[n+1]*D[i]/m[i]/m[i] -
(m[n-1]*m[n-1]+m[n+1]*m[n+1])*D[i] + D[i]*m[i]*m[i]);

n = 10;
for (int i = 0; i < n; i++)
D[n] -= D[i];

for (int i = 0; i < 11; i++)
wr += D[i]*exp(-m[i]r[0])(1+3/m[i]/r[0]+3/(m[i]*r[0])**2);

return wr;
}

Double_t SDensityBonnP(Double_t *p, Double_t *par) {

C[10] = 0.0;
Double_t ur = 0.0;
Double_t q = p[0]/fm2GeV;

for (int i = 0; i < 10; i++) C[10] -= C[i];

for (int i = 0; i < 11; i++ ) {
m[i] = gamma + im0;
ur += C[i]/(q
q+m[i]*m[i]);
}

return 2/Pi*(ur)2*fm2GeV3;

}

Double_t DDensityBonnP(Double_t *p, Double_t *par) {

Double_t q = p[0]/fm2GeV;
Double_t wr = 0.0;
Int_t n;
D[8] = D[9] = D[10] = 0.0;

for (int i = 0; i < 13 ; i++)
m[i] = gamma + i*m0;

n = 8;
for (int i = 0; i < n; i++)
D[n] -= m[n]*m[n]/(m[n+2]*m[n+2]-m[n]*m[n])/(m[n+1]*m[n+1]-m[n]m[n])
(m[n+1]*m[n+1]*m[n+2]*m[n+2]*D[i]/m[i]/m[i] -
(m[n+1]*m[n+1]+m[n+2]*m[n+2])*D[i] + D[i]*m[i]*m[i]);

n = 9;
for (int i = 0; i < n-1; i++)
D[n] -= m[n]*m[n]/(m[n]*m[n]-m[n+1]*m[n+1])/(m[n]*m[n]-m[n-1]m[n-1])
(m[n-1]*m[n-1]*m[n+1]*m[n+1]*D[i]/m[i]/m[i] -
(m[n-1]*m[n-1]+m[n+1]*m[n+1])*D[i] + D[i]*m[i]*m[i]);

n = 10;
for (int i = 0; i < n; i++)
D[n] -= D[i];

for (int i = 0; i < 11; i++)
wr += D[i]/(q*q+m[i]*m[i]);

return 2/Pi*(wr)2*fm2GeV3;

}

Double_t ParProbability(Double_t *p, Double_t *par) {

return (SDensityBonnP(p,par)-DDensityBonnP(p,par))/
(SDensityBonnP(p,par)+DDensityBonnP(p,par));
}

Double_t SphBesselJ (Double_t x, Int_t n) {

if (n == 0)
return (x == 0) ? 1 : sin(x)/x;
if (n == 2)
return (x == 0) ? 0 : -sin(x)/x +3sin(x)/pow(x,3)-3cos(x)/pow(x,2);
return 1;

};

Double_t DEBonn (Double_t *p, Double_t *par) {

Double_t intval = 0.0;
Double_t r = 0.001;
Double_t dr = 0.02;
Double_t x;
Double_t q = p[0]/fm2GeV;

for ( int i = 0 ; i < 3000; i++,r += dr){
x = SphBesselJ(qr/2,0);
intval += x
(SwaveBonnR(&r,par)**2 + DwaveBonnR(&r,par)**2)*dr;
}
return intval;

}

Double_t DQBonn (Double_t *p, Double_t *par) {

Double_t intval = 0.0;
Double_t r = 0.001;
Double_t dr = 0.02;
Double_t eta = (p[0] == 0) ? md*md/sqrt(50)/fm2GeV/fm2GeV : 3/sqrt(2)/(p[0]*p[0]/md/md/4);
Double_t x;
Double_t q = p[0]/fm2GeV;

for ( int i = 0 ; i < 3000; i++,r += dr){
x = (q == 0) ? rr : SphBesselJ(qr/2,2);
intval += x *(SwaveBonnR(&r,par)-DwaveBonnR(&r,par)/2.828427)*DwaveBonnR(&r,par)dr;
}
return eta
intval;

}

Double_t DSBonn (Double_t *p, Double_t *par) {

Double_t intval = 0.0;
Double_t r = 0.001;
Double_t dr = 0.02;
Double_t q = p[0]/fm2GeV;

for ( int i = 0 ; i < 3000; i++,r += dr)
intval += (SphBesselJ(qr/2,0)(SwaveBonnR(&r,par)**2-0.5DwaveBonnR(&r,par)**2) +
SphBesselJ(q
r/2,2)0.5(1.4142135*SwaveBonnR(&r,par)*DwaveBonnR(&r,par) + //
DwaveBonnR(&r,par)**2))*dr;

return intval;
}

Double_t DLBonn (Double_t *p, Double_t *par) {

Double_t intval = 0.0;
Double_t r = 0.001;
Double_t dr = 0.02;
Double_t q = p[0]/fm2GeV;

for ( int i = 0 ; i < 3000; i++,r += dr)
intval += (SphBesselJ(qr/2,0)+SphBesselJ(qr/2,2))DwaveBonnR(&r,par)**2dr;

return intval;

}

Hi,

[quote=“nitewater”]Error: Function DQBonn(&q,NULL) is not defined in current scope FILE:GE_from_GQ.C LINE:51
Possible candidates are…
filename line:size busy function type and name
Bonn.C 145:16 0 public:Double_t DQBonn(Double_t* p, Double_t* par);

WHAT THE HECK IS THE PROBLEM???[/quote]
No reason to shout. You’re calling DQBonn(Float_t*,Float_t*) and Cint correctly tells you that this doesn’t exist.

Cheers, Axel.