Gams reconstruction

From GlueXWiki
Jump to: navigation, search

Short description of the reconstruction package developed for GAMS

(with changes and updates)


Code location:

svn ls https://halldsvn.jlab.org/repos/trunk/Studies/eta/gams



Package includes:

adcgam_bk.inc common with output reconstruction

phot_cell_cbk_mc.inc common with shower profile parameters

cphoto.inc common with control keys, flags and other aux. variables


addhits_lib.F generates hits based on shower library data

addhits_sim.F performs hits generation using fast simulation based on profile functions


isim.F main routine calling others to generate hits

recon_sim.F contains reconstruction package itself


guout.F call recon_sim() from here to get event reconstruction

gustep.F call isim(chdet,chsimopt) to simulate and store hits. Normally, after that particle stops in GUSTEP (ISTOP = 1) to avoid multiple counting



Files description:

adcgam_bk.inc Reconstruction common looks like:

Real:

energy_adcgam(1,i) - energy in GeV
     x_adcgam(1,i) - log. method x-coord (angular correction applied)
     y_adcgam(1,i) - log. method y-coord (angular correction applied)
     z_adcgam(1,i) - z-coord
    xc_adcgam(1,i) - center of gravity x-coord (no angular correction and global alignment - internal ref. syst.)
    yc_adcgam(1,i) - center of gravity y-coord (no angular correction and global alignment - internal ref. syst.)
  chi2_adcgam(1,i) - chi2

Integer:

  type_adcgam(1,i) - type of the gamma:
 = 0 default value
+= 1 or 2 for clusters selected by splitting single maxima shape
+= 10 for clusters selected from mutlimaxima island
+= 100 for LG clusters in hybrid detector
 = 50 + type1 + type2 for merged together subclusters 1 and 2 (transition case)
(hole size is hardcoded to 5x5 cells for PWO and 3x3 cells for LG)
dime_adcgam(1,i) - number of counters in the gamma id_adcgam(1,i) - id of the cell with the max energy deposition: = 10*col+row nadcgam - number of reconstructions in event (i = 1 ... nadcgam)


isim.F - control keys and options:

chdet = hybrid or lg, - simulate Hybrid (120x120cm pwo and LG outer part) or "regular" LG FCAL

chsimopt = simfast, libr or libs for fast profile simulation or to read clusters from library (sequentially or randomly) To use library option enviroment LIB_DIR must be set to directory containing library files. Files currently located at /w/work/hallb/primex/pdisk/ilarin/tmp/lib and also stored at /mss/hallb/primex2/mcdata/ilarin/simplified_shower_libary_for_pwo.tar.gz

Library has 7 energy and 15 geometry points (total 7x15=105 cells). Each cell has up to 100000 statistics written. Usage of large statistics needed only when running for high number of events in user Monte-Carlo. It will take some time to read the library (during the program startup). For not too high number of events in user Monte-Carlo (upto 100k-1M) one can use 1k-10k library events per cell which will allow program startup relatively fast (upto 2 minutes). Since this code does not use dynamical arrays in FORTRAN, the depth to be used (number of library events per cell) is hardcoded to avoid of usage of unnecessary memory. It is defined by preprocessor variable _MAXEVE_ in addhits_lib.F file (default value is 1k).


addhits_sim.F and addhits_lib.F: generate response for

e+/e-/gamma - library read or simfast,

other types - for now simfast only:

MIP - gaussian energy deposition in single cell, with mean value 210MeV for LG or 280MeV for pwo or MIP energy if it is less than these constants, and sigma 6.2% for LG or 6.4% for pwo
neutral hadrons - parametrized ugly shape from GAMS,
                  probab. of shower is given by nulc. length
charged hadrons = neutral hadrons + MIP


 isim.F - flags and options:

zmcplane = 625.0506cm - FCal upstream surf. z

main settings are in init_sim_geom (file isim.F):

     min_energy = 0.1        - [GeV] clusters energy threshold
     global_gain= 1.000      - global energy gain, useful to quickly correct energy scale
     delch      = 4.         - minimum chi2 improvement sufficient for algorithm to decide to split 2 clusters from the signle maximum shape. Note, that chi2 here is not reduced (i.e. = reduced chi2 times Ndof, since Ndof is different for single and separated hits cases)
     xm2cut     = 1.2        - min inv. mass divided by energy sum to split hits from single maximum (could be removed by setting to 0)
     minpk      = 9          - (in 10MeV units) minimum cell energy to be good for the peak of the island, note that this cut indirectly affects on cluster min energy. Not recomended to set to less than 3.
     chisq1     = 3          - min (reduced) chi2 to try to split shape at preliminary stage
     chisq2     = 1.4 (was 0.4)  - min (reduced) chi2 to try to split shape at final stage
     event_display = 0       - whether to run event display (option removed to allow hybrid)

Some things to be done:

*) implement shower library for LG
*) restore Event Display for hybrid option
*) switch from chi2 to loglikelihood in reoncstruction
*) introduce chi2x and chi2y for x and y reconstruction
*) switch from rndm,rannor,etc to grndm,granor,etc


Other things which could / should be useful:

*) timing information usage
*) improve MIP and hadronic simulations
*) MC matching
*) minpk parameter dependent on total "island" energy