FGT. . . . . . . . . . S I M U L A T I O N S

Simulation of physics background for development of e/h algo. ( Physics Background Simulation)  

Selected topics:


Physics Background Simulation

Ongoing effort of preparing physics-background samples for developing of e/h discrimination algos for W reconstruction

Existing Framework For FGT Simulations

With the completion of the FGT hardware review, focus must now be made on the creation and implementation of efficient analysis algorithms. To this end a framework for creating simulation files must be established. Here I document the existing framework I created this past summer for a small FGT project.
    The creation of simulation files within STAR is handled in two steps.

  • starsim is called with a PYTHIA kumac, creating a fzd file.
  • The fzd file is converted to a full muDst with the bfc.

The kumac sets all parameters of the underlying physics events, while the bfc handles the fine tuning of the reconstruction of the STAR detector.
    In the following analysis the simulation was split by the underlying physics processes: those producing W bosons and those from QCD 2->2 interactions. Both are produced with the geometry UPGR13 and sqrt(s) = 500 GeV, in accordance with the FGT upgrade. Moreover, each kumac accepts a random number seed to ensure that different jobs are independent of each other.  Specific details are included below,

PYTHIA Settings
  W Hadron
Geometry UPGR13 UPGR13
sqrt(s) 500 GeV 500 GeV
Vertex (mean, variance) 0 cm, 60 cm 0 cm, 60 cm
Subprocesses 2, 15, 20, 23, 25, 31 11, 12, 13, 28, 53, 68, 96
CKIN3 10 GeV 10 GeV
CKIN4 None None
Additional Cuts Require electron in the endcap with pT > 15 GeV None
Additional Notes W bosons made explicitly unstable None
Events / Job 4000 2000
Cross Section / Job O(103 pb) O(103 pb)
PYTHIA + GSTAR + BFC Running Time / Job O(20 hours) O(16 hours)
PYTHIA  + GSTAR Running Time / Job O(12 hours) O(6 hours)
Memory Used / Job O(1000 MB) O(1500 MB)
Size of Output Files / Job O(2.5 GB) O(2.5 GB)
Once starsim has completed, the files are processed through the bfc with the command

bfc.C\(1,nEvents,"trs ssd upgr13 pixFastSim Idst IAna l0 tpcI fcf Tree logger ITTF Sti StiRnd PixelIT IstIT StiPulls genvtx NoSvtIt SsdIt MakeEvent McEvent geant evoutgeantout IdTruth tags bbcSim emcY2 EEfs big -dstout fzin MiniMcMk McEvOut clearmem","fileName.fzd")

Detailed log files can be found at


while the existing files are at


Attached are the relevant scripts (the _.txt has been added to get around DRUPAL attachment restrictions), although the hardcoded paths are no longer valid.  The master script is submit_simulations.csh, which submits all the others to the RCAS queue star_cas_big.  In particular, W_job.csh and hadron_job.csh are each called with the command line arguments

*_job.csh <em>nEvents fileName randomNumberSeed

The *_job.csh scrips then call the starsim and bfc with the necessary arguments passed as appropriate.

Filtered Simulations For The Development of Electron/Hadron Discrimination Algorithms

Critical to the upcoming flavor physics at STAR is efficient electron identification in the endcap, particularly amongst the dominant charged hadron/meson background.  The development of such discrimination algorithms, however, requires extensive simulations.  To reduce the computational burden of these simulations to a practical level we must modify starsim, reconstructing only those events of interest.

In this case we require electrons and charged hadrons/mesons in the endcap, and by adding a filter to PYTHIA we can ensure that only events matching the this criteria are reconstructed.  Below is a small study showing the significant reduction in computing time gained with this filtering.

The filtered simulations required a charged hadron or meson in the endcap with pT > 15 GeV before GSTAR was allowed to reconstruct the event.  Candidate refers to an event meeting the above requirements in the PYTHIA record, and projected refers to an extrapolation estimate for 80 pb-1.

Hadrons/Mesons Filtered Filtered (Projected) Unfiltered Unfiltered (Projected)
Candidates 10 18,604 10 18,604
Reconstructed GEANT Events 10 18,604 2863 5,326,325
Integrated Luminousity (pb-1) 0.043 80 0.043 80
Starsim Running Time (hours) 0.274 509  7.42  13,817
BFC Running Time (hours) 0.845 1572  24.2  45,023

