ATLAS Offline Software
Loading...
Searching...
No Matches
ITkTrigSequence.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from TrigInDetConfig.InnerTrackerTrigSequence import InnerTrackerTrigSequence
4from AthenaConfiguration.AthConfigFlags import AthConfigFlags
5from AthenaConfiguration.Enums import Format
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8
9from AthenaCommon.Logging import logging
10
11class ITkTrigSequence(InnerTrackerTrigSequence):
12 def __init__(self, flags : AthConfigFlags, signature : str, rois : str, inView : str):
13 super().__init__(flags, signature,rois,inView)
14 self.log = logging.getLogger("ITkTrigSequence")
15 self.log.info(f"signature: {self.signature} rois: {self.rois} inview: {self.inView}")
16
17
18 def viewDataVerifier(self, viewVerifier='IDViewDataVerifier') -> ComponentAccumulator:
19
20 acc = ComponentAccumulator()
21
22 ViewDataVerifier = CompFactory.AthViews.ViewDataVerifier(
23 name = viewVerifier + "_" + self.signature,
24 DataObjects= {('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
25 ('InDet::PixelClusterContainerCache', self.flags.Trigger.ITkTracking.PixelClusterCacheKey),
26 ('PixelRDO_Cache', self.flags.Trigger.ITkTracking.PixRDOCacheKey),
27 ('InDet::SCT_ClusterContainerCache', self.flags.Trigger.ITkTracking.SCTClusterCacheKey),
28 ('SCT_RDO_Cache', self.flags.Trigger.ITkTracking.SCTRDOCacheKey),
29 ('IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.PixBSErrCacheKey ),
30 ('IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.SCTBSErrCacheKey ),
31 ('IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.SCTFlaggedCondCacheKey ),
32 ('SpacePointCache', self.flags.Trigger.ITkTracking.SpacePointCachePix),
33 ('SpacePointCache', self.flags.Trigger.ITkTracking.SpacePointCacheSCT),
34 ('InDet::SiDetectorElementStatus' , 'StoreGateSvc+ITkPixelDetectorElementStatus' ),
35 ('InDet::SiDetectorElementStatus' , 'StoreGateSvc+ITkStripDetectorElementStatus' ),
36 ('xAOD::EventInfo', 'EventInfo'),
37 ('TrigRoiDescriptorCollection', str(self.rois)),
38 ('TagInfo' , 'DetectorStore+ProcessingTags' )} )
39
40 isByteStream = self.flags.Input.Format == Format.BS
41 if not isByteStream:
42 ViewDataVerifier.DataObjects |= {( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
43 ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
44 ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map')}
45 from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
46 sgil_load = [( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
47 ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
48 ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map')]
49 acc.merge(SGInputLoaderCfg(self.flags, Load=sgil_load))
50
51 acc.addEventAlgo(ViewDataVerifier)
52 return acc
53
54 def dataPreparation(self) -> ComponentAccumulator:
55
56 signature = self.flags.Tracking.ActiveConfig.input_name
57
58 acc = ComponentAccumulator()
59
60 self.log.info(f"DataPrep signature: {self.signature} rois: {self.rois} inview: {self.inView}")
61
62 if not self.inView:
63 from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
64 loadRDOs = [( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
65 ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
66 ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map') ]
67 acc.merge(SGInputLoaderCfg(self.flags, Load=loadRDOs))
68
69 if self.flags.Input.Format == Format.BS:
70 if self.flags.Detector.EnableITkPixel:
71 from ITkPixelByteStreamCnv.ITkPixelByteStreamCnvConfig import ITkPixelDecodingAlgCfg
72 acc.merge( ITkPixelDecodingAlgCfg(self.flags) )
73
74 if self.flags.Detector.EnableITkStrip:
75 from ITkStripsByteStreamCnv.ITkStripByteStreamCnvConfig import ITkStripRawDataProviderCfg
76 acc.merge(ITkStripRawDataProviderCfg(self.flags))
77
78 #Clusterisation
79 from InDetConfig.InDetPrepRawDataFormationConfig import ITkTrigPixelClusterizationCfg, ITkTrigStripClusterizationCfg
80 if self.flags.Detector.EnableITkPixel:
81 acc.merge(ITkTrigPixelClusterizationCfg(self.flags, roisKey=self.rois, signature=signature))
82 if self.flags.Detector.EnableITkStrip:
83 acc.merge(ITkTrigStripClusterizationCfg(self.flags, roisKey=self.rois, signature=signature))
84 return acc
85
86 def viewDataVerifierAfterPattern(self, viewVerifier='IDViewDataVerifierForAmbi') -> ComponentAccumulator:
87
88 acc = ComponentAccumulator()
89
90 dataObjects = [
91 ( 'InDet::PixelGangedClusterAmbiguities' , self.flags.Trigger.ITkTracking.ClusterAmbiguitiesMap),
92 ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map')
93 ]
94 from TrigInDetConfig.TrigInDetConfig import InDetExtraDataObjectsFromDataPrep
95 InDetExtraDataObjectsFromDataPrep(self.flags,dataObjects)
96
97 ViewDataVerifier = \
98 CompFactory.AthViews.ViewDataVerifier(
99 name = viewVerifier + "_" + self.signature,
100 DataObjects = dataObjects
101 )
102 from TrigInDetConfig.TrigInDetConfig import InDetExtraDataObjectsFromDataPrep
103
104 acc.addEventAlgo(ViewDataVerifier)
105 return acc
106
107
108 def spacePointFormation(self) -> ComponentAccumulator:
109
110 signature = self.flags.Tracking.ActiveConfig.input_name
111 acc = ComponentAccumulator()
112
113 from InDetConfig.SiSpacePointFormationConfig import ITkTrigSiTrackerSpacePointFinderCfg
114 acc.merge(ITkTrigSiTrackerSpacePointFinderCfg(self.flags, signature=signature))
115 return acc
116
118 extraFlags : AthConfigFlags = None,
119 inputTracksName : str = None) -> ComponentAccumulator:
120 acc = self.fastTrackFinderBase(extraFlags, inputTracksName)
121 signature = self.flags.Tracking.ActiveConfig.input_name
122
123 if not self.flags.Tracking.ActiveConfig.doZFinderOnly:
124 self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_FTF
125 from xAODTrackingCnv.xAODTrackingCnvConfig import TrigITkTrackParticleCnvAlgCfg
126 acc.merge(TrigITkTrackParticleCnvAlgCfg(self.flags,
127 name = "ITkTrigTrackParticleCnvAlg"+signature,
128 TrackContainerName = self.lastTrkCollection,
129 xAODTrackParticlesFromTracksContainerName = self.flags.Tracking.ActiveConfig.tracks_FTF))
130
131 return acc
132
133 def ambiguitySolver(self) -> ComponentAccumulator:
134
135 acc = ComponentAccumulator()
136
137 if self.inView:
138 acc.merge(self.viewDataVerifierAfterPattern())
139
140 from TrkConfig.TrkAmbiguitySolverConfig import TrigITkTrkAmbiguityScoreCfg
141 acc.merge(
142 TrigITkTrkAmbiguityScoreCfg(
143 self.flags,
144 name = f"{self.ambiPrefix}Score_{self.flags.Tracking.ActiveConfig.input_name}",
145 TrackInput = [self.lastTrkCollection],
146 AmbiguityScoreProcessor = None
147 )
148 )
149
150 from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguitySolver_Trig_Cfg
151 acc.merge(
152 TrkAmbiguitySolver_Trig_Cfg(
153 self.flags,
154 name = f"{self.ambiPrefix}guitySolver_{self.flags.Tracking.ActiveConfig.input_name}",
155 )
156 )
157 self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_IDTrig+"_Amb"
158 return acc
159
160 def xAODParticleCreation(self) -> ComponentAccumulator:
161
162 acc = ComponentAccumulator()
163
164 from xAODTrackingCnv.xAODTrackingCnvConfig import TrigITkTrackParticleCnvAlgCfg
165 prefix = "ITk"
166 acc.merge(TrigITkTrackParticleCnvAlgCfg(
167 self.flags,
168 name = prefix+'xAODParticleCreatorAlg'+self.flags.Tracking.ActiveConfig.input_name+'_IDTrig',
169 TrackContainerName = self.lastTrkCollection,
170 xAODTrackParticlesFromTracksContainerName = self.flags.Tracking.ActiveConfig.tracks_IDTrig,
171 ))
172 return acc
173
174 def offlinePattern(self) -> ComponentAccumulator:
175
176 ca = ComponentAccumulator()
177
178 from InDetConfig.SiSPSeededTrackFinderConfig import TrigITkSiSPSeededTrackFinderCfg
179
180 self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_IDTrig
181 ca.merge(TrigITkSiSPSeededTrackFinderCfg(self.flags,
182 name = 'EFsiSPSeededTrackFinder'+self.flags.Tracking.ActiveConfig.input_name,
183 TracksLocation = self.lastTrkCollection,
184 ))
185
186 self.ambiPrefix = "EFAmbi"
187
188 return ca
ComponentAccumulator dataPreparation(self)
__init__(self, AthConfigFlags flags, str signature, str rois, str inView)
ComponentAccumulator spacePointFormation(self)
ComponentAccumulator offlinePattern(self)
ComponentAccumulator viewDataVerifierAfterPattern(self, viewVerifier='IDViewDataVerifierForAmbi')
ComponentAccumulator xAODParticleCreation(self)
ComponentAccumulator ambiguitySolver(self)
ComponentAccumulator viewDataVerifier(self, viewVerifier='IDViewDataVerifier')
ComponentAccumulator fastTrackFinder(self, AthConfigFlags extraFlags=None, str inputTracksName=None)