ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalVariables.py
Go to the documentation of this file.
1# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3
4from ROOT import TMath
5import 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')
12from 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
44lArDQGlobals = 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
48lArDQGlobals.HVeta_EMB = {"EMBAPS":[8, 0.,1.6],"EMBA":[7,0.,1.4]}
49lArDQGlobals.HVphi_EMB = {"EMBAPS":[32,-TMath.Pi(),TMath.Pi()],"EMBA":[128,-TMath.Pi(),TMath.Pi()]}
50for 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
55emecbinsA=[1.375,1.50,1.6,1.8,2.0,2.1,2.3,2.5,2.8,3.2]
56emecbinsC=[-1*(bi+0.01) for bi in reversed(emecbinsA)]
57phibinsPS=64
58phibins=256
59lArDQGlobals.HVeta_EMEC = {"EMECAPS":emecbinsA,"EMECA":emecbinsA,"EMECCPS":emecbinsC,"EMECC":emecbinsC}
60lArDQGlobals.HVphi_EMEC={}
61ps_phirange = range(phibinsPS+1)
62lArDQGlobals.HVphi_EMEC["EMECAPS"]=[-TMath.Pi()+ x*2*TMath.Pi()/phibinsPS for x in ps_phirange]
63phirange =range(phibins+1)
64lArDQGlobals.HVphi_EMEC["EMECA"]=[-TMath.Pi()+ x*2*TMath.Pi()/phibins for x in phirange]
65lArDQGlobals.HVphi_EMEC["EMECCPS"]=lArDQGlobals.HVphi_EMEC["EMECAPS"]
66lArDQGlobals.HVphi_EMEC["EMECC"]=lArDQGlobals.HVphi_EMEC["EMECA"]
67#hec-fcal
68lArDQGlobals.HVeta_HECFcal = {"HECA":[1,1.5, 3.2],"FCalA":[1, 2.9, 4.9]} #same for all layers
69lArDQGlobals.HVphi_HECFcal = {"HECA":[32,-TMath.Pi(),TMath.Pi()],"FCalA":[16, -3.2, 3.2]} #same for all layers
70for 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
75lArDQGlobals.LB_Bins=3000
76lArDQGlobals.LB_Min=-0.5
77lArDQGlobals.LB_Max=lArDQGlobals.LB_Bins+lArDQGlobals.LB_Min
78#bunch crossing id ranges
79lArDQGlobals.BCID_Bins=3564
80lArDQGlobals.BCID_Min=-0.5
81lArDQGlobals.BCID_Max=lArDQGlobals.BCID_Min+lArDQGlobals.BCID_Bins
82#LArCollisionTime (A-C) ranges
83lArDQGlobals.colTime_BinWidth = 0.25*Units.nanosecond
84lArDQGlobals.colTime_Min=-50.5*Units.nanosecond
85lArDQGlobals.colTime_Max=50.5*Units.nanosecond
86lArDQGlobals.colTime_Bins=(int)((lArDQGlobals.colTime_Max-lArDQGlobals.colTime_Min)//lArDQGlobals.colTime_BinWidth)
87lArDQGlobals.avgColTime_BinWidth = 0.25*Units.nanosecond
88lArDQGlobals.avgColTime_Min=-40*Units.nanosecond
89lArDQGlobals.avgColTime_Max=40*Units.nanosecond
90lArDQGlobals.avgColTime_Bins=(int)((lArDQGlobals.avgColTime_Max-lArDQGlobals.avgColTime_Min)//lArDQGlobals.avgColTime_BinWidth)
91#eta ranges for caloNoise
92lArDQGlobals.etaCaloNoise_Bins=320
93lArDQGlobals.etaCaloNoise_Max=3.2
94lArDQGlobals.etaCaloNoise_Min=-3.2
95lArDQGlobals.etaCaloNoise_FcalBins=500
96lArDQGlobals.etaCaloNoise_FcalMax=5.0
97lArDQGlobals.etaCaloNoise_FcalMin=-5.0
98
99#FEB ranges
100lArDQGlobals.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]}
101lArDQGlobals.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]}
102lArDQGlobals.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
104lArDQGlobals.FEB_N_channels=128
105lArDQGlobals.FEB_channels_Min=-0.5
106lArDQGlobals.FEB_channels_Max=lArDQGlobals.FEB_N_channels-0.5
107
108#total number of FEB
109lArDQGlobals.N_FEB=1524
110lArDQGlobals.N_FEB_Parttions_Max=500
111lArDQGlobals.N_Cells=200000
112
113#feedthrough+slot ranges
114lArDQGlobals.Feedthrough_Slot_Nbins={p : (lArDQGlobals.FEB_Feedthrough[p][1]+1)*lArDQGlobals.FEB_Slot[p][1] for p in lArDQGlobals.FEB_Feedthrough }
115lArDQGlobals.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 }
116range_0_32=range(32)
117range_1_15=range(1,15)
118lArDQGlobals.Feedthrough_Slot_labels_Barrel=[str(If) if Is==1 else '' for If in range_0_32 for Is in range_1_15]
119range_0_25=range(25)
120range_1_16=range(1,16)
121lArDQGlobals.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
124lArDQGlobals.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"
132larStrHelp=LArStrHelper()
133lArDQGlobals.febsBarrelA=[larStrHelp.febNameString(True,1,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15]
134lArDQGlobals.febsBarrelC=[larStrHelp.febNameString(True,0,i_ft,i_slot) for i_ft in range_0_32 for i_slot in range_1_15]
135lArDQGlobals.febsEndcapA=[larStrHelp.febNameString(False,1,i_ft,i_slot) for i_ft in range_0_25 for i_slot in range_1_16]
136lArDQGlobals.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
144lArDQGlobals.ROD_Crates={"EMBA":[1,4],"EMBC":[1,4],"EMECA":[1,3],"EMECC":[1,3],"HECA":[1],"HECC":[1],"FCalA":[1],"FCalC":[1]}
145lArDQGlobals.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
148lArDQGlobals.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
151lArDQGlobals.N_FEBErrors=13
152lArDQGlobals.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
155lArDQGlobals.TotalNcell=182468
156
157#partitions
158lArDQGlobals.N_Partitions=8
159lArDQGlobals.Partitions=["EMBC","EMBA","EMECC","EMECA","HECC","HECA","FCalC","FCalA"]
160lArDQGlobals.N_SubDet=4
161lArDQGlobals.SubDet=["EMB","EMEC","HEC","FCal"]
162lArDQGlobals.N_Gains=3
163lArDQGlobals.Gains=["High Gain","Medium Gain","Low Gain"]
164
165#digits summary
166lArDQGlobals.N_DigitsSummary=4
167lArDQGlobals.DigitsSummary=["OutOfRange","Saturation","Null Digits","Mean Time"]
168
169#samples range
170lArDQGlobals.Samples_Bins=33
171lArDQGlobals.Samples_Min=-0.5
172lArDQGlobals.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)
179lArDQGlobals.Cell_Time_Min=-200
180lArDQGlobals.Cell_Time_Max=200
181
182#Energies ranges
183lArDQGlobals.Emin=-20000.0
184lArDQGlobals.Emax=20000.0
185
186#Difference Energies
187lArDQGlobals.DEmin=-512
188lArDQGlobals.DEmax=512
189
190#Qfactor range
191lArDQGlobals.Qmin=0
192lArDQGlobals.Qmax=6553
193
194#Differences Q factor
195lArDQGlobals.DQmin=-3000
196lArDQGlobals.DQmax=1000
197
198#Time ranges (ps)
199lArDQGlobals.Tmin=-80000
200lArDQGlobals.Tmax=80000
201
202#Time ranges (ps)
203lArDQGlobals.Tmin=-80000
204lArDQGlobals.Tmax=80000
205
206#Diff Time ranges (ps)
207lArDQGlobals.DTmin=-800
208lArDQGlobals.DTmax=800
209
210#ADC energy range
211lArDQGlobals.Energy_Bins=300
212lArDQGlobals.Energy_Min=0.
213lArDQGlobals.Energy_Max=3000.
214
215#Cell threshold ADC counts
216lArDQGlobals.MaxCellThresholdADC=1900
217
218#DSP diff
219lArDQGlobals.DSPEnergy_Bins=400
220lArDQGlobals.DSPEnergy_Min=-40.
221lArDQGlobals.DSPEnergy_Max=40.
222lArDQGlobals.DSPTime_Bins=400
223lArDQGlobals.DSPTime_Min=-800.
224lArDQGlobals.DSPTime_Max=800.
225lArDQGlobals.DSPQuality_Bins=400
226lArDQGlobals.DSPQuality_Min=-3000.
227lArDQGlobals.DSPQuality_Max=3000.
228lArDQGlobals.DSP1Energy_Bins=5000
229lArDQGlobals.DSP1Energy_Min=-515.
230lArDQGlobals.DSP1Energy_Max=515.
231lArDQGlobals.DSPRanges_Bins=4
232lArDQGlobals.DSPRanges_Min=0
233lArDQGlobals.DSPRanges_Max=4
234lArDQGlobals.DSPRanges=["E < 2^{13} MeV","E < 2^{16} MeV","E < 2^{19} MeV","E < 2^{22} MeV"]
235lArDQGlobals.DSPEonEoff_Bins=300
236lArDQGlobals.DSPEonEoff_Max=20000.
237lArDQGlobals.DSPTonToff_Bins=300
238lArDQGlobals.DSPTonToff_Max=80000.
239lArDQGlobals.DSPQonQoff_Bins=300
240lArDQGlobals.DSPQonQoff_Max=66000.
241lArDQGlobals.DSPThr_Bins=2000
242
243#trigger word range
244lArDQGlobals.L1Trig_Bins=256
245lArDQGlobals.L1Trig_Min=-0.5
246lArDQGlobals.L1Trig_Max=lArDQGlobals.L1Trig_Bins-0.5
247
248#triggerWord
249lArDQGlobals.TTriggerTypeMax=256
250
251#Corruption errors
252lArDQGlobals.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
255lArDQGlobals.Evt_Bins = 15
256lArDQGlobals.Evt_Min = -0.5
257lArDQGlobals.Evt_Max = 14.5
258lArDQGlobals.Evt_labels = ["","Raw data - Transparent","","Result - Physic","","","Calibration","","","Pedestals","","","","Raw data+Result"]
259lArDQGlobals.EvtRej_Bins = 8
260lArDQGlobals.EvtRej_Min = 0
261lArDQGlobals.EvtRej_Max = 8
262lArDQGlobals.EvtRej_labels = [">=1 FEB in error",">=4 FEBs in error","LArError_DATACORRUPTED","LArError_DATACORRUPTEDNOVETO","LArError_DATACORRUPTEDVETO","LArError_NOISEBURSTVETO","Accepted","Total"]
263
264lArDQGlobals.rejBits_Bins=8192
265
266lArDQGlobals.defaultStreamNames = ["express","Main","CosmicCalo","L1Calo","L1Topo","ZeroBias","Standby","LArCells","LArCellsEmpty","Background","others"]
267
268#NoisyRO
269lArDQGlobals.noisyFEB_Bins=51
270lArDQGlobals.noisyFEB_Min=-0.5
271lArDQGlobals.noisyFEB_Max=50.5
272
273#Creation of the dictionnary
274lArDQGlobals.Cell_Variables={}
275lArDQGlobals.Variables=["etaRange","phiRange","etaNbin", "phiNbin","etasize","etaCellSize","etaMin"]
276lArDQGlobals.Layers=["0","1","2","3"]
277for 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
287lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["A"]= {"0":64,"1":256,"2":256,"3":256}
288lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["EMB"]["A"]
289
290lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["A"]= {"0":64,"1":64,"2":256,"3":256}
291lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["EMEC"]["A"]
292
293lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
294lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["C"]= lArDQGlobals.Cell_Variables["phiNbin"]["HEC"]["A"]
295
296lArDQGlobals.Cell_Variables["phiNbin"]["FCal"]["A"]= {"1":16,"2":16,"3":16}
297lArDQGlobals.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
303lArDQGlobals.Cell_Variables["etaNbin"]["EMB"]["A"]= {"0":[0,61],"1":[0,1,447,451],"2":[0,58,60],"3":[0, 27, 28]}
304lArDQGlobals.Cell_Variables["etaMin" ]["EMB"]["A"]= {"0":0.0,"1":0.0,"2":0.0,"3":0.0}
305lArDQGlobals.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
308lArDQGlobals.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]}
309lArDQGlobals.Cell_Variables["etaMin" ]["EMEC"]["A"]= {"0":1.5,"1":1.375,"2":1.375,"3":1.5}
310lArDQGlobals.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
313lArDQGlobals.Cell_Variables["etaNbin"]["HEC"]["A"]= {"0":[0,10,14],"1":[0,10,13],"2":[0,9,12],"3":[0,8,12]}
314lArDQGlobals.Cell_Variables["etaMin" ]["HEC"]["A"]= {"0":1.5,"1":1.5,"2":1.6,"3":1.7}
315lArDQGlobals.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
318lArDQGlobals.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]}#
319lArDQGlobals.Cell_Variables["etaMin" ]["FCal"]["A"]= {"1":3.08,"2":3.192,"3":3.27}
320lArDQGlobals.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
325for 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
345for 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
368lArDQGlobals.SuperCell_Variables={}
369lArDQGlobals.Variables=["etaRange","phiRange","etaNbin", "phiNbin","etasize","etaCellSize","etaMin","phiMin"]
370lArDQGlobals.Layers=["0","1","2","3"]
371for 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()
379for 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
387lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["A"]= {"0":64,"1":64,"2":64,"3":64}
388lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["EMB"]["A"]
389
390lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
391lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["EMEC"]["A"]
392
393lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["A"]= {"0":64,"1":64,"2":64,"3":64}
394lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["HEC"]["A"]
395
396lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["A"]= {"1":16,"2":16,"3":16}
397lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["C"]= lArDQGlobals.SuperCell_Variables["phiNbin"]["FCal"]["A"]
398
399lArDQGlobals.SuperCell_Variables["phiNbin"]["All"]= {"0":64,"1":64,"2":64,"3":64, "All":16}
400lArDQGlobals.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
405lArDQGlobals.SuperCell_Variables["etaNbin"]["EMB"]["A"]= {"0":[0,14,15],"1":[0,59],"2":[0,56,57],"3":[0, 14]}
406lArDQGlobals.SuperCell_Variables["etaMin" ]["EMB"]["A"]= {"0":0.0,"1":0.0,"2":0.0,"3":0.0}
407lArDQGlobals.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
410lArDQGlobals.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]}
411lArDQGlobals.SuperCell_Variables["etaMin" ]["EMEC"]["A"]= {"0":1.5,"1":1.375,"2":1.375,"3":1.5}
412lArDQGlobals.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
415lArDQGlobals.SuperCell_Variables["etaNbin"]["HEC"]["A"]= {"0":[0,10,14],"1":[0,10,14],"2":[0,10,14],"3":[0,10,14]}
416lArDQGlobals.SuperCell_Variables["etaMin" ]["HEC"]["A"]= {"0":1.5, "1":1.5, "2":1.5, "3":1.5}
417lArDQGlobals.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
420lArDQGlobals.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]
421lArDQGlobals.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
422lArDQGlobals.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
423lArDQGlobals.SuperCell_Variables["etaRange"]["FCal"]["A"]["3"]=[3.30,3.40,3.60,4.00,4.90]
424
425#Filling Phi ranges
426for 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
438for 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
449for 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
470for 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
474eta_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 ])))
475lArDQGlobals.SuperCell_Variables["etaRange"]["All"]["All"] = sorted(list(set(eta_range + [-1*x for x in eta_range])))
476
477#CNF
478lArDQGlobals.CNFN_tot = 80
479lArDQGlobals.CNFXmin_tot = -400.
480lArDQGlobals.CNFXmax_tot = 400.
481lArDQGlobals.CNFN_ncoh = 120
482lArDQGlobals.CNFXmin_ncoh = -40.
483lArDQGlobals.CNFXmax_ncoh = 200.
484
void print(char *figname, TCanvas *c1)
Helper class to manipulate strings for LArOnlineID names.
STL class.
STL class.