22 """Configure the derivation framework driving algorithm (kernel) for JETM5"""
23 acc = ComponentAccumulator()
26 if not flags.Input.isMC:
30 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
31 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs[
'TriggerListsHelper']))
34 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg
37 JETM5MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
39 name =
"JETM5MuonTPThinningTool",
40 StreamName = kwargs[
'StreamName'],
42 InDetTrackParticlesKey =
"InDetTrackParticles"))
45 JETM5ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
47 name =
"JETM5ElectronTPThinningTool",
48 StreamName = kwargs[
'StreamName'],
50 InDetTrackParticlesKey =
"InDetTrackParticles"))
53 JETM5PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
55 name =
"JETM5PhotonTPThinningTool",
56 StreamName = kwargs[
'StreamName'],
58 InDetTrackParticlesKey =
"InDetTrackParticles",
59 GSFConversionVerticesKey =
"GSFConversionVertices"))
62 thinningTools = [JETM5MuonTPThinningTool,
63 JETM5ElectronTPThinningTool,
64 JETM5PhotonTPThinningTool]
68 truth_cond_WZH =
"(TruthParticles.isW || TruthParticles.isZ || TruthParticles.isHiggs)"
69 truth_cond_Lepton =
"((TruthParticles.isLepton) && !(TruthParticles.isSimulationParticle))"
70 truth_cond_QuarkGluon =
"((TruthParticles.isParton) && (TruthParticles.pt > 10000.)) || (TruthParticles.isTop)"
71 truth_cond_Photon =
"((TruthParticles.isPhoton) && (TruthParticles.pt > 10000.) && !(TruthParticles.isSimulationParticle))"
73 truth_expression =
'('+truth_cond_WZH+
' || '+truth_cond_Lepton +
' || '+truth_cond_QuarkGluon+
' || '+truth_cond_Photon+
')'
75 preserveAllDescendants =
False
77 JETM5TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name =
"JETM5TruthThinningTool",
78 StreamName = kwargs[
'StreamName'],
79 ParticleSelectionString = truth_expression,
80 PreserveDescendants = preserveAllDescendants,
81 PreserveGeneratorDescendants =
not preserveAllDescendants,
82 PreserveAncestors =
True)
84 acc.addPublicTool(JETM5TruthThinningTool)
85 thinningTools.append(JETM5TruthThinningTool)
88 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
89 acc.addEventAlgo(DerivationKernel(name,
90 ThinningTools = thinningTools,
91 SkimmingTools = [skimmingTool]
if not flags.Input.isMC
else []))
95 from DerivationFrameworkJetEtMiss.PFlowCommonConfig
import PFlowCommonCfg
96 acc.merge(PFlowCommonCfg(flags))
103 acc = ComponentAccumulator()
109 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
110 JETM5TriggerListsHelper = TriggerListsHelper(flags)
113 acc.merge(
JETM5KernelCfg(flags, name=
"JETM5Kernel", StreamName =
'StreamDAOD_JETM5', TriggerListsHelper = JETM5TriggerListsHelper))
118 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
119 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
120 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
122 JETM5SlimmingHelper =
SlimmingHelper(
"JETM5SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
124 JETM5SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
125 "Electrons",
"Photons",
"Muons",
"TauJets",
126 "MET_Baseline_AntiKt4EMTopo",
"MET_Baseline_AntiKt4EMPFlow",
127 "AntiKt4EMTopoJets",
"AntiKt4EMPFlowJets",
130 JETM5SlimmingHelper.AllVariables = [
"CaloCalTopoClusters",
132 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
133 "GlobalNeutralParticleFlowObjects",
"GlobalChargedParticleFlowObjects",
134 "CHSGChargedParticleFlowObjects",
"CHSGNeutralParticleFlowObjects",
138 JETM5SlimmingHelper.ExtraVariables += [
"AntiKt4EMPFlowJets.constituentLinks",
139 "AntiKt4EMTopoJets.constituentLinks"]
142 JETM5SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
143 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer',
144 'TruthVertices':
'xAOD::TruthVertexContainer',
145 'TruthVerticesAux':
'xAOD::TruthVertexAuxContainer'})
147 JETM5SlimmingHelper.AllVariables += [
"MuonTruthParticles",
"egammaTruthParticles",
148 "TruthParticles",
"TruthEvents",
"TruthVertices"]
151 JETM5SlimmingHelper.IncludeTriggerNavigation =
False
152 JETM5SlimmingHelper.IncludeJetTriggerContent =
False
153 JETM5SlimmingHelper.IncludeMuonTriggerContent =
False
154 JETM5SlimmingHelper.IncludeEGammaTriggerContent =
False
155 JETM5SlimmingHelper.IncludeTauTriggerContent =
False
156 JETM5SlimmingHelper.IncludeEtMissTriggerContent =
False
157 JETM5SlimmingHelper.IncludeBJetTriggerContent =
False
158 JETM5SlimmingHelper.IncludeBPhysTriggerContent =
False
159 JETM5SlimmingHelper.IncludeMinBiasTriggerContent =
False
162 JETM5ItemList = JETM5SlimmingHelper.GetItemList()
163 acc.merge(OutputStreamCfg(flags,
"DAOD_JETM5", ItemList=JETM5ItemList, AcceptAlgs=[
"JETM5Kernel"]))
164 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_JETM5", AcceptAlgs=[
"JETM5Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData,MetadataCategory.TruthMetaData]))