I have a sequence of doubles (a numpy.array, in this case) and I would like to fit a histogram using ROOT.
h = ROOT.TH1D(d) doesn’t seem to work. I have tried using an array.array(‘d’, seq), too, but it just doesn’t seem to want to be automatically cast to a TVectorD.
Additionally, to make a TVectorD, I can’t see a nicer way of doing it other than:
root_data = ROOT.TVectorD(len(a))
for index in range(len(a)):
root_data[index] = a[index]
What am I missing here?
Thanks
Alex