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 206 of file HIGG1D2.py.

206def HIGG1D2Cfg(flags):
207
208 acc = ComponentAccumulator()
209
210 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
211 HIGG1D2TriggerListsHelper = TriggerListsHelper(flags)
212
213 acc.merge(HIGG1D2KernelCfg(flags, name="HIGG1D2Kernel", StreamName = 'StreamDAOD_HIGG1D2', TriggerListsHelper = HIGG1D2TriggerListsHelper))
214
215 # Define contents of the format
216 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
217 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
218 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
219
220 HIGG1D2SlimmingHelper = SlimmingHelper("HIGG1D2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
221 HIGG1D2SlimmingHelper.SmartCollections = ["EventInfo",
222 "Electrons",
223 "Photons",
224 "Muons",
225 "PrimaryVertices",
226 "InDetTrackParticles",
227 "AntiKt4EMPFlowJets",
228]
229
230 # Trigger content
231 HIGG1D2SlimmingHelper.IncludeTriggerNavigation = False
232 HIGG1D2SlimmingHelper.IncludeJetTriggerContent = False
233 HIGG1D2SlimmingHelper.IncludeMuonTriggerContent = False
234 HIGG1D2SlimmingHelper.IncludeEGammaTriggerContent = False
235 HIGG1D2SlimmingHelper.IncludeJetTauEtMissTriggerContent = False
236 HIGG1D2SlimmingHelper.IncludeTauTriggerContent = False
237 HIGG1D2SlimmingHelper.IncludeEtMissTriggerContent = False
238 HIGG1D2SlimmingHelper.IncludeBJetTriggerContent = False
239 HIGG1D2SlimmingHelper.IncludeBPhysTriggerContent = False
240 HIGG1D2SlimmingHelper.IncludeMinBiasTriggerContent = False
241
242 # Variables to include
243 HIGG1D2SlimmingHelper.AllVariables = ["Electrons","Photons","egammaClusters","GSFConversionVertices","PrimaryVertices","MET_Track","CaloCalTopoClusters"]
244
245 HIGG1D2SlimmingHelper.ExtraVariables = ["Photons.zvertex",
246 "Muons.quality.EnergyLoss.energyLossType.etcone20.ptconecoreTrackPtrCorrection",
247 "MuonClusterCollection.eta_sampl.phi_sampl",
248 "GSFTrackParticles.parameterX.parameterY.parameterZ.parameterPX.parameterPY.parameterPZ.parameterPosition.vx.vy.eProbabilityHT",
249 "InDetTrackParticles.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
250 "AntiKt4EMPFlowJets.Jvt.JVFCorr",
251 "CombinedMuonTrackParticles.z0.vz",
252 "ExtrapolatedMuonTrackParticles.z0.vz",
253 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.TTVA_AMVFVertices_forReco.TTVA_AMVFWeights_forReco.TTVA_AMVFVertices_forHiggs.TTVA_AMVFWeights_forHiggs.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
254 "EventInfo.hardScatterVertexLink.timeStampNSOffset"]
255
256 # Add Btagging information
257 from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingStandardContent
258 HIGG1D2SlimmingHelper.ExtraVariables += BTaggingStandardContent(flags, "AntiKt4EMPFlowJets")
259
260 # Truth containers
261 if flags.Input.isMC:
262 HIGG1D2SlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
263 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
264 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
265 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
266 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
267 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
268 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
269 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
270 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
271 'TruthHFWithDecayParticles':'xAOD::TruthParticleContainer','TruthHFWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
272 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer'}
273
274 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
275 addTruth3ContentToSlimmerTool(HIGG1D2SlimmingHelper)
276 HIGG1D2SlimmingHelper.AllVariables += ['TruthHFWithDecayParticles',
277 'AntiKt4TruthDressedWZJets',
278 'AntiKt4TruthWZJets',
279 'TruthEvents',
280 'TruthPrimaryVertices',
281 'TruthVertices',
282 'TruthParticles',
283 'TruthElectrons',
284 'TruthParticles',
285 'TruthPhotons',
286 'TruthMuons',
287 'TruthBoson']
288 HIGG1D2SlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
289 "Muons.TruthLink",
290 "Photons.TruthLink"]
291
292
293 HIGG1D2SlimmingHelper.AppendToDictionary.update({'MET_Track':'xAOD::MissingETContainer','MET_TrackAux':'xAOD::MissingETAuxContainer'})
294
295 # Trigger matching
296 # Run 2
297 if flags.Trigger.EDMVersion == 2:
298 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
299 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D2SlimmingHelper,
300 OutputContainerPrefix = "TrigMatch_",
301 TriggerList = HIGG1D2TriggerListsHelper.Run2TriggerNamesTau)
302 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D2SlimmingHelper,
303 OutputContainerPrefix = "TrigMatch_",
304 TriggerList = HIGG1D2TriggerListsHelper.Run2TriggerNamesNoTau)
305 # Run 3
306 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
307 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
308 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(HIGG1D2SlimmingHelper)
309
310 # Output stream
311 HIGG1D2ItemList = HIGG1D2SlimmingHelper.GetItemList()
312 acc.merge(OutputStreamCfg(flags, "DAOD_HIGG1D2", ItemList=HIGG1D2ItemList, AcceptAlgs=["HIGG1D2Kernel"]))
313 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_HIGG1D2", AcceptAlgs=["HIGG1D2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
314
315 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 # Kernel now
198 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
199 acc.addEventAlgo(DerivationKernel(name,
200 SkimmingTools = [skimmingTool],
201 ThinningTools = thinningTools,
202 AugmentationTools = augmentationTools))
203 return acc
204
205