Yes the red region is defined by my cut bounds. I looked at the 20 TDCs associated with the PMTs and fit the TDC signal with a Gaussian. I then too the width to be 2*sigma for the Gaussian fit. So I have two arrays of length 20 corresponding to the TDC peak and sigma for each PMT. The difference in the TDC cuts is due to how well the fit fits the TDC signal on each PMT. Some are TDC signals are not as sharp as others. Should I fix them to all have the same width about the TDC peak?  <br>
<br><div class="gmail_quote">On Fri, Mar 12, 2010 at 10:55 AM, Brad Sawatzky &lt;<a href="mailto:brads@jlab.org">brads@jlab.org</a>&gt; wrote:<br><blockquote class="gmail_quote">
<div class="im">On Fri, 12 Mar 2010, MATTHEW R POSIK wrote:<br>
<br>
&gt; Yes, that is a good point. Looking at the actual hits there is never<br>
&gt; any above 5 hits for any PMT. But when I do a<br>
&gt; T-&gt;MakeSelector(&quot;my_selector&quot; ) on the TTree, it outputs a<br>
&gt; my_selector.C and my_selector.h where the .h file lists all variable<br>
&gt; names,types and array sizes. This is what it lists for the DBB.BBcerT*<br>
&gt; stuff:<br>
&gt;<br>
&gt;   Double_t        DBB_BBcerT01[16];   //[Ndata.DBB.BBcerT01]<br>
</div>[ . . . ]<br>
<div class="im">&gt; So there are arrays of length of 16? Am I interpreting this correctly?<br>
<br>
</div>Yup, you&#39;re correct.<br>
<br>
[ . . . ]<br>
<div class="im">&gt; I also use this TBranch to set the TDCs to a double array of legth 20.<br>
&gt; Note that if I try to define the length as tdc_values[20][5] or<br>
&gt; something less I get the following error:<br>
&gt;<br>
&gt;  *** Break *** segmentation violation<br>
</div>[ . . . ]<br>
<div class="im">&gt; Double_t tdc_values[20][20]<br>
&gt;  for(pmt=0;pmt&lt;20;pmt++) {<br>
&gt;<br>
&gt;  TBranch * btdc =   chain-&gt;GetBranch(Form(&quot;DBB.BBcerT%02d&quot;,pmt+1)  ) ;<br>
&gt;   if( btdc ) {<br>
&gt;     chain-&gt;SetBranchAddress(Form(&quot;DBB.BBcerT%02d&quot;,pmt+1), &amp;tdc_values[pmt] ,<br>
&gt; &amp;btdc ) ;<br>
<br>
</div>The segfault occurs because you define an array tdc_values[X][Y], and<br>
then ask root to stuff 16 values (the allocated full DBB.BBcerT%02d<br>
array size) into tdc_values[X], which is of length Y.  If Y&lt;16 you&#39;ll<br>
have problems.<br>
<div class="im"><br>
&gt; I do not think this leads to the same issue as with using the TString<br>
&gt; method, due to the fact that I only loop over the number of hits on<br>
&gt; each PMT for each event:<br>
<br>
&gt;   //Loop over PMTs<br>
&gt;      for(pmt=0;pmt&lt;20; pmt++) {<br>
&gt;         h_hits[pmt]-&gt;Fill(tdc_hits[pmt]);<br>
&gt; // Loop over cherenkov tdc hits<br>
&gt;          for(j=0;j&lt;tdc_hits[pmt];j++) {<br>
&gt;             h_tdc[pmt]-&gt;Fill(tdc_values[pmt][j]);<br>
&gt;         }<br>
&gt;     }<br>
&gt;<br>
&gt; So j only goes to the number of hits on that PMT for that event.<br>
&gt; Looking at the TDCs and TDC hits they seem to look good. See plots<br>
&gt; below, red histo is a TDC cut using the Multi-hit TDCs.  Does this<br>
&gt; seem correct?<br>
<br>
</div>That approach looks reasonable.<br>
<br>
Why doesn&#39;t the red region have the same width for all PMTs though?<br>
Isn&#39;t that width just defined by your cut bounds?<br>
<div><div></div><div class="h5"><br>
-- Brad<br>
<br>
--<br>
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-5235<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>
</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>