Looking at the tracks in the GEANT record we see that the filtering worked as described.  Here every charged hadron/meson in every reconstructed event is shown, and in the Filtered sample we see a sharp cutoff at 15 GeV exactly as expected. 

The same analysis can be done for the W boson simulations, here instead requiring an electron(positron) from a W decay in the endcap with pT > 15 GeV.

Ws Filtered Filtered (Projected) Unfiltered Unfiltered (Projected)
Candidates 10  672 10  672
Reconstructed GEANT Events 10 10 357  24,020
Integrated Luminousity (pb-1)  1.189 80  1.189 80
Starsim Running Time (hours)  0.0361  2.42  0.822  55.3
BFC Running Time (hours)  0.0882  5.93  2.807  188.8

Again, comparing the two files shows the desired effects

In both cases the computational demands seem impractical, but one has to remember that this extrapolation is based on the use of a single processor.  Real jobs will be run in parallel, significantly reducing the projected times to more reasonable levels.  Despite the reduction, however, it might still be necessary to reduce the desired integrated luminousity slightly.

Filtering PYTHIA Events In Starsim

Within the STAR framework, simulation files are created with the command starsim which runs both PYTHIA and GEANT.  Unfortunately, this means that there is no straightforward way to filter PYTHIA events before the GEANT reconstruction and producing simulation files for rare events can be very time consuming, as most of the CPU is wasted on the GEANT reconstruction of undesired events.

The trick around this is to modify the PYTHIA libraries themselves.  In particular we want to modify the PYEVNT subroutine which is run during the generation of each PYTHIA event.  Begin by

  •     Checking out a copy of the pythia libraries from cvs
  •     Create a back up of pyevnt.F in case anything goes wrong
  •     Open up pyevnt.F in your favorite text editor
  •     Now create your own subroutine, SUBROUTINE PYEVNT
  •     Copy the variable declarations and commonblocks from the original PYEVNT

The body of this new subroutine will in general go as the following

while(conditions have not been met)

Call the original PYEVNT
Call any necessary auxillery subroutines
Loop over particles
if(not desired characteristic a) continue
if(not desired characteristic b) continue
if(not desired characteristic i) continue
Calculate relevant kinematic variables
Check conditions

Note that to avoid too many nested if loops we abort when the first test fails.

For example, consider an analysis requiring a high energy electron in the endcap.  The usual PYTHIA settings allow one to require a high energy electron, but there is no way to restrict its location in the detector.  So in the above pseudocode becomes

while(no high pT electron in the endcap)

Call the original PYEVNT
Loop over particles
if(not electron) continue
Calculate pT
Calculate eta
if(pT < 15) continue
if(eta < 1) continue
if(eta > 2) continue

The main background to the above is charged hadrons/mesons.  In order to filter these we require that the particle has a charge of +/- 1, that is has the PDG ID of a hadron or a meson, that it has not decayed in the PYTHIA record, and fulfills the kinematic requirements.

while(no high pT jet in the endcap)

Call the original PYEVNT
Loop over the jets at the end of the PYTHIA record
if(not stable) continue
if(charge not equal +/- 1) continue
if(not hadron or meson) continue
Calculate pT
Calculate eta
if(pT < 15) continue
if(eta < 1) continue
if(eta > 2) continue

Once pyevnt.F has been succussfully modified it must be compiled with cons, and the path to the compiled library itself must be explicitly set in the kumac.  For example,

gexec $STAR_LIB/libpythia_6410.so

must be replaced by

gexec /star/u/username/path_to_directory/.slxx_gccxxxx/lib/name_of_new_pythia_library.so

Examples of modified pyevnt.F files for both the electron example and the jet example are attached, as is a kumac for use with the jet example.

List of available M-C event samples (Jan)


