ATLAS Offline Software
Loading...
Searching...
No Matches
HION14.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2#====================================================================
3# HION14.py
4# author: Mariana Vivas <mariana.vivas.albornoz@cern.ch>
5# Application: Open Data
6#====================================================================
7
8from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9from AthenaConfiguration.ComponentFactory import CompFactory
10from AthenaConfiguration.Enums import MetadataCategory
11
12#Skiming
14 """Configure the example skimming tool"""
15 #Building jet skimming triggers
16 triggers = ["HLT_mb_sptrk_ion_L1ZDC_A_C_VTE50","HLT_noalg_mb_L1TE50"]
17
18 expression = ' ( ' +' || '.join(triggers) + ' )'
19
20 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
21 xAODStringSkimmingToolCfg)
22 return xAODStringSkimmingToolCfg(flags, name = "HION14StringSkimmingTool",
23 expression = expression)
24
26 """Configure the example augmentation tool"""
27 acc = ComponentAccumulator()
28
29 # Configure the augmentation tool
30 # This adds FCalEtA, FCalEtC, ...
31 augmentation_tool = CompFactory.DerivationFramework.HIGlobalAugmentationTool(name="HION14AugmentationTool",
32 nHarmonic=5 # to capture higher-order harmonics for anisotropic flow
33 )
34 acc.addPublicTool(augmentation_tool, primary=True)
35
36 return acc
37
39 """Configure the example augmentation tool"""
40 acc = ComponentAccumulator()
41
42 # Configure track selection tools
43 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
44 InDetTrackSelectionTool_HITight_Cfg )
45
46 HITightTrackSelector = acc.popToolsAndMerge(InDetTrackSelectionTool_HITight_Cfg(flags,
47 name="HITightTrackSelector",
48 minPt=100
49 )
50 )
51
52 # Add track selection tools to the ComponentAccumulator
53 acc.addPublicTool(HITightTrackSelector)
54
55 # Adding the decoration for HITight
56 HITightDecorator = CompFactory.DerivationFramework.InDetTrackSelectionToolWrapper(name='HION14TighDecorator',
57 TrackSelectionTool=HITightTrackSelector,
58 DecorationName='HITight',
59 ContainerName="InDetTrackParticles"
60 )
61
62 # Merge the ComponentAccumulator returned by the decorator configuration
63 acc.addPublicTool(HITightDecorator, primary=True)
64
65 return acc
66
68 """Configure the example augmentation tool"""
69 acc = ComponentAccumulator()
70
71 # Centrality tool
72 HICentralityDecorator = CompFactory.DerivationFramework.HICentralityDecorationTool(name="HION14CentralityTool")
73
74 # Add centrality tools to the ComponentAccumulator
75 acc.addPublicTool(HICentralityDecorator, primary=True)
76
77 return acc
78
79def HION14KernelCfg(flags, name='HION14Kernel', **kwargs):
80 """Configure the derivation framework driving algorithm (kernel)"""
81 acc = ComponentAccumulator()
82 skimmingTool = []
83 # Only apply the triggers to data (it doesn't work on MC for a unknown reason)
84 if not flags.Input.isMC:
85 triggers = acc.getPrimaryAndMerge(HION14SkimmingToolCfg(flags))
86 skimmingTool += [triggers]
87
88
89 thinningTool = []
90
91 # Loose thinning
92 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
93 InDetTrackSelectionTool_HILoose_Cfg)
94
95 HILooseTrackSelector = acc.popToolsAndMerge(InDetTrackSelectionTool_HILoose_Cfg(flags,
96 name = "HION14TrackSelectionToolLoose",
97 minPt = 100
98 )
99 )
100
101 acc.addPublicTool(HILooseTrackSelector)
102
103 HION14TrackThinningTool = CompFactory.DerivationFramework.HITrackParticleThinningTool(name="HION14TrackThinningTool",
104 #InDetTrackParticlesKey="InDetTrackParticles",
105 PrimaryVertexKey="PrimaryVertices",
106 PrimaryVertexSelection="sumPt2",
107 TrackSelectionTool=HILooseTrackSelector
108 )
109
110 acc.addPublicTool(HION14TrackThinningTool)
111 thinningTool += [HION14TrackThinningTool]
112
113 # Muon thinning
114 muonThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name="HION14MuonThinningTool",
115 MuonKey = "Muons",
116 InDetTrackParticlesKey = "InDetTrackParticles")
117
118 acc.addPublicTool(muonThinningTool)
119 thinningTool += [muonThinningTool]
120
121 # Truth thinning
122 if flags.Input.isMC:
123 truth_thinning_expression = "(TruthParticles.isStable) && ( (TruthParticles.pdgId != 2112 && TruthParticles.pdgId != 2212) || TruthParticles.pt > 0.1 )"
124
125 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import GenericTruthThinningCfg
126
127 HION14TruthThinningTool = acc.getPrimaryAndMerge(GenericTruthThinningCfg(flags,
128 name="HION14TruthThinningTool",
129 StreamName=kwargs['StreamName'],
130 ParticleSelectionString=truth_thinning_expression
131 )
132 )
133
134 thinningTool += [HION14TruthThinningTool]
135
136
138 globalAugmentationTool = acc.getPrimaryAndMerge(HION14GlobalAugmentationToolCfg(flags))
139 tightAugmentationTool = acc.getPrimaryAndMerge(HION14TightAugmentationToolCfg(flags))
140 centralityAugmentatioTool = acc.getPrimaryAndMerge(HION14CentralityAugmentationToolCfg(flags))
141 augmentationTool = [globalAugmentationTool, tightAugmentationTool, centralityAugmentatioTool]
142
143 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
144 acc.addEventAlgo(DerivationKernel(name,
145 SkimmingTools= skimmingTool,
146 ThinningTools=thinningTool,
147 AugmentationTools=augmentationTool
148 ),
149 )
150
151 return acc
152
153def HION14Cfg(flags):
154 acc = ComponentAccumulator()
155 acc.merge(HION14KernelCfg(flags, name="HION14Kernel", StreamName="StreamDAOD_HION14"))
156
157 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
158 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
159 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
160
161
162 from DerivationFrameworkHI import ListSlimming
163
164 HION14SlimmingHelper = SlimmingHelper("HION14SlimmingHelper", NamesAndTypes=flags.Input.TypedCollections, flags=flags)
165
166 HION14SlimmingHelper.SmartCollections = ListSlimming.HION14SmartCollections()
167 # For these variables we want all the branches
168 HION14SlimmingHelper.AllVariables = ListSlimming.HION14AllVariablesGeneral()
169 # These are selected branches
170 HION14SlimmingHelper.ExtraVariables = ListSlimming.HION14ExtraContentAll()
171
172 # Truth information
173 if flags.Input.isMC:
174 HION14SlimmingHelper.ExtraVariables +=ListSlimming.HION14ExtraContentAllTruth()
175 HION14SlimmingHelper.AllVariables += ListSlimming.HION14TruthVariablesGeneral()
176
177
178 HION14ItemList = HION14SlimmingHelper.GetItemList()
179
180 acc.merge(OutputStreamCfg(flags, "DAOD_HION14", ItemList=HION14ItemList, AcceptAlgs=["HION14Kernel"]))
181 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_HION14", AcceptAlgs=["HION14Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
182
183 return acc
184
HION14TightAugmentationToolCfg(flags)
Definition HION14.py:38
HION14GlobalAugmentationToolCfg(flags)
Definition HION14.py:25
HION14SkimmingToolCfg(flags)
Definition HION14.py:13
HION14Cfg(flags)
Definition HION14.py:153
HION14KernelCfg(flags, name='HION14Kernel', **kwargs)
Definition HION14.py:79
HION14CentralityAugmentationToolCfg(flags)
Definition HION14.py:67