[d2n-analysis-talk] BB Cerenkov TDC cut

Brad Sawatzky brads at jlab.org
Fri Mar 12 10:55:22 EST 2010


On Fri, 12 Mar 2010, MATTHEW R POSIK wrote:

> Yes, that is a good point. Looking at the actual hits there is never
> any above 5 hits for any PMT. But when I do a
> T->MakeSelector("my_selector" ) on the TTree, it outputs a
> my_selector.C and my_selector.h where the .h file lists all variable
> names,types and array sizes. This is what it lists for the DBB.BBcerT*
> stuff:
> 
>   Double_t        DBB_BBcerT01[16];   //[Ndata.DBB.BBcerT01]
[ . . . ]
> So there are arrays of length of 16? Am I interpreting this correctly?

Yup, you're correct.

[ . . . ]
> I also use this TBranch to set the TDCs to a double array of legth 20.
> Note that if I try to define the length as tdc_values[20][5] or
> something less I get the following error:
> 
>  *** Break *** segmentation violation
[ . . . ]
> Double_t tdc_values[20][20]
>  for(pmt=0;pmt<20;pmt++) {
> 
>  TBranch * btdc =   chain->GetBranch(Form("DBB.BBcerT%02d",pmt+1)  ) ;
>   if( btdc ) {
>     chain->SetBranchAddress(Form("DBB.BBcerT%02d",pmt+1), &tdc_values[pmt] ,
> &btdc ) ;

The segfault occurs because you define an array tdc_values[X][Y], and
then ask root to stuff 16 values (the allocated full DBB.BBcerT%02d
array size) into tdc_values[X], which is of length Y.  If Y<16 you'll
have problems.

> I do not think this leads to the same issue as with using the TString
> method, due to the fact that I only loop over the number of hits on
> each PMT for each event:

>   //Loop over PMTs
>      for(pmt=0;pmt<20; pmt++) {
>         h_hits[pmt]->Fill(tdc_hits[pmt]);
> // Loop over cherenkov tdc hits
>          for(j=0;j<tdc_hits[pmt];j++) {
>             h_tdc[pmt]->Fill(tdc_values[pmt][j]);
>         }
>     }
>
> So j only goes to the number of hits on that PMT for that event.
> Looking at the TDCs and TDC hits they seem to look good. See plots
> below, red histo is a TDC cut using the Multi-hit TDCs.  Does this
> seem correct?

That approach looks reasonable.

Why doesn't the red region have the same width for all PMTs though?
Isn't that width just defined by your cut bounds?

-- Brad

-- 
Brad Sawatzky, PhD <brads at jlab.org>  -<>-  Jefferson Lab / Hall C / C111
  Ph: 757-269-5947 -<>- Pager: 757-584-5947 -<>- Fax: 757-269-5235
The most exciting phrase to hear in science, the one that heralds new
  discoveries, is not "Eureka!" but "That's funny..."   -- Isaac Asimov


More information about the d2n-analysis-talk mailing list