<br><br><div class="gmail_quote">On Wed, May 26, 2010 at 11:05 AM, Brad Sawatzky <<a href="mailto:brads@jlab.org">brads@jlab.org</a>> wrote:<br><blockquote class="gmail_quote">
<div class="im">On Wed, 26 May 2010, MATTHEW R POSIK wrote:<br>
<br>
</div><div class="im">> On Wed, May 26, 2010 at 10:15 AM, Brad Sawatzky <<a href="mailto:brads@jlab.org">brads@jlab.org</a>> wrote:<br>
><br>
> > On Sat, 22 May 2010, <a href="mailto:posik@jlab.org">posik@jlab.org</a> wrote:<br>
> ><br>
> > > So I think I finally got the BB cer multihit TDCs working right. I<br>
> > > just use TString cuts for all hits in the TDC. For example the<br>
> > > beam line side has 6 hits, so I do something like<br>
> > ><br>
> > > TString tdc1_1 =<br>
> > > "DL.BBcerT01[Ndata.DL.BBcerT01-1]>xx&&DL.BBcerT01[Ndata.DL.BBcerT01-1]<xx"<br>
> ><br>
> > What happens when Ndata.DL.BBcerTxx==0? Will it attempt to index with<br>
> > '-1' or do you watch for that condition prior to invoking this cut?<br>
><br>
> Yes, I took this condition in to account by appending the condition<br>
> Ndata.DLBBcerTxx!=0 to all 20 TDCs.<br>
<br>
</div>You should not just add Ndata.DLBBcerTxx!=0 to the end of the Cut<br>
string. The software must still evaluate all of the bogus [-1] indexes.<br>
If those memory locations are out of scope, then you can segfault or<br>
throw some other error. Same problem if you try to invoke a cut for<br>
"hit 6" when there are less than 6 hits -- in either case you're<br>
indexing beyond the scope of the array. That kind of code is just<br>
begging for trouble :-)<br>
<br>
[ . . . ]<br>
<div class="im">> Following the suggestion of this site<br>
> <a href="http://root.cern.ch/phpBB3//viewtopic.php?p=34643&sid=0337d028a3147d554b6b650c9474eddd">http://root.cern.ch/phpBB3//viewtopic.php?p=34643&sid=0337d028a3147d554b6b650c9474eddd</a><br>
> I was able to fix that problem. I think this cut is now correctly working.<br>
<br>
</div>It looks like the default limit is 1000. Are you really intending to<br>
generating a cut with more than 1000 comparisons? How big do you have<br>
to set it? <br></blockquote><div><br>Right now I have it set to 10000. I have five comparisons for 1 hit on TDC1:<br><br> 1) for Ndata !=0<br> 2) && with the TDC hit cut windows<br> 3) Hit one less than a TDC channel<br>
4) Hit one greater than a TDC channel <br> 5) another && between the two high and low TDC channels<br><br>This is then done for 20 TDCs. This gives 5*20 = 600 comparisons.<br>I then make another cut called "TString tdc_1 = OR of all the one hits in the 20 TDCs" this is another 19 comparisons, which now total 600+19=619 comparisons <br>
This is then done for 6 hits, so the comparisons are now 619*6 = 3714 comparisons. <br><br>Is there a more efficient way to do this? I only did it this way because it was the most straight forward.<br><br>-matt <br></div>
<div><br> </div><blockquote class="gmail_quote">
<div><div></div><div class="h5"><br>
-- Brad<br>
<br>
--<br>
Brad Sawatzky, PhD <<a href="mailto:brads@jlab.org">brads@jlab.org</a>> -<>- Jefferson Lab / Hall C / C111<br>
Ph: 757-269-5947 -<>- Fax: 757-269-5235 -<>- Pager: <a href="mailto:brads-page@jlab.org">brads-page@jlab.org</a><br>
The most exciting phrase to hear in science, the one that heralds new<br>
discoveries, is not "Eureka!" but "That's funny..." -- Isaac Asimov<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Matthew Posik<br>Email: <a href="mailto:posik@temple.edu">posik@temple.edu</a><br>Temple University Physics Dept.<br>Office: BA-319<br>Office #: 215-204-1331 <br>
WebSites:<br>Temple:<br><a href="http://quarks.temple.edu/">http://quarks.temple.edu/</a><br>d2n:<br><a href="http://hallaweb.jlab.org/experiment/E06-014/">http://hallaweb.jlab.org/experiment/E06-014/</a><br><br>