ATLAS Offline Software
Loading...
Searching...
No Matches
InDetRetrieversConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4from AthenaConfiguration.Enums import Format
5
6
7def PixelClusterRetrieverCfg(flags, name="PixelClusterRetriever", **kwargs):
8 result = ComponentAccumulator()
9 if not flags.Input.isMC:
10 kwargs.setdefault("PixelTruthMap", "")
11 the_tool = CompFactory.JiveXML.PixelClusterRetriever(name, **kwargs)
12 result.addPublicTool(the_tool, primary=True)
13 return result
14
15
16def SiClusterRetrieverCfg(flags, name="SiClusterRetriever", **kwargs):
17 result = ComponentAccumulator()
18 if not flags.Input.isMC:
19 kwargs.setdefault("SCT_TruthMap", "")
20 the_tool = CompFactory.JiveXML.SiClusterRetriever(name, **kwargs)
21 result.addPublicTool(the_tool, primary=True)
22 return result
23
24
25def SiSpacePointRetrieverCfg(flags, name="SiSpacePointRetriever", **kwargs):
26 result = ComponentAccumulator()
27 if not flags.Input.isMC:
28 kwargs.setdefault("PRD_TruthPixel", "")
29 kwargs.setdefault("PRD_TruthSCT", "")
30 the_tool = CompFactory.JiveXML.SiSpacePointRetriever(name, **kwargs)
31 result.addPublicTool(the_tool, primary=True)
32 return result
33
34
35def TRTRetrieverCfg(flags, name="TRTRetriever", **kwargs):
36 result = ComponentAccumulator()
37 if not flags.Input.isMC:
38 kwargs.setdefault("TRTTruthMap", "")
39 the_tool = CompFactory.JiveXML.TRTRetriever(name, **kwargs)
40 result.addPublicTool(the_tool, primary=True)
41 return result
42
43
44def TrackRetrieverCfg(flags, name="TrackRetriever", **kwargs):
45 # Based on TrkJiveXML_DataTypes
46 result = ComponentAccumulator()
47
48 from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryHelperToolCfg
49 muonSummaryHelperTool=result.popToolsAndMerge(MuonTrackSummaryHelperToolCfg(flags))
50
51 from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg
52 InDetTrackSummaryTool=result.popToolsAndMerge(InDetTrackSummaryToolCfg(flags,MuonSummaryHelperTool=muonSummaryHelperTool))
53 kwargs.setdefault("TrackSummaryTool", InDetTrackSummaryTool)
54
55 from TrkConfig.TrkResidualPullCalculatorConfig import (ResidualPullCalculatorCfg)
56 ResidualPullCalculator=result.addPublicTool(result.popToolsAndMerge(ResidualPullCalculatorCfg(flags)))
57 kwargs.setdefault("ResidualPullCalculator", ResidualPullCalculator)
58 if not flags.Input.isMC:
59 kwargs.setdefault("TruthCollections",[""])
60 kwargs.setdefault("isMC", flags.Input.isMC)
61 kwargs.setdefault("DoWriteResiduals", False)
62 the_tool = CompFactory.JiveXML.TrackRetriever(name, **kwargs)
63 result.addPublicTool(the_tool, primary=True)
64 return result
65
66
67def VertexRetrieverCfg(flags, **kwargs):
68 result = ComponentAccumulator()
69 the_tool = CompFactory.JiveXML.VertexRetriever(name="VertexRetriever", **kwargs)
70 result.addPublicTool(the_tool, primary=True)
71 return result
72
73
74def SegmentRetrieverCfg(flags, **kwargs):
75 result = ComponentAccumulator()
76 the_tool = CompFactory.JiveXML.SegmentRetriever(name="SegmentRetriever", **kwargs)
77 result.addPublicTool(the_tool, primary=True)
78 return result
79
80
81def BeamSpotRetrieverCfg(flags, **kwargs):
82 result = ComponentAccumulator()
83 the_tool = CompFactory.JiveXML.BeamSpotRetriever(name="BeamSpotRetriever", **kwargs)
84 result.addPublicTool(the_tool, primary=True)
85 return result
86
87
88def PixelRDORetrieverCfg(flags, **kwargs):
89 result = ComponentAccumulator()
90 the_tool = CompFactory.JiveXML.PixelRDORetriever(name="PixelRDORetriever", **kwargs)
91 result.addPublicTool(the_tool, primary=True)
92 return result
93
94
95def SCTRDORetrieverCfg(flags, **kwargs):
96 result = ComponentAccumulator()
97 the_tool = CompFactory.JiveXML.SCTRDORetriever(name="SCTRDORetriever", **kwargs)
98 result.addPublicTool(the_tool, primary=True)
99 return result
100
101
103 result = ComponentAccumulator()
104 tools = []
105 # Do we need to add equivalent of InDetFlags.doSlimming=False (in JiveXML_RecEx_config.py)? If so, why?
106 # Following is based on InDetJiveXML_DataTypes.py and TrkJiveXML_DataTypes.py
107
108 haveRDO = (
109 flags.Input.Format is Format.BS or "StreamRDO" in flags.Input.ProcessingTags
110 )
111
112 if flags.Detector.EnablePixel and flags.Detector.GeometryPixel:
113 tools += [result.getPrimaryAndMerge(PixelClusterRetrieverCfg(flags))]
114 if haveRDO:
115 tools += [result.getPrimaryAndMerge(PixelRDORetrieverCfg(flags))]
116
117 if flags.Detector.EnableID and flags.Detector.GeometryID and flags.Detector.EnablePixel and flags.Detector.GeometryPixel and flags.Detector.EnableSCT and flags.Detector.GeometrySCT:
118 tools += [result.getPrimaryAndMerge(SiClusterRetrieverCfg(flags))]
119 tools += [result.getPrimaryAndMerge(SiSpacePointRetrieverCfg(flags))]
120 tools += [result.getPrimaryAndMerge(SegmentRetrieverCfg(flags))]
121 tools += [result.getPrimaryAndMerge(VertexRetrieverCfg(flags))]
122 tools += [result.getPrimaryAndMerge(TrackRetrieverCfg(flags))]
123
124 if flags.Detector.EnableTRT and flags.Detector.GeometryTRT:
125 tools += [result.getPrimaryAndMerge(TRTRetrieverCfg(flags))]
126
127 if haveRDO and flags.Detector.EnableSCT and flags.Detector.GeometrySCT:
128 tools += [result.getPrimaryAndMerge(SCTRDORetrieverCfg(flags))]
129
130 if not flags.OnlineEventDisplays.OfflineTest:
131 tools += [result.getPrimaryAndMerge(BeamSpotRetrieverCfg(flags))]
132
133 return result, tools
VertexRetrieverCfg(flags, **kwargs)
BeamSpotRetrieverCfg(flags, **kwargs)
SiClusterRetrieverCfg(flags, name="SiClusterRetriever", **kwargs)
SiSpacePointRetrieverCfg(flags, name="SiSpacePointRetriever", **kwargs)
PixelClusterRetrieverCfg(flags, name="PixelClusterRetriever", **kwargs)
TRTRetrieverCfg(flags, name="TRTRetriever", **kwargs)
PixelRDORetrieverCfg(flags, **kwargs)
SegmentRetrieverCfg(flags, **kwargs)
TrackRetrieverCfg(flags, name="TrackRetriever", **kwargs)
SCTRDORetrieverCfg(flags, **kwargs)