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

Functions

 HIGG1D2KernelCfg (flags, name='HIGG1D2Kernel', **kwargs)
 HIGG1D2Cfg (flags)

Function Documentation

◆ HIGG1D2Cfg()

python.HIGG1D2.HIGG1D2Cfg ( flags)

Definition at line 211 of file HIGG1D2.py.

211def HIGG1D2Cfg(flags):
212
213 acc = ComponentAccumulator()
214
215 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
216 HIGG1D2TriggerListsHelper = TriggerListsHelper(flags)
217
218 acc.merge(HIGG1D2KernelCfg(flags, name="HIGG1D2Kernel", StreamName = 'StreamDAOD_HIGG1D2', TriggerListsHelper = HIGG1D2TriggerListsHelper))
219
220 # Define contents of the format
221 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
222 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
223 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
224
225 HIGG1D2SlimmingHelper = SlimmingHelper("HIGG1D2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
226 HIGG1D2SlimmingHelper.SmartCollections = ["EventInfo",
227 "Electrons",
228 "Photons",
229 "Muons",
230 "PrimaryVertices",
231 "InDetTrackParticles",
232 "AntiKt4EMPFlowJets",
233]
234
235 # Trigger content
236 HIGG1D2SlimmingHelper.IncludeTriggerNavigation = False
237 HIGG1D2SlimmingHelper.IncludeJetTriggerContent = False
238 HIGG1D2SlimmingHelper.IncludeMuonTriggerContent = False
239 HIGG1D2SlimmingHelper.IncludeEGammaTriggerContent = False
240 HIGG1D2SlimmingHelper.IncludeJetTauEtMissTriggerContent = False
241 HIGG1D2SlimmingHelper.IncludeTauTriggerContent = False
242 HIGG1D2SlimmingHelper.IncludeEtMissTriggerContent = False
243 HIGG1D2SlimmingHelper.IncludeBJetTriggerContent = False
244 HIGG1D2SlimmingHelper.IncludeBPhysTriggerContent = False
245 HIGG1D2SlimmingHelper.IncludeMinBiasTriggerContent = False
246
247 # Variables to include
248 HIGG1D2SlimmingHelper.AllVariables = ["Electrons","Photons","egammaClusters","GSFConversionVertices","PrimaryVertices","MET_Track","CaloCalTopoClusters"]
249
250 HIGG1D2SlimmingHelper.ExtraVariables = ["Photons.zvertex",
251 "Muons.quality.EnergyLoss.energyLossType.etcone20.ptconecoreTrackPtrCorrection",
252 "MuonClusterCollection.eta_sampl.phi_sampl",
253 "GSFTrackParticles.parameterX.parameterY.parameterZ.parameterPX.parameterPY.parameterPZ.parameterPosition.vx.vy.eProbabilityHT",
254 "InDetTrackParticles.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
255 "AntiKt4EMPFlowJets.Jvt.JVFCorr",
256 "CombinedMuonTrackParticles.z0.vz",
257 "ExtrapolatedMuonTrackParticles.z0.vz",
258 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.TTVA_AMVFVertices_forReco.TTVA_AMVFWeights_forReco.TTVA_AMVFVertices_forHiggs.TTVA_AMVFWeights_forHiggs.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
259 "EventInfo.hardScatterVertexLink.timeStampNSOffset"]
260
261 # Add Btagging information
262 from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingStandardContent
263 HIGG1D2SlimmingHelper.ExtraVariables += BTaggingStandardContent(flags, "AntiKt4EMPFlowJets")
264
265 # Truth containers
266 if flags.Input.isMC:
267 HIGG1D2SlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
268 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
269 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
270 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
271 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
272 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
273 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
274 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
275 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
276 'TruthHFWithDecayParticles':'xAOD::TruthParticleContainer','TruthHFWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
277 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer'}
278
279 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
280 addTruth3ContentToSlimmerTool(HIGG1D2SlimmingHelper)
281 HIGG1D2SlimmingHelper.AllVariables += ['TruthHFWithDecayParticles',
282 'AntiKt4TruthDressedWZJets',
283 'AntiKt4TruthWZJets',
284 'TruthEvents',
285 'TruthPrimaryVertices',
286 'TruthVertices',
287 'TruthParticles',
288 'TruthElectrons',
289 'TruthParticles',
290 'TruthPhotons',
291 'TruthMuons',
292 'TruthBoson']
293 HIGG1D2SlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
294 "Muons.TruthLink",
295 "Photons.TruthLink"]
296
297 # Add HTXS variables
298 HIGG1D2SlimmingHelper.ExtraVariables.extend(["EventInfo.HTXS_prodMode",
299 "EventInfo.HTXS_errorCode",
300 "EventInfo.HTXS_Stage0_Category",
301 "EventInfo.HTXS_Stage1_Category_pTjet25",
302 "EventInfo.HTXS_Stage1_Category_pTjet30",
303 "EventInfo.HTXS_Stage1_FineIndex_pTjet30",
304 "EventInfo.HTXS_Stage1_FineIndex_pTjet25",
305 "EventInfo.HTXS_Stage1_2_Category_pTjet25",
306 "EventInfo.HTXS_Stage1_2_Category_pTjet30",
307 "EventInfo.HTXS_Stage1_2_FineIndex_pTjet30",
308 "EventInfo.HTXS_Stage1_2_FineIndex_pTjet25",
309 "EventInfo.HTXS_Stage1_2_Fine_Category_pTjet25",
310 "EventInfo.HTXS_Stage1_2_Fine_Category_pTjet30",
311 "EventInfo.HTXS_Stage1_2_Fine_FineIndex_pTjet30",
312 "EventInfo.HTXS_Stage1_2_Fine_FineIndex_pTjet25",
313 "EventInfo.HTXS_Njets_pTjet25",
314 "EventInfo.HTXS_Njets_pTjet30",
315 "EventInfo.HTXS_isZ2vvDecay",
316 "EventInfo.HTXS_Higgs_eta",
317 "EventInfo.HTXS_Higgs_m",
318 "EventInfo.HTXS_Higgs_phi",
319 "EventInfo.HTXS_Higgs_pt",
320 "EventInfo.HTXS_V_jets30_eta",
321 "EventInfo.HTXS_V_jets30_m",
322 "EventInfo.HTXS_V_jets30_phi",
323 "EventInfo.HTXS_V_jets30_pt",
324 "EventInfo.HTXS_V_pt"])
325
326
327 HIGG1D2SlimmingHelper.AppendToDictionary.update({'MET_Track':'xAOD::MissingETContainer','MET_TrackAux':'xAOD::MissingETAuxContainer'})
328
329 # Trigger matching
330 # Run 2
331 if flags.Trigger.EDMVersion == 2:
332 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
333 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D2SlimmingHelper,
334 OutputContainerPrefix = "TrigMatch_",
335 TriggerList = HIGG1D2TriggerListsHelper.Run2TriggerNamesTau)
336 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D2SlimmingHelper,
337 OutputContainerPrefix = "TrigMatch_",
338 TriggerList = HIGG1D2TriggerListsHelper.Run2TriggerNamesNoTau)
339 # Run 3
340 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
341 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
342 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(HIGG1D2SlimmingHelper)
343
344 # Output stream
345 HIGG1D2ItemList = HIGG1D2SlimmingHelper.GetItemList()
346 acc.merge(OutputStreamCfg(flags, "DAOD_HIGG1D2", ItemList=HIGG1D2ItemList, AcceptAlgs=["HIGG1D2Kernel"]))
347 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_HIGG1D2", AcceptAlgs=["HIGG1D2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
348
349 return acc

