4 '''@file LArCoherentNoisefractionAlg
7 @brief Adapted from LArNoiseCorrelationMonAlg by M. Spalla
12 from AthenaMonitoring.AthMonitorCfgHelper
import AthMonitorCfgHelper
13 helper = AthMonitorCfgHelper(flags,
'LArCoherentNoisefractionMonAlgCfg')
15 from AthenaConfiguration.ComponentFactory
import CompFactory
19 from LArMonitoring.GlobalVariables
import lArDQGlobals
21 larCoherentNoisefractionMonAlg = helper.addAlgorithm(algoinstance,
'larCoherentNoisefractionMonAlg')
24 allGroups=[
"tot",
"top",
"bot",
"left",
"right",
"q1",
"q2",
"q3",
"q4",
"qs11",
"qs22",
"qs3",
"qs4"]
25 groupsNChan=[128,64,64,64,64,32,32,32,32,32,32,32,32]
26 allMonitor=[
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True,
True]
31 larCoherentNoisefractionMonAlg.IsCalibrationRun = inputFlags.LArMon.calibRun
32 except AttributeError:
33 larCoherentNoisefractionMonAlg.IsCalibrationRun =
False
35 larCoherentNoisefractionMonAlg.LArDigitContainerKey = inputFlags.LArMon.LArDigitKey
36 except AttributeError:
37 larCoherentNoisefractionMonAlg.LArDigitContainerKey =
'FREE'
38 larCoherentNoisefractionMonAlg.ListOfGroupNames = allGroups
39 larCoherentNoisefractionMonAlg.GroupNchan = groupsNChan
40 if len(groupsToMonitor) == 0:
41 customGroupstoMonitor = allMonitor
43 if len(customGroupstoMonitor) != len(allMonitor):
44 from AthenaCommon.Logging
import logging
45 logging.getLogger().warning(
"Wrong list of groups to monitor, setting all !")
46 customGroupstoMonitor = allMonitor
48 customGroupstoMonitor = groupsToMonitor
49 larCoherentNoisefractionMonAlg.GroupsToMonitor = customGroupstoMonitor
52 customFEBStoMonitor = inputFlags.LArMon.customFEBsToMonitor
53 except AttributeError:
54 customFEBStoMonitor = [
"endcapAft19slot12",
"endcapAft19slot09",
"endcapAft20slot09"]
57 from ROOT
import LArStrHelper
59 customFEBStoMonitor=[larStrHelp.fixFEBname(nm)
for nm
in customFEBStoMonitor]
63 larCoherentNoisefractionMonAlg.TriggerChain =
"HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY"
66 setCustomFEBS=
set(customFEBStoMonitor)
67 febsToMonitorBarrelA=
list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelA))
68 febsToMonitorEndcapA=
list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapA))
69 febsToMonitorBarrelC=
list(setCustomFEBS.intersection(lArDQGlobals.febsBarrelC))
70 febsToMonitorEndcapC=
list(setCustomFEBS.intersection(lArDQGlobals.febsEndcapC))
72 if len(febsToMonitorBarrelA)==0
and len(febsToMonitorEndcapA)==0
and len(febsToMonitorBarrelC)==0
and len(febsToMonitorEndcapC)==0:
73 print(
"LArCoherentNoisefractionMonAlg:WARNING. None of the following FEBs were recognised, no plot will be produced")
74 print(customFEBStoMonitor)
75 larCoherentNoisefractionMonAlg.PlotsOFF=
True
76 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=
False
77 larCoherentNoisefractionMonAlg.FEBlist=[]
80 larCoherentNoisefractionMonAlg.PlotCustomFEBSset=
True
81 larCoherentNoisefractionMonAlg.FEBlist=febsToMonitorBarrelA+febsToMonitorBarrelC+febsToMonitorEndcapA+febsToMonitorEndcapC
85 for grp
in range(0,len(allGroups)):
86 if not customGroupstoMonitor[grp]:
continue
89 cnfArray = helper.addArray([larCoherentNoisefractionMonAlg.FEBlist],larCoherentNoisefractionMonAlg,allGroups[grp])
93 tot_plot_name=
"cnf_tot"
94 tot_var_and_name=
"SumDev;"+tot_plot_name
95 cnfArray.defineHistogram(tot_var_and_name,
98 path=hist_path+
'BarrelA',
99 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
100 pattern=febsToMonitorBarrelA)
102 cnfArray.defineHistogram(tot_var_and_name,
105 path=hist_path+
'BarrelC',
106 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
107 pattern=febsToMonitorBarrelC)
109 print(lArDQGlobals.CNFN_tot)
110 cnfArray.defineHistogram(tot_var_and_name,
113 path=hist_path+
'EndcapA',
114 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
115 pattern=febsToMonitorEndcapA)
118 cnfArray.defineHistogram(tot_var_and_name,
121 path=hist_path+
'EndcapC',
122 xbins=lArDQGlobals.CNFN_tot, xmin=lArDQGlobals.CNFXmin_tot, xmax=lArDQGlobals.CNFXmax_tot,
123 pattern=febsToMonitorEndcapC)
126 noncoh_plot_name=
"cnf_noncoh"
127 noncoh_var_and_name=
"Dev;"+noncoh_plot_name
129 cnfArray.defineHistogram(noncoh_var_and_name,
130 title=noncoh_plot_name,
132 path=hist_path+
'BarrelA',
133 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
134 pattern=febsToMonitorBarrelA)
136 cnfArray.defineHistogram(noncoh_var_and_name,
137 title=noncoh_plot_name,
139 path=hist_path+
'BarrelC',
140 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
141 pattern=febsToMonitorBarrelC)
143 cnfArray.defineHistogram(noncoh_var_and_name,
144 title=noncoh_plot_name,
146 path=hist_path+
'EndcapA',
147 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
148 pattern=febsToMonitorEndcapA)
150 cnfArray.defineHistogram(noncoh_var_and_name,
151 title=noncoh_plot_name,
153 path=hist_path+
'EndcapC',
154 xbins=lArDQGlobals.CNFN_ncoh, xmin=lArDQGlobals.CNFXmin_ncoh, xmax=lArDQGlobals.CNFXmax_ncoh,
155 pattern=febsToMonitorEndcapC)
158 print(cnfArray.toolList())
160 cfg.merge(helper.result())
164 if __name__==
'__main__':
166 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
167 from AthenaCommon.Logging
import log
172 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
173 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
174 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
179 flags.Input.Files = [
'/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-5s-High-Emec-A-RawData/00393063/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW._lb0000._SFO-1._0001.data',
'/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-5s-High-Emec-A-RawData/00393063/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW._lb0000._SFO-2._0001.data',
'/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-5s-High-Emec-A-RawData/00393063/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW._lb0000._SFO-3._0001.data',
'/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-5s-High-Emec-A-RawData/00393063/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW/data21_calib.00393063.calibration_LArElec-Pedestal-5s-High-Emec-A-RawData.daq.RAW._lb0000._SFO-4._0001.data']
181 flags.LArMon.calibRun =
True
182 flags.Output.HISTFileName =
'LArCNFMonOutput.root'
183 flags.DQ.enableLumiAccess =
False
184 flags.DQ.useTrigger =
False
186 from AthenaConfiguration.Enums
import BeamType
187 flags.Beam.Type = BeamType.Collisions
190 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
192 from LArByteStream.LArRawDataReadingConfig
import LArRawDataReadingCfg
197 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
199 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
203 for ft
in [11,12,23,24]:
204 for slot
in range(1,15):
206 feblist += [
'EndcapAft'+
str(ft)+
'slot0'+
str(slot)]
208 feblist += [
'EndcapAft'+
str(ft)+
'slot'+
str(slot)]