ATLAS Offline Software
TileCondToolsTestConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 """Define methods to construct configured Tile conditions tools for tests"""
4 
5 
7  """Test Tile conditions tools configuration and return component accumulator"""
8 
9  from AthenaCommon.Logging import logging
10  msg = logging.getLogger('TileCondToolsTestCfg')
11 
12  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13  acc = ComponentAccumulator()
14 
15  from .TileEMScaleConfig import TileCondToolEmscaleCfg
16  emScaleTool = acc.popToolsAndMerge( TileCondToolEmscaleCfg(flags) )
17  msg.info(emScaleTool)
18 
19  from .TileEMScaleConfig import TileExpertToolEmscaleCfg
20  emScaleExpertTool = acc.popToolsAndMerge( TileExpertToolEmscaleCfg(flags) )
21  msg.info(emScaleExpertTool)
22 
23  from .TileBadChannelsConfig import TileBadChanToolCfg
24  badChanTool = acc.popToolsAndMerge( TileBadChanToolCfg(flags) )
25  msg.info(badChanTool)
26 
27  from .TileMuIDConfig import TileCondToolMuIDCfg
28  muIDTool = acc.popToolsAndMerge( TileCondToolMuIDCfg(flags) )
29  msg.info(muIDTool)
30 
31  from .TileIntegratorConfig import TileCondToolIntegratorCfg
32  integratorTool = acc.popToolsAndMerge( TileCondToolIntegratorCfg(flags) )
33  msg.info(integratorTool)
34 
35  from .TileTimingConfig import TileCondToolTimingCfg
36  timingTool = acc.popToolsAndMerge( TileCondToolTimingCfg(flags) )
37  msg.info(timingTool)
38 
39  from .TileTimingConfig import TileCondToolOnlineTimingCfg
40  onlineTimingTool = acc.popToolsAndMerge( TileCondToolOnlineTimingCfg(flags) )
41  msg.info(onlineTimingTool)
42 
43  from .TileOFCConfig import TileCondToolOfcCoolCfg
44  ofcCoolTool = acc.popToolsAndMerge( TileCondToolOfcCoolCfg(flags) )
45  msg.info(ofcCoolTool)
46 
47  from .TileSampleNoiseConfig import TileCondToolNoiseSampleCfg
48  if flags.Common.isOnline:
49  accSampleNoise = TileCondToolNoiseSampleCfg(flags)
50  else:
51  accSampleNoise = TileCondToolNoiseSampleCfg(flags,
52  TileSampleNoise = 'TileSampleNoise',
53  TileOnlineSampleNoise = 'TileOnlineSampleNoise')
54 
55  sampleNoiseTool = acc.popToolsAndMerge( accSampleNoise )
56  msg.info(sampleNoiseTool)
57 
58  if flags.IOVDb.DatabaseInstance == 'CONDBR2':
59  from .TileTMDBConfig import TileCondToolTMDBCfg
60  tmdbTool = acc.popToolsAndMerge( TileCondToolTMDBCfg(flags) )
61  msg.info(tmdbTool)
62 
63  from .TileDSPThresholdConfig import TileCondToolDspThresholdCfg
64  dspThrTool = acc.popToolsAndMerge( TileCondToolDspThresholdCfg(flags) )
65  msg.info(dspThrTool)
66 
67  if not (flags.IOVDb.DatabaseInstance == 'CONDBR2' and flags.Common.isOnline):
68  from .TilePulseShapeConfig import TileCondToolPulseShapeCfg
69  pulseShapeTool = acc.popToolsAndMerge( TileCondToolPulseShapeCfg(flags) )
70  msg.info(pulseShapeTool)
71 
72  from .TilePulseShapeConfig import TileCondToolMuRcvPulseShapeCfg
73  muRcvPulseShapeTool = acc.popToolsAndMerge( TileCondToolMuRcvPulseShapeCfg(flags) )
74  msg.info(muRcvPulseShapeTool)
75 
76  from .TileAutoCorrelationConfig import TileCondToolAutoCrCfg
77  autoCorrelationTool = acc.popToolsAndMerge( TileCondToolAutoCrCfg(flags) )
78  msg.info(autoCorrelationTool)
79 
80  from .TileOFCConfig import TileCondToolOfcCfg
81  ofcTool = acc.popToolsAndMerge( TileCondToolOfcCfg(flags) )
82  msg.info(ofcTool)
83 
84 
85  if not (flags.Input.isMC or flags.Common.isOnline):
86  from TileConditions.TileDCSConfig import TileDCSToolCfg
87  dcsTool = acc.popToolsAndMerge( TileDCSToolCfg(flags) )
88  msg.info(dcsTool)
89 
90  return acc
91 
92 
93 if __name__ == "__main__":
94 
95  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
96  from AthenaConfiguration.AllConfigFlags import initConfigFlags
97  from AthenaConfiguration.TestDefaults import defaultTestFiles
98  from AthenaCommon.Logging import log
99  from AthenaCommon.Constants import DEBUG
100 
101  # Test setup
102  log.setLevel(DEBUG)
103 
104  flags = initConfigFlags()
105  flags.Input.Files = defaultTestFiles.RAW_RUN2
106  flags.lock()
107 
109  acc.merge( TileCondToolsTestCfg(flags) )
110 
111  acc.printConfig(withDetails = True, summariseProps = True)
112  print(acc.getService('IOVDbSvc'))
113  acc.store( open('TileCondTools.pkl','wb') )
114 
115  print('All OK')
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TileIntegratorConfig.TileCondToolIntegratorCfg
def TileCondToolIntegratorCfg(flags, **kwargs)
Definition: TileIntegratorConfig.py:59
python.TileSampleNoiseConfig.TileCondToolNoiseSampleCfg
def TileCondToolNoiseSampleCfg(flags, **kwargs)
Definition: TileSampleNoiseConfig.py:69
python.TileTimingConfig.TileCondToolTimingCfg
def TileCondToolTimingCfg(flags, **kwargs)
Definition: TileTimingConfig.py:77
python.TileDSPThresholdConfig.TileCondToolDspThresholdCfg
def TileCondToolDspThresholdCfg(flags, **kwargs)
Definition: TileDSPThresholdConfig.py:60
python.TileBadChannelsConfig.TileBadChanToolCfg
def TileBadChanToolCfg(flags, **kwargs)
Definition: TileBadChannelsConfig.py:83
python.TileOFCConfig.TileCondToolOfcCoolCfg
def TileCondToolOfcCoolCfg(flags, **kwargs)
Definition: TileOFCConfig.py:66
python.TileTimingConfig.TileCondToolOnlineTimingCfg
def TileCondToolOnlineTimingCfg(flags, **kwargs)
Definition: TileTimingConfig.py:111
python.TileTMDBConfig.TileCondToolTMDBCfg
def TileCondToolTMDBCfg(flags, **kwargs)
Definition: TileTMDBConfig.py:76
python.TileDCSConfig.TileDCSToolCfg
def TileDCSToolCfg(flags, **kwargs)
Definition: TileDCSConfig.py:68
python.TileMuIDConfig.TileCondToolMuIDCfg
def TileCondToolMuIDCfg(flags, **kwargs)
Definition: TileMuIDConfig.py:56
python.TileAutoCorrelationConfig.TileCondToolAutoCrCfg
def TileCondToolAutoCrCfg(flags, **kwargs)
Definition: TileAutoCorrelationConfig.py:63
python.TilePulseShapeConfig.TileCondToolPulseShapeCfg
def TileCondToolPulseShapeCfg(flags, **kwargs)
Definition: TilePulseShapeConfig.py:86
Constants
some useful constants -------------------------------------------------—
python.TileEMScaleConfig.TileExpertToolEmscaleCfg
def TileExpertToolEmscaleCfg(flags, **kwargs)
Definition: TileEMScaleConfig.py:155
python.TileEMScaleConfig.TileCondToolEmscaleCfg
def TileCondToolEmscaleCfg(flags, **kwargs)
Definition: TileEMScaleConfig.py:125
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.TilePulseShapeConfig.TileCondToolMuRcvPulseShapeCfg
def TileCondToolMuRcvPulseShapeCfg(flags, **kwargs)
Definition: TilePulseShapeConfig.py:115
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
python.TileOFCConfig.TileCondToolOfcCfg
def TileCondToolOfcCfg(flags, **kwargs)
Definition: TileOFCConfig.py:98
python.TileCondToolsTestConfig.TileCondToolsTestCfg
def TileCondToolsTestCfg(flags)
Definition: TileCondToolsTestConfig.py:6