ATLAS Offline Software
JETM11.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #!/usr/bin/env python
3 #====================================================================
4 # DAOD_JETM11.py
5 #====================================================================
6 
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.Enums import MetadataCategory
10 
11 # Main algorithm config
13  """Configure the trigger skimming tool"""
14  acc = ComponentAccumulator()
15 
16  from DerivationFrameworkJetEtMiss import TriggerLists
17  singleElTriggers = TriggerLists.single_el_Trig(flags)
18  singleMuTriggers = TriggerLists.single_mu_Trig(flags)
19 
20  JETM11TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool( name = "JETM11TrigSkimmingTool1",
21  TriggerListOR = singleElTriggers + singleMuTriggers)
22 
23  acc.addPublicTool(JETM11TrigSkimmingTool, primary=True)
24 
25  return acc
26 
28  """Configure the string skimming tool"""
29 
30  acc = ComponentAccumulator()
31 
32  cutExpression = "(count(Electrons.DFCommonElectronsLHLoose && Electrons.pt > (24 * GeV) && abs(Electrons.eta) < 2.47) + count(Muons.DFCommonMuonPassPreselection && Muons.pt > (24*GeV) && abs(Muons.eta) < 2.47) ) >= 1"
33 
34  JETM11StringSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM11StringSkimmingTool",
35  expression = cutExpression)
36 
37  acc.addPublicTool(JETM11StringSkimmingTool, primary=True)
38 
39  return(acc)
40 
41 
42 # Main algorithm config
43 def JETM11KernelCfg(flags, name='JETM11Kernel', **kwargs):
44  """Configure the derivation framework driving algorithm (kernel) for JETM11"""
45  acc = ComponentAccumulator()
46 
47  # Skimming
48  skimmingTools = []
49  skimmingTools.append(acc.getPrimaryAndMerge(JETM11TriggerSkimmingToolCfg(flags)))
50  skimmingTools.append(acc.getPrimaryAndMerge(JETM11StringSkimmingToolCfg(flags)))
51 
52  # Common augmentations
53  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
54  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
55 
56  # Derivation kernel:
57  from DerivationFrameworkJetEtMiss.METTriggerDerivationContentConfig import TightMETTriggerDerivationKernelCfg
58  acc.merge(TightMETTriggerDerivationKernelCfg(flags, name="JETM11Kernel", skimmingTools = skimmingTools, StreamName = 'StreamDAOD_JETM11'))
59 
60  return acc
61 
62 
63 def JETM11Cfg(flags):
64 
65  acc = ComponentAccumulator()
66 
67  # Get the lists of triggers needed for trigger matching.
68  # This is needed at this scope (for the slimming) and further down in the config chain
69  # for actually configuring the matching, so we create it here and pass it down
70  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
71  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
72  JETM11TriggerListsHelper = TriggerListsHelper(flags)
73 
74  # Skimming, thinning, augmentation
75  acc.merge(JETM11KernelCfg(flags, name="JETM11Kernel", StreamName = 'StreamDAOD_JETM11', TriggerListsHelper = JETM11TriggerListsHelper))
76 
77  # ============================
78  # Define contents of the format
79  # =============================
80  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
81  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
82  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
83 
84  JETM11SlimmingHelper = SlimmingHelper("JETM11SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
85 
86  from DerivationFrameworkJetEtMiss.METTriggerDerivationContentConfig import addMETTriggerDerivationContent
87  addMETTriggerDerivationContent(JETM11SlimmingHelper, isLoose=False)
88 
89  # Trigger content
90  JETM11SlimmingHelper.IncludeTriggerNavigation = False
91  JETM11SlimmingHelper.IncludeJetTriggerContent = False
92  JETM11SlimmingHelper.IncludeMuonTriggerContent = False
93  JETM11SlimmingHelper.IncludeEGammaTriggerContent = False
94  JETM11SlimmingHelper.IncludeTauTriggerContent = False
95  JETM11SlimmingHelper.IncludeEtMissTriggerContent = False
96  JETM11SlimmingHelper.IncludeBJetTriggerContent = False
97  JETM11SlimmingHelper.IncludeBPhysTriggerContent = False
98  JETM11SlimmingHelper.IncludeMinBiasTriggerContent = False
99 
100  # Output stream
101  JETM11ItemList = JETM11SlimmingHelper.GetItemList()
102  acc.merge(OutputStreamCfg(flags, "DAOD_JETM11", ItemList=JETM11ItemList, AcceptAlgs=["JETM11Kernel"]))
103  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_JETM11", AcceptAlgs=["JETM11Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
104 
105  return acc
106 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.JETM11.JETM11KernelCfg
def JETM11KernelCfg(flags, name='JETM11Kernel', **kwargs)
Definition: JETM11.py:43
python.JETM11.JETM11TriggerSkimmingToolCfg
def JETM11TriggerSkimmingToolCfg(flags)
Definition: JETM11.py:12
python.METTriggerDerivationContentConfig.addMETTriggerDerivationContent
def addMETTriggerDerivationContent(slimmingHelper, isLoose=True)
Definition: METTriggerDerivationContentConfig.py:120
python.JETM11.JETM11StringSkimmingToolCfg
def JETM11StringSkimmingToolCfg(flags)
Definition: JETM11.py:27
python.METTriggerDerivationContentConfig.TightMETTriggerDerivationKernelCfg
def TightMETTriggerDerivationKernelCfg(ConfigFlags, name, StreamName, skimmingTools)
Definition: METTriggerDerivationContentConfig.py:22
python.JETM11.JETM11Cfg
def JETM11Cfg(flags)
Definition: JETM11.py:63
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:14
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:219
SlimmingHelper
Definition: SlimmingHelper.py:1