ATLAS Offline Software
Loading...
Searching...
No Matches
python.EVNTMerge_Skeleton Namespace Reference

Functions

 fromRunArgs (runArgs)

Variables

 jobPropertiesDisallowed

Function Documentation

◆ fromRunArgs()

python.EVNTMerge_Skeleton.fromRunArgs ( runArgs)

Definition at line 12 of file EVNTMerge_Skeleton.py.

12def fromRunArgs(runArgs):
13 from AthenaCommon.Logging import logging
14 log = logging.getLogger("EVNTMerge")
15 log.info("****************** STARTING EVNT MERGING *****************")
16
17 log.info("**** Transformation run arguments")
18 log.info(str(runArgs))
19
20 log.info("**** Setting-up configuration flags")
21 from AthenaConfiguration.AllConfigFlags import initConfigFlags
22 flags = initConfigFlags()
23
24 from AthenaConfiguration.Enums import ProductionStep, MetadataCategory
25 flags.Common.ProductionStep = ProductionStep.Generation
26
27 commonRunArgsToFlags(runArgs, flags)
28
29 if hasattr(runArgs, "inputEVNTFile"):
30 flags.Input.Files = runArgs.inputEVNTFile
31 else:
32 raise RuntimeError("No input EVNT file defined")
33
34 if hasattr(runArgs, "outputEVNT_MRGFile"):
35 if runArgs.outputEVNT_MRGFile == "None":
36 flags.Output.EVNTFileName = ""
37 # TODO decide if we need a specific EVNT_MRGFileName flag
38 else:
39 flags.Output.EVNTFileName = runArgs.outputEVNT_MRGFile
40 else:
41 raise RuntimeError("No outputEVNT_MRGFile defined")
42
43 # Pre-include
44 processPreInclude(runArgs, flags)
45
46 # Pre-exec
47 processPreExec(runArgs, flags)
48
49 # To respect --athenaopts
50 flags.fillFromArgs()
51
52 # Lock flags
53 flags.lock()
54
55 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
56 cfg = MainServicesCfg(flags)
57
58 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
59 cfg.merge(PoolReadCfg(flags))
60
61 # Old EVNT files may have only an old EventInfo called McEventInfo.
62 # Schedule a conversion in that case.
63 if ('EventInfo' not in flags.Input.Collections and
64 'McEventInfo' in flags.Input.Collections):
65 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
66 cfg.merge(EventInfoCnvAlgCfg(flags, disableBeamSpot = True))
67
68 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
69 cfg.merge(OutputStreamCfg(flags, "EVNT", disableEventTag = True, takeItemsFromInput = True, extendProvenanceRecord = False))
70
71 # Add in-file MetaData
72 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
73
74 cfg.merge(
75 SetupMetaDataForStreamCfg(
76 flags,
77 "EVNT",
78 disableEventTag=True,
79 createMetadata=[MetadataCategory.IOVMetaData],
80 )
81 )
82
83 # Post-include
84 processPostInclude(runArgs, flags, cfg)
85
86 # Post-exec
87 processPostExec(runArgs, flags, cfg)
88
89 # Write AMI tag into in-file metadata
90 from PyUtils.AMITagHelperConfig import AMITagCfg
91 cfg.merge(AMITagCfg(flags, runArgs))
92
93
94 from AthenaConfiguration.AutoConfigFlags import GetFileMD
95 hepmc_version = GetFileMD(flags.Input.Files).get("hepmc_version", None)
96 if hepmc_version is not None:
97 if hepmc_version == "2":
98 hepmc_version = "HepMC2"
99 elif hepmc_version == "3":
100 hepmc_version = "HepMC3"
101 log.info("Input file was produced with %s", hepmc_version)
102 from EventInfoMgt.TagInfoMgrConfig import TagInfoMgrCfg
103 cfg.merge(TagInfoMgrCfg(flags, tagValuePairs={"hepmc_version": hepmc_version}))
104
105 import time
106 tic = time.time()
107 # Run the final accumulator
108 sc = cfg.run()
109 log.info("Ran EVNTMerge_tf in " + str(time.time()-tic) + " seconds")
110
111 sys.exit(not sc.isSuccess())
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

Variable Documentation

◆ jobPropertiesDisallowed

python.EVNTMerge_Skeleton.jobPropertiesDisallowed

Definition at line 9 of file EVNTMerge_Skeleton.py.