ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileConditions
python
TileCablingSvcConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
"""Define method to construct configured Tile cabling service"""
4
5
from
AthenaConfiguration.AccumulatorCache
import
AccumulatorCache
6
from
AthenaConfiguration.ComponentFactory
import
CompFactory
7
from
AthenaConfiguration.Enums
import
LHCPeriod
8
9
10
@AccumulatorCache
11
def
TileCablingSvcCfg
(flags):
12
"""Return component accumulator with configured Tile cabling service
13
14
Arguments:
15
flags -- Athena configuration flags
16
"""
17
18
from
AthenaCommon.Logging
import
logging
19
msg = logging.getLogger(
'TileCablingSvc'
)
20
21
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
22
acc = ComponentAccumulator()
23
24
from
TileGeoModel.TileGMConfig
import
TileGMCfg
25
acc.merge( TileGMCfg(flags) )
26
27
tileCablingSvc = CompFactory.TileCablingSvc()
28
29
geometry = flags.GeoModel.AtlasVersion
30
31
if
geometry.startswith(
'ATLAS-CTB'
):
32
tileCablingSvc.CablingType = -1
33
msg.info(
"Forcing TestBeam cabling for geometry %s"
, geometry)
34
elif
not
flags.Common.isOnline:
35
runNumber = flags.Input.RunNumbers[0]
36
if
flags.Input.OverrideRunNumber > 0:
37
from
AthenaKernel.EventIdOverrideConfig
import
getMinMaxRunNumbers
38
runNumber = getMinMaxRunNumbers(flags)[0]
39
if
flags.GeoModel.Run
is
LHCPeriod.Run1:
40
if
runNumber > 219651:
41
# Choose RUN2 cabling for old geometry tags starting from 26-MAR-2013
42
tileCablingSvc.CablingType = 4
43
msg.warning(
"Forcing RUN2 cabling for run %s with geometry %s"
, runNumber, geometry)
44
45
elif
flags.GeoModel.Run
is
LHCPeriod.Run2:
46
if
(flags.Input.isMC
and
runNumber >= 310000)
or
runNumber >= 343000
or
runNumber < 1:
47
# Choose RUN2a cabling for R2 geometry tags starting from 31-Jan-2018
48
tileCablingSvc.CablingType = 5
49
msg.info(
"Forcing RUN2a (2018) cabling for run %s with geometry %s"
, runNumber, geometry)
50
51
else
:
52
tileCablingSvc.CablingType = 4
53
msg.info(
"Forcing RUN2 (2014-2017) cabling for run %s with geometry %s"
, runNumber, geometry)
54
elif
flags.GeoModel.Run
is
LHCPeriod.Run3:
55
tileCablingSvc.CablingType = 6
56
msg.info(
"Forcing RUN3 cabling for run %s with geometry %s"
, flags.GeoModel.Run.value, geometry)
57
else
:
#Running online or simulating running online: either way, do not access run number
58
if
flags.GeoModel.Run
is
LHCPeriod.Run1:
59
tileCablingSvc.CablingType = 4
60
msg.warning(
"Forcing RUN2 (2014-2017) cabling for unknown run number and geometry %s"
, geometry)
61
if
flags.GeoModel.Run
is
LHCPeriod.Run2:
62
tileCablingSvc.CablingType = 5
63
msg.info(
"Forcing RUN2a (2018) cabling for online run with geometry %s"
, geometry)
64
elif
flags.GeoModel.Run
is
LHCPeriod.Run3:
65
tileCablingSvc.CablingType = 6
66
msg.info(
"Forcing RUN3 cabling for online run with geometry %s"
, geometry)
67
elif
flags.GeoModel.Run
is
LHCPeriod.Run4:
68
tileCablingSvc.CablingType = 6
69
msg.warning(
"Forcing RUN3 cabling beyond Run3 for online run with geometry %s"
, geometry)
70
else
:
71
msg.error(
"Tile Cabling version not set for %s"
, geometry)
72
73
acc.addService(tileCablingSvc, primary =
True
)
74
75
return
acc
76
77
78
if
__name__ ==
"__main__"
:
79
80
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
81
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
82
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles
83
from
AthenaCommon.Logging
import
log
84
from
AthenaCommon.Constants
import
DEBUG
85
86
# Test setup
87
log.setLevel(DEBUG)
88
89
flags = initConfigFlags()
90
flags.Input.Files = defaultTestFiles.RAW_RUN2
91
flags.lock()
92
93
acc = ComponentAccumulator()
94
acc.merge(
TileCablingSvcCfg
(flags) )
95
96
acc.printConfig(withDetails =
True
, summariseProps =
True
)
97
print
(acc.getService(
'TileCablingSvc'
))
98
acc.store( open(
'TileCablingSvc.pkl'
,
'wb'
) )
99
100
print
(
'All OK'
)
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
Constants
python.TileCablingSvcConfig.TileCablingSvcCfg
TileCablingSvcCfg(flags)
Definition
TileCablingSvcConfig.py:11
Generated on
for ATLAS Offline Software by
1.17.0