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  if flags.Detector.EnableHGTD and (flags.Acts.useHGTDClusterInTrackFinding or flags.HGTD.doActs):
75  kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
76  kwargs.setdefault('AssociationMapOut','ActsTracksToTruthParticles')
77  kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV)
78 
79  if 'TrackingGeometryTool' not in kwargs:
80  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
81  kwargs.setdefault("TrackingGeometryTool", acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
82 
83  acc.addEventAlgo( CompFactory.ActsTrk.TrackToTruthAssociationAlg(name=name, **kwargs) )
84  return acc
85 
87  name: str = 'ActsTruthParticleHitCountAlg',
88  **kwargs: dict) -> ComponentAccumulator:
89  acc = ComponentAccumulator()
90  acc.merge( MapToInDetSimDataWrapSvcCfg(flags, collectionName='ITkStripSDO_Map') )
91 
92  kwargs.setdefault('PixelClustersToTruthAssociationMap','ITkPixelClustersToTruthParticles')
93  kwargs.setdefault('StripClustersToTruthAssociationMap','ITkStripClustersToTruthParticles')
94  if flags.Detector.EnableHGTD and (flags.Acts.useHGTDClusterInTrackFinding or flags.HGTD.doActs):
95  kwargs.setdefault('HgtdClustersToTruthAssociationMap','HgtdClustersToTruthParticles')
96  kwargs.setdefault('TruthParticleHitCountsOut','TruthParticleHitCounts')
97  kwargs.setdefault('MaxEnergyLoss',1e3*UnitConstants.TeV) # @TODO introduce flag and synchronise with TrackToTruthAssociationAlg
98  kwargs.setdefault('NHitsMin',4)
99 
100  if 'TrackingGeometryTool' not in kwargs:
101  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
102  kwargs.setdefault("TrackingGeometryTool", acc.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags)))
103 
104  acc.addEventAlgo( CompFactory.ActsTrk.TruthParticleHitCountAlg(name=name, **kwargs) )
105  return acc
106 
107 
109  **kwargs: dict) -> ComponentAccumulator:
110  acc = ComponentAccumulator()
111 
112  if flags.Detector.EnableITkPixel:
113  acc.merge(ActsPixelClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="PixelClusterToTruthAssociationAlg.", **kwargs) ))
114 
115  if flags.Detector.EnableITkStrip:
116  acc.merge(ActsStripClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="StripClusterToTruthAssociationAlg.", **kwargs) ))
117 
118  if flags.Detector.EnableHGTD and (flags.Acts.useHGTDClusterInTrackFinding or flags.HGTD.doActs):
119  acc.merge(ActsHgtdClusterToTruthAssociationAlgCfg(flags, **extractChildKwargs(prefix="HgtdClusterToTruthAssociationAlg.", **kwargs) ))
120  return acc
121 
123  kwargs.setdefault('MatchWeights',[0., # other
124  10., 5., # ID (pixel, strips)
125  0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
126  0. ]) # HGTD
127  # weights used for hit purity and hit efficiencies
128  kwargs.setdefault('CountWeights',[0., # other
129  1.,1., # ID (pixel, strips)
130  0., 0., 0. , 0., 0., # MS (MdtDriftCircle, RpcStrip, TgcStrip, MMCluster, sTgcStrip)
131  0. ]) # HGTD
132  kwargs.setdefault('StatisticPtBins',[1e3,2.5e3,5e3,10e3,100e3])
133  kwargs.setdefault('ShowDetailedTables',False)
134  kwargs.setdefault('PdgIdCategorisation',False)
135  kwargs.setdefault('StatisticEtaBins',[eta/10. for eta in range(5, 40, 5)])
136 
138  name: str = 'ActsTrackParticleTruthDecorationAlg',
139  **kwargs: dict) -> ComponentAccumulator:
140  acc = ComponentAccumulator()
141  kwargs.setdefault('TrackToTruthAssociationMaps','ActsCombinedTracksToTruthParticleAssociation')
142  kwargs.setdefault('TrackParticleContainerName','ActsCombinedTracksParticlesAlt')
143  kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
144  # weights used for computing the matching probability and identifying the best match
146  kwargs.setdefault('ComputeTrackRecoEfficiency',False)
147 
148  if 'TruthSelectionTool' not in kwargs:
149  # should be as tight or looser as the TruthSelectionTool when analysing the truth matches
150  from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
151  kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
153  name='RelaxedInDetRttTruthSelectionTool',
154  requireOnlyPrimary=False,
155  minPt=500.,
156  maxEta=4.5
157  )))
158 
159  acc.addEventAlgo( CompFactory.ActsTrk.TrackParticleTruthDecorationAlg(name=name, **kwargs) )
160  return acc
161 
163  name: str = 'ActsTracksValidationAlg',
164  **kwargs: dict) -> ComponentAccumulator:
165  acc = ComponentAccumulator()
166  kwargs.setdefault('TruthParticleHitCounts','TruthParticleHitCounts')
167  kwargs.setdefault('TrackToTruthAssociationMap','ActsTracksToTruthParticles')
169  kwargs.setdefault('ComputeTrackRecoEfficiency',True)
170 
171  if 'TruthSelectionTool' not in kwargs:
172  from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetRttTruthSelectionToolCfg
173  kwargs.setdefault("TruthSelectionTool", acc.popToolsAndMerge(
175 
176  acc.addEventAlgo( CompFactory.ActsTrk.TrackFindingValidationAlg(name=name, **kwargs) )
177  return acc
ActsTruthConfig.setDefaultTruthMatchingArgs
def setDefaultTruthMatchingArgs(kwargs)
Definition: ActsTruthConfig.py:122
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:86
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:162
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:122
ActsTruthConfig.ActsTruthAssociationAlgCfg
ComponentAccumulator ActsTruthAssociationAlgCfg(flags, **dict kwargs)
Definition: ActsTruthConfig.py:108
ActsTruthConfig.ActsTrackParticleTruthDecorationAlgCfg
ComponentAccumulator ActsTrackParticleTruthDecorationAlgCfg(flags, str name='ActsTrackParticleTruthDecorationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:137
ActsTruthConfig.ActsStripClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsStripClusterToTruthAssociationAlgCfg(flags, str name='ActsStripClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:35