(file) Return to e01011nt.tex CVS log (file) (dir) Up to [HallC] / Documents / Howtos

File: [HallC] / Documents / Howtos / Attic / e01011nt.tex (download) / (as text)
Revision: 1.1.2.1, Tue Jun 14 18:45:17 2005 UTC (19 years, 3 months ago) by saw
Branch: hks05
Changes since 1.1: +183 -0 lines
First version

\documentclass{chowto}

\title{Using and Modifying HKS Ntuples}
\howtotype{user}
\category{general}
\experiment{HKS}
%\maintainer{} % Optional
\author{T. Miyoshi}
\date{June 15, 2004}

\begin{document}

\begin{abstract}
This document describes how to play with analysis code.
(1) how to play with ntuple, (2) how to examine subroutine code.
I describes only the standard Hall C way to create ntuple routine by users.
\end{abstract}

\section{Ntuple}

\subsection{Caution}

Ntuple can be huge file size. If you make ntuple, make sure 
your disk space is enough to store your file.
if disk space is not enough, avoid disk full.
Just copy your ntuple file to other local disk where
has more disk space.

Do not commit personal ntuple file on CVS.

Do not commit your own hks, enge and coin ntuple file.
These should be maintained by autholized person (analysis expert).
Especially we should share coin ntuple to avoid multiple results
from each university group.

\subsection{filename}

There are several names of ntuple prepared: 

\begin{verbatim}
  beam_ntuple        = 'paw/beam%d.rzdat' for beam 
  hks_ntuple         = 'paw/hks%d.rzdat'  for hks summary
  hks_DCntuple       = 'paw/hdc%d.rzdat'  for HDC
  hks_SCINntuple     = 'paw/hscin%d.rzdat' for HKS scintillator
  hks_CHntuple       = 'paw/hch%d.rzdat' for HKS Cherenkov
  enge_ntuple        = 'paw/enge%d.rzdat' for ENGE summary
  enge_DCntuple      = 'paw/edc%d.rzdat' for EDC
  enge_SCINntuple    = 'paw/escin%d.rzdat' for Enge scintillator
  enge_FISNtuple     = 'paw/efis%d.rzdat' for fission chamber
  coin_Ntuple        = 'paw/coin%d.rzdat' for coincidence (the most important!)
\end{verbatim}

These can be on/off in REPLAY.PARM. (i.e.,';beam$_-$ntuple' is off)

All the ntuple files are in e01011src/ENGINE:

\begin{verbatim}
e_scin_ntuple_keep.f for paw/escin%d.rzdat
e_dc_ntuple_keep.f   for paw/hdc%d.rzdat
e_fis_ntuple_keep.f  for paw/efis%d.rzdat
h_scin_ntuple_keep.f for paw/hscin%d.rzdat
h_ch_ntuple_keep.f   for paw/hch%d.rzdat
h_dc_ntuple_keep.f   for paw/hdc%d.rzdat
e_ntuple_keep.f      for paw/enge%d.rzdat
h_ntuple_keep.f      for paw/hks%d.rzdat
c_ntuple_keep.f      for paw/coin%d.rzdat

e_scin_ntuple_init.f for paw/escin%d.rzdat
e_dc_ntuple_init.f   for paw/hdc%d.rzdat
e_fis_ntuple_init.f  for paw/efis%d.rzdat
h_scin_ntuple_init.f for paw/hscin%d.rzdat
h_ch_ntuple_init.f   for paw/hch%d.rzdat
h_dc_ntuple_init.f   for paw/hdc%d.rzdat
e_ntuple_init.f      for paw/enge%d.rzdat
h_ntuple_init.f      for paw/hks%d.rzdat
c_ntuple_init.f      for paw/coin%d.rzdat
\end{verbatim}

hks$_-$ntuple, enge$_-$ntuple and coin$_-$ntuple are special files
to be shared in the entire HKS group. you can have the other ntuple in your own
directory but the ntuple is not maintained in CVS.

\subsection{Example of creating your own ntuple}

If you don't e01011-replay and e01011src, first

\begin{verbatim}
cvs checkout e01011src
cvs checkout e01011-replay
\end{verbatim}

Then, go to e01011-replay/SRC.

For example, if you want to have your own Cherenkov ntuple
in you own directory, copy h$_-$ch$_-$ntuple$_-$init.f and 
h$_-$ch$_-$ntuple$_-$keep.f
to your e01011-replay/SRC directory.
Then add the filenames in Makefile,

\begin{verbatim}
OBJS= engine.o h_ch_ntuple_init.o h_ch_ntuple_keep.o
\end{verbatim}

Where engine.o is a default file.
If you do make, the file on the same directory becomes up-to-date one.
Then, edit the two files. For example...
\begin{verbatim}
(all '!' is comment)

in h_ch_ntuple_init.f
...
m=0
m=m+1
h_ch_ntuple_tag(m)= 'ac11+'    ! 1. up to 8 characters
m=m+1
h_ch_ntuple_tag(m)= 'ac11-'    ! 1. up to 8 characters

h_ch_ntuple_size= m          !total size

...

-----------------

in h_ch_ntuple_keep.f

integer*4 temp_vector1(3,7),temp_vector2(3,7) ! vector definition
integer*4 la,co
...


Do i=1,3 ! initialize
  Do j=1,7
    temp_vector1(i,j)=0
    temp_vector2(i,j)=0
  EndDo
EndDo

Do i=1,haer_raw_tot_hits ! fill adc in vector
  la=haer_raw_layer_num(i) ! AC layer number
  co=haer_raw_counter_num(i) !AC segment number
  temp_vector1(la,co)=haer_rawadc_pos(i) !ADC+
  temp_vector2(la,co)=haer_rawadc_neg(i) !ADC-
EndDo


m=0   ! fill contents in ntuple vector
m=m+1
h_ch_ntuple_contents(m)= temp_vector1(1,1) ! ac11+ 
m=m+1
h_ch_ntuple_contents(m)= temp_vector2(1,1) ! ac11-
...

\end{verbatim}

Make sure h$_-$ch$_-$ntuple$_-$size= m  is the same as the number of contents in
the ntuple keep routine.

After editing, do make.
Then, edit REPLAY.PARM in e01011-replay/, turn on  hks$_-$CHntuple
then start replay. After finishing replay, you may find
hch[run number].rzdat in paw directory.  
To analyze ntuple, read paw manual, please.


\section{Examine source code}

 Editing and committing source code are basically autholized by
only analysis expert. However, if you want to examine some subroutine,
copy files from e01011src/ENGINE, HTRACKING or ETRACKING to
e01011-replay/SRC directory. For example, if you look at h$_-$aero.f and
add test$_-$aceff.f, copy e01011src/HTRACKING/h$_-$aero.f to 
e01011-replay/SRC/, create test$_-$aceff.f, add sentence 'call test$_-$aceff'
into h$_-$aero.f then, edit Makefile to add object file like 
OBJS=engine.o h$_-$aero.o test$_-$aero.o,
then do make. Go back to e01011-replay, then replay.

Do not commit your code without checking if (1) compile is passed,
(2) no core dump, (3) histogram/ntuple contents are fine, and (4) do not 
conflict filename.

\end{document}

% $Log: e01011nt.tex,v $
% Revision 1.1.2.1  2005/06/14 19:45:17  saw
% First version
%

Analyzer/Replay: Mark Jones, Documents: Stephen Wood
Powered by
ViewCVS 0.9.2-cvsgraph-1.4.0