ATLAS Offline Software
ActsTrigSequence.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.AthConfigFlags import AthConfigFlags
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 from AthenaCommon.Logging import logging
9 
10 class ActsTrigSequence(InnerTrackerTrigSequence):
11  def __init__(self, flags : AthConfigFlags, signature : str, rois : str, inView : str):
12  super().__init__(flags, signature,rois,inView)
13  self.log = logging.getLogger("ActsTrigSequence")
14  self.log.info(f"signature: {self.signature} rois: {self.rois} inview: {self.inView}")
15 
16 
17  def viewDataVerifier(self, viewVerifier='IDViewDataVerifier') -> ComponentAccumulator:
18 
19  acc = ComponentAccumulator()
20 
21  ViewDataVerifier = CompFactory.AthViews.ViewDataVerifier(
22  name = viewVerifier + "_" + self.signature,
23  DataObjects= {('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
24  ('PixelRDO_Cache', 'PixRDOCache'),
25  ('SCT_RDO_Cache', 'SctRDOCache'),
26  #enable later when BS ready
27  #( 'IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.PixBSErrCacheKey ),
28  #( 'IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.SCTBSErrCacheKey ),
29  #( 'IDCInDetBSErrContainer_Cache' , self.flags.Trigger.ITkTracking.SCTFlaggedCondCacheKey ),
30  ( 'ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend' , 'StoreGateSvc+ActsPixelSpacePointCache_Back' ),
31  ('ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend', 'StoreGateSvc+ActsStripSpacePointCache_Back'),
32  ('ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend', 'StoreGateSvc+ActsStripOverlapSpacePointCache_Back'),
33  ( 'ActsTrk::Cache::Handles<xAOD::PixelCluster>::IDCBackend' , 'StoreGateSvc+ActsPixelClusterCache_Back' ),
34  ( 'ActsTrk::Cache::Handles<xAOD::StripCluster>::IDCBackend' , 'StoreGateSvc+ActsStripClusterCache_Back' ),
35  ('xAOD::EventInfo', 'EventInfo'),
36  ( 'ActsGeometryContext' , 'StoreGateSvc+ActsAlignment' ),
37  ('TrigRoiDescriptorCollection', str(self.rois)),
38  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )} )
39 
40  if self.flags.Input.isMC:
41  ViewDataVerifier.DataObjects |= {( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
42  ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
43  ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map'),
44  ( 'ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend' , 'StoreGateSvc+ActsPixelSpacePointCache_Back' ),
45  ('ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend', 'StoreGateSvc+ActsStripSpacePointCache_Back'),
46  ('ActsTrk::Cache::Handles<xAOD::SpacePoint>::IDCBackend', 'StoreGateSvc+ActsStripOverlapSpacePointCache_Back'),
47  ( 'ActsTrk::Cache::Handles<xAOD::PixelCluster>::IDCBackend' , 'StoreGateSvc+ActsPixelClusterCache_Back' ),
48  ( 'ActsTrk::Cache::Handles<xAOD::StripCluster>::IDCBackend' , 'StoreGateSvc+ActsStripClusterCache_Back' ),
49  ( 'ActsGeometryContext' , 'StoreGateSvc+ActsAlignment' )}
50  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
51  sgil_load = [( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
52  ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
53  ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map'),]
54  acc.merge(SGInputLoaderCfg(self.flags, Load=sgil_load))
55 
56  acc.addEventAlgo(ViewDataVerifier)
57  return acc
58 
59  def dataPreparation(self) -> ComponentAccumulator:
60  acc = ComponentAccumulator()
61 
62  self.log.info(f"DataPrep signature: {self.signature} rois: {self.rois} inview: {self.inView}")
63 
64  if not self.inView:
65  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
66  loadRDOs = [( 'PixelRDO_Container' , 'StoreGateSvc+ITkPixelRDOs' ),
67  ( 'SCT_RDO_Container' , 'StoreGateSvc+ITkStripRDOs' ),
68  ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map') ]
69  acc.merge(SGInputLoaderCfg(self.flags, Load=loadRDOs))
70 
71  #Clusterisation
72  from ActsConfig.ActsClusterizationConfig import ActsPixelClusterizationAlgCfg,ActsStripClusterizationAlgCfg,ActsPixelClusterPreparationAlgCfg,ActsStripClusterPreparationAlgCfg
73 
74  acc.merge(ActsPixelClusterizationAlgCfg(self.flags, name="ActsPixelClusterizationAlg_"+self.signature,useCache=True, RoIs=self.rois,ClustersKey="ITkPixelClusters_"+self.signature))
75  acc.merge(ActsStripClusterizationAlgCfg(self.flags, name="ActsStripClusterizationAlg_"+self.signature,useCache=True, RoIs=self.rois,ClustersKey="ITkStripClusters_"+self.signature))
76 
77  if self.flags.Acts.useCache:
78  acc.merge(ActsPixelClusterPreparationAlgCfg(self.flags, "ActsPixelClusterViewFiller_"+self.signature, True,OutputCollection="ITkPixelClusters_Cached", InputIDC="ActsPixelClustersCache", RoIs=self.rois))
79  acc.merge(ActsStripClusterPreparationAlgCfg(self.flags, "ActsStripClusterViewFiller_"+self.signature, True,OutputCollection="ITkStripClusters_Cached", InputIDC="ActsStripClustersCache", RoIs=self.rois))
80 
81  return acc
82 
83  def viewDataVerifierAfterPattern(self, viewVerifier='ActsViewDataVerifierForAmbi') -> ComponentAccumulator:
84 
85  acc = ComponentAccumulator()
86 
87  ViewDataVerifier = \
88  CompFactory.AthViews.ViewDataVerifier(
89  name = viewVerifier + "_" + self.signature,
90  DataObjects = {
91  ( 'InDetSimDataCollection' , 'ITkPixelSDO_Map'),
92  ( 'ActsGeometryContext' , 'StoreGateSvc+ActsAlignment' )
93  }
94  )
95 
96  acc.addEventAlgo(ViewDataVerifier)
97  return acc
98 
99 
100  def spacePointFormation(self) -> ComponentAccumulator:
101  acc = ComponentAccumulator()
102 
103  from ActsConfig.ActsSpacePointFormationConfig import ActsPixelSpacePointFormationAlgCfg,ActsPixelSpacePointPreparationAlgCfg
104 
105  acc.merge(ActsPixelSpacePointFormationAlgCfg(self.flags,name="PixelSPFormation_"+self.signature,useCache=self.flags.Acts.useCache, PixelClusters = "ITkPixelClusters_Cached" if self.flags.Acts.useCache else "ITkPixelClusters_"+self.signature, PixelSpacePoints = "ITkPixelSpacepoints_"+self.signature))
106 
107  if self.flags.Acts.useCache:
108  acc.merge(ActsPixelSpacePointPreparationAlgCfg(self.flags,name="PixelSPVF_"+self.signature,useCache=True, RoIs=self.rois, OutputCollection="ITkPixelSpacePoints_Cached", InputIDC="ActsPixelSpacePointCache"))
109 
110  return acc
111 
112  def fastTrackFinder(self,
113  extraFlags : AthConfigFlags = None,
114  inputTracksName : str = None) -> ComponentAccumulator:
115  acc = ComponentAccumulator()
116 
117  from ActsConfig.ActsSeedingConfig import ActsPixelSeedingAlgCfg
118 
119  acc.merge(ActsPixelSeedingAlgCfg(self.flags, name="ActsPixelSeedingAlg_"+self.signature, InputSpacePoints=['ITkPixelSpacePoints_Cached'] if self.flags.Acts.useCache else ['ITkPixelSpacepoints_'+self.signature], useFastTracking=True))
120 
121  from ActsConfig.ActsTrackFindingConfig import ActsMainTrackFindingAlgCfg, ActsTrackToTrackParticleCnvAlgCfg
122 
123  acc.merge(ActsMainTrackFindingAlgCfg(self.flags, name="ActsTrackFindingAlg_"+self.signature, ACTSTracksLocation=self.flags.Tracking.ActiveConfig.trkTracks_FTF,SeedLabels=["PPP"],SeedContainerKeys=["ActsPixelSeeds"],UncalibratedMeasurementContainerKeys=["ITkPixelClusters_Cached" if self.flags.Acts.useCache else "ITkPixelClusters_"+self.signature ,"ITkStripClusters_Cached" if self.flags.Acts.useCache else "ITkStripClusters_"+self.signature],EstimatedTrackParametersKeys=["ActsPixelEstimatedTrackParams"]))
124  acc.merge(ActsTrackToTrackParticleCnvAlgCfg(self.flags,name="ActsTrackParticleCreator_"+self.signature, ACTSTracksLocation=[self.flags.Tracking.ActiveConfig.trkTracks_FTF], TrackParticlesOutKey=self.flags.Tracking.ActiveConfig.tracks_FTF))
125 
126  return acc
127 
128  def ambiguitySolver(self) -> ComponentAccumulator:
129  acc = ComponentAccumulator()
130 
131  if self.inView:
132  acc.merge(self.viewDataVerifierAfterPattern())
133 
134  from ActsConfig.ActsTrackFindingConfig import ActsMainAmbiguityResolutionAlgCfg
135 
136  acc.merge(ActsMainAmbiguityResolutionAlgCfg(self.flags, "ActsAmbiguityResolutionAlg_"+self.signature, TracksLocation=self.flags.Tracking.ActiveConfig.trkTracks_FTF, ResolvedTracksLocation=self.flags.Tracking.ActiveConfig.trkTracks_IDTrig))
137 
138 
139  return acc
140 
141  def xAODParticleCreation(self) -> ComponentAccumulator:
142 
143  acc = ComponentAccumulator()
144  from ActsConfig.ActsTrackFindingConfig import ActsTrackToTrackParticleCnvAlgCfg
145  acc.merge(ActsTrackToTrackParticleCnvAlgCfg(self.flags,"ActsTrackParticleCreator_Ambi_"+self.signature, ACTSTracksLocation=[self.flags.Tracking.ActiveConfig.trkTracks_IDTrig], TrackParticlesOutKey=self.flags.Tracking.ActiveConfig.tracks_IDTrig))
146 
147  return acc
grepfile.info
info
Definition: grepfile.py:38
ActsClusterizationConfig.ActsPixelClusterizationAlgCfg
ComponentAccumulator ActsPixelClusterizationAlgCfg(flags, str name='ActsPixelClusterizationAlg', *bool useCache=False, **kwargs)
Definition: ActsClusterizationConfig.py:106
python.ActsTrigSequence.ActsTrigSequence.spacePointFormation
ComponentAccumulator spacePointFormation(self)
Definition: ActsTrigSequence.py:100
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ActsSeedingConfig.ActsPixelSeedingAlgCfg
ComponentAccumulator ActsPixelSeedingAlgCfg(flags, str name='ActsPixelSeedingAlg', **kwargs)
Definition: ActsSeedingConfig.py:254
python.ActsTrigSequence.ActsTrigSequence.fastTrackFinder
ComponentAccumulator fastTrackFinder(self, AthConfigFlags extraFlags=None, str inputTracksName=None)
Definition: ActsTrigSequence.py:112
python.ActsTrigSequence.ActsTrigSequence.ambiguitySolver
ComponentAccumulator ambiguitySolver(self)
Definition: ActsTrigSequence.py:128
python.ActsTrigSequence.ActsTrigSequence.log
log
Definition: ActsTrigSequence.py:13
ActsClusterizationConfig.ActsStripClusterizationAlgCfg
ComponentAccumulator ActsStripClusterizationAlgCfg(flags, str name='ActsStripClusterizationAlg', bool useCache=False, **kwargs)
Definition: ActsClusterizationConfig.py:140
ActsSpacePointFormationConfig.ActsPixelSpacePointPreparationAlgCfg
ComponentAccumulator ActsPixelSpacePointPreparationAlgCfg(flags, str name="ActsPixelSpacePointPreparationAlg", *bool useCache=False, **dict kwargs)
Definition: ActsSpacePointFormationConfig.py:58
python.ActsTrigSequence.ActsTrigSequence.dataPreparation
ComponentAccumulator dataPreparation(self)
Definition: ActsTrigSequence.py:59
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
python.ActsTrigSequence.ActsTrigSequence.viewDataVerifier
ComponentAccumulator viewDataVerifier(self, viewVerifier='IDViewDataVerifier')
Definition: ActsTrigSequence.py:17
python.ActsTrigSequence.ActsTrigSequence.xAODParticleCreation
ComponentAccumulator xAODParticleCreation(self)
Definition: ActsTrigSequence.py:141
ActsClusterizationConfig.ActsStripClusterPreparationAlgCfg
ComponentAccumulator ActsStripClusterPreparationAlgCfg(flags, str name="ActsStripClusterPreparationAlg", bool useCache=False, **kwargs)
Definition: ActsClusterizationConfig.py:206
ActsSpacePointFormationConfig.ActsPixelSpacePointFormationAlgCfg
ComponentAccumulator ActsPixelSpacePointFormationAlgCfg(flags, str name="ActsPixelSpacePointFormationAlg", *bool useCache=False, **dict kwargs)
Definition: ActsSpacePointFormationConfig.py:116
ActsTrackFindingConfig.ActsMainAmbiguityResolutionAlgCfg
ComponentAccumulator ActsMainAmbiguityResolutionAlgCfg(flags, str name="ActsAmbiguityResolutionAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:274
python.ActsTrigSequence.ActsTrigSequence.__init__
def __init__(self, AthConfigFlags flags, str signature, str rois, str inView)
Definition: ActsTrigSequence.py:11
python.ActsTrigSequence.ActsTrigSequence
Definition: ActsTrigSequence.py:10
ActsTrackFindingConfig.ActsMainTrackFindingAlgCfg
ComponentAccumulator ActsMainTrackFindingAlgCfg(flags, str name="ActsTrackFindingAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:53
ActsClusterizationConfig.ActsPixelClusterPreparationAlgCfg
ComponentAccumulator ActsPixelClusterPreparationAlgCfg(flags, str name="ActsPixelClusterPreparationAlg", bool useCache=False, **kwargs)
Definition: ActsClusterizationConfig.py:182
str
Definition: BTagTrackIpAccessor.cxx:11
python.ActsTrigSequence.ActsTrigSequence.viewDataVerifierAfterPattern
ComponentAccumulator viewDataVerifierAfterPattern(self, viewVerifier='ActsViewDataVerifierForAmbi')
Definition: ActsTrigSequence.py:83
ActsTrackFindingConfig.ActsTrackToTrackParticleCnvAlgCfg
ComponentAccumulator ActsTrackToTrackParticleCnvAlgCfg(flags, str name="ActsTrackToTrackParticleCnvAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:322