ATLAS Offline Software
Functions | Variables
MdtMonUtils Namespace Reference

Functions

def getMDTLabel (x, y)
 
def getMDTLabelx (x)
 
def putBoxMdtRegional (h, xAxis, geo)
 
def putBoxMdtGlobal (h, ecap, geo)
 
def putBox (h, x1, y1, x2, y2, offset)
 
def putLine (h, x1, y1, x2, y2, offset=0, c=1)
 
def getTubeLength (name)
 
def MDT2DHWName (name)
 
def MDTTubeEff (name, hi_num, hi_den)
 
def fittzero (x, par)
 
def fittmax (x, par)
 
def MDTFitTDC (h)
 

Variables

dictionary tubeLenght_dict
 
 tf1_fittzero = TF1("func1", fittzero, 0., 200., 4)
 
 tf1_fittmax = TF1("func2", fittmax, 0., 200., 4)
 

Function Documentation

◆ fittmax()

def MdtMonUtils.fittmax (   x,
  par 
)

Definition at line 540 of file MdtMonUtils.py.

540 def fittmax(x, par):
541  fitvaltmax = par[0] + ( par[3] / ( 1 + ( TMath.Exp((x[0]-par[1])/par[2]) ) ) )
542  return fitvaltmax
543 

◆ fittzero()

def MdtMonUtils.fittzero (   x,
  par 
)

Definition at line 533 of file MdtMonUtils.py.

533 def fittzero(x, par):
534  fitvaltzero = par[0] + ( par[3] / ( 1 + ( TMath.Exp((-x[0]+par[1])/par[2]) ) ) )
535  return fitvaltzero
536 

◆ getMDTLabel()

def MdtMonUtils.getMDTLabel (   x,
  y 
)

Definition at line 8 of file MdtMonUtils.py.

8 def getMDTLabel(x,y):
9  labelx = getattr(labels, x)
10  labely = getattr(labels, y)
11  return labelx,labely
12 
13 

◆ getMDTLabelx()

def MdtMonUtils.getMDTLabelx (   x)

Definition at line 14 of file MdtMonUtils.py.

14 def getMDTLabelx(x):
15  labelx = getattr(labels, x)
16  return labelx
17 
18 

◆ getTubeLength()

def MdtMonUtils.getTubeLength (   name)

Definition at line 456 of file MdtMonUtils.py.

456 def getTubeLength( name ):
457 
458  name03=name[0:3]
459  name04=name[0:4]
460  name56= name[5:7]
461 
462  tubeLength = 4.9615
463 
464  tubeLength = tubeLenght_dict.get(name03, tubeLength)
465  tubeLength = tubeLenght_dict.get(name04, tubeLength)
466  tubeLength = tubeLenght_dict.get(name03+name56, tubeLength)
467  tubeLength = tubeLenght_dict.get(name04+name56, tubeLength)
468 
469  return tubeLength
470 
471 

◆ MDT2DHWName()

def MdtMonUtils.MDT2DHWName (   name)

Definition at line 472 of file MdtMonUtils.py.

472 def MDT2DHWName(name):
473  statphi_s = name[5:7]
474  eta_s = name[3:4]
475  #ME1[AC]14 (mistake - is actually 13 - so account for both cases!) -->BME4[AC]13 in histogram position
476  if(name[0:3]=="BME"):
477  eta_s = "4"
478  statphi_s = "13"
479 
480  statphi_c = statphi_s+" 1"
481  statphi_c2 = statphi_s+" 2"
482  if(name[0:3]=="BIR" or name[0:3]=="BIM") :
483  statphi_c = statphi_c +" "+name[2:3]
484  statphi_c2 = statphi_c2 +" "+name[2:3]
485 
486  #BML[45][AC]13-->BML[56][AC]13
487  if(name[0:3] == "BML" and int(name[3:4])>=4 and name[5:7] == "13"):
488  eta_s = str(int(name[3:4])+1)
489 
490  #BMF1,2,3 corresponds to eta stations 1,3,5
491  if( name[0:3] == "BMF"):
492  eta_s=str(int(name[3:4])*2-1)
493 
494  stateta_c = name[0:2]
495  stateta_c += name[4:5]
496  stateta_c += eta_s
497 
498  stateta_IMO_c = name[0:1]
499  stateta_IMO_c += name[4:5]
500  stateta_IMO_c += eta_s
501 
502  statphi_IMO_c = name[1:2]+" "+statphi_s
503  if((name[0:3]=="BIR" or name[0:3]=="BIM") and (name[5:7] == "11" or name[5:7] == "15" )):
504  statphi_IMO_c = statphi_IMO_c+" "+name[2:3]
505 
506  return (stateta_IMO_c, statphi_IMO_c, stateta_c, statphi_c, statphi_c2)
507 
508 

◆ MDTFitTDC()

def MdtMonUtils.MDTFitTDC (   h)

Definition at line 546 of file MdtMonUtils.py.

