[d2n-analysis-talk] S1 and S2m Time Averages: Problems With the SetAlias Method?

David Flay flay at jlab.org
Tue Sep 21 12:10:40 EDT 2010


On Tue, Sep 21, 2010 at 12:04 PM, Brad Sawatzky <brads at jlab.org> wrote:

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

hmm, I'll check this out..


> Hmm, as an additional observation, the event counts in the histograms
> don't seem to add up.  The 'Entries' line claims 1.2M events, but if I
> add the bins up by eye I only get ~400k tops.  Where are the other 800k
> events?
>

Good question... I'll have to investigate this


>
> That said, the statement that this line fails:
> >
> ch->SetAlias("S1TimeAvg","(1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)");
> but works if you leave off the 1/6 factor is really puzzling.  Do you
> mean that if you plot:
> >
> ch->SetAlias("S1TimeAvg","(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5)");
> then you get figure 2:  a single clean peak at 55ns?


Yeah -- that's exactly what I was attempting to point out in the first
email.

Again, the Entries
> number and the integrated counts in the visible bins don't seem to add
> up, so perhaps you're just looking at a peak that was outside your histo
> bounds when you divided by 1/6?
>

I should open up the bounds of the plot and see what it looks like with and
without the 1/6 factor


> There could also be some weird operator or function precedence stuff
> going on when ROOT is internally unrolling all the aliases to get to the
> final expression.  You could try adding 'extra' parentheses around
> the expression. Ex:
>
>  ch->SetAlias("S1TimeAvg","((1.0/6.0)*(S1TAvg_0+S1TAvg_1+S1TAvg_2+S1TAvg_3+S1TAvg_4+S1TAvg_5))");
> I doubt this is the problem though.
>
> I should add this anyway just to be sure

Thanks!


-- 
-----------------------------------------------------------
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://www.jlab.org/%7Eflay>
              http://quarks.temple.edu
-----------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100921/bdb39966/attachment.html 


More information about the d2n-analysis-talk mailing list