I noticed some files are automatically added to a TDirectory such as TH1 objects when cloned.
However it seems this is not the same with all objects such as TGraph.
I would like to use gDirectory::Add(TObject*); for those who ain’t copied.
Can you advise me ?
Therefore I developed two functions, one which creates a subdirectory and a second one which is supposed to add the object at the place I want, such as :
Those objects are cloned, because deleted later on.
However the function CopyTo, doesn’t work as expected because in some cases it doesn’t add objects. TH1 are added, when Cloned, but TGraph not.
As I found the function TDirectory::Add(TObject*, …); I am currently using the special case in case the object inherits from TGraph, but I don’t understand why TH1 are copy and TGraph not.