ATLAS Offline Software
JETM14.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_JETM14.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  singleMuTriggers = TriggerLists.single_mu_Trig(flags)
18 
19  JETM14TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool( name = "JETM14TrigSkimmingTool1",
20  TriggerListOR = singleMuTriggers)
21 
22  acc.addPublicTool(JETM14TrigSkimmingTool, primary=True)
23 
24  return acc
25 
27  """Configure the string skimming tool"""
28 
29  acc = ComponentAccumulator()
30 
31  cutExpression = "(count(Muons.DFCommonMuonPassPreselection && Muons.pt > (20*GeV) && abs(Muons.eta) < 2.7) ) >= 2"
32 
33  JETM14StringSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM14StringSkimmingTool",
34  expression = cutExpression)
35 
36  acc.addPublicTool(JETM14StringSkimmingTool, primary=True)
37 
38  return(acc)
39 
40 
41 # Main algorithm config
42 def JETM14KernelCfg(flags, name='JETM14Kernel', **kwargs):
43  """Configure the derivation framework driving algorithm (kernel) for JETM14"""
44  acc = ComponentAccumulator()
45 
46  # Skimming
47  skimmingTools = []
48  skimmingTools.append(acc.getPrimaryAndMerge(JETM14TriggerSkimmingToolCfg(flags)))
49  skimmingTools.append(acc.getPrimaryAndMerge(JETM14StringSkimmingToolCfg(flags)))
50 
51  # Common augmentations
52  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
53  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
54 
55  # Derivation kernel:
56  from DerivationFrameworkJetEtMiss.METTriggerDerivationContentConfig import LooseMETTriggerDerivationKernelCfg
57  acc.merge(LooseMETTriggerDerivationKernelCfg(flags, name="JETM14Kernel", skimmingTools = skimmingTools, StreamName = 'StreamDAOD_JETM14'))
58 
59  return acc
60 
61 
62 def JETM14Cfg(flags):
63 
64  acc = ComponentAccumulator()
65 
66  # Get the lists of triggers needed for trigger matching.
67  # This is needed at this scope (for the slimming) and further down in the config chain
68  # for actually configuring the matching, so we create it here and pass it down
69  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
70  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
71  JETM14TriggerListsHelper = TriggerListsHelper(flags)
72 
73  # Skimming, thinning, augmentation
74  acc.merge(JETM14KernelCfg(flags, name="JETM14Kernel", StreamName = 'StreamDAOD_JETM14', TriggerListsHelper = JETM14TriggerListsHelper))
75 
76  # ============================
77  # Define contents of the format
78  # =============================
79  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
80  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
81  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
82 
83  JETM14SlimmingHelper = SlimmingHelper("JETM14SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
84 
85  from DerivationFrameworkJetEtMiss.METTriggerDerivationContentConfig import addMETTriggerDerivationContent
86  addMETTriggerDerivationContent(JETM14SlimmingHelper, isLoose=True)
87 
88  # Trigger content
89  JETM14SlimmingHelper.IncludeTriggerNavigation = False
90  JETM14SlimmingHelper.IncludeJetTriggerContent = False
91  JETM14SlimmingHelper.IncludeMuonTriggerContent = False
92  JETM14SlimmingHelper.IncludeEGammaTriggerContent = False
93  JETM14SlimmingHelper.IncludeTauTriggerContent = False
94  JETM14SlimmingHelper.IncludeEtMissTriggerContent = False
95  JETM14SlimmingHelper.IncludeBJetTriggerContent = False
96  JETM14SlimmingHelper.IncludeBPhysTriggerContent = False
97  JETM14SlimmingHelper.IncludeMinBiasTriggerContent = False
98 
99  # Output stream
100  JETM14ItemList = JETM14SlimmingHelper.GetItemList()
101  acc.merge(OutputStreamCfg(flags, "DAOD_JETM14", ItemList=JETM14ItemList, AcceptAlgs=["JETM14Kernel"]))
102  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_JETM14", AcceptAlgs=["JETM14Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
103 
104  return acc
105 
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.JETM14.JETM14TriggerSkimmingToolCfg
def JETM14TriggerSkimmingToolCfg(flags)
Definition: JETM14.py:12
python.METTriggerDerivationContentConfig.addMETTriggerDerivationContent
def addMETTriggerDerivationContent(slimmingHelper, isLoose=True)
Definition: METTriggerDerivationContentConfig.py:120
python.METTriggerDerivationContentConfig.LooseMETTriggerDerivationKernelCfg
def LooseMETTriggerDerivationKernelCfg(ConfigFlags, name, StreamName, skimmingTools)
Definition: METTriggerDerivationContentConfig.py:7
python.JETM14.JETM14KernelCfg
def JETM14KernelCfg(flags, name='JETM14Kernel', **kwargs)
Definition: JETM14.py:42
python.JETM14.JETM14StringSkimmingToolCfg
def JETM14StringSkimmingToolCfg(flags)
Definition: JETM14.py:26
python.JETM14.JETM14Cfg
def JETM14Cfg(flags)
Definition: JETM14.py:62
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