5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
11 check whether the decorator can be added.
13 A decorator can be added if a track particle converter alg is in the sequence or
14 if ESDs or AODs are read.
17 if not (flags.Detector.GeometryID
or flags.Detector.GeometryITk):
20 return (flags.PhysVal.IDPVM.runDecoration
and
21 (
"StreamESD" in flags.Input.ProcessingTags
or
22 "StreamAOD" in flags.Input.ProcessingTags
or
23 (len(flags.Input.ProcessingTags) > 0
and
26 "StreamDAOD" in flags.Input.ProcessingTags[0])))
30 flags, name="InDetPhysHitDecoratorAlg", **kwargs):
31 if flags.Detector.GeometryITk:
35 create decoration algorithm which decorates track particles with the unbiased hit residuals and pulls.
39 if 'InDetTrackHoleSearchTool' not in kwargs:
40 from InDetConfig.InDetTrackHoleSearchConfig
import (
41 InDetTrackHoleSearchToolCfg)
42 kwargs.setdefault(
"InDetTrackHoleSearchTool", acc.popToolsAndMerge(
45 if 'Updator' not in kwargs:
46 from TrkConfig.TrkMeasurementUpdatorConfig
import InDetUpdatorCfg
47 kwargs.setdefault(
"Updator", acc.popToolsAndMerge(
InDetUpdatorCfg(flags)))
49 if 'LorentzAngleTool' not in kwargs:
50 from SiLorentzAngleTool.PixelLorentzAngleConfig
import (
51 PixelLorentzAngleToolCfg)
52 kwargs.setdefault(
"LorentzAngleTool", acc.popToolsAndMerge(
55 if 'ResidualPullCalculator' not in kwargs:
56 from TrkConfig.TrkResidualPullCalculatorConfig
import (
57 ResidualPullCalculatorCfg)
58 kwargs.setdefault(
"ResidualPullCalculator", acc.addPublicTool(
61 acc.addEventAlgo(CompFactory.InDetPhysHitDecoratorAlg(name, **kwargs))
67 create decoration algorithm which decorates track particles with the unbiased hit residuals and pulls.
72 if 'InDetTrackHoleSearchTool' not in kwargs:
73 from InDetConfig.InDetTrackHoleSearchConfig
import (
74 ITkTrackHoleSearchToolCfg)
75 kwargs.setdefault(
"InDetTrackHoleSearchTool", acc.popToolsAndMerge(
78 if 'Updator' not in kwargs:
79 from TrkConfig.TrkMeasurementUpdatorConfig
import ITkUpdatorCfg
80 kwargs.setdefault(
"Updator", acc.popToolsAndMerge(
ITkUpdatorCfg(flags)))
82 if 'LorentzAngleTool' not in kwargs:
83 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig
import (
84 ITkPixelLorentzAngleToolCfg)
85 kwargs.setdefault(
"LorentzAngleTool", acc.popToolsAndMerge(
88 acc.addEventAlgo(CompFactory.InDetPhysHitDecoratorAlg(name, **kwargs))
93 flags, name="ParameterErrDecoratorAlg", **kwargs):
95 create decoration algorithm which decorates track particles with the uncertainties of the track parameters.
98 acc.addEventAlgo(CompFactory.ParameterErrDecoratorAlg(name, **kwargs))
103 flags, name="InDetPhysValTruthDecoratorAlg", **kwargs):
105 create decoration algorithm which decorates truth particles with track parameters at the perigee.
109 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg
111 acc.addPublicTool(extrapolator)
112 kwargs.setdefault(
"Extrapolator", extrapolator)
114 if flags.Detector.GeometryITk:
115 kwargs.setdefault(
"PixelClusterContainerName",
"ITkPixelClusters")
116 kwargs.setdefault(
"SCTClusterContainerName",
"ITkStripClusters")
118 kwargs.setdefault(
'TruthParticleIndexDecoration',
119 'origTruthIndex' if flags.PhysVal.IDPVM.doTechnicalEfficiency
else '')
121 acc.addEventAlgo(CompFactory.InDetPhysValTruthDecoratorAlg(name, **kwargs))
127 create decoration algorithm which decorates truth particles with origin and type from truth classifier.
130 acc.addEventAlgo(CompFactory.TruthClassDecoratorAlg(name, **kwargs))
136 Get track particle decorators needed for the InDetPhysValMonitoring tool
140 if "CombinedInDetTracks" in flags.Input.Collections:
149 kwargs.setdefault(
"TrackParticleContainerName",
"GSFTrackParticles")
155 Add the track particle decoration algorithm to the top sequence.
156 The algorithm is to be run on RAW/RDO since it depends on full hit information
157 which is generally not available at later stages. The decorations added by this
158 algorithm are used by InDetPhysValMonitoring tool.
165 from BeamSpotConditions.BeamSpotConditionsConfig
import (
170 if flags.PhysVal.IDPVM.doValidateGSFTracks:
180 if flags.PhysVal.IDPVM.doValidateGSFTracks:
183 for col
in flags.PhysVal.IDPVM.validateExtraTrackCollections:
185 flags, TrackParticleContainerName=col))
190 Add the InDet decoration algorithm if it has not been ran yet.
196 print(
'DEBUG addDecoratorIfNeeded ? Stage is too early or too late for running the decoration. Needs reconstructed tracks. Try again during next stage ?')