84def RunTrackConversion(flags, track_collections = [], outputfile='dump.json', setupMuon = False):
85 from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
86 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
87 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
88
89 cfg = MainServicesCfg(flags)
90
91
92 cfg.merge(PoolReadCfg(flags))
93 for collection in track_collections:
94 cfg.merge(TrackCollectionReadCfg(flags, collection))
95
96
97 from TrkEventCnvTools.TrkEventCnvToolsConfig import TrkEventCnvSuperToolCfg
98 cfg.merge(TrkEventCnvSuperToolCfg(flags))
99
100
101 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
102 cfg.merge(MuonGeoModelCfg(flags))
103
104
105 acc = TrkToActsConvertorAlgCfg(
106 flags, OutputLevel=1, TrackCollectionKeys=track_collections,
107 ATLASConverterTool= cfg.popToolsAndMerge(ActsToTrkConverterToolCfg(flags, setupMuon=setupMuon)))
108 cfg.merge(acc)
109
110
111 from DumpEventDataToJSON.DumpEventDataToJSONConfig import DumpEventDataToJSONAlgCfg
112 acc = DumpEventDataToJSONAlgCfg(
113 flags, doExtrap=False, OutputLevel=1,
114 TrackCollectionKeys=track_collections,
115 CscPrepRawDataKey="",
116 MMPrepRawDataKey="",
117 sTgcPrepRawDataKey="",
118 MdtPrepRawDataKey="",
119 RpcPrepRawDataKey="",
120 TgcPrepRawDataKey="",
121 PixelPrepRawDataKey="",
122 SctPrepRawDataKey="",
123 TrtPrepRawDataKey="",
124 CaloCellContainerKey=[""],
125 CaloClusterContainerKeys=[""],
126 MuonContainerKeys=[""],
127 JetContainerKeys=[""],
128 TrackParticleContainerKeys=[""],
129 OutputLocation=outputfile,
130 )
131 cfg.merge(acc)
132 cfg.printConfig(withDetails=True, summariseProps=True)
134
139 cfg.getCondAlgo("AtlasTrackingGeometryCondAlg").OutputLevel = FATAL
140
141 sc = cfg.run()
142 if not sc.isSuccess():
143 import sys
144 sys.exit("Execution failed")
145
146