546 def MDTFitTDC(h):
547  t0 = 0
548  tmax = 0
549  t0err = 0
550  tmaxerr = 0
551  up = h.GetBinCenter(h.GetMaximumBin()+1)
552  if( up > 200 ):
553  up = 200
554  down = up + 650
555  if( up < 50 ):
556  up = 50
557  parESD0 = h.GetBinContent(h.GetMinimumBin())
558  parESD1 = up
559  parESD2 = 20
560  parESD3 = h.GetBinContent(h.GetMaximumBin()) - h.GetBinContent(h.GetMinimumBin())
561  func1 = tf1_fittzero
562  func1.SetRange(0., up)
563  func1.SetParameters(parESD0, parESD1, parESD2, parESD3)
564  func1.SetLineColor(kBlue+2)
565  if(h.GetEntries()>100):
566  h.Fit("func1","RQN")
567  t0 = func1.GetParameter(1)
568  t0err = func1.GetParError(1)
569  binAtT0 = h.GetBinContent(h.FindBin(t0))
570  if(binAtT0<1):
571  binAtT0 = 1
572  # // to additionally account for bad fits
573  if(func1.GetNumberFitPoints()!=0):
574  t0err += 10.0 * func1.GetChisquare() / (0.01*binAtT0*binAtT0*func1.GetNumberFitPoints())
575 
576  parESD0 = h.GetBinContent(h.GetMinimumBin())
577  parESD1 = down
578  parESD2 = 50
579  parESD3 = (h.GetBinContent(h.GetMaximumBin())-h.GetBinContent(h.GetMinimumBin()))/10.
580  func2 = tf1_fittmax
581  func2.SetRange((down-135), (down+135))
582  func2.SetParameters(parESD0,parESD1,parESD2,parESD3)
583  func2.SetLineColor(kRed+1)
584  if(h.GetEntries()>100):
585  func2.SetParLimits(0, parESD0, 2.0*parESD0+1)
586  func2.SetParLimits(2, 5, 90)
587  func2.SetParLimits(3, 0.2*parESD3, 7*parESD3)
588  h.Fit("func2","WWRQN+")
589  tmax = func2.GetParameter(1)
590  tmaxerr = func2.GetParError(1)
591  binAtTmax = h.GetBinContent(h.FindBin(tmax))
592  if(binAtTmax<1):
593  binAtTmax = 1
594  # to additionally account for bad fits
595  if func2.GetNumberFitPoints() > 0:
596  tmaxerr += 10.0 * func2.GetChisquare() / (0.01*binAtTmax*binAtTmax*func2.GetNumberFitPoints())
597 
598  return [t0, t0err, tmax, tmaxerr]
599 
600 

◆ MDTTubeEff()

def MdtMonUtils.MDTTubeEff (   name,
  hi_num,
  hi_den 
)

Definition at line 509 of file MdtMonUtils.py.

509 def MDTTubeEff(name,hi_num,hi_den):
510  nBinsNum = hi_num.GetNbinsX()
511  BinsML1 = nBinsNum/2
512  if(name[0:4]=="BIS8" or name[0:2]=="BE"):
513  BinsML1=nBinsNum
514  if(nBinsNum!=hi_den.GetNbinsX()):
515  return
516  countsML1=0
517  countsML2=0
518  entriesML1=0
519  entriesML2=0
520  for ibin in range(nBinsNum):
521  entries = hi_den.GetBinContent(ibin)
522  counts = hi_num.GetBinContent(ibin)
523  if(ibin<BinsML1 or BinsML1==nBinsNum) :
524  countsML1+=counts
525  entriesML1+=entries
526  else:
527  countsML2+=counts
528  entriesML2+=entries
529 
530  return (countsML1, countsML2, entriesML1, entriesML2)
531 
532 

◆ putBox()

def MdtMonUtils.putBox (   h,
  x1,
  y1,
  x2,
  y2,
  offset 
)

Definition at line 377 of file MdtMonUtils.py.

377 def putBox(h, x1, y1, x2, y2, offset):
378  box = TBox(x1-offset, y1*0.5, x2-offset, y2*0.5)
379  box.SetFillColor(kGray)
380  box.SetLineColor(kGray)
381  h.GetListOfFunctions().Add(box)
382 

◆ putBoxMdtGlobal()

def MdtMonUtils.putBoxMdtGlobal (   h,
  ecap,
  geo 
)

Definition at line 169 of file MdtMonUtils.py.

