ATLAS Offline Software
TRTStandaloneConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.Enums import BeamType
4 
5 def TRTStandaloneCfg(flags, InputCollections = None):
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 
75 if __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"))
python.TRTPreProcessing.TRTPreProcessingCfg
def TRTPreProcessingCfg(flags)
Definition: TRTPreProcessing.py:11
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:55
python.TRT_StandaloneTrackFinderConfig.TRT_TrackSegment_TrackFinderCfg
def TRT_TrackSegment_TrackFinderCfg(flags, name='InDetTRT_TrackSegment_TrackFinder', **kwargs)
Definition: TRT_StandaloneTrackFinderConfig.py:25
python.TrackTruthConfig.InDetTrackTruthCfg
def InDetTrackTruthCfg(flags, Tracks="CombinedInDetTracks", DetailedTruth="CombinedInDetTracksDetailedTruth", TracksTruth="CombinedInDetTracksTruthCollection")
Definition: TrackTruthConfig.py:11
python.InDetTrackPRD_AssociationConfig.InDetTrackPRD_AssociationCfg
def InDetTrackPRD_AssociationCfg(flags, name='InDetTrackPRD_Association', **kwargs)
Definition: InDetTrackPRD_AssociationConfig.py:6
python.TRT_StandaloneTrackFinderConfig.TRT_StandaloneTrackFinderCfg
def TRT_StandaloneTrackFinderCfg(flags, name='InDetTRT_StandaloneTrackFinder', **kwargs)
Definition: TRT_StandaloneTrackFinderConfig.py:7
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:42
python.TRT_SegmentsToTrackConfig.TRT_Cosmics_SegmentsToTrackCfg
def TRT_Cosmics_SegmentsToTrackCfg(flags, name='InDetTRT_Cosmics_SegmentsToTrack', **kwargs)
Definition: TRT_SegmentsToTrackConfig.py:6
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
PixelGeoModelConfig.PixelReadoutGeometryCfg
def PixelReadoutGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:42
python.TRTStandaloneConfig.TRT_TrackSegment_Cfg
def TRT_TrackSegment_Cfg(flags)
Definition: TRTStandaloneConfig.py:50
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.TRTStandaloneConfig.TRTStandaloneCfg
def TRTStandaloneCfg(flags, InputCollections=None)
Definition: TRTStandaloneConfig.py:5
python.TRTSegmentFindingConfig.TRTSegmentFindingCfg
def TRTSegmentFindingCfg(flags, InputCollections=None)
Definition: TRTSegmentFindingConfig.py:5
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69