168def RunTrackConversion(flags, track_collections = [], outputfile='dump.json', setupMuon = False):
169 from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
170 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
171 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
172
173 cfg = MainServicesCfg(flags)
174
175
176 cfg.merge(PoolReadCfg(flags))
177 for collection in track_collections:
178 cfg.merge(TrackCollectionReadCfg(flags, collection))
179
180
181 from TrkEventCnvTools.TrkEventCnvToolsConfig import TrkEventCnvSuperToolCfg
182 cfg.merge(TrkEventCnvSuperToolCfg(flags))
183
184
185 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
186 cfg.merge(MuonGeoModelCfg(flags))
187
188
189 acc = TrkToActsConvertorAlgCfg(
190 flags, OutputLevel=1, TrackCollectionKeys=track_collections,
191 ATLASConverterTool= cfg.popToolsAndMerge(ActsToTrkConverterToolCfg(flags, setupMuon=setupMuon)))
192 cfg.merge(acc)
193
194
195 from DumpEventDataToJSON.DumpEventDataToJSONConfig import DumpEventDataToJSONAlgCfg
196 acc = DumpEventDataToJSONAlgCfg(
197 flags, doExtrap=False, OutputLevel=1,
198 TrackCollectionKeys=track_collections,
199 CscPrepRawDataKey="",
200 MMPrepRawDataKey="",
201 sTgcPrepRawDataKey="",
202 MdtPrepRawDataKey="",
203 RpcPrepRawDataKey="",
204 TgcPrepRawDataKey="",
205 PixelPrepRawDataKey="",
206 SctPrepRawDataKey="",
207 TrtPrepRawDataKey="",
208 CaloCellContainerKey=[""],
209 CaloClusterContainerKeys=[""],
210 MuonContainerKeys=[""],
211 JetContainerKeys=[""],
212 TrackParticleContainerKeys=[""],
213 OutputLocation=outputfile,
214 )
215 cfg.merge(acc)
216 cfg.printConfig(withDetails=True, summariseProps=True)
218
223 cfg.getCondAlgo("AtlasTrackingGeometryCondAlg").OutputLevel = FATAL
224
225 sc = cfg.run()
226 if not sc.isSuccess():
227 import sys
228 sys.exit("Execution failed")
229
230