ATLAS Offline Software
GlobalVariables.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 from __future__ import print_function
4 
5 from ROOT import TMath
6 import AthenaCommon.SystemOfUnits as Units
7 
8 #import cppyy
9 #cppyy.load_library("libLArStrHelperDict")
10 #import LArStrHelper
11 #import ROOT
12 #ROOT.gROOT.GetClass('LArStrHelper::febNameString')
13 from ROOT import LArStrHelper
14 
16  __slots__ = ('HVeta_EMB','HVphi_EMB','HVeta_EMEC','HVphi_EMEC','HVeta_HECFcal','HVphi_HECFcal',
17  'LB_Bins','LB_Min','LB_Max','BCID_Bins','BCID_Min','BCID_Max',
18  'colTime_BinWidth','colTime_Bins','colTime_Min','colTime_Max','avgColTime_BinWidth','avgColTime_Bins','avgColTime_Min','avgColTime_Max',
19  'etaCaloNoise_Bins','etaCaloNoise_Max','etaCaloNoise_Min','etaCaloNoise_FcalBins','etaCaloNoise_FcalMax','etaCaloNoise_FcalMin',
20  'FEB_Feedthrough','FEB_Slot','FEB_Crates',
21  'FEB_N_channels','FEB_channels_Min','FEB_channels_Max', 'N_FEBErrors','FEBErrors',
22  'N_FEB_Parttions_Max','N_Cells', 'N_FEB', 'N_Partitions','N_Gains','Gains',
23  'Feedthrough_Slot_Nbins','Feedthrough_Slot_range','Feedthrough_Slot_labels_Barrel','Feedthrough_Slot_labels_Endcap',
24  'ROD_Crates','ROD_Slots','ROS_link',
25  'N_DigitsSummary','DigitsSummary',
26  'N_SubDet','SubDet','Samples_Bins','Samples_Min','Samples_Max',
27  'Energy_Bins','Energy_Min','Energy_Max', 'DSPEnergy_Bins', 'DSPEnergy_Min', 'DSPEnergy_Max',
28  'DSPTime_Bins', 'DSPTime_Min', 'DSPTime_Max', 'DSPQuality_Bins', 'DSPQuality_Min', 'DSPQuality_Max',
29  'DSP1Energy_Bins', 'DSP1Energy_Min', 'DSP1Energy_Max','DSPRanges_Bins', 'DSPRanges_Min', 'DSPRanges_Max', 'DSPRanges',
30  'DSPEonEoff_Bins','DSPEonEoff_Max', 'DSPTonToff_Bins','DSPTonToff_Max', 'DSPQonQoff_Bins','DSPQonQoff_Max', 'DSPThr_Bins',
31  'L1Trig_Bins','L1Trig_Min','L1Trig_Max',
32  'Evt_Bins','Evt_Min','Evt_Max','Evt_labels',
33  'EvtRej_Bins','EvtRej_Min','EvtRej_Max','EvtRej_labels','rejBits_Bins',
34  'defaultStreamNames',
35  'TotalNcell',
36  'noisyFEB_Bins','noisyFEB_Max','noisyFEB_Min',
37  'Cell_Time_Min','Cell_Time_Max','Emin','Emax','DEmin','DEmax','Qmin','Qmax','DQmin','DQmax',
38  'Tmin','Tmax','DTmin','DTmax','OnlineOffline','TTriggerTypeMax','MaxCellThresholdADC',
39  'CorruptionSource','Streams',
40  'Partitions','Sides','Variables','Layers','Cell_Variables','SuperCell_Variables',
41  'febsBarrelA','febsEndcapA','febsBarrelC','febsEndcapC',
42  'CNFN_tot','CNFXmin_tot','CNFXmax_tot','CNFN_ncoh','CNFXmin_ncoh','CNFXmax_ncoh')
43 
44 
45 lArDQGlobals = LArDQGlobals()
46 
47 #HV eta-phi bins (used by LArAffectedRegions, bin values copied from there). NOTE: EMEC bins are provided as a list of bin boundaries (variable bin size), all other partitions are in format [Nbins,x_low,x_high]
48 #barrel
49 lArDQGlobals.HVeta_EMB = {"EMBAPS":[8, 0.,1.6],"EMBA":[7,0.,1.4]}
50 lArDQGlobals.HVphi_EMB = {"EMBAPS":[32,-TMath.Pi(),TMath.Pi()],"EMBA":[128,-TMath.Pi(),TMath.Pi()]}
51 for end in ["PS",""]:
52  bins=lArDQGlobals.HVeta_EMB["EMBA"+end]
53  lArDQGlobals.HVeta_EMB["EMBC"+end]=[bins[0],-1*(bins[2]+0.01),-1*(bins[1]+0.01)]
54  lArDQGlobals.HVphi_EMB["EMBC"+end]=lArDQGlobals.HVphi_EMB["EMBA"+end]
55 #endcap
56 emecbinsA=[1.375,1.50,1.6,1.8,2.0,2.1,2.3,2.5,2.8,3.2]
57 emecbinsC=[-1*(bi+0.01) for bi in reversed(emecbinsA)]
58 phibinsPS=64
59 phibins=256
60 lArDQGlobals.HVeta_EMEC = {"EMECAPS":emecbinsA,"EMECA":emecbinsA,"EMECCPS":emecbinsC,"EMECC":emecbinsC}
61 lArDQGlobals.HVphi_EMEC={}
62 ps_phirange = range(phibinsPS+1)
63 lArDQGlobals.HVphi_EMEC["EMECAPS"]=[-TMath.Pi()+ x*2*TMath.Pi()/phibinsPS for x in ps_phirange]
64 phirange =range(phibins+1)
65 lArDQGlobals.HVphi_EMEC["EMECA"]=[-TMath.Pi()+ x*2*TMath.Pi()/phibins for x in phirange]
66 lArDQGlobals.HVphi_EMEC["EMECCPS"]=lArDQGlobals.HVphi_EMEC["EMECAPS"]
67 lArDQGlobals.HVphi_EMEC["EMECC"]=lArDQGlobals.HVphi_EMEC["EMECA"]
68 #hec-fcal
69 lArDQGlobals.HVeta_HECFcal = {"HECA":[1,1.5, 3.2],"FCalA":[1, 2.9, 4.9]} #same for all layers
70 lArDQGlobals.HVphi_HECFcal = {"HECA":[32,-TMath.Pi(),TMath.Pi()],"FCalA":[16, -3.2, 3.2]} #same for all layers
71 for par in ["HEC","FCal"]:
72  bins=lArDQGlobals.HVeta_HECFcal[par+"A"]
73  lArDQGlobals.HVeta_HECFcal[par+"C"]=[bins[0],-1*(bins[2]+0.01),-1*(bins[1]+0.01)]
74  lArDQGlobals.HVphi_HECFcal[par+"C"]=lArDQGlobals.HVphi_HECFcal[par+"A"]
75 #Lumi block ranges
76 lArDQGlobals.LB_Bins=3000
77 lArDQGlobals.LB_Min=-0.5
78 lArDQGlobals.LB_Max=lArDQGlobals.LB_Bins+lArDQGlobals.LB_Min
79 #bunch crossing id ranges
80 lArDQGlobals.BCID_Bins=3564
81 lArDQGlobals.BCID_Min=-0.5
82 lArDQGlobals.BCID_Max=lArDQGlobals.BCID_Min+lArDQGlobals.BCID_Bins
83 #LArCollisionTime (A-C) ranges
84 lArDQGlobals.colTime_BinWidth = 0.25*Units.nanosecond
85 lArDQGlobals.colTime_Min=-50.5*Units.nanosecond
86 lArDQGlobals.colTime_Max=50.5*Units.nanosecond
87 lArDQGlobals.colTime_Bins=(int)((lArDQGlobals.colTime_Max-lArDQGlobals.colTime_Min)//lArDQGlobals.colTime_BinWidth)
88 lArDQGlobals.avgColTime_BinWidth = 0.25*Units.nanosecond
89 lArDQGlobals.avgColTime_Min=-40*Units.nanosecond
90 lArDQGlobals.avgColTime_Max=40*Units.nanosecond
91 lArDQGlobals.avgColTime_Bins=(int)((lArDQGlobals.avgColTime_Max-lArDQGlobals.avgColTime_Min)//lArDQGlobals.avgColTime_BinWidth)
92 #eta ranges for caloNoise
93 lArDQGlobals.etaCaloNoise_Bins=320
94 lArDQGlobals.etaCaloNoise_Max=3.2
95 lArDQGlobals.etaCaloNoise_Min=-3.2
96 lArDQGlobals.etaCaloNoise_FcalBins=500
97 lArDQGlobals.etaCaloNoise_FcalMax=5.0
98 lArDQGlobals.etaCaloNoise_FcalMin=-5.0
99 
100 #FEB ranges
101 lArDQGlobals.FEB_Feedthrough={"EMBA":[0,31],"EMBC":[0,31],"EMECA":[0,24],"EMECC":[0,24],"HECA":[0,24],"HECC":[0,24],"FCalA":[0,24],"FCalC":[0,24]}
102 lArDQGlobals.FEB_Slot={"EMBA":[1,14],"EMBC":[1,14],"EMECA":[1,15],"EMECC":[1,15],"HECA":[1,15],"HECC":[1,15],"FCalA":[1,15],"FCalC":[1,15]}
103 lArDQGlobals.FEB_Crates={"EMBA":[1,448],"EMBC":[1,448],"EMECA":[1,375],"EMECC":[1,375],"HECA":[1,375],"HECC":[1,375],"FCalA":[1,375],"FCalC":[1,375]}
104 #Feb N channels
105 lArDQGlobals.FEB_N_channels=128
106 lArDQGlobals.FEB_channels_Min=-0.5
107 lArDQGlobals.FEB_channels_Max=lArDQGlobals.FEB_N_channels-0.5
108 
109 #total number of FEB
110 lArDQGlobals.N_FEB=1524
111 lArDQGlobals.N_FEB_Parttions_Max=500
112 lArDQGlobals.N_Cells=200000
113 
114 #feedthrough+slot ranges
115 lArDQGlobals.Feedthrough_Slot_Nbins={p : (lArDQGlobals.FEB_Feedthrough[p][1]+1)*lArDQGlobals.FEB_Slot[p][1] for p in lArDQGlobals.FEB_Feedthrough }
116 lArDQGlobals.Feedthrough_Slot_range={p : [lArDQGlobals.FEB_Feedthrough[p][0]*lArDQGlobals.FEB_Slot[p][1]+lArDQGlobals.FEB_Slot[p][0]-0.5,lArDQGlobals.FEB_Feedthrough[p][1]*lArDQGlobals.FEB_Slot[p][1]+lArDQGlobals.FEB_Slot[p][1]+0.5] for p in lArDQGlobals.FEB_Feedthrough }
117 range_0_32=range(32)
118 range_1_15=range(1,15)
119 lArDQGlobals.Feedthrough_Slot_labels_Barrel=[str(If) if Is==1 else '' for If in range_0_32 for Is in range_1_15]
120 range_0_25=range(25)
121 range_1_16=range(1,16)
122 lArDQGlobals.Feedthrough_Slot_labels_Endcap=[str(If) if Is==1 else '' for If in range_0_25 for Is in range_1_16]
123 
124 #feedthrough+slot ranges for noise correlation plots
125 lArDQGlobals.Sides=["A","C"]
126 
127 
128 #numbers from LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h
129 #feedthroughString="ft"
130 #slotString="slot"
131 #barrelString="Barrel"
132 #endcapString="Endcap"
133 larStrHelp=LArStrHelper()
134 lArDQGlobals.febsBarrelA=[larStrHelp.febNameString(True,1,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15]
135 lArDQGlobals.febsBarrelC=[larStrHelp.febNameString(True,0,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15]
136 lArDQGlobals.febsEndcapA=[larStrHelp.febNameString(False,1,i_ft,i_slot) for i_ft in range_0_25 for i_slot in range_1_16]
137 lArDQGlobals.febsEndcapC=[larStrHelp.febNameString(False,0,i_ft,i_slot) for i_ft in range_0_25 for i_slot in range_1_16]
138 #lArDQGlobals.febsBarrelA=[barrelString+"A"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_32 for i_slot in range_1_15]
139 #lArDQGlobals.febsBarrelC=[barrelString+"C"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_32 for i_slot in range_1_15]
140 #lArDQGlobals.febsEndcapA=[endcapString+"A"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_25 for i_slot in range_1_16]
141 #lArDQGlobals.febsEndcapC=[endcapString+"C"+feedthroughString+str(i_ft).zfill(2)+slotString+str(i_slot).zfill(2) for i_ft in range_0_25 for i_slot in range_1_16]
142 
143 
144 #ROD ranges
145 lArDQGlobals.ROD_Crates={"EMBA":[1,4],"EMBC":[1,4],"EMECA":[1,3],"EMECC":[1,3],"HECA":[1],"HECC":[1],"FCalA":[1],"FCalC":[1]}
146 lArDQGlobals.ROD_Slots={"EMBA":[1,14],"EMBC":[1,14],"EMECA":[1,13],"EMECC":[1,13],"HECA":[1,6],"HECC":[1,6],"FCalA":[1,4],"FCalC":[1,4]}
147 
148 #ROS ranges
149 lArDQGlobals.ROS_link={"EMBA":[0,31],"EMBC":[0,31],"EMECA":[0,24],"EMECC":[0,24],"HECA":[0,24],"HECC":[0,24],"FCalA":[0,24],"FCalC":[0,24]}
150 
151 #FEB errors
152 lArDQGlobals.N_FEBErrors=13
153 lArDQGlobals.FEBErrors=["Parity","BCID","Sample Header","EVTID","SCAC status","Sca out of range","Gain mismatch","Type mismatch","# of samples","Empty data block","Checksum / block size","Missing header","Bad gain"]
154 
155 #number of cells
156 lArDQGlobals.TotalNcell=182468
157 
158 #partitions
159 lArDQGlobals.N_Partitions=8
160 lArDQGlobals.Partitions=["EMBC","EMBA","EMECC","EMECA","HECC","HECA","FCalC","FCalA"]
161 lArDQGlobals.N_SubDet=4
162 lArDQGlobals.SubDet=["EMB","EMEC","HEC","FCal"]
163 lArDQGlobals.N_Gains=3
164 lArDQGlobals.Gains=["High Gain","Medium Gain","Low Gain"]
165 
166 #digits summary
167 lArDQGlobals.N_DigitsSummary=4
168 lArDQGlobals.DigitsSummary=["OutOfRange","Saturation","Null Digits","Mean Time"]
169 
170 #samples range
171 lArDQGlobals.Samples_Bins=33
172 lArDQGlobals.Samples_Min=-0.5
173 lArDQGlobals.Samples_Max=lArDQGlobals.Samples_Bins-0.5
174 
175 #Samples
176 #check if any algo uses this lArDQGlobals.Sample_N_Min=0
177 #check if any algo uses this lArDQGlobals.Sample_N_Max=32
178 
179 #Cell time (in ns)
180 lArDQGlobals.Cell_Time_Min=-200
181 lArDQGlobals.Cell_Time_Max=200
182 
183 #Energies ranges
184 lArDQGlobals.Emin=-20000.0
185 lArDQGlobals.Emax=20000.0
186 
187 #Difference Energies
188 lArDQGlobals.DEmin=-512
189 lArDQGlobals.DEmax=512
190 
191 #Qfactor range
192 lArDQGlobals.Qmin=0
193 lArDQGlobals.Qmax=6553
194 
195 #Differences Q factor
196 lArDQGlobals.DQmin=-3000
197 lArDQGlobals.DQmax=1000
198 
199 #Time ranges (ps)
200 lArDQGlobals.Tmin=-80000
201 lArDQGlobals.Tmax=80000
202 
203 #Time ranges (ps)
204 lArDQGlobals.Tmin=-80000
205 lArDQGlobals.Tmax=80000
206 
207 #Diff Time ranges (ps)
208 lArDQGlobals.DTmin=-800
209 lArDQGlobals.DTmax=800
210 
211 #ADC energy range
212 lArDQGlobals.Energy_Bins=300
213 lArDQGlobals.Energy_Min=0.
214 lArDQGlobals.Energy_Max=3000.
215 
216 #Cell threshold ADC counts
217 lArDQGlobals.MaxCellThresholdADC=1900
218 
219 #DSP diff
220 lArDQGlobals.DSPEnergy_Bins=400
221 lArDQGlobals.DSPEnergy_Min=-40.
222 lArDQGlobals.DSPEnergy_Max=40.
223 lArDQGlobals.DSPTime_Bins=400
224 lArDQGlobals.DSPTime_Min=-800.
225 lArDQGlobals.DSPTime_Max=800.
226 lArDQGlobals.DSPQuality_Bins=400
227 lArDQGlobals.DSPQuality_Min=-3000.
228 lArDQGlobals.DSPQuality_Max=3000.
229 lArDQGlobals.DSP1Energy_Bins=5000
230 lArDQGlobals.DSP1Energy_Min=-515.
231 lArDQGlobals.DSP1Energy_Max=515.
232 lArDQGlobals.DSPRanges_Bins=4
233 lArDQGlobals.DSPRanges_Min=0
234 lArDQGlobals.DSPRanges_Max=4
235 lArDQGlobals.DSPRanges=["E < 2^{13} MeV","E < 2^{16} MeV","E < 2^{19} MeV","E < 2^{22} MeV"]
236 lArDQGlobals.DSPEonEoff_Bins=300
237 lArDQGlobals.DSPEonEoff_Max=20000.
238 lArDQGlobals.DSPTonToff_Bins=300
239 lArDQGlobals.DSPTonToff_Max=80000.
240 lArDQGlobals.DSPQonQoff_Bins=300
241 lArDQGlobals.DSPQonQoff_Max=66000.
242 lArDQGlobals.DSPThr_Bins=2000
243 
244 #trigger word range
245 lArDQGlobals.L1Trig_Bins=256
246 lArDQGlobals.L1Trig_Min=-0.5
247 lArDQGlobals.L1Trig_Max=lArDQGlobals.L1Trig_Bins-0.5
248 
249 #triggerWord
250 lArDQGlobals.TTriggerTypeMax=256
251 
252 #Corruption errors
253 lArDQGlobals.CorruptionSource=["Parity","BCID Mismatch","Sample header","EVT ID","SCAC status","Sca out of range","Gain mismatch","Type mismatch","# of samples","Empty data block","Checksum /block size","Missing header","Bad gain"]
254 
255 #Event types histo
256 lArDQGlobals.Evt_Bins = 15
257 lArDQGlobals.Evt_Min = -0.5
258 lArDQGlobals.Evt_Max = 14.5
259 lArDQGlobals.Evt_labels = ["","Raw data - Transparent","","Result - Physic","","","Calibration","","","Pedestals","","","","Raw data+Result"]
260 lArDQGlobals.EvtRej_Bins = 8
261 lArDQGlobals.EvtRej_Min = 0
262 lArDQGlobals.EvtRej_Max = 8
263 lArDQGlobals.EvtRej_labels = [">=1 FEB in error",">=4 FEBs in error","LArError_DATACORRUPTED","LArError_DATACORRUPTEDNOVETO","LArError_DATACORRUPTEDVETO","LArError_NOISEBURSTVETO","Accepted","Total"]
264 
265 lArDQGlobals.rejBits_Bins=8192
266 
267 lArDQGlobals.defaultStreamNames = ["express","Main","CosmicCalo","L1Calo","L1Topo","ZeroBias","Standby","LArCells","LArCellsEmpty","Background","others"]
268 
269 #NoisyRO
270 lArDQGlobals.noisyFEB_Bins=51
271 lArDQGlobals.noisyFEB_Min=-0.5
272 lArDQGlobals.noisyFEB_Max=50.5
273 
274 #Creation of the dictionnary
275 lArDQGlobals.Cell_Variables={}
276 lArDQGlobals.Variables=["etaRange","phiRange","etaNbin", "phiNbin","etasize","etaCellSize","etaMin"]
277 lArDQGlobals.Layers=["0","1","2","3"]
278 for Variable in lArDQGlobals.Variables :
279  lArDQGlobals.Cell_Variables[Variable]={}
280  for sdet in lArDQGlobals.SubDet :
281  lArDQGlobals.Cell_Variables[Variable][sdet]={}
282  for Side in lArDQGlobals.Sides :
283  lArDQGlobals.Cell_Variables[Variable][sdet][Side]={}
284  for Layer in lArDQGlobals.Layers:
285  lArDQGlobals.Cell_Variables[Variable][sdet][Side][Layer]=list()
286 
287 #Number of Bins in phi
288 lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["A"]= {"0":64,"1":256,"2":256,"3":256}
289 lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["A"]
290 
291 lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["A"]= {"0":64,"1":64,"2":256,"3":256}
292 lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["A"]
293 
294 lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
295 lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["A"]
296 
297 lArDQGlobals.Cell_Variables["phiNbin"]["FCal"]["A"]= {"1":16,"2":16,"3":16}
298 lArDQGlobals.Cell_Variables["phiNbin"]["FCal"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["FCal"]["A"]
299 
300 
301 #Number of bins in eta in each range of cells (defining only for A side since C side is symmetric)
302 # https://edms.cern.ch/ui/file/1257047/1/OffMappingNote.pdf
303 # Table 2.1
304 lArDQGlobals.Cell_Variables["etaNbin"]["EMB"]["A"]= {"0":[0,61],"1":[0,1,447,451],"2":[0,58,60],"3":[0, 27, 28]}
305 lArDQGlobals.Cell_Variables["etaMin" ]["EMB"]["A"]= {"0":0.0,"1":0.0,"2":0.0,"3":0.0}
306 lArDQGlobals.Cell_Variables["etaCellSize"]["EMB"]["A"]={"0":[0.025],"1":[0.025/4,0.025/8,0.025],"2":[0.025,0.05],"3":[0.05, 0.125]}
307 
308 # Table 3.1
309 lArDQGlobals.Cell_Variables["etaNbin"]["EMEC"]["A"]= {"0":[0,12],"1":[0,1,3,107,155,219,223,230],"2":[0,1,47,54],"3":[0,20]}
310 lArDQGlobals.Cell_Variables["etaMin" ]["EMEC"]["A"]= {"0":1.5,"1":1.375,"2":1.375,"3":1.5}
311 lArDQGlobals.Cell_Variables["etaCellSize"]["EMEC"]["A"]= {"0":[0.025],"1":[0.05,0.025,0.025/8,0.025/6,0.025/4,0.025,0.1],"2":[0.05,0.025,0.1],"3":[0.05]}
312 
313 # Table 4.1
314 lArDQGlobals.Cell_Variables["etaNbin"]["HEC"]["A"]= {"0":[0,10,14],"1":[0,10,13],"2":[0,9,12],"3":[0,8,12]}
315 lArDQGlobals.Cell_Variables["etaMin" ]["HEC"]["A"]= {"0":1.5,"1":1.5,"2":1.6,"3":1.7}
316 lArDQGlobals.Cell_Variables["etaCellSize"]["HEC"]["A"]= {"0":[0.1,0.2],"1":[0.1,0.2],"2":[0.1,0.2],"3":[0.1,0.2]}
317 
318 # Table 5.1
319 lArDQGlobals.Cell_Variables["etaNbin"]["FCal"]["A"]= {"1":[0, 3, 9, 13, 15],"2":[0, 1, 4, 5, 6, 7, 10, 12, 13, 14, 17, 21, 25, 27, 28, 29, 30, 31],"3":[0,2,4,5,6,8]}#
320 lArDQGlobals.Cell_Variables["etaMin" ]["FCal"]["A"]= {"1":3.08,"2":3.192,"3":3.27}
321 lArDQGlobals.Cell_Variables["etaCellSize"]["FCal"]["A"]= {"1":[0.04, 0.1, 0.2, 0.11],"2":[0.007, 0.0035, 0.008, 0.0005, 0.012, 0.01, 0.04, 0.03, 0.02, 0.043, 0.0125, 0.066, 0.132, 0.265, 0.135, 0.15, 0.16],"3":[0.08, 0.135, 0.21, 0.42, 0.21]}
322 
323 
324 
326 for Layer in lArDQGlobals.Layers :
327  for sdet in lArDQGlobals.SubDet:
328  if sdet=="FCal":
329  if Layer=="0": #there's only fcal1, fcal2 and fcal3
330  continue
331  else:
332  phi_range=range(lArDQGlobals.Cell_Variables["phiNbin"][sdet]["A"][Layer]+1)
333  lArDQGlobals.Cell_Variables["phiRange"][sdet]["A"][Layer]=[-0.5+x for x in phi_range]
334  lArDQGlobals.Cell_Variables["phiRange"][sdet]["C"]=lArDQGlobals.Cell_Variables["phiRange"][sdet]["A"]
335  else: #all other partitions
336  phi_range=range(lArDQGlobals.Cell_Variables["phiNbin"][sdet]["A"][Layer]+1)
337  lArDQGlobals.Cell_Variables["phiRange"][sdet]["A"][Layer]=[-TMath.Pi()+ x*2*TMath.Pi()/lArDQGlobals.Cell_Variables["phiNbin"][sdet]["A"][Layer] for x in phi_range]
338  lArDQGlobals.Cell_Variables["phiRange"][sdet]["C"]=lArDQGlobals.Cell_Variables["phiRange"][sdet]["A"]
339  pass
340  pass #partition loop
341  pass #layer loop
342 
343 
345 
346 for sdet in lArDQGlobals.SubDet:
347  for Lay in lArDQGlobals.Layers:
348  if sdet=="FCal" and Lay=="0":
349  continue
350  Ranges=lArDQGlobals.Cell_Variables["etaNbin"][sdet]["A"][Lay]
351  Sizes=lArDQGlobals.Cell_Variables["etaCellSize"][sdet]["A"][Lay]
352  if not len(Ranges)-len(Sizes)==1 :
353  print("Bad list of ranges and size please check")
354  continue
355 
356  etamin=lArDQGlobals.Cell_Variables["etaMin"][sdet]["A"][Lay]
357  currange=[etamin]
358  for k in range(len(Ranges)-1) :
359  eta_range = range(1,Ranges[k+1]-Ranges[k]+1)
360  currange+=[round(currange[-1] + x * Sizes[k],5) for x in eta_range]
361 
362  lArDQGlobals.Cell_Variables["etaRange"][sdet]["A"][Lay]=currange
363  #The C side is just the symmeteric of the A side
364  lArDQGlobals.Cell_Variables["etaRange"][sdet]["C"][Lay] =list(map(lambda x: x*-1,lArDQGlobals.Cell_Variables["etaRange"][sdet]["A"][Lay]))[::-1]
365 
366 
369 lArDQGlobals.SuperCell_Variables={}
370 lArDQGlobals.Variables=["etaRange","phiRange","etaNbin", "phiNbin","etasize","etaCellSize","etaMin","phiMin"]
371 lArDQGlobals.Layers=["0","1","2","3"]
372 for Variable in lArDQGlobals.Variables :
373  lArDQGlobals.SuperCell_Variables[Variable]={}
374  for sdet in lArDQGlobals.SubDet :
375  lArDQGlobals.SuperCell_Variables[Variable][sdet]={}
376  for Side in lArDQGlobals.Sides :
377  lArDQGlobals.SuperCell_Variables[Variable][sdet][Side]={}
378  for Layer in lArDQGlobals.Layers:
379  lArDQGlobals.SuperCell_Variables[Variable][sdet][Side][Layer]=list()
380 for Variable in ["etaRange","phiRange","phiNbin", "phiMin"]:
381  lArDQGlobals.SuperCell_Variables[Variable]["All"] = {}
382  lArDQGlobals.SuperCell_Variables[Variable]["All"]["All"]=list()
383  for Layer in lArDQGlobals.Layers:
384  lArDQGlobals.SuperCell_Variables[Variable]["All"][Layer]=list()
385 
386 
387 #Number of Bins in phi
388 lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["A"]= {"0":64,"1":64,"2":64,"3":64}
389 lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["A"]
390 
391 lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
392 lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["A"]
393 
394 lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
395 lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["A"]
396 
397 lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["A"]= {"1":16,"2":16,"3":16}
398 lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["A"]
399 
400 lArDQGlobals.SuperCell_Variables["phiNbin"]["All"]= {"0":64,"1":64,"2":64,"3":64, "All":16}
401 lArDQGlobals.SuperCell_Variables["phiMin"]["All"] = {"0": -3.094550609588623, "1": -3.0960847139358521, "2": -3.0960847139358521, "3": -TMath.Pi(), "All": -TMath.Pi()}
402 
403 #Number of bins in eta in each range of cells (defining only for A side since C side is symmetric)
404 # https://edms.cern.ch/ui/file/1257047/1/OffMappingNote.pdf
405 # Table 2.1
406 lArDQGlobals.SuperCell_Variables["etaNbin"]["EMB"]["A"]= {"0":[0,14,15],"1":[0,59],"2":[0,56,57],"3":[0, 14]}
407 lArDQGlobals.SuperCell_Variables["etaMin" ]["EMB"]["A"]= {"0":0.0,"1":0.0,"2":0.0,"3":0.0}
408 lArDQGlobals.SuperCell_Variables["etaCellSize"]["EMB"]["A"]={"0":[0.1,0.12],"1":[0.025],"2":[0.025,0.075],"3":[0.1]}
409 
410 # Table 3.1 -- Updated to assume IW layers are 2/3 rather than 1/2
411 lArDQGlobals.SuperCell_Variables["etaNbin"]["EMEC"]["A"]= {"0":[0,3],"1":[0,1,13,25,41,42],"2":[0,1,44,47,48],"3":[0,10,13,14]}
412 lArDQGlobals.SuperCell_Variables["etaMin" ]["EMEC"]["A"]= {"0":1.5,"1":1.375,"2":1.375,"3":1.5}
413 lArDQGlobals.SuperCell_Variables["etaCellSize"]["EMEC"]["A"]={"0":[0.1],"1":[0.125,0.025,0.1/6,0.025,0.1],"2":[0.05,0.025,0.2,0.1],"3":[0.1,0.2,0.1]}
414 
415 # Table 4.1
416 lArDQGlobals.SuperCell_Variables["etaNbin"]["HEC"]["A"]= {"0":[0,10,14],"1":[0,10,14],"2":[0,10,14],"3":[0,10,14]}
417 lArDQGlobals.SuperCell_Variables["etaMin" ]["HEC"]["A"]= {"0":1.5, "1":1.5, "2":1.5, "3":1.5}
418 lArDQGlobals.SuperCell_Variables["etaCellSize"]["HEC"]["A"]= {"0":[0.1,0.2],"1":[0.1,0.2],"2":[0.1,0.2],"3":[0.1,0.2]}
419 
420 # Defined using Sven's binning manually
421 lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["1"]=[3.10,3.20,3.30,3.37,3.45,3.55,3.6,3.65,3.80,3.9,3.972,4.30,4.50,4.66,4.90]
422 lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["2"]=[3.20,3.25,3.35,3.45,3.55,3.75,4.00,4.40,4.90] #Original
423 lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["2"]=[3.20,3.24,3.25,3.35,3.45,3.55,3.65,3.75,4.00,4.40,4.90] #Adding more bins to remove overlap
424 lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["3"]=[3.30,3.40,3.60,4.00,4.90]
425 
426 #Filling Phi ranges
427 for Layer in lArDQGlobals.Layers :
428  for sdet in lArDQGlobals.SubDet:
429  if sdet=="FCal" and Layer == "0": #there's only fcal1, fcal2 and fcal3
430  continue
431  else:
432  phi_range=range(lArDQGlobals.SuperCell_Variables["phiNbin"][sdet]["A"][Layer]+1)
433  lArDQGlobals.SuperCell_Variables["phiRange"][sdet]["A"][Layer]=[-TMath.Pi()+ x*2*TMath.Pi()/lArDQGlobals.SuperCell_Variables["phiNbin"][sdet]["A"][Layer] for x in phi_range]
434  lArDQGlobals.SuperCell_Variables["phiRange"][sdet]["C"]=lArDQGlobals.SuperCell_Variables["phiRange"][sdet]["A"]
435  pass #partition loop
436  pass #layer loop
437 
438 # Phi binning for Layer plots
439 for Layer in ["0","1","2","3","All"] :
440  if Layer == "3" or Layer == "All":
441  phi_range=range(lArDQGlobals.SuperCell_Variables["phiNbin"]["All"][Layer]+1)
442  lArDQGlobals.SuperCell_Variables["phiRange"]["All"][Layer]=[lArDQGlobals.SuperCell_Variables["phiMin"]["All"][Layer] + x*2*TMath.Pi()/lArDQGlobals.SuperCell_Variables["phiNbin"]["All"][Layer] for x in phi_range]
443  else:
444  phi_range=range(lArDQGlobals.SuperCell_Variables["phiNbin"]["All"][Layer])
445  phi_range1 = lArDQGlobals.SuperCell_Variables["phiRange"]["All"][Layer]=[lArDQGlobals.SuperCell_Variables["phiMin"]["All"][Layer] + x*2*TMath.Pi()/lArDQGlobals.SuperCell_Variables["phiNbin"]["All"][Layer] for x in phi_range]
446  phi_range2 = [-1*x for x in phi_range1]
447  lArDQGlobals.SuperCell_Variables["phiRange"]["All"][Layer] = sorted(phi_range1 + phi_range2)
448 
449 #Filling Eta range with Sven's new binning 3/14/23
450 for sdet in lArDQGlobals.SubDet:
451  for Lay in lArDQGlobals.Layers:
452  if Lay not in lArDQGlobals.SuperCell_Variables["etaNbin"][sdet]["A"].keys(): continue
453  if sdet=="FCal":
454  lArDQGlobals.SuperCell_Variables["etaRange"][sdet]["C"][Lay] =list(map(lambda x: x*-1,lArDQGlobals.SuperCell_Variables["etaRange"][sdet]["A"][Lay]))[::-1]
455  else:
456  Ranges=lArDQGlobals.SuperCell_Variables["etaNbin"][sdet]["A"][Lay]
457  Sizes=lArDQGlobals.SuperCell_Variables["etaCellSize"][sdet]["A"][Lay]
458  if not len(Ranges)-len(Sizes)==1 :
459  print("Bad list of ranges and size please check")
460  continue
461 
462  etamin=lArDQGlobals.SuperCell_Variables["etaMin"][sdet]["A"][Lay]
463  currange=[etamin]
464  for k in range(len(Ranges)-1) :
465  eta_range = range(1,Ranges[k+1]-Ranges[k]+1)
466  currange+=[round(currange[-1] + x * Sizes[k],5) for x in eta_range]
467 
468  lArDQGlobals.SuperCell_Variables["etaRange"][sdet]["A"][Lay]=currange
469  lArDQGlobals.SuperCell_Variables["etaRange"][sdet]["C"][Lay] =list(map(lambda x: x*-1,lArDQGlobals.SuperCell_Variables["etaRange"][sdet]["A"][Lay]))[::-1]
470 
471 for layer in ["0","1","2","3"]:
472  lArDQGlobals.SuperCell_Variables["etaRange"]["All"][layer] = sorted(list(set([item for sublist in [lArDQGlobals.SuperCell_Variables["etaRange"][det][side][layer] for det in ["EMB","EMEC","HEC","FCal"] for side in ["A","C"] if layer in lArDQGlobals.SuperCell_Variables["etaRange"][det][side].keys()] for item in sublist ])))
473 
474 #Custom global eta bins
475 eta_range = sorted(list(set([item for sublist in [lArDQGlobals.SuperCell_Variables["etaRange"]["EMB"]["A"]["1"], lArDQGlobals.SuperCell_Variables["etaRange"]["EMEC"]["A"]["2"],lArDQGlobals.SuperCell_Variables["etaRange"]["HEC"]["A"]["0"],lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["2"]] for item in sublist ])))
476 lArDQGlobals.SuperCell_Variables["etaRange"]["All"]["All"] = sorted(list(set(eta_range + [-1*x for x in eta_range])))
477 
478 #CNF
479 lArDQGlobals.CNFN_tot = 80
480 lArDQGlobals.CNFXmin_tot = -400.
481 lArDQGlobals.CNFXmax_tot = 400.
482 lArDQGlobals.CNFN_ncoh = 120
483 lArDQGlobals.CNFXmin_ncoh = -40.
484 lArDQGlobals.CNFXmax_ncoh = 200.
485 
SystemOfUnits
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
GlobalVariables.LArDQGlobals
Definition: GlobalVariables.py:15
pickleTool.object
object
Definition: pickleTool.py:30
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798