Very stupid questions :(

Hello, colleagues,

Could someone tell me why CINT throws “Unexpected EOF G__ignorestream():” pointing to the last line of .C file I’m trying to load?

How can I paste text from clipboard to CINT? And vice versa?

Thank you in advance.

[color=olive]GAMMA.C[/color] follows:

[size=75][color=olive]

#include “Riostream.h”
#include “TMath.h”
#include “TGraph.h”
#include “TFumili.h”
#include “TStyle.h”
#include “TCanvas.h”
#include “TF1.h”

const Double_t alpha[6] = {-0.016000, -0.009190, -0.002350,  0.002600,  0.009320,  0.016000}

void GAMMA()
{
fn = new TF1(“fn”, “
[0]-(
.5*[1][2][12]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[5]+[6]))(x-[3]([4]+[5]+[6]))+.25*[2][2])
+
.5
[1][2][13]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]-[5]+[7]))(x-[3]([4]-[5]+[7]))+.25*[2][2])
+
.5
[1][2]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[8]))(x-[3]([4]+[8]))+.25[2][2])
+
.5
[1][2]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[9]))(x-[3]([4]+[9]))+.25[2][2])
+
.5
[1][2][13]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]-[5]+[10]))(x-[3]([4]-[5]+[10]))+.25*[2][2])
+
.5
[1][2][12]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[5]+[11]))(x-[3]([4]+[5]+[11]))+.25*[2]*[2])
)
”, -10, 10);
fn->SetParameters(480000, //0 Background
40, //1 Amplitude
0.3, //2 FWHH
330, //3 HFM field
0.1, //4 Isomer Shift
0.04, //5 Quadrupole Splitting
-0.016, //6 Alpha(1)
-0.00919, //7 Alpha(2)
-0.00235, //8 Alpha(3)
0.0026, //9 Alpha(4)
0.00932, //10 Alpha(5)
0.016, //11 Alpha(6)
3, //12 AID(1)
2 //13 AID(2)
);
fn->Draw();
}[/color][/size]

You had many C++ mistakes in your code.
You can check the errors using ACLIC.
Instead of
.L GAMMA.C
do
.L GAMMA.C+

I modified your code to work.

Rene

#include “Riostream.h”
#include “TMath.h”
#include “TGraph.h”
#include “TFumili.h”
#include “TStyle.h”
#include “TCanvas.h”
#include “TF1.h”

const Double_t alpha[6] = {-0.016000, -0.009190, -0.002350, 0.002600, 0.009320, 0.016000};

void GAMMA()
{
TF1 fn = new TF1(“fn”,
"[0]-(
.5
[1][2][12]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[5]+[6]))(x-[3]([4]+[5]+[6]))+.25*[2][2])
+
.5
[1][2][13]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]-[5]+[7]))(x-[3]([4]-[5]+[7]))+.25*[2][2])
+
.5
[1][2]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[8]))(x-[3]([4]+[8]))+.25[2][2])
+
.5
[1][2]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[9]))(x-[3]([4]+[9]))+.25[2][2])
+
.5
[1][2][13]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]-[5]+[10]))(x-[3]([4]-[5]+[10]))+.25*[2][2])
+
.5
[1][2][12]TMath::InvPi()/TMath::Max(1.e-10,(x-[3]([4]+[5]+[11]))(x-[3]([4]+[5]+[11]))+.25*[2]*[2])
)",
-10, 10);

fn->SetParameter(0,480000); // Background
fn->SetParameter(1,40); // Amplitude
fn->SetParameter(2,0.3); // FWHH
fn->SetParameter(3,330); // HFM field
fn->SetParameter(4,0.1); // Isomer Shift
fn->SetParameter(5,0.04); // Quadrupole Splitting
fn->SetParameter(6,-0.016); // Alpha(1)
fn->SetParameter(7,-0.00919); // Alpha(2)
fn->SetParameter(8,-0.00235); // Alpha(3)
fn->SetParameter(9,0.0026); // Alpha(4)
fn->SetParameter(10,0.00932); // Alpha(5)
fn->SetParameter(11,0.016); // Alpha(6)
fn->SetParameter(12,3); // AID(1)
fn->SetParameter(13,2); // AID(2)

fn->Draw();
}

Yeah, Ok, I missed those backslashes, thanks for them, and I didn’t actually understand from the first glance, the possibility of adding a + to precompile the macro (if that is what the plus does).

However, the corrected text doesn’t work either. Please forgive me if I just failed to find the necessary info in the manual’s first 9 chapters.

Output as follows.

[color=olive]
root[0] .L brun.C+
Info in TWinNTSystem::ACLiC: creating shared library …\brun_C.dll
’cl’ is not recognized as an internal or external command, operable program or batch file.
… repeated several times …
Error in : Compilation failed!
[/color]

Thank you for support. Would appreciate further help.

by the way, should we move to ROOT support? it was quite a question for me to select the appropriate branch :wink: