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