4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.Enums
import BeamType, LHCPeriod
7 from IOVDbSvc.IOVDbSvcConfig
import addFoldersSplitOnline
15 from PixelConditionsAlgorithms.PixelConditionsConfig
import (
16 PixelChargeCalibCondCfg, PixelOfflineCalibCondAlgCfg)
17 if (
'SCT' in flags.Digitization.DoFastDigi
and
18 'Pixel' not in flags.Digitization.DoFastDigi):
24 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import (
25 PixelReadoutManagerCfg)
28 if "PixelLorentzAngleTool" not in kwargs:
29 from SiLorentzAngleTool.PixelLorentzAngleConfig
import (
30 PixelLorentzAngleToolCfg)
31 kwargs.setdefault(
"PixelLorentzAngleTool", acc.popToolsAndMerge(
34 if "SCTLorentzAngleTool" not in kwargs:
35 from SiLorentzAngleTool.SCT_LorentzAngleConfig
import (
36 SCT_LorentzAngleToolCfg)
37 kwargs.setdefault(
"SCTLorentzAngleTool", acc.popToolsAndMerge(
40 acc.setPrivateTools(CompFactory.InDet.ClusterMakerTool(name, **kwargs))
47 from PixelConditionsAlgorithms.ITkPixelConditionsConfig
import (
48 ITkPixelChargeCalibCondAlgCfg)
49 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import (
50 ITkPixelReadoutManagerCfg)
56 kwargs.setdefault(
"PixelReadoutManager", acc.getService(
57 "ITkPixelReadoutManager"))
59 if "PixelLorentzAngleTool" not in kwargs:
60 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig
import (
61 ITkPixelLorentzAngleToolCfg)
62 kwargs.setdefault(
"PixelLorentzAngleTool", acc.popToolsAndMerge(
65 if "SCTLorentzAngleTool" not in kwargs:
66 from SiLorentzAngleTool.ITkStripLorentzAngleConfig
import (
67 ITkStripLorentzAngleToolCfg)
68 kwargs.setdefault(
"SCTLorentzAngleTool", acc.popToolsAndMerge(
71 acc.setPrivateTools(CompFactory.InDet.ClusterMakerTool(name, **kwargs))
77 from PixelGeoModel.PixelGeoModelConfig
import PixelReadoutGeometryCfg
80 kwargs.setdefault(
"PixelDetElStatus",
"PixelDetectorElementStatus")
82 if kwargs[
"PixelDetElStatus"] !=
"":
83 from PixelConditionsAlgorithms.PixelConditionsConfig
import (
84 PixelDetectorElementStatusAlgCfg)
87 if "PixelConditionsSummaryTool" not in kwargs:
88 from PixelConditionsTools.PixelConditionsSummaryConfig
import (
89 PixelConditionsSummaryCfg)
90 kwargs.setdefault(
"PixelConditionsSummaryTool", acc.popToolsAndMerge(
95 kwargs.setdefault(
"CheckDuplicatedRDO",
96 (len(flags.Input.ProjectName) >= 6
and
97 flags.Input.ProjectName[:6] ==
"data15"))
99 acc.setPrivateTools(CompFactory.InDet.PixelRDOTool(name, **kwargs))
105 from PixelGeoModelXml.ITkPixelGeoModelConfig
import (
106 ITkPixelReadoutGeometryCfg)
109 kwargs.setdefault(
"PixelConditionsSummaryTool",
None)
110 if "PixelDetElStatus" not in kwargs :
111 if not flags.Trigger.doHLT :
112 from PixelConditionsAlgorithms.ITkPixelConditionsConfig
import (
113 ITkPixelDetectorElementStatusAlgCfg)
115 kwargs.setdefault(
"PixelDetElStatus",
"ITkPixelDetectorElementStatus")
117 kwargs.setdefault(
"PixelReadoutManager",
"ITkPixelReadoutManager")
119 kwargs.setdefault(
"PixelDetEleCollKey",
"ITkPixelDetectorElementCollection")
120 kwargs.setdefault(
"CheckGanged",
False)
122 acc.setPrivateTools(CompFactory.InDet.PixelRDOTool(name, **kwargs))
133 kwargs.setdefault(
"globalPosAlg", acc.popToolsAndMerge(
135 kwargs.setdefault(
"PixelRDOTool", acc.popToolsAndMerge(
138 acc.setPrivateTools(CompFactory.InDet.MergedPixelsTool(name, **kwargs))
149 acc.setPrivateTools(CompFactory.InDet.MergedPixelsTool(name, **kwargs))
156 kwargs.setdefault(
"globalPosAlg", acc.popToolsAndMerge(
158 kwargs.setdefault(
"PixelRDOTool", acc.popToolsAndMerge(
161 kwargs.setdefault(
"PixelChargeCalibCondData",
"ITkPixelChargeCalibCondData")
162 kwargs.setdefault(
"PixelOfflineCalibData",
"")
164 acc.setPrivateTools(CompFactory.InDet.MergedPixelsTool(name, **kwargs))
169 flags, name="PixelClusterNnCondAlg", trackNetwork=False, **kwargs):
173 "NumberParticles_NoTrack/",
174 "ImpactPoints1P_NoTrack/",
175 "ImpactPoints2P_NoTrack/",
176 "ImpactPoints3P_NoTrack/",
177 "ImpactPointErrorsX1_NoTrack/",
178 "ImpactPointErrorsX2_NoTrack/",
179 "ImpactPointErrorsX3_NoTrack/",
180 "ImpactPointErrorsY1_NoTrack/",
181 "ImpactPointErrorsY2_NoTrack/",
182 "ImpactPointErrorsY3_NoTrack/"]
185 nn_names = [elm.replace(
'_NoTrack',
'')
for elm
in nn_names]
187 kwargs.setdefault(
"NetworkNames", nn_names)
188 kwargs.setdefault(
"GetInputsInfo",
True)
189 kwargs.setdefault(
"WriteKey", (
"PixelClusterNN" if not trackNetwork
190 else "PixelClusterNNWithTrack"))
194 "/PIXEL/Onl/PixelClustering/PixelClusNNCalib",
195 "/PIXEL/PixelClustering/PixelClusNNCalib",
196 className=
'CondAttrListCollection'))
198 if "NetworkToHistoTool" not in kwargs:
199 from TrkConfig.TrkNeuralNetworkUtilsConfig
import (
200 NeuralNetworkToHistoToolCfg)
201 kwargs.setdefault(
"NetworkToHistoTool", acc.popToolsAndMerge(
204 acc.addCondAlgo(CompFactory.InDet.TTrainedNetworkCondAlg(name, **kwargs))
209 flags, name="PixelClusterNnWithTrackCondAlg"):
218 "/PIXEL/Onl/PixelClustering/PixelNNCalibJSON",
219 "/PIXEL/PixelClustering/PixelNNCalibJSON",
220 className=
"CondAttrListCollection"))
222 kwargs.setdefault(
"WriteKey",
"PixelClusterNNJSON")
224 acc.addCondAlgo(CompFactory.InDet.LWTNNCondAlg(name, **kwargs))
229 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import (
230 PixelReadoutManagerCfg)
233 from PixelConditionsAlgorithms.PixelConditionsConfig
import (
234 PixelChargeCalibCondCfg)
237 if flags.GeoModel.Run
is LHCPeriod.Run1:
243 if "PixelLorentzAngleTool" not in kwargs:
244 from SiLorentzAngleTool.PixelLorentzAngleConfig
import (
245 PixelLorentzAngleToolCfg)
246 kwargs.setdefault(
"PixelLorentzAngleTool", acc.popToolsAndMerge(
249 kwargs.setdefault(
"doRunI", flags.GeoModel.Run
is LHCPeriod.Run1)
250 kwargs.setdefault(
"useToT",
False)
251 kwargs.setdefault(
"useRecenteringNNWithoutTracks", (
252 flags.GeoModel.Run
is LHCPeriod.Run1))
253 kwargs.setdefault(
"useRecenteringNNWithTracks",
False)
254 kwargs.setdefault(
"correctLorShiftBarrelWithoutTracks", 0)
255 kwargs.setdefault(
"correctLorShiftBarrelWithTracks", (
256 0.03
if flags.GeoModel.Run
is LHCPeriod.Run1
else 0.))
257 kwargs.setdefault(
"useTTrainedNetworks",
258 flags.GeoModel.Run
is LHCPeriod.Run1)
259 kwargs.setdefault(
"NnCollectionReadKey", (
260 "PixelClusterNN" if flags.GeoModel.Run
is LHCPeriod.Run1
else ""))
261 kwargs.setdefault(
"NnCollectionWithTrackReadKey", (
262 "PixelClusterNNWithTrack" if flags.GeoModel.Run
is LHCPeriod.Run1
264 kwargs.setdefault(
"NnCollectionJSONReadKey", (
265 "" if flags.GeoModel.Run
is LHCPeriod.Run1
266 else "PixelClusterNNJSON"))
269 CompFactory.InDet.NnClusterizationFactory(name, **kwargs))
277 from PixelConditionsAlgorithms.PixelConditionsConfig
import (
278 PixelChargeCalibCondCfg)
284 from SiLorentzAngleTool.PixelLorentzAngleConfig
import (
285 PixelLorentzAngleToolCfg)
286 kwargs[
"PixelLorentzAngleTool"] = acc.popToolsAndMerge(
289 kwargs[
"useToT"] =
False
290 kwargs[
"NnCollectionReadKey"] =
"PixelClusterNN"
291 kwargs[
"NnCollectionWithTrackReadKey"] =
"PixelClusterNNWithTrack"
294 CompFactory.InDet.NnClusterizationFactory(name, **kwargs))
298 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import (
299 ITkPixelReadoutManagerCfg)
302 from PixelConditionsAlgorithms.ITkPixelConditionsConfig
import (
303 ITkPixelChargeCalibCondAlgCfg)
308 if "PixelLorentzAngleTool" not in kwargs:
309 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig
import (
310 ITkPixelLorentzAngleToolCfg)
311 kwargs.setdefault(
"PixelLorentzAngleTool", acc.popToolsAndMerge(
314 kwargs.setdefault(
"useToT",
False)
315 kwargs.setdefault(
"NnCollectionReadKey",
"")
316 kwargs.setdefault(
"NnCollectionWithTrackReadKey",
"")
317 kwargs.setdefault(
"NnCollectionJSONReadKey",
"PixelClusterNNJSON")
319 kwargs.setdefault(
"PixelReadoutManager",
"ITkPixelReadoutManager")
320 kwargs.setdefault(
"PixelChargeCalibCondData",
"ITkPixelChargeCalibCondData")
323 CompFactory.InDet.NnClusterizationFactory(name, **kwargs))
328 flags, name="NnPixelClusterSplitProbTool", **kwargs):
331 kwargs.setdefault(
"NnClusterizationFactory", acc.popToolsAndMerge(
333 kwargs.setdefault(
"PriorMultiplicityContent", [1, 1, 1])
334 kwargs.setdefault(
"useBeamSpotInfo", flags.Tracking.useBeamSpotInfoNN)
337 CompFactory.InDet.NnPixelClusterSplitProbTool(name, **kwargs))
341 flags, name="ITkNnPixelClusterSplitProbTool", **kwargs):
344 kwargs.setdefault(
"NnClusterizationFactory", acc.popToolsAndMerge(
346 kwargs.setdefault(
"PriorMultiplicityContent", [1, 1, 1])
347 kwargs.setdefault(
"useBeamSpotInfo", flags.Tracking.useBeamSpotInfoNN)
350 CompFactory.InDet.NnPixelClusterSplitProbTool(name, **kwargs))
355 flags, name="InDetPixelGangedAmbiguitiesFinder", **kwargs):
357 from PixelGeoModel.PixelGeoModelConfig
import PixelReadoutGeometryCfg
360 CompFactory.InDet.PixelGangedAmbiguitiesFinder(name, **kwargs))
365 flags, name="ITkPixelGangedAmbiguitiesFinder", **kwargs):
367 from PixelGeoModelXml.ITkPixelGeoModelConfig
import (
368 ITkPixelReadoutGeometryCfg)
370 kwargs.setdefault(
"PixelDetEleCollKey",
"ITkPixelDetectorElementCollection")
372 CompFactory.InDet.PixelGangedAmbiguitiesFinder(name, **kwargs))
377 flags, name="InDetSCT_ClusteringTool", **kwargs):
379 from SCT_GeoModel.SCT_GeoModelConfig
import SCT_ReadoutGeometryCfg
382 kwargs.setdefault(
"SCTDetElStatus",
383 "SCTDetectorElementStatusWithoutFlagged")
385 kwargs.setdefault(
"doSimplePositionWidthCalculation",
386 flags.InDet.doSCTSimpleWidth)
388 if "conditionsTool" not in kwargs:
389 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import (
390 SCT_ConditionsSummaryToolCfg)
391 kwargs.setdefault(
"conditionsTool", acc.popToolsAndMerge(
394 if "LorentzAngleTool" not in kwargs:
395 from SiLorentzAngleTool.SCT_LorentzAngleConfig
import (
396 SCT_LorentzAngleToolCfg)
397 kwargs.setdefault(
"LorentzAngleTool", acc.popToolsAndMerge(
400 kwargs.setdefault(
"globalPosAlg", acc.popToolsAndMerge(
403 if flags.InDet.selectSCTIntimeHits:
404 coll_25ns = (flags.Beam.BunchSpacing <= 25
and
405 flags.Beam.Type
is BeamType.Collisions)
406 kwargs.setdefault(
"timeBins",
"01X" if coll_25ns
else "X1X")
408 acc.setPrivateTools(CompFactory.InDet.SCT_ClusteringTool(name, **kwargs))
415 if "conditionsTool" not in kwargs:
416 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import (
417 SCT_ConditionsSummaryToolCfg)
418 kwargs.setdefault(
"conditionsTool", acc.popToolsAndMerge(
421 kwargs.setdefault(
"SCTDetElStatus",
"")
424 kwargs.setdefault(
"doSimplePositionWidthCalculation",
False)
426 acc.setPrivateTools(acc.popToolsAndMerge(
432 flags, name="ITkStripClusteringTool", **kwargs):
434 from StripGeoModelXml.ITkStripGeoModelConfig
import (
435 ITkStripReadoutGeometryCfg)
438 kwargs.setdefault(
"SCTDetEleCollKey",
"ITkStripDetectorElementCollection")
439 kwargs.setdefault(
"doSimplePositionWidthCalculation",
True)
441 kwargs.setdefault(
"conditionsTool",
None)
442 if "SCTDetElStatus" not in kwargs :
443 if not flags.Trigger.doHLT :
444 from SCT_ConditionsAlgorithms.ITkStripConditionsAlgorithmsConfig
import (
445 ITkStripDetectorElementStatusAlgCfg)
447 kwargs.setdefault(
"SCTDetElStatus",
"ITkStripDetectorElementStatus")
449 if "LorentzAngleTool" not in kwargs:
450 from SiLorentzAngleTool.ITkStripLorentzAngleConfig
import (
451 ITkStripLorentzAngleToolCfg)
452 kwargs.setdefault(
"LorentzAngleTool", acc.popToolsAndMerge(
455 kwargs.setdefault(
"globalPosAlg", acc.popToolsAndMerge(
458 if flags.ITk.selectStripIntimeHits:
459 coll_25ns = (flags.Beam.BunchSpacing <= 25
and
460 flags.Beam.Type
is BeamType.Collisions)
461 kwargs.setdefault(
"timeBins",
"01X" if coll_25ns
else "X1X")
463 acc.setPrivateTools(CompFactory.InDet.SCT_ClusteringTool(name, **kwargs))
468 flags, name='TruthClusterizationFactory', **kwargs):
471 kwargs.setdefault(
"discardPUHits", flags.Digitization.PileUp)
472 kwargs.setdefault(
"truthClusterSplittingEff", flags.Tracking.TruthClusterSplittingEff)
474 CompFactory.InDet.TruthClusterizationFactory(name, **kwargs))
479 flags, name='ITkTruthClusterizationFactory', **kwargs):
482 kwargs.setdefault(
"InputSDOMap",
"ITkPixelSDO_Map")
483 kwargs.setdefault(
"discardPUHits", flags.Digitization.PileUp)
484 kwargs.setdefault(
"truthClusterSplittingEff", flags.Tracking.TruthClusterSplittingEff)
486 CompFactory.InDet.TruthClusterizationFactory(name, **kwargs))
491 flags, name="TruthPixelClusterSplitProbTool", **kwargs):
493 kwargs.setdefault(
"PriorMultiplicityContent", [1, 1, 1])
494 kwargs.setdefault(
"NnClusterizationFactory", acc.popToolsAndMerge(
497 CompFactory.InDet.TruthPixelClusterSplitProbTool(name, **kwargs))
502 flags, name="ITkTruthPixelClusterSplitProbTool", **kwargs):
504 kwargs.setdefault(
"PriorMultiplicityContent", [1, 1, 1])
505 kwargs.setdefault(
"NnClusterizationFactory", acc.popToolsAndMerge(
508 CompFactory.InDet.TruthPixelClusterSplitProbTool(name, **kwargs))
514 from InDetConfig.SiClusterizationToolConfig
import ITkPixelRDOToolCfg
516 alg = CompFactory.InDet.HitsToxAODCopier(PixelRDOTool=tool, PixelRDOContainerKey=
"ITkPixelRDOs")
519 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD, addToAOD
521 toRecod = [
"xAOD::BaseContainer#PixelHits",
"xAOD::AuxContainerBase#PixelHitsAux.col.row.tot.eta_module.phi_module.layer_disk.barrel_ec.detid",
522 "xAOD::BaseContainer#StripHits",
"xAOD::AuxContainerBase#StripHitsAux.strip.side.eta_module.phi_module.layer_disk.barrel_ec.detid" ]