De-referencing pointer to TGraphErrrors object

Hi Everybody,

I have a problem de-referencing a pointer to TGraphObject. The problem is as follows. The following un-named script runs without problems:

SCRIPT:

[code]{
Double_t x1[20] = {1.2, 1.3, 1.4, 1.6, 1.8, 2.3, 2.5, 3, 4, 6, 7, 8, 10,11, 14, 15, 18, 20, 21.3, 22};

Double_t y1[20] = {2.3, 4.3, 2.4, 4.5, 2.3, 4.3, 4.4, 5, 8, 7, 8, 9, 11,13, 15, 12, 20, 22, 23.4, 25};
Double_t ex1[20] = {0.02, 0.02, 0.03, 0.03, 0.05, 0.05, 0.03, 0.02, 0.02, 0.02, 0.01, 0.02, 0.01, 0.04, 0.05, 0.02, 0.02, 0.02, 0.01, 0.01};
Double_t ey1[20] = {0.02, 0.02, 0.03, 0.03, 0.05, 0.05, 0.03, 0.02, 0.02, 0.02, 0.01, 0.02, 0.01, 0.04, 0.05, 0.02, 0.02, 0.02, 0.01, 0.01};
Double_t x2[20], y2[20];
Double_t x3[20], y3[20];

for (Int_t i=0; i<20; i++)
{
x2[i] = x1[i]*1.2;
y2[i] = y1[i]*1.13;
x3[i] = x1[i]+1.3;
y3[i] = y1[i] + 0.9;

}

TGraphErrors *gr1 = new TGraphErrors(20, x1, y1, ex1, ey1);
TGraphErrors *gr2 = new TGraphErrors(20, x2, y2, ex1, ey1);
TGraphErrors *gr3 = new TGraphErrors(20, x3, y3, ex1, ey1);
TGraphErrors *graph[3];
TGraphErrors gr[3];

gr1->SetMarkerColor(1);
gr1->SetMarkerStyle(22);
gr1->SetMarkerSize(1.2);

gr2->SetMarkerColor(2);
gr2->SetMarkerStyle(22);
gr2->SetMarkerSize(1.2);

gr3->SetMarkerColor(4);
gr3->SetMarkerStyle(22);
gr3->SetMarkerSize(1.2);

graph[0] = gr1;
graph[1] = gr2;
graph[2] = gr3;

TMultiGraph *mg = new TMultiGraph();

for (Int_t j=0; j<3; j++)
{
mg->Add(graph[j]);
gr[j] = *graph[j]; //!!! problematic line !!!
}

//gPad->SetLogy(1);
mg->Draw(“AP”);

}[/code]

The problem is with gr[j] = *graph[j]; line. Because as soon as I name the very same script and run it as a function I get “segmentation violation” at that line. Is there any reason why the CINT doesn’t allow that?

thanks
michal

Unfortunately the classes TGraph, TGraphErrors do not have an assignement operator = defined. (only copy constructors).
I will add these operators in a coming version.

Rene