ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTruthConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 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 or (flags.HGTD.doActs and flags.Tracking.doTruth)):
107 kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
108 kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
109 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
110
111 acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
112 return acc
113
115 name: str = 'ActsInDetTracksToTruthAssociationAlg',
116 **kwargs: dict) -> ComponentAccumulator:
117 # Inner Detector configurations
118 acc = ComponentAccumulator()
119 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='SCT_SDO_Map') )
120
121 kwargs.setdefault('ACTSTracksLocation','ActsTracks')
122 kwargs.setdefault('PixelClustersToTruthAssociationMap','PixelClustersToTruthParticles')
123 kwargs.setdefault('StripClustersToTruthAssociationMap','SCT_ClustersToTruthParticles')
124 kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
125 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
126
127 acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
128 return acc
129
131 name: str = 'ActsTruthParticleHitCountAlg',
132 **kwargs: dict) -> ComponentAccumulator:
133 acc = ComponentAccumulator()
134 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
135
136 kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
137 kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
138 if flags.Detector.EnableHGTD and flags.Acts.useHGTDClusterInTrackFinding:
139 kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
140 kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
141 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
142 kwargs.setdefault('NHitsMin',4)
143
144
145 acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
146 return acc
147
149 name: str = 'ActsInDetTruthParticleHitCountAlg',
150 **kwargs: dict) -> ComponentAccumulator:
151 # Inner Detector configurations
152 acc = ComponentAccumulator()
153 acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='SCT_SDO_Map') )
154
155 kwargs.setdefault('PixelClustersToTruthAssociationMap','PixelClustersToTruthParticles')
156 kwargs.setdefault('StripClustersToTruthAssociationMap','SCT_ClustersToTruthParticles')
157 kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
158 kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
159 kwargs.setdefault('NHitsMin',4)
160
161 acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
162 return acc
163
165 **kwargs: dict) -> ComponentAccumulator:
166 acc = ComponentAccumulator()
167
168 if flags.Detector.EnablePixel:
169 acc.merge(ActsInDetPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
170
171 if flags.Detector.EnableSCT:
172 acc.merge(ActsInDetStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
173
174 if flags.Detector.EnableITkPixel:
175 acc.merge(ActsPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
176
177 if flags.Detector.EnableITkStrip:
178 acc.merge(ActsStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
179
180 if flags.Detector.EnableHGTD and flags.Acts.useHGTDClusterInTrackFinding:
181 acc.merge(ActsHgtdClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="HgtdClusterToTruthAssociationAlg.", **kwargs) ))
182 return acc
183
185 kwargs.setdefault('MatchWeights',[0., # other
186 10., 5., # ID (pixel, strips)
187 0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
188 0. ]) # HGTD
189 # weights used for hit purity and hit efficiencies
190 kwargs.setdefault('CountWeights',[0., # other
191 1.,1., # ID (pixel, strips)
192 0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
193 0. ]) # HGTD
194 kwargs.setdefault('StatisticPtBins',[1e3,2.5e3,5e3,10e3,100e3])
195 kwargs.setdefault('ShowDetailedTables',False)
196 kwargs.setdefault('PdgIdCategorisation',False)
197 kwargs.setdefault('StatisticEtaBins',[eta/10. for eta in range(5, 40, 5)])
198
200 name: str = 'ActsTrackParticleTruthDecorationAlg',
201 **kwargs: dict) -> ComponentAccumulator:
202 acc = ComponentAccumulator()
203 kwargs.setdefault('TrackToTruthAssociationMaps','ActsCombinedTracksToTruthParticleAssociation')
204 kwargs.setdefault('TrackParticleContainerName','ActsCombinedTracksParticlesAlt')
205 kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
206 # weights used for computing the matching probability and identifying the best match
208 kwargs.setdefault('ComputeTrackRecoEfficiency',False)
209
210 if 'TruthSelectionTool' not in kwargs:
211 # should be as tight or looser as the TruthSelectionTool when analysing the truth matches
212 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
213 kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
214 InDetRttTruthSelectionToolCfg(flags,
215 name='RelaxedInDetRttTruthSelectionTool',
216 requireOnlyPrimary=False,
217 minPt=500.,
218 maxEta=4.5
219 )))
220
221 if 'MCTruthClassifier' not in kwargs:
222 from MCTruthClassifier.MCTruthClassifierConfig import MCTruthClassifierCfg
223 kwargs.setdefault("MCTruthClassifier", acc.popToolsAndMerge(
224 MCTruthClassifierCfg(flags)))
225
226 acc.addEventAlgo( CompFactory.ActsTrk.TrackParticleTruthDecorationAlg(name=name, **kwargs) )
227 return acc
228
230 name: str = 'ActsTracksValidationAlg',
231 **kwargs: dict) -> ComponentAccumulator:
232 acc = ComponentAccumulator()
233 kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
234 kwargs.setdefault('TrackToTruthAssociationMap','ActsTracksToTruthParticles')
236 kwargs.setdefault('ComputeTrackRecoEfficiency',True)
237
238 if 'TruthSelectionTool' not in kwargs:
239 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
240 kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
241 InDetRttTruthSelectionToolCfg(flags)))
242
243 acc.addEventAlgo( CompFactory.ActsTrk.TrackFindingValidationAlg(name=name, **kwargs) )
244 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)