ATLAS Offline Software
HION2.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 # HION2.py
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaConfiguration.Enums import MetadataCategory
7 from AthenaCommon.CFElements import seqAND
8 from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionToolCfg
9 
10 
13  """Configure the example skimming tool"""
14  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
15  acc = ComponentAccumulator()
16 
17  ExtraData = []
18  ExtraData += ['xAOD::VertexContainer/PrimaryVertices']
19 
20  acc.addSequence( seqAND("HION2Sequence") )
21  acc.getSequence("HION2Sequence").ExtraDataForDynamicConsumers = ExtraData
22  acc.getSequence("HION2Sequence").ProcessDynamicDataDependencies = True
23 
24  #Building jet skimming triggers
25  from DerivationFrameworkHI import ListTriggers
26 
27  triggers = []
28  triggers += ListTriggers.HION2MinBias2023()
29 
30  expression = ' ( ' +' || '.join(triggers) + ' ) && (count(abs(PrimaryVertices.z)<100)>1)'
31 
32  tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
33  acc.addPublicTool(CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "HION2StringSkimmingTool",
34  expression = expression,
35  TrigDecisionTool=tdt),
36  primary = True)
37  return(acc)
38 
40 
41 def InDetTrackSelectionTool_HITight_Cfg(flags, name="InDetTrackSelectionTool_HITight", **kwargs):
42  kwargs.setdefault("CutLevel", "HITight")
43  return InDetTrackSelectionToolCfg(flags, name, **kwargs)
44 
45 
47  """Configure the example augmentation tool"""
48  acc = ComponentAccumulator()
49 
50  from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_HILoose_Cfg
51 
52  TrkSelTool_hi_loose = acc.popToolsAndMerge(InDetTrackSelectionTool_HILoose_Cfg(flags,
53  name = "TrackSelectionTool_hi_loose",
54  minPt = 100))
55 
56  TrkSelTool_hi_tight = acc.popToolsAndMerge(InDetTrackSelectionTool_HITight_Cfg(flags,
57  name = "TrackSelectionTool_hi_tight",
58  minPt = 100))
59  acc.addPublicTool(TrkSelTool_hi_loose)
60  acc.addPublicTool(TrkSelTool_hi_tight)
61 
62  acc.addPublicTool(CompFactory.DerivationFramework.HITrackQualityAugmentationTool(name= "HION2AugmentationTool",
63  TrackSelectionTool_pp = TrkSelTool_hi_loose, #didnt find a tool for minbias
64  TrackSelectionTool_hi_loose =TrkSelTool_hi_loose,
65  TrackSelectionTool_hi_tight =TrkSelTool_hi_tight),
66  primary = True)
67  return(acc)
68 
69 def HION2KernelCfg(flags, name='HION2Kernel', **kwargs):
70  """Configure the derivation framework driving algorithm (kernel)"""
71  acc = ComponentAccumulator()
72 
73  skimmingTool = acc.getPrimaryAndMerge(HION2SkimmingToolCfg(flags))
74  augmentationTool = acc.getPrimaryAndMerge(HION2AugmentationToolCfg(flags))
75 
76  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
77  acc.addEventAlgo(DerivationKernel(name,
78  SkimmingTools = [skimmingTool],
79  AugmentationTools = [augmentationTool]),
80  sequenceName = "HION2Sequence")
81 
82  return acc
83 
84 def HION2Cfg(flags):
85 
86  acc = ComponentAccumulator()
87  acc.merge(HION2KernelCfg(flags, name="HION2Kernel",StreamName = "StreamDAOD_HION2"))
88 
89  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
90  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
91  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
92 
93 
95  from DerivationFrameworkHI import ListSlimming
96 
97  HION2SlimmingHelper = SlimmingHelper("HION2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
98 
99  AllVar = []
100  AllVar += ListSlimming.HION2AllVariablesGeneral()
101  AllVar += ListSlimming.HION2AllVariablesPbPb_2015_5TeV()
102  AllVar += ListSlimming.HION2AllVariablespPb_2016()
103 
104  ExtraVar = []
105  ExtraVar += ListSlimming.HION2ExtraVariablesGeneral()
106  ExtraVar += ListSlimming.HION2ExtraVariablesPbPb_2015_5TeV()
107 
108  HION2SlimmingHelper.AllVariables = AllVar
109  HION2SlimmingHelper.ExtraVariables = ExtraVar
110 
111  HION2ItemList = HION2SlimmingHelper.GetItemList()
112 
113  acc.merge(OutputStreamCfg(flags, "DAOD_HION2", ItemList=HION2ItemList, AcceptAlgs=["HION2Kernel"]))
114  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_HION2", AcceptAlgs=["HION2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
115 
116  return acc
python.HION2.HION2Cfg
def HION2Cfg(flags)
Definition: HION2.py:84
python.HION2.HION2KernelCfg
def HION2KernelCfg(flags, name='HION2Kernel', **kwargs)
Definition: HION2.py:69
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.HION2.InDetTrackSelectionTool_HITight_Cfg
def InDetTrackSelectionTool_HITight_Cfg(flags, name="InDetTrackSelectionTool_HITight", **kwargs)
Creating InDetTrackTools.
Definition: HION2.py:41
python.HION2.HION2SkimmingToolCfg
def HION2SkimmingToolCfg(flags)
Skiming.
Definition: HION2.py:12
python.InDetTrackSelectionToolConfig.InDetTrackSelectionToolCfg
def InDetTrackSelectionToolCfg(flags, name="InDetTrackSelectionTool", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:7
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
python.HION2.HION2AugmentationToolCfg
def HION2AugmentationToolCfg(flags)
Definition: HION2.py:46
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
python.InDetTrackSelectionToolConfig.InDetTrackSelectionTool_HILoose_Cfg
def InDetTrackSelectionTool_HILoose_Cfg(flags, name="InDetTrackSelectionTool_HILoose", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:68
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