[d2n-analysis-talk] ROOT TH2D Fit Trouble: S1 Timewalk

David Flay flay at jlab.org
Wed Mar 24 10:07:15 EDT 2010


On Tue, Mar 23, 2010 at 9:36 AM, Diana Parno <dparno at cmu.edu> wrote:

>
>> > 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.
>>
>> The ROOT equivalents to hslice and vslice are TH2::ProjectionX and
>> TH2::ProjectionY, which give you 1-d histograms. You can also try
>> TH2::ProfileX and TH2::ProfileY, which give you profile histograms.
>>
>
I have drawn profiles of my 2D histos, using:

  for(Int_t i=0; i<6; i++){
    c1->cd(i+1);
    rootvar.Form("1e+9*L.s1.lt_c[%d]:1.0/sqrt(L.s1.la_c[%d])",i,i);
    hname.Form("h1[%d]",i+1);
    h1[i] = new TH2F(hname,rootvar,1000,0.02,0.2,1000,0,220);
    h1[i]->SetName(hname);
    h1[i]->GetXaxis()->SetTitle("1/sqrt(ADC) (arb.)");
    h1[i]->GetXaxis()->CenterTitle();
    h1[i]->GetYaxis()->SetTitle("TDC (ns)");
    h1[i]->GetYaxis()->CenterTitle();
    h1[i]->SetMarkerColor(kBlack);
    cut = cut0;
    T->Project(hname,rootvar,cut);
    h1[i]->SetMinimum(0.1);
    h1[i]->ProfileX()->Draw();

    c1->Update();

  }

This gives the plots attached.  However, if I use the FitPanel, a linear fit
does not work at all -- I get a solid line along the x-axis, similar to the
problem before using the Profile function...  I tried hard-coding the fit
in, but it then neglects the Profile function, and just draws the histogram,
as if the ProfileX() didn't exist...



-- 
-----------------------------------------------------------
David Flay
Physics Department
Temple University
Philadelphia, PA 19122

office: Barton Hall, BA319
phone: (215) 204-1331

e-mail: flay at jlab.org
           flay at temple.edu

website: http://www.jlab.org/~flay
             http://quarks.temple.edu
-----------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100324/880b0f1e/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_timewalk_profile_20676_3_23_10.png
Type: image/png
Size: 38609 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100324/880b0f1e/attachment-0001.png 


More information about the d2n-analysis-talk mailing list