6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from AthenaConfiguration.Enums
import MetadataCategory
12 """Configure the skimming tool"""
15 from DerivationFrameworkJetEtMiss
import TriggerLists
16 electronTriggers = TriggerLists.single_el_Trig(flags)
17 muonTriggers = TriggerLists.single_mu_Trig(flags)
18 photonTriggers = TriggerLists.single_photon_Trig(flags)
20 jetTriggers = TriggerLists.get_jetTrig(flags)
23 jetsofflinesel =
'(count( AntiKt10LCTopoJets.pt > 400.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 400.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
25 jetsofflinesel =
'(count( AntiKt10LCTopoJets.pt > 180.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 180.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
28 jetsel_lep =
'(count( AntiKt10LCTopoJets.pt > 150.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 150.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
29 elofflinesel = andstr.join([
'count((Electrons.pt > 20*GeV) && (Electrons.DFCommonElectronsLHLoose)) >= 1',jetsel_lep])
30 muofflinesel = andstr.join([
'count((Muons.pt > 20*GeV) && (Muons.DFCommonMuonPassPreselection)) >= 1',jetsel_lep])
31 gammaofflinesel = andstr.join([
'count(Photons.pt > 150*GeV) >= 1',jetsel_lep])
35 JETM6OfflineSkimmingTool_ele = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_ele",
36 expression = elofflinesel,
38 JETM6OfflineSkimmingTool_mu = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_mu",
39 expression = muofflinesel,
41 JETM6OfflineSkimmingTool_gamma = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_gamma",
42 expression = gammaofflinesel,
44 JETM6OfflineSkimmingTool_jets = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_jets",
45 expression = jetsofflinesel,
48 acc.addPublicTool(JETM6OfflineSkimmingTool_ele)
49 acc.addPublicTool(JETM6OfflineSkimmingTool_mu)
50 acc.addPublicTool(JETM6OfflineSkimmingTool_gamma)
51 acc.addPublicTool(JETM6OfflineSkimmingTool_jets)
53 if not flags.Input.isMC:
54 JETM6TriggerSkimmingTool_ele = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_ele", TriggerListOR = electronTriggers)
55 acc.addPublicTool(JETM6TriggerSkimmingTool_ele)
56 JETM6TriggerSkimmingTool_mu = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_mu", TriggerListOR = muonTriggers)
57 acc.addPublicTool(JETM6TriggerSkimmingTool_mu)
58 JETM6TriggerSkimmingTool_gamma = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_gamma", TriggerListOR = photonTriggers)
59 acc.addPublicTool(JETM6TriggerSkimmingTool_gamma)
60 JETM6TriggerSkimmingTool_jets = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_jets", TriggerListOR = jetTriggers)
61 acc.addPublicTool(JETM6TriggerSkimmingTool_jets)
64 JETM6SkimmingTool_ele = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_ele", FilterList=[JETM6OfflineSkimmingTool_ele, JETM6TriggerSkimmingTool_ele] )
65 JETM6SkimmingTool_mu = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_mu", FilterList=[JETM6OfflineSkimmingTool_mu, JETM6TriggerSkimmingTool_mu] )
66 JETM6SkimmingTool_gamma = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_gamma", FilterList=[JETM6OfflineSkimmingTool_gamma, JETM6TriggerSkimmingTool_gamma] )
67 JETM6SkimmingTool_jets = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_jets", FilterList=[JETM6OfflineSkimmingTool_jets, JETM6TriggerSkimmingTool_jets] )
69 acc.addPublicTool(JETM6SkimmingTool_ele)
70 acc.addPublicTool(JETM6SkimmingTool_mu)
71 acc.addPublicTool(JETM6SkimmingTool_gamma)
72 acc.addPublicTool(JETM6SkimmingTool_jets)
75 JETM6SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name=
"JETM6SkimmingTool",
76 FilterList=[JETM6SkimmingTool_ele, JETM6SkimmingTool_mu, JETM6SkimmingTool_gamma, JETM6SkimmingTool_jets])
77 acc.addPublicTool(JETM6SkimmingTool, primary =
True)
80 JETM6SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(
81 name=
"JETM6SkimmingTool",
82 FilterList=[JETM6OfflineSkimmingTool_ele,JETM6OfflineSkimmingTool_mu,JETM6OfflineSkimmingTool_gamma,JETM6OfflineSkimmingTool_jets])
84 acc.addPublicTool(JETM6SkimmingTool, primary =
True)
91 """Configure the derivation framework driving algorithm (kernel) for JETM6"""
95 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
98 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
101 name =
"DFJETM6CommonTrackSelectionLoose",
103 DecorationName =
"DFJETM6Loose"))
105 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"JETM6CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
111 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg, TauTrackParticleThinningCfg
114 JETM6_thinning_expression =
"InDetTrackParticles.DFJETM6Loose && (InDetTrackParticles.pt > 0.5*GeV) && (abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm) && (abs(InDetTrackParticles.d0) < 5.0*mm)"
117 name =
"JETM6TrackParticleThinningTool",
118 StreamName = kwargs[
'StreamName'],
119 SelectionString = JETM6_thinning_expression,
120 InDetTrackParticlesKey =
"InDetTrackParticles"))
126 name =
"JETM6Akt4PFlowJetTPThinningTool",
127 StreamName = kwargs[
'StreamName'],
128 JetKey =
"AntiKt4EMPFlowJets",
129 SelectionString =
"AntiKt4EMPFlowJets.pt > 15*GeV",
130 InDetTrackParticlesKey =
"InDetTrackParticles"))
134 name =
"JETM6Akt10LCJetTPThinningTool",
135 StreamName = kwargs[
'StreamName'],
136 JetKey =
"AntiKt10LCTopoJets",
137 SelectionString =
"AntiKt10LCTopoJets.pt > 150*GeV",
138 InDetTrackParticlesKey =
"InDetTrackParticles"))
142 name =
"JETM6Akt10UFOJetTPThinningTool",
143 StreamName = kwargs[
'StreamName'],
144 JetKey =
"AntiKt10UFOCSSKJets",
145 SelectionString =
"AntiKt10UFOCSSKJets.pt > 150*GeV",
146 InDetTrackParticlesKey =
"InDetTrackParticles"))
151 name =
"JETM6MuonTPThinningTool",
152 StreamName = kwargs[
'StreamName'],
154 InDetTrackParticlesKey =
"InDetTrackParticles"))
159 name =
"JETM6ElectronTPThinningTool",
160 StreamName = kwargs[
'StreamName'],
162 InDetTrackParticlesKey =
"InDetTrackParticles"))
167 name =
"JETM6TauTPThinningTool",
168 StreamName = kwargs[
'StreamName'],
170 InDetTrackParticlesKey =
"InDetTrackParticles",
171 DoTauTracksThinning =
True,
172 TauTracksKey =
"TauTracks"))
174 thinningTools = [JETM6TrackParticleThinningTool,
175 JETM6MuonTPThinningTool,
176 JETM6ElectronTPThinningTool,
177 JETM6TauTPThinningTool,
178 JETM6Akt10LCJetTPThinningTool,
179 JETM6Akt10UFOJetTPThinningTool,
180 JETM6Akt4PFlowJetTPThinningTool]
183 JETM6TruthJetInputThin = CompFactory.DerivationFramework.ViewContainerThinning( name =
"JETM6ViewContThinning",
184 StreamName = kwargs[
'StreamName'],
185 TruthParticleKey =
"TruthParticles",
186 TruthParticleViewKey =
"JetInputTruthParticles")
188 acc.addPublicTool(JETM6TruthJetInputThin)
189 thinningTools.append(JETM6TruthJetInputThin)
192 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
194 ThinningTools = thinningTools,
195 SkimmingTools = [skimmingTool]))
213 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg, AddTruthCollectionNavigationDecorationsCfg
224 if flags.Trigger.EDMVersion == 2:
225 triggerNames = [
"JetContainer_a4tcemsubjesFS",
"JetContainer_a4tcemsubjesISFS",
"JetContainer_a10tclcwsubjesFS",
"JetContainer_GSCJet"]
227 for trigger
in triggerNames:
228 wrapperName = trigger+
'AuxWrapper'
229 auxContainerName =
'HLT_xAOD__'+trigger+
'Aux'
231 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+
"." ] ))
244 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
245 JETM6TriggerListsHelper = TriggerListsHelper(flags)
248 acc.merge(
JETM6KernelCfg(flags, name=
"JETM6Kernel", StreamName =
'StreamDAOD_JETM6', TriggerListsHelper = JETM6TriggerListsHelper))
253 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
254 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
255 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
257 JETM6SlimmingHelper =
SlimmingHelper(
"JETM6SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
259 JETM6SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
260 "Electrons",
"Photons",
"Muons",
"TauJets",
261 "MET_Baseline_AntiKt4EMPFlow",
262 "AntiKt4EMPFlowJets",
263 "AntiKt10LCTopoJets",
"AntiKt10UFOCSSKJets",
264 "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
265 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
266 "BTagging_AntiKtVR30Rmax4Rmin02Track",
267 "BTagging_AntiKt4EMPFlow"]
269 JETM6SlimmingHelper.AllVariables = [
"Kt4EMPFlowEventShape",
"Kt4EMPFlowPUSBEventShape",
"UFOCSSK"]
270 JETM6SlimmingHelper.ExtraVariables = [
'CaloCalTopoClusters.calE.calEta.calM.calPhi.CENTER_MAG',
271 'GlobalChargedParticleFlowObjects.chargedObjectLinks'
272 'GlobalNeutralParticleFlowObjects.chargedObjectLinks'
273 'CSSKGChargedParticleFlowObjects.pt.eta.phi.m.matchedToPV.originalObjectLink'
274 'CSSKGNeutralParticleFlowObjects.pt.eta.phi.m.originalObjectLink',
275 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.SizeParameter',
276 'AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.SizeParameter',
277 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets.SizeParameter',
278 'AntiKt10TruthSoftDropBeta100Zcut10Jets.SizeParameter']
283 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
286 JETM6SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
287 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
289 JETM6SlimmingHelper.AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
"TruthHFWithDecayParticles"]
290 JETM6SlimmingHelper.SmartCollections += [
"AntiKt4TruthJets",
"AntiKt10TruthJets"]
293 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addOriginCorrectedClustersToSlimmingTool
296 JETM6SlimmingHelper.AppendToDictionary.update({
"CSSKGChargedParticleFlowObjects":
'xAOD::FlowElementContainer',
297 "CSSKGChargedParticleFlowObjectsAux":
'xAOD::ShallowAuxContainer',
298 "CSSKGNeutralParticleFlowObjects":
'xAOD::FlowElementContainer',
299 "CSSKGNeutralParticleFlowObjectsAux":
'xAOD::ShallowAuxContainer'})
302 JETM6SlimmingHelper.IncludeTriggerNavigation =
False
303 JETM6SlimmingHelper.IncludeJetTriggerContent =
True
304 JETM6SlimmingHelper.IncludeMuonTriggerContent =
True
305 JETM6SlimmingHelper.IncludeEGammaTriggerContent =
True
306 JETM6SlimmingHelper.IncludeTauTriggerContent =
False
307 JETM6SlimmingHelper.IncludeEtMissTriggerContent =
False
308 JETM6SlimmingHelper.IncludeBJetTriggerContent =
False
309 JETM6SlimmingHelper.IncludeBPhysTriggerContent =
False
310 JETM6SlimmingHelper.IncludeMinBiasTriggerContent =
False
314 if flags.Trigger.EDMVersion == 2:
315 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
317 OutputContainerPrefix =
"TrigMatch_",
318 TriggerList = JETM6TriggerListsHelper.Run2TriggerNamesTau)
320 OutputContainerPrefix =
"TrigMatch_",
321 TriggerList = JETM6TriggerListsHelper.Run2TriggerNamesNoTau)
323 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
324 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
328 JETM6ItemList = JETM6SlimmingHelper.GetItemList()
329 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM6", ItemList=JETM6ItemList, AcceptAlgs=[
"JETM6Kernel"]))
330 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM6", AcceptAlgs=[
"JETM6Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))