ATLAS Offline Software
Functions
JepJemMonitorAlgorithm Namespace Reference

Functions

def JepJemMonitoringConfig (inputFlags)
 

Function Documentation

◆ JepJemMonitoringConfig()

def JepJemMonitorAlgorithm.JepJemMonitoringConfig (   inputFlags)
Function to configure LVL1 JepJem algorithm in the monitoring system.

Definition at line 4 of file JepJemMonitorAlgorithm.py.

4 def JepJemMonitoringConfig(inputFlags):
5  '''Function to configure LVL1 JepJem algorithm in the monitoring system.'''
6 
7  import math
8  # get the component factory - used for getting the algorithms
9  from AthenaConfiguration.ComponentFactory import CompFactory
10  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11  result = ComponentAccumulator()
12 
13  # make the athena monitoring helper
14  from AthenaMonitoring import AthMonitorCfgHelper
15  helper = AthMonitorCfgHelper(inputFlags,'JepJemMonitoringCfg')
16 
17  # get any algorithms
18  JepJemMonAlg = helper.addAlgorithm(CompFactory.JepJemMonitorAlgorithm,'JepJemMonAlg')
19 
20  # add any steering
21  groupName = 'JepJemMonitor' # the monitoring group name is also used for the package name
22  JepJemMonAlg.PackageName = groupName
23  maxSlices = 5
24  JepJemMonAlg.s_maxSlices = maxSlices
25  crates = 2 # number of JEM crates
26  JepJemMonAlg.s_crates = crates
27  modules = 16 # number of modules per crate
28  JepJemMonAlg.s_modules = modules
29  tobsPerJEM = 4 # maximum number of TOBs per JEM sent to CMX
30  JepJemMonAlg.s_tobsPerJEM = tobsPerJEM
31 
32  # histogram paths
33  mainDir = 'L1Calo'
34  trigPath = 'JEM/'
35  inputPath = trigPath + '/Input/'
36  outputPath = trigPath + '/Output/'
37  errorPath = trigPath + '/Errors/'
38  monRoIPath = outputPath + '/RoI/'
39  monESumPath = outputPath + '/EnergySums/'
40  monHardPath = errorPath + '/Hardware/'
41 
42  # add monitoring algorithm to group, with group name and main directory
43  myGroup = helper.addGroup(JepJemMonAlg, groupName, mainDir)
44 
45 
46  phibins_1d = 32
47  phibins_2d = 32
48  phimin = 0.
49  phimax_1d = 2.*math.pi
50  phimax_2d = 32.
51  etabins_1d = [-4.9,-3.2,-2.9,-2.7,-2.4,-2.2,-2.0,-1.8,
52  -1.6,-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,
53  0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,
54  2.0,2.2,2.4,2.7,2.9,3.2,4.9]
55  etabins_2d = 32
56  etamin_2d = -3.2
57  etamax_2d = 3.2
58  jebins = 256
59  maxEnergyRange = 1024
60  maxEnergySum = 16384
61 
62  # binning keyword argument dictionaries
63  energy_bins = {
64  'xbins': jebins - 1, 'xmin': 1, 'xmax': maxEnergyRange
65  }
66  eta_bins = {
67  'xbins': etabins_1d
68  }
69  phi_bins = {
70  'xbins': phibins_1d, 'xmin': phimin, 'xmax': phimax_1d
71  }
72  eta_phi_bins = {
73  'xbins': etabins_2d, 'xmin': etamin_2d, 'xmax': etamax_2d,
74  'ybins': phibins_2d, 'ymin': phimin, 'ymax': phimax_2d
75  }
76 
77  # bin labels
78  eta_phi_xlabels = [''] * 32
79  for ch in range(-11, 12, 2):
80  chan = ch
81  if chan>=-1: chan += 1
82  eta = chan/5. + 0.1
83  eta_phi_xlabels[chan+16] = "{}/{:.2f}".format(chan, eta)
84  eta_phi_xlabels[1] = "-15/-3.05"
85  eta_phi_xlabels[3] = "-13/-2.55"
86  eta_phi_xlabels[28] = "12/2.55"
87  eta_phi_xlabels[30] = "14/3.05"
88 
89  eta_phi_ylabels = [''] * 32
90  phiBin = math.pi/16.
91  halfPhiBin = math.pi/32.
92  for chan in range(0, 32, 2):
93  rad = chan*phiBin + halfPhiBin
94  eta_phi_ylabels[chan+1] = "{}/{:.2f}".format(chan, rad)
95  eta_phi_ylabels[-1] = "etaVphi"
96 
97  eta_phi_bin_labels = {
98  'xlabels': eta_phi_xlabels,
99  'ylabels': eta_phi_ylabels
100  }
101 
102 
104  myGroup.defineHistogram('phiJepJemJE_em;jem_em_1d_jetEl_Phi',
105  title='EM TowerSum distribution per #phi -- JEM input;#phi', type='TH1F',
106  path=inputPath, cutmask='', **phi_bins)
107  myGroup.defineHistogram('etaJepJemJE_em;jem_em_1d_jetEl_Eta',
108  title='EM TowerSum distribution per #eta -- JEM input;#eta', type='TH1F',
109  path=inputPath, cutmask='', **eta_bins)
110  myGroup.defineHistogram('etJepJemJE_em;jem_em_1d_jetEl_Energy',
111  title='TowerSum EM energy distribution -- JEM input;em energy [GeV]', type='TH1F',
112  path=inputPath, cutmask='', **energy_bins)
113 
114  # HAD 1D
115  myGroup.defineHistogram('phiJepJemJE_had;jem_had_1d_jetEl_Phi',
116  title='HAD TowerSum distribution per #phi -- JEM input;#phi', type='TH1F',
117  path=inputPath, cutmask='',
118  xbins=phibins_1d, xmin=phimin, xmax=phimax_1d)
119  myGroup.defineHistogram('etaJepJemJE_had;jem_had_1d_jetEl_Eta',
120  title='HAD TowerSum distribution per #eta -- JEM input;#eta', type='TH1F',
121  path=inputPath, cutmask='', **eta_bins)
122  myGroup.defineHistogram('etJepJemJE_had;jem_had_1d_jetEl_Energy',
123  title='TowerSum HAD energy distribution -- JEM input;had energy [GeV]', type='TH1F',
124  path=inputPath, cutmask='', **energy_bins)
125 
126  # EM 2D
127  myGroup.defineHistogram('etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_HitMapWeighted',
128  title='#eta - #phi map of EM TowerSum weighted with energy -- JEM input', type='TH2F',
129  cutmask='', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels,
130  weight='em_weight')
131 
132  # HAD 2D
133  myGroup.defineHistogram('etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_HitMapWeighted',
134  title='#eta - #phi map of HAD TowerSum weighted with energy -- JEM input', type='TH2F',
135  cutmask='', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels,
136  weight='had_weight')
137 
138 
139  # Number of triggered slice
140  myGroup.defineHistogram('jem_1d_TriggeredSlice_num;jem_1d_TriggeredSlice',
141  title='Number of the Triggered Slice for JE;#Slice', type='TH1F',
142  path=inputPath, cutmask='', xlabels=[str(i) for i in range(maxSlices)],
143  xbins=maxSlices, xmin=0, xmax=maxSlices)
144 
145  # JEM E_t Sums
146  myGroup.defineHistogram('JEMEtSums_Ex;jem_1d_energy_SubSumsEx',
147  title='JEM E_{x}^{JEM} -- JEM DAQ;Ex [GeV]', type='TH1F',
148  path=monESumPath, cutmask='',
149  xbins=jebins, xmin=0, xmax=maxEnergySum)
150  myGroup.defineHistogram('JEMEtSums_Ey;jem_1d_energy_SubSumsEy',
151  title='JEM E_{y}^{JEM} -- JEM DAQ;Ey [GeV]', type='TH1F',
152  path=monESumPath, cutmask='',
153  xbins=jebins, xmin=0, xmax=maxEnergySum)
154  myGroup.defineHistogram('JEMEtSums_Et;jem_1d_energy_SubSumsEt',
155  title='JEM E_{t}^{JEM} -- JEM DAQ;Et [GeV]', type='TH1F',
156  path=monESumPath, cutmask='',
157  xbins=jebins, xmin=0, xmax=maxEnergySum)
158 
159  # Timeslices
160  for i in range(maxSlices):
161  # EM
162  myGroup.defineHistogram('etaSliceJepJemJE_em_num{0},phiSliceJepJemJE_em_num{0};jem_em_2d_etaPhi_jetEl_HitMapSlice{0}'.format(i),
163  title='#eta - #phi map of EM TowerSum for Timeslice {0} -- JEM input'.format(i), type='TH2F',
164  cutmask='', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels)
165  # HAD
166  myGroup.defineHistogram('etaSliceJepJemJE_had_num{0},phiSliceJepJemJE_had_num{0};jem_had_2d_etaPhi_jetEl_HitMapSlice{0}'.format(i),
167  title='#eta - #phi map of HAD TowerSum for Timeslice {0} -- JEM input'.format(i), type='TH2F',
168  cutmask='', path=inputPath, **eta_phi_bins, **eta_phi_bin_labels)
169 
170  # Error Maps
171  # ==============
172  subStatus_labels = ["GLinkParity", "GLinkProtocol", "BCNMismatch", "FIFOOverflow", "ModuleError", "", "GLinkDown", "GLinkTimeout"]
173  numberPairs_labels = [""] * 32
174  for first in range(0, 2):
175  bin = first * 16
176  for second in range(0, 15, 2):
177  numberPairs_labels[bin] = "{}/{}".format(first, second)
178  bin += 2
179 
180  myGroup.defineHistogram('GLinkParityError,jemLoc;jepjem_2d_Status',
181  title='Error reports from JEM SubStatus Word;;Crate/Module', type='TH2F',
182  cutmask='', path=monHardPath,
183  xbins=8,xmin=0.,xmax=8.0,ybins=32,ymin=0.,ymax=32.0,
184  xlabels=subStatus_labels, ylabels=numberPairs_labels)
185  # EM
186  myGroup.defineHistogram('etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_Parity',
187  title='Jet Element EM Parity Errors;#eta;#phi', type='TH2F',
188  cutmask='parityErrorJepJE_em', path=monHardPath, **eta_phi_bins)
189  myGroup.defineHistogram('etaScaledJepJemJE_em,phiScaledJepJemJE_em;jem_em_2d_etaPhi_jetEl_LinkDown',
190  title='Jet Element EM Link Down Errors;#eta;#phi', type='TH2F',
191  cutmask='linkDownErrorJepJE_em', path=monHardPath, **eta_phi_bins)
192  # HAD
193  myGroup.defineHistogram('etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_Parity',
194  title='Jet Element Had Parity Errors;#eta;#phi', type='TH2F',
195  cutmask='parityErrorJepJE_had', path=monHardPath, **eta_phi_bins)
196  myGroup.defineHistogram('etaScaledJepJemJE_had,phiScaledJepJemJE_had;jem_had_2d_etaPhi_jetEl_LinkDown',
197  title='Jet Element Had Link Down Errors;#eta;#phi', type='TH2F',
198  cutmask='linkDownErrorJepJE_had', path=monHardPath, **eta_phi_bins)
199 
200  # Error Summaries
201  NumberOfSummaryBins=5
202  err_summary_bin_labels = ["EM parity", "Had parity", "EM link", "Had link", "JEM status"]
203 
204  myGroup.defineHistogram('jem_1d_ErrorSummary;jem_1d_ErrorSummary',
205  title='Summary of JEM Data Errors;;',type='TH1F',
206  cutmask='',path=monHardPath, xlabels=err_summary_bin_labels,
207  xbins=NumberOfSummaryBins, xmin=0.,xmax=NumberOfSummaryBins)
208 
209  # Number of Error Event Number Samples
210  EventSamples=10
211  myGroup.defineHistogram('GLinkParityError,jemLoc;jem_2d_ErrorEventNumbers',
212  title='JEM Error Event Numbers;Events with Error/Mismatch',type='TH2I',
213  cutmask='',path=monHardPath,
214  xbins=EventSamples, xmin=0, xmax=EventSamples, xlabels=[str(i + 1) for i in range(EventSamples)],
215  ybins=NumberOfSummaryBins, ymin=0, ymax=NumberOfSummaryBins, ylabels=err_summary_bin_labels)
216 
217  # RoIs
218  # ==========
219  # bin labels
220  eta_phi_roi_xlabels = [''] * 32
221  for chan in range(-10, 12, 2):
222  eta = chan/5.
223  eta_phi_roi_xlabels[chan+15] = "{}/{:.2f}".format(chan, eta)
224  eta_phi_roi_xlabels[1] = "-14/-2.95"
225  eta_phi_roi_xlabels[3] = "-12/-2.45"
226  eta_phi_roi_xlabels[27] = "12/2.45"
227  eta_phi_roi_xlabels[29] = "14/2.95"
228  eta_phi_roi_xlabels[31] = "16/4.05"
229 
230  eta_phi_roi_ylabels = [''] * 32
231  phiBin = math.pi/16.
232  for chan in range(0, 32, 2):
233  rad = (chan + 1)*phiBin
234  eta_phi_roi_ylabels[chan] = "{}/{:.2f}".format(chan, rad)
235  eta_phi_roi_ylabels[-1] = "etaVphi"
236 
237  eta_phi_roi_bin_labels = {
238  'xlabels': eta_phi_roi_xlabels,
239  'ylabels': eta_phi_roi_ylabels
240  }
241 
242  maxLarge = 1024
243  maxSmall = 512
244  myGroup.defineHistogram('jemRoiEnergyLg;jem_1d_roi_EnergyLg',
245  title='JEM TOB RoI Energy Large Window Size;', type='TH1F',
246  cutmask='', path=monRoIPath,
247  xbins=jebins, xmin=0., xmax=maxLarge)
248  myGroup.defineHistogram('jemRoiEnergySm;jem_1d_roi_EnergySm',
249  title='JEM TOB RoI Energy Small Window Size;', type='TH1F',
250  cutmask='', path=monRoIPath,
251  xbins=jebins, xmin=0., xmax=maxSmall)
252  # JEM TOB RoI TOBs per JEM
253  tobsPerJEMLabels = [str(i + 1) for i in range(tobsPerJEM + 1)]
254  tobsPerJEMLabels[-1] = 'More'
255  myGroup.defineHistogram('jemRoiTOBsPerJEM;jem_1d_roi_TOBsPerJEM',
256  title='JEM TOB RoI TOBs per JEM;Number of TOBs', type='TH1F',
257  cutmask='', path=monRoIPath, xlabels=tobsPerJEMLabels,
258  xbins=tobsPerJEM + 1, xmin=1, xmax=tobsPerJEM + 2)
259  # RoI eta/phi maps
260  myGroup.defineHistogram('jemRoiEta,jemRoiPhi;jem_2d_etaPhi_roi_Hitmap',
261  title='JEM TOB RoIs Hit Map;;', type='TH2F',
262  cutmask='', path=monRoIPath, **eta_phi_bins, **eta_phi_roi_bin_labels)
263  myGroup.defineHistogram('jemRoiEtaWeighted,jemRoiPhiWeighted;jem_2d_etaPhi_roi_EtWeighted',
264  title='JEM TOB RoIs Hit Map Weighted by Energy;;', type='TH2F',
265  cutmask='', path=monRoIPath, **eta_phi_bins, **eta_phi_roi_bin_labels,
266  weight='jemRoiEnergyWeight')
267 
268  acc = helper.result()
269  result.merge(acc)
270  return result
271 
272 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
str
Definition: BTagTrackIpAccessor.cxx:11
JepJemMonitorAlgorithm.JepJemMonitoringConfig
def JepJemMonitoringConfig(inputFlags)
Definition: JepJemMonitorAlgorithm.py:4