[Sbs_software] Possibly helpful information about defining cuts on variable-sized arrays in the analyzer

Andrew Puckett puckett at jlab.org
Mon Sep 27 10:35:29 EDT 2021


Hello fellow SBS software developers:

After much experimentation, I’ve concluded that the only foolproof and reliable way to apply a cut on a variable-sized array within the output definition file is to write some code within the analyzer to calculate the result of that cut, define a variable holding the result of that cut for each index in the variable array, and then use ONLY the name of that variable as the cut definition in either the odef or cdef file. Combining them in cut definitions with logical operators does not seem to work correctly.

For example, I have a “decoded strip” array for each GEM module, and I wanted to histogram the decoded strips by choosing strips along a particular axis and also strips along a particular axis that end up on a good track. I already had two variables to indicate each of these conditions:

sbs.uvagem.m0.strip.ontrack # flag indicating strip is on a good track
sbs.uvagem.m0.strip.IsU # flag indicating this is a U/X strip (“axis” = 0)
sbs.uvagem.m0.strip.IsV # flag indicating this is a V/Y strip (“axis” = 1)

When I try to define a histogram like this, it doesn’t work correctly:

th1d hstripv_good_sbs_uvagem_m1 'V Strip heat map, module 1' sbs.uvagem.m1.strip.istrip[I] 1280 -0.5 1279.5 sbs.uvagem.m1.strip.ontrack[I]&&sbs.uvagem.m1.strip.IsV[I]

It compiles but I get incorrect results. The cut expression is attempting to combine the “ontrack” and “IsV” results. However, in the output histogram only the first expression is applied and everything after the && seems to be ignored.

So although it is extremely annoying to do so, I defined a new variable “ontrackV” which is the logical AND of “ontrack” and “IsV” and calculated its result in the code. The following syntax then works correctly:

th1d hstripv_good_sbs_uvagem_m0 ‘V Strip heat map, module 0’ sbs.uvagem.m0.strip.istrip[I] 1280 -0.5 1279.5 sbs.uvagem.m0.strip.ontrackV[I]

I am not sure if the “[I]” is necessary, but it can’t hurt to make your intentions more clear to Podd. While the automatic histogramming and cut definition in the analyzer is clunky and cumbersome and should probably eventually be rewritten wholesale, nobody has time to do that, so this is something that works that we can use for now. I thought you might find this useful.

Cheers,
Andrew


Andrew Puckett
Associate Professor, Physics Department
University of Connecticut
196 Auditorium Road, Unit 3046
Storrs, CT 06269-3046
Office phone: (860) 486-7137
https://puckett.physics.uconn.edu
puckett at jlab.org<mailto:andrew.puckett at uconn.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/sbs_software/attachments/20210927/501c61ce/attachment.html>


More information about the Sbs_software mailing list