M-C Event Samples Available   

  1. General  setup, assumptions
    1. use UPGR13 geometry
    2. run in SL07e
    3. use PPV vertex finder in reco
    4. displace & smear vertex in GEANT in X-Y plane: x0=+1mm, sig=200us, y0=-2mm, sig=200um (except setA)
    5. beam energy sqrt(s)=500 GeV
    6. detectors passed by track thrown at various eta at 3 Z-vertex location of -60, -30 an 0 cm.

  2. setA (produced by Mike @ MIT)
  3. BFC w/ generic vertex finder has ~50% efficiency,

    Vertex distribution: Gauss(Z=0, sigZ=60cm, Z=Y=0, sigX=sigY=0)

     Type of events   total events time per event
     Pythia, minB  400K, 100 jobs  GSTAR: 8.4 sec, BFC ???

    Files location: 80K eve at IUCF disk: /star/institutions/iucf/kocolosk/2008-02-15-fgt-hadron-background

    full sample at MIT ...


  4. setB (pilot sample by Jan @ RCF)
  5. Filtering of Pythia events: seed cell =10GeV ET, pair of cells>20 GeV ET,

    particle eta range [0.8,2.2], grid cell size: 0.14 in eta, 9 deg in phi

    BFC w/ PPV vertex finder has ~95% efficiency, SSD, STI not used in tracking

    Vertex distribution: Gauss(Z=-60, sigZ=5cm, Z,Y offset)

    Pythia event generator, 

    BFC chain:" DbV20080310 trs  -ssd upgr13  Idst IAna l0 tpcI fcf -ftpc Tree logger ITTF Sti StiRnd  -IstIT -SvtIt -NoSvtIt SvtCL,svtDb -SsdIt MakeEvent McEvent geant evout geantout IdTruth  bbcSim emcY2 EEfs bigbig -dstout fzin -MiniMcMk McEvOut clearmem -ctbMatchVtx VFPPV eemcDb beamLine"

     Type of events Pythia filter   total events time per event job name file size, MB
      W-events (kumac) 1/6.5  1K, 1 job GSTAR 10 sec, BFC 5.3 sec wElec4 fzd=149, stevent=132, geant=154, McEvent=132, muDst=14
    1:1 , OFF  5K, 1 job - wElec5 -
      QCD-events (kumac) pt=20-30 GeV 1/40  1K, 1 job GSTAR 11 sec, BFC 6.7 sec qcd2 fzd=203, StEvent=157, geant=212, McEvent=172, muDst=17
    1:1, OFF  5K, 1 job - qcd3 -
      QCD-events, scan pt 10...90 GeV varies  100 eve, 1 job - qcd_pt_xx_yy files at ...balewski/2008-FGT-simu/setB-pt-scan/

    Files location:  /star/institutions/iucf/balewski/2008-FGT-simu/setB-pilot/

    Custom code : Pythia, Generic Vertex finder, same location


  6.  setC - Pythia macros inspected by Jim: ppQCDprod.kumac & ppWprod.kumac
    Filtering of Pythia events: seed cell =10GeV ET, pair of cells>20 GeV ET,
    particle eta range [0.8,2.2], grid cell size: 0.14 in eta, 9 deg in phi

    * setC1: /star/institutions/iucf/balewski/2008-FGT-simu/setC2-pt-0.2inv_pb

    This is LT balanced for 0.2/pb, using your ppQCDprod.kumac

    pt1 pt2 neve
    10    ,15    ,373
    15    ,20    ,1252
    20    ,25    ,2516
    25    ,30    ,3367
    30    ,35    ,2330
    35    ,40    ,1015
    40    ,45    ,705
    45    ,50    ,292
    50    ,55    ,114
    55    ,60    ,67
    60    ,65    ,28
    65    ,70    ,13
    70    ,75    ,8
    75    ,80    ,4
    80    ,85    ,2
    85    ,90    ,1
    90    ,95    ,1


    * setC2 (only filtered events of various types)



    * setC3 (filtered vs. not filtered events)



    * setC4 ( filtered QCD events w/ various partonic PT )

  7. setC5 : QCD events , 3-stage filtering, LT~100/pb


evaluation of Pythia Filter for QCD & W events (setC3)


Based on setC3 the number of events with reco EM cluster ET>20 GeV is similar for the filtered and unfiltered pythia samples after LT correction - compare yellow & green areas: 


