Ntuple filling and fitting

Hi, I’m relatively new at using ntuples, so forgive me in advance if this has been discussed already (I really tried searching for the answer).
Here’s the situation:

  1. I have a bunch of histograms (TProfile and TH1D). I noticed that it is easier to massage the data when it’s stored in an ntuple. So I was wondering if there’s another way to fill an ntuple from a histogram or two, besides looping over them and using GetBinContent().

2)About the actual data massage - say I filled the ntuple somehow and now have one looking like TNtuple(“blah”,“blah”,“px:py:pz”)
I am able to draw any function of the constituents, say Draw(“cos(py/pz):px”). Now Say I like what I see and I want to fit a range of this function [cos(py/pz):px] to a straight line or something. Is it possible to do something like ntuple->Fit(“cos(py/pz):px”…) or do I have to fill a new histogram and fit that? If not - what’s the traditional way to handle this?

  1. Is it possible to plot (or fit) a function of a histogram say log(h), where h is a histogram of some kind?

Thanks a lot in advance.