◆ HIGG1D2KernelCfg()

python.HIGG1D2.HIGG1D2KernelCfg ( flags,
name = 'HIGG1D2Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for HIGG1D2

Definition at line 17 of file HIGG1D2.py.

17def HIGG1D2KernelCfg(flags, name='HIGG1D2Kernel', **kwargs):
18 """Configure the derivation framework driving algorithm (kernel) for HIGG1D2"""
19 acc = ComponentAccumulator()
20
21 # Common augmentations
22 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
23 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
24
25 # Common Calo decorator tool (as in EGAM, for calibration of merged electrons)
26 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
27 CaloDecoratorKernelCfg)
28 acc.merge(CaloDecoratorKernelCfg(flags))
29
30 # Thinning tools
31 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg
32 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import GenericTruthThinningCfg
33
34 # Inner detector group recommendations for indet tracks in analysis
35 # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
36 HIGG1D2_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV"
37
38 HIGG1D2TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
39 flags,
40 name = "HIGG1D2TrackParticleThinningTool",
41 StreamName = kwargs['StreamName'],
42 SelectionString = HIGG1D2_thinning_expression,
43 InDetTrackParticlesKey = "InDetTrackParticles"))
44
45 # Include inner detector tracks associated with muons
46 HIGG1D2MuonTPThinningTool = acc.getPrimaryAndMerge(
47 MuonTrackParticleThinningCfg(
48 flags,
49 name = "HIGG1D2MuonTPThinningTool",
50 StreamName = kwargs['StreamName'],
51 MuonKey = "Muons",
52 InDetTrackParticlesKey = "InDetTrackParticles"
53 )
54 )
55
56 # Include inner detector tracks associated with electrons
57 HIGG1D2ElectronTPThinningTool = (
58 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
59 name = "HIGG1D2ElectronTPThinningTool",
60 StreamName = kwargs['StreamName'],
61 SGKey = "Electrons",
62 BestMatchOnly = False
63 )
64 )
65 acc.addPublicTool(HIGG1D2ElectronTPThinningTool)
66
67 # Include inner detector tracks associated with photons
68 HIGG1D2PhotonTPThinningTool = (
69 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
70 name = "HIGG1D2PhotonTPThinningTool",
71 StreamName = kwargs['StreamName'],
72 SGKey = "Photons",
73 GSFConversionVerticesKey = "GSFConversionVertices",
74 BestMatchOnly = False
75 )
76 )
77 acc.addPublicTool(HIGG1D2PhotonTPThinningTool)
78
79 # Include topoclusters around electrons, needed for calibration of merged electrons
80 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import CaloClusterThinningCfg
81
82 HIGG1D2CCTCThinningTool = acc.getPrimaryAndMerge(
83 CaloClusterThinningCfg(
84 flags,
85 name = "HIGG1D2CCTCThinningTool",
86 StreamName = kwargs['StreamName'],
87 SGKey = "Electrons",
88 SelectionString = "Electrons.pt>4*GeV",
89 TopoClCollectionSGKey = "CaloCalTopoClusters",
90 ConeSize = 0.5
91 )
92 )
93
94 thinningTools = [HIGG1D2TrackParticleThinningTool,
95 HIGG1D2MuonTPThinningTool,
96 HIGG1D2ElectronTPThinningTool,
97 HIGG1D2PhotonTPThinningTool,
98 HIGG1D2CCTCThinningTool]
99
100 # Photon vertex
101 from DerivationFrameworkEGamma.EGammaToolsConfig import PhotonVertexSelectionWrapperKernelCfg
102 acc.merge(PhotonVertexSelectionWrapperKernelCfg(flags))
103
104 # Truth thinning
105 if flags.Input.isMC :
106 truth_cond_1 = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
107 truth_cond_2 = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16))" # Leptons
108 truth_cond_3 = "((abs(TruthParticles.pdgId) == 6))" # Top quark
109 truth_cond_4 = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 1*GeV))" # Photon
110 truth_cond_finalState = '(TruthParticles.isGenStable)' # stable particles
111 truth_expression = '('+truth_cond_1+' || '+truth_cond_2 +' || '+truth_cond_3 +' || '+truth_cond_4+') || ('+truth_cond_finalState+')'
112
113 HIGG1D2GenericTruthThinningTool = acc.getPrimaryAndMerge(GenericTruthThinningCfg(
114 flags,
115 name = "HIGG1D2GenericTruthThinningTool",
116 StreamName = kwargs['StreamName'],
117 ParticleSelectionString = truth_expression,
118 PreserveDescendants = False,
119 PreserveGeneratorDescendants = True,
120 PreserveAncestors = True))
121 acc.addPublicTool(HIGG1D2GenericTruthThinningTool)
122 thinningTools.append(HIGG1D2GenericTruthThinningTool)
123
124 # SkimmingTool
125 from DerivationFrameworkHiggs.SkimmingToolHIGG1Config import SkimmingToolHIGG1Cfg
126 from DerivationFrameworkHiggs.HIGG1TriggerContent import expressionTriggers, mergedTriggers
127
128 SkipTriggerRequirement = flags.Input.isMC or not flags.Reco.EnableTrigger
129 TriggerExp = []
130 TriggerMerged = []
131
132 if not SkipTriggerRequirement:
133
134 MenuType = None
135 if float(flags.Beam.Energy) == 6500000.0:
136 # 13 TeV
137 MenuType = "Run2"
138 elif float(flags.Beam.Energy) == 6800000.0:
139 # 13.6 TeV
140 MenuType = "Run3"
141
142 TriggerExp = expressionTriggers[MenuType]
143 TriggerMerged = mergedTriggers[MenuType]
144
145 # Merged electrons for skimming
146 from ROOT import egammaPID
147
148 MergedElectronIsEM = CompFactory.AsgElectronIsEMSelector("MergedElectronIsEM")
149 MergedElectronIsEM.ConfigFile = "ElectronPhotonSelectorTools/trigger/rel21_20161021/ElectronIsEMMergedTightSelectorCutDefs.conf"
150 MergedElectronIsEM.isEMMask = egammaPID.ElectronTightHLT
151 acc.addPublicTool(MergedElectronIsEM)
152
153 # Set up skimming for merged and resolved events
154 skimmingTool = acc.popToolsAndMerge( SkimmingToolHIGG1Cfg(flags,
155 name = "HIGG1D2SkimmingTool",
156 RequireGRL = False,
157 ReqireLArError = True,
158 RequireTrigger = not SkipTriggerRequirement,
159 IncludeDoublePhotonPreselection = False,
160 RequirePreselection = False,
161 RequireKinematic = False,
162 RequireQuality = False,
163 RequireIsolation = False,
164 RequireInvariantMass = False,
165 Triggers = TriggerExp,
166 MergedElectronTriggers = TriggerMerged,
167 IncludeSingleElectronPreselection = False,
168 IncludeDoubleElectronPreselection = False,
169 IncludeSingleMuonPreselection = False,
170 IncludePhotonDoubleElectronPreselection = True,
171 IncludeDoubleMuonPreselection = True,
172 IncludePhotonMergedElectronPreselection = True,
173 IncludeHighPtPhotonElectronPreselection = True,
174 MinimumPhotonPt = 9.9*GeV,
175 MinimumElectronPt = 4.4*GeV,
176 MinimumMergedElectronPt = 18*GeV,
177 MinimumMuonPt = 2.9*GeV,
178 MaxMuonEta = 2.7,
179 RemoveCrack = False,
180 MaxEta = 2.5,
181 MergedElectronCutTool = MergedElectronIsEM))
182
183 acc.addPublicTool(skimmingTool)
184
185 # Augmentation tool for merged electron ID
186 from DerivationFrameworkHiggs.MergedElectronConfig import MergedElectronDetailsDecoratorCfg
187 HIGG1D2MergedElectronDetailsDecorator = acc.getPrimaryAndMerge(MergedElectronDetailsDecoratorCfg(flags,
188 name = "HIGG1D2MergedElectronDetailsDecorator"))
189 augmentationTools = [HIGG1D2MergedElectronDetailsDecorator]
190
191
193 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
194 contNames = ["Muons", "Electrons", "Photons"]
195 acc.merge(IsoCloseByAlgsCfg(flags, suff = "_HIGG1D2", isPhysLite = False, containerNames = contNames, stream_name = kwargs['StreamName']))
196
197 # Truth categories decoration tool for HTXS
198 if flags.Input.isMC:
199 from DerivationFrameworkHiggs.TruthCategoriesConfig import TruthCategoriesDecoratorCfg
200 acc.merge(TruthCategoriesDecoratorCfg(flags, name="TruthCategoriesDecorator"))
201
202 # Kernel now
203 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
204 acc.addEventAlgo(DerivationKernel(name,
205 SkimmingTools = [skimmingTool],
206 ThinningTools = thinningTools,
207 AugmentationTools = augmentationTools))
208 return acc
209
210