3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.Enums
import BeamType, MetadataCategory
10 """ Configure the TrackTools tool """
14 from TrackToCalo.TrackToCaloConfig
import ParticleCaloExtensionToolCfg
15 kwargs.setdefault(
'ParticleCaloExtensionTool', acc.popToolsAndMerge(
18 kwargs.setdefault(
'IsCollision', flags.Beam.Type
is BeamType.Collisions)
20 TrackTools = CompFactory.TileCal.TrackTools
26 """ Configure the Tile Cells Muon decorator augmentation tool """
30 from TileGeoModel.TileGMConfig
import TileGMCfg
33 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
36 kwargs.setdefault(
'name',
'TCAL1TileCellsMuonDecorator')
37 kwargs.setdefault(
'Prefix',
'TCAL1_')
38 kwargs.setdefault(
'SelectMuons', flags.Beam.Type
is BeamType.Collisions)
39 kwargs.setdefault(
'MinMuonPt', 10 * GeV)
40 kwargs.setdefault(
'MaxAbsMuonEta', 1.7)
41 kwargs.setdefault(
'IsoCone', 0.4)
42 kwargs.setdefault(
'MaxRelETrkInIsoCone', 100000)
46 TileCellsDecorator = CompFactory.DerivationFramework.TileCellsDecorator
47 kwargs.setdefault(
'CellsDecorator', TileCellsDecorator(Prefix=kwargs[
'Prefix']))
49 kwargs.setdefault(
'TracksInConeTool', CompFactory.xAOD.TrackParticlesInConeTool())
51 TileCellsMuonDecorator = CompFactory.DerivationFramework.TileCellsMuonDecorator
52 acc.addPublicTool(TileCellsMuonDecorator(**kwargs), primary =
True)
58 """Configure TCAL1 derivation framework skimming tool"""
60 prefix = kwargs.pop(
'Prefix',
'TCAL1_')
62 from TrigDecisionTool.TrigDecisionToolConfig
import TrigDecisionToolCfg
66 selectionExpression =
""
67 if flags.Beam.Type
is BeamType.Collisions:
68 selectionExpression = f
'(Muons.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500 + 0.4 * Muons.neflowisol20) / Muons.pt < 0.18 && Muons.{prefix}SelectedMuon'
70 selectionExpression =
'abs(Muons.eta) < 1.7'
72 skimmingExpression = f
'count({selectionExpression}) > 0'
74 kwargs.setdefault(
'name',
'TCAL1StringSkimmingTool')
75 kwargs.setdefault(
'expression', skimmingExpression)
76 kwargs.setdefault(
'TrigDecisionTool', tdt)
78 xAODStringSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool
79 acc.addPublicTool(xAODStringSkimmingTool(**kwargs), primary =
True)
85 """Configure TCAL1 derivation framework thinning tool"""
89 kwargs[
'StreamName'] = streamName
90 kwargs.setdefault(
'name',
'TCAL1MuonTPThinningTool')
91 kwargs.setdefault(
'MuonKey',
'Muons')
92 kwargs.setdefault(
'InDetTrackParticlesKey',
'InDetTrackParticles')
94 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg
97 acc.addPublicTool(muonTPThinningTool, primary =
True)
103 """Configure the TCAL1 derivation framework driving algorithm (kernel)"""
107 prefix = kwargs.pop(
'Prefix',
'TCAL1_')
108 streamName = kwargs.pop(
'StreamName',
'StreamDAOD_TCAL1')
111 triggerListsHelper = kwargs.pop(
'TriggerListsHelper',
'TriggerListsHelper')
112 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
116 kwargs.setdefault(
'AugmentationTools', [cellsMuonDecorator])
119 kwargs.setdefault(
'SkimmingTools', [skimmingTool])
122 kwargs.setdefault(
'ThinningTools', [thinningTool])
124 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
131 """Configure the TCAL1 derivation framework"""
133 TCAL1Prefix =
'TCAL1_'
134 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
135 TCAL1TriggerListsHelper = TriggerListsHelper(flags)
138 acc.merge(
TCAL1KernelCfg(flags, name=
"TCAL1Kernel", StreamName=
"StreamDAOD_TCAL1", Prefix=TCAL1Prefix, TriggerListsHelper=TCAL1TriggerListsHelper))
140 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
141 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
142 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
143 TCAL1SlimmingHelper =
SlimmingHelper(
"TCAL1SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
144 TCAL1SlimmingHelper.SmartCollections = [
'EventInfo',
'Muons',
'AntiKt4EMTopoJets',
'AntiKt4EMPFlowJets',
'MET_Baseline_AntiKt4EMTopo',
'MET_Baseline_AntiKt4EMPFlow',
'PrimaryVertices',
'BTagging_AntiKt4EMPFlow']
146 TCAL1ExtraVariables = f
'Muons.{TCAL1Prefix}etrkcone40'
148 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_'.
join([
'',
'energy',
'et',
'eta',
'phi',
'gain',
'bad',
'time',
'quality'])
149 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_'.
join([
'',
'sampling',
'sinTh',
'cosTh',
'cotTh',
'x',
'y',
'z'])
151 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_'.
join([
'',
'side',
'section',
'module',
'tower',
'sample'])
152 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_'.
join([
'',
'r',
'dx',
'dy',
'dz',
'dr',
'dphi',
'deta',
'volume'])
154 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_muon_'.
join([
'',
'dx',
'dedx',
'x',
'y',
'z',
'eta',
'phi'])
155 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_to_muon_'.
join([
'',
'dx',
'dy',
'dz',
'deta',
'dphi'])
157 for pmt
in [
'pmt1',
'pmt2']:
158 TCAL1ExtraVariables += f
'.{TCAL1Prefix}cells_{pmt}_'.
join([
'',
'ros',
'drawer',
'channel',
'energy',
'time',
'quality',
'qbit',
'bad',
'gain'])
160 TCAL1SlimmingHelper.ExtraVariables = [TCAL1ExtraVariables]
164 if flags.Trigger.EDMVersion == 2:
165 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
167 OutputContainerPrefix =
"TrigMatch_",
168 TriggerList = TCAL1TriggerListsHelper.Run2TriggerNamesTau)
170 OutputContainerPrefix =
"TrigMatch_",
171 TriggerList = TCAL1TriggerListsHelper.Run2TriggerNamesNoTau)
173 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
174 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
177 TCAL1ItemList = TCAL1SlimmingHelper.GetItemList()
178 acc.merge(
OutputStreamCfg(flags,
"DAOD_TCAL1", ItemList=TCAL1ItemList, AcceptAlgs=[
"TCAL1Kernel"]))
179 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_TCAL1", AcceptAlgs=[
"TCAL1Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))