3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.Enums
import ProductionStep
10 evSel = CompFactory.EventSelectorAthenaPool(
"EventSelector",
11 InputCollections=flags.Input.Files,
12 SkipEvents=flags.Exec.SkipEvents)
13 if flags.Input.OverrideRunNumber:
14 if not flags.Input.RunAndLumiOverrideList:
19 if flags.Input.ConditionsRunNumber > 0:
21 DataRunNumber = flags.Input.ConditionsRunNumber
23 InitialTimeStamp = flags.IOVDb.RunToTimestampDict.get(DataRunNumber, 1)
24 if not flags.Sim.DoFullChain:
25 OldRunNumber = flags.Input.RunNumbers[0]
26 elif flags.Input.RunNumbers:
28 DataRunNumber = flags.Input.RunNumbers[0]
29 FirstLB = flags.Input.LumiBlockNumbers[0]
30 InitialTimeStamp = flags.Input.TimeStamps[0]
31 assert DataRunNumber >= 0, (
32 "flags.Input.OverrideRunNumber was True, but provided DataRunNumber (%d) is negative. "
33 "Use a real run number from data." % DataRunNumber)
34 evSel.OverrideRunNumber = flags.Input.OverrideRunNumber
35 evSel.RunNumber = DataRunNumber
36 evSel.FirstLB = FirstLB
37 evSel.InitialTimeStamp = InitialTimeStamp
38 if hasattr(evSel,
"OverrideRunNumberFromInput"):
39 evSel.OverrideRunNumberFromInput = flags.Input.OverrideRunNumber
41 evSel.OldRunNumber = OldRunNumber
42 elif flags.Common.ProductionStep
in [ProductionStep.Simulation, ProductionStep.FastChain]:
44 from AthenaKernel.EventIdOverrideConfig
import getMinMaxRunNumbers, getFirstLumiBlock
46 evSel.OverrideRunNumber = flags.Input.OverrideRunNumber
47 evSel.RunNumber = minMax[0]
49 evSel.InitialTimeStamp = flags.IOVDb.RunToTimestampDict.get(minMax[0], 1)
50 if hasattr(evSel,
"OverrideRunNumberFromInput"):
51 evSel.OverrideRunNumberFromInput = flags.Input.OverrideRunNumber
55 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
57 elif flags.Common.ProductionStep
in [ProductionStep.Simulation]
and len(flags.Input.RunNumbers)
and flags.Sim.ISF.ReSimulation:
59 evSel.OverrideRunNumber =
True
60 evSel.RunNumber = flags.Input.RunNumbers[0]
61 if flags.Input.LumiBlockNumbers:
62 evSel.FirstLB = flags.Input.LumiBlockNumbers[0]
63 evSel.InitialTimeStamp = flags.IOVDb.RunToTimestampDict.get(flags.Input.RunNumbers[0], 1)
65 result.addService(evSel)
71 Creates a ComponentAccumulator instance containing the
72 athena services required for POOL file reading
77 from AthenaPoolCnvSvc.PoolCommonConfig
import AthenaPoolCnvSvcCfg, AthenaPoolAddressProviderSvcCfg
78 result.merge(
AthenaPoolCnvSvcCfg(flags, InputPoolAttributes=[
"DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'"]))
80 if flags.Input.SecondaryFiles:
81 skipEventsPrimary = flags.Exec.SkipEvents
82 skipEventsSecondary = flags.Exec.SkipEvents
83 if flags.Overlay.SkipSecondaryEvents >= 0:
84 skipEventsSecondary = flags.Overlay.SkipSecondaryEvents
87 evSel = CompFactory.DoubleEventSelectorAthenaPool(
"EventSelector",
88 InputCollections=flags.Input.Files)
90 if flags.Overlay.DataOverlay:
92 evSel.SkipEvents = skipEventsPrimary
95 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
100 name=
"AthenaPoolAddressProviderSvcPrimary",
101 DataHeaderKey=
"EventSelector"))
104 evSel.SkipEvents = skipEventsSecondary
106 evSel.ProcessMetadata =
False
110 name=
"AthenaPoolAddressProviderSvcPrimary",
111 DataHeaderKey=
"EventSelector",
112 AttributeListKey=
"Input"))
114 name=
"AthenaPoolAddressProviderSvcSecondary",
115 DataHeaderKey=
"SecondaryEventSelector"))
117 secondarySel = CompFactory.EventSelectorAthenaPool(
"SecondaryEventSelector",
119 InputCollections=flags.Input.SecondaryFiles,
120 SkipEvents=skipEventsPrimary)
121 result.addService(secondarySel)
122 result.addService(evSel)
127 evSel = result.getService(
"EventSelector")
130 processingTags=flags.Input.ProcessingTags
131 if "StreamAOD" in processingTags:
133 from RecJobTransforms.AODFixConfig
import AODFixCfg
141 result.setAppProperty(
"EvtSel", evSel.getFullJobOptName())