Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ActsTruthConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from ActsInterop import UnitConstants
6 from 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 = 'ActsTracksToTruthAssociationAlg',
67  **kwargs: dict) -> ComponentAccumulator:
68  acc = ComponentAccumulator()
69  acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
70 
71  kwargs.setdefault('ACTSTracksLocation','ActsTracks')
72  kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
73  kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
74  kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
75  kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
76  kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
77 
78  if 'TrackingGeometryTool' not in kwargs:
79  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
80  kwargs.setdefault("TrackingGeometryTool", acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
81 
82  acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
83  return acc
84 
86  name: str = 'ActsTruthParticleHitCountAlg',
87  **kwargs: dict) -> ComponentAccumulator:
88  acc = ComponentAccumulator()
89  acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
90 
91  kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
92  kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
93  if flags.Detector.EnableHGTD and (flags.Acts.useHGTDClusterInTrackFinding or flags.HGTD.doActs):
94  kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
95  kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
96  kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
97  kwargs.setdefault('NHitsMin',4)
98 
99  if 'TrackingGeometryTool' not in kwargs:
100  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
101  kwargs.setdefault("TrackingGeometryTool", acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
102 
103  acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
104  return acc
105 
106 
108  **kwargs: dict) -> ComponentAccumulator:
109  acc = ComponentAccumulator()
110 
111  if flags.Detector.EnableITkPixel:
112  acc.merge(ActsPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
113 
114  if flags.Detector.EnableITkStrip:
115  acc.merge(ActsStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
116 
117  if flags.Detector.EnableHGTD and (flags.Acts.useHGTDClusterInTrackFinding or flags.HGTD.doActs):
118  acc.merge(ActsHgtdClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="HgtdClusterToTruthAssociationAlg.", **kwargs) ))
119  return acc
120 
122  kwargs.setdefault('MatchWeights',[0., # other
123  10., 5., # ID (pixel, strips)
124  0., 0., 0. , 0., # MS
125  0. ]) # HGTD
126  # weights used for hit purity and hit efficiencies
127  kwargs.setdefault('CountWeights',[0., # other
128  1.,1., # ID (pixel, strips)
129  0., 0., 0. , 0., # MS
130  0. ]) # HGTD
131  kwargs.setdefault('StatisticPtBins',[1e3,2.5e3,5e3,10e3,100e3])
132  kwargs.setdefault('ShowDetailedTables',False)
133  kwargs.setdefault('PdgIdCategorisation',False)
134  kwargs.setdefault('StatisticEtaBins',[eta/10. for eta in range(5, 40, 5)])
135 
137  name: str = 'ActsTrackParticleTruthDecorationAlg',
138  **kwargs: dict) -> ComponentAccumulator:
139  acc = ComponentAccumulator()
140  kwargs.setdefault('TrackToTruthAssociationMaps','ActsCombinedTracksToTruthParticleAssociation')
141  kwargs.setdefault('TrackParticleContainerName','ActsCombinedTracksParticlesAlt')
142  kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
143  # weights used for computing the matching probability and identifying the best match
145  kwargs.setdefault('ComputeTrackRecoEfficiency',False)
146 
147  if 'TruthSelectionTool' not in kwargs:
148  # should be as tight or looser as the TruthSelectionTool when analysing the truth matches
149  from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
150  kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
152  name='RelaxedInDetRttTruthSelectionTool',
153  requireOnlyPrimary=False,
154  minPt=500.,
155  maxEta=4.5
156  )))
157 
158  acc.addEventAlgo( CompFactory.ActsTrk.TrackParticleTruthDecorationAlg(name=name, **kwargs) )
159  return acc
160 
162  name: str = 'ActsTracksValidationAlg',
163  **kwargs: dict) -> ComponentAccumulator:
164  acc = ComponentAccumulator()
165  kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
166  kwargs.setdefault('TrackToTruthAssociationMap','ActsTracksToTruthParticles')
168  kwargs.setdefault('ComputeTrackRecoEfficiency',True)
169 
170  if 'TruthSelectionTool' not in kwargs:
171  from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
172  kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
174 
175  acc.addEventAlgo( CompFactory.ActsTrk.TrackFindingValidationAlg(name=name, **kwargs) )
176  return acc
ActsTruthConfig.setDefaultTruthMatchingArgs
def setDefaultTruthMatchingArgs(kwargs)
Definition: ActsTruthConfig.py:121
ActsTruthConfig.ActsHgtdClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsHgtdClusterToTruthAssociationAlgCfg(flags, str name='ActsHgtdClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:50
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ActsUtilities.extractChildKwargs
dict extractChildKwargs(*str prefix, **dict kwargs)
Definition: ActsUtilities.py:3
ActsTruthConfig.MapToInDetSimDataWrapSvcCfg
ComponentAccumulator MapToInDetSimDataWrapSvcCfg(flags, *str collectionName)
Definition: ActsTruthConfig.py:8
ActsTruthConfig.ActsTruthParticleHitCountAlgCfg
ComponentAccumulator ActsTruthParticleHitCountAlgCfg(flags, str name='ActsTruthParticleHitCountAlg', **dict kwargs)
Definition: ActsTruthConfig.py:85
ActsTruthConfig.ActsTrackToTruthAssociationAlgCfg
ComponentAccumulator ActsTrackToTruthAssociationAlgCfg(flags, str name='ActsTracksToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:65
ActsTruthConfig.ActsPixelClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsPixelClusterToTruthAssociationAlgCfg(flags, str name='ActsPixelClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:20
ActsTruthConfig.ActsTrackFindingValidationAlgCfg
ComponentAccumulator ActsTrackFindingValidationAlgCfg(flags, str name='ActsTracksValidationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:161
InDetPhysValMonitoringConfig.InDetRttTruthSelectionToolCfg
def InDetRttTruthSelectionToolCfg(flags, name="InDetRttTruthSelectionTool", **kwargs)
Definition: InDetPhysValMonitoringConfig.py:38
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ActsGeometryConfig.ActsTrackingGeometryToolCfg
ComponentAccumulator ActsTrackingGeometryToolCfg(flags, str name="ActsTrackingGeometryTool")
Definition: ActsGeometryConfig.py:116
ActsTruthConfig.ActsTruthAssociationAlgCfg
ComponentAccumulator ActsTruthAssociationAlgCfg(flags, **dict kwargs)
Definition: ActsTruthConfig.py:107
ActsTruthConfig.ActsTrackParticleTruthDecorationAlgCfg
ComponentAccumulator ActsTrackParticleTruthDecorationAlgCfg(flags, str name='ActsTrackParticleTruthDecorationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:136
ActsTruthConfig.ActsStripClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsStripClusterToTruthAssociationAlgCfg(flags, str name='ActsStripClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:35