Can someone answer who is the owner of TCut instances?
Say, I want to make a function Cuts() which will list defined cuts,
similar to Paw “cuts” command – see below.
But it does not seem to work, e.g.
if I define a cut
TCut *c1 = new TCut(“c1”, “cut number 1”);
*c1 = “x > 0”;
Cuts();
I got nothing. I looked at gROOT->GetListOfSpecials()->FindObject(“c1”),
could not find the “c1”, who will be the owner of TCut objects?
TCut object are added to none of the list in ROOT. The normal C++ life time rule applies (aka. in your example, you have to manage your own container of cuts).
Then, may be manual Section 8 Object Ownership, may be wrong?
It reads, “The Colletion of Specials”
… This collection contains objects of the following classes: Tcut, …
Now I have a working (?) version of Cuts()function, see attachment,
which accept “P” and “-” options and function similar to Paw “cuts”.
Which uses GetList()->Add() function, is this what you mentioned?
Thanks,
Chul Su
[quote=“pcanal”]TCut object are added to none of the list in ROOT. The normal C++ life time rule applies (aka. in your example, you have to manage your own container of cuts).
As Philippe said, TCut objects are not added to any list.
The documentation is wrong where you indicate. Only TCutG objects are added to gROOT->GetListOfSpecials(). This is now fixed in the manual.
[quote=“brun”]As Philippe said, TCut objects are not added to any list.
The documentation is wrong where you indicate. Only TCutG objects are added to gROOT->GetListOfSpecials(). This is now fixed in the manual.