[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with cosmics triggers files (fwd)




Hi Andrei and Zisis,

    They got the farm networking issues fixed and I have taken a look at 
the files. The problem is that the format of the TTree was changed a 
couple of times last year to add new branches. Namely, files produced 
after June 22, 2007 included the "tmean" values which are timewalk 
corrected mean times. Here is the svn comment:

/------------------------------------------------------------------------
r2712 | davidl | 2007-06-22 12:38:07 -0400 (Fri, 22 Jun 2007) | 1 line

Added timewalk corrected mean times for each cell. Only cells 7,8, and 9 
have timewalk corrections derived from the data for those channels. All 
other channels use the parameters derived for cell 9. These corrections 
come from Blake's April 6th, 2007 wiki page. Also modified sort 
algorithm for photons in tree to be based on closest time to bcal cell 8 
timewalk corrected mean time.
------------------------------------------------------------------------
/
In principle, we can regenerate these files to include the timewalk 
corrected mean times. However, I don't know how reliable the corrected 
values would be for anything but cells 7,8, and 9 unless there are new 
timewalk functions available for all cells.

Files produced before between June 8,2007 and June 22, 2007 did not have 
the mean times, but did have tagger t-counter id numbers. These, of 
course, are not relevant for cosmic studies. I mention it because it was 
a slightly different format for the TTree.

Files produced prior to June 8, 2007 had neither the mean times nor the 
t-counter ids and so represent a 3rd format of the TTree.

I have made variants of the trig_filter.C macro called 
trig_filter_tree1.C and trig_filter_tree2.C that work with these 
formats. There are also lists of the original bcal_dst produced root 
files for each of the 3 formats called tree1files.txt, tree2files.txt, 
and tree3files.txt.

The new scripts have now been run on the appropriate files and it looks 
like things are better.

As for combining the files into a single one, I'll suggest the following 
(which you may have already considered). One can easily use a TChain to 
effectively combine files so that it acts like a single TTree. For 
example, suppose you gathered all of the root files you wished to 
process into a single directory (with no other root files present). 
Then, the following could be used:

*void TChain_example(void)
{
    gROOT->Reset();
    TChain *bcal = new TChain("bcal");
    bcal->Add("bcal_dst*_t6.root/bcal");

    bcal->Draw("trig");
}
*
The one caveat here is that this can only be used with files that have 
trees with exactly the same definition. Therefore, it won't work if you 
try combining trees of type 1 with trees of type 2 as described above.

Finally, I'm CC-ing this to the halld-cal mailing list since the 
exchange has grown to a level worth documenting.

Let me know if you discover any more problems.

Regards,
-David

David Lawrence wrote:
>
> Hi Andrei,
>
>    I'll take a look and let you know what I find.
>
> Regards,
> -David
>
> Andrei Semenov wrote:
>> It looks like my previous e-mail did not reach both David and Zisis, 
>> so I
>> re-send it now again.
>>
>> Thank you,
>> Andrei
>>
>>
>>
>> ---------- Forwarded message ----------
>> Date: Fri, 25 Apr 2008 18:56:25 -0400 (EDT)
>> From: Andrei Semenov <semenov@jlab.org>
>> To: David Lawrence <davidl@jlab.org>
>> Cc: Zisis Papandreou <zisis@uregina.ca>
>> Subject: Problems with cosmics triggers files
>>
>>
>> David:
>>
>> I had a look on the /work/halld/bcal06/bcal_dst0????_t6.root files (that
>> were created 2 days ago), and it looks like these files are empty: 
>> some of
>> the files (like run 2371) have the size of about 370 bytes and no ntuple
>> structure inside; the rest of the files has the ntuple structure but
>> filled with zeroes... I checked a couple original ntuples with 
>> "trig==32"
>> condition, and it looks like the data are OK (in original ntuples).
>>
>> Could you please have a look?
>>
>> Is it a big problem to direct whole output to one summary file?
>>
>> Thank you,
>> Andrei
>>
>>
>>
>>
>> On Wed, 23 Apr 2008, David Lawrence wrote:
>>
>>  
>>> Hi Zisis and Andrei,
>>>
>>>     I have written a script that will copy events from a file created
>>> with bcal_dst into a new file, but filtered such that only certain
>>> triggers are kept. Right now, it just creates one output file for a
>>> single input file. I assume the outputs can be chained together using
>>> TChain to give the same functionality as copying them all into a single
>>> file.
>>>
>>>     The script is called trig_filter.C and it currently exists in the
>>> /work/halld/bcal06 directory on the JLab CUE. It has some minimal
>>> documentation at the top that describes what it does and how to use it.
>>> I am currently running it on every bcal_dst-generated file in the 
>>> bcal06
>>> directory to filter out events with trigger 6 set. The filtered files
>>> have names based on the input files', but with an "_t6" appended to the
>>> base name.
>>>
>>>     The trees in the filtered files also have another branch to hold 
>>> the
>>> run number as per Andrei's request. It derives this from the name of 
>>> the
>>> input ROOT file. This worked OK on my first test case, but I haven't
>>> checked it beyond that.
>>>
>>>     This should be done running in a couple of hours. Please let me 
>>> know
>>> if you'd like something else or need help with the chaining.
>>>
>>> Regards,
>>> -David
>>>
>>>
>>> Zisis Papandreou wrote:
>>>    
>>>> No sweat, it has been chaotic here too.
>>>>
>>>> Thanks David.
>>>>
>>>> Cheers, Zisis...
>>>>
>>>>
>>>> On Apr 23, 2008, at 3:37 AM, David Lawrence wrote:
>>>>
>>>>      
>>>>> Hi Guys,
>>>>>
>>>>>    Oops! I guess with everything else that was going on, I completely
>>>>> forgot about this by the time I finally got back to my desk at JLab.
>>>>> I'll get started on this today. I've very sorry about the delay and
>>>>> I'll let you know one something is available.
>>>>>
>>>>> Regards,
>>>>> -David
>>>>>
>>>>> Zisis Papandreou wrote:
>>>>>        
>>>>>> Hi David:
>>>>>>
>>>>>> just a gentle reminder that we are waiting to hear from you on
>>>>>> getting help to chain the TS cosmics trigger events from the photon
>>>>>> runs, for Andrei's timing resolution study.  Are you still able and
>>>>>> willing to help us with code to produce a single ROOT file with
>>>>>> these events from days of running with photons?
>>>>>>
>>>>>> Cheers, Zisis...
>>>>>>
>>>>>> ---
>>>>>> Dr. Zisis Papandreou |  email: zisis@uregina.ca
>>>>>> <mailto:zisis@uregina.ca>
>>>>>> Department of Physics |  tel. : (306) 585-5379
>>>>>> University of Regina |  tel. : (306) 585-4149
>>>>>> Regina, SK  S4S 0A2 |  fax. : (306) 585-5659
>>>>>> World Wide Web:    http://www.phys.uregina.ca/sparro/zisis/
>>>>>>
>>>>>>
>>>>>>           
>>>>> -- 
>>>>>
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>>  David Lawrence Ph.D.
>>>>>  Staff Scientist                 Office: (757)269-5567   [[[  [   [
>>>>> [        Jefferson Lab                   Pager:  (757)584-5567   [  [
>>>>> [ [ [ [    http://www.jlab.org/~davidl
>>>>> <http://www.jlab.org/%7Edavidl>     davidl@jlab.org
>>>>> <mailto:davidl@jlab.org>         [[[  [[ [[ [[[
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>         
>>>> ---
>>>> Dr. Zisis Papandreou |  email: zisis@uregina.ca 
>>>> <mailto:zisis@uregina.ca>
>>>> Department of Physics |  tel. : (306) 585-5379
>>>> University of Regina |  tel. : (306) 585-4149
>>>> Regina, SK  S4S 0A2 |  fax. : (306) 585-5659
>>>> World Wide Web:    http://www.phys.uregina.ca/sparro/zisis/
>>>>
>>>>
>>>>       
>>> -- 
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>   David Lawrence Ph.D.
>>>   Staff Scientist                 Office: (757)269-5567   [[[  [   [ [
>>>   Jefferson Lab                   Pager:  (757)584-5567   [  [ [ [ [ [
>>>   http://www.jlab.org/~davidl     davidl@jlab.org         [[[  [[ [[ 
>>> [[[
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>>
>>>
>>>
>>>     
>>
>>   
>

-- 

------------------------------------------------------------------------
  David Lawrence Ph.D.
  Staff Scientist                 Office: (757)269-5567   [[[  [   [ [       
  Jefferson Lab                   Pager:  (757)584-5567   [  [ [ [ [ [   
  http://www.jlab.org/~davidl     davidl@jlab.org         [[[  [[ [[ [[[
------------------------------------------------------------------------