169 def putBoxMdtGlobal(h, ecap, geo):
170  if(ecap == "B"):
171  offset = 8
172  # Left Side
173  putBox(h, 0, 0, 6, 16, offset); putLine(h, 6, 0, 6, 16, offset); putLine(h, 2, 16, 6, 16, offset)
174  putBox(h, 0, 16, 2, 18, offset); putLine(h, 2, 16, 2, 18, offset)
175  putLine(h, 0, 18, 2, 18, offset)
176  putBox(h, 0, 20, 2, 22, offset); putLine(h, 2, 20, 2, 22, offset); putLine(h, 0, 20, 2, 20, offset); putLine(h, 0, 22, 2, 22, offset) # 3
177  putBox(h, 0, 24, 2, 26, offset); putLine(h,2,24,2,26,offset); putLine(h, 0, 24, 2, 24, offset); putLine(h, 0, 26, 2, 26, offset) # 5
178  putBox(h, 0, 28, 2, 30, offset); putLine(h,2,28,2,30,offset); putLine(h,0,28,2,28,offset); putLine(h,0,30,2,30,offset) # 7
179  putBox(h, 0, 32, 2, 34, offset); putLine(h,2,32,2,34,offset); putLine(h,0,32,2,32,offset); putLine(h,0,34,2,34,offset) # 9
180  putBox(h, 0, 36, 3, 38, offset); putLine(h,3,36,3,38,offset); putLine(h,0,36,3,36,offset); putLine(h,2,38,3,38,offset) # 11M
181  putBox(h, 0, 38, 2, 40, offset); putLine(h,2,38,2,40,offset); putLine(h,0,40,2,40,offset) # 11R
182  putBox(h, 0, 42, 2, 44, offset); putLine(h,0,42,2,42,offset); putLine(h,2,42,2,44,offset); putLine(h,0,44,2,44,offset) # 13
183  putBox(h, 0, 46, 3, 48, offset); putLine(h,3,46,3,48,offset); putLine(h,0,46,3,46,offset); putLine(h,2,48,3,48,offset) # 15M
184  putBox(h, 0, 48, 2, 50, offset); putLine(h,2,48,2,50,offset); putLine(h,0,50,2,50,offset) # 15R
185  putBox(h, 0, 52, 2, 106, offset)
186  putLine(h,0,52,2,52,offset)
187 
188  putLine(h,0,106,2,106,offset)
189  putBox(h, 0, 108, 1, 110, offset); putLine(h,1,108,1,110,offset); putLine(h,0,108,1,108,offset); putLine(h,0,110,1,110,offset)
190  putBox(h, 0, 112, 2, 116, offset); putLine(h,2,112,2,116,offset); putLine(h,0,112,2,112,offset)
191  putLine(h,2,52,2,106,offset)
192 
193  # Mid Section
194  putBox(h, 8, 0, 9, 106, offset); putLine(h,8,0,8,106, offset); putLine(h,8,106,9,106, offset); putLine(h,9,0,9,106, offset)
195  putBox(h, 8, 108, 9, 110, offset); putLine(h,8,108,9,108, offset); putLine(h,8,110,9,110, offset); putLine(h,8,108,8,110, offset); putLine(h,9,108,9,110, offset)
196  putBox(h, 8, 112, 9, 116, offset); putLine(h,8,112,9,112, offset); putLine(h,8,112,8,116, offset); putLine(h,9,112,9,116, offset)
197 
198  # Right Side
199  putBox(h, 11, 0, 17, 16, offset); putLine(h,11,0,11,16, offset); putLine(h,11,16,15,16, offset)
200  putBox(h, 15, 16, 17, 18, offset); putLine(h,15,16,15,18, offset)
201  if geo==0:
202  putLine(h,15,18,17,18, offset) # 1
203  elif geo==1:
204  putLine(h,15,18,16,18, offset) # 1
205  putBox(h, 15, 20, 17, 22, offset); putLine(h,15,20,15,22, offset); putLine(h,15,20,17,20, offset); putLine(h,15,22,17,22, offset) # 3
206  putBox(h, 15, 24, 17, 26, offset); putLine(h,15,24,15,26, offset); putLine(h,15,24,17,24, offset); putLine(h,15,26,17,26, offset) # 5
207  putBox(h, 15, 28, 17, 30, offset); putLine(h,15,28,15,30, offset); putLine(h,15,28,17,28, offset); putLine(h,15,30,17,30, offset) # 7
208  putBox(h, 15, 32, 17, 34, offset); putLine(h,15,32,15,34, offset); putLine(h,15,32,17,32, offset); putLine(h,15,34,17,34, offset) # 9
209  putBox(h, 14, 36, 17, 38, offset); putLine(h,14,36,14,38, offset); putLine(h,14,36,17,36, offset); putLine(h,14,38,15,38, offset) # 11M
210  putBox(h, 15, 38, 17, 40, offset); putLine(h,15,38,15,40, offset); putLine(h,15,40,17,40, offset) # 11R
211  putBox(h, 15, 42, 17, 44, offset); putLine(h,15,42,15,44, offset); putLine(h,15,42,17,42, offset); putLine(h,15,44,17,44, offset) # 13
212  putBox(h, 14, 46, 17, 48, offset); putLine(h,14,46,14,48, offset); putLine(h,14,46,17,46, offset); putLine(h,14,48,15,48, offset) # 15M
213  putBox(h, 15, 48, 17, 50, offset); putLine(h,15,48,15,50, offset); putLine(h,15,50,17,50, offset) # 15R
214  putBox(h, 15, 52, 17, 106, offset)
215  if geo==0:
216  putLine(h,15,52,17,52, offset)
217  elif geo==1:
218  putLine(h,15,52,16,52, offset)
219  putLine(h,15,106,17,106, offset)
220  putBox(h, 16, 108, 17, 110, offset); putLine(h,16,108,16,110, offset); putLine(h,16,108,17,108, offset); putLine(h,16,110,17,110, offset)
221  putBox(h, 15, 112, 17, 116, offset); putLine(h,15,112,15,116, offset); putLine(h,15,112,17,112, offset)
222 
223  if geo==1:
224  putBox(h, 8, 18, 9, 52, 0)
225 
226  putLine(h,15,52,15,106, offset)
227 
228  elif(ecap == "E"):
229  offset = 6
230  # Bottom:
231  putBox(h, 0, 0, 4, 32, offset); putBox(h, 4, 8, 5, 10, offset)
232  putLine(h, 4, 0, 4, 8, offset); putLine(h, 4, 8, 5, 8, offset); putLine(h, 5, 8, 5, 10, offset); putLine(h, 4, 10, 5, 10, offset); putLine(h, 4, 10, 4, 32, offset) # Left side
233  putBox(h, 8, 0, 12, 32, offset); putBox(h, 7, 8, 8, 10, offset)
234  putLine(h, 8, 0, 8, 8, offset); putLine(h, 7, 8, 8, 8, offset); putLine(h, 7, 8, 7, 10, offset); putLine(h, 7, 10, 8, 10, offset); putLine(h, 8, 10, 8, 32, offset)
235  # Left
236  putBox(h, 0, 32, 1, 34, offset)
237  putBox(h, 0, 34, 4, 36, offset)
238  putBox(h, 0, 36, 2, 38, offset); putLine(h, 2, 36, 2, 38, offset) # phi 3
239  putBox(h, 0, 38, 4, 40, offset)
240  putBox(h, 0, 40, 2, 42, offset)
241  putBox(h, 0, 42, 4, 44, offset)
242  putBox(h, 0, 44, 2, 46, offset); putLine(h, 2, 44, 2, 46, offset) # phi 7
243  putBox(h, 0, 46, 4, 48, offset); putLine(h, 2, 46, 4, 46, offset)
244  putBox(h, 0, 48, 1, 50, offset); putLine(h, 1, 48, 1, 50, offset) # phi 9
245  putBox(h, 0, 50, 4, 52, offset)
246  putBox(h, 0, 52, 2, 54, offset)
247  putBox(h, 0, 54, 4, 56, offset)
248  putBox(h, 0, 56, 2, 58, offset)
249  putBox(h, 0, 58, 4, 60, offset)
250  putBox(h, 0, 60, 2, 62, offset)
251  putBox(h, 0, 62, 4, 64, offset)
252  putBox(h, 0, 64, 1, 96, offset); putLine(h, 1, 64, 1, 96, offset); putLine(h, 0, 96, 1, 96, offset)
253  if geo==1:
254  putBox(h, -3, 32, 3, 64, 0)
255 
256  if geo==0:
257  putLine(h, 1, 32, 4, 32, offset)
258  putLine(h, 1, 34, 4, 34, offset)
259  putLine(h, 1, 48, 4, 48, offset) # phi 8
260  putLine(h, 1, 50, 4, 50, offset)
261  putLine(h, 1, 64, 4, 64, offset) # phi 16
262  putLine(h, 2, 36, 4, 36, offset) # phi 2
263  putLine(h, 2, 38, 4, 38, offset)
264  putLine(h, 2, 40, 4, 40, offset) # phi 4
265  putLine(h, 2, 42, 4, 42, offset)
266  putLine(h, 2, 44, 4, 44, offset) # phi 6
267  putLine(h, 2, 52, 4, 52, offset) # phi 10
268  putLine(h, 2, 54, 4, 54, offset)
269  putLine(h, 2, 56, 4, 56, offset) # phi 12
270  putLine(h, 2, 58, 4, 58, offset)
271  putLine(h, 2, 60, 4, 60, offset) # phi 14
272  putLine(h, 2, 62, 4, 62, offset)
273  elif geo==1:
274  putLine(h, 1, 32, 3, 32, offset)
275  putLine(h, 1, 34, 3, 34, offset)
276  putLine(h, 1, 48, 3, 48, offset) # phi 8
277  putLine(h, 1, 50, 3, 50, offset)
278  putLine(h, 1, 64, 3, 64, offset) # phi 16
279  putLine(h, 2, 36, 3, 36, offset) # phi 2
280  putLine(h, 2, 38, 3, 38, offset)
281  putLine(h, 2, 40, 3, 40, offset) # phi 4
282  putLine(h, 2, 42, 3, 42, offset)
283  putLine(h, 2, 44, 3, 44, offset) # phi 6
284  putLine(h, 2, 52, 3, 52, offset) # phi 10
285  putLine(h, 2, 54, 3, 54, offset)
286  putLine(h, 2, 56, 3, 56, offset) # phi 12
287  putLine(h, 2, 58, 3, 58, offset)
288  putLine(h, 2, 60, 3, 60, offset) # phi 14
289  putLine(h, 2, 62, 3, 62, offset)
290 
291  if geo==0:
292  putLine(h, 4, 34, 4, 36, offset)
293  putLine(h, 4, 38, 4, 40, offset)
294  putLine(h, 4, 42, 4, 44, offset)
295  putLine(h, 4, 46, 4, 48, offset)
296  putLine(h, 4, 50, 4, 52, offset)
297  putLine(h, 4, 54, 4, 56, offset)
298  putLine(h, 4, 58, 4, 60, offset)
299  putLine(h, 4, 62, 4, 64, offset)
300 
301  putLine(h, 1, 32, 1, 34, offset) # phi 1
302  putLine(h, 2, 40, 2, 42, offset) # phi 5
303  putLine(h, 2, 52, 2, 54, offset) # phi 11
304  putLine(h, 2, 56, 2, 58, offset) # phi 13
305  putLine(h, 2, 60, 2, 62, offset) # phi 15
306 
307 
308  # Right
309  putBox(h, 11, 32, 12, 34, offset)
310  putBox(h, 8, 34, 12, 36, offset)
311  putBox(h, 10, 36, 12, 38, offset); putLine(h, 10, 36, 10, 38, offset) # phi 3
312  putBox(h, 8, 38, 12, 40, offset)
313  putBox(h, 10, 40, 12, 42, offset); putLine(h, 10, 40, 10, 42, offset) # phi 5
314  putBox(h, 8, 42, 12, 44, offset)
315  putBox(h, 10, 44, 12, 46, offset); putLine(h, 10, 44, 10, 46, offset) # phi 7
316  putBox(h, 8, 46, 12, 48, offset)# phi 8
317  putBox(h, 11, 48, 12, 50, offset); putLine(h, 11, 48, 11, 50, offset) # phi 9
318  putBox(h, 8, 50, 12, 52, offset)
319  putBox(h, 10, 52, 12, 54, offset); putLine(h, 10, 52, 10, 54, offset) # phi 11
320  putBox(h, 8, 54, 12, 56, offset)
321  putBox(h, 10, 56, 12, 58, offset); putLine(h, 10, 56, 10, 58, offset) # phi 13
322  putBox(h, 8, 58, 12, 60, offset)
323  putBox(h, 10, 60, 12, 62, offset); putLine(h, 10, 60, 10, 62, offset) # phi 15
324  putBox(h, 8, 62, 12, 64, offset)
325  putBox(h, 11, 64, 12, 96, offset); putLine(h, 11, 64, 11, 96, offset); putLine(h, 12, 96, 11, 96, offset)
326 
327  if geo==0:
328  putLine(h, 8, 32, 11, 32, offset)
329  putLine(h, 8, 34, 11, 34, offset)
330  putLine(h, 10, 36, 8, 36, offset) # phi 2
331  putLine(h, 10, 38, 8, 38, offset)
332  putLine(h, 10, 40, 8, 40, offset) # phi 4
333  putLine(h, 10, 42, 8, 42, offset)
334  putLine(h, 10, 44, 8, 44, offset) # phi 6
335  putLine(h, 10, 46, 8, 46, offset)
336  putLine(h, 11, 48, 8, 48, offset) # phi 8
337  putLine(h, 11, 50, 8, 50, offset)
338  putLine(h, 10, 52, 8, 52, offset) # phi 10
339  putLine(h, 10, 54, 8, 54, offset)
340  putLine(h, 10, 56, 8, 56, offset) # phi 12
341  putLine(h, 10, 58, 8, 58, offset)
342  putLine(h, 10, 60, 8, 60, offset) # phi 14
343  putLine(h, 10, 62, 8, 62, offset)
344  putLine(h, 11, 64, 8, 64, offset) # phi 16
345  elif geo==1:
346  putLine(h, 9, 32, 11, 32, offset)
347  putLine(h, 9, 34, 11, 34, offset)
348  putLine(h, 10, 36, 9, 36, offset) # phi 2
349  putLine(h, 10, 38, 9, 38, offset)
350  putLine(h, 10, 40, 9, 40, offset) # phi 4
351  putLine(h, 10, 42, 9, 42, offset)
352  putLine(h, 10, 44, 9, 44, offset) # phi 6
353  putLine(h, 10, 46, 9, 46, offset)
354  putLine(h, 11, 48, 9, 48, offset) # phi 8
355  putLine(h, 11, 50, 9, 50, offset)
356  putLine(h, 10, 52, 9, 52, offset) # phi 10
357  putLine(h, 10, 54, 9, 54, offset)
358  putLine(h, 10, 56, 9, 56, offset) # phi 12
359  putLine(h, 10, 58, 9, 58, offset)
360  putLine(h, 10, 60, 9, 60, offset) # phi 14
361  putLine(h, 10, 62, 9, 62, offset)
362  putLine(h, 11, 64, 9, 64, offset) # phi 16
363 
364  if geo==0:
365  putLine(h, 8, 34, 8, 36, offset)
366  putLine(h, 8, 38, 8, 40, offset)
367  putLine(h, 8, 42, 8, 44, offset)
368  putLine(h, 8, 46, 8, 48, offset)
369  putLine(h, 8, 50, 8, 52, offset)
370  putLine(h, 8, 54, 8, 56, offset)
371  putLine(h, 8, 58, 8, 60, offset)
372  putLine(h, 8, 62, 8, 64, offset)
373 
374  putLine(h, 11, 32, 11, 34, offset) # phi 1
375 
376 

