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

Functions

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

Function Documentation

◆ JETM5Cfg()

JETM5Cfg ( flags)

Definition at line 101 of file JETM5.py.

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

◆ JETM5KernelCfg()

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 = "(TruthParticles.isW || TruthParticles.isZ || TruthParticles.isHiggs)" # W, Z and Higgs
69 truth_cond_Lepton = "((TruthParticles.isLepton) && !(TruthParticles.isSimulationParticle))" # Leptons
70 truth_cond_QuarkGluon = "((TruthParticles.isParton) && (TruthParticles.pt > 10000.)) || (TruthParticles.isTop)" # Quarks and Gluons
71 truth_cond_Photon = "((TruthParticles.isPhoton) && (TruthParticles.pt > 10000.) && !(TruthParticles.isSimulationParticle))" # Photon
72
73 truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_QuarkGluon+' || '+truth_cond_Photon+')'
74
75 preserveAllDescendants = False
76
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)
83
84 acc.addPublicTool(JETM5TruthThinningTool)
85 thinningTools.append(JETM5TruthThinningTool)
86
87 # Finally the kernel itself
88 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
89 acc.addEventAlgo(DerivationKernel(name,
90 ThinningTools = thinningTools,
91 SkimmingTools = [skimmingTool] if not flags.Input.isMC else []))
92
93
94 # PFlow augmentation tool
95 from DerivationFrameworkJetEtMiss.PFlowCommonConfig import PFlowCommonCfg
96 acc.merge(PFlowCommonCfg(flags))
97
98 return acc
99
100

◆ JETM5SkimmingToolCfg()

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