RS Light Yield and Attenuation Length Calculations


General Description

    This study is a part of the TD energy calibration. It was originally done by Millind.
If you would like to know some backgrounds about this study, you can find his tech note in E787 TN-362.
For the use of E949, some modifications were made which were mainly the change of RS layers (21 layers to 19 layers)
and the use of RS TDCs for a track finding. The recent modification was that a track which pass through the layer 19
was allowed in the fcn_trkrng.F. This modification made the correct range calculation in layer 19 possible.


Utilities

The utilities below are available here.

How to do the study?

    In order to create ntuples for this study, some special subroutines other than the standard
PASS2 code are needed. You need to copy the files below into your PASS2 source directory and
modify your 'Makefile' to include these subroutines.
    Once your own executable is created, you should run it on ## km22 ## monitor data.
A run script 'pass2_anal_tdcal.csh' is available here. The script has three arguments.

<< usage >>
% pass2_anal_tdcal.csh [data directory] [output directory] [# of jobs]

For example,
% pass2_anal_tdcal.csh /data1/e949/data/km22 ./nt 4

<< Arguments >>
data directory : Directory containing raw data to run
output directory : Directory to put ntuples and log files
# of jobs : The maximum number of jobs allowed to run simulteneously on a machine.
                 You should type a value less than the number of CPUs on a machine.

    After your PASS2 job is finished, you should run the paw job. If the ntuples are distributed on
many machines and you want to run the paw job on each machine, you can use 'distributed paw jobs'.
The instruction can be found in a Joe's message. You can use a script run_dist_paw.csh, but
you need to modify it based on your machine environment.

At first, you need to create an include file pass2nt.inc.

% uwfunc
 Enter ntuple file name: [km22_50218.nt.001, for example]
 Enter ntuple # [ 1]: [return]
 Enter generated file name [uwfunc]: [pass2nt, for example]
 Open input file: km22_50218.nt.001

An include file 'pass2nt.P' will be created.
You should rename it.
% mv pass2nt.P pass2nt.inc

You can then run paw jobs by manual or the script.

<< By manual >>
% paw < km22_2002.input
or
% paw < km22_2002.input >& logfile
==> output histogram file : histfile.km22_2002.xxx (xxx is 3 digit number like 001)

<< By the script >>
% run_dist_paw.csh km22_2002
==> output histogram files : histfile.km22_2002.xxx.machine ('machine' means the machine's hostname)

Note that the comis function 'km22_2002.f' does not use any tight cuts. If you want to use them,
you should modify km22_2002.f.


    In the next, you should create calibration files for light yield and attenuation length.
In paw, you need to type commands as follows,

PAW > hist/file 1 histfile.km22_2002.001
if you ran paw jobs on several machines, chain all of them.
PAW > chain f histfile.km22_2002.001.machine1
PAW > chain f histfile.km22_2002.001.machine2
                                    ....
PAW > cd //f

Then, execute kumac files.
PAW > exec plot_att

==> result_att.txt and result_gain.txt will be created.

PAW > exec plot_npe
==> result_pe_all.txt will be created.

You should confirm that values in the output text files are correct.
Sometimes fittings of histograms are bad and calculations screw up.
In this case, you should fit the histograms by hand.

    Finally, you create some plots to see the year dependence of the light yield and attenuation length.
What you do is just to execute the scripts att_years.kumac and npe_years.kumac in paw.

PAW > exec att_years
PAW > exec npe_years

Then you can see the plots on the display (attenuation length and light yield).

    If you want to add new data points, you need to modify the kumac files.
I think you can easily modify the kumac in the same way as done there.




T. Sekiguchi
. 07/29/2004