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

David Flay flay at jlab.org
Mon Sep 20 21:38:10 EDT 2010


Hi Brad,

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 reason for using the SetAlias method is that it acts as a simple
string replacement, similar to TTreeFormula (according to ROOT discussions
I've found), allowing me to 'create' ROOTvariables I can manipulate as if
they were created from the source code.  This will be useful for when I
make plots of the time averages vs. track-x, etc.

However, this code yields the first plot attached---which is clearly not
correct, as the time average for the S1 plane should be at ~55ns.  If I
then leave off the 1/6 factor, I obtain what I would expect.  See the
second plot.  The same issue is seen for S2m.

One can also construct the time average as follows (and is done when I
show those 'characteristic plots' for the S1, S2m planes):

   ch->SetAlias("S1TimeAvgTPads","0.5e+09*(L.s1.lt_c[L.s1.t_pads[0]]+L.s1.rt_c[L.s1.t_pads[0]])");
ch->SetAlias("S2mTimeAvgTPads","0.5e+09*(L.s2.lt_c[L.s2.t_pads[0]]+L.s2.rt_c[L.s2.t_pads[0]])");

This yields an identical plot to the second one.  See plot #3.

I've also considered constructing the corrected variables myself from the
raw ones, utilizing the coefficients in the DB:

    //construct the time averages using RAW variables:
    ch->SetAlias("S1TAvgRawCor_0",Form("0.5*%f*(L.s1.lt[0]-%f+L.s1.rt[0]-%f)",fTdc2T,S1LeftCor[0],S1RightCor[0]));
ch->SetAlias("S1TAvgRawCor_1",Form("0.5*%f*(L.s1.lt[1]-%f+L.s1.rt[1]-%f)",fTdc2T,S1LeftCor[1],S1RightCor[1]));
ch->SetAlias("S1TAvgRawCor_2",Form("0.5*%f*(L.s1.lt[2]-%f+L.s1.rt[2]-%f)",fTdc2T,S1LeftCor[2],S1RightCor[2]));
ch->SetAlias("S1TAvgRawCor_3",Form("0.5*%f*(L.s1.lt[3]-%f+L.s1.rt[3]-%f)",fTdc2T,S1LeftCor[3],S1RightCor[3]));
ch->SetAlias("S1TAvgRawCor_4",Form("0.5*%f*(L.s1.lt[4]-%f+L.s1.rt[4]-%f)",fTdc2T,S1LeftCor[4],S1RightCor[4]));
ch->SetAlias("S1TAvgRawCor_5",Form("0.5*%f*(L.s1.lt[5]-%f+L.s1.rt[5]-%f)",fTdc2T,S1LeftCor[5],S1RightCor[5]));
ch->SetAlias("S1TimeAvgRawCor","(1.0/1.0)*(S1TAvgRawCor_0+S1TAvgRawCor_1+S1TAvgRawCor_2+S1TAvgRawCor_3+S1TAvgRawCor_4+S1TAvgRawCor_5)");

This does not give good results either, see the fourth plot.  To see if I
was adding correctly, I did this for a sum of only the first two.  This
gives plot #5---this is clearly wrong.  In fact, it doesn't make
sense---all the S1 time averages are (using the SetAlias method,
constructing the corrected variables from the raw ones) sitting at ~55ns
(see plot #6).

Maybe I'm just tired, but I can't seem to find anything wrong with the
reasoning in my code, and I do think that there should be factors of 1/6
on the S1 time average, but it seems to give an incorrect result.

Thanks,

Dave

-------------------------------------------------
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://quarks.temple.edu
-------------------------------------------------










-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_s2m_t-avgs_cor-vars-div_20676_9_20_10.png
Type: image/png
Size: 22359 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0006.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_s2m_t-avgs_cor-vars_20676_9_20_10.png
Type: image/png
Size: 24288 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0007.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_s2m_t-avgs_cor-vars_t-pads_20676_9_20_10.png
Type: image/png
Size: 21640 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0008.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_raw-cor-avg_20676_9_20_10.png
Type: image/png
Size: 17804 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0009.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_raw-cor_pads-0-and-1_20676_9_20_10.png
Type: image/png
Size: 16223 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0010.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1_t-avg_overlay_20676_9_20_10.png
Type: image/png
Size: 19912 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/d2n-analysis-talk/attachments/20100920/31719a4f/attachment-0011.png 


More information about the d2n-analysis-talk mailing list