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  from IOVDbSvc.IOVDbSvcConfig import addFolders
26  acc.merge(addFolders(flags, "/LAR/ElecCalibFlat/OFC",'LAR_ONL', className = 'CondAttrListCollection'))
27  larCondSvc = CompFactory.LArFlatConditionSvc()
28  larCondSvc.OFCInput="/LAR/ElecCalibFlat/OFC"
29  acc.addService(larCondSvc)
30  acc.addService(CompFactory.ProxyProviderSvc(ProviderNames=[larCondSvc.name]))
31  acc.addCondAlgo(CompFactory.getComp('LArFlatConditionsAlg<LArOFCFlat>')(ReadKey="/LAR/ElecCalibFlat/OFC", WriteKey='LArOFC'))
32  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
33  acc.merge(LuminosityCondAlgCfg(flags))
34 
35  from CaloRec.CaloBCIDAvgAlgConfig import CaloBCIDAvgAlgCfg
36  acc.merge(CaloBCIDAvgAlgCfg(flags))
37  from LArRecUtils.LArRecUtilsConfig import LArMCSymCondAlgCfg
38  acc.merge( LArMCSymCondAlgCfg( flags ) )
39  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
40  monTool = GenericMonitoringTool(flags, 'MonTool')
41  monTool.defineHistogram('TIME_exec', path='EXPERT', type='TH1F', title="CaloBCIDAvgAlg execution time; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=4000)
42  acc.getEventAlgo("CaloBCIDAvgAlg").MonTool = monTool
43  return acc
44 
45 @AccumulatorCache
47 
48  acc = ComponentAccumulator()
49  svc = CompFactory.TrigCaloDataAccessSvc()
50 
51  # since the svc depends on calo geometry configure it here
52  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
53  acc.merge( LArGMCfg( flags ) )
54 
55  from TileGeoModel.TileGMConfig import TileGMCfg
56  acc.merge( TileGMCfg( flags ) )
57 
58  from LArRecUtils.LArRecUtilsConfig import LArRoIMapCondAlgCfg
59  acc.merge( LArRoIMapCondAlgCfg( flags ) )
60 
61  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArFebRodMappingCfg
62  acc.merge( LArOnOffIdMappingCfg( flags ))
63  acc.merge( LArFebRodMappingCfg( flags ))
64 
65  from TileByteStream.TileHid2RESrcIDConfig import TileHid2RESrcIDCondAlgCfg
66  acc.merge( TileHid2RESrcIDCondAlgCfg(flags, ForHLT=True) )
67 
68  #setup region selector
69  from RegionSelector.RegSelToolConfig import (regSelTool_TTEM_Cfg,regSelTool_TTHEC_Cfg,
70  regSelTool_FCALEM_Cfg,regSelTool_FCALHAD_Cfg,regSelTool_TILE_Cfg)
71 
72  svc.RegSelToolEM = acc.popToolsAndMerge(regSelTool_TTEM_Cfg(flags))
73  svc.RegSelToolHEC = acc.popToolsAndMerge(regSelTool_TTHEC_Cfg(flags))
74  svc.RegSelToolFCALEM = acc.popToolsAndMerge(regSelTool_FCALEM_Cfg(flags))
75  svc.RegSelToolFCALHAD = acc.popToolsAndMerge(regSelTool_FCALHAD_Cfg(flags))
76  svc.RegSelToolTILE = acc.popToolsAndMerge(regSelTool_TILE_Cfg(flags))
77 
78 
79  # Needed by bad channel maskers, refrerenced from LArCellCont.
80  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
81  acc.merge(LArBadChannelCfg(flags))
82  acc.merge(LArBadFebCfg(flags))
83 
84  from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
85  acc.merge( TileEMScaleCondAlgCfg(flags) )
86 
87  from TileConditions.TileBadChannelsConfig import TileBadChannelsCondAlgCfg
88  acc.merge( TileBadChannelsCondAlgCfg(flags) )
89 
90  if flags.Trigger.Calo.doOffsetCorrection:
91  if flags.Trigger.doHLT:
92  from AthenaCommon.CFElements import parOR
93  eventAcc = ComponentAccumulator(parOR("HLTBeginSeq"))
94  eventAcc.merge(CaloOffsetCorrectionCfg(flags), sequenceName="HLTBeginSeq")
95  acc.merge(eventAcc)
96  else:
97  acc.merge(CaloOffsetCorrectionCfg(flags))
98 
99  acc.addService( svc, primary=True )
100  return acc
101 
102 
103 if __name__ == "__main__":
104  from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
105  from AthenaConfiguration.AllConfigFlags import initConfigFlags
106  import sys
107 
108  flags = initConfigFlags()
109  flags.Input.Files = defaultTestFiles.RAW_RUN2
110  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
111  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
112  flags.Input.isMC=False
113  flags.lock()
114 
115  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
116  acc = MainServicesCfg( flags )
117 
118  from AthenaCommon.CFElements import parOR
119  acc.addSequence(parOR("HLTBeginSeq"))
120 
121  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
122  acc.merge( ByteStreamReadCfg( flags ) )
123 
124  acc.merge( trigCaloDataAccessSvcCfg( flags ) )
125 
126  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
127  import math
128  mon = GenericMonitoringTool(flags, "TrigCaloDataAccessSvcMon")
129  mon.defineHistogram("TIME_locking_LAr_RoI",
130  path="EXPERT",
131  title="Time spent in unlocking the LAr collection",
132  xbins=100, xmin=0, xmax=100 )
133  mon.defineHistogram("roiROBs_LAr",
134  path="EXPERT",
135  title="Number of ROBs unpacked in RoI requests",
136  xbins=20, xmin=0, xmax=20 )
137  mon.defineHistogram("TIME_locking_LAr_FullDet",
138  path="EXPERT",
139  title="Time spent in unlocking the LAr collection",
140  xbins=100, xmin=0, xmax=100 )
141  mon.defineHistogram("roiEta_LAr,roiPhi_LAr",
142  type="TH2F",
143  path="EXPERT",
144  title="Geometric usage",
145  xbins=50, xmin=-5, xmax=5,
146  ybins=64, ymin=-math.pi, ymax=math.pi )
147 
148  acc.getService("TrigCaloDataAccessSvc").MonTool = mon
149 
150  testAlg = CompFactory.TestCaloDataAccess()
151  acc.addEventAlgo(testAlg)
152 
153  acc.printConfig(True)
154  sc = acc.run(10)
155  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:242
RegSelToolConfig.regSelTool_FCALHAD_Cfg
def regSelTool_FCALHAD_Cfg(flags)
Definition: RegSelToolConfig.py:230
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:218
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:256
TrigCaloDataAccessConfig.trigCaloDataAccessSvcCfg
def trigCaloDataAccessSvcCfg(flags)
Definition: TrigCaloDataAccessConfig.py:46
RegSelToolConfig.regSelTool_TTHEC_Cfg
def regSelTool_TTHEC_Cfg(flags)
Definition: RegSelToolConfig.py:206
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
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:194