ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCaloDataAccessConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4from AthenaConfiguration.AccumulatorCache import AccumulatorCache
5
6CaloDataAccessSvcDependencies = [('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
107if __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())