ATLAS Offline Software
TrigCaloDataAccessConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
5 
6 CaloDataAccessSvcDependencies = [('TileEMScale' , 'ConditionStore+TileEMScale'),
7  ('TileHid2RESrcID' , 'ConditionStore+TileHid2RESrcIDHLT'),
8  ('TileBadChannels' , 'ConditionStore+TileBadChannels'),
9  ('IRegSelLUTCondData' , 'ConditionStore+RegSelLUTCondData_TTEM'),
10  ('IRegSelLUTCondData' , 'ConditionStore+RegSelLUTCondData_TTHEC'),
11  ('IRegSelLUTCondData' , 'ConditionStore+RegSelLUTCondData_TILE'),
12  ('IRegSelLUTCondData' , 'ConditionStore+RegSelLUTCondData_FCALEM'),
13  ('IRegSelLUTCondData' , 'ConditionStore+RegSelLUTCondData_FCALHAD'),
14  ('LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' ),
15  ('LArFebRodMapping' , 'ConditionStore+LArFebRodMap' ),
16  ('LArMCSym' , 'ConditionStore+LArMCSym'),
17  ('LArBadChannelCont' , 'ConditionStore+LArBadChannel'),
18  ('CaloDetDescrManager', 'ConditionStore+CaloDetDescrManager')]
19 
20 
22 
23  acc = ComponentAccumulator()
24  if not flags.Input.isMC and flags.Common.isOnline:
25  acc.addCondAlgo(CompFactory.getComp('LArFlatConditionsAlg<LArOFCFlat>')(ReadKey="/LAR/ElecCalibFlat/OFC", WriteKey='LArOFC'))
26  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
27  acc.merge(LuminosityCondAlgCfg(flags))
28 
29  from CaloRec.CaloBCIDAvgAlgConfig import CaloBCIDAvgAlgCfg
30  acc.merge(CaloBCIDAvgAlgCfg(flags))
31  from LArRecUtils.LArRecUtilsConfig import LArMCSymCondAlgCfg
32  acc.merge( LArMCSymCondAlgCfg( flags ) )
33  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
34  monTool = GenericMonitoringTool(flags, 'MonTool')
35  monTool.defineHistogram('TIME_exec', path='EXPERT', type='TH1F', title="CaloBCIDAvgAlg execution time; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=4000)
36  acc.getEventAlgo("CaloBCIDAvgAlg").MonTool = monTool
37  return acc
38 
39 @AccumulatorCache
41 
42  acc = ComponentAccumulator()
43  svc = CompFactory.TrigCaloDataAccessSvc()
44 
45  # since the svc depends on calo geometry configure it here
46  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
47  acc.merge( LArGMCfg( flags ) )
48 
49  from TileGeoModel.TileGMConfig import TileGMCfg
50  acc.merge( TileGMCfg( flags ) )
51 
52  from LArRecUtils.LArRecUtilsConfig import LArRoIMapCondAlgCfg
53  acc.merge( LArRoIMapCondAlgCfg( flags ) )
54 
55  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArFebRodMappingCfg
56  acc.merge( LArOnOffIdMappingCfg( flags ))
57  acc.merge( LArFebRodMappingCfg( flags ))
58 
59  from TileByteStream.TileHid2RESrcIDConfig import TileHid2RESrcIDCondAlgCfg
60  acc.merge( TileHid2RESrcIDCondAlgCfg(flags, ForHLT=True) )
61 
62  #setup region selector
63  from RegionSelector.RegSelToolConfig import (regSelTool_TTEM_Cfg,regSelTool_TTHEC_Cfg,
64  regSelTool_FCALEM_Cfg,regSelTool_FCALHAD_Cfg,regSelTool_TILE_Cfg)
65 
66  svc.RegSelToolEM = acc.popToolsAndMerge(regSelTool_TTEM_Cfg(flags))
67  svc.RegSelToolHEC = acc.popToolsAndMerge(regSelTool_TTHEC_Cfg(flags))
68  svc.RegSelToolFCALEM = acc.popToolsAndMerge(regSelTool_FCALEM_Cfg(flags))
69  svc.RegSelToolFCALHAD = acc.popToolsAndMerge(regSelTool_FCALHAD_Cfg(flags))
70  svc.RegSelToolTILE = acc.popToolsAndMerge(regSelTool_TILE_Cfg(flags))
71 
72 
73  # Needed by bad channel maskers, refrerenced from LArCellCont.
74  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
75  acc.merge(LArBadChannelCfg(flags))
76  acc.merge(LArBadFebCfg(flags))
77 
78  from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
79  acc.merge( TileEMScaleCondAlgCfg(flags) )
80 
81  from TileConditions.TileBadChannelsConfig import TileBadChannelsCondAlgCfg
82  acc.merge( TileBadChannelsCondAlgCfg(flags) )
83 
84  if flags.Trigger.Calo.doOffsetCorrection:
85  if flags.Trigger.doHLT:
86  from AthenaCommon.CFElements import parOR
87  eventAcc = ComponentAccumulator(parOR("HLTBeginSeq"))
88  eventAcc.merge(CaloOffsetCorrectionCfg(flags), sequenceName="HLTBeginSeq")
89  acc.merge(eventAcc)
90  else:
91  acc.merge(CaloOffsetCorrectionCfg(flags))
92 
93  acc.addService( svc, primary=True )
94  return acc
95 
96 
97 if __name__ == "__main__":
98  from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
99  from AthenaConfiguration.AllConfigFlags import initConfigFlags
100  import sys
101 
102  flags = initConfigFlags()
103  flags.Input.Files = defaultTestFiles.RAW_RUN2
104  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
105  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
106  flags.Input.isMC=False
107  flags.lock()
108 
109  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
110  acc = MainServicesCfg( flags )
111 
112  from AthenaCommon.CFElements import parOR
113  acc.addSequence(parOR("HLTBeginSeq"))
114 
115  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
116  acc.merge( ByteStreamReadCfg( flags ) )
117 
118  acc.merge( trigCaloDataAccessSvcCfg( flags ) )
119 
120  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
121  import math
122  mon = GenericMonitoringTool(flags, "TrigCaloDataAccessSvcMon")
123  mon.defineHistogram("TIME_locking_LAr_RoI",
124  path="EXPERT",
125  title="Time spent in unlocking the LAr collection",
126  xbins=100, xmin=0, xmax=100 )
127  mon.defineHistogram("roiROBs_LAr",
128  path="EXPERT",
129  title="Number of ROBs unpacked in RoI requests",
130  xbins=20, xmin=0, xmax=20 )
131  mon.defineHistogram("TIME_locking_LAr_FullDet",
132  path="EXPERT",
133  title="Time spent in unlocking the LAr collection",
134  xbins=100, xmin=0, xmax=100 )
135  mon.defineHistogram("roiEta_LAr,roiPhi_LAr",
136  type="TH2F",
137  path="EXPERT",
138  title="Geometric usage",
139  xbins=50, xmin=-5, xmax=5,
140  ybins=64, ymin=-math.pi, ymax=math.pi )
141 
142  acc.getService("TrigCaloDataAccessSvc").MonTool = mon
143 
144  testAlg = CompFactory.TestCaloDataAccess()
145  acc.addEventAlgo(testAlg)
146 
147  acc.printConfig(True)
148  sc = acc.run(10)
149  sys.exit(sc.isFailure())
TrigCaloDataAccessConfig.CaloOffsetCorrectionCfg
def CaloOffsetCorrectionCfg(flags)
Definition: TrigCaloDataAccessConfig.py:21
python.LuminosityCondAlgConfig.LuminosityCondAlgCfg
def LuminosityCondAlgCfg(flags, useOnlineLumi=None, suffix=None)
Definition: LuminosityCondAlgConfig.py:17
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.CaloBCIDAvgAlgConfig.CaloBCIDAvgAlgCfg
def CaloBCIDAvgAlgCfg(flags, **kwargs)
Definition: CaloBCIDAvgAlgConfig.py:11
RegSelToolConfig.regSelTool_TILE_Cfg
def regSelTool_TILE_Cfg(flags)
Definition: RegSelToolConfig.py:247
RegSelToolConfig.regSelTool_FCALHAD_Cfg
def regSelTool_FCALHAD_Cfg(flags)
Definition: RegSelToolConfig.py:235
python.LArRecUtilsConfig.LArMCSymCondAlgCfg
def LArMCSymCondAlgCfg(flags, name="LArMCSymCondAlg", **kwargs)
Definition: LArRecUtilsConfig.py:12
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
LArCablingConfig.LArFebRodMappingCfg
def LArFebRodMappingCfg(configFlags)
Definition: LArCablingConfig.py:80
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:45
RegSelToolConfig.regSelTool_FCALEM_Cfg
def regSelTool_FCALEM_Cfg(flags)
Definition: RegSelToolConfig.py:223
python.JetAnalysisCommon.parOR
parOR
Definition: JetAnalysisCommon.py:271
python.TileBadChannelsConfig.TileBadChannelsCondAlgCfg
def TileBadChannelsCondAlgCfg(flags, **kwargs)
Definition: TileBadChannelsConfig.py:10
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
TrigCaloDataAccessConfig.trigCaloDataAccessSvcCfg
def trigCaloDataAccessSvcCfg(flags)
Definition: TrigCaloDataAccessConfig.py:40
RegSelToolConfig.regSelTool_TTHEC_Cfg
def regSelTool_TTHEC_Cfg(flags)
Definition: RegSelToolConfig.py:211
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.TileEMScaleConfig.TileEMScaleCondAlgCfg
def TileEMScaleCondAlgCfg(flags, **kwargs)
Definition: TileEMScaleConfig.py:10
GenericMonitoringTool
Definition: GenericMonitoringTool.py:1
TileHid2RESrcIDConfig.TileHid2RESrcIDCondAlgCfg
def TileHid2RESrcIDCondAlgCfg(flags, source='COOL', **kwargs)
Definition: TileHid2RESrcIDConfig.py:24
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.LArRecUtilsConfig.LArRoIMapCondAlgCfg
def LArRoIMapCondAlgCfg(flags, name='LArRoIMapCondAlg', **kwargs)
Definition: LArRecUtilsConfig.py:158
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7
RegSelToolConfig.regSelTool_TTEM_Cfg
def regSelTool_TTEM_Cfg(flags)
Definition: RegSelToolConfig.py:199