[d2n-analysis-talk] ROOT TH2D Fit Trouble: S1 Timewalk
Brad Sawatzky
brads at jlab.org
Tue Mar 23 10:26:07 EDT 2010
On Mon, 22 Mar 2010, David Flay wrote:
> I am trying to check on how good the current timewalk factors for S1
> are in my DB, so I plot:
>
> 1e+9*(L.s1.lt_c[i]):1.0/sqrt(L.s1.la_c[i])
>
> which puts the TDC variable in nanoseconds.
>
> After drawing this histo (object name = h), I use:
>
> h->Fit("pol1");
>
> The result I get is attached. I'm trying to figure out how to get the
> fit to actually fit the dark band, where the majority of the events
> are. If I use a fitting range, I get 'no fit' -- I get a black line
> along the x-axis.
I'm not sure how ROOT can even try to fit a polonomial (x, z) to a 3
dimensional data set (x, y, z)...
What I've done in the past is take multiple slices of the 2D histo in x
and generate 1D histos from them. For example:
T->Draw("y>>h1","abs(x-0.02)<0.1")
T->Draw("y>>h2","abs(x-0.04)<0.1")
T->Draw("y>>h3","abs(x-0.06)<0.1")
...
T->Draw("y>>hN","abs(x-0.12)<0.1")
Fit a gaussian to each of those 1D histos, then fit a line to the means
of each gaussian vs. x. Each mean marks the center of the band you
want to fit for x=0.2, 0.4, ..., 0.12.
In PAW there was an 'hslice' and 'vslice' command that helped streamline
the process. I'm sure ROOT's T2D histo class has something similar.
-- Brad
--
Brad Sawatzky, PhD <brads at jlab.org> -<>- Jefferson Lab / Hall C / C111
Ph: 757-269-5947 -<>- Fax: 757-269-5235
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" but "That's funny..." -- Isaac Asimov
More information about the d2n-analysis-talk
mailing list