16 """Configure the derivation framework driving algorithm (kernel) for HIGG9D1"""
19 doLRT = flags.Tracking.doLargeD0
21 log_HIGG9D1.info(
"flags.Tracking.doLargeD0 is True")
23 log_HIGG9D1.info(
"flags.Tracking.doLargeD0 is False")
26 HIGG9D1_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
27 name =
"HIGG9D1_AugOriginalCounts",
28 VertexContainer =
"PrimaryVertices",
29 TrackContainer =
"InDetTrackParticles",
30 TrackLRTContainer =
"InDetLargeD0TrackParticles" if doLRT
else "" )
31 acc.addPublicTool(HIGG9D1_AugOriginalCounts)
33 mainMuonInput =
"StdWithLRTMuons" if doLRT
else "Muons"
34 mainIDInput =
"InDetWithLRTTrackParticles" if doLRT
else "InDetTrackParticles"
36 from DerivationFrameworkLLP.LLPToolsConfig
import LRTMuonMergerAlg
37 from AthenaConfiguration.Enums
import LHCPeriod
39 PromptMuonLocation =
"Muons",
40 LRTMuonLocation =
"MuonsLRT",
41 OutputMuonLocation = mainMuonInput,
42 CreateViewCollection =
True,
43 UseRun3WP = flags.GeoModel.Run
is LHCPeriod.Run3 ))
44 from DerivationFrameworkInDet.InDetToolsConfig
import InDetLRTMergeCfg
45 acc.merge(
InDetLRTMergeCfg( flags, OutputTrackParticleLocation = mainIDInput ))
47 MuonToRelink = [
"Muons",
"MuonsLRT" ]
if doLRT
else []
48 TrkToRelink = [
"InDetTrackParticles",
"InDetLargeD0TrackParticles"]
if doLRT
else []
50 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
53 acc.addPublicTool(vkalvrt)
54 acc.addPublicTool(V0Tools)
56 acc.addPublicTool(TrackSelector)
58 acc.addPublicTool(vpest)
60 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
62 acc.addPublicTool(pvRefitter)
64 HIGG9D1JpsiFinder = CompFactory.Analysis.JpsiFinder(
65 name =
"HIGG9D1JpsiFinder",
68 TrackAndTrack =
False,
70 trackThresholdPt = 2400.,
71 invMassLower = 2600.0,
72 invMassUpper = 3500.0,
74 oppChargesOnly =
True,
75 atLeastOneComb =
True,
76 useCombinedMeasurement =
False,
77 muonCollectionKey = mainMuonInput,
78 TrackParticleCollection = mainIDInput,
79 V0VertexFitterTool =
None,
81 TrkVertexFitterTool = vkalvrt,
82 TrackSelectorTool = TrackSelector,
83 VertexPointEstimator = vpest,
85 acc.addPublicTool(HIGG9D1JpsiFinder)
87 HIGG9D1UpsiFinder = CompFactory.Analysis.JpsiFinder(
88 name =
"HIGG9D1UpsiFinder",
91 TrackAndTrack =
False,
93 trackThresholdPt = 2400.,
94 invMassLower = 8900.0,
95 invMassUpper = 9900.0,
97 oppChargesOnly =
True,
98 atLeastOneComb =
True,
99 useCombinedMeasurement =
False,
100 muonCollectionKey = mainMuonInput,
101 TrackParticleCollection = mainIDInput,
102 V0VertexFitterTool =
None,
104 TrkVertexFitterTool = vkalvrt,
105 TrackSelectorTool = TrackSelector,
106 VertexPointEstimator = vpest,
108 acc.addPublicTool(HIGG9D1UpsiFinder)
110 HIGG9D1_Jpsi = CompFactory.DerivationFramework.Reco_Vertex(
111 name =
"HIGG9D1_Jpsi",
112 VertexSearchTool = HIGG9D1JpsiFinder,
113 OutputVtxContainerName =
"HIGG9D1_JpsiCandidates",
114 PVContainerName =
"PrimaryVertices",
115 RefPVContainerName =
"HIGG9D1_JpsiRefittedPrimaryVertices",
119 RelinkTracks = TrkToRelink,
120 RelinkMuons = MuonToRelink,
121 PVRefitter = pvRefitter,
123 acc.addPublicTool(HIGG9D1_Jpsi)
125 HIGG9D1_Upsi = CompFactory.DerivationFramework.Reco_Vertex(
126 name =
"HIGG9D1_Upsi",
127 VertexSearchTool = HIGG9D1UpsiFinder,
128 OutputVtxContainerName =
"HIGG9D1_UpsiCandidates",
129 PVContainerName =
"PrimaryVertices",
130 RefPVContainerName =
"HIGG9D1_UpsiRefittedPrimaryVertices",
134 RelinkTracks = TrkToRelink,
135 RelinkMuons = MuonToRelink,
136 PVRefitter = pvRefitter,
138 acc.addPublicTool(HIGG9D1_Upsi)
140 from InDetConfig.InDetTrackSelectionToolConfig
import InDetTrackSelectionTool_Loose_Cfg
143 name =
"HIGG9D1_isoTrackSelTool",
147 from IsolationAlgs.IsoToolsConfig
import TrackIsolationToolCfg
150 name =
"HIGG9D1_TrackIsoTool",
151 TrackSelectionTool = HIGG9D1_isoTrackSelTool))
152 acc.addPublicTool(HIGG9D1_TrackIsoTool)
154 HIGG9D1_JpsiVtxTrkIsoDecor = CompFactory.DerivationFramework.VertexTrackIsolation(
155 name =
"HIGG9D1_JpsiVtxTrkIsoDecor",
156 TrackIsoTool = HIGG9D1_TrackIsoTool,
157 TrackContainer =
"InDetTrackParticles",
158 InputVertexContainer =
"HIGG9D1_JpsiCandidates",
159 FixElecExclusion =
False,
161 acc.addPublicTool(HIGG9D1_JpsiVtxTrkIsoDecor)
163 HIGG9D1_UpsiVtxTrkIsoDecor = CompFactory.DerivationFramework.VertexTrackIsolation(
164 name =
"HIGG9D1_UpsiVtxTrkIsoDecor",
165 TrackIsoTool = HIGG9D1_TrackIsoTool,
166 TrackContainer =
"InDetTrackParticles",
167 InputVertexContainer =
"HIGG9D1_UpsiCandidates",
168 FixElecExclusion =
False,
170 acc.addPublicTool(HIGG9D1_UpsiVtxTrkIsoDecor)
173 from AthenaCommon.CFElements
import seqAND
174 acc.addSequence(
seqAND(
"HIGG9D1Sequence") )
177 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
178 acc.merge(
PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs[
'TriggerListsHelper']), sequenceName=
"HIGG9D1Sequence")
183 HIGG9D1_onia_skim = CompFactory.DerivationFramework.AnyVertexSkimmingTool(name =
"HIGG9D1_onia_skim", VertexContainerNames = [
"HIGG9D1_JpsiCandidates",
"HIGG9D1_UpsiCandidates"])
184 acc.addPublicTool(HIGG9D1_onia_skim)
186 HIGG9D1_onia_skimKernel = CompFactory.DerivationFramework.DerivationKernel(
187 "HIGG9D1_onia_skimKernel",
188 AugmentationTools = [ HIGG9D1_AugOriginalCounts, HIGG9D1_Jpsi, HIGG9D1_Upsi, HIGG9D1_JpsiVtxTrkIsoDecor, HIGG9D1_UpsiVtxTrkIsoDecor ],
189 SkimmingTools = [ HIGG9D1_onia_skim ])
191 acc.addEventAlgo(HIGG9D1_onia_skimKernel, sequenceName=
"HIGG9D1Sequence")
194 from DerivationFrameworkFlavourTag.FtagDerivationConfig
import JetCollectionsBTaggingCfg
203 HIGG9D1_smallR_EMPFlow_2j_sel =
"count(AntiKt4EMPFlowJets.pt > 18*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.8) >= 2"
204 HIGG9D1_smallR_EMPFlow_1j_sel =
"count(AntiKt4EMPFlowJets.pt > 33*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.8) >= 1"
209 HIGG9D1_smallR_EMPFlow_1b_sel =
"count(AntiKt4EMPFlowJets.pt > 18*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.8 && log(BTagging_AntiKt4EMPFlow.GN2v01_pb/(0.2*BTagging_AntiKt4EMPFlow.GN2v01_pc + (1.-0.2-0.01)*BTagging_AntiKt4EMPFlow.GN2v01_pu + 0.01*BTagging_AntiKt4EMPFlow.GN2v01_ptau))>=0.844) >= 1"
211 HIGG9D1_bjet_sel =
"%s && %s && %s" % (HIGG9D1_smallR_EMPFlow_2j_sel, HIGG9D1_smallR_EMPFlow_1j_sel, HIGG9D1_smallR_EMPFlow_1b_sel)
212 HIGG9D1_bb_skim = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"HIGG9D1_bb_skim", expression = HIGG9D1_bjet_sel)
213 acc.addPublicTool(HIGG9D1_bb_skim)
216 HIGG9D1_tauTrks =
'(TauJets.nTracks + TauJets.nTracksIsolation >= 1 && TauJets.nTracks + TauJets.nTracksIsolation <= 8)'
217 HIGG9D1_tauLead =
'(TauJets.pt > 23.0*GeV || TauJets.ptFinalCalib > 23.0*GeV)'
218 HIGG9D1_tauSubl =
'(TauJets.pt > 18.0*GeV || TauJets.ptFinalCalib > 18.0*GeV)'
219 HIGG9D1_tauId =
'TauJets.DFTauLoose'
220 HIGG9D1_tauReq0 =
'count( '+HIGG9D1_tauSubl+
' && '+HIGG9D1_tauTrks+
' ) >= 2'
221 HIGG9D1_tauReq1 =
'count( '+HIGG9D1_tauSubl+
' && '+HIGG9D1_tauTrks+
' && '+HIGG9D1_tauId+
' ) >= 1'
222 HIGG9D1_tauReq2 =
'count( '+HIGG9D1_tauLead+
' && '+HIGG9D1_tauTrks+
' ) >= 1'
223 HIGG9D1_tau_sel =
"%s && %s && %s" % (HIGG9D1_tauReq0, HIGG9D1_tauReq1, HIGG9D1_tauReq2)
225 HIGG9D1_tautau_skim = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"HIGG9D1_tautau_skim", expression = HIGG9D1_tau_sel)
226 acc.addPublicTool(HIGG9D1_tautau_skim)
229 from DerivationFrameworkHiggs.SkimmingToolHIGG1Config
import SkimmingToolHIGG1Cfg
232 name =
"HIGG9D1_yy_skim",
234 ReqireLArError =
True,
235 RequireTrigger =
False,
236 RequirePreselection =
True,
237 RequireKinematic =
False,
238 RequireQuality =
False,
239 RequireIsolation =
False,
240 RequireInvariantMass =
False,
241 IncludeSingleMergedElectronPreselection =
False,
242 IncludeSingleElectronPreselection =
False,
243 IncludeDoubleElectronPreselection =
False,
244 IncludeSingleMuonPreselection =
False,
245 IncludeDoubleMuonPreselection =
False,
246 IncludePhotonDoubleElectronPreselection =
False,
247 IncludePhotonMergedElectronPreselection =
False,
248 IncludeHighPtPhotonElectronPreselection =
False,
249 IncludeDoublePhotonPreselection =
True,
250 MinimumPhotonPt = 4800.0,
253 acc.addPublicTool(HIGG9D1_yy_skim)
256 HIGG9D1_bb_tautau_yy_skim = CompFactory.DerivationFramework.FilterCombinationOR(
257 name =
"HIGG9D1_bb_tautau_yy_skim",
258 FilterList = [HIGG9D1_bb_skim, HIGG9D1_tautau_skim, HIGG9D1_yy_skim])
259 acc.addPublicTool(HIGG9D1_bb_tautau_yy_skim)
262 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (CaloDecoratorKernelCfg, ClusterEnergyPerLayerDecoratorCfg)
266 augmentationTools = []
267 cluster_sizes = (3,5), (5,7), (7,7)
268 for neta, nphi
in cluster_sizes:
269 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
271 acc.addPublicTool(ClusterEnergyPerLayerDecorator)
272 augmentationTools.append(ClusterEnergyPerLayerDecorator)
274 HIGG9D1_bb_tautau_yy_skimKernel = CompFactory.DerivationFramework.DerivationKernel(
275 "HIGG9D1_bb_tautau_yy_skimKernel",
276 AugmentationTools = augmentationTools,
277 SkimmingTools = [ HIGG9D1_bb_tautau_yy_skim ])
279 acc.addEventAlgo(HIGG9D1_bb_tautau_yy_skimKernel, sequenceName=
"HIGG9D1Sequence")
283 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByAlgsCfg
284 acc.merge(
IsoCloseByAlgsCfg(flags, suff =
"_HIGG9D1", isPhysLite =
False, stream_name = kwargs[
'StreamName']), sequenceName=
"HIGG9D1Sequence")
287 from DerivationFrameworkEGamma.EGammaToolsConfig
import PhotonVertexSelectionWrapperKernelCfg
289 from DerivationFrameworkHiggs.HIGG1D1CustomVertexConfig
import DiphotonVertexDecoratorCfg
292 DiphotonVertexName =
"HIGG9D1_DiphotonPrimaryVertices"))
293 acc.addPublicTool(DiphotonVertexDecorator)
294 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(name =
"DiphotonVertexAugmentation", AugmentationTools = [DiphotonVertexDecorator]), sequenceName=
"HIGG9D1Sequence")
300 from DerivationFrameworkInDet.InDetToolsConfig
import (TrackParticleThinningCfg, MuonTrackParticleThinningCfg)
301 HIGG9D1TPthinning_expression =
"InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV"
304 name =
"HIGG9D1TrackParticleThinningTool",
305 StreamName = kwargs[
'StreamName'],
306 SelectionString = HIGG9D1TPthinning_expression,
307 InDetTrackParticlesKey =
"InDetTrackParticles"))
308 acc.addPublicTool(HIGG9D1TrackParticleThinningTool)
313 name =
"HIGG9D1MuonTPThinningTool",
314 StreamName = kwargs[
'StreamName'],
316 InDetTrackParticlesKey =
"InDetTrackParticles"))
317 acc.addPublicTool(HIGG9D1MuonTPThinningTool)
320 HIGG9D1ElectronTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
321 name =
"HIGG9D1ElectronTPThinningTool",
323 StreamName = kwargs[
'StreamName'],
324 InDetTrackParticlesKey =
"InDetTrackParticles")
325 acc.addPublicTool(HIGG9D1ElectronTPThinningTool)
328 from DerivationFrameworkInDet.InDetToolsConfig
import TauTrackParticleThinningCfg
331 name =
"HIGG9D1TauTPThinningTool",
332 StreamName = kwargs[
'StreamName'],
334 InDetTrackParticlesKey =
"InDetTrackParticles",
335 DoTauTracksThinning =
True,
336 TauTracksKey =
"TauTracks"))
339 HIGG9D1_ThinVtxTracks = CompFactory.DerivationFramework.Thin_vtxTrk(
340 name =
"HIGG9D1_ThinVtxTracks",
341 StreamName = kwargs[
'StreamName'],
342 TrackParticleContainerName =
"InDetTrackParticles",
343 VertexContainerNames = [ HIGG9D1_Jpsi.OutputVtxContainerName, HIGG9D1_Upsi.OutputVtxContainerName ],
345 acc.addPublicTool(HIGG9D1_ThinVtxTracks)
348 HIGG9D1_ThinPV = CompFactory.DerivationFramework.BPhysPVThinningTool(
349 name =
"HIGG9D1_ThinPV",
350 CandidateCollections = [ HIGG9D1_Jpsi.OutputVtxContainerName, HIGG9D1_Upsi.OutputVtxContainerName ],
351 StreamName = kwargs[
'StreamName'],
353 acc.addPublicTool(HIGG9D1_ThinPV)
355 thinningTools = [HIGG9D1TrackParticleThinningTool,
356 HIGG9D1MuonTPThinningTool,
357 HIGG9D1ElectronTPThinningTool,
358 HIGG9D1TauTPThinningTool,
359 HIGG9D1_ThinVtxTracks,
364 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig
import MenuTruthThinningCfg
367 name =
"HIGG9D1TruthTool",
368 StreamName = kwargs[
'StreamName'],
369 ParticlesKey =
"TruthParticles",
370 VerticesKey =
"TruthVertices",
371 EventsKey =
"TruthEvents",
372 WritePartons =
False,
374 WriteBHadrons =
True,
375 WriteCHadrons =
True,
380 WriteBSMProducts =
True,
381 WriteBosonProducts =
False,
382 WriteTopAndDecays =
True,
383 WriteEverything =
False,
384 WriteAllLeptons =
True,
385 WriteNotPhysical =
False,
386 PreserveDescendants =
False,
387 PreserveGeneratorDescendants =
True,
388 PreserveAncestors =
True))
389 acc.addPublicTool(HIGG9D1TruthTool)
390 thinningTools.append(HIGG9D1TruthTool)
395 from DerivationFrameworkMCTruth.HFClassificationCommonConfig
import HFClassificationCommonCfg
399 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, ThinningTools = thinningTools), sequenceName=
"HIGG9D1Sequence")