Upgrade simulations to use as-measured noise and pileup. These can be obtained from periodic triggers, so instead of generating noise from whole cloth we would read in periodic triggers and overlay them on top of the simulated events.
The first step of the above is to employ the following strategy:
ACD
(in progress)
CAL
Digs are merged by a Gaudi algorithm "CalDigiMergeAlg". This algorithm simply reads in overlay digis from the special section of the TDS and then "merges" them into the existing Cal Digis from the simulation. If a CalDigi does not exist for a log, then the overlay digi is copied into the list, if a CalDigi exists in both simulation and overlay, then the adc counts are updated for the simulated digi - if the ranges are the same then they are summed (and cutoff at 4095), if the ranges are different then the adc value corresponding to the greater range is used. A status word is included which sets an "overlay" bit for the overlay digis.
TKR
Similar philosophy to the above
Events to be overlaid are taken from periodic triggers in the data files. These are grouped into collections according to some distribution, where Mark Strickman and Eric Grove advocate the following:Divide large sample of real periodic triggers into McIlwain L bins (size of bins left as an exercise for the reader). Why McIlwain L? Because background is generally more linear in McIlwain L than in rigidity or magnetic latitude. Perform a pedestal subtraction on all the xtal channels using cal peds. This will of course result in both positive and negative signals.
Implementing this requires a controlling algorithm which is able to retrieve the necessary information for determining the correct bin to use, then to handle the opening/closing/handling of the correct input file, then, finally, to "randomly" select an event from this file. The strategy is very similar to that used in the existing interleave package.
(To be done)