71def PoolReadCfg(flags):
72 """
73 Creates a ComponentAccumulator instance containing the
74 athena services required for POOL file reading
75 """
76
77 result = ComponentAccumulator()
78
79 from AthenaPoolCnvSvc.PoolCommonConfig import AthenaPoolAddressProviderSvcCfg
80 if flags.MP.UseSharedReader or flags.MP.UseSharedWriter:
81 from AthenaPoolCnvSvc.PoolCommonConfig import AthenaPoolSharedIOCnvSvcCfg
82 result.merge(AthenaPoolSharedIOCnvSvcCfg(flags, InputPoolAttributes=["DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'"]))
83 elif flags.PoolSvc.PersSvcPerInputType:
84 from AthenaPoolCnvSvc.PoolCommonConfig import AthenaPoolCnvSvcCfg
85 result.merge(AthenaPoolCnvSvcCfg(flags, InputPoolAttributes=["DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '0'"]))
86 else:
87 from AthenaPoolCnvSvc.PoolCommonConfig import AthenaPoolCnvSvcCfg
88 result.merge(AthenaPoolCnvSvcCfg(flags, InputPoolAttributes=["DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'"]))
89
90
91 from AthenaServices.ROOTMessageFilterSvcConfig import ROOTMessageFilterSvcCfg
92 result.merge(ROOTMessageFilterSvcCfg(flags,
93 SuppressionRules=[('TClass::Init',
94 '.*DataHeader.*_p[12].*',
95 ROOT.kWarning),
96 ('TClass::Init',
97 '.*PoolToken_p1.*',
98 ROOT.kWarning)]))
99
100 if flags.Input.SecondaryFiles:
101 skipEventsPrimary = flags.Exec.SkipEvents
102 skipEventsSecondary = flags.Exec.SkipEvents
103 if flags.Overlay.SkipSecondaryEvents >= 0:
104 skipEventsSecondary = flags.Overlay.SkipSecondaryEvents
105
106
107 evSel = CompFactory.DoubleEventSelectorAthenaPool("EventSelector",
108 CollectionType="RootCollection",
109 InputCollections=flags.Input.Files)
110
111
112 evSel.SkipEvents = skipEventsSecondary
113
114 evSel.ProcessMetadata = False
115
116
117 result.merge(AthenaPoolAddressProviderSvcCfg(flags,
118 name="AthenaPoolAddressProviderSvcPrimary",
119 DataHeaderKey="EventSelector",
120 AttributeListKey="Input"))
121 result.merge(AthenaPoolAddressProviderSvcCfg(flags,
122 name="AthenaPoolAddressProviderSvcSecondary",
123 DataHeaderKey="SecondaryEventSelector"))
124
125 secondarySel = CompFactory.EventSelectorAthenaPool("SecondaryEventSelector",
126 CollectionType="RootCollection",
127 IsSecondary=True,
128 InputCollections=flags.Input.SecondaryFiles,
129 SkipEvents=skipEventsPrimary)
130 result.addService(secondarySel)
131 result.addService(evSel)
132 else:
133
134 result.merge(AthenaPoolAddressProviderSvcCfg(flags))
135 result.merge(EventSelectorAthenaPoolCfg(flags))
136 evSel = result.getService("EventSelector")
137
138
139 processingTags=flags.Input.ProcessingTags
140 if "StreamAOD" in processingTags:
141 try:
142 from RecJobTransforms.AODFixConfig import AODFixCfg
143 result.merge(AODFixCfg(flags))
144 except ImportError:
145
146 pass
147
148
149
150 result.setAppProperty("EvtSel", evSel.getFullJobOptName())
151
152 return result