On Tue, Mar 23, 2010 at 9:36 AM, Diana Parno <<a href="mailto:dparno@cmu.edu">dparno@cmu.edu</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote">
<div><br>
> In PAW there was an 'hslice' and 'vslice' command that helped<br>
> streamline<br>
> the process. I'm sure ROOT's T2D histo class has something similar.<br>
<br>
</div>The ROOT equivalents to hslice and vslice are TH2::ProjectionX and<br>
TH2::ProjectionY, which give you 1-d histograms. You can also try<br>
TH2::ProfileX and TH2::ProfileY, which give you profile histograms.<font color="#888888"><br></font></blockquote></div></div></blockquote></div><br>I have drawn profiles of my 2D histos, using: <br><br> for(Int_t i=0; i<6; i++){<br>
c1->cd(i+1);<br> rootvar.Form("1e+9*L.s1.lt_c[%d]:1.0/sqrt(L.s1.la_c[%d])",i,i);<br> hname.Form("h1[%d]",i+1);<br> h1[i] = new TH2F(hname,rootvar,1000,0.02,0.2,1000,0,220);<br> h1[i]->SetName(hname);<br>
h1[i]->GetXaxis()->SetTitle("1/sqrt(ADC) (arb.)");<br> h1[i]->GetXaxis()->CenterTitle();<br> h1[i]->GetYaxis()->SetTitle("TDC (ns)");<br> h1[i]->GetYaxis()->CenterTitle();<br>
h1[i]->SetMarkerColor(kBlack);<br> cut = cut0;<br> T->Project(hname,rootvar,cut);<br> h1[i]->SetMinimum(0.1);<br> h1[i]->ProfileX()->Draw();<br><br> c1->Update();<br><br> }<br><br>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...<br>
<br><br clear="all"><br>-- <br>-----------------------------------------------------------<br>David Flay<br>Physics Department<br>Temple University<br>Philadelphia, PA 19122 <br><br>office: Barton Hall, BA319<br>phone: (215) 204-1331<br>
<br>e-mail: <a href="mailto:flay@jlab.org">flay@jlab.org</a> <br> <a href="mailto:flay@temple.edu">flay@temple.edu</a><br><br>website: <a href="http://www.jlab.org/~flay">http://www.jlab.org/~flay</a><br> <a href="http://quarks.temple.edu">http://quarks.temple.edu</a><br>
-----------------------------------------------------------<br><br><br>