STARSIM: Pileup Simulation HOWTO

Running pileup simulation in starsim

1) Generate your physics event sample and save them in an fzd file
2) Generate your (larger) minbias background event sample, saving them in multiple fzd files.  Create a list of background files --
    $ ls background*.fzd > background.list
3) Run starsim and merge the

starsim> gfile p physics.fzd        ** physics input fzd
starsim> gfile b background.list   ** list of background files
starsim> gfile o output.fzd           ** final output file.

Determine how many bunch crossing before and after the trigger bunch crossing you are interested in sampling.  Also determine the probability that a given bunch crossing results in a collision, and the mean time between collisions.

starsim > gback [Nbefore] [Nafter] [Probability] 106.5 1.5

Here we used 106.5 ns between bunch crossings.  The last number 1.5 instructs starsim to skip a random number of events (poisson with mean 1.5) in the background sample.

Now set the parameters for the simulation of each detector which is sensitive to pileup:

starsim> mode tpce back 3761376 ** TPC sees 376 bxings before and 376 bxings after the trigger collision.
starsim> mode pixl back 8751875 ** Pixel sees 875 bxings before and 875 bxings after the trigger collision.

Now, trigger on all events and we have created an fzd file, which can be reconstructed.

starsim> trig [nevents]

Running pileup simulation as part of a reconstruction job...