Project

General

Profile

SamplingInput configuration

To see the full supported configuration, type 'art --print-description SamplingInput'. The following legal configuration, however, will suffice for our purposes:

source: {

  module_type: SamplingInput

  maxEvents: 20

  # The specified run and subrun numbers are used for all primary events
  # generated in a given art job.  If no values are specified, default
  # values of 1 and 0 are chosen for the run and subrun, respectively.

  run: 1  # default
  subRun: 0  # default
  firstEvent: 1  #default

  # List the datasets to serve as input to the source, with their respective weights.  
  # There is no limit to the number of datasets that are specified.
  dataSets: {
    signal: {
      weight: 0.35
      fileNames: ["signal.root"]

      # When processing signal events, begin at Run 14, SubRun 3, and Event 11
      skipToEvent: "14:3:11" 
    }
    bkgd: {
      weight: 0.82
      fileNames: ["bkgd.root"]
    }
  }
}

The configuration names 'signal' and 'bkgd' are the dataset names. Upon a successful configuration, the following will be printed to the terminal:

The following datasets have been configured for the SamplingInput source:

           Specified    Expected
Dataset       weight    fraction    File name
------------------------------------------------------------------------
bkgd            0.82    0.700855    bkgd.root
signal          0.35    0.299145    signal.root
  └─ starting at run: 14 subRun: 3 event: 11

where the specified weight matches the configuration, and the expected fraction is the weight normalized to the sum of all dataset weights--it is the relative sampling probability corresponding to the specified weight.

Constraints

There are several constraints of the SamplingInput source:

  • No weight can be negative
  • Although it is allowed for a weight to be 0, the sum of all weights must be greater than 0
  • Only one input file per dataset is currently supported

If any of these constraints are violated, an exception will be thrown at run-time, ending the job.