ATLAS Offline Software
InDetTrigSequence.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from TrigInDetConfig.InnerTrackerTrigSequence import InnerTrackerTrigSequence
4 from AthenaConfiguration.Enums import Format
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
8 from AthenaCommon.Logging import logging
9 
10 
11 class InDetTrigSequence(InnerTrackerTrigSequence):
12 
13  def __init__(self,flags : AthConfigFlags, signature : str, rois : str, inView : str):
14  super().__init__(flags, signature,rois,inView)
15  self.log = logging.getLogger("InDetTrigSequence")
16  self.log.info(f"signature: {self.signature} rois: {self.rois} inview: {self.inView}")
17 
18  def offlinePattern(self) -> ComponentAccumulator:
19 
21 
22  from InDetConfig.SiSPSeededTrackFinderConfig import TrigSiSPSeededTrackFinderCfg
23  ca.merge(TrigSiSPSeededTrackFinderCfg(self.flags,
24  name = 'EFsiSPSeededTrackFinder'+self.flags.Tracking.ActiveConfig.input_name
25  ))
26 
27  self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_IDTrig
28  self.ambiPrefix = "EFAmbi"
29 
30  return ca
31 
32 
33  def viewDataVerifier(self, viewVerifier='IDViewDataVerifier') -> ComponentAccumulator:
34 
35  acc = ComponentAccumulator()
36 
37  dataObjs = {( 'InDet::PixelClusterContainerCache' , self.flags.Trigger.InDetTracking.PixelClusterCacheKey ),
38  ( 'PixelRDO_Cache' , self.flags.Trigger.InDetTracking.PixRDOCacheKey ),
39  ( 'InDet::SCT_ClusterContainerCache' , self.flags.Trigger.InDetTracking.SCTClusterCacheKey ),
40  ( 'SCT_RDO_Cache' , self.flags.Trigger.InDetTracking.SCTRDOCacheKey ),
41  ( 'SpacePointCache' , self.flags.Trigger.InDetTracking.SpacePointCachePix ),
42  ( 'SpacePointCache' , self.flags.Trigger.InDetTracking.SpacePointCacheSCT ),
43  ( 'IDCInDetBSErrContainer_Cache' , self.flags.Trigger.InDetTracking.PixBSErrCacheKey ),
44  ( 'IDCInDetBSErrContainer_Cache' , self.flags.Trigger.InDetTracking.SCTBSErrCacheKey ),
45  ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
46  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )}
47 
48  ViewDataVerifier = CompFactory.AthViews.ViewDataVerifier( name = viewVerifier + "_" + self.signature,
49  DataObjects = dataObjs)
50 
51  isByteStream = self.flags.Input.Format == Format.BS
52  if not isByteStream:
53  ViewDataVerifier.DataObjects |= {( 'PixelRDO_Container' , 'PixelRDOs' ),
54  ( 'SCT_RDO_Container' , 'SCT_RDOs' )}
55 
56  ViewDataVerifier.DataObjects.add(( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+%s' % self.rois ))
57 
58  acc.addEventAlgo(ViewDataVerifier)
59  return acc
60 
61 
62 
63  def viewDataVerifierTRT(self, viewVerifier='IDViewDataVerifierTRT') -> ComponentAccumulator:
64 
65  acc = ComponentAccumulator()
66 
67  ViewDataVerifier = \
68  CompFactory.AthViews.ViewDataVerifier( name = viewVerifier + "_" + self.signature,
69  DataObjects = {
70  ( 'InDet::TRT_DriftCircleContainerCache' ,
71  f'StoreGateSvc+{self.flags.Trigger.InDetTracking.TRT_DriftCircleCacheKey}' ),
72 
73  }
74  )
75 
76  if self.flags.Input.Format == Format.BS:
77  ViewDataVerifier.DataObjects.add(( 'TRT_RDO_Cache' , f'StoreGateSvc+{self.flags.Trigger.InDetTracking.TRTRDOCacheKey}'))
78  else:
79  ViewDataVerifier.DataObjects.add(( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' ))
80 
81  acc.addEventAlgo(ViewDataVerifier)
82  return acc
83 
84  def viewDataVerifierAfterDataPrep(self, viewVerifier='IDViewDataVerifierAfterDataPrep') -> ComponentAccumulator:
85 
86  acc = ComponentAccumulator()
87 
88  ViewDataVerifier = \
89  CompFactory.AthViews.ViewDataVerifier( name = viewVerifier + "_" + self.signature,
90  DataObjects = {
91  ( 'SpacePointContainer', 'StoreGateSvc+SCT_TrigSpacePoints' ),
92  ( 'SpacePointContainer', 'StoreGateSvc+PixelTrigSpacePoints' ),
93  ( 'SpacePointOverlapCollection', 'StoreGateSvc+OverlapSpacePoints' ),
94  #( 'InDet::PixelGangedClusterAmbiguities' , 'StoreGateSvc+TrigPixelClusterAmbiguitiesMap' ),
95  ( 'InDet::SCT_ClusterContainer', 'StoreGateSvc+SCT_TrigClusters' ),
96  ( 'InDet::PixelClusterContainer', 'StoreGateSvc+PixelTrigClusters' ),
97  }
98  )
99 
100  if self.flags.Input.Format == Format.BS:
101  ViewDataVerifier.DataObjects |= {
102  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ),
103  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ),
104  }
105 
106  acc.addEventAlgo(ViewDataVerifier)
107  return acc
108 
109  def viewDataVerifierAfterPattern(self, viewVerifier='IDViewDataVerifierForAmbi') -> ComponentAccumulator:
110 
111  acc = ComponentAccumulator()
112 
113  ViewDataVerifier = \
114  CompFactory.AthViews.ViewDataVerifier( name = viewVerifier + "_" + self.signature,
115  DataObjects = {
116  ( 'InDet::PixelGangedClusterAmbiguities' , 'TrigPixelClusterAmbiguitiesMap'),
117  }
118  )
119  if self.flags.Input.Format == Format.BS:
120  ViewDataVerifier.DataObjects |= {
121  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ),
122  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ),
123  }
124 
125  acc.addEventAlgo(ViewDataVerifier)
126  return acc
127 
128  def dataPreparation(self) -> ComponentAccumulator:
129 
130  signature = self.flags.Tracking.ActiveConfig.input_name
131 
132  acc = ComponentAccumulator()
133 
134  self.log.info(f"DataPrep signature: {self.signature} rois: {self.rois} inview: {self.inView}")
135 
136  if self.flags.Input.Format == Format.BS:
137  from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConfig import TrigPixelRawDataProviderAlgCfg
138  acc.merge(TrigPixelRawDataProviderAlgCfg(self.flags,suffix=signature,RoIs=self.rois))
139 
140  from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConfig import TrigSCTRawDataProviderCfg
141  acc.merge(TrigSCTRawDataProviderCfg(self.flags,suffix=signature,RoIs=self.rois))
142  elif not self.inView:
143  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
144  loadRDOs = [( 'PixelRDO_Container' , 'StoreGateSvc+PixelRDOs' ),
145  ( 'SCT_RDO_Container' , 'StoreGateSvc+SCT_RDOs' ) ]
146  acc.merge(SGInputLoaderCfg(self.flags, Load=loadRDOs))
147 
148  #Clusterisation
149  from InDetConfig.InDetPrepRawDataFormationConfig import TrigPixelClusterizationCfg
150  acc.merge(TrigPixelClusterizationCfg(self.flags,
151  self.rois,
152  name=f"InDetPixelClusterization_{signature}"))
153 
154 
155  from InDetConfig.InDetPrepRawDataFormationConfig import TrigSCTClusterizationCfg
156  acc.merge(TrigSCTClusterizationCfg(self.flags,
157  self.rois,
158  name=f"InDetSCTClusterization_{signature}"))
159 
160  return acc
161 
162 
163  def dataPreparationTRT(self) ->ComponentAccumulator:
164 
165  acc = ComponentAccumulator()
166 
167  acc.merge(self.viewDataVerifierTRT())
168 
169  if self.flags.Input.Format == Format.BS:
170  from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConfig import TrigTRTRawDataProviderCfg
171  acc.merge(TrigTRTRawDataProviderCfg(self.flags, RoIs=self.lastRois))
172 
173  elif not self.inView:
174  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
175  loadRDOs = [( 'TRT_RDO_Container' , 'StoreGateSvc+TRT_RDOs' )]
176  acc.merge(SGInputLoaderCfg(self.flags, Load=loadRDOs))
177 
178  from InDetConfig.InDetPrepRawDataFormationConfig import TrigTRTRIOMakerCfg
179  signature = self.flags.Tracking.ActiveConfig.input_name
180  acc.merge(TrigTRTRIOMakerCfg(self.flags,
181  self.lastRois,
182  name=f"TrigTRTDriftCircleMaker_{signature}"))
183 
184 
185  return acc
186 
187 
188  def spacePointFormation(self) -> ComponentAccumulator:
189 
190  signature = self.flags.Tracking.ActiveConfig.input_name
191  acc = ComponentAccumulator()
192 
193  from InDetConfig.SiSpacePointFormationConfig import TrigSiTrackerSpacePointFinderCfg
194  acc.merge(TrigSiTrackerSpacePointFinderCfg(self.flags, name="TrigSpacePointFinder"+signature))
195  return acc
196 
197  def fastTrackFinder(self,
198  extraFlags : AthConfigFlags = None,
199  inputTracksName : str = None) -> ComponentAccumulator:
200  acc = self.fastTrackFinderBase(extraFlags, inputTracksName)
201  if not self.flags.Tracking.ActiveConfig.doZFinderOnly:
202  from TrkConfig.TrkParticleCreatorConfig import InDetTrigParticleCreatorToolFTFCfg
203  creatorTool = acc.popToolsAndMerge(InDetTrigParticleCreatorToolFTFCfg(self.flags))
204  acc.addPublicTool(creatorTool)
205 
206  from xAODTrackingCnv.xAODTrackingCnvConfig import TrigTrackParticleCnvAlgCfg
207  prefix = "InDet"
208  acc.merge(
210  self.flags,
211  name = prefix+'xAODParticleCreatorAlg'+self.flags.Tracking.ActiveConfig.input_name+'_FTF',
212  TrackParticleCreator = creatorTool,
213  TrackContainerName = self.lastTrkCollection,
214  xAODTrackParticlesFromTracksContainerName = self.flags.Tracking.ActiveConfig.tracks_FTF,
215  )
216  )
217  return acc
218 
219 
220  def ambiguitySolver(self) -> ComponentAccumulator:
221 
222  acc = ComponentAccumulator()
223 
224  if self.inView:
225  acc.merge(self.viewDataVerifierAfterPattern())
226 
227  from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguityScore_Trig_Cfg
228  acc.merge(
230  self.flags,
231  name = f"{self.ambiPrefix}Score_{self.flags.Tracking.ActiveConfig.input_name}",
232  TrackInput = [self.lastTrkCollection],
233  AmbiguityScoreProcessor = None
234  )
235  )
236 
237  from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguitySolver_Trig_Cfg
238  acc.merge(
240  self.flags,
241  name = f"{self.ambiPrefix}guitySolver_{self.flags.Tracking.ActiveConfig.input_name}",
242  )
243  )
244 
245  self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_IDTrig+"_Amb"
246  return acc
247 
248 
249  def trtExtensions(self) -> ComponentAccumulator:
250 
251  acc = self.dataPreparationTRT()
252 
253  from InDetConfig.TRT_TrackExtensionAlgConfig import Trig_TRT_TrackExtensionAlgCfg
254  acc.merge(Trig_TRT_TrackExtensionAlgCfg(self.flags, self.lastTrkCollection, name="TrigTrackExtensionAlg%s"% self.signature))
255 
256  from InDetConfig.InDetExtensionProcessorConfig import TrigInDetExtensionProcessorCfg
257  acc.merge(TrigInDetExtensionProcessorCfg(self.flags, name="TrigExtensionProcessor%s"% self.signature))
258 
259  self.lastTrkCollection = self.flags.Tracking.ActiveConfig.trkTracks_IDTrig
260 
261  return acc
262 
263 
264  def xAODParticleCreation(self) -> ComponentAccumulator:
265 
266  if self.flags.Tracking.ActiveConfig.doTRT:
267  acc = self.dataPreparationTRT()
268  else:
269  acc = ComponentAccumulator()
270 
271  from xAODTrackingCnv.xAODTrackingCnvConfig import TrigTrackParticleCnvAlgCfg
272  prefix = "InDet"
273  acc.merge(
275  self.flags,
276  name = prefix+'xAODParticleCreatorAlg'+self.flags.Tracking.ActiveConfig.input_name+'_IDTrig',
277  TrackContainerName = self.lastTrkCollection,
278  xAODTrackParticlesFromTracksContainerName = self.flags.Tracking.ActiveConfig.tracks_IDTrig,
279  ))
280  return acc
281 
grepfile.info
info
Definition: grepfile.py:38
PixelRawDataByteStreamCnvConfig.TrigPixelRawDataProviderAlgCfg
def TrigPixelRawDataProviderAlgCfg(flags, suffix, RoIs, **kwargs)
Definition: PixelRawDataByteStreamCnvConfig.py:37
python.TrkAmbiguitySolverConfig.TrkAmbiguityScore_Trig_Cfg
def TrkAmbiguityScore_Trig_Cfg(flags, name='InDetTrig_SeededAmbiguityScore', **kwargs)
Definition: TrkAmbiguitySolverConfig.py:61
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetTrigSequence.InDetTrigSequence.log
log
Definition: InDetTrigSequence.py:15
python.InDetTrigSequence.InDetTrigSequence
Definition: InDetTrigSequence.py:11
python.TRT_TrackExtensionAlgConfig.Trig_TRT_TrackExtensionAlgCfg
def Trig_TRT_TrackExtensionAlgCfg(flags, inputTracks, name='TrigTrackExtensionAlg', **kwargs)
Definition: TRT_TrackExtensionAlgConfig.py:29
python.SCT_RawDataByteStreamCnvConfig.TrigSCTRawDataProviderCfg
def TrigSCTRawDataProviderCfg(flags, suffix, RoIs)
Definition: SCT_RawDataByteStreamCnvConfig.py:40
python.InDetTrigSequence.InDetTrigSequence.__init__
def __init__(self, AthConfigFlags flags, str signature, str rois, str inView)
Definition: InDetTrigSequence.py:13
python.InDetTrigSequence.InDetTrigSequence.trtExtensions
ComponentAccumulator trtExtensions(self)
Definition: InDetTrigSequence.py:249
python.InDetTrigSequence.InDetTrigSequence.offlinePattern
ComponentAccumulator offlinePattern(self)
Definition: InDetTrigSequence.py:18
python.InDetTrigSequence.InDetTrigSequence.dataPreparation
ComponentAccumulator dataPreparation(self)
Definition: InDetTrigSequence.py:128
python.InDetTrigSequence.InDetTrigSequence.viewDataVerifierAfterPattern
ComponentAccumulator viewDataVerifierAfterPattern(self, viewVerifier='IDViewDataVerifierForAmbi')
Definition: InDetTrigSequence.py:109
python.InDetTrigSequence.InDetTrigSequence.xAODParticleCreation
ComponentAccumulator xAODParticleCreation(self)
Definition: InDetTrigSequence.py:264
python.InDetExtensionProcessorConfig.TrigInDetExtensionProcessorCfg
def TrigInDetExtensionProcessorCfg(flags, name="InDetTrigMTExtensionProcessor", **kwargs)
Definition: InDetExtensionProcessorConfig.py:67
python.InDetPrepRawDataFormationConfig.TrigTRTRIOMakerCfg
def TrigTRTRIOMakerCfg(flags, RoIs, name="InDetTrigMTTRTDriftCircleMaker", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:280
xAODTrackingCnvConfig.TrigTrackParticleCnvAlgCfg
def TrigTrackParticleCnvAlgCfg(flags, name="TrigTrackParticleCnvAlg", ClusterSplitProbabilityName="", AssociationMapName="", **kwargs)
Definition: xAODTrackingCnvConfig.py:150
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
python.InDetTrigSequence.InDetTrigSequence.viewDataVerifier
ComponentAccumulator viewDataVerifier(self, viewVerifier='IDViewDataVerifier')
Definition: InDetTrigSequence.py:33
python.TrkParticleCreatorConfig.InDetTrigParticleCreatorToolFTFCfg
def InDetTrigParticleCreatorToolFTFCfg(flags, name="InDetTrigParticleCreatorToolFTF", **kwargs)
Definition: TrkParticleCreatorConfig.py:155
python.SiSpacePointFormationConfig.TrigSiTrackerSpacePointFinderCfg
def TrigSiTrackerSpacePointFinderCfg(flags, name="InDetTrigSiTrackerSpacePointFinder", **kwargs)
Definition: SiSpacePointFormationConfig.py:96
python.InDetTrigSequence.InDetTrigSequence.spacePointFormation
ComponentAccumulator spacePointFormation(self)
Definition: InDetTrigSequence.py:188
python.TRT_RawDataByteStreamCnvConfig.TrigTRTRawDataProviderCfg
def TrigTRTRawDataProviderCfg(AthConfigFlags flags, str RoIs, **kwargs)
Definition: TRT_RawDataByteStreamCnvConfig.py:39
python.InDetTrigSequence.InDetTrigSequence.ambiguitySolver
ComponentAccumulator ambiguitySolver(self)
Definition: InDetTrigSequence.py:220
python.InDetTrigSequence.InDetTrigSequence.dataPreparationTRT
ComponentAccumulator dataPreparationTRT(self)
Definition: InDetTrigSequence.py:163
python.InDetTrigSequence.InDetTrigSequence.viewDataVerifierAfterDataPrep
ComponentAccumulator viewDataVerifierAfterDataPrep(self, viewVerifier='IDViewDataVerifierAfterDataPrep')
Definition: InDetTrigSequence.py:84
python.InDetTrigSequence.InDetTrigSequence.ambiPrefix
ambiPrefix
Definition: InDetTrigSequence.py:28
python.SiSPSeededTrackFinderConfig.TrigSiSPSeededTrackFinderCfg
def TrigSiSPSeededTrackFinderCfg(flags, name="InDetTrigSiSpTrackFinder", **kwargs)
Definition: SiSPSeededTrackFinderConfig.py:63
python.InDetTrigSequence.InDetTrigSequence.fastTrackFinder
ComponentAccumulator fastTrackFinder(self, AthConfigFlags extraFlags=None, str inputTracksName=None)
Definition: InDetTrigSequence.py:197
python.TrkAmbiguitySolverConfig.TrkAmbiguitySolver_Trig_Cfg
def TrkAmbiguitySolver_Trig_Cfg(flags, name='InDetTrig_SeededAmbiguitySolver', **kwargs)
Definition: TrkAmbiguitySolverConfig.py:161
python.InDetTrigSequence.InDetTrigSequence.viewDataVerifierTRT
ComponentAccumulator viewDataVerifierTRT(self, viewVerifier='IDViewDataVerifierTRT')
Definition: InDetTrigSequence.py:63
python.InDetPrepRawDataFormationConfig.TrigSCTClusterizationCfg
def TrigSCTClusterizationCfg(flags, RoIs, name="InDetSCT_Clusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:166
python.InDetTrigSequence.InDetTrigSequence.lastTrkCollection
lastTrkCollection
Definition: InDetTrigSequence.py:27
python.InDetPrepRawDataFormationConfig.TrigPixelClusterizationCfg
def TrigPixelClusterizationCfg(flags, RoIs, name="InDetPixelClusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:68