------------ From Brian -------

Hi Jan,

I processed the events in setC3 and I put the plots into the
fgt-hn-contributions drupal page. (All plots show unfiltered events on
the left and filtered events on the right).

Transverse energy spectrum for the QCD events:

Number of events passing ET>20GeV and ET>20GeV + Eta < 1.7 for QCD
events: http://drupal.star.bnl.gov/STAR/system/files/OPcountsQCD.png

Transverse energy spectrum for the W events:

Number of events passing ET>20GeV and ET>20GeV + Eta < 1.7 for W events:



PT scan of Pythia-filter rejection for QCD events ( Jan)

Pythia Filer: cell>10 GeV ET, cluster >20 GeV ET , grid covers Endcap Pythia events

Note, 'live' spreadsheet is attached at the bottom


Examples of event filtering for some choices partonic PT ranges:

pt range event counter and pt spectra eta-phi distributions, all pythia tracks and seed distribution

partonic PT 15-20 GeV




partonic PT 40-45 GeV





partonic PT 75-80 GeV






Practical Pythia Event Filter (Jan)

Filtering of Pythia events preserving those which may fire HT trigger in the Endcap.

In order to develop efficient e/h discrimination algo for reco of electrons from Ws it is necessary to generate sizable sample of QCD physics background events with 1e5 or more events triggering Endcap HT >10 GeV. The brute force approach (run PYTHIA+GSTAR+BFC long enough) is investigated by my not succeed due to low yield of events of interests.

Therefore, we are working on the in-fly Pythia events filtering. It must be more complex than accepting events with a single Pythia track above certain threshold because multiple tracks from jet (also hadrons) may deposit in a single tower cumulative energy exceeding the HT threshold even if all tracks have energy below this threshold.

The tricky part is to decide if EEMC response may be large before GSTAR does very time consuming simulation of EM & hadronic showers for the whole event.

Proposed Method (2-stage Pythia filtering)

  • Define : eta range [0.9,2.1], partonPTthres of 5 GeV, jetPTthres of 5 GeV (to be tuned later)
  • Inspect lines 7 & 8 of Pythia record (counting from 1) and drop event if none of partons is within eta range and above parton PT threshold.
    For survived events
  • Define 2D eta-phi grid covering eta [0.9,2.1] and 2pi in phi. Divide it in to cells of size 0.1x0.1. Clear grid for every event.
  • Loop over Pythia record 9..max and drop: partons, gluons, unstable particles, neutrino, muons.
    Retain all stable hadrons, e+, e- within eta range, project particle ET in to the eta-phi grid.
  • find seeds all cells with ET above 1/2 of jetThreshold.
  • for every seed from 8 pairs using every of its neighbors. If any pair ET sum is above jetThreshold event will be accepted and passed to GSTAR and eventually to BFC.

Additional comments:
* for Barrel eta range should be [-0.2,1.2] and cell size 0.05x0.05 in eta x phi.
* the code should be written in F77.
* at any step priority should be given to processing speed vs. program size. E.g. use lookup tables when reasonable.
* provide few QA histos generated with Pythia using HBOOK + kumac to display them

Content of Pythia record

1 proton 1
2 proton 2
3 parton from proton1
4 parton from proton2
5 parton from proton 1 after intial state radiation
6 parton from proton 2 after intial state radiation
7 parton 1 after scatter
8 parton 2 after scatter
9 ... intermediate and final partons/particles


evaluation of Bates minB sample (Jan)

Evaluation of minB events ample produced by Mike at Bates in January of 2008.

Events characteristic: Pythia MinB events, sqrt(s)=500 GeV, vertex Gauss(0,60cm)

Below you see detectors acquired by e+/e- surrogate :  

  1st pi-,pi+ with pT>2.0 GeV and eta>0.7

FGT disks are located at Z of 70,80,...,110 cm - our best guess location.

3 events samples were chosen based on Geant vertex location of -60, 30, and 0 cm, with margin of +/-10 cm, what leads to smeared FGT disks.  


Optimization of FGT disk location

 Several versions of FGT disk geometries has been studied in 2007

as documented  here (disk-based HTML documentation)


