7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
13 """Configure the skimming tool"""
16 expression =
'( HLT_noalg_zb_L1ZB || HLT_noalg_L1ZB )'
17 JETM5SkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"JETM5SkimmingTool1",
18 expression = expression)
20 acc.addPublicTool(JETM5SkimmingTool, primary =
True)
27 """Configure the derivation framework driving algorithm (kernel) for JETM5"""
31 if not flags.Input.isMC:
35 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
39 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg
44 name =
"JETM5MuonTPThinningTool",
45 StreamName = kwargs[
'StreamName'],
47 InDetTrackParticlesKey =
"InDetTrackParticles"))
52 name =
"JETM5ElectronTPThinningTool",
53 StreamName = kwargs[
'StreamName'],
55 InDetTrackParticlesKey =
"InDetTrackParticles"))
60 name =
"JETM5PhotonTPThinningTool",
61 StreamName = kwargs[
'StreamName'],
63 InDetTrackParticlesKey =
"InDetTrackParticles",
64 GSFConversionVerticesKey =
"GSFConversionVertices"))
67 thinningTools = [JETM5MuonTPThinningTool,
68 JETM5ElectronTPThinningTool,
69 JETM5PhotonTPThinningTool]
73 truth_cond_WZH =
"((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))"
74 truth_cond_Lepton =
"((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && (TruthParticles.barcode < 200000))"
75 truth_cond_Quark =
"((abs(TruthParticles.pdgId) <= 5 && (TruthParticles.pt > 10000.)) || (abs(TruthParticles.pdgId) == 6))"
76 truth_cond_Gluon =
"((abs(TruthParticles.pdgId) == 21) && (TruthParticles.pt > 10000.))"
77 truth_cond_Photon =
"((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 10000.) && (TruthParticles.barcode < 200000))"
79 truth_expression =
'('+truth_cond_WZH+
' || '+truth_cond_Lepton +
' || '+truth_cond_Quark+
'||'+truth_cond_Gluon+
' || '+truth_cond_Photon+
')'
81 preserveAllDescendants =
False
83 JETM5TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name =
"JETM5TruthThinningTool",
84 StreamName = kwargs[
'StreamName'],
85 ParticleSelectionString = truth_expression,
86 PreserveDescendants = preserveAllDescendants,
87 PreserveGeneratorDescendants =
not preserveAllDescendants,
88 PreserveAncestors =
True)
90 acc.addPublicTool(JETM5TruthThinningTool)
91 thinningTools.append(JETM5TruthThinningTool)
94 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
96 ThinningTools = thinningTools,
97 SkimmingTools = [skimmingTool]
if not flags.Input.isMC
else []))
101 from DerivationFrameworkJetEtMiss.PFlowCommonConfig
import PFlowCommonCfg
115 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
116 JETM5TriggerListsHelper = TriggerListsHelper(flags)
119 acc.merge(
JETM5KernelCfg(flags, name=
"JETM5Kernel", StreamName =
'StreamDAOD_JETM5', TriggerListsHelper = JETM5TriggerListsHelper))
124 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
125 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
126 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
128 JETM5SlimmingHelper =
SlimmingHelper(
"JETM5SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
130 JETM5SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
131 "Electrons",
"Photons",
"Muons",
"TauJets",
132 "MET_Baseline_AntiKt4EMTopo",
"MET_Baseline_AntiKt4EMPFlow",
133 "AntiKt4EMTopoJets",
"AntiKt4EMPFlowJets",
134 "BTagging_AntiKt4EMPFlow"]
136 JETM5SlimmingHelper.AllVariables = [
"CaloCalTopoClusters",
138 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
139 "GlobalNeutralParticleFlowObjects",
"GlobalChargedParticleFlowObjects",
140 "CHSGChargedParticleFlowObjects",
"CHSGNeutralParticleFlowObjects",
144 JETM5SlimmingHelper.ExtraVariables += [
"AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1"]
147 JETM5SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
148 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer',
149 'TruthVertices':
'xAOD::TruthVertexContainer',
150 'TruthVerticesAux':
'xAOD::TruthVertexAuxContainer'})
152 JETM5SlimmingHelper.AllVariables += [
"MuonTruthParticles",
"egammaTruthParticles",
153 "TruthParticles",
"TruthEvents",
"TruthVertices"]
156 JETM5SlimmingHelper.IncludeTriggerNavigation =
False
157 JETM5SlimmingHelper.IncludeJetTriggerContent =
False
158 JETM5SlimmingHelper.IncludeMuonTriggerContent =
False
159 JETM5SlimmingHelper.IncludeEGammaTriggerContent =
False
160 JETM5SlimmingHelper.IncludeJetTauEtMissTriggerContent =
False
161 JETM5SlimmingHelper.IncludeTauTriggerContent =
False
162 JETM5SlimmingHelper.IncludeEtMissTriggerContent =
False
163 JETM5SlimmingHelper.IncludeBJetTriggerContent =
False
164 JETM5SlimmingHelper.IncludeBPhysTriggerContent =
False
165 JETM5SlimmingHelper.IncludeMinBiasTriggerContent =
False
168 JETM5ItemList = JETM5SlimmingHelper.GetItemList()
169 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM5", ItemList=JETM5ItemList, AcceptAlgs=[
"JETM5Kernel"]))
170 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM5", AcceptAlgs=[
"JETM5Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))