Project

General

Profile

Running event mixer

The goal of event mixer (NovaSimMixer package) is to overlay Monte Carlo events from different input files.

Mixing events is done in two steps. First, we put the collection from two different files into a single file and in second step we merge them under the same label.

For more details of the guts one can read up on Product Mixing

Event mixing

At this step, we add collections from two files into one. One can think of it as the event records from a secondary file is added to a primary file's event record. In other words collections from the primary file keep their label while collections from secondary files have a new label (often times this label is "singlemixer") .

Merge collections

At this step, collections from the primary and secondary files are merged under the same label. Also, IDs of most of the objects are offset.

Example of mixing cosmic events with beam events

Mix events
There is an example configuration in the NovaSimMixer package mixtestcosmic, which mixes one cosmic event with one beam event.

Run it

nova -c mixtestcosmic.fcl 

The cosmic file is specified in the source

source :
{
  module_type : RootInput
  fileNames   : [ "../NDCosmicFileNoDAQ.root" ]
  maxEvents   : 100
}

The beam event is specified as a filter


physics :
{
  producers:{
  }

  filters: {
    Mixer: {
      // Parameters for the MixFilter template
      module_type       : MixSimEvents
      fileNames           : [ "../NDBeamFileNoDAQ.root" ]
      readMode            : sequential
      seed                : [24680]

      // Parameters for the MixDetail class
      fixed                : 1
      meanPoisson         : 1
      mode:                 useFixed
      genModuleLabel      : generator
      g4ModuleLabel       : geantgen
    }
  }

  p1 : [ Mixer ]
  e1 : [ outfile ]

  trigger_paths  : [p1]
  end_paths      : [e1]

}

To change the number of events from the secondary file to merge with the cosmic primary file change the fhicl parameter fixed in the .fcl file. To select the number of secondaries from a Poisson distribution, change mode to usePoisson and set meanPoisson appropriately. A third mode (usePoissonMinus1) is also available.

Merge events

The fhicl for merging events is mergecollectionsjob.fcl and it is a general configuration file not only for the cosmic-beam event merging.
Alternatively, separate generator and geant collection merging can be done using MergeGenCollections.fcl in combination with MergeG4Collections.fcl, allowing the two collection types to have separate labels. For production processing, prodFDCosmicMixMerge.fcl and prodNDRockMixMerge.fcl are used. These combine both steps of the overlay process into a single job, and properly drop obsolete collections and rename the new collections with the same labels normally seen in non-overlaid files.

Run it

nova -c  mergecollectionsjob.fcl  -s infile -o outfile

or, run the mix and merge steps in one job, for example with  

nova -c prodFDCosmicMixMerge.fcl -s infile -o outfile