107 from InDetPhysValMonitoring.InDetPhysValDecorationConfig
import (
108 AddDecoratorIfNeededCfg)
110 kwargs.setdefault(
"useTrackSelection",
False)
111 kwargs.setdefault(
"EnableLumi",
False)
114 kwargs.setdefault(
'VertexContainerName', flags.PhysVal.IDPVM.PrimaryVertexContainer)
117 if flags.PhysVal.IDPVM.hardScatterStrategy
in [2, 3]:
119 from InDetPhysValMonitoring.addRecoJetsConfig
import (
120 AddRecoJetsIfNotExistingCfg)
122 flags, flags.PhysVal.IDPVM.jetsNameForHardScatter))
125 if flags.PhysVal.IDPVM.hardScatterStrategy == 3:
126 from InDetConfig.InDetGNNHardScatterSelectionConfig
import (
131 if flags.PhysVal.IDPVM.hardScatterStrategy == 4:
132 from DerivationFrameworkHiggs.HIGG1D1CustomVertexConfig
import DiPhotonVertexCfg
135 if flags.PhysVal.IDPVM.GRL:
136 kwargs.setdefault(
"useGRL",
True)
137 kwargs.setdefault(
'GoodRunsListSelectionTool', acc.popToolsAndMerge(
140 kwargs.setdefault(
"doIDTIDEPlots", flags.PhysVal.IDPVM.doIDTIDE)
142 if flags.PhysVal.IDPVM.doValidateTracksInJets:
143 kwargs.setdefault(
"JetContainerName", flags.PhysVal.IDPVM.jetCollection)
144 kwargs.setdefault(
"FillTrackInJetPlots",
True)
145 kwargs.setdefault(
'JetAbsEtaMin', 0)
146 kwargs.setdefault(
'JetAbsEtaMax', flags.PhysVal.IDPVM.JetAbsEtaMax)
147 kwargs.setdefault(
'JetPtMin', flags.PhysVal.IDPVM.JetPtMin)
148 kwargs.setdefault(
'JetPtMax', flags.PhysVal.IDPVM.JetPtMax)
149 kwargs.setdefault(
'maxTrkJetDR', flags.PhysVal.IDPVM.maxTrkJetDR)
150 kwargs.setdefault(
"FillTrackInBJetPlots",
151 flags.PhysVal.IDPVM.doValidateTracksInBJets)
153 kwargs.setdefault(
"JetContainerName",
'')
154 kwargs.setdefault(
"FillTrackInJetPlots",
False)
157 if flags.Input.isMC
and not flags.PhysVal.IDPVM.doRecoOnly:
158 kwargs.setdefault(
"TruthParticleContainerName",
"TruthParticles")
159 if 'TruthSelectionTool' not in kwargs:
160 kwargs.setdefault(
"TruthSelectionTool", acc.popToolsAndMerge(
163 doHyyHSSelection = flags.PhysVal.IDPVM.hardScatterStrategy == 4
164 if 'hardScatterSelectionTool' not in kwargs:
165 from InDetConfig.InDetHardScatterSelectionToolConfig
import (
166 InDetHardScatterSelectionToolCfg)
167 kwargs.setdefault(
"hardScatterSelectionTool", acc.popToolsAndMerge(
170 RedoHardScatter=
not doHyyHSSelection,
171 SelectionMode=flags.PhysVal.IDPVM.hardScatterStrategy,
173 JetContainer=flags.PhysVal.IDPVM.jetsNameForHardScatter,
174 VertexContainer=flags.PhysVal.IDPVM.PrimaryVertexContainer
178 assert flags.PhysVal.IDPVM.PrimaryVertexContainer ==
'HggPrimaryVertices'
180 kwargs.setdefault(
"FillTruthToRecoNtuple",
181 flags.PhysVal.IDPVM.doValidateTruthToRecoNtuple)
182 kwargs.setdefault(
"doTruthOriginPlots",
183 flags.PhysVal.IDPVM.doTruthOriginPlots)
184 kwargs.setdefault(
"doDuplicatePlots",
185 flags.PhysVal.IDPVM.doDuplicatePlots)
186 kwargs.setdefault(
"doPerAuthorPlots",
187 flags.PhysVal.IDPVM.doPerAuthorPlots)
188 kwargs.setdefault(
"doHitLevelPlots",
189 flags.PhysVal.IDPVM.doHitLevelPlots)
192 if not flags.PhysVal.IDPVM.doIDTIDE:
193 kwargs.setdefault(
"useVertexTruthMatchTool",
True)
194 kwargs.setdefault(
"VertexTruthMatchTool", acc.popToolsAndMerge(
197 if "trackTruthOriginTool" not in kwargs:
198 from InDetTrackSystematicsTools.InDetTrackSystematicsToolsConfig
import InDetTrackTruthOriginToolCfg
199 kwargs.setdefault(
"trackTruthOriginTool", acc.popToolsAndMerge(
203 if flags.PhysVal.IDPVM.setTruthStrategy
in [
'All',
'PileUp']:
204 if not(
"xAOD::TruthPileupEventContainer#TruthPileupEvents"
205 in flags.Input.TypedCollections):
206 print(
'WARNING Truth Strategy for InDetPhysValMonitoring set to %s but TruthPileupEvents are missing in the input' % (flags.PhysVal.IDPVM.setTruthStrategy))
207 kwargs.setdefault(
"PileupSwitch",
208 flags.PhysVal.IDPVM.setTruthStrategy)
210 elif flags.PhysVal.IDPVM.setTruthStrategy !=
'HardScatter':
211 print(
'WARNING Truth Strategy for for InDetPhysValMonitoring set to invalid option %s; valid flags are ["HardScatter", "All", "PileUp"]' % (
212 flags.PhysVal.IDPVM.setTruthStrategy))
216 kwargs.setdefault(
"TruthParticleContainerName",
'')
217 kwargs.setdefault(
"TruthVertexContainerName",
'')
218 kwargs.setdefault(
"TruthEvents",
'')
219 kwargs.setdefault(
"TruthPileupEvents",
'')
220 kwargs.setdefault(
"TruthSelectionTool",
None)
221 kwargs.setdefault(
"FillTruthToRecoNtuple",
False)
223 if flags.Detector.GeometryITk:
225 kwargs.setdefault(
"doTRTExtensionPlots",
False)
226 kwargs.setdefault(
"isITk",
True)
228 if flags.PhysVal.IDPVM.doTechnicalEfficiency:
229 kwargs.setdefault(
"fillTechnicalEfficiency",
True)
230 kwargs.setdefault(
"EtaBins", flags.Tracking.ITkMainPass.etaBins
if flags.Detector.GeometryITk
232 kwargs.setdefault(
"MinNumberClusters", flags.Tracking.ITkMainPass.minClusters
if flags.Detector.GeometryITk
233 else [flags.Tracking.MainPass.minClusters])
236 if flags.PhysVal.IDPVM.doPhysValOutput:
237 kwargs.setdefault(
"DetailLevel", 100)
239 elif flags.PhysVal.IDPVM.doExpertOutput:
240 kwargs.setdefault(
"DetailLevel", 200)
243 if flags.PhysVal.IDPVM.doIDTIDE:
244 kwargs.setdefault(
"doIDTIDEPlots",
True)
245 kwargs.setdefault(
"JetContainerName",
'AntiKt4EMPFlowJets')
246 kwargs.setdefault(
"FillTrackInJetPlots",
True)
249 kwargs.setdefault(
'JetAbsEtaMin', 0)
250 kwargs.setdefault(
'JetAbsEtaMax',
251 flags.PhysVal.IDPVM.JetAbsEtaMax)
252 kwargs.setdefault(
'maxTrkJetDR',
253 flags.PhysVal.IDPVM.maxTrkJetDR)
255 kwargs.setdefault(
'JetPtMin', 100)
256 kwargs.setdefault(
'JetPtMax', 5000)
258 kwargs.setdefault(
"doPRW", flags.PhysVal.IDPVM.doPRW)
260 acc.setPrivateTools(CompFactory.InDetPhysValMonitoringTool(**kwargs))