On Tue, Mar 23, 2010 at 9:36 AM, Diana Parno &lt;<a href="mailto:dparno@cmu.edu">dparno@cmu.edu</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote">
<div><br>
&gt; In PAW there was an &#39;hslice&#39; and &#39;vslice&#39; command that helped<br>
&gt; streamline<br>
&gt; the process.  I&#39;m sure ROOT&#39;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&lt;6; i++){<br>
    c1-&gt;cd(i+1);<br>    rootvar.Form(&quot;1e+9*L.s1.lt_c[%d]:1.0/sqrt(L.s1.la_c[%d])&quot;,i,i);<br>    hname.Form(&quot;h1[%d]&quot;,i+1);<br>    h1[i] = new TH2F(hname,rootvar,1000,0.02,0.2,1000,0,220);<br>    h1[i]-&gt;SetName(hname);<br>
    h1[i]-&gt;GetXaxis()-&gt;SetTitle(&quot;1/sqrt(ADC) (arb.)&quot;);<br>    h1[i]-&gt;GetXaxis()-&gt;CenterTitle();<br>    h1[i]-&gt;GetYaxis()-&gt;SetTitle(&quot;TDC (ns)&quot;);<br>    h1[i]-&gt;GetYaxis()-&gt;CenterTitle();<br>
    h1[i]-&gt;SetMarkerColor(kBlack);<br>    cut = cut0;<br>    T-&gt;Project(hname,rootvar,cut);<br>    h1[i]-&gt;SetMinimum(0.1);<br>    h1[i]-&gt;ProfileX()-&gt;Draw();<br><br>    c1-&gt;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&#39;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>