FMS Simulation Issues

 The problem that we notices in last weeks FMS meeting was that there appeared to be a strange cutoff in the per-tower simulation at 50 GeV.
Mriganga made available an example of simulation code that he is running. 
https://drupal.star.bnl.gov/STAR/blog/mriganka/photon-recontruction-gstar

I copied and ran his example code and made a plot from the mudst.root file. This mudst.root file came from generation of 50 single photon geant events  with energies ranging from 30-120 GeV.  The plot below is for adc vs hit energy for higher energy towers.
 

As we noted last week, the problem is that the energy per tower cuts off at 50 GeV!

After I spent some time looking for a problem in the FMS analysis software, it became clear that the problem goes back to the Geant level.

By searching for a place where the number 50 occured in the code, I noticed it in the directories

pams/geometry/fpdmgeo

with files :
fpdmgeo1.g  fpdmgeo2.g  fpdmgeo3.g 

These ".g" files are written in a secret language known only to a few STAR experts. However I found in these files about 5 lines that looked like this

 HITS FLGR ELOS:0:(0,50)
 HITS FLGF ELOS:0:(0,50)
 HITS FLGX ELOS:0:(0,50)

so

I did a check out

cvs co pams/geometry

to get the files locally then I replaced (0:50) with (0:150)

I ran cons and created a new local geometry.so  library and pointed the geant .kumac macro to that library.

Finally I ran another 50 events with energies between 50 and 100 GeV. 

The mriganka's geant kumac was now changed to

-------simJetRequest.kumac----------------------------

*
* Macro to generate ntrack particles. Note with the option E
* (last argument of gkine for energy range instead of pT range)
* the PDG numbering scheme is used for the particle ID.
* See also 'help gkine' inside starsim.
*
macro singletrack outfile=test.fzd nevents=50 ntrack=1 pid=22 ptlow=50.0 pthigh=100.  ylow=3.60 yhigh=3.61 philow=-3.1416 phihigh=3.
1416 zlow=0. zhigh=0. option=E seed=0
debug on
gfile o [outfile]
detp geom y2012 field=-5.0 hadr_on split_off
gexec .sl64_gcc447/lib/geometry.so
gexec $STAR_LIB/gstar.so
gclose all
rndm [seed] 1
do i=1,[nevents]
  mess [i]
  gkine [ntrack] [pid] [ptlow] [pthigh] [ylow] [yhigh] [philow] [phihigh] [zlow] [zhigh] [option]
  trig
  gprint vert
  gprint kine
  gprint hits
enddo
quit

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

So this runs 50 events with the changed geometry.so library and with photon energies from 50 to 100 GeV into pseudorapidity of about 3.6

The corresponding plot of adc vs energy for fms hits is now shown below.

We did get rid of the 50 GeV cuttoff in the fms energy distribution.

The only problem is that I can only guess what this line of code " HITS FLGR ELOS:0:(0,50)"  in the "*.g" files does. I have no idea why a limit like this is placed in the geometry definition files or even exactly what these files do for the FMS simulation (they are named with "fpd").  I assume that some or all of these files are for the FMS. 

 Someone who knows what this STAR geometry  language does should think about this.