Re: filling TGraph with TNtuple ?
Pasha Murat (murat@cdfsga.fnal.gov)
Wed, 5 Aug 1998 18:44:28 -0500 (CDT)
Tomasz Motylewski writes:
>
> I like very much the feature of ntuple->Draw("x-2y:z","z>0")
> But as far as I can tell this clever code in TTree.cxx is underused.
> OK, I can fill a histogram, I can fill a TPolyMarker, but I would like to be
> able to fill a TGraph class and then use TGraph:Fit. I some cases points
> would need to be sorted.
>
> I just think that TNtuple(TTree) is the most convinient class for me to store
> my spectra which consist of wavelength, and then several data channels
> recorded. Various functions of them need to be plotted to get meaningful
> information, but they are not to be treated as histograms. I have noticed the
> same weakness in PAW: there was no easy way to get functions of ntuple
> fields as vectors.
>
> What I am in fact asking for is the simplest way to fit e.g. pol4
>
> x*(1+2*z) = pol4 (3*y+x) for z>x where x,y,z are TNtuple fields.
>
>
> Another problem is that ROOT's most developed objects are histograms, but my
> data represents value AT some point, not mean value in some range. I can
> probably construct histograms in such a way that bin centers correspond to my
> data points, but is there any cleaner solution?
>
> I would like to develop solutions for above mentioned problems, but please
> tell me if this is not already done.
>
> Best regards,
> --
> Tomasz Motylewski
one of the easiest solutions would be to use MINUIT directly (see description
of TMinuit class) and to write FCN function which would read your tree and
calculate the chi**2.
pasha.