7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
13 """Configure the skimming tool"""
16 from DerivationFrameworkJetEtMiss
import TriggerLists
17 electronTriggers = TriggerLists.single_el_Trig(flags)
18 muonTriggers = TriggerLists.single_mu_Trig(flags)
19 photonTriggers = TriggerLists.single_photon_Trig(flags)
21 jetTriggers = TriggerLists.get_jetTrig(flags)
24 jetsofflinesel =
'(count( AntiKt10LCTopoJets.pt > 400.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 400.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
26 jetsofflinesel =
'(count( AntiKt10LCTopoJets.pt > 180.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 180.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
29 jetsel_lep =
'(count( AntiKt10LCTopoJets.pt > 150.*GeV && abs(AntiKt10LCTopoJets.eta) < 2.5 ) >=1 || count( AntiKt10UFOCSSKJets.pt > 150.*GeV && abs(AntiKt10UFOCSSKJets.eta) < 2.5 ) >= 1)'
30 elofflinesel = andstr.join([
'count((Electrons.pt > 20*GeV) && (Electrons.DFCommonElectronsLHLoose)) >= 1',jetsel_lep])
31 muofflinesel = andstr.join([
'count((Muons.pt > 20*GeV) && (Muons.DFCommonMuonPassPreselection)) >= 1',jetsel_lep])
32 gammaofflinesel = andstr.join([
'count(Photons.pt > 150*GeV) >= 1',jetsel_lep])
36 JETM6OfflineSkimmingTool_ele = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_ele",
37 expression = elofflinesel,
39 JETM6OfflineSkimmingTool_mu = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_mu",
40 expression = muofflinesel,
42 JETM6OfflineSkimmingTool_gamma = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_gamma",
43 expression = gammaofflinesel,
45 JETM6OfflineSkimmingTool_jets = CompFactory.DerivationFramework.xAODStringSkimmingTool( name =
"JETM6OfflineSkimmingTool_jets",
46 expression = jetsofflinesel,
49 acc.addPublicTool(JETM6OfflineSkimmingTool_ele)
50 acc.addPublicTool(JETM6OfflineSkimmingTool_mu)
51 acc.addPublicTool(JETM6OfflineSkimmingTool_gamma)
52 acc.addPublicTool(JETM6OfflineSkimmingTool_jets)
54 if not flags.Input.isMC:
55 JETM6TriggerSkimmingTool_ele = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_ele", TriggerListOR = electronTriggers)
56 acc.addPublicTool(JETM6TriggerSkimmingTool_ele)
57 JETM6TriggerSkimmingTool_mu = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_mu", TriggerListOR = muonTriggers)
58 acc.addPublicTool(JETM6TriggerSkimmingTool_mu)
59 JETM6TriggerSkimmingTool_gamma = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_gamma", TriggerListOR = photonTriggers)
60 acc.addPublicTool(JETM6TriggerSkimmingTool_gamma)
61 JETM6TriggerSkimmingTool_jets = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"JETM6TriggerSkimmingTool_jets", TriggerListOR = jetTriggers)
62 acc.addPublicTool(JETM6TriggerSkimmingTool_jets)
65 JETM6SkimmingTool_ele = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_ele", FilterList=[JETM6OfflineSkimmingTool_ele, JETM6TriggerSkimmingTool_ele] )
66 JETM6SkimmingTool_mu = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_mu", FilterList=[JETM6OfflineSkimmingTool_mu, JETM6TriggerSkimmingTool_mu] )
67 JETM6SkimmingTool_gamma = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_gamma", FilterList=[JETM6OfflineSkimmingTool_gamma, JETM6TriggerSkimmingTool_gamma] )
68 JETM6SkimmingTool_jets = CompFactory.DerivationFramework.FilterCombinationAND(name=
"JETM6SkimmingTool_jets", FilterList=[JETM6OfflineSkimmingTool_jets, JETM6TriggerSkimmingTool_jets] )
70 acc.addPublicTool(JETM6SkimmingTool_ele)
71 acc.addPublicTool(JETM6SkimmingTool_mu)
72 acc.addPublicTool(JETM6SkimmingTool_gamma)
73 acc.addPublicTool(JETM6SkimmingTool_jets)
76 JETM6SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name=
"JETM6SkimmingTool",
77 FilterList=[JETM6SkimmingTool_ele, JETM6SkimmingTool_mu, JETM6SkimmingTool_gamma, JETM6SkimmingTool_jets])
78 acc.addPublicTool(JETM6SkimmingTool, primary =
True)
81 JETM6SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(
82 name=
"JETM6SkimmingTool",
83 FilterList=[JETM6OfflineSkimmingTool_ele,JETM6OfflineSkimmingTool_mu,JETM6OfflineSkimmingTool_gamma,JETM6OfflineSkimmingTool_jets])
85 acc.addPublicTool(JETM6SkimmingTool, primary =
True)
92 """Configure the derivation framework driving algorithm (kernel) for JETM6"""
96 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
99 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
102 name =
"DFJETM6CommonTrackSelectionLoose",
104 DecorationName =
"DFJETM6Loose"))
106 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
"JETM6CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
112 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg, TauTrackParticleThinningCfg
115 JETM6_thinning_expression =
"InDetTrackParticles.DFJETM6Loose && (InDetTrackParticles.pt > 0.5*GeV) && (abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm) && (abs(InDetTrackParticles.d0) < 5.0*mm)"
118 name =
"JETM6TrackParticleThinningTool",
119 StreamName = kwargs[
'StreamName'],
120 SelectionString = JETM6_thinning_expression,
121 InDetTrackParticlesKey =
"InDetTrackParticles"))
127 name =
"JETM6Akt4PFlowJetTPThinningTool",
128 StreamName = kwargs[
'StreamName'],
129 JetKey =
"AntiKt4EMPFlowJets",
130 SelectionString =
"AntiKt4EMPFlowJets.pt > 15*GeV",
131 InDetTrackParticlesKey =
"InDetTrackParticles"))
135 name =
"JETM6Akt10LCJetTPThinningTool",
136 StreamName = kwargs[
'StreamName'],
137 JetKey =
"AntiKt10LCTopoJets",
138 SelectionString =
"AntiKt10LCTopoJets.pt > 150*GeV",
139 InDetTrackParticlesKey =
"InDetTrackParticles"))
143 name =
"JETM6Akt10UFOJetTPThinningTool",
144 StreamName = kwargs[
'StreamName'],
145 JetKey =
"AntiKt10UFOCSSKJets",
146 SelectionString =
"AntiKt10UFOCSSKJets.pt > 150*GeV",
147 InDetTrackParticlesKey =
"InDetTrackParticles"))
152 name =
"JETM6MuonTPThinningTool",
153 StreamName = kwargs[
'StreamName'],
155 InDetTrackParticlesKey =
"InDetTrackParticles"))
160 name =
"JETM6ElectronTPThinningTool",
161 StreamName = kwargs[
'StreamName'],
163 InDetTrackParticlesKey =
"InDetTrackParticles"))
168 name =
"JETM6TauTPThinningTool",
169 StreamName = kwargs[
'StreamName'],
171 InDetTrackParticlesKey =
"InDetTrackParticles",
172 DoTauTracksThinning =
True,
173 TauTracksKey =
"TauTracks"))
175 thinningTools = [JETM6TrackParticleThinningTool,
176 JETM6MuonTPThinningTool,
177 JETM6ElectronTPThinningTool,
178 JETM6TauTPThinningTool,
179 JETM6Akt10LCJetTPThinningTool,
180 JETM6Akt10UFOJetTPThinningTool,
181 JETM6Akt4PFlowJetTPThinningTool]
184 JETM6TruthJetInputThin = CompFactory.DerivationFramework.ViewContainerThinning( name =
"JETM6ViewContThinning",
185 StreamName = kwargs[
'StreamName'],
186 TruthParticleKey =
"TruthParticles",
187 TruthParticleViewKey =
"JetInputTruthParticles")
189 acc.addPublicTool(JETM6TruthJetInputThin)
190 thinningTools.append(JETM6TruthJetInputThin)
193 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
195 ThinningTools = thinningTools,
196 SkimmingTools = [skimmingTool]))
214 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg, AddTruthCollectionNavigationDecorationsCfg
225 if flags.Trigger.EDMVersion == 2:
226 triggerNames = [
"JetContainer_a4tcemsubjesFS",
"JetContainer_a4tcemsubjesISFS",
"JetContainer_a10tclcwsubjesFS",
"JetContainer_GSCJet"]
228 for trigger
in triggerNames:
229 wrapperName = trigger+
'AuxWrapper'
230 auxContainerName =
'HLT_xAOD__'+trigger+
'Aux'
232 acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+
"." ] ))
245 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
246 JETM6TriggerListsHelper = TriggerListsHelper(flags)
249 acc.merge(
JETM6KernelCfg(flags, name=
"JETM6Kernel", StreamName =
'StreamDAOD_JETM6', TriggerListsHelper = JETM6TriggerListsHelper))
254 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
255 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
256 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
258 JETM6SlimmingHelper =
SlimmingHelper(
"JETM6SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
260 JETM6SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
261 "Electrons",
"Photons",
"Muons",
"TauJets",
262 "MET_Baseline_AntiKt4EMPFlow",
263 "AntiKt4EMPFlowJets",
264 "AntiKt10LCTopoJets",
"AntiKt10UFOCSSKJets",
265 "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
266 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
267 "BTagging_AntiKtVR30Rmax4Rmin02Track",
268 "BTagging_AntiKt4EMPFlow"]
270 JETM6SlimmingHelper.AllVariables = [
"Kt4EMPFlowEventShape",
"Kt4EMPFlowPUSBEventShape",
"UFOCSSK"]
271 JETM6SlimmingHelper.ExtraVariables = [
'CaloCalTopoClusters.calE.calEta.calM.calPhi.CENTER_MAG',
272 'GlobalChargedParticleFlowObjects.chargedObjectLinks'
273 'GlobalNeutralParticleFlowObjects.chargedObjectLinks'
274 'CSSKGChargedParticleFlowObjects.pt.eta.phi.m.matchedToPV.originalObjectLink'
275 'CSSKGNeutralParticleFlowObjects.pt.eta.phi.m.originalObjectLink',
276 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.SizeParameter',
277 'AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.SizeParameter',
278 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets.SizeParameter',
279 'AntiKt10TruthSoftDropBeta100Zcut10Jets.SizeParameter']
284 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
287 JETM6SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
288 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
290 JETM6SlimmingHelper.AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
"TruthHFWithDecayParticles"]
291 JETM6SlimmingHelper.SmartCollections += [
"AntiKt4TruthJets",
"AntiKt10TruthJets"]
294 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addOriginCorrectedClustersToSlimmingTool
297 JETM6SlimmingHelper.AppendToDictionary.update({
"CSSKGChargedParticleFlowObjects":
'xAOD::FlowElementContainer',
298 "CSSKGChargedParticleFlowObjectsAux":
'xAOD::ShallowAuxContainer',
299 "CSSKGNeutralParticleFlowObjects":
'xAOD::FlowElementContainer',
300 "CSSKGNeutralParticleFlowObjectsAux":
'xAOD::ShallowAuxContainer'})
303 JETM6SlimmingHelper.IncludeTriggerNavigation =
False
304 JETM6SlimmingHelper.IncludeJetTriggerContent =
True
305 JETM6SlimmingHelper.IncludeMuonTriggerContent =
True
306 JETM6SlimmingHelper.IncludeEGammaTriggerContent =
True
307 JETM6SlimmingHelper.IncludeTauTriggerContent =
False
308 JETM6SlimmingHelper.IncludeEtMissTriggerContent =
False
309 JETM6SlimmingHelper.IncludeBJetTriggerContent =
False
310 JETM6SlimmingHelper.IncludeBPhysTriggerContent =
False
311 JETM6SlimmingHelper.IncludeMinBiasTriggerContent =
False
315 if flags.Trigger.EDMVersion == 2:
316 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
318 OutputContainerPrefix =
"TrigMatch_",
319 TriggerList = JETM6TriggerListsHelper.Run2TriggerNamesTau)
321 OutputContainerPrefix =
"TrigMatch_",
322 TriggerList = JETM6TriggerListsHelper.Run2TriggerNamesNoTau)
324 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
325 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
329 JETM6ItemList = JETM6SlimmingHelper.GetItemList()
330 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM6", ItemList=JETM6ItemList, AcceptAlgs=[
"JETM6Kernel"]))
331 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM6", AcceptAlgs=[
"JETM6Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))