ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTruthConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from ActsInterop import UnitConstants
6from ActsConfig.ActsUtilities import extractChildKwargs
7
9 *,
10 collectionName: str) -> ComponentAccumulator:
11 acc = ComponentAccumulator()
12
13 AddressRemappingSvc = CompFactory.AddressRemappingSvc(
14 TypeKeyOverwriteMaps = [f"InDetSimDataCollection#{collectionName}->InDetSimDataCollectionWrap#{collectionName}"]
15 )
16 acc.addService(AddressRemappingSvc)
17 return acc
18
19
21 name: str = 'ActsPixelClusterToTruthAssociationAlg',
22 **kwargs: dict) -> ComponentAccumulator:
23 acc = ComponentAccumulator()
24 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkPixelSDO_Map') )
25
26 kwargs.setdefault('InputTruthParticleLinks', 'xAODTruthLinks')
27 kwargs.setdefault('SimData', 'ITkPixelSDO_Map')
28 kwargs.setdefault('DepositedEnergyMin', 300) # @TODO revise ? From PRD_MultiTruthBuilder.h; should be 1/10 of threshold
29 kwargs.setdefault('Measurements', 'ITkPixelClusters')
30 kwargs.setdefault('AssociationMapOut', 'ITkPixelClustersToTruthParticles')
31
32 acc.addEventAlgo( CompFactory.ActsTrk.PixelClusterToTruthAssociationAlg(name=name, **kwargs) )
33 return acc
34
36 name: str = 'ActsStripClusterToTruthAssociationAlg',
37 **kwargs: dict) -> ComponentAccumulator:
38 acc = ComponentAccumulator()
39 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
40
41 kwargs.setdefault('InputTruthParticleLinks', 'xAODTruthLinks')
42 kwargs.setdefault('SimData', 'ITkStripSDO_Map')
43 kwargs.setdefault('DepositedEnergyMin', 600) # @TODO revise ? From PRD_MultiTruthBuilder.h; should be 1/10 of threshold
44 kwargs.setdefault('Measurements', 'ITkStripClusters')
45 kwargs.setdefault('AssociationMapOut', 'ITkStripClustersToTruthParticles')
46
47 acc.addEventAlgo( CompFactory.ActsTrk.StripClusterToTruthAssociationAlg(name=name, **kwargs) )
48 return acc
49
51 name: str = 'ActsHgtdClusterToTruthAssociationAlg',
52 **kwargs: dict) -> ComponentAccumulator:
53 acc = ComponentAccumulator()
54 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='HGTD_SDO_Map') )
55
56 kwargs.setdefault('InputTruthParticleLinks', 'xAODTruthLinks')
57 kwargs.setdefault('SimData', 'HGTD_SDO_Map')
58 kwargs.setdefault('DepositedEnergyMin', 600) # @TODO revise ? From PRD_MultiTruthBuilder.h; should be 1/10 of threshold
59 kwargs.setdefault('Measurements', 'HGTD_Clusters')
60 kwargs.setdefault('AssociationMapOut', 'HgtdClustersToTruthParticles')
61
62 acc.addEventAlgo( CompFactory.ActsTrk.HgtdClusterToTruthAssociationAlg(name=name, **kwargs) )
63 return acc
64
66 name: str = 'ActsInDetPixelClusterToTruthAssociationAlg',
67 **kwargs: dict) -> ComponentAccumulator:
68 # Inner Detector configurations
69 acc = ComponentAccumulator()
70 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='PixelSDO_Map') )
71
72 kwargs.setdefault('InputTruthParticleLinks', 'xAODTruthLinks')
73 kwargs.setdefault('SimData', 'PixelSDO_Map')
74 kwargs.setdefault('DepositedEnergyMin', 300) # @TODO revise ? From PRD_MultiTruthBuilder.h; should be 1/10 of threshold
75 kwargs.setdefault('Measurements', 'PixelClusters')
76 kwargs.setdefault('AssociationMapOut', 'PixelClustersToTruthParticles')
77
78 acc.addEventAlgo( CompFactory.ActsTrk.PixelClusterToTruthAssociationAlg(name=name, **kwargs) )
79 return acc
80
82 name: str = 'ActsInDetStripClusterToTruthAssociationAlg',
83 **kwargs: dict) -> ComponentAccumulator:
84 # Inner Detector configurations
85 acc = ComponentAccumulator()
86 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='SCT_SDO_Map') )
87
88 kwargs.setdefault('InputTruthParticleLinks', 'xAODTruthLinks')
89 kwargs.setdefault('SimData', 'SCT_SDO_Map')
90 kwargs.setdefault('DepositedEnergyMin', 600) # @TODO revise ? From PRD_MultiTruthBuilder.h; should be 1/10 of threshold
91 kwargs.setdefault('Measurements', 'SCT_Clusters')
92 kwargs.setdefault('AssociationMapOut', 'SCT_ClustersToTruthParticles')
93
94 acc.addEventAlgo( CompFactory.ActsTrk.StripClusterToTruthAssociationAlg(name=name, **kwargs) )
95 return acc
96
98 name: str = 'ActsTracksToTruthAssociationAlg',
99 **kwargs: dict) -> ComponentAccumulator:
100 acc = ComponentAccumulator()
101 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
102
103 kwargs.setdefault('ACTSTracksLocation','ActsTracks')
104 kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
105 kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
106 if flags.Detector.EnableHGTD and flags.Acts.useHGTDClusterInTrackFinding:
107 kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
108 kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
109 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
110
111 if 'TrackingGeometryTool' not in kwargs:
112 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
113 kwargs.setdefault("TrackingGeometryTool", acc.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
114
115 acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
116 return acc
117
119 name: str = 'ActsInDetTracksToTruthAssociationAlg',
120 **kwargs: dict) -> ComponentAccumulator:
121 # Inner Detector configurations
122 acc = ComponentAccumulator()
123 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='SCT_SDO_Map') )
124
125 kwargs.setdefault('ACTSTracksLocation','ActsTracks')
126 kwargs.setdefault('PixelClustersToTruthAssociationMap','PixelClustersToTruthParticles')
127 kwargs.setdefault('StripClustersToTruthAssociationMap','SCT_ClustersToTruthParticles')
128 kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
129 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
130
131 if 'TrackingGeometryTool' not in kwargs:
132 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
133 kwargs.setdefault("TrackingGeometryTool", acc.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
134
135 acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
136 return acc
137
139 name: str = 'ActsTruthParticleHitCountAlg',
140 **kwargs: dict) -> ComponentAccumulator:
141 acc = ComponentAccumulator()
142 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
143
144 kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
145 kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
146 if flags.Detector.EnableHGTD and flags.Acts.useHGTDClusterInTrackFinding:
147 kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
148 kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
149 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
150 kwargs.setdefault('NHitsMin',4)
151
152 if 'TrackingGeometryTool' not in kwargs:
153 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
154 kwargs.setdefault("TrackingGeometryTool", acc.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
155
156 acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
157 return acc
158
160 name: str = 'ActsInDetTruthParticleHitCountAlg',
161 **kwargs: dict) -> ComponentAccumulator:
162 # Inner Detector configurations
163 acc = ComponentAccumulator()
164 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='SCT_SDO_Map') )
165
166 kwargs.setdefault('PixelClustersToTruthAssociationMap','PixelClustersToTruthParticles')
167 kwargs.setdefault('StripClustersToTruthAssociationMap','SCT_ClustersToTruthParticles')
168 kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
169 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
170 kwargs.setdefault('NHitsMin',4)
171
172 if 'TrackingGeometryTool' not in kwargs:
173 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
174 kwargs.setdefault("TrackingGeometryTool", acc.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
175
176 acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
177 return acc
178
180 **kwargs: dict) -> ComponentAccumulator:
181 acc = ComponentAccumulator()
182
183 if flags.Detector.EnablePixel:
184 acc.merge(ActsInDetPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
185
186 if flags.Detector.EnableSCT:
187 acc.merge(ActsInDetStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
188
189 if flags.Detector.EnableITkPixel:
190 acc.merge(ActsPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
191
192 if flags.Detector.EnableITkStrip:
193 acc.merge(ActsStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
194
195 if flags.Detector.EnableHGTD and flags.Acts.useHGTDClusterInTrackFinding:
196 acc.merge(ActsHgtdClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="HgtdClusterToTruthAssociationAlg.", **kwargs) ))
197 return acc
198
200 kwargs.setdefault('MatchWeights',[0., # other
201 10., 5., # ID (pixel, strips)
202 0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
203 0. ]) # HGTD
204 # weights used for hit purity and hit efficiencies
205 kwargs.setdefault('CountWeights',[0., # other
206 1.,1., # ID (pixel, strips)
207 0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
208 0. ]) # HGTD
209 kwargs.setdefault('StatisticPtBins',[1e3,2.5e3,5e3,10e3,100e3])
210 kwargs.setdefault('ShowDetailedTables',False)
211 kwargs.setdefault('PdgIdCategorisation',False)
212 kwargs.setdefault('StatisticEtaBins',[eta/10. for eta in range(5, 40, 5)])
213
215 name: str = 'ActsTrackParticleTruthDecorationAlg',
216 **kwargs: dict) -> ComponentAccumulator:
217 acc = ComponentAccumulator()
218 kwargs.setdefault('TrackToTruthAssociationMaps','ActsCombinedTracksToTruthParticleAssociation')
219 kwargs.setdefault('TrackParticleContainerName','ActsCombinedTracksParticlesAlt')
220 kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
221 # weights used for computing the matching probability and identifying the best match
223 kwargs.setdefault('ComputeTrackRecoEfficiency',False)
224
225 if 'TruthSelectionTool' not in kwargs:
226 # should be as tight or looser as the TruthSelectionTool when analysing the truth matches
227 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
228 kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
229 InDetRttTruthSelectionToolCfg(flags,
230 name='RelaxedInDetRttTruthSelectionTool',
231 requireOnlyPrimary=False,
232 minPt=500.,
233 maxEta=4.5
234 )))
235
236 acc.addEventAlgo( CompFactory.ActsTrk.TrackParticleTruthDecorationAlg(name=name, **kwargs) )
237 return acc
238
240 name: str = 'ActsTracksValidationAlg',
241 **kwargs: dict) -> ComponentAccumulator:
242 acc = ComponentAccumulator()
243 kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
244 kwargs.setdefault('TrackToTruthAssociationMap','ActsTracksToTruthParticles')
246 kwargs.setdefault('ComputeTrackRecoEfficiency',True)
247
248 if 'TruthSelectionTool' not in kwargs:
249 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
250 kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
251 InDetRttTruthSelectionToolCfg(flags)))
252
253 acc.addEventAlgo( CompFactory.ActsTrk.TrackFindingValidationAlg(name=name, **kwargs) )
254 return acc
ComponentAccumulator ActsInDetTrackToTruthAssociationAlgCfg(flags, str name='ActsInDetTracksToTruthAssociationAlg', **dict kwargs)
ComponentAccumulator MapToInDetSimDataWrapSvcCfg(flags, *, str collectionName)
ComponentAccumulator ActsInDetStripClusterToTruthAssociationAlgCfg(flags, str name='ActsInDetStripClusterToTruthAssociationAlg', **dict kwargs)
ComponentAccumulator ActsTrackParticleTruthDecorationAlgCfg(flags, str name='ActsTrackParticleTruthDecorationAlg', **dict kwargs)
ComponentAccumulator ActsTruthParticleHitCountAlgCfg(flags, str name='ActsTruthParticleHitCountAlg', **dict kwargs)
ComponentAccumulator ActsTrackFindingValidationAlgCfg(flags, str name='ActsTracksValidationAlg', **dict kwargs)
ComponentAccumulator ActsTruthAssociationAlgCfg(flags, **dict kwargs)
ComponentAccumulator ActsHgtdClusterToTruthAssociationAlgCfg(flags, str name='ActsHgtdClusterToTruthAssociationAlg', **dict kwargs)
setDefaultTruthMatchingArgs(kwargs)
ComponentAccumulator ActsPixelClusterToTruthAssociationAlgCfg(flags, str name='ActsPixelClusterToTruthAssociationAlg', **dict kwargs)
ComponentAccumulator ActsStripClusterToTruthAssociationAlgCfg(flags, str name='ActsStripClusterToTruthAssociationAlg', **dict kwargs)
ComponentAccumulator ActsTrackToTruthAssociationAlgCfg(flags, str name='ActsTracksToTruthAssociationAlg', **dict kwargs)
ComponentAccumulator ActsInDetTruthParticleHitCountAlgCfg(flags, str name='ActsInDetTruthParticleHitCountAlg', **dict kwargs)
ComponentAccumulator ActsInDetPixelClusterToTruthAssociationAlgCfg(flags, str name='ActsInDetPixelClusterToTruthAssociationAlg', **dict kwargs)