◆ putBoxMdtRegional()

def MdtMonUtils.putBoxMdtRegional (   h,
  xAxis,
  geo 
)

Definition at line 19 of file MdtMonUtils.py.

19 def putBoxMdtRegional(h, xAxis, geo):
20  offset=0
21  #Make gray boxes
22  if(xAxis=="BOA"):
23  putBox(h, 0, 0, 1, 44, offset); putBox(h, 7, 0, 9, 44 ,offset)
24  putBox(h, 0, 48, 1, 52 ,offset); putBox(h, 8, 48, 9, 52 ,offset)
25  putBox(h, 0, 56, 1, 64 ,offset); putBox(h, 7, 56, 9, 64 ,offset)
26 
27  putLine(h, 1, 0, 1, 44 ); putLine(h, 7, 0, 7, 44 ); putLine(h, 0, 44, 1, 44); putLine(h, 7, 44, 9, 44)
28  putLine(h, 1, 48, 1, 52); putLine(h, 8, 48, 8, 52); putLine(h, 0, 48, 1, 48); putLine(h, 8, 48, 9, 48); putLine(h, 0, 52, 1, 52); putLine(h, 8, 52, 9, 52)
29  putLine(h, 1, 56, 1, 64); putLine(h, 7, 56, 7, 64); putLine(h, 0, 56, 1, 56); putLine(h, 7, 56, 9, 56 )
30 
31  if(xAxis=="BOC"):
32  putBox(h, 0, 0, 2, 44 ,offset)
33  putBox(h, 0, 48, 1, 52 ,offset)
34  putBox(h, 0, 56, 2, 64 ,offset)
35 
36  putLine(h, 2, 0, 2, 44); putLine(h, 0, 44, 2, 44)
37  putLine(h, 1, 48, 1, 52); putLine(h, 0, 48, 1, 48); putLine(h, 0, 52, 1, 52)
38  putLine(h, 2, 56, 2, 64); putLine(h, 0, 56, 2, 56)
39 
40  if(xAxis=="BIA") :
41  putBox(h, 6, 0, 8, 4 ,offset); putLine(h, 6, 0, 8, 0); putLine(h, 6, 0, 6, 4); putLine(h, 6, 4, 8, 4) #phi 1
42  putBox(h, 7, 6, 8, 8 ,offset); putLine(h, 7, 6, 8, 6); putLine(h, 7, 6, 7, 8) #phi 2
43  putBox(h, 6, 8, 8, 12 ,offset); putLine(h, 6, 8, 7, 8); putLine(h, 6, 8, 6, 12); putLine(h, 6, 12, 8, 12) #phi 3
44  putBox(h, 7, 14, 8, 16 ,offset); putLine(h, 7, 14, 8, 14); putLine(h, 7, 14, 7, 16) #phi 4
45  putBox(h, 6, 16, 8, 20 ,offset); putLine(h, 6, 16, 7, 16); putLine(h, 6, 16, 6, 20); putLine(h, 6, 20, 8, 20) #phi 5
46  putBox(h, 7, 22, 8, 24 ,offset); putLine(h, 7, 22, 8, 22); putLine(h, 7, 22, 7, 24) #phi 6
47  putBox(h, 6, 24, 8, 28 ,offset); putLine(h, 6, 24, 7, 24); putLine(h, 6, 24, 6, 28); putLine(h, 6, 28, 8, 28) #phi 7
48  putBox(h, 7, 30, 8, 32 ,offset); putLine(h, 7, 30, 8, 30); putLine(h, 7, 30, 7, 32) #phi 8
49  putBox(h, 6, 32, 8, 36 ,offset); putLine(h, 6, 32, 7, 32); putLine(h, 6, 32, 6, 36); putLine(h, 6, 36, 8, 36) #phi 9
50  putBox(h, 7, 38, 8, 40 ,offset); putLine(h, 7, 38, 8, 38); putLine(h, 7, 38, 7, 40) #phi 10
51  putBox(h, 6, 40, 8, 44 ,offset); putLine(h, 6, 40, 7, 40); putLine(h, 6, 40, 6, 44) #putLine(h, 6, 40, 5, 44) #phi 11
52  putBox(h, 5, 44, 8, 48 ,offset); putLine(h, 5, 44, 6, 44); putLine(h, 5, 44, 5, 48); putLine(h, 5, 48, 8, 48) #phi 11 M
53  putBox(h, 7, 50, 8, 52 ,offset); putLine(h, 7, 50, 8, 50); putLine(h, 7, 50, 7, 52) #phi 12
54  putBox(h, 6, 52, 8, 56 ,offset); putLine(h, 6, 52, 7, 52); putLine(h, 6, 52, 6, 56); putLine(h, 6, 56, 8, 56) #phi 13
55  putBox(h, 7, 58, 8, 60 ,offset); putLine(h, 7, 58, 8, 58); putLine(h, 7, 58, 7, 60) #phi 14
56  putBox(h, 6, 60, 8, 64 ,offset); putLine(h, 6, 60, 7, 60); putLine(h, 6, 60, 6, 64) #putLine(h, 6, 60, 5, 64) #phi 15
57  putBox(h, 5, 64, 8, 68 ,offset); putLine(h, 5, 64, 6, 64); putLine(h, 5, 64, 5, 68); putLine(h, 5, 68, 8, 68) #phi 15 M
58  putBox(h, 7, 70, 8, 72 ,offset); putLine(h, 7, 70, 8, 70); putLine(h, 7, 70, 7, 72); putLine(h, 7, 72, 8, 72) # phi 16
59 
60  if geo==1:
61  putBox(h, 7, 0, 8, 72, 0)
62 
63 
64  if(xAxis=="BIC"):
65  putBox(h, 2, 0, 0, 4 ,offset); putLine(h, 2, 0, 0, 0); putLine(h, 2, 0, 2, 4); putLine(h, 2, 4, 0, 4) #phi 1
66  putBox(h, 1, 6, 0, 8 ,offset); putLine(h, 1, 6, 0, 6); putLine(h, 1, 6, 1, 8) #phi 2
67  putBox(h, 2, 8, 0, 12 ,offset); putLine(h, 2, 8, 1, 8); putLine(h, 2, 8, 2, 12); putLine(h, 2, 12, 0, 12) #phi 3
68  putBox(h, 1, 14, 0, 16 ,offset); putLine(h, 1, 14, 0, 14); putLine(h, 1, 14, 1, 16)#phi 4
69  putBox(h, 2, 16, 0, 20 ,offset); putLine(h, 2, 16, 1, 16); putLine(h, 2, 16, 2, 20); putLine(h, 2, 20, 0, 20) #phi 5
70  putBox(h, 1, 22, 0, 24 ,offset); putLine(h, 1, 22, 0, 22); putLine(h, 1, 22, 1, 24) #phi 6
71  putBox(h, 2, 24, 0, 28 ,offset); putLine(h, 2, 24, 1, 24); putLine(h, 2, 24, 2, 28); putLine(h, 2, 28, 0, 28) #phi 7
72  putBox(h, 1, 30, 0, 32 ,offset); putLine(h, 1, 30, 0, 30); putLine(h, 1, 30, 1, 32) #phi 8
73  putBox(h, 2, 32, 0, 36 ,offset); putLine(h, 2, 32, 1, 32); putLine(h, 2, 32, 2, 36); putLine(h, 2, 36, 0, 36) #phi 9
74  putBox(h, 1, 38, 0, 40 ,offset); putLine(h, 1, 38, 0, 38); putLine(h, 1, 38, 1, 40) #phi 10
75  putBox(h, 2, 40, 0, 44 ,offset); putLine(h, 2, 40, 1, 40); putLine(h, 2, 40, 2, 44) #putLine(h, 2, 40, 3, 44) #phi 11
76  putBox(h, 3, 44, 0, 48 ,offset); putLine(h, 3, 44, 2, 44); putLine(h, 3, 44, 3, 48); putLine(h, 3, 48, 0, 48)#phi 11 M
77  putBox(h, 1, 50, 0, 52 ,offset); putLine(h, 1, 50, 0, 50); putLine(h, 1, 50, 1, 52) #phi 12
78  putBox(h, 2, 52, 0, 56 ,offset); putLine(h, 2, 52, 1, 52); putLine(h, 2, 52, 2, 56); putLine(h, 2, 56, 0, 56)# phi 13
79  putBox(h, 1, 58, 0, 60 ,offset); putLine(h, 1, 58, 0, 58); putLine(h, 1, 58, 1, 60) #phi 14
80  putBox(h, 2, 60, 0, 64 ,offset); putLine(h, 2, 60, 1, 60); putLine(h, 2, 60, 2, 64) #putLine(h, 2, 60, 3, 64); //phi 15
81  putBox(h, 3, 64, 0, 68 ,offset); putLine(h, 3, 64, 2, 64); putLine(h, 3, 64, 3, 68); putLine(h, 3, 68, 0, 68) #phi 15 M
82  putBox(h, 1, 70, 0, 72 ,offset); putLine(h, 1, 70, 0, 70); putLine(h, 1, 70, 1, 72); putLine(h, 1, 72, 0, 72) #phi 16
83 
84  if(xAxis=="EIA"):
85  putBox(h, 2, 4, 5, 8 ,offset); putLine(h, 2, 4, 5, 4); putLine(h, 2, 4, 2, 8); putLine(h, 2, 8, 4, 8) #phi 2
86  putBox(h, 4, 8, 5, 12 ,offset); putLine(h, 4, 8, 4, 12) #phi 3
87  putBox(h, 2, 12, 5, 16 ,offset); putLine(h, 2, 12, 4, 12); putLine(h, 2, 12, 2, 16); putLine(h, 2, 16, 4, 16) #phi 4
88  putBox(h, 4, 16, 5, 20 ,offset); putLine(h, 4, 16, 4, 20) #phi 5
89  putBox(h, 2, 20, 5, 24 ,offset); putLine(h, 2, 20, 4, 20); putLine(h, 2, 20, 2, 24); putLine(h, 2, 24, 4, 24) #phi 6
90  putBox(h, 4, 24, 5, 28 ,offset); putLine(h, 4, 24, 4, 28) #phi 7
91  putBox(h, 2, 28, 5, 32 ,offset); putLine(h, 2, 28, 4, 28); putLine(h, 2, 28, 2, 32); putLine(h, 2, 32, 5, 32) # phi 8
92  putBox(h, 2, 36, 5, 40 ,offset); putLine(h, 2, 36, 5, 36); putLine(h, 2, 36, 2, 40); putLine(h, 2, 40, 4, 40) #phi 10
93  putBox(h, 4, 40, 5, 44 ,offset); putLine(h, 4, 40, 4, 44) #phi 11
94  putBox(h, 2, 44, 5, 48 ,offset); putLine(h, 2, 44, 4, 44); putLine(h, 2, 44, 2, 48); putLine(h, 2, 48, 4, 48) #phi 12
95  putBox(h, 4, 48, 5, 52 ,offset); putLine(h, 4, 48, 4, 52) #phi 13
96  putBox(h, 2, 52, 5, 56 ,offset); putLine(h, 2, 52, 4, 52); putLine(h, 2, 52, 2, 56); putLine(h, 2, 56, 4, 56) # phi 14
97  putBox(h, 4, 56, 5, 60 ,offset); putLine(h, 4, 56, 4, 60) #phi 15
98  putBox(h, 2, 60, 5, 64 ,offset); putLine(h, 2, 60, 4, 60); putLine(h, 2, 60, 2, 64); putLine(h, 2, 64, 5, 64) # phi 16
99 
100  if geo ==1:
101  putBox(h, 0, 0, 3, 64 ,0)
102 
103  if(xAxis=="EIC"):
104  putBox(h, 3, 4, 0, 8 ,offset); putLine(h, 3, 4, 0, 4); putLine(h, 3, 4, 3, 8); putLine(h, 3, 8, 1, 8) # phi 2
105  putBox(h, 1, 8, 0, 12 ,offset); putLine(h, 1, 8, 1, 12) #phi 3
106  putBox(h, 3, 12, 0, 16 ,offset); putLine(h, 3, 12, 1, 12); putLine(h, 3, 12, 3, 16); putLine(h, 3, 16, 1, 16) # phi 4
107  putBox(h, 1, 16, 0, 20 ,offset); putLine(h, 1, 16, 1, 20) #phi 5
108  putBox(h, 3, 20, 0, 24 ,offset); putLine(h, 3, 20, 1, 20); putLine(h, 3, 20, 3, 24); putLine(h, 3, 24, 1, 24) # phi 6
109  putBox(h, 1, 24, 0, 28 ,offset); putLine(h, 1, 24, 1, 28) #phi 7
110  putBox(h, 3, 28, 0, 32 ,offset); putLine(h, 3, 28, 1, 28); putLine(h, 3, 28, 3, 32); putLine(h, 3, 32, 0, 32) # phi
111  putBox(h, 3, 36, 0, 40 ,offset); putLine(h, 3, 36, 0, 36); putLine(h, 3, 36, 3, 40); putLine(h, 3, 40, 1, 40) # phi 10
112  putBox(h, 1, 40, 0, 44 ,offset); putLine(h, 1, 40, 1, 44) #phi 11
113  putBox(h, 3, 44, 0, 48 ,offset); putLine(h, 3, 44, 1, 44); putLine(h, 3, 44, 3, 48); putLine(h, 3, 48, 1, 48) # phi 12
114  putBox(h, 1, 48, 0, 52 ,offset); putLine(h, 1, 48, 1, 52) #phi 13
115  putBox(h, 3, 52, 0, 56 ,offset); putLine(h, 3, 52, 1, 52); putLine(h, 3, 52, 3, 56); putLine(h, 3, 56, 1, 56) # phi 14
116  putBox(h, 1, 56, 0, 60 ,offset); putLine(h, 1, 56, 1, 60) #phi 15
117  putBox(h, 3, 60, 0, 64 ,offset); putLine(h, 3, 60, 1, 60); putLine(h, 3, 60, 3, 64); putLine(h, 3, 64, 0, 64) # phi 16
118 
119  if geo ==1:
120  putBox(h, 2, 0, 5, 64 ,0)
121 
122 
123 
124  if(xAxis=="EEA"):
125  putBox(h, 1, 16, 2, 20 ,offset)
126  putLine(h, 1, 16, 2, 16)
127  putLine(h, 1, 16, 1, 20)
128  putLine(h, 1, 20, 2, 20)
129 
130 
131  if(xAxis=="EEC"):
132  putBox(h, 0, 16, 1, 20 ,offset)
133  putLine(h, 0, 16, 1, 16)
134  putLine(h, 1, 16, 1, 20)
135  putLine(h, 0, 20, 1, 20)
136 
137 
138  if(xAxis=="BEA" or xAxis == "BEC"):
139  putBox(h, 2, 0, 3, 16 ,offset)
140  putLine(h, 2, 0, 2, 16)
141 
142 
143  if(xAxis == "EMA" or xAxis == "EMC"):
144  putBox(h, 5, 0, 6, 64 ,offset)
145  putLine(h, 5, 0, 5, 64)
146 
147 
148  if(xAxis == "EOA" or xAxis == "EOC"):
149  putBox(h, 6, 0, 7, 64 ,offset)
150  putLine(h, 6, 0, 6, 64)
151 
152  if(xAxis[0:2] == "EE" or xAxis[0:2] == "BI" or xAxis[0:2] == "EI" or xAxis[0:2] == "BM" or xAxis[0:2] == "BO"):
153  #Draw TickMarks
154  for i in range(h.GetNbinsY()+1):
155  l = TLine(0,i,0.55*h.GetNbinsX()/17,i)
156  h.GetListOfFunctions().Add(l)
157  for i in range(h.GetNbinsX()+1):
158  l = TLine(i,0,i,0.55/17*h.GetNbinsY())
159  h.GetListOfFunctions().Add(l)
160 
161  lx = TLine(0,0,h.GetNbinsX(),0)
162  ly = TLine(0,0,0,h.GetNbinsY())
163  lx.SetLineColor(kBlack)
164  ly.SetLineColor(kBlack)
165  h.GetListOfFunctions().Add(lx)
166  h.GetListOfFunctions().Add(ly)
167 
168 

