27def TrackCollectionReadCfg (flags, key):
28 """Configure an algorithm to read a TrackCollection.
29KEY is the desired TrackCollection key.
30Will do nothing in serial mode, or if the requested object is not
31in the input file."""
32
33
34 result = ComponentAccumulator()
35 if flags.Concurrency.NumThreads <= 0:
36 return result
37
38
39
40 from AthenaConfiguration.AutoConfigFlags import GetFileMD
41 tcolls = set ([k
for t,k
in GetFileMD (flags.Input.Files).
get(
'itemList', [])
42 if t == 'TrackCollection'])
43 tracks_alias = _guessTracksAlias (tcolls)
44
45
46 if key == 'Tracks' and tracks_alias is not None and key not in tcolls:
47 key = tracks_alias
48
49
50 if key not in tcolls:
51 return result
52
53
54 aliases = []
55 if key == tracks_alias and 'Tracks' not in tcolls:
56 aliases = ['Tracks']
57
58 extra_inputs = []
59 if flags.Detector.GeometryPixel:
60 extra_inputs.append(('InDetDD::SiDetectorElementCollection', 'ConditionStore+PixelDetectorElementCollection'))
61 if flags.Detector.GeometrySCT:
62 extra_inputs.append(('InDetDD::SiDetectorElementCollection', 'ConditionStore+SCT_DetectorElementCollection'))
63 if flags.Detector.GeometryTRT:
64 extra_inputs.append(( 'InDetDD::TRT_DetElementContainer' , 'ConditionStore+TRT_DetElementContainer' ))
65 if flags.Detector.GeometryITkPixel:
66 extra_inputs.append(( 'InDetDD::SiDetectorElementCollection' , 'ConditionStore+ITkPixelDetectorElementCollection' ))
67 if flags.Detector.GeometryITkStrip:
68 extra_inputs.append(( 'InDetDD::SiDetectorElementCollection' , 'ConditionStore+ITkStripDetectorElementCollection' ))
69 if flags.Detector.GeometryMuon:
70 extra_inputs.append(('MuonGM::MuonDetectorManager', 'ConditionStore+MuonDetectorManager'))
71
72
73 AthReadAlg=CompFactory.AthReadAlg
74 alg = AthReadAlg ('TrackCollectionRead_' + key,
75 Key = 'TrackCollection/' + key,
76 Aliases = aliases,
77 ExtraInputs = extra_inputs)
78 result.addEventAlgo (alg)
79
80
81 from SGComps.AddressRemappingConfig import AddressRemappingCfg
82 result.merge (AddressRemappingCfg())
83 return result
84
85
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)