ATLAS Offline Software
Loading...
Searching...
No Matches
TRTStandaloneConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.Enums import BeamType
4
5def TRTStandaloneCfg(flags, InputCollections = None):
6 acc = ComponentAccumulator()
7
8 #
9 # --- get list of already associated hits (always do this, even if no other tracking ran before)
10 #
11 prd_to_track_map = ''
12 if flags.Tracking.ActiveConfig.usePrdAssociationTool:
13 prd_to_track_map = 'InDetTRTonly_PRDtoTrackMap'
14 from InDetConfig.InDetTrackPRD_AssociationConfig import (
15 InDetTrackPRD_AssociationCfg)
16 acc.merge(InDetTrackPRD_AssociationCfg(flags,
17 name = 'InDetTRTonly_TrackPRD_Association',
18 AssociationMapName = prd_to_track_map,
19 TracksName = list(InputCollections)))
20
21 if flags.Beam.Type is BeamType.Cosmics:
22 #
23 # --- cosmics segment to track conversion for Barrel
24 #
25 from InDetConfig.TRT_SegmentsToTrackConfig import TRT_Cosmics_SegmentsToTrackCfg
26 acc.merge(TRT_Cosmics_SegmentsToTrackCfg(flags, name = 'InDetTRT_SegmentsToTrack_Barrel',
27 OutputTrackCollection = 'TRTStandaloneTracks',
28 InputSegmentsCollection = 'TRTSegments',
29 InputAssociationMapName = prd_to_track_map))
30
31 else:
32 #
33 # --- TRT standalone tracks algorithm
34 #
35 from InDetConfig.TRT_StandaloneTrackFinderConfig import (
36 TRT_StandaloneTrackFinderCfg)
37 acc.merge(TRT_StandaloneTrackFinderCfg(flags,
38 InputSegmentsLocation = 'TRTSegments',
39 PRDtoTrackMap = prd_to_track_map))
40 if flags.Tracking.doTruth:
41 from InDetConfig.TrackTruthConfig import InDetTrackTruthCfg
42 acc.merge(InDetTrackTruthCfg(
43 flags,
44 Tracks = "TRTStandaloneTracks",
45 DetailedTruth = "TRTStandaloneTracksDetailedTruth",
46 TracksTruth = "TRTStandaloneTracksTruthCollection"))
47
48 return acc
49
51 acc = ComponentAccumulator()
52
53 if flags.Beam.Type is BeamType.Cosmics:
54 #
55 # --- cosmics segment to track conversion for Barrel
56 #
57 from InDetConfig.TRT_SegmentsToTrackConfig import TRT_Cosmics_SegmentsToTrackCfg
58 acc.merge(TRT_Cosmics_SegmentsToTrackCfg(flags, name = 'InDetTRT_Cosmics_SegmentsToTrack',
59 OutputTrackCollection = 'StandaloneTRTTracks',
60 InputSegmentsCollection = 'TRTSegmentsTRT'))
61
62 else:
63 #
64 # --- TRT standalone tracks algorithm
65 #
66 from InDetConfig.TRT_StandaloneTrackFinderConfig import (
67 TRT_TrackSegment_TrackFinderCfg)
68 acc.merge(TRT_TrackSegment_TrackFinderCfg(flags,
69 InputSegmentsLocation = 'TRTSegmentsTRT'))
70
71
72 return acc
73
74
75if __name__ == "__main__":
76 from AthenaConfiguration.AllConfigFlags import initConfigFlags
77 flags = initConfigFlags()
78
79 from AthenaConfiguration.TestDefaults import defaultTestFiles
80 flags.Input.Files=defaultTestFiles.RDO_RUN2
81
82 # disable calo for this test
83 flags.Detector.EnableCalo = False
84
85 # TODO: TRT only?
86
87 numThreads=1
88 flags.Concurrency.NumThreads=numThreads
89 flags.Concurrency.NumConcurrentEvents=numThreads
90
91
92 flags.lock()
93 flags.dump()
94
95 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
96 top_acc = MainServicesCfg(flags)
97
98
99 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
100 top_acc.merge(PoolReadCfg(flags))
101
102 from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
103 top_acc.merge(TRT_ReadoutGeometryCfg( flags ))
104
105 from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
106 top_acc.merge( PixelReadoutGeometryCfg(flags) )
107
108 from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
109 top_acc.merge(SCT_ReadoutGeometryCfg(flags))
110
111
112 from InDetConfig.TRTPreProcessing import TRTPreProcessingCfg
113 top_acc.merge(TRTPreProcessingCfg(flags))
114
115 from InDetConfig.TRTSegmentFindingConfig import TRTSegmentFindingCfg
116 top_acc.merge(TRTSegmentFindingCfg(flags))
117
119 top_acc.merge(TRTStandaloneCfg(flags))
120
121 iovsvc = top_acc.getService('IOVDbSvc')
122 iovsvc.OutputLevel=5
123
124 top_acc.run(25)
125 top_acc.store(open("test_TRTStandaloneConfig.pkl", "wb"))
TRTStandaloneCfg(flags, InputCollections=None)