17 hasRDO_BKGInput = hasattr(runArgs,
'inputRDO_BKGFile')
18 hasBS_SKIMInput = hasattr(runArgs,
'inputBS_SKIMFile')
19 hasEVNT_Input = hasattr(runArgs,
'inputEVNTFile')
21 if flags.Common.ProductionStep == ProductionStep.Overlay
and not hasattr(runArgs,
'inputHITSFile'):
22 raise RuntimeError(
'No input HITS file defined')
24 if hasRDO_BKGInput
and hasBS_SKIMInput:
25 raise RuntimeError(
'Both RDO_BKG and BS_SKIM are defined')
26 if not hasRDO_BKGInput
and not hasBS_SKIMInput:
27 raise RuntimeError(
'Define one of RDO_BKG and BS_SKIM file types')
29 if hasattr(runArgs,
'skipSecondaryEvents'):
30 flags.Overlay.SkipSecondaryEvents = runArgs.skipSecondaryEvents
33 log.info(
'Running MC+MC overlay')
34 flags.Overlay.DataOverlay =
False
35 flags.Input.isMC =
True
36 flags.Input.Files = runArgs.inputRDO_BKGFile
37 if flags.Common.ProductionStep == ProductionStep.Overlay:
38 flags.Input.SecondaryFiles = runArgs.inputHITSFile
39 elif flags.Common.ProductionStep == ProductionStep.FastChain:
41 raise RuntimeError(
'No input EVNT file defined')
43 flags.Input.SecondaryFiles = runArgs.inputEVNTFile
45 raise RuntimeError(
'No secondaryFiles are defined')
48 flags.Input.MCChannelNumber =
GetFileMD(flags.Input.SecondaryFiles, allowEmpty=
False).
get(
"mc_channel_number", 0)
51 if hasattr(runArgs,
'runNumber'):
52 if flags.Input.MCChannelNumber != runArgs.runNumber:
53 log.warning(
'Got different MC channel number (%d) from runNumber than from metadata (%d)', runArgs.runNumber, flags.Input.MCChannelNumber)
54 flags.Input.MCChannelNumber = runArgs.runNumber
56 log.info(
'MC channel number: %d', flags.Input.MCChannelNumber)
58 log.info(
'Running MC+data overlay')
59 flags.Overlay.DataOverlay =
True
60 flags.Input.isMC =
False
61 flags.Input.Files = runArgs.inputHITSFile
62 flags.Input.SecondaryFiles = runArgs.inputBS_SKIMFile