ATLAS Offline Software
Loading...
Searching...
No Matches
python.JETM5 Namespace Reference

Functions

 JETM5SkimmingToolCfg (flags)
 JETM5KernelCfg (flags, name='JETM5Kernel', **kwargs)
 JETM5Cfg (flags)

Function Documentation

◆ JETM5Cfg()

python.JETM5.JETM5Cfg ( flags)

Definition at line 102 of file JETM5.py.

102def JETM5Cfg(flags):
103
104 acc = ComponentAccumulator()
105
106 # Get the lists of triggers needed for trigger matching.
107 # This is needed at this scope (for the slimming) and further down in the config chain
108 # for actually configuring the matching, so we create it here and pass it down
109 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
110 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
111 JETM5TriggerListsHelper = TriggerListsHelper(flags)
112
113 # Skimming, thinning, augmentation, extra content
114 acc.merge(JETM5KernelCfg(flags, name="JETM5Kernel", StreamName = 'StreamDAOD_JETM5', TriggerListsHelper = JETM5TriggerListsHelper))
115
116 # ============================
117 # Define contents of the format
118 # =============================
119 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
120 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
121 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
122
123 JETM5SlimmingHelper = SlimmingHelper("JETM5SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
124
125 JETM5SlimmingHelper.SmartCollections = ["EventInfo", "InDetTrackParticles", "PrimaryVertices",
126 "Electrons", "Photons", "Muons", "TauJets",
127 "MET_Baseline_AntiKt4EMTopo","MET_Baseline_AntiKt4EMPFlow",
128 "AntiKt4EMTopoJets","AntiKt4EMPFlowJets",
129]
130
131 JETM5SlimmingHelper.AllVariables = ["CaloCalTopoClusters",
132 "MuonSegments",
133 "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape",
134 "GlobalNeutralParticleFlowObjects", "GlobalChargedParticleFlowObjects",
135 "CHSGChargedParticleFlowObjects", "CHSGNeutralParticleFlowObjects",
136 "UFOCSSK"]
137
138
139 JETM5SlimmingHelper.ExtraVariables += ["AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1"]
140
141 if flags.Input.isMC:
142 JETM5SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
143 'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer',
144 'TruthVertices': 'xAOD::TruthVertexContainer',
145 'TruthVerticesAux': 'xAOD::TruthVertexAuxContainer'})
146
147 JETM5SlimmingHelper.AllVariables += ["MuonTruthParticles", "egammaTruthParticles",
148 "TruthParticles", "TruthEvents", "TruthVertices"]
149
150 # Trigger content
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
160
161 # Output stream
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]))
165
166 return acc
167

◆ JETM5KernelCfg()

python.JETM5.JETM5KernelCfg ( flags,
name = 'JETM5Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for JETM5

Definition at line 21 of file JETM5.py.

21def JETM5KernelCfg(flags, name='JETM5Kernel', **kwargs):
22 """Configure the derivation framework driving algorithm (kernel) for JETM5"""
23 acc = ComponentAccumulator()
24
25 # Skimming
26 if not flags.Input.isMC:
27 skimmingTool = acc.getPrimaryAndMerge(JETM5SkimmingToolCfg(flags))
28
29 # Common augmentations
30 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
31 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
32
33 # Thinning tools...
34 from DerivationFrameworkInDet.InDetToolsConfig import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg
35
36 # Include inner detector tracks associated with muons
37 JETM5MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
38 flags,
39 name = "JETM5MuonTPThinningTool",
40 StreamName = kwargs['StreamName'],
41 MuonKey = "Muons",
42 InDetTrackParticlesKey = "InDetTrackParticles"))
43
44 # Include inner detector tracks associated with electonrs
45 JETM5ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
46 flags,
47 name = "JETM5ElectronTPThinningTool",
48 StreamName = kwargs['StreamName'],
49 SGKey = "Electrons",
50 InDetTrackParticlesKey = "InDetTrackParticles"))
51
52 # Include inner detector tracks associated with photons
53 JETM5PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
54 flags,
55 name = "JETM5PhotonTPThinningTool",
56 StreamName = kwargs['StreamName'],
57 SGKey = "Photons",
58 InDetTrackParticlesKey = "InDetTrackParticles",
59 GSFConversionVerticesKey = "GSFConversionVertices"))
60
61
62 thinningTools = [JETM5MuonTPThinningTool,
63 JETM5ElectronTPThinningTool,
64 JETM5PhotonTPThinningTool]
65
66 # Truth particle thinning
67 if flags.Input.isMC:
68 truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
69 truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && !(TruthParticles.isSimulationParticle))" # Leptons
70 truth_cond_Quark = "((abs(TruthParticles.pdgId) <= 5 && (TruthParticles.pt > 10000.)) || (abs(TruthParticles.pdgId) == 6))" # Quarks
71 truth_cond_Gluon = "((abs(TruthParticles.pdgId) == 21) && (TruthParticles.pt > 10000.))" # Gluons
72 truth_cond_Photon = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 10000.) && !(TruthParticles.isSimulationParticle))" # Photon
73
74 truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_Quark+'||'+truth_cond_Gluon+' || '+truth_cond_Photon+')'
75
76 preserveAllDescendants = False
77
78 JETM5TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name = "JETM5TruthThinningTool",
79 StreamName = kwargs['StreamName'],
80 ParticleSelectionString = truth_expression,
81 PreserveDescendants = preserveAllDescendants,
82 PreserveGeneratorDescendants = not preserveAllDescendants,
83 PreserveAncestors = True)
84
85 acc.addPublicTool(JETM5TruthThinningTool)
86 thinningTools.append(JETM5TruthThinningTool)
87
88 # Finally the kernel itself
89 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
90 acc.addEventAlgo(DerivationKernel(name,
91 ThinningTools = thinningTools,
92 SkimmingTools = [skimmingTool] if not flags.Input.isMC else []))
93
94
95 # PFlow augmentation tool
96 from DerivationFrameworkJetEtMiss.PFlowCommonConfig import PFlowCommonCfg
97 acc.merge(PFlowCommonCfg(flags))
98
99 return acc
100
101

◆ JETM5SkimmingToolCfg()

python.JETM5.JETM5SkimmingToolCfg ( flags)
Configure the skimming tool

Definition at line 11 of file JETM5.py.

11def JETM5SkimmingToolCfg(flags):
12 """Configure the skimming tool"""
13 expression = '( HLT_noalg_zb_L1ZB || HLT_noalg_L1ZB )'
14 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
15 xAODStringSkimmingToolCfg)
16 return xAODStringSkimmingToolCfg(flags, name = "JETM5SkimmingTool1",
17 expression = expression)
18
19
20# Main algorithm config