39def fromRunArgs(runArgs):
40 from AthenaCommon.Logging import logging
41 log = logging.getLogger('PRWConfig_tf')
42 log.info( '****************** STARTING AODtoNTUP_PILEUP *****************' )
43
44 log.info('**** Transformation run arguments')
45 log.info(str(runArgs))
46
47 log.info('**** Setting-up configuration flags')
48 from AthenaConfiguration.AllConfigFlags import initConfigFlags
49 flags = initConfigFlags()
50
51 commonRunArgsToFlags(runArgs, flags)
52
53 if hasattr(runArgs, 'inputAODFile'):
54 flags.Input.Files = runArgs.inputAODFile
55 else:
56 raise RuntimeError('No input AOD file defined')
57
58 if hasattr(runArgs, 'outputNTUP_PILEUPFile'):
59 flags.Output.HISTFileName = runArgs.outputNTUP_PILEUPFile
60 else:
61 log.warning('No output file set')
62 flags.Output.HISTFileName = 'output.NTUP_PILEUP.root'
63
64
65 processPreInclude(runArgs, flags)
66
67
68 processPreExec(runArgs, flags)
69
70
71 flags.fillFromArgs()
72
73
74 flags.lock()
75
76 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
77 cfg = MainServicesCfg(flags)
78
79 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
80 cfg.merge(PoolReadCfg(flags))
81
82 cfg.merge(PRWSteeringCfg(flags))
83
84
85 processPostInclude(runArgs, flags, cfg)
86
87
88 processPostExec(runArgs, flags, cfg)
89
90 import time
91 tic = time.time()
92
93 sc = cfg.run()
94 log.info("Ran PRWConfig_tf in " + str(time.time()-tic) + " seconds")
95
96 sys.exit(not sc.isSuccess())