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