6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from AthenaConfiguration.Enums
import MetadataCategory
12 """Configure the skimming tool"""
15 expression =
'( HLT_noalg_zb_L1ZB || HLT_noalg_L1ZB )'
16 JETM5SkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"JETM5SkimmingTool1",
17 expression = expression)
19 acc.addPublicTool(JETM5SkimmingTool, primary =
True)
26 """Configure the derivation framework driving algorithm (kernel) for JETM5"""
30 if not flags.Input.isMC:
34 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
38 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg
43 name =
"JETM5MuonTPThinningTool",
44 StreamName = kwargs[
'StreamName'],
46 InDetTrackParticlesKey =
"InDetTrackParticles"))
51 name =
"JETM5ElectronTPThinningTool",
52 StreamName = kwargs[
'StreamName'],
54 InDetTrackParticlesKey =
"InDetTrackParticles"))
59 name =
"JETM5PhotonTPThinningTool",
60 StreamName = kwargs[
'StreamName'],
62 InDetTrackParticlesKey =
"InDetTrackParticles",
63 GSFConversionVerticesKey =
"GSFConversionVertices"))
66 thinningTools = [JETM5MuonTPThinningTool,
67 JETM5ElectronTPThinningTool,
68 JETM5PhotonTPThinningTool]
72 truth_cond_WZH =
"((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))"
73 truth_cond_Lepton =
"((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && (TruthParticles.barcode < 200000))"
74 truth_cond_Quark =
"((abs(TruthParticles.pdgId) <= 5 && (TruthParticles.pt > 10000.)) || (abs(TruthParticles.pdgId) == 6))"
75 truth_cond_Gluon =
"((abs(TruthParticles.pdgId) == 21) && (TruthParticles.pt > 10000.))"
76 truth_cond_Photon =
"((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 10000.) && (TruthParticles.barcode < 200000))"
78 truth_expression =
'('+truth_cond_WZH+
' || '+truth_cond_Lepton +
' || '+truth_cond_Quark+
'||'+truth_cond_Gluon+
' || '+truth_cond_Photon+
')'
80 preserveAllDescendants =
False
82 JETM5TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name =
"JETM5TruthThinningTool",
83 StreamName = kwargs[
'StreamName'],
84 ParticleSelectionString = truth_expression,
85 PreserveDescendants = preserveAllDescendants,
86 PreserveGeneratorDescendants =
not preserveAllDescendants,
87 PreserveAncestors =
True)
89 acc.addPublicTool(JETM5TruthThinningTool)
90 thinningTools.append(JETM5TruthThinningTool)
93 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
95 ThinningTools = thinningTools,
96 SkimmingTools = [skimmingTool]
if not flags.Input.isMC
else []))
100 from DerivationFrameworkJetEtMiss.PFlowCommonConfig
import PFlowCommonCfg
114 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
115 JETM5TriggerListsHelper = TriggerListsHelper(flags)
118 acc.merge(
JETM5KernelCfg(flags, name=
"JETM5Kernel", StreamName =
'StreamDAOD_JETM5', TriggerListsHelper = JETM5TriggerListsHelper))
123 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
124 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
125 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
127 JETM5SlimmingHelper =
SlimmingHelper(
"JETM5SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
129 JETM5SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
130 "Electrons",
"Photons",
"Muons",
"TauJets",
131 "MET_Baseline_AntiKt4EMTopo",
"MET_Baseline_AntiKt4EMPFlow",
132 "AntiKt4EMTopoJets",
"AntiKt4EMPFlowJets",
133 "BTagging_AntiKt4EMPFlow"]
135 JETM5SlimmingHelper.AllVariables = [
"CaloCalTopoClusters",
137 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
138 "GlobalNeutralParticleFlowObjects",
"GlobalChargedParticleFlowObjects",
139 "CHSGChargedParticleFlowObjects",
"CHSGNeutralParticleFlowObjects",
143 JETM5SlimmingHelper.ExtraVariables += [
"AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1"]
146 JETM5SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
147 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer',
148 'TruthVertices':
'xAOD::TruthVertexContainer',
149 'TruthVerticesAux':
'xAOD::TruthVertexAuxContainer'})
151 JETM5SlimmingHelper.AllVariables += [
"MuonTruthParticles",
"egammaTruthParticles",
152 "TruthParticles",
"TruthEvents",
"TruthVertices"]
155 JETM5SlimmingHelper.IncludeTriggerNavigation =
False
156 JETM5SlimmingHelper.IncludeJetTriggerContent =
False
157 JETM5SlimmingHelper.IncludeMuonTriggerContent =
False
158 JETM5SlimmingHelper.IncludeEGammaTriggerContent =
False
159 JETM5SlimmingHelper.IncludeTauTriggerContent =
False
160 JETM5SlimmingHelper.IncludeEtMissTriggerContent =
False
161 JETM5SlimmingHelper.IncludeBJetTriggerContent =
False
162 JETM5SlimmingHelper.IncludeBPhysTriggerContent =
False
163 JETM5SlimmingHelper.IncludeMinBiasTriggerContent =
False
166 JETM5ItemList = JETM5SlimmingHelper.GetItemList()
167 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM5", ItemList=JETM5ItemList, AcceptAlgs=[
"JETM5Kernel"]))
168 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM5", AcceptAlgs=[
"JETM5Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))