TCutG class description mistake

Both, TCutG and TCutG contain the same mistake.
Instead of:
TCutG *cutg = new TCutG(“mycut”,5);
it should be:
TCutG *cutg = new TCutG(“mycut”, 6);

HI Pepe,

I fixed it. Note that the code is correct because SetPoint extend automatically the internal arrays.

root [0] TCutG *cutg = new TCutG("mycut",5);
root [1] cutg->SetVarX("y");
root [2] cutg->SetVarY("x");
root [3] cutg->SetPoint(0,-0.3586207,1.509534);
root [4] cutg->SetPoint(1,-1.894181,-0.529661);
root [5] cutg->SetPoint(2,0.07780173,-1.21822);
root [6] cutg->SetPoint(3,-1.0375,-0.07944915);
root [7] cutg->SetPoint(4,0.756681,0.1853814);
root [8] cutg->SetPoint(5,-0.3586207,1.509534);
root [9] cutg->GetN()
(Int_t) 6

But I agree with you it is more logic to put 6.

quote=“couet” Note that the code is correct because SetPoint extend automatically the internal arrays. (…)[/quote] I did use the word “mistake”, not “error”, didn’t I?

BTW. If you want to rely on automatic TGraph resize, why don’t you simply use:
TCutG cutg = new TCutG(“mycut”, -1); // -1 … or … 0
or even better, why don’t you modify the constructor:
TCutG::TCutG(const char
name, Int_t n = -1)
then you could say:
TCutG *cutg = new TCutG(“mycut”);

If you want to rely on automatic TGraph resize

In this simple example it is better to not rely on it.

My proposal is still valid … set a “default value” to the last parameter:
TCutG::TCutG(const char* name, Int_t n = -1)

Done