ATLAS Offline Software
STDM6.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 # STDM6.py - derivation dedicated for the special runs at low mu (AFP analysis)
3 
4 # Based on PHYS derivation:
5 # * no skimming
6 # * slimming by default as in PHYS derivation
7 # * added content wrt PHYS:
8 # - forward protons
9 # - InDet tracks/particles
10 # - ["TruthEvents", "TruthParticles", "TruthVertices", "AntiKt4TruthJets","AntiKt4TruthWZJets"]
11 # - Calo clusters
12 # * Nov 2024 update: added JET-M1 containers
13 
14 
15 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
16 from AthenaConfiguration.ComponentFactory import CompFactory
17 from AthenaConfiguration.Enums import MetadataCategory
18 from AthenaCommon.Logging import logging
19 logSTDM6 = logging.getLogger('STDM6')
20 
21 
22 
23 # Main algorithm config
24 def STDM6KernelCfg(flags, name='STDM6Kernel', **kwargs):
25  """Configure the derivation framework driving algorithm (kernel) for STDM6"""
26  acc = ComponentAccumulator()
27 
28  # Common augmentations
29  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
31  flags,
32  TriggerListsHelper = kwargs['TriggerListsHelper'],
33  TauJets_EleRM_in_input = kwargs['TauJets_EleRM_in_input']
34  ))
35 
36  from DerivationFrameworkInDet.InDetToolsConfig import InDetTrackSelectionToolWrapperCfg
37  DFCommonTrackSelection = acc.getPrimaryAndMerge(InDetTrackSelectionToolWrapperCfg(
38  flags,
39  name = "DFJETM1CommonTrackSelectionLoose",
40  CutLevel = "Loose",
41  DecorationName = "DFJETM1Loose"))
42 
43  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation("JETM1CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
44 
45  # Thinning tools
46  # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
47  thinningToolsArgs = {
48  'TrackParticleThinningToolName' : "STDM6TrackParticleThinningTool",
49  'MuonTPThinningToolName' : "STDM6MuonTPThinningTool",
50  'TauJetThinningToolName' : "STDM6TauJetThinningTool",
51  'TauJets_MuonRMThinningToolName' : "STDM6TauJets_MuonRMThinningTool",
52  'DiTauTPThinningToolName' : "STDM6DiTauTPThinningTool",
53  'DiTauLowPtThinningToolName' : "STDM6DiTauLowPtThinningTool",
54  'DiTauLowPtTPThinningToolName' : "STDM6DiTauLowPtTPThinningTool",
55  }
56  # for AOD produced before 24.0.17, the electron removal tau is not available
57  if kwargs.get('TauJets_EleRM_in_input', False):
58  thinningToolsArgs['TauJets_EleRMThinningToolName'] = "STDM6TauJets_EleRMThinningTool"
59  # Configure the thinning tools
60  from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
61  acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
62  # Get them from the CA so they can be added to the kernel
63  thinningTools = []
64  for key in thinningToolsArgs:
65  thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
66 
67  # The kernel algorithm itself
68  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
69  acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
70 
71  # not using the thinning from the JET-M1 derivation!
72 
73  # From JET-M1 - extra jet content:
74  acc.merge(JETM1ExtraContentCfg(flags))
75 
76  return acc
77 
79 
80  acc = ComponentAccumulator()
81 
82  from JetRecConfig.JetRecConfig import JetRecCfg, getModifier
83  from JetRecConfig.StandardJetMods import stdJetModifiers
84  from JetRecConfig.StandardSmallRJets import AntiKt4PV0Track, AntiKt4EMPFlow, AntiKt4EMPFlowNoPtCut, AntiKt4EMTopoNoPtCut
85 
86  #=======================================
87  # Schedule additional jet decorations
88  #=======================================
89  bJVTTool = getModifier(AntiKt4EMPFlow, stdJetModifiers['bJVT'], stdJetModifiers['bJVT'].modspec, flags=flags)
90  acc.addEventAlgo(CompFactory.JetDecorationAlg(name='bJVTAlg',
91  JetContainer='AntiKt4EMPFlowJets',
92  Decorators=[bJVTTool]))
93 
94  #=======================================
95  # R = 0.4 track-jets (needed for Rtrk)
96  #=======================================
97  jetList = [AntiKt4PV0Track]
98 
99  #=======================================
100  # SCHEDULE SMALL-R JETS WITH NO PT CUT
101  #=======================================
102  if flags.Input.isMC:
103  jetList += [AntiKt4EMPFlowNoPtCut, AntiKt4EMTopoNoPtCut]
104 
105  #=======================================
106  # CSSK R = 0.4 UFO jets
107  #=======================================
108  if flags.Input.isMC:
109  from JetRecConfig.StandardSmallRJets import AntiKt4UFOCSSKNoPtCut
110  AntiKt4UFOCSSKNoPtCut_JETM1 = AntiKt4UFOCSSKNoPtCut.clone(
111  modifiers = AntiKt4UFOCSSKNoPtCut.modifiers+("NNJVT",)
112  )
113  jetList += [AntiKt4UFOCSSKNoPtCut_JETM1]
114  else:
115  from JetRecConfig.StandardSmallRJets import AntiKt4UFOCSSK
116  AntiKt4UFOCSSK_JETM1 = AntiKt4UFOCSSK.clone(
117  modifiers = AntiKt4UFOCSSK.modifiers+("NNJVT",)
118  )
119  jetList += [AntiKt4UFOCSSK_JETM1]
120 
121 
122  for jd in jetList:
123  acc.merge(JetRecCfg(flags,jd))
124 
125  #=======================================
126  # UFO CSSK event shape
127  #=======================================
128 
129  from JetRecConfig.JetRecConfig import getConstitPJGAlg
130  from JetRecConfig.StandardJetConstits import stdConstitDic as cst
131  from JetRecConfig.JetInputConfig import buildEventShapeAlg
132 
133  acc.addEventAlgo(buildEventShapeAlg(cst.UFOCSSK,'', suffix=None))
134  acc.addEventAlgo(getConstitPJGAlg(cst.UFOCSSK, suffix='Neut'))
135  acc.addEventAlgo(buildEventShapeAlg(cst.UFOCSSK,'', suffix='Neut'))
136 
137  #=======================================
138  # More detailed truth information
139  #=======================================
140 
141  if flags.Input.isMC:
142  from DerivationFrameworkMCTruth.MCTruthCommonConfig import AddTopQuarkAndDownstreamParticlesCfg
143  acc.merge(AddTopQuarkAndDownstreamParticlesCfg(flags, generations=4,rejectHadronChildren=True))
144 
145  #=======================================
146  # Add Run-2 jet trigger collections
147  # Only needed for Run-2 due to different aux container type (JetTrigAuxContainer) which required special wrapper for conversion to AuxContainerBase
148  # In Run-3, the aux. container type is directly JetAuxContainer (no conversion needed)
149  #=======================================
150 
151  if flags.Trigger.EDMVersion == 2:
152  triggerNames = ["JetContainer_a4tcemsubjesFS", "JetContainer_a4tcemsubjesISFS", "JetContainer_GSCJet",
153  "JetContainer_a10tclcwsubjesFS", "JetContainer_a10tclcwsubFS", "JetContainer_a10ttclcwjesFS"]
154 
155  for trigger in triggerNames:
156  wrapperName = trigger+'AuxWrapper'
157  auxContainerName = 'HLT_xAOD__'+trigger+'Aux'
158 
159  acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+"." ] ))
160 
161  return acc
162 
163 
164 def STDM6CoreCfg(flags, name_tag='STDM6', StreamName='StreamDAOD_STDM6', TriggerListsHelper=None, TauJets_EleRM_in_input=None):
165 
166  if TriggerListsHelper is None:
167  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
168  TriggerListsHelper = TriggerListsHelper(flags)
169 
170  if TauJets_EleRM_in_input is None:
171  # for AOD produced before 24.0.17, the electron removal tau is not available
172  TauJets_EleRM_in_input = (flags.Input.TypedCollections.count('xAOD::TauJetContainer#TauJets_EleRM') > 0)
173 
174  acc = ComponentAccumulator()
175 
176 
177  from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
178  acc.merge(HiggsAugmentationAlgsCfg(flags))
179 
180 
182  from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
183  acc.merge(IsoCloseByAlgsCfg(flags, suff = "_"+name_tag, isPhysLite = False, stream_name = StreamName))
184 
185  #===================================================
186  # HEAVY FLAVOR CLASSIFICATION FOR ttbar+jets EVENTS
187  #===================================================
188  from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
189  acc.merge(HFClassificationCommonCfg(flags))
190 
191  # ============================
192  # Define contents of the format
193  # =============================
194  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
195  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
196  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
197 
198  STDM6SlimmingHelper = SlimmingHelper(name_tag+"SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
199  STDM6SlimmingHelper.SmartCollections = ["EventInfo",
200  "Electrons",
201  "Photons",
202  "Muons",
203  "PrimaryVertices",
204  "InDetTrackParticles",
205  "AntiKt4EMTopoJets",
206  "AntiKt4EMPFlowJets",
207  "AntiKt10UFOCSSKJets",
208  "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
209  "BTagging_AntiKt4EMPFlow",
210  "BTagging_AntiKtVR30Rmax4Rmin02Track",
211  "MET_Baseline_AntiKt4EMTopo",
212  "MET_Baseline_AntiKt4EMPFlow",
213  "TauJets",
214  "TauJets_MuonRM",
215  "DiTauJets",
216  "DiTauJetsLowPt",
217  "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
218  "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
219  "AntiKtVR30Rmax4Rmin02PV0TrackJets",
220  ]
221  if TauJets_EleRM_in_input:
222  STDM6SlimmingHelper.SmartCollections.append("TauJets_EleRM")
223 
224  # STDM6 needs additionally full info on:
225  # - AFP
226  # - Calo clusters
227  STDM6SlimmingHelper.AllVariables += [ "AFPSiHitContainer",
228  "AFPToFHitContainer",
229  "AFPSiHitsClusterContainer",
230  "AFPTrackContainer",
231  "AFPToFTrackContainer",
232  "AFPProtonContainer",
233  "AFPVertexContainer",
234  "CaloCalTopoClusters",
235  ]
236 
237  # additional contenct from JET-M1
238  # Maciej LewickiL: I'd rather keep it the way it is because it will be easier to keep up with any future changes in JET-M1
239  STDM6SlimmingHelper.AllVariables += ["MuonSegments", "EventInfo",
240  "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape","Kt4EMPFlowPUSBEventShape","Kt4EMPFlowNeutEventShape","Kt4UFOCSSKEventShape","Kt4UFOCSSKNeutEventShape",
241  "AntiKt4EMPFlowJets"]
242 
243  excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV"
244  StaticContent = []
245  StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"]
246  StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData]
247  StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"]
248  StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData]
249  StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"]
250  StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData]
251 
252  STDM6SlimmingHelper.StaticContent = StaticContent
253 
254  # Extra content
255  STDM6SlimmingHelper.ExtraVariables += ["AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
256  "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.isJvtHS.isJvtPU",
257  "TruthPrimaryVertices.t.x.y.z",
258  "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
259  "EventInfo.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification",
260  "TauJets.dRmax.etOverPtLeadTrk",
261  "TauJets_MuonRM.dRmax.etOverPtLeadTrk",
262  "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey",
263  "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey"]
264  if TauJets_EleRM_in_input:
265  STDM6SlimmingHelper.ExtraVariables += ["TauJets_EleRM.dRmax.etOverPtLeadTrk"]
266 
267  # additional content from JET-M1
268  # Maciej Lewicki: I'd rather keep it the way it is because it will be easier to keep up with any future changes in JET-M1
269  STDM6SlimmingHelper.ExtraVariables += ["AntiKt4EMTopoJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
270  "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1",
271  "AntiKt4EMPFlowJets.passOnlyBJVT.DFCommonJets_bJvt.isJvtHS.isJvtPU",
272  "InDetTrackParticles.truthMatchProbability",
273  "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.zg.rg.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.EnergyPerSampling.GhostTrack",
274  "AntiKt10UFOCSSKJets.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.EnergyPerSampling.GhostTrack"]
275 
276 
277  # FTAG Xbb extra content
278  extraList = []
279  for tagger in ["GN2Xv00", "GN2XWithMassv00", "GN2Xv01"]:
280  for score in ["phbb", "phcc", "ptop", "pqcd"]:
281  extraList.append(f"{tagger}_{score}")
282  STDM6SlimmingHelper.ExtraVariables += ["AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets." + ".".join(extraList)]
283 
284  # Truth extra content
285  # ---> extetnding deafult PHYS conttents with:
286  # - AntiKt4EMTTopoJets
287  # - AntiKt4EMPFlowJets
288  # - TruthPrimaryVertices
289  # - InDetTrackParticles
290  if flags.Input.isMC:
291 
292  from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
293  addTruth3ContentToSlimmerTool(STDM6SlimmingHelper)
294 
295  # coming from the JET-M1 derivation
296  STDM6SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
297  'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer'})
298 
299  STDM6SlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm','TruthPileupParticles','InTimeAntiKt4TruthJets','OutOfTimeAntiKt4TruthJets']
300  STDM6SlimmingHelper.AllVariables += ["TruthEvents", "TruthParticles", "TruthVertices", "AntiKt4TruthJets","AntiKt4TruthWZJets"]
301  STDM6SlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
302  "Muons.TruthLink",
303  "Photons.TruthLink",
304  "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
305  "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt",
306  "TruthPrimaryVertices.t.x.y.z",
307  "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
308  "PrimaryVertices.x.y.z.covariance.trackWeights.vertexType.sumPt2",
309  ]
310 
311  # Maciej Lewicki: coming from the JET-M1 derivation
312  STDM6SlimmingHelper.SmartCollections += ["AntiKt4TruthWZJets"]
313  STDM6SlimmingHelper.AllVariables += ["TruthTopQuarkWithDecayParticles","TruthTopQuarkWithDecayVertices",
314  "AntiKt4TruthJets", "InTimeAntiKt4TruthJets", "OutOfTimeAntiKt4TruthJets", "TruthParticles"]
315  STDM6SlimmingHelper.ExtraVariables += ["TruthVertices.barcode.z"]
316 
317  from DerivationFrameworkMCTruth.MCTruthCommonConfig import AddTauAndDownstreamParticlesCfg
318  acc.merge(AddTauAndDownstreamParticlesCfg(flags))
319  STDM6SlimmingHelper.AllVariables += ['TruthTausWithDecayParticles','TruthTausWithDecayVertices']
320 
321  STDM6SlimmingHelper.AppendToDictionary.update({'Kt4UFOCSSKEventShape':'xAOD::EventShape',
322  'Kt4UFOCSSKEventShapeAux':'xAOD::EventShapeAuxInfo',
323  'Kt4UFOCSSKNeutEventShape':'xAOD::EventShape',
324  'Kt4UFOCSSKNeutEventShapeAux':'xAOD::EventShapeAuxInfo'})
325 
326 
327  from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
328  setupHiggsSlimmingVariables(flags, STDM6SlimmingHelper)
329 
330  # Trigger content
331  STDM6SlimmingHelper.IncludeTriggerNavigation = False
332  # modification from JET-M1 derivation:
333  STDM6SlimmingHelper.IncludeJetTriggerContent = True
334  STDM6SlimmingHelper.IncludeMuonTriggerContent = False
335  STDM6SlimmingHelper.IncludeEGammaTriggerContent = False
336  STDM6SlimmingHelper.IncludeJetTauEtMissTriggerContent = False
337  STDM6SlimmingHelper.IncludeTauTriggerContent = False
338  STDM6SlimmingHelper.IncludeEtMissTriggerContent = False
339  STDM6SlimmingHelper.IncludeBJetTriggerContent = False
340  STDM6SlimmingHelper.IncludeBPhysTriggerContent = False
341  STDM6SlimmingHelper.IncludeMinBiasTriggerContent = False
342 
343  # Trigger matching
344  # Run 2
345  if flags.Trigger.EDMVersion == 2:
346  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
347  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM6SlimmingHelper,
348  OutputContainerPrefix = "TrigMatch_",
349  TriggerList = TriggerListsHelper.Run2TriggerNamesTau)
350  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM6SlimmingHelper,
351  OutputContainerPrefix = "TrigMatch_",
352  TriggerList = TriggerListsHelper.Run2TriggerNamesNoTau)
353  triggerNames = ["a4tcemsubjesFS", "a4tcemsubjesISFS", "a10tclcwsubjesFS", "a10tclcwsubFS", "a10ttclcwjesFS", "GSCJet"]
354  for trigger in triggerNames:
355  STDM6SlimmingHelper.FinalItemList.append('xAOD::AuxContainerBase!#HLT_xAOD__JetContainer_'+trigger+'Aux.pt.eta.phi.m')
356 
357  # Run 3, or Run 2 with navigation conversion
358  if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
359  from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
361 
362  jetOutputList = ["AntiKt4PV0TrackJets", "AntiKt4UFOCSSKJets"]
363  if flags.Input.isMC:
364  jetOutputList = ["AntiKt4PV0TrackJets","AntiKt4UFOCSSKNoPtCutJets","AntiKt4EMPFlowNoPtCutJets","AntiKt4EMTopoNoPtCutJets"]
365  from DerivationFrameworkJetEtMiss.JetCommonConfig import addJetsToSlimmingTool
366  addJetsToSlimmingTool(STDM6SlimmingHelper, jetOutputList, STDM6SlimmingHelper.SmartCollections)
367 
368 
369  # Output stream
370  STDM6ItemList = STDM6SlimmingHelper.GetItemList()
371  acc.merge(OutputStreamCfg(flags, "DAOD_"+name_tag, ItemList=STDM6ItemList, AcceptAlgs=[name_tag+"Kernel"]))
372  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_"+name_tag, AcceptAlgs=[name_tag+"Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
373 
374  return acc
375 
376 def STDM6Cfg(flags):
377 
378  logSTDM6.info('****************** STARTING STDM6 *****************')
379 
380  stream_name = 'StreamDAOD_STDM6'
381  acc = ComponentAccumulator()
382 
383  # Get the lists of triggers needed for trigger matching.
384  # This is needed at this scope (for the slimming) and further down in the config chain
385  # for actually configuring the matching, so we create it here and pass it down
386  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
387  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
388  STDM6TriggerListsHelper = TriggerListsHelper(flags)
389 
390  # for AOD produced before 24.0.17, the electron removal tau is not available
391  TauJets_EleRM_in_input = (flags.Input.TypedCollections.count('xAOD::TauJetContainer#TauJets_EleRM') > 0)
392  if TauJets_EleRM_in_input:
393  logSTDM6.info("TauJets_EleRM is in the input AOD. Relevant containers will be scheduled")
394  else:
395  logSTDM6.info("TauJets_EleRM is Not in the input AOD. No relevant containers will be written")
396 
397  # Common augmentations
398  acc.merge(STDM6KernelCfg(
399  flags,
400  name="STDM6Kernel",
401  StreamName = stream_name,
402  TriggerListsHelper = STDM6TriggerListsHelper,
403  TauJets_EleRM_in_input=TauJets_EleRM_in_input
404  ))
405  # STDM6 content
406  acc.merge(STDM6CoreCfg(
407  flags,
408  "STDM6",
409  StreamName = stream_name,
410  TriggerListsHelper = STDM6TriggerListsHelper,
411  TauJets_EleRM_in_input=TauJets_EleRM_in_input
412  ))
413 
414  return acc
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:98
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetToolsConfig.InDetTrackSelectionToolWrapperCfg
def InDetTrackSelectionToolWrapperCfg(flags, name, CutLevel="TightPrimary", **kwargs)
Definition: InDetToolsConfig.py:426
python.STDM6.STDM6CoreCfg
def STDM6CoreCfg(flags, name_tag='STDM6', StreamName='StreamDAOD_STDM6', TriggerListsHelper=None, TauJets_EleRM_in_input=None)
Definition: STDM6.py:164
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.PhysCommonThinningConfig.PhysCommonThinningCfg
def PhysCommonThinningCfg(flags, StreamName="StreamDAOD_PHYS", **kwargs)
Definition: PhysCommonThinningConfig.py:9
python.JetInputConfig.buildEventShapeAlg
def buildEventShapeAlg(jetOrConstitdef, inputspec, voronoiRf=0.9, radius=0.4, suffix=None)
Definition: JetInputConfig.py:132
IsolationSelectionConfig.IsoCloseByAlgsCfg
def IsoCloseByAlgsCfg(flags, suff="", isPhysLite=False, containerNames=["Muons", "Electrons", "Photons"], stream_name="", ttva_wp="Nonprompt_All_MaxWeight", useSelTools=False)
Definition: IsolationSelectionConfig.py:146
python.MCTruthCommonConfig.AddTauAndDownstreamParticlesCfg
def AddTauAndDownstreamParticlesCfg(flags, generations=-1, rejectHadronChildren=False)
Definition: MCTruthCommonConfig.py:263
python.JetRecConfig.getModifier
def getModifier(jetdef, moddef, modspec, flags=None)
Definition: JetRecConfig.py:658
python.TriggerMatchingCommonConfig.AddRun2TriggerMatchingToSlimmingHelper
def AddRun2TriggerMatchingToSlimmingHelper(**kwargs)
Definition: TriggerMatchingCommonConfig.py:49
python.MCTruthCommonConfig.AddTopQuarkAndDownstreamParticlesCfg
def AddTopQuarkAndDownstreamParticlesCfg(flags, generations=1, rejectHadronChildren=False)
Definition: MCTruthCommonConfig.py:253
python.STDM6.JETM1ExtraContentCfg
def JETM1ExtraContentCfg(flags)
Definition: STDM6.py:78
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:36
python.JetCommonConfig.addJetsToSlimmingTool
def addJetsToSlimmingTool(slimhelper, contentlist, smartlist=[])
Definition: JetCommonConfig.py:262
python.STDM6.STDM6KernelCfg
def STDM6KernelCfg(flags, name='STDM6Kernel', **kwargs)
Definition: STDM6.py:24
python.HiggsPhysContent.HiggsAugmentationAlgsCfg
def HiggsAugmentationAlgsCfg(flags)
Definition: HiggsPhysContent.py:4
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.JetRecConfig.getConstitPJGAlg
def getConstitPJGAlg(constitdef, suffix=None, flags=None, parent_jetdef=None)
Definition: JetRecConfig.py:350
python.MCTruthCommonConfig.addTruth3ContentToSlimmerTool
def addTruth3ContentToSlimmerTool(slimmer)
Definition: MCTruthCommonConfig.py:462
python.HiggsPhysContent.setupHiggsSlimmingVariables
def setupHiggsSlimmingVariables(ConfigFlags, slimmingHelper)
Definition: HiggsPhysContent.py:13
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:14
python.STDM6.STDM6Cfg
def STDM6Cfg(flags)
Definition: STDM6.py:376
python.HFClassificationCommonConfig.HFClassificationCommonCfg
def HFClassificationCommonCfg(flags)
Definition: HFClassificationCommonConfig.py:114
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
SlimmingHelper
Definition: SlimmingHelper.py:1
python.HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:66