5 '''@file InDetSelectionConfig.py
8 @brief CA-based python configurations for selection tools in this package
11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
17 CA-based configuration for the Tool to retrieve and select RoIs
21 kwargs.setdefault(
"RoiKey", flags.PhysVal.IDTPM.currentTrkAna.RoiKey )
22 kwargs.setdefault(
"ChainLeg", flags.PhysVal.IDTPM.currentTrkAna.ChainLeg )
23 kwargs.setdefault(
"doTagNProbe", flags.PhysVal.IDTPM.currentTrkAna.doTagNProbe )
24 kwargs.setdefault(
"RoiKeyTag", flags.PhysVal.IDTPM.currentTrkAna.RoiKeyTag )
25 kwargs.setdefault(
"ChainLegTag", flags.PhysVal.IDTPM.currentTrkAna.ChainLegTag )
26 kwargs.setdefault(
"RoiKeyProbe", flags.PhysVal.IDTPM.currentTrkAna.RoiKeyProbe )
27 kwargs.setdefault(
"ChainLegProbe", flags.PhysVal.IDTPM.currentTrkAna.ChainLegProbe )
29 acc.setPrivateTools( CompFactory.IDTPM.RoiSelectionTool( name, **kwargs ) )
36 kwargs.setdefault(
"TriggerTrkParticleContainerName",
37 flags.PhysVal.IDTPM.currentTrkAna.TrigTrkKey )
39 acc.setPrivateTools( CompFactory.IDTPM.TrackRoiSelectionTool( name, **kwargs ) )
46 kwargs.setdefault(
"TriggerVertexContainerName",
47 flags.PhysVal.IDTPM.currentTrkAna.TrigVtxKey )
49 acc.setPrivateTools( CompFactory.IDTPM.VertexRoiSelectionTool( name, **kwargs ) )
56 objStr = flags.PhysVal.IDTPM.currentTrkAna.SelectOfflineObject
57 kwargs.setdefault(
"ObjectType", objStr )
58 kwargs.setdefault(
"ObjectQuality", flags.PhysVal.IDTPM.currentTrkAna.ObjectQuality )
61 kwargs.setdefault(
"TauType", flags.PhysVal.IDTPM.currentTrkAna.TauType )
62 kwargs.setdefault(
"TauNprongs", flags.PhysVal.IDTPM.currentTrkAna.TauNprongs )
65 kwargs.setdefault(
"MatchingTruthProb", flags.PhysVal.IDTPM.currentTrkAna.TruthProbMin )
67 acc.setPrivateTools( CompFactory.IDTPM.TrackObjectSelectionTool( name, **kwargs ) )
73 kwargs_InDetTrackSelectionTool = {}
75 if flags.PhysVal.IDTPM.currentTrkAna.offlMinPt!=-9999.:
76 kwargs_InDetTrackSelectionTool.setdefault(
"minPt", flags.PhysVal.IDTPM.currentTrkAna.offlMinPt )
77 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsEta!=-9999.:
78 kwargs_InDetTrackSelectionTool.setdefault(
"maxAbsEta", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsEta )
79 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxZ0SinTheta!=-9999.:
80 kwargs_InDetTrackSelectionTool.setdefault(
"maxZ0SinTheta", flags.PhysVal.IDTPM.currentTrkAna.offlMaxZ0SinTheta )
81 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxZ0!=-9999.:
82 kwargs_InDetTrackSelectionTool.setdefault(
"maxZ0", flags.PhysVal.IDTPM.currentTrkAna.offlMaxZ0 )
83 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxD0!=-9999.:
84 kwargs_InDetTrackSelectionTool.setdefault(
"maxD0", flags.PhysVal.IDTPM.currentTrkAna.offlMaxD0 )
85 if flags.PhysVal.IDTPM.currentTrkAna.offlMinNInnermostLayerHits!=-9999.:
86 kwargs_InDetTrackSelectionTool.setdefault(
"minNInnermostLayerHits", flags.PhysVal.IDTPM.currentTrkAna.offlMinNInnermostLayerHits )
87 if flags.PhysVal.IDTPM.currentTrkAna.offlMinNBothInnermostLayersHits!=-9999.:
88 kwargs_InDetTrackSelectionTool.setdefault(
"minNBothInnermostLayersHits", flags.PhysVal.IDTPM.currentTrkAna.offlMinNBothInnermostLayersHits )
89 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNInnermostLayerSharedHits!=-9999.:
90 kwargs_InDetTrackSelectionTool.setdefault(
"maxNInnermostLayerSharedHits", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNInnermostLayerSharedHits )
91 if flags.PhysVal.IDTPM.currentTrkAna.offlMinNSiHits!=-9999.:
92 kwargs_InDetTrackSelectionTool.setdefault(
"minNSiHits", flags.PhysVal.IDTPM.currentTrkAna.offlMinNSiHits )
93 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSiSharedHits!=-9999.:
94 kwargs_InDetTrackSelectionTool.setdefault(
"maxNSiSharedHits", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSiSharedHits )
95 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSiHoles!=-9999.:
96 kwargs_InDetTrackSelectionTool.setdefault(
"maxNSiHoles", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSiHoles )
97 if flags.PhysVal.IDTPM.currentTrkAna.offlMinNPixelHits!=-9999.:
98 kwargs_InDetTrackSelectionTool.setdefault(
"minNPixelHits", flags.PhysVal.IDTPM.currentTrkAna.offlMinNPixelHits )
99 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNPixelSharedHits!=-9999.:
100 kwargs_InDetTrackSelectionTool.setdefault(
"maxNPixelSharedHits", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNPixelSharedHits )
101 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNPixelHoles!=-9999.:
102 kwargs_InDetTrackSelectionTool.setdefault(
"maxNPixelHoles", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNPixelHoles )
103 if flags.PhysVal.IDTPM.currentTrkAna.offlMinNSctHits!=-9999.:
104 kwargs_InDetTrackSelectionTool.setdefault(
"minNSctHits", flags.PhysVal.IDTPM.currentTrkAna.offlMinNSctHits )
105 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSctSharedHits!=-9999.:
106 kwargs_InDetTrackSelectionTool.setdefault(
"maxNSctSharedHits", flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSctSharedHits )
107 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxNSctHoles!=-9999.:
108 kwargs_InDetTrackSelectionTool.setdefault(
"maxNSctHoles", flags.PhysVal.IDTPM.currentTrkAna.offlMaxChiSq )
109 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxChiSq!=-9999.:
110 kwargs_InDetTrackSelectionTool.setdefault(
"maxChiSq", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsEta )
111 if flags.PhysVal.IDTPM.currentTrkAna.offlMaxChiSqperNdf!=-9999.:
112 kwargs_InDetTrackSelectionTool.setdefault(
"maxChiSqperNdf", flags.PhysVal.IDTPM.currentTrkAna.offlMaxChiSqperNdf )
113 if flags.PhysVal.IDTPM.currentTrkAna.offlMinProb!=-9999.:
114 kwargs_InDetTrackSelectionTool.setdefault(
"minProb", flags.PhysVal.IDTPM.currentTrkAna.offlMinProb )
115 kwargs_InDetTrackSelectionTool.setdefault(
"CutLevel", flags.PhysVal.IDTPM.currentTrkAna.OfflineQualityWP )
117 from InDetConfig.InDetTrackSelectionToolConfig
import InDetTrackSelectionToolCfg
120 kwargs.setdefault(
"offlineTool", offlineSelectionTool )
121 kwargs.setdefault(
"maxPt", flags.PhysVal.IDTPM.currentTrkAna.offlMaxPt )
122 kwargs.setdefault(
"minEta", flags.PhysVal.IDTPM.currentTrkAna.offlMinEta )
123 kwargs.setdefault(
"minPhi", flags.PhysVal.IDTPM.currentTrkAna.offlMinPhi )
124 kwargs.setdefault(
"maxPhi", flags.PhysVal.IDTPM.currentTrkAna.offlMaxPhi )
125 kwargs.setdefault(
"minD0", flags.PhysVal.IDTPM.currentTrkAna.offlMinD0 )
126 kwargs.setdefault(
"minZ0", flags.PhysVal.IDTPM.currentTrkAna.offlMinZ0 )
127 kwargs.setdefault(
"minQoPT", flags.PhysVal.IDTPM.currentTrkAna.offlMinQoPT )
128 kwargs.setdefault(
"maxQoPT", flags.PhysVal.IDTPM.currentTrkAna.offlMaxQoPT )
129 kwargs.setdefault(
"minAbsEta", flags.PhysVal.IDTPM.currentTrkAna.offlMinAbsEta )
130 kwargs.setdefault(
"minAbsPhi", flags.PhysVal.IDTPM.currentTrkAna.offlMinAbsPhi )
131 kwargs.setdefault(
"maxAbsPhi", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsPhi )
132 kwargs.setdefault(
"minAbsD0", flags.PhysVal.IDTPM.currentTrkAna.offlMinAbsD0 )
133 kwargs.setdefault(
"maxAbsD0", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsD0 )
134 kwargs.setdefault(
"minAbsZ0", flags.PhysVal.IDTPM.currentTrkAna.offlMinAbsZ0 )
135 kwargs.setdefault(
"maxAbsZ0", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsZ0 )
136 kwargs.setdefault(
"minAbsQoPT", flags.PhysVal.IDTPM.currentTrkAna.offlMinAbsQoPT )
137 kwargs.setdefault(
"maxAbsQoPT", flags.PhysVal.IDTPM.currentTrkAna.offlMaxAbsQoPT )
139 acc.setPrivateTools( CompFactory.IDTPM.OfflineTrackQualitySelectionTool( name, **kwargs ) )
149 truthMinPt = flags.PhysVal.IDTPM.currentTrkAna.truthMinPt
150 truthMaxPt = flags.PhysVal.IDTPM.currentTrkAna.truthMaxPt
151 truthPdgId = flags.PhysVal.IDTPM.currentTrkAna.truthPdgId
152 truthIsHadron = flags.PhysVal.IDTPM.currentTrkAna.truthIsHadron
153 truthIsPion = flags.PhysVal.IDTPM.currentTrkAna.truthIsPion
155 if "Muon" in flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject:
157 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"highPTMuon":
160 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"lowPTMuon":
164 elif "Hadron" in flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject:
166 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"highPTHadron":
169 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"lowPTHadron":
173 elif "Pion" in flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject:
175 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"highPTPion":
178 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"lowPTHadron":
182 elif "Electron" in flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject:
184 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"highPTElectron":
187 if flags.PhysVal.IDTPM.currentTrkAna.SelectTruthObject ==
"lowPTElectron":
194 kwargs_InDetRttTruthSelectionTool = {}
195 if truthMinPt!=-9999.: kwargs_InDetRttTruthSelectionTool.setdefault(
"minPt", truthMinPt )
196 if truthMaxPt!=-9999.: kwargs_InDetRttTruthSelectionTool.setdefault(
"maxPt", truthMaxPt )
197 if flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsEta!=-9999.: kwargs_InDetRttTruthSelectionTool.setdefault(
"maxEta", flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsEta )
198 if truthPdgId!=-9999.: kwargs_InDetRttTruthSelectionTool.setdefault(
"pdgId", truthPdgId )
200 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig
import InDetRttTruthSelectionToolCfg
205 kwargs.setdefault(
"truthTool" , truthSelectionTool)
206 kwargs.setdefault(
"maxEta", flags.PhysVal.IDTPM.currentTrkAna.truthMaxEta )
207 kwargs.setdefault(
"minEta", flags.PhysVal.IDTPM.currentTrkAna.truthMinEta )
208 kwargs.setdefault(
"minPhi", flags.PhysVal.IDTPM.currentTrkAna.truthMinPhi )
209 kwargs.setdefault(
"maxPhi", flags.PhysVal.IDTPM.currentTrkAna.truthMaxPhi )
210 kwargs.setdefault(
"minD0", flags.PhysVal.IDTPM.currentTrkAna.truthMinD0 )
211 kwargs.setdefault(
"maxD0", flags.PhysVal.IDTPM.currentTrkAna.truthMaxD0 )
212 kwargs.setdefault(
"minZ0", flags.PhysVal.IDTPM.currentTrkAna.truthMinZ0 )
213 kwargs.setdefault(
"maxZ0", flags.PhysVal.IDTPM.currentTrkAna.truthMaxZ0 )
214 kwargs.setdefault(
"minQoPT", flags.PhysVal.IDTPM.currentTrkAna.truthMinQoPT )
215 kwargs.setdefault(
"maxQoPT", flags.PhysVal.IDTPM.currentTrkAna.truthMaxQoPT )
216 kwargs.setdefault(
"isHadron", truthIsHadron )
217 kwargs.setdefault(
"isPion", truthIsPion )
218 kwargs.setdefault(
"minAbsEta", flags.PhysVal.IDTPM.currentTrkAna.truthMinAbsEta )
219 kwargs.setdefault(
"minAbsPhi", flags.PhysVal.IDTPM.currentTrkAna.truthMinAbsPhi )
220 kwargs.setdefault(
"maxAbsPhi", flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsPhi )
221 kwargs.setdefault(
"minAbsD0", flags.PhysVal.IDTPM.currentTrkAna.truthMinAbsD0 )
222 kwargs.setdefault(
"maxAbsD0", flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsD0 )
223 kwargs.setdefault(
"minAbsZ0", flags.PhysVal.IDTPM.currentTrkAna.truthMinAbsZ0 )
224 kwargs.setdefault(
"maxAbsZ0", flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsZ0 )
225 kwargs.setdefault(
"minAbsQoPT", flags.PhysVal.IDTPM.currentTrkAna.truthMinAbsQoPT )
226 kwargs.setdefault(
"maxAbsQoPT", flags.PhysVal.IDTPM.currentTrkAna.truthMaxAbsQoPT )
228 acc.setPrivateTools( CompFactory.IDTPM.TruthQualitySelectionTool( name, **kwargs ) )
237 if flags.PhysVal.IDTPM.currentTrkAna.OfflineQualityWP !=
"" or flags.PhysVal.IDTPM.currentTrkAna.DoOfflineSelection:
238 kwargs.setdefault(
"DoOfflineSelection",
True )
240 kwargs.setdefault(
"OfflineSelectionTool", acc.popToolsAndMerge(
245 kwargs.setdefault(
"DoTruthSelection",
True )
247 kwargs.setdefault(
"TruthSelectionTool", acc.popToolsAndMerge(
251 if flags.PhysVal.IDTPM.currentTrkAna.SelectOfflineObject !=
"":
252 kwargs.setdefault(
"DoObjectSelection",
True )
254 if "TrackObjectSelectionTool" not in kwargs:
255 kwargs.setdefault(
"TrackObjectSelectionTool", acc.popToolsAndMerge(
257 name=
"TrackObjectSelectionTool" + flags.PhysVal.IDTPM.currentTrkAna.anaTag ) ) )
259 acc.setPrivateTools( CompFactory.IDTPM.TrackQualitySelectionTool( name, **kwargs ) )
268 acc.setPrivateTools( CompFactory.IDTPM.VertexQualitySelectionTool( name, **kwargs ) )