Ok, I will try this, but I don&#39;t think it is the Ndata.DBB.BBcerT%02d cut that is making the cerenkov sum vanish when I &quot;OR&quot; the TDCs. I tried a variety of things and one was using just DBB.BBcerT%02[0] TDC hits and when applying the &quot;OR&quot; ed beamline side TDCs the sum still look ok, but when I applyed the &quot;OR&quot; ed farside (farthest from beam) TDCs with out the beamline side TDCs, the cerenkov sum vanished.<br>
<br>  However, since BB.cer.asum_c was only a single element, I did not use an index on it, so I guess I could try BB.cer.asum_c[0]. But then I do not know why using the &quot;OR&quot; ed BB.cer.t[ ] TDCs on the unindexed chernkov sum would work?<br>
<br>-Matt  <br><div class="gmail_quote">On Fri, Jan 29, 2010 at 12:03 AM, Brad Sawatzky &lt;<a href="mailto:brads@jlab.org">brads@jlab.org</a>&gt; wrote:<br><blockquote class="gmail_quote">
Hi Matt,<br>
<br>
There are only &#39;Ndata.DBB.BBcerT%02d&#39; hits in the DBB.BBcerT%02d[]<br>
array.  If you index out of bounds you&#39;ll get weird results.<br>
<br>
Modify your loop so that you build your cut this way:<br>
  for(nhit=0; nhit&lt;Ndata.DBB.BBcerT%02d; nhit++) { ... }<br>
Note that this will not add any cut if there are no hits in that<br>
particular TDC channel.<br>
<br>
Also, be very careful that you add an explicit index to every array type<br>
variable in all of your cuts (and that includes arrays with only one<br>
entry).<br>
<br>
-- Brad<br>
<div><div></div><div class="h5"><br>
On Thu, 28 Jan 2010, <a href="mailto:posik@jlab.org">posik@jlab.org</a> wrote:<br>
<br>
&gt; Hi All,<br>
&gt;<br>
&gt;  So I was playing around with the Big bite TDCs today and forming a cut<br>
&gt; that incorporates all the multi-hits for each TDC, so that I can apply it<br>
&gt; to the cerenkov ADC signals.<br>
&gt;<br>
&gt;   The multihit TDC cut loops over all tdc-hits and accepts only a certain<br>
&gt; timing peak. ie<br>
&gt;<br>
&gt;     for(Int_t nhit=0;nhit&lt;6;nhit++){ //loop over multihit TDC<br>
&gt;                if(nhit==0){<br>
&gt;                    tdc_ct=Form(&quot;(DBB.BBcerT%02d[Ndata.DBB.BBcerT%02d]&lt;%f&amp;&amp;DBB.BBcerT%02d[Ndata.DBB.BBcerT%02d]&gt;%f)&quot;,pmt,pmt,tdc_hi,pmt,pmt,tdc_low);<br>
&gt;                 }else{<br>
&gt;                    tdc_ct+=<br>
&gt; Form(&quot;||(DBB.BBcerT%02d[Ndata.DBB.BBcerT%02d-%d]&lt;%f&amp;&amp;DBB.BBcerT%02d[Ndata.DBB.BBcerT%02d-%d]&gt;%f)&quot;,pmt,pmt,nhit,tdc_hi,pmt,pmt,nhit,tdc_low);<br>
&gt;                 }<br>
&gt;             }<br>
&gt;  where pmt is the pmt that you are looking at and tdc_hi and tdc_lo are<br>
&gt; the high and low ranges of the timing peak.This is shown below in the<br>
&gt; plot multi_tdc.png. The blue histo is the raw TDC and the red is the<br>
&gt; multi-hit cut TDC, there seems to be some background/noise in some of the<br>
&gt; higher chans (&gt;400), this can be removed by using an extra cut<br>
&gt;<br>
&gt;   (&quot;DBB.BBcerT%02d&lt;400&quot;,pmt) where pmt is the pmt you are looking at.<br>
&gt;<br>
&gt; Next I wanted to look at the cerenkov ADC sum, so I plot this and start to<br>
&gt; apply multi-hit TDC cuts defined above to the sum by &quot;OR&quot; ing the TDC cuts<br>
&gt; for each TDC, something like:<br>
&gt;<br>
&gt;  tdc_cut1 || tdc_cut2 || tdc_cut3 || ect<br>
&gt;<br>
&gt; However when I begin to &quot;OR&quot; the TDCs and apply them to the ADC sum, the<br>
&gt; sum goes to zero. And yet applying the individual TDC cuts to the<br>
&gt; individual ADCs, they seem ok.<br>
&gt;<br>
&gt; What I think may be happening is that I am using THaCherenkov class to<br>
&gt; produce the ADCs (each individual ADC, ped subtracted ADC, gain corrected<br>
&gt; ADC and the ADC sum) and I am using the DBB class for the TDCs. I was<br>
&gt; wondering if it is possible that the two classes are some how conflicting<br>
&gt; when I try to &quot;OR&quot; the DBB TDCs. As a curiosity I tried to use the<br>
&gt; THaCherenkov TDCs(only single hit) and they leave me with a signal when<br>
&gt; &quot;OR&quot; ing them together. You can see the cerenkov ADC sum using the<br>
&gt; THCherenkov TDCs below(bb_cer_sum.png).<br>
&gt;<br>
&gt; I was wondering if anyone had any input on this issue?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Matt<br>
<br>
<br>
<br>
</div></div>--<br>
<font color="#888888">Brad Sawatzky, PhD &lt;<a href="mailto:brads@jlab.org">brads@jlab.org</a>&gt;  -&lt;&gt;-  Jefferson Lab / Hall C / C111<br>
  Ph: 757-269-5947 -&lt;&gt;- Pager: 757-584-5947 -&lt;&gt;- Fax: 757-269-7848<br>
The most exciting phrase to hear in science, the one that heralds new<br>
  discoveries, is not &quot;Eureka!&quot; but &quot;That&#39;s funny...&quot;   -- Isaac Asimov<br>
_______________________________________________<br>
d2n-analysis-talk mailing list<br>
<a href="mailto:d2n-analysis-talk@jlab.org">d2n-analysis-talk@jlab.org</a><br>
<a href="https://mailman.jlab.org/mailman/listinfo/d2n-analysis-talk">https://mailman.jlab.org/mailman/listinfo/d2n-analysis-talk</a><br>
</font></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>