Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
21 
22  acc = ComponentAccumulator()
23  if not flags.Input.isMC and flags.Common.isOnline:
24  acc.addCondAlgo(CompFactory.getComp('LArFlatConditionsAlg<LArOFCFlat>')(ReadKey="/LAR/ElecCalibFlat/OFC", WriteKey='LArOFC'))
25  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
26  acc.merge(LuminosityCondAlgCfg(flags))
27 
28  # patch from Super-Cells
29  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingInRoICfg
30  from LArCellRec.LArCellBuilderConfig import LArDeadOTXAlgCfg
31  if ( not flags.Input.isMC ):
32  # keep this code here, but commented for future developement and testing purposes
33  #acc.merge(LArRawSCDataReadingInRoICfg(flags,ROBList=[0x441005]))
34  acc.merge(LArRawSCDataReadingInRoICfg(flags,ROBList=[])) # empty list assumes good FEBs
35  acc.merge(LArDeadOTXAlgCfg(flags))
36  from CaloRec.CaloBCIDAvgAlgConfig import CaloBCIDAvgAlgCfg
37  acc.merge(CaloBCIDAvgAlgCfg(flags))
38  from LArRecUtils.LArRecUtilsConfig import LArMCSymCondAlgCfg
39  acc.merge( LArMCSymCondAlgCfg( flags ) )
40  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
41  monTool = GenericMonitoringTool(flags, 'MonTool')
42  monTool.defineHistogram('TIME_exec', path='EXPERT', type='TH1F', title="CaloBCIDAvgAlg execution time; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=4000)
43  acc.getEventAlgo("CaloBCIDAvgAlg").MonTool = monTool
44  return acc
45 
46 @AccumulatorCache
48 
49  acc = ComponentAccumulator()
50  svc = CompFactory.TrigCaloDataAccessSvc()
51 
52  # since the svc depends on calo geometry configure it here
53  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
54  acc.merge( LArGMCfg( flags ) )
55 
56  from TileGeoModel.TileGMConfig import TileGMCfg
57  acc.merge( TileGMCfg( flags ) )
58 
59  from LArRecUtils.LArRecUtilsConfig import LArRoIMapCondAlgCfg
60  acc.merge( LArRoIMapCondAlgCfg( flags ) )
61 
62  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArFebRodMappingCfg
63  acc.merge( LArOnOffIdMappingCfg( flags ))
64  acc.merge( LArFebRodMappingCfg( flags ))
65 
66  from TileByteStream.TileHid2RESrcIDConfig import TileHid2RESrcIDCondAlgCfg
67  acc.merge( TileHid2RESrcIDCondAlgCfg(flags, ForHLT=True) )
68 
69  #setup region selector
70  from RegionSelector.RegSelToolConfig import (regSelTool_TTEM_Cfg,regSelTool_TTHEC_Cfg,
71  regSelTool_FCALEM_Cfg,regSelTool_FCALHAD_Cfg,regSelTool_TILE_Cfg)
72 
73  svc.RegSelToolEM = acc.popToolsAndMerge(regSelTool_TTEM_Cfg(flags))
74  svc.RegSelToolHEC = acc.popToolsAndMerge(regSelTool_TTHEC_Cfg(flags))
75  svc.RegSelToolFCALEM = acc.popToolsAndMerge(regSelTool_FCALEM_Cfg(flags))
76  svc.RegSelToolFCALHAD = acc.popToolsAndMerge(regSelTool_FCALHAD_Cfg(flags))
77  svc.RegSelToolTILE = acc.popToolsAndMerge(regSelTool_TILE_Cfg(flags))
78 
79 
80  # Needed by bad channel maskers, refrerenced from LArCellCont.
81  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
82  acc.merge(LArBadChannelCfg(flags))
83  acc.merge(LArBadFebCfg(flags))
84 
85  from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
86  acc.merge( TileEMScaleCondAlgCfg(flags) )
87 
88  from TileConditions.TileBadChannelsConfig import TileBadChannelsCondAlgCfg
89  acc.merge( TileBadChannelsCondAlgCfg(flags) )
90 
91  if flags.Trigger.Calo.doOffsetCorrection:
92  if flags.Trigger.doHLT:
93  from AthenaCommon.CFElements import parOR
94  eventAcc = ComponentAccumulator(parOR("HLTBeginSeq"))
95  eventAcc.merge(CaloOffsetCorrectionCfg(flags), sequenceName="HLTBeginSeq")
96  acc.merge(eventAcc)
97  else:
98  acc.merge(CaloOffsetCorrectionCfg(flags))
99 
100  if ( flags.Input.isMC ):
101  svc.LArDeadOTXFromSC=""
102 
103  acc.addService( svc, primary=True )
104  return acc
105 
106 
107 if __name__ == "__main__":
108  from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
109  from AthenaConfiguration.AllConfigFlags import initConfigFlags
110  import sys
111 
112  flags = initConfigFlags()
113  flags.Input.Files = defaultTestFiles.RAW_RUN2
114  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
115  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
116  flags.Input.isMC=False
117  flags.lock()
118 
119  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
120  acc = MainServicesCfg( flags )
121 
122  from AthenaCommon.CFElements import parOR
123  acc.addSequence(parOR("HLTBeginSeq"))
124 
125  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
126  acc.merge( ByteStreamReadCfg( flags ) )
127 
128  acc.merge( trigCaloDataAccessSvcCfg( flags ) )
129 
130  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
131  import math
132  mon = GenericMonitoringTool(flags, "TrigCaloDataAccessSvcMon")
133  mon.defineHistogram("TIME_locking_LAr_RoI",
134  path="EXPERT",
135  title="Time spent in unlocking the LAr collection",
136  xbins=100, xmin=0, xmax=100 )
137  mon.defineHistogram("roiROBs_LAr",
138  path="EXPERT",
139  title="Number of ROBs unpacked in RoI requests",
140  xbins=20, xmin=0, xmax=20 )
141  mon.defineHistogram("TIME_locking_LAr_FullDet",
142  path="EXPERT",
143  title="Time spent in unlocking the LAr collection",
144  xbins=100, xmin=0, xmax=100 )
145  mon.defineHistogram("roiEta_LAr,roiPhi_LAr",
146  type="TH2F",
147  path="EXPERT",
148  title="Geometric usage",
149  xbins=50, xmin=-5, xmax=5,
150  ybins=64, ymin=-math.pi, ymax=math.pi )
151 
152  acc.getService("TrigCaloDataAccessSvc").MonTool = mon
153 
154  testAlg = CompFactory.TestCaloDataAccess()
155  acc.addEventAlgo(testAlg)
156 
157  acc.printConfig(True)
158  sc = acc.run(10)
159  sys.exit(sc.isFailure())
TrigCaloDataAccessConfig.CaloOffsetCorrectionCfg
def CaloOffsetCorrectionCfg(flags)
Definition: TrigCaloDataAccessConfig.py:20
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
LArCellBuilderConfig.LArDeadOTXAlgCfg
def LArDeadOTXAlgCfg(configFlags, keySC="SC_ET_ID_RoI")
Definition: LArCellBuilderConfig.py:89
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:46
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:47
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.LArRawSCDataReadingConfig.LArRawSCDataReadingInRoICfg
def LArRawSCDataReadingInRoICfg(configFlags, name="LArRawSCDataReadingInRoI", etIdCollKey="SC_ET_ID_RoI", ROBList=[])
Definition: LArRawSCDataReadingConfig.py:29
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