Introduction to PASSx ntuple analysis last update: 2002-July-24 (Wed) Takeshi K. Komatsubara (KEK-IPNS) 1. Find where the nutples are. - The pnn1or2 "autorun" PASS2 ntuples at bnlku7 are in /e949dsk/towb09/e949/autorun/pass2_pnn1or2/ntuple/analyzed/ - The pnn1or2 "autorun" PASS2 ntuples at hestia are in /scr10/e949/autorun/pass2_pnn1or2/ntuple/analyzed/ 2. Set a symbolic link to the directory. A shorter name is better. %ln -si /scr10/e949/autorun/pass2_pnn1or2/ntuple/analyzed/ 02pnn 3. In a kumac file, the chain to the ntuples are setup, using chain_nt.kumac, by PAW>exec chain_nt ./02pnn 0 pnn02 * Or, create a kumac file to chain the ntuple inputs. % ./chain_create_pnn1or2-02.csh and, with chain_create_pnn1or2-02.awk, the kumac file chain_pnn1or2-02.kumac is created. In a kumac file, PAW> exec chain_pnn1or2-02.kumac PAW> cd //pnn02 and you are ready to analyzing ntuples 4. Analyze the ntuples. Example: pnn1or2-02.kumac : kumac for analysis PAW> exec pnn1or2-02.kumac and do everything template_histo.kumac : kumac for histogramming macro define : define HBOOK histograms macro process : process histos if necessary macro display : display histos template.f : fortran file for analysis nt/loop 1 template.f and the code is analyzing event by event (as DPLOT in KOFIA). 5. edit and make your own template.f and template_histo.kumac o template.f - SAVE statement does not work in FORtran-PAW ( though all the variabes are SAVEd without the statement ). - 'pass2nt.inc', the variables of the ntuples to be included to the fortran file: Unfortunately the "uwfunc" implemented in PAW does not work, because the number of variables in the PASSx ntuples are huge! PAW > hi/file 1 02pnn1or2/pass2_pnn1or2_197.nt.001 RZOPEN: LRECL inconsistant - file was opened with LRECL = 1024 should be LRECL = 4096 PAW > uwfunc 1 test.inc ---> HUWFUN: Not space to store COMMON definition PAW > There is a special "uwfunc" executable made by TRIUMF people. See /e949d/e949/utc/run/paw/uwfunc (or ufwunc in this directory). bnlku7 35% ./uwfunc Enter ntuple file name: 02pnn1or2/pass2_pnn1or2_197.nt.001 Enter ntuple # [ 1]:1 Enter generated file name [uwfunc]: test.inc Open input file: 02pnn1or2/pass2_pnn1or2_197.nt.001 bnlku7 36% and the following files are created. - test.inc.P for paw (to be copied to pass2nt.inc) - test.inc.B for KOFIA code - to understand the variables of the ntuples, you should check the analysis code that is creating the "autorun" ntuples: % setup pass2 02 % cd $PASS2_SOURCE or ask experts for help. 6. profile plots to check the runNo.-dependence of the "efficiency" of a cut or a condition [2002-July-24] In template_histo.kumac. macro define, profile 2002 'fitpi eff in pnn1' 130 49000.0 50300.0 -1.0 2.0 and in template.f IF(T_pnn1) THEN rcut=0.0 IF(ipiflg.eq.0) THEN rcut=1.0 ELSE END IF call hfill(2002, float(run) , rcut,1.0) END IF Then the plot ID=2002 is the runNo.-dependence of the ratio of the pnn1 events that pass the "FITPI cut(ipiflg.eq.0)". If you want to make the plot of the runNo.-dependence of the Rejection, rather than the "(in)efficiency", you can process the profile plot ID=2002 with "inv_his.kumac" . In template_histo.kumac. macro process, exec inv_his 2002 2003 'fitpi rejection in pnn1' and a new plot ID=2003 that presents the runNo.-dependence of the Rejection (== the reciprocal of the ratios in ID=2002) is created. 7. plots to check the runNo.-dependence of the fitted "mean" and "sigma" of the peak. [2002-July-24] In template_histo.kumac. macro define, profile 2011 'CCDa Top DS' 130 49000.0 50300.0 -10.0 10.0 2d 2021 'CCDa Top DS' 130 49000.0 50300.0 100 -10.0 10.0 0. and in template.f Do i=1,npvbs ... IF(ISTR.eq.2.and.ICR.eq.1) THEN C... CCDA top detector strobe call hfill(2011, float(run) , tpvbs(i) ,1.0) call hfill(2021, float(run) , tpvbs(i) ,1.0) ... END IF End Do Then the plot ID=2011 is the runNo.-dependence of the DStrobe timing in profile plot, and the plot ID=2021 is the scatter plot of runNo. vs the DStrobe timing. The profile plot ID=2011 simply shows the average and the standard deviation of the entries in each X-bin. If you want to make the runNo.-dependence of the fitted "mean" and "sigma" of the peak in each X-bin, you can process the scatter plot ID=2021 with "prj.kumac" . In template_histo.kumac. macro process, exec prj#prj_fity 2021 36 65 30 2031 'CCDa Top DS fitted-mean' 5.0 2041 'CCDa Top DS fitted-sigma' 5.0 0 the distribution of the Y-bins from j=36 to j=65 (t=-3.0ns to t=+3.0ns) in each X-bin, if the total number of entries in the region is more than 30, is fitted by Gaussian, and - the runNo.-dependence of the fitted mean is plotted to ID=2031, with the title 'CCDa Top DS fitted-mean', in the range from -5.0ns to +5.0ns - the runNo.-dependence of the fitted sigma is plotted to ID=2041, with the title 'CCDa Top DS fitted-sigma', in the range from 0ns to +5.0ns. - If you put "2051 'CCDa Top DS fitted-bgd' 50.0" instead of "0" the distribution is fitted by Gausian+flat_background, and the runNo.-dependence of the fitted background is plotted to ID=2051. *** REMIND: macro prj_fity in prj.kumac uses the histograms ID=1 to ID=130 (number of X-bins) for fitting. These IDs should not be used in template.f/template_histo.kumac ***** The histogram of the timing distribution in specific X-bins, say i=11 to 30 (runs 49100 to 49300), you can plocess the scatter plot ID=2021 as exec prj#prj_sumx 2061 'CCDa Top DS runs 49100-49300' 2021 11 30 and make the plot ID=2061. +++ End of this document