6 '''Function to configures some algorithms in the monitoring system.'''
11 from AthenaMonitoring.AthMonitorCfgHelper
import AthMonitorCfgHelper
12 helper = AthMonitorCfgHelper(flags,
'LArDigitMonAlgCfg')
14 from AthenaConfiguration.ComponentFactory
import CompFactory
20 from LArMonitoring.GlobalVariables
import lArDQGlobals
22 larDigitMonAlg = helper.addAlgorithm(algoinstance,
'larDigitMonAlg')
24 summaryGroupName=
"Summary"
26 for i
in range(0,len(lArDQGlobals.FEB_Slot)):
27 nslots.append(lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[i]][1])
29 larDigitMonAlg.SummaryMonGroup=summaryGroupName
30 larDigitMonAlg.LArDigitsSubDetNames=lArDQGlobals.SubDet
31 larDigitMonAlg.LArDigitsPartitionNames=lArDQGlobals.Partitions
32 larDigitMonAlg.LArDigitsNslots=nslots
33 larDigitMonAlg.ProblemsToMask=[
"highNoiseHG",
"highNoiseMG",
"highNoiseLG",
"deadReadout",
"deadPhys"]
34 larDigitMonAlg.Streams=lArDQGlobals.defaultStreamNames
36 summaryGroup = helper.addGroup(
43 summary_hist_path=summaryGroupName+
'/'
45 summaryGroup.defineHistogram(
'gain,partition;SummaryGain',
46 title=
'Gain;Gain;Partition',
48 path=summary_hist_path,
49 xbins=lArDQGlobals.N_Gains,xmin=-0.5,xmax=lArDQGlobals.N_Gains-0.5,
50 ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
51 xlabels=lArDQGlobals.Gains,ylabels=lArDQGlobals.Partitions)
53 summaryGroup.defineHistogram(
'LBN;LBN',type=
'TH1I',
54 title=
'Event counter per LB',
56 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
59 for subdet
in range(0,lArDQGlobals.N_SubDet):
60 array = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larDigitMonAlg,lArDQGlobals.SubDet[subdet],topPath=
'/')
61 hist_path=
'/LAr/Digits/'+lArDQGlobals.SubDet[subdet]+
'/'
62 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
63 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
64 slot_n =
int(slot_up - slot_low)
65 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
66 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
67 ft_n =
int(ft_up - ft_low)
68 chan_n = lArDQGlobals.FEB_N_channels
69 chan_low = lArDQGlobals.FEB_channels_Min
70 chan_up = lArDQGlobals.FEB_channels_Max
71 crates_n = lArDQGlobals.FEB_Crates[lArDQGlobals.Partitions[subdet*2]][1]
73 crates_up = lArDQGlobals.FEB_Crates[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
74 array.defineHistogram(
'Outslot,OutFT;RAW_OutOfRange',
75 title=
'% chan/FEB/events with max out of range;Slot;FT',
79 xbins=
int(slot_n),xmin=slot_low,xmax=slot_up,
80 ybins=
int(ft_n), ymin=ft_low, ymax=ft_up)
81 array.defineHistogram(
'Outcrate,Outchan;RAW_OutOfRangeChan',
82 title=
'% chan/events with max out of range;Crate (Slot + N_slots*FT);Channel',
86 xbins=crates_n,xmin=crates_low,xmax=crates_up,
87 ybins=chan_n, ymin=chan_low, ymax=chan_up)
89 array.defineHistogram(
'Saturslot,SaturFT;RAW_Saturation',
90 title=
'% chan/FEB/events with max=4095 ADC;Slot;FT',
94 xbins=
int(slot_n),xmin=slot_low,xmax=slot_up,
95 ybins=
int(ft_n), ymin=ft_low, ymax=ft_up)
96 array.defineHistogram(
'Saturcrate,Saturchan;RAW_SaturationChan',
97 title=
'% chan/events with max=4095 ADC - Med/High Gain - All Stream;Crate (Slot + N_slots*FT);Channel',
101 xbins=crates_n,xmin=crates_low,xmax=crates_up,
102 ybins=chan_n, ymin=chan_low, ymax=chan_up)
104 array.defineHistogram(
'SaturLowslot,SaturLowFT;RAW_SaturationLow',
105 title=
'% chan/FEB/events with max=4095 ADC ;Slot;FT',
108 weight=
'SaturLowweight',
109 xbins=
int(slot_n),xmin=slot_low,xmax=slot_up,
110 ybins=
int(ft_n), ymin=ft_low, ymax=ft_up)
111 array.defineHistogram(
'SaturLowcrate,SaturLowchan;RAW_SaturationChanLow',
112 title=
'% chan/events with max=4095 ADC - Low Gain - All Stream;Crate (Slot + N_slots*FT);Channel',
116 xbins=crates_n,xmin=crates_low,xmax=crates_up,
117 ybins=chan_n, ymin=chan_low, ymax=chan_up)
119 array.defineHistogram(
'Nullslot,NullFT;tNullDigit',
120 title=
'% chan/FEB/events with min=0 ADC;Slot;FT',
124 xbins=
int(slot_n),xmin=slot_low,xmax=slot_up,
125 ybins=
int(ft_n), ymin=ft_low, ymax=ft_up)
126 array.defineHistogram(
'Nullcrate,Nullchan;RAW_NullDigitChan',
127 title=
'% chan/events with min=0 ADC - All Gain - All Stream;Crate;Channel',
130 xbins=crates_n,xmin=crates_low,xmax=crates_up,
131 ybins=chan_n, ymin=chan_low, ymax=chan_up)
133 array.defineHistogram(
'slot,FT,MaxPos;RAW_AvePosMaxDig',
134 title=
'Average position of Max Digit;Slot;FT',
137 xbins=
int(slot_n),xmin=slot_low,xmax=slot_up,
138 ybins=
int(ft_n), ymin=ft_low, ymax=ft_up)
140 array.defineHistogram(
'LBN,MaxPos;MaxVsTime',
141 title=
'Average Max Sample vs LumiBlock;Luminosity Block;Average Max Sample',
144 xbins=lArDQGlobals.LB_Bins,xmin=lArDQGlobals.LB_Min,xmax=lArDQGlobals.LB_Max)
145 array.defineHistogram(
'MaxPos,Energy;EnVsMaxSample',
146 title=
'Energy vs max sample;Sample Number;Energy [ADC] ',
149 xbins=lArDQGlobals.Samples_Bins,xmin=lArDQGlobals.Samples_Min,xmax=lArDQGlobals.Samples_Max,
150 ybins=lArDQGlobals.Energy_Bins, ymin=lArDQGlobals.Energy_Min, ymax=lArDQGlobals.Energy_Max)
152 array.defineHistogram(
'MaxPos,streamBin;MaxSample_PerStream',
153 title=
"Position of the Max Sample;Average Max Sample",
156 xbins=lArDQGlobals.Samples_Bins,xmin=lArDQGlobals.Samples_Min,xmax=lArDQGlobals.Samples_Max,
157 ybins=len(lArDQGlobals.defaultStreamNames),ymin=-0.5, ymax=len(lArDQGlobals.defaultStreamNames)-0.5,
158 ylabels=lArDQGlobals.defaultStreamNames)
161 array.defineHistogram(
'l1trig,MaxPos;TriggerWord',
162 title=
'Position of max sample per L1 trigger word (8 bits);L1 trigger word;Position of max Sample ',
165 xbins=lArDQGlobals.L1Trig_Bins,xmin=lArDQGlobals.L1Trig_Min,xmax=lArDQGlobals.L1Trig_Max)
167 array.defineHistogram(
'Sample,SignalNorm;SignShape',
168 title=
'Normalized Signal Shape;Sample Number;Normalized Signal Shape ',
172 xbins=lArDQGlobals.Samples_Bins,xmin=lArDQGlobals.Samples_Min,xmax=lArDQGlobals.Samples_Max)
175 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
177 cfg.merge(helper.result())
181 if __name__==
'__main__':
183 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
186 from AthenaCommon.Logging
import log
190 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
191 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
193 from AthenaConfiguration.TestDefaults
import defaultTestFiles
194 flags.Input.Files = defaultTestFiles.RAW_RUN2
196 flags.Output.HISTFileName =
'LArDigitsMonOutput.root'
197 flags.DQ.enableLumiAccess =
False
198 flags.DQ.useTrigger =
False
201 from CaloRec.CaloRecoConfig
import CaloRecoCfg
204 from LArCellRec.LArNoisyROSummaryConfig
import LArNoisyROSummaryCfg