#
# Quick notes to remember the procedures to generate light collection plots
# June 3, 2009  ES
#
# all files are checked into svn https://halldsvn.jlab.org/repos/trunk/home/elton/geantguide
#
General comment: Currently the process is quite cumbersome, but flexible. There are 
several places where editing is required. This could be streamlined with a common input
file. The code is "legacy" copied from previous work and adapted for "quick studies."
However, just in producing two different configurations, I find that it takes time to 
generate the geometry files and configure the program in a consistent manner. 

Files that need editing as geometry changes

input.dat - currently the only parameter modified is 'kine' last argument (z vertex)
gukine2  - generation of light ray distributions
draw_trigs.kumac - kumac which draws light guides inside of GEANT3 (gbcal-int executable)
uhinit.f - defines histograms, data lines must be modified as geometry changes
ugeom.f - defines geometry, must be updated as geometry changes in several places. 
          In particular, see GEANT3 User's Guide GEOM 001 and GEOM 050
gustep.f - called at each step, fills histograms, data lines must be modified as geometry changes
plot_guide.kumac - kumac which plots histograms output by gbcal-int in file gntbcal.hbook

Files that might need editing occasionally:

cerenkov.f - Must be changed if material parameters are changed (e.g. attenuation length, 
             reflectivity, index of refraction, etc.). Note that the detailed wavelength
             dependence of many parameters is by-passed. A simplified routine would currently
             suffice.

To compile and link executable gbcal-int and use (example session)
eltonsmac:geantguide>make


eltonsmac:geantguide>gbcal-int 
  *************************************************** 
  *                                                 * 
  *               G E A N T   3 . 2 1               * 
  *                                                 * 
  *                    C E R N                      * 
  *                                                 * 
  *               15/3/94  Geneva  CH               * 
  *                                                 * 
  *************************************************** 

 MZSTOR.  ZEBRA table base TAB(0) in /MZCC/ at adr    37260855     2388E37 HEX

 MZSTOR.  Initialize Store  0  in /GCBANK/
          with Store/Table at absolute adrs    12695253    37260855
                                        HEX      C1B6D5     2388E37
                                        HEX    FE8926E6           0
                              relative adrs   -24566042           0
          with     1 Str. in     2 Links in   5300 Low words in14999970 words.
          This store has a fence of   16 words.

 MZLOGL.  Set Log Level 0 for store  0

 MZSTOR.  Initialize Store  1  in /PAWC/  
          with Store/Table at absolute adrs    27695337    36694928
                                        HEX     1A698E9     22FEB90
                                        HEX    FF6E08FA    FFF75D59
                              relative adrs    -9565958     -565927
          with     1 Str. in     1 Links in   5001 Low words in 8999990 words.
          This store has a fence of    5 words.

 MZLINK.  Initialize Link Area  /HCBOOK/  for Store  1 NL/NS=    49     4

 MZDIV.   Initialize Division  KUIP Div  in Store  1
          NW/NWMAX=   50009000000,  MODE/KIND=  1  1
          Division  3 initialized.

 MZLINK.  Initialize Link Area  /KCLINK/  for Store  1 NL/NS=    20     7

 MZLINK.  Initialize Link Area  /KCVADD/  for Store  1 NL/NS=    16    16
 ******************************************************
 *                                                    *
 *            W E L C O M E    to   P A W             *
 *                                                    *
 *       Version 2.14/04      12 January 2004         *
 *                                                    *
 ******************************************************
 Workstation type (?=HELP) <CR>=1 :


......lots of GEANT3 output (useful for debugging)

 
GEANT > exe draw_trigs
 Finished successfully
 Finished successfully
 Finished successfully
 Finished successfully
 Finished successfully
GEANT > trig 10000
 Finished successfully

GEANT > exit
1         **** NUMBER OF EVENTS PROCESSED =        41
          **** RANDOM NUMBER GENERATOR AFTER LAST COMPLETE EVENT   1078150071  1131551837
          **** TIME TO PROCESS ONE EVENT IS =    0.2927 SECONDS





eltonsmac:geantguide>pawX11
 ******************************************************
 *                                                    *
 *            W E L C O M E    to   P A W             *
 *                                                    *
 *       Version 2.14/04      12 January 2004         *
 *                                                    *
 ******************************************************
 Workstation type (?=HELP) <CR>=1 : 
 Version 1.29/04 of HIGZ started
 *** No default PAWLOGON file "/Users/elton/.pawlogon.kumac" found

PAW > exe plot_guide
 utilGenColormap: Generating new colormap rgb with 49 levels
Type <CR> to continue or Q to quit 
PAW > 
PAW > exit

            
eltonsmac:geantguide>gv plot_guide.ps