Problem with macro emacs

Please provide the following information:


ROOT Version (e.g. 6.12/02):
Platform, compiler (e.g. CentOS 7.3, gcc6.2):


When i run my program in root i’ve got this massages :

Error: Missing one of ',)' expected at or after line 37.
Error: Unexpected end of file (G__fgetstream_template():2) Higgs.C:80:
Error: Missing one of ',;{(' expected at or after line 80.
Error: Unexpected end of file (G__fgetstream_template():2) Higgs.C:80:
Error: Missing one of '{' expected at or after line 80.
Error: Unexpected end of file (G__fignorestream():3) Higgs.C:80:
*** Interpreter error recovered ***

Can you please help me ?

N.P I write my program using emacs.
this programm is already written in RootPrimerLatter :slightly_smiling_face:

void format_line(TAttLine* line,int col,int sty){
    line->SetLineWidth(5);
    line->SetLineColor(col);
    line->SetLineStyle(sty);
}

double the_gausppar(double* vars, double* pars){
 return pars[0]*TMath::Gaus(vars[0],pars[1],pars[2])+
 pars[3]+pars[4]*vars[0]+pars[5]*vars[0]*vars[0];}


{
   gStyle->SetOptTitle(0); gStyle->SetOptStat(0);
   gStyle->SetOptFit(1111); gStyle->SetStatBorderSize(0);
   gStyle->SetStatX(.89); gStyle->SetStatY(.89);

   TF1 parabola("parabola","[0]+[1]*x+[2]*x**2",0,20);
   format_line(&parabola,kBlue,2);

   TF1 gaussian("gaussian","[0]*TMath::Gaus(x,[1],[2])",0,20);
   format_line(&gaussian,kRed,2);

   TF1 gausppar("gausppar",the_gausppar,-0,20,6);
   double a=15; double b=-1.2; double c=.03;
   double norm=4; double mean=7; double sigma=1;
   gausppar.SetParameters(norm,mean,sigma,a,b,c);
   gausppar.SetParNames("Norm","Mean","Sigma","a","b","c");
   format_line(&gausppar,kBlue,1);

   TH1F histo("histo","Signal plus background;X vals;Y Vals",50,0,20);
   histo.SetMarkerStyle(8);

   // Fake the data                                                    

   for (int i=1;i<=5000;++i){
     histo.Fill(gausppar.GetRandom());
   }

Thank you very much…

Try to replace:

{
   gStyle->SetOptTitle(0); gStyle->SetOptStat(0);

with:

void Higgs(void) {
   gStyle->SetOptTitle(0); gStyle->SetOptStat(0);

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).

As Wile pointed, your macro is incomplete you need a name for the function. You also need to close it with a curly bracket like in this modified version of you script: tnourji.C (1.1 KB)

It works now:

root [0] 
Processing tnourji.C...
root [1]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.