Z disk location accuracy

Propagation of the Z hit location inaccuracy  on to the error of predicted Rxy location of the Endcap EM shower.

Slide 1.  Every FGT disk is mounted only at  only 2 points to the Alu rail r=6mm, disks have R=38 cm, so the leverage arm is 1:63.
The tension from individual (stiff) cables located also at 90 deg vs. Alu rods  could cause a tilt of disks ( during cables assembly or sliding the 6-disk unit to its final position at STAR).
Slide 2.  An example of FGT-only reconstructed track. The inset shows there is an intrinsic fluctuation of primary ionization over 3mm in Z, we can't compensate off-line. This sets the scale for accuracy Z-alignment of the disks.
Slide 3  shows  systematical displacement of predicted EM shower radial distance at the Endcap due to extreme ionization spread in 2 FGT disks . In reconstruction the mean Z location of FGT disks is used. The predicted radial distance of the reco tracks at Z=SMD  can be off by up to 1.2cm.
This is not that small  but since we will impose isolation cut in EEMC, there should be no other significant energy deposit in calorimeter at much larger radii. Note, the EM shower radii is of 3 cm, but we claim its center will be reco with 1mm accuracy. 



geometry in MC

 Documented evolution of implementation of FGT geometry in GSTAR, started on May, 2008

Our studies are below seen as child pages.

Here are links to other studies


1 content of UPGR15, May 2008

 Selected cross sections of UPGR15 geometry, as of May 2008

Fig 1

Fig 2

Fig 3

Fig 4

Fig 5

Fig 5 Realistic geometry from Jim K. model, May 2008

2 UPGR15+FGT as of May 2008

 UPGR15 geometry was modified to match best guess of FGT geometry as of May 2008.

The active FGT area is : Z1=70,..., Z6=120cm, DZ=10 cm, Rin=11.5cm, Rout=37.5 cm 
There is 1cm of additional dead material at Rin & Rout


Fig 1. Zvertex=0 cm, green= eta [1.06,2.0]. , red=eta[2.5,4.0]



Fig 2. Zvertex=+30 cm, green= eta [1.06,2.0]. , red=eta[2.5,4.0]



Fig 3. Zvertex=-30 cm, green= eta [1.06,2.0]. , red=eta[2.5,4.0]


Fig 4. Zoom in on 1 FGT disk.  Detected particle enters from the left, 'active' gas volume has depth of 3mm (between magenta ad blue lines),  FGT strips collect charge on the 1st green line.
 (units in cm)
Zstart = 70.0 ! starting position along Z axis
Z = { 0.0, 10.0, 20.0, 30.0, 40.0, 50.0} ! Z positions for GEM front face
FThk = { 0.05, 0.05, 0.05, 0.05 } ! foil thicknesses inside GEM
SThk = { 0.3, 0.2, 0.2, 0.2 } ! support/spacing thicknesses
SR = 1.0 ! radial size for support

USED material:

 * use aluminized mylar mixture instead of kapton
      Component C5  A=12    Z=6  W=5
      Component H4  A=1     Z=1  W=4
      Component O2  A=16    Z=8  W=2
      Component Al  A=27    Z=13 W=0.2302
      Mixture  ALKAP  Dens=1.432
*     G10 is about 60% SiO2 and 40% epoxy
      Component Si  A=28.08  Z=14   W=0.6*1*28./60.
      Component O   A=16     Z=8    W=0.6*2*16./60.
      Component C   A=12     Z=6    W=0.4*8*12./174.
      Component H   A=1      Z=1    W=0.4*14*1./174.
      Component O   A=16     Z=8    W=0.4*4*16./174.
      Mixture   G10    Dens=1.7
Block FGDO is the mother volume of the individual GEM disks
      Component Ar A=39.95   Z=18.   W=0.9
      Component C  A=12.01   Z=6.    W=0.1*1*12.01/44.01
      Component O  A=16.     Z=8.    W=0.1*2*16./44.01
      Mixture   Ar_mix  Dens=0.0018015
Block FGFO describes the GEM foils
      Material ALKAP
Block FGIS describes the inner support or spacer
      Material G10

Fig 4b FGT disk front view in Geant


