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 flags.Input.Files = runArgs.inputRDO_BKGFile
36 log.info(
'Running MC+MC overlay')
37 flags.Overlay.DataOverlay =
False
39 log.info(
'Running MC+data overlay')
40 flags.Overlay.DataOverlay =
True
42 if flags.Common.ProductionStep == ProductionStep.Overlay:
43 flags.Input.SecondaryFiles = runArgs.inputHITSFile
44 elif flags.Common.ProductionStep == ProductionStep.FastChain:
46 raise RuntimeError(
'No input EVNT file defined')
48 flags.Input.SecondaryFiles = runArgs.inputEVNTFile
50 raise RuntimeError(
'No secondaryFiles are defined')
54 flags.Input.MCChannelNumber =
GetFileMD(flags.Input.SecondaryFiles, allowEmpty=
False).
get(
"mc_channel_number", 0)
57 if hasattr(runArgs,
'runNumber'):
58 if flags.Input.MCChannelNumber != runArgs.runNumber:
59 log.warning(
'Got different MC channel number (%d) from runNumber than from metadata (%d)', runArgs.runNumber, flags.Input.MCChannelNumber)
60 flags.Input.MCChannelNumber = runArgs.runNumber
62 log.info(
'MC channel number: %d', flags.Input.MCChannelNumber)
64 log.info(
'Running MC+data overlay from ByteStream')
65 flags.Overlay.DataOverlay =
True
66 flags.Overlay.ByteStream =
True
67 flags.Input.isMC =
False
68 if flags.Common.ProductionStep == ProductionStep.Overlay:
69 flags.Input.Files = runArgs.inputHITSFile
70 elif flags.Common.ProductionStep == ProductionStep.FastChain:
72 raise RuntimeError(
'No input EVNT file defined')
74 flags.Input.Files = runArgs.inputEVNTFile
76 raise RuntimeError(
'No input files are defined')
78 flags.Input.SecondaryFiles = runArgs.inputBS_SKIMFile
82 flags.Input.RunNumbers =
list(
GetFileMD(flags.Input.SecondaryFiles).
get(
"runNumbers", []))
83 flags.Input.LumiBlockNumbers =
list(
GetFileMD(flags.Input.SecondaryFiles).
get(
"lumiBlockNumbers", []))