On Tue, Sep 21, 2010 at 12:10 PM, David Flay &lt;<a href="mailto:flay@jlab.org">flay@jlab.org</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote">

<br><br><div class="gmail_quote"><div>On Tue, Sep 21, 2010 at 12:04 PM, Brad Sawatzky &lt;<a href="mailto:brads@jlab.org">brads@jlab.org</a>&gt; wrote:<br><blockquote class="gmail_quote">


<div><br>
On Mon, 20 Sep 2010, David Flay wrote:<br>
<br>
&gt; I have been trying to construct S1 and S2m time average root variables<br>
&gt; using the SetAlias method.  However, I have run into some odd issues:<br>
&gt;<br>
&gt; To obtain the S1 time average, for instance, my code is:<br>
&gt;<br>
&gt;     //construct the time averages:<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_0&quot;,&quot;0.5e+09*(L.s1.lt_c[0]+L.s1.rt_c[0])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_1&quot;,&quot;0.5e+09*(L.s1.lt_c[1]+L.s1.rt_c[1])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_2&quot;,&quot;0.5e+09*(L.s1.lt_c[2]+L.s1.rt_c[2])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_3&quot;,&quot;0.5e+09*(L.s1.lt_c[3]+L.s1.rt_c[3])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_4&quot;,&quot;0.5e+09*(L.s1.lt_c[4]+L.s1.rt_c[4])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TAvg_5&quot;,&quot;0.5e+09*(L.s1.lt_c[5]+L.s1.rt_c[5])&quot;);<br>
&gt; ch-&gt;SetAlias(&quot;S1TimeAvg&quot;,&quot;(1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)&quot;);<br>
<br>
</div>The bad plots look like they are accessing the uncorrected variable<br>
data, but I do not see how that is possible from the code you quote...<br>
Any chance the you&#39;re not drawing the histo you think you are?  ie.<br>
Copy-and-paste type error that you&#39;re unintentionally repeating when you<br>
were testing (ie. commenting and uncommenting different blocks of lines<br>
that should be identical, but really aren&#39;t).  Or some low-level<br>
weirdness due to multiple object instantiations sharing the same name,<br>
or a &#39;generic&#39; histo pointer falls out of scope and isn&#39;t pointing to<br>
the object you think it is...  That&#39;s what seems to be the most likely<br>
culprit.<br></blockquote></div><div><br>hmm, I&#39;ll check this out.. <br></div></div></blockquote><div><br>As far as I can see, I don&#39;t see any issues with repeats of code that doesn&#39;t make sense...<br> <br></div>

<blockquote class="gmail_quote"><div class="gmail_quote"><div><br></div><div><blockquote class="gmail_quote">


<br>
Hmm, as an additional observation, the event counts in the histograms<br>
don&#39;t seem to add up.  The &#39;Entries&#39; line claims 1.2M events, but if I<br>
add the bins up by eye I only get ~400k tops.  Where are the other 800k<br>
events?<br></blockquote></div><div><br>Good question... I&#39;ll have to investigate this<br> <br></div></div></blockquote><blockquote class="gmail_quote">

<div class="gmail_quote"><div></div><div><br><br></div><div><blockquote class="gmail_quote">
Again, the Entries<br>
number and the integrated counts in the visible bins don&#39;t seem to add<br>
up, so perhaps you&#39;re just looking at a peak that was outside your histo<br>
bounds when you divided by 1/6?<br></blockquote></div><div><br>I should open up the bounds of the plot and see what it looks like with and without the 1/6 factor<br></div></div></blockquote><div><br>I zoomed out on these various plots and I got some (odd) things going on here.   <br>

<br>The first plot is the sum &lt;without&gt; the factor of 1/6 or 1/16 (for S2m).<br><br>The second plot is &lt;with&gt; the factor.  This second plot seems to give a &#39;somewhat&#39; more believable result... kind of.<br>

<br>The third plot uses the definitions for the time averages:<br><br>    ch-&gt;SetAlias(&quot;S1TimeAvgTPads&quot;,&quot;0.5e+09*(L.s1.lt_c[L.s1.t_pads[0]]+L.s1.rt_c[L.s1.t_pads[0]])&quot;);<br>    ch-&gt;SetAlias(&quot;S2mTimeAvgTPads&quot;,&quot;0.5e+09*(L.s2.lt_c[L.s2.t_pads[0]]+L.s2.rt_c[L.s2.t_pads[0]])&quot;);  <br>

<br>This gives the most consistent and expected result of the three plots, at least for S2m.  <br>Further, if I consider the difference of these two variables (S2m - S1, as defined at the top of this message) plotted vs. track-x, I get the fourth plot.   <br>

Zooming in on the lower bright band, I get a structure that is identical to beta vs. track-x <br>(the bumps are inverted, of course, since this is the time difference, not 1/t_diff vs track-x). <br><br>If I compare this to the same time difference, but using t_pads as the argument, I obtain the last plot -- I zoomed in here, <br>

because this was the only bright spot on the plot. <br></div></div><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/%7Eflay">http://www.jlab.org/~flay</a><br>              <a href="http://quarks.temple.edu">http://quarks.temple.edu</a><br>-----------------------------------------------------------<br>

<br><br>