3 from PyJobTransforms.CommonRunArgsToFlags
import commonRunArgsToFlags
4 from PyJobTransforms.TransformUtils
import processPreExec, processPreInclude, processPostExec, processPostInclude
6 from AthenaCommon
import SystemOfUnits
as Units
9 from AthenaCommon
import JobProperties
10 JobProperties.jobPropertiesDisallowed =
True
15 from AthenaCommon.Logging
import logging
16 log = logging.getLogger(
'RAWtoALL')
17 log.info(
'****************** STARTING Reconstruction (RAWtoALL) *****************')
19 log.info(
'**** Transformation run arguments')
20 log.info(
str(runArgs))
23 timeStart = time.time()
25 log.info(
'**** executing ROOT6Setup')
26 from PyUtils.Helpers
import ROOT6Setup
29 log.info(
'**** Setting-up configuration flags')
30 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
33 flags.Exec.EventTimeOut = 3600*Units.second
38 if hasattr(runArgs,
'detectors'):
39 detectors = runArgs.detectors
47 inputsDRAW = [prop
for prop
in dir(runArgs)
if prop.startswith(
'inputDRAW')
and prop.endswith(
'File')]
48 if hasattr(runArgs,
'inputBSFile'):
50 raise RuntimeError(
'Impossible to run RAWtoALL with input BS and DRAW files (one input type only!)')
51 flags.Input.Files = runArgs.inputBSFile
52 if len(inputsDRAW) == 1:
53 flags.Input.Files = getattr(runArgs, inputsDRAW[0])
54 elif len(inputsDRAW) > 1:
55 raise RuntimeError(
'Impossible to run RAWtoALL with multiple input DRAW files (viz.: {0})'.
format(inputsDRAW))
58 if hasattr(runArgs,
'inputRDOFile'):
59 flags.Input.Files = runArgs.inputRDOFile
60 if hasattr(runArgs,
'inputRDO_TRIGFile'):
61 flags.Input.Files = runArgs.inputRDO_TRIGFile
67 if hasattr(runArgs,
'outputESDFile'):
68 flags.Output.ESDFileName = runArgs.outputESDFile
69 log.info(
"---------- Configured ESD output")
71 if hasattr(runArgs,
'outputAODFile'):
72 flags.Output.AODFileName = runArgs.outputAODFile
73 log.info(
"---------- Configured AOD output")
75 if hasattr(runArgs,
'outputHISTFile'):
76 flags.Output.HISTFileName = runArgs.outputHISTFile
77 flags.DQ.doMonitoring =
True
78 log.info(
"---------- Configured HIST output")
80 if hasattr(runArgs,
'outputHIST_R2AFile'):
81 flags.Output.HISTFileName = runArgs.outputHIST_R2AFile
82 flags.DQ.doMonitoring =
True
83 log.info(
"---------- Configured HIST_R2A output")
85 if hasattr(runArgs,
'outputDAOD_IDTIDEFile'):
86 flagString =
'Output.DAOD_IDTIDEFileName'
87 flags.addFlag(flagString, runArgs.outputDAOD_IDTIDEFile)
88 flags.Output.doWriteDAOD =
True
89 flags.addFlag(
'Output.doWriteDAOD_IDTIDE',
True)
90 log.info(
"---------- Configured DAOD_IDTIDE output")
92 if hasattr(runArgs,
'outputDAOD_PIXELVALIDFile'):
93 flagString =
'Output.DAOD_PIXELVALIDFileName'
94 flags.addFlag(flagString, runArgs.outputDAOD_PIXELVALIDFile)
95 flags.Output.doWriteDAOD =
True
96 flags.addFlag(
'Output.doWriteDAOD_PIXELVALID',
True)
97 log.info(
"---------- Configured DAOD_PIXELVALID output")
99 if hasattr(runArgs,
'outputDAOD_IDTRKVALIDFile'):
100 flagString =
'Output.DAOD_IDTRKVALIDFileName'
101 flags.addFlag(flagString, runArgs.outputDAOD_IDTRKVALIDFile)
102 flags.Output.doWriteDAOD =
True
103 flags.addFlag(
'Output.doWriteDAOD_IDTRKVALID',
True)
104 log.info(
"---------- Configured DAOD_IDTRKVALID output")
106 if hasattr(runArgs,
'outputDAOD_SCTVALIDFile'):
107 flagString =
'Output.DAOD_SCTVALIDFileName'
108 flags.addFlag(flagString, runArgs.outputDAOD_SCTVALIDFile)
109 flags.Output.doWriteDAOD =
True
110 flags.addFlag(
'Output.doWriteDAOD_SCTVALID',
True)
111 log.info(
"---------- Configured DAOD_SCTVALID output")
113 if hasattr(runArgs,
'outputDESDM_MCPFile'):
114 flagString =
'Output.DESDM_MCPFileName'
115 flags.addFlag(flagString, runArgs.outputDESDM_MCPFile)
116 flags.Output.doWriteDAOD =
True
117 flags.addFlag(
'Output.doWriteDESDM_MCP',
True)
118 log.info(
"---------- Configured DESDM_MCP output")
120 if hasattr(runArgs,
'outputDESDM_EXOTHIPFile'):
121 flagString =
'Output.DESDM_EXOTHIPFileName'
122 flags.addFlag(flagString, runArgs.outputDESDM_EXOTHIPFile)
123 flags.Output.doWriteDAOD =
True
124 flags.addFlag(
'Output.doWriteDESDM_EXOTHIP',
True)
125 log.info(
"---------- Configured DESDM_EXOTHIP output")
127 if hasattr(runArgs,
'outputDRAW_ZMUMUFile'):
128 flagString =
'Output.DRAW_ZmumuFileName'
129 flags.addFlag(flagString, runArgs.outputDRAW_ZMUMUFile)
130 flags.Output.doWriteBS =
True
131 log.info(
"---------- Configured DRAW ZMUMU output")
133 if hasattr(runArgs,
'outputDRAW_EGZFile'):
134 flagString =
'Output.DRAW_EGZFileName'
135 flags.addFlag(flagString, runArgs.outputDRAW_EGZFile)
136 flags.Output.doWriteBS =
True
137 log.info(
"---------- Configured DRAW_EGZ output")
139 if hasattr(runArgs,
'outputDRAW_TAULHFile'):
140 flagString =
'Output.DRAW_TAULHFileName'
141 flags.addFlag(flagString, runArgs.outputDRAW_TAULHFile)
142 flags.Output.doWriteBS =
True
143 log.info(
"---------- Configured DRAW_TAULH output")
145 if hasattr(runArgs,
'outputDRAW_JETFile'):
146 flagString =
'Output.DRAW_JETFileName'
147 flags.addFlag(flagString, runArgs.outputDRAW_JETFile)
148 flags.Output.doWriteBS =
True
149 log.info(
"---------- Configured DRAW_JET output")
151 if hasattr(runArgs,
'outputDAOD_L1CALO1File'):
152 flagString =
'Output.DAOD_L1CALO1FileName'
153 flags.addFlag(flagString, runArgs.outputDAOD_L1CALO1File)
154 flags.Output.doWriteDAOD =
True
155 flags.addFlag(
'Output.doWriteDAOD_L1CALO1',
True)
156 log.info(
"---------- Configured DAOD_L1CALO1 output")
158 if hasattr(runArgs,
'outputDAOD_L1CALO2File'):
159 flagString =
'Output.DAOD_L1CALO2FileName'
160 flags.addFlag(flagString, runArgs.outputDAOD_L1CALO2File)
161 flags.Output.doWriteDAOD =
True
162 flags.addFlag(
'Output.doWriteDAOD_L1CALO2',
True)
163 log.info(
"---------- Configured DAOD_L1CALO2 output")
165 if hasattr(runArgs,
'outputDESDM_PHOJETFile'):
166 flagString =
'Output.DESDM_PHOJETFileName'
167 flags.addFlag(flagString, runArgs.outputDESDM_PHOJETFile)
168 flags.Output.doWriteDAOD =
True
169 flags.addFlag(
'Output.doWriteDESDM_PHOJET',
True)
170 log.info(
"---------- Configured DESDM_PHOJET output")
172 if hasattr(runArgs,
'outputDESDM_ALLCELLSFile'):
173 streamName =
'DESDM_ALLCELLS'
174 flags.addFlag(f
'Output.{streamName}FileName', runArgs.outputDESDM_ALLCELLSFile)
175 flags.addFlag(f
'Output.doWrite{streamName}',
True)
176 log.info(
"---------- Configured "+streamName+
" output")
179 from RecJobTransforms.RecoConfigFlags
import recoRunArgsToFlags
182 from AthenaConfiguration.Enums
import ProductionStep
183 flags.Common.ProductionStep=ProductionStep.Reconstruction
186 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
187 setupDetectorFlags(flags, detectors, use_metadata=
True, toggle_geometry=
True, keep_beampipe=
True)
189 from RecJobTransforms.RecoConfigFlags
import printRecoFlags
201 from PerfMonComps.PerfMonConfigHelpers
import setPerfmonFlagsFromRunArgs
217 from RecJobTransforms.RecoSteering
import RecoSteering
221 cfg.flagPerfmonDomain(
'PerfDPD')
223 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_IDTIDEFileName" in key)]:
224 from DerivationFrameworkInDet.IDTIDE
import IDTIDECfg
226 log.info(
"---------- Configured IDTIDE perfDPD")
229 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_PIXELVALIDFileName" in key)]:
230 from DerivationFrameworkInDet.PIXELVALID
import PixelVALIDCfg
232 log.info(
"---------- Configured PixelVALID perfDPD")
235 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_SCTVALIDFileName" in key)]:
236 from InDetPrepRawDataToxAOD.SCTVALID
import SCTVALIDCfg
238 log.info(
"---------- Configured SCTVALID perfDPD")
241 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_IDTRKVALIDFileName" in key)]:
242 from DerivationFrameworkInDet.IDTRKVALID
import IDTRKVALIDCfg
244 log.info(
"---------- Configured IDTRKVALID perfDPD")
247 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DESDM_MCPFileName" in key)]:
248 from PrimaryDPDMaker.DESDM_MCP
import DESDM_MCPCfg
250 log.info(
"---------- Configured DESDM_MCP perfDPD")
253 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DESDM_EXOTHIPFileName" in key)]:
254 from PrimaryDPDMaker.DESDM_EXOTHIP
import DESDM_EXOTHIPCfg
256 log.info(
"---------- Configured DESDM_EXOTHIP perfDPD")
259 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DRAW_ZmumuFileName" in key)]:
260 from PrimaryDPDMaker.DRAW_ZMUMU
import DRAW_ZmumuCfg
262 log.info(
"---------- Configured DRAW_ZMUMU perfDPD")
265 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DRAW_EGZFileName" in key)]:
266 from PrimaryDPDMaker.DRAW_EGZ
import DRAW_EGZCfg
268 log.info(
"---------- Configured DRAW_EGZ perfDPD")
271 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DRAW_TAULHFileName" in key)]:
272 from PrimaryDPDMaker.DRAW_TAULH
import DRAW_TAULHCfg
274 log.info(
"---------- Configured DRAW_TAULH perfDPD")
277 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DRAW_JETFileName" in key)]:
278 from PrimaryDPDMaker.DRAW_JET
import DRAW_JETCfg
280 log.info(
"---------- Configured DRAW_JET perfDPD")
283 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_L1CALO1FileName" in key)]:
284 from DerivationFrameworkL1Calo.L1CALO1
import L1CALO1Cfg
286 log.info(
"---------- Configured L1CALO1 perfDPD")
288 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DAOD_L1CALO2FileName" in key)]:
289 from DerivationFrameworkL1Calo.L1CALO2
import L1CALO2Cfg
291 log.info(
"---------- Configured L1CALO2 perfDPD")
294 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DESDM_PHOJETFileName" in key)]:
295 from PrimaryDPDMaker.DESDM_PHOJET
import DESDM_PHOJETCfg
297 log.info(
"---------- Configured PHOJET perfDPD")
300 for flag
in [key
for key
in flags._flagdict.keys()
if (
"Output.DESDM_ALLCELLSFileName" in key)]:
301 from PrimaryDPDMaker.DESDM_ALLCELLS
import DESDM_ALLCELLSCfg
303 log.info(
"---------- Configured ALLCELLS perfDPD")
306 from DigitizationConfig.DigitizationSteering
import DigitizationMessageSvcCfg
315 from AthenaConfiguration.Utils
import setupLoggingLevels
319 from EventInfoMgt.TagInfoMgrConfig
import TagInfoMgrCfg
324 "beam_type": flags.Beam.Type.value,
325 "beam_energy":
str(
int(flags.Beam.Energy)),
326 "triggerStreamOfFile":
""
328 else flags.Input.TriggerStream,
329 "project_name":
"IS_SIMULATION"
331 else flags.Input.ProjectName,
332 f
"AtlasRelease_{runArgs.trfSubstepName}": flags.Input.Release
or "n/a",
336 if not flags.Input.isMC
and flags.Input.DataYear > 0:
338 "data_year":
str(flags.Input.DataYear)
342 from PyUtils.AMITagHelperConfig
import AMITagCfg
346 if flags.PerfMon.doFullMonMT:
347 cfg.printPerfmonDomains()
349 timeConfig = time.time()
350 log.info(
"configured in %d seconds", timeConfig - timeStart)
352 log.info(
"Configured according to flag values listed below")
356 from AthenaConfiguration.AccumulatorCache
import AccumulatorDecorator
357 AccumulatorDecorator.printStats()
361 timeFinal = time.time()
362 log.info(
"Run RAWtoALL_skeleton in %d seconds (running %d seconds)", timeFinal - timeStart, timeFinal - timeConfig)
365 sys.exit(
not sc.isSuccess())