◆ putLine()

def MdtMonUtils.putLine (   h,
  x1,
  y1,
  x2,
  y2,
  offset = 0,
  c = 1 
)

Definition at line 383 of file MdtMonUtils.py.

383 def putLine(h, x1, y1, x2, y2, offset=0, c=1):
384  line = TLine(x1-offset, y1*0.5, x2-offset, y2*0.5)
385  line.SetLineColor(c)
386  h.GetListOfFunctions().Add(line)
387 

Variable Documentation

◆ tf1_fittmax

MdtMonUtils.tf1_fittmax = TF1("func2", fittmax, 0., 200., 4)

Definition at line 544 of file MdtMonUtils.py.

◆ tf1_fittzero

MdtMonUtils.tf1_fittzero = TF1("func1", fittzero, 0., 200., 4)

Definition at line 537 of file MdtMonUtils.py.

◆ tubeLenght_dict

dictionary MdtMonUtils.tubeLenght_dict

Definition at line 388 of file MdtMonUtils.py.

CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MdtMonUtils.MDTTubeEff
def MDTTubeEff(name, hi_num, hi_den)
Definition: MdtMonUtils.py:509
MdtMonUtils.fittmax
def fittmax(x, par)
Definition: MdtMonUtils.py:540
MdtMonUtils.getMDTLabelx
def getMDTLabelx(x)
Definition: MdtMonUtils.py:14
MdtMonUtils.getMDTLabel
def getMDTLabel(x, y)
Definition: MdtMonUtils.py:8
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
MdtMonUtils.putBoxMdtRegional
def putBoxMdtRegional(h, xAxis, geo)
Definition: MdtMonUtils.py:19
MdtMonUtils.putLine
def putLine(h, x1, y1, x2, y2, offset=0, c=1)
Definition: MdtMonUtils.py:383
MdtMonUtils.getTubeLength
def getTubeLength(name)
Definition: MdtMonUtils.py:456
MdtMonUtils.MDTFitTDC
def MDTFitTDC(h)
Definition: MdtMonUtils.py:546
MdtMonUtils.putBox
def putBox(h, x1, y1, x2, y2, offset)
Definition: MdtMonUtils.py:377
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
MdtMonUtils.MDT2DHWName
def MDT2DHWName(name)
Definition: MdtMonUtils.py:472
str
Definition: BTagTrackIpAccessor.cxx:11
MdtMonUtils.putBoxMdtGlobal
def putBoxMdtGlobal(h, ecap, geo)
Definition: MdtMonUtils.py:169
MdtMonUtils.fittzero
def fittzero(x, par)
Definition: MdtMonUtils.py:533