ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkTileCal
python
TCAL2.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
from
AthenaConfiguration.Enums
import
LHCPeriod, MetadataCategory
6
7
def
TCAL2MbtsToVectorsToolCfg
(flags, **kwargs):
8
""" Configure the MbtsToVectorsTool augmentation tool """
9
10
acc = ComponentAccumulator()
11
12
from
TileGeoModel.TileGMConfig
import
TileGMCfg
13
acc.merge(TileGMCfg(flags))
14
15
from
LArGeoAlgsNV.LArGMConfig
import
LArGMCfg
16
acc.merge(LArGMCfg(flags))
17
18
kwargs.setdefault(
'name'
,
'TCAL2MbtsToVectorsTool'
)
19
prefix = kwargs.pop(
'Prefix'
,
'TCAL2_mbts_'
)
20
kwargs.setdefault(
"Energy"
, prefix +
"energy"
)
21
kwargs.setdefault(
"Time"
, prefix +
"time"
)
22
kwargs.setdefault(
"Eta"
, prefix +
"eta"
)
23
kwargs.setdefault(
"Phi"
, prefix +
"phi"
)
24
kwargs.setdefault(
"Quality"
, prefix +
"quality"
)
25
kwargs.setdefault(
"Type"
, prefix +
"type"
)
26
kwargs.setdefault(
"Module"
, prefix +
"module"
)
27
kwargs.setdefault(
"Channel"
, prefix +
"channel"
)
28
kwargs.setdefault(
'SaveEtaPhiInfo'
,
True
)
29
kwargs.setdefault(
'CellContainer'
,
'MBTSContainer'
)
30
31
acc.setPrivateTools(CompFactory.DerivationFramework.MbtsToVectorsTool(**kwargs))
32
33
return
acc
34
35
36
def
TCAL2E4prToVectorsToolCfg
(flags, **kwargs):
37
""" Configure the E4prToVectorsTool augmentation tool """
38
39
kwargs.setdefault(
'name'
,
'TCAL2E4prToVectorsTool'
)
40
kwargs.setdefault(
'Prefix'
,
'TCAL2_e4pr'
)
41
kwargs.setdefault(
'SaveEtaPhiInfo'
,
False
)
42
kwargs.setdefault(
'CellContainer'
,
'E4prContainer'
)
43
return
TCAL2MbtsToVectorsToolCfg
(flags, **kwargs)
44
45
46
def
TCAL2KernelCfg
(flags, name='TCAL2Kernel', **kwargs):
47
"""Configure the TCAL2 derivation framework driving algorithm (kernel)"""
48
49
acc = ComponentAccumulator()
50
51
prefix = kwargs.pop(
'Prefix'
,
'TCAL2_'
)
52
53
cellsToVectorstools = []
54
if
flags.GeoModel.Run
in
[LHCPeriod.Run1, LHCPeriod.Run2, LHCPeriod.Run3]:
55
cellsToVectorstools.append( acc.addPublicTool(acc.popToolsAndMerge(
TCAL2MbtsToVectorsToolCfg
(flags, Prefix=f
'{prefix}mbts_'
))) )
56
if
flags.GeoModel.Run
is
LHCPeriod.Run2:
57
cellsToVectorstools.append ( acc.addPublicTool(acc.popToolsAndMerge(
TCAL2E4prToVectorsToolCfg
(flags, Prefix=f
'{prefix}e4pr_'
))) )
58
59
DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
60
acc.addEventAlgo(DerivationKernel(name, AugmentationTools = cellsToVectorstools))
61
62
return
acc
63
64
def
TCAL2Cfg
(flags):
65
"""Configure the TCAL1 derivation framework"""
66
67
TCAL2Prefix =
'TCAL2_'
68
69
acc = ComponentAccumulator()
70
acc.merge(
TCAL2KernelCfg
(flags, name=
"TCAL2Kernel"
, StreamName =
"StreamDAOD_TCAL2"
, Prefix=TCAL2Prefix))
71
72
from
OutputStreamAthenaPool.OutputStreamConfig
import
OutputStreamCfg
73
from
xAODMetaDataCnv.InfileMetaDataConfig
import
SetupMetaDataForStreamCfg
74
from
DerivationFrameworkCore.SlimmingHelper
import
SlimmingHelper
75
TCAL2SlimmingHelper =
SlimmingHelper
(
"TCAL2SlimmingHelper"
, NamesAndTypes = flags.Input.TypedCollections, flags = flags)
76
TCAL2SlimmingHelper.SmartCollections = [
"EventInfo"
]
77
78
if
flags.GeoModel.Run
in
[LHCPeriod.Run1, LHCPeriod.Run2, LHCPeriod.Run3]:
79
mbtsItems = [f
'std::vector<float>#TCAL2_mbts_{item}'
for
item
in
[
'energy'
,
'time'
,
'eta'
,
'phi'
]]
80
mbtsItems += [f
'std::vector<int>#TCAL2_mbts_{item}'
for
item
in
[
'quality'
,
'module'
,
'channel'
,
'type'
]]
81
TCAL2SlimmingHelper.StaticContent = mbtsItems
82
if
flags.GeoModel.Run
is
LHCPeriod.Run2:
83
e4prItems = [f
'std::vector<float>#TCAL2_e4pr_{item}'
for
item
in
[
'energy'
,
'time'
]]
84
e4prItems += [
'std::vector<int>#TCAL2_e4pr_{item}'
for
item
in
[
'quality'
,
'module'
,
'channel'
,
'type'
]]
85
TCAL2SlimmingHelper.StaticContent += e4prItems
86
TCAL2ItemList = TCAL2SlimmingHelper.GetItemList()
87
88
acc.merge(OutputStreamCfg(flags,
"DAOD_TCAL2"
, ItemList=TCAL2ItemList, AcceptAlgs=[
"TCAL2Kernel"
]))
89
acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_TCAL2"
, AcceptAlgs=[
"TCAL2Kernel"
], createMetadata=[MetadataCategory.CutFlowMetaData]))
90
91
return
acc
TCAL2.TCAL2Cfg
TCAL2Cfg(flags)
Definition
TCAL2.py:64
TCAL2.TCAL2KernelCfg
TCAL2KernelCfg(flags, name='TCAL2Kernel', **kwargs)
Definition
TCAL2.py:46
TCAL2.TCAL2MbtsToVectorsToolCfg
TCAL2MbtsToVectorsToolCfg(flags, **kwargs)
Definition
TCAL2.py:7
TCAL2.TCAL2E4prToVectorsToolCfg
TCAL2E4prToVectorsToolCfg(flags, **kwargs)
Definition
TCAL2.py:36
SlimmingHelper
Definition
getLabel.h:34
Generated on
for ATLAS Offline Software by
1.17.0