I would like to use a copy constructor of the TPad a la
import ROOT
class Pad(ROOT.TPad):
def __init__(self,pad = None):
if not pad is None:
ROOT.TPad.__init__(self, pad) #This is not possible
else:
ROOT.TPad.__init__(self)
canvas = ROOT.TCanvas()
canvas.Divide(2,2)
P = Pad(canvas.cd(2))
This is not possible as i see in the documentation says, there is no Copy constructor for TPad, other than for every other ROOT object i know. Is there any clever workaround?
Could you give an example, how this works? I need to inherit from TPad. I don’t want to only copy the pad. I want to add methods to an inherited object. Is there a possibility like
import ROOT
class Pad(ROOT.TPad):
def __init__(self,pad = None):
ROOT.TPad.__init__(self)
if not pad is None:
self = pad.Clone() #How to make this right? This is nonesense of course