Fig 5. 1st FGT disk by Jim K. as of April, 2008


Fig 6. 3 FGT disks by Jim K. as of April, 2008  

Fig 7 Realistic geometry from Jim K. as of May, 2008

Fig 8 Disk material budget, from Doug, as of May, 2008

Fig 9 APV location , from Doug, as of May, 2008



3 new FGT geometry

 Modified FGT geometry of FGT, June 2008

 Detailed description (PDF) , ver 1

4 compare geom 2007 vs. UPGR16


Green dashed lines at eta=1.0,.1.06,2.0

red lines at eta=2.5, 4.0



UPGR16, geom=2010



Speculative FGT++

another 6 disks are added at the following Z:

 Zstart  =   62.98  ! starting position along Z axis

 Z       = { 5.4, 15.4, 25.4, 35.4, 45.4, 55.4, 75., 90., 105., 120., 135., 150.}  ! Z positions of GEM front face

Green dashed lines at eta=1.0,.1.09,2.0

red lines at eta=2.5, 4.0


5 FGT cables in Geant



If I want to know the total area for one FGT disk what is the proper multiplier : 4, 28, or 24*28 ?

Within the cable, multipliers for the individual "subcomponents" are in column L.

Then, there are overall 4 cables per FGT disk - the column B tells you number of cables and I-J tells you where they go.

In other words, for instance, overall total copper area in FGT-power cables is
24*(7*5.176E-3+1*3.255E-3) = 0.948 cm^2.

I know you asked to break out with one "line" per cable route - we can do this later but for now there are already a lot of lines... I'll leave them grouped as this and you should look at I-J to decide the lengths and where they are.

By the way, I imagine the "patch" between cone/FGT cables and "external" cables lying on TPC endwheel, through services gap, to crates, occurs somewhere just outside the cone, within the first foot or so.

6 radiation length study for UPGR16 + SSD

Study of the dead material in front and behind FGT.

3 versions of GEANT geometries were investigated:

  • UPGR16 + current SSD w/ current cables
  • UPGR16 w/ 'light' SSD (Alu support structure replaced by carbon, Cu cables replaced by Alu)
  • UPGR16 without SSD, nor SSD cables

Plot below is just example of material using current SSD.

 Many more plots are in attached PDF, in particular figs 2a-c, 3a-c, 4a-c.

7 PR track plots with UPGR16 & fixed barrel

Geometry= UPGR16, 6 FGT disks , fixed barrel geometry.

Single electrons, 20 GeV ET, thrown at eta=0, 0.4, 0.8, 1.2, 1.6, 2.0

Fig 1, Z vertex=0


Fig 2, Z vertex=+30 cm


Fig 3, Z vertex=-30 cm



FGT hits fired by backward tracks (Wei-Ming Zhang)


           1, MC tracks (eta < -1.3) are thrown backwards and FGT are found fired.

             Fig. 1, An events with FGT hits fired by backward tracks (UPGR16)

           2, To investigate with tracks (1.3 |eta| < 3.1) from MC events of RQMD Au-Au 10 GeV

            Fig. 2


          There are two rows in Fig. 2. Each row has three plots, the left is track multiplicity of events, the middle pt of
      tracks, and the right dE of FGT hits in KeV. The top row is plotted for backward tracks which fire FGT and for fired FGT 
      hits (backward hits). The first two of the bottom are for all backward tracks. The right of the bottom is a dE spectrum
      of FGT hits fired by FORWARD tracks (forward hits).  From Fig. 1, we see
        1, A low level of backward hits  (mult_0/mult_1 = 200 shown in the top left plot)
        2, A relatively large energy loss of backward hits which is 2-3 time larger than that of forward hits.
           This suggests backward tracks which fire FGT have very low speed and deposit more energy than forward MIPs.

         Based on the above, we believe that backward hits in FGT come from multiple scattering.

        Fig. 3, Split spectra of the top row of Fig. 2 for individual FGT disks: disk1 (top) disk2 (middle)
               and disk3 (bottome)


       Fig. 4, Split spectra of the top row of Fig. 2 for individual FGT disks: disk4 (top) disk5 (middle)
               and disk6 (bottome)