<br><br><div class="gmail_quote">On Tue, Sep 21, 2010 at 12:04 PM, Brad Sawatzky <<a href="mailto:brads@jlab.org">brads@jlab.org</a>> wrote:<br><blockquote class="gmail_quote">
<div class="im"><br>
On Mon, 20 Sep 2010, David Flay wrote:<br>
<br>
> I have been trying to construct S1 and S2m time average root variables<br>
> using the SetAlias method. However, I have run into some odd issues:<br>
><br>
> To obtain the S1 time average, for instance, my code is:<br>
><br>
> //construct the time averages:<br>
> ch->SetAlias("S1TAvg_0","0.5e+09*(L.s1.lt_c[0]+L.s1.rt_c[0])");<br>
> ch->SetAlias("S1TAvg_1","0.5e+09*(L.s1.lt_c[1]+L.s1.rt_c[1])");<br>
> ch->SetAlias("S1TAvg_2","0.5e+09*(L.s1.lt_c[2]+L.s1.rt_c[2])");<br>
> ch->SetAlias("S1TAvg_3","0.5e+09*(L.s1.lt_c[3]+L.s1.rt_c[3])");<br>
> ch->SetAlias("S1TAvg_4","0.5e+09*(L.s1.lt_c[4]+L.s1.rt_c[4])");<br>
> ch->SetAlias("S1TAvg_5","0.5e+09*(L.s1.lt_c[5]+L.s1.rt_c[5])");<br>
> ch->SetAlias("S1TimeAvg","(1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)");<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're not drawing the histo you think you are? ie.<br>
Copy-and-paste type error that you're unintentionally repeating when you<br>
were testing (ie. commenting and uncommenting different blocks of lines<br>
that should be identical, but really aren't). Or some low-level<br>
weirdness due to multiple object instantiations sharing the same name,<br>
or a 'generic' histo pointer falls out of scope and isn't pointing to<br>
the object you think it is... That's what seems to be the most likely<br>
culprit.<br></blockquote><div><br>hmm, I'll check this out.. <br><br></div><blockquote class="gmail_quote">
<br>
Hmm, as an additional observation, the event counts in the histograms<br>
don't seem to add up. The 'Entries' 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><br>Good question... I'll have to investigate this<br> </div><blockquote class="gmail_quote">
<br>
That said, the statement that this line fails:<br>
<div class="im">> ch->SetAlias("S1TimeAvg","(1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)");<br>
</div>but works if you leave off the 1/6 factor is really puzzling. Do you<br>
mean that if you plot:<br>
> ch->SetAlias("S1TimeAvg","(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)");<br>
then you get figure 2: a single clean peak at 55ns? </blockquote><div><br>Yeah -- that's exactly what I was attempting to point out in the first email. <br><br></div><blockquote class="gmail_quote">
Again, the Entries<br>
number and the integrated counts in the visible bins don't seem to add<br>
up, so perhaps you're just looking at a peak that was outside your histo<br>
bounds when you divided by 1/6?<br></blockquote><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> <br></div><blockquote class="gmail_quote">
There could also be some weird operator or function precedence stuff<br>
going on when ROOT is internally unrolling all the aliases to get to the<br>
final expression. You could try adding 'extra' parentheses around<br>
the expression. Ex:<br>
ch->SetAlias("S1TimeAvg","((1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5))");<br>
I doubt this is the problem though.<br>
<br></blockquote><div>I should add this anyway just to be sure<br><br>Thanks! <br></div></div><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>