ATLAS Offline Software
Functions | Variables
TilePostProcessing Namespace Reference

Functions

def getTileModuleHistogram (inputs, name, title)
 
def setTileModuleHistogramStyle (histogram, markerStyle=None, markerSize=None, markerColor=None, labelSize=None, ymin=None, ymax=None, delta=0.1)
 
def getProfile2D_RMS (inputs, title, name)
 
def getTilePartitionRawChannelNoise (inputs)
 
def getTileModulePedestalsAndLFN (inputs)
 
def getTileModuleHFN (inputs)
 
def getTileModuleCRC (inputs)
 
def getTileModuleBCID (inputs)
 
def getTileStuckBitsNumber2 (inputHistogram)
 
def getTileStuckBitsNumber (inputHistogram)
 
def getTileModuleStuckBits (inputs)
 
def getTileModuleCovariance (inputs)
 
def getTileModuleChi2VsAmplitude (inputs)
 
def getTileModuleAmplitudeAndSigmaWithRMS (inputs)
 
def fillTileModuleMeanAndRMS (histogram, inputs)
 
def getTileModuleSumHistogram (inputs, name, title)
 
def getTileModuleTime (inputs)
 
def getTileModuleTimeCorrected (inputs)
 
def getTileModuleAmplitudeDiffBetweenOfflineAndDSP (inputs)
 
def getTileModuleAmplitudeDSP (inputs)
 
def getTileModuleTimeDiffBetweenOfflineAndDSP (inputs)
 
def channelToPMT (module, channel)
 
def getTileModuleAmplitudeVarianceOverMean (inputs)
 
def getTileModuleAmplitudeOverChargeRatio (inputs)
 
def getTileModuleTimeSlopeAndOffset (inputs)
 
def sigtermHandler (signal, frame)
 

Variables

 parser
 
 action
 
 help
 
 dest
 
 type
 
 int
 
 default
 
 args
 
 server
 
 partition
 
 dataPath
 
 inputPath
 
 outputPath
 
 physConfigurations
 
 physPostProcess
 
 noiseConfigurations
 
 noisePostProcess
 

Function Documentation

◆ channelToPMT()

def TilePostProcessing.channelToPMT (   module,
  channel 
)
This function converts Tile channel number to PMT number (hole/position in drawer)

   Negative number means that PMT is not connected!

Definition at line 691 of file TilePostProcessing.py.

691 def channelToPMT(module, channel):
692  """
693  This function converts Tile channel number to PMT number (hole/position in drawer)
694 
695  Negative number means that PMT is not connected!
696  """
697 
698  position = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
699  13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
700  27, 26, 25, 30, 29, 28,-33,-32, 31, 36, 35, 34,
701  39, 38, 37, 42, 41, 40, 45,-44, 43, 48, 47, 46,
702 
703  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
704  13, 14, 15, 16, 17, 18,-19,-20, 21, 22, 23, 24,
705  -27,-26,-25,-31,-32,-28, 33, 29, 30,-36,-35, 34,
706  44, 38, 37, 43, 42, 41,-45,-39,-40,-48,-47,-46 ]
707 
708  if module.startswith('EB'):
709  channel += 48 # Extended barrel
710  pmt = position[channel]
711  # One need to do something for special modules EBA15 and EBC18 where
712  # the first 4 channels are not connected, but E3 and E4 gap scintilators
713  # are connected to channels 18 and 19 correspondingly
714  if module in ['EBA15', 'EBC18'] and (channel < 4 or channel in [18, 19]):
715  pmt = -pmt
716 
717  return pmt
718 
719 

◆ fillTileModuleMeanAndRMS()

def TilePostProcessing.fillTileModuleMeanAndRMS (   histogram,
  inputs 
)
This function fills 1D summary histogram per Tile module with mean value and RMS of all channels in the module 

Definition at line 596 of file TilePostProcessing.py.

596 def fillTileModuleMeanAndRMS(histogram, inputs):
597  """ This function fills 1D summary histogram per Tile module with mean value and RMS of all channels in the module """
598 
599  for input in inputs:
600 
601  inputHistogram = input[1][0]
602  nEntries = inputHistogram.GetEntries()
603  if nEntries > 0:
604  channel = int(input[0]['channel'])
605  bin = int(channel) + 1
606 
607  rms = inputHistogram.GetRMS()
608  mean = inputHistogram.GetMean()
609  histogram.SetBinContent(bin, mean)
610  histogram.SetBinError(bin, rms)
611 
612 

◆ getProfile2D_RMS()

def TilePostProcessing.getProfile2D_RMS (   inputs,
  title,
  name 
)
This function produces 2D histogram with RMS from Profile2D per Tile partition 

Definition at line 55 of file TilePostProcessing.py.

55 def getProfile2D_RMS(inputs, title, name):
56  """ This function produces 2D histogram with RMS from Profile2D per Tile partition """
57 
58  assert len(inputs) == 1
59 
60  inputProfile = inputs[0][1][0]
61  assert "TProfile2D" in str(inputProfile.ClassName())
62  inputProfile.SetErrorOption("s")
63 
64  fullName = '{}_{}'.format(name, inputs[0][0]['partition'])
65  if 'gain' in inputs[0][0]:
66  fullName += '_' + inputs[0][0]['gain']
67 
68  fullTitle = str(inputProfile.GetTitle()).split(':')[0] + ': ' + title
69 
70  nBinsX = inputProfile.GetNbinsX()
71  nBinsY = inputProfile.GetNbinsY()
72 
73  outputHistogram = inputProfile.Clone()
74  outputHistogram.Reset()
75  outputHistogram.SetTitle(fullTitle)
76  outputHistogram.SetName(fullName)
77  for binX in range(0, nBinsX + 1):
78  for binY in range(0, nBinsY + 1):
79  rms = inputProfile.GetBinError(binX, binY)
80  if rms != 0:
81  outputHistogram.SetBinContent(binX, binY, rms)
82  outputHistogram.SetBinEntries(inputProfile.GetBin(binX, binY), 1)
83 
84  return [outputHistogram]
85 
86 

◆ getTileModuleAmplitudeAndSigmaWithRMS()

def TilePostProcessing.getTileModuleAmplitudeAndSigmaWithRMS (   inputs)
This function produces 1D summary histogram per Tile module with amplitude, sigma, and RMS of all channels in the module 

Definition at line 540 of file TilePostProcessing.py.

541  """ This function produces 1D summary histogram per Tile module with amplitude, sigma, and RMS of all channels in the module """
542 
543  import math
544  import ROOT
545  # Force batch mode
546  ROOT.gROOT.SetBatch(True)
547 
548  gain = inputs[0][0]['gain']
549 
550  amplitudeHistogram = getTileModuleHistogram(inputs, 'amp', 'Average Amplitude and RMS')
551  rmsHistogram = getTileModuleHistogram(inputs, 'rms', 'RMS of Amplitude')
552  sigmaHistogram = getTileModuleHistogram(inputs, 'sigma', 'Sigma of Amplitude from Gaussian fit')
553 
554  fitFunction = ROOT.TF1("g", 'gaus')
555  inputHistogram = inputs[0][1][0]
556  overlapHistogram = inputHistogram.GetBinWidth(1) == inputHistogram.GetBinWidth(100)
557 
558  for input in inputs:
559 
560  inputHistogram = input[1][0]
561  nEntries = inputHistogram.GetEntries()
562  if nEntries > 0:
563  channel = int(input[0]['channel'])
564  bin = int(channel) + 1
565 
566  rms = inputHistogram.GetRMS()
567  amplitude = inputHistogram.GetMean()
568  amplitudeHistogram.SetBinContent(bin, amplitude)
569  amplitudeHistogram.SetBinError(bin, rms / math.sqrt(nEntries))
570 
571  rmsHistogram.SetBinContent(bin, rms)
572  rmsHistogram.SetBinError(bin, rms / math.sqrt(2.0 * nEntries))
573 
574  if nEntries > 90:
575  if overlapHistogram:
576  inputHistogram.Scale(1, 'width')
577  inputHistogram.Fit(fitFunction, 'Q')
578  sigma = fitFunction.GetParameter(2)
579  sigmaError = fitFunction.GetParError(2)
580  sigmaHistogram.SetBinContent(bin, sigma)
581  sigmaHistogram.SetBinError(bin, sigmaError)
582 
583  setTileModuleHistogramStyle(amplitudeHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08,
584  ymin={'hi' : -0.05, 'lo' : -1.0}.get(gain),
585  ymax={'hi' : 0.05, 'lo' : 1.0}.get(gain))
586 
587  yMin = min(0.0, rmsHistogram.GetMinimum(), sigmaHistogram.GetMinimum())
588  yMax = max({'hi' : 0.05, 'lo' : 1.0}.get(gain), rmsHistogram.GetMaximum(), sigmaHistogram.GetMaximum())
589 
590  setTileModuleHistogramStyle(rmsHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08, ymin=yMin, ymax=yMax)
591  setTileModuleHistogramStyle(sigmaHistogram, markerStyle=25, markerSize=0.75, labelSize=0.08,ymin=yMin, ymax=yMax)
592 
593  return [amplitudeHistogram, sigmaHistogram, rmsHistogram]
594 
595 

◆ getTileModuleAmplitudeDiffBetweenOfflineAndDSP()

def TilePostProcessing.getTileModuleAmplitudeDiffBetweenOfflineAndDSP (   inputs)
This function produces 1D summary histogram per Tile module with amplitude difference between offline and DSP of all channels in the module 

Definition at line 658 of file TilePostProcessing.py.

659  """ This function produces 1D summary histogram per Tile module with amplitude difference between offline and DSP of all channels in the module """
660 
661  ampDiffHistogram = getTileModuleHistogram(inputs, 'dspfit_ampdiff', '(DSP-OFFLINE)/OFFLINE Amplitude and RMS')
662  fillTileModuleMeanAndRMS(ampDiffHistogram, inputs)
663  setTileModuleHistogramStyle(ampDiffHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08, ymin=-0.05, ymax=0.05)
664 
665  sumAmpDiffHistogram = getTileModuleSumHistogram(inputs, 'dspfit_amphbar', '(DSP-OFFLINE)/OFFLINE Amplitude for all channels')
666 
667  return [ampDiffHistogram, sumAmpDiffHistogram]
668 
669 

◆ getTileModuleAmplitudeDSP()

def TilePostProcessing.getTileModuleAmplitudeDSP (   inputs)
This function produces 1D summary histogram per Tile module with DSP amplitudes of all channels in the module 

Definition at line 670 of file TilePostProcessing.py.

670 def getTileModuleAmplitudeDSP(inputs):
671  """ This function produces 1D summary histogram per Tile module with DSP amplitudes of all channels in the module """
672 
673  amplitudeHistogram = getTileModuleHistogram(inputs, 'dspamp', 'Average DSP Amplitude and RMS')
674  fillTileModuleMeanAndRMS(amplitudeHistogram, inputs)
675 
676  return [amplitudeHistogram]
677 
678 

◆ getTileModuleAmplitudeOverChargeRatio()

def TilePostProcessing.getTileModuleAmplitudeOverChargeRatio (   inputs)
This function produces 1D summary histogram graph per Tile module with amplitude over charge ratio of all channels in the module 

Definition at line 780 of file TilePostProcessing.py.

781  """ This function produces 1D summary histogram graph per Tile module with amplitude over charge ratio of all channels in the module """
782 
783  import ROOT
784  # Force batch mode
785  ROOT.gROOT.SetBatch(True)
786 
787  from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
788 
789  capactior = str(inputs[0][1][0].GetName()).split('_').pop()
790  amplitudeOverQHistogram = getTileModuleHistogram(inputs, f'qratio_{capactior}', f'Amplitude/Q Ratio for {capactior} pF')
791 
792  gain = inputs[0][0]['gain']
793  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
794  module = inputs[0][0]['module']
795  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
796 
797  amplitudeOverQGraphName = f'{module}_{gain}_tails_{capactior}'
798  amplitudeOverQGraphTitle = f'Run {run} {module} {gainName} gain: Mean Amplitude/Q and up/down tails for {capactior} pF'
799  amplitudeOverQGraph = ROOT.TGraphAsymmErrors(Tile.MAX_CHAN)
800  amplitudeOverQGraph.SetName(amplitudeOverQGraphName)
801  amplitudeOverQGraph.SetTitle(amplitudeOverQGraphTitle)
802 
803  downLimit = 0.7
804  upLimit = 1.3
805 
806  lowIntegralLimit = 0.005
807  mediumIntegralLimit = 0.010
808  highIntegralLimit = 0.015
809 
810  for input in inputs:
811 
812  inputHistogram = input[1][0]
813  channel = int(input[0]['channel'])
814  nEntries = inputHistogram.GetEntries()
815  if nEntries > 0:
816  bin = int(channel) + 1
817 
818  mean = inputHistogram.GetMean()
819  amplitudeOverQHistogram.SetBinContent(bin, mean)
820 
821  # The following code calculates the error bars of amplitude over Q summary plots.
822  # The error bar depends on the percentage of events outside a certain limit.
823  # If the percentage of events outside a certain limit is below the threshold,
824  # then the error bar length is set to 0.
825  # There are 3 different thresholds and a lower and an upper limit.
826  minBin = inputHistogram.FindFirstBinAbove(0)
827  maxBin = inputHistogram.FindLastBinAbove(0)
828  xMin = inputHistogram.GetBinCenter(minBin)
829  xMax = inputHistogram.GetBinCenter(maxBin)
830  if downLimit < mean < upLimit:
831  if xMin > downLimit:
832  xMin = mean
833  else:
834  downLimitBin = inputHistogram.FindBin(downLimit)
835  # We also want underflow, in case... Integral() is calculated including the contents of both limiting bins.
836  # As 0.7 falls in the middle of a bin, we are calculating the integral by excess
837  integral = inputHistogram.Integral(0, downLimitBin)
838  ratio = integral / nEntries
839  if ratio > highIntegralLimit:
840  # Larger error bar
841  xMin = mean - 1.05
842  elif ratio > mediumIntegralLimit:
843  # Intermediate error bar
844  xMin = mean - 0.7
845  elif ratio > lowIntegralLimit:
846  # Small error bar
847  xMin = mean - 0.35
848  else:
849  xMin = mean
850 
851  if xMax < upLimit:
852  xMax = mean
853  else:
854  upLimitBin = inputHistogram.FindBin(upLimit)
855  # We also want overflow, in case... Integral() is calculated including the contents of both limiting bins.
856  # As 1.3 falls in the middle of a bin, we are calculating the integral by excess.
857  integral = inputHistogram.Integral(upLimitBin, (inputHistogram.GetNbinsX() + 1))
858  ratio = integral / nEntries
859  if ratio > highIntegralLimit:
860  # Larger error bar
861  xMax = mean + 1.05
862  elif ratio > mediumIntegralLimit:
863  # Intermediate error bar
864  xMax = mean + 0.7
865  elif ratio > lowIntegralLimit:
866  # Small error bar
867  xMax = mean + 0.35
868  else:
869  xMax = mean
870 
871  amplitudeOverQGraph.SetPoint(channel, channel + 0.5, mean)
872  amplitudeOverQGraph.SetPointError(channel, 0.0, 0.0, max(0.0, mean - xMin), max(0.0, xMax - mean))
873  else:
874  amplitudeOverQGraph.SetPoint(channel, channel + 0.5, 0.0)
875 
876  amplitudeOverQHistogram.SetStats(ROOT.kFALSE)
877  setTileModuleHistogramStyle(amplitudeOverQHistogram, markerStyle=21, markerSize=0.75, ymin=-0.2, ymax=2.2, labelSize=0.06)
878 
879  amplitudeOverQGraph.GetXaxis().SetRangeUser(0, 48)
880  setTileModuleHistogramStyle(amplitudeOverQGraph, markerStyle=21, markerSize=0.75, ymin=-0.2, ymax=2.2)
881 
882 
883  return [amplitudeOverQHistogram, amplitudeOverQGraph]
884 
885 

◆ getTileModuleAmplitudeVarianceOverMean()

def TilePostProcessing.getTileModuleAmplitudeVarianceOverMean (   inputs)
This function produces 1D summary histogram per Tile module with amplitude variance over mean of all channels in the module 

Definition at line 720 of file TilePostProcessing.py.

721  """ This function produces 1D summary histogram per Tile module with amplitude variance over mean of all channels in the module """
722 
723  import math
724  module = inputs[0][0]['module']
725 
726  emptyPMTHistogram = getTileModuleHistogram(inputs, 'pmtGain_empty', 'Variance/Mean')
727  setTileModuleHistogramStyle(emptyPMTHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08, ymin=-0.2, ymax=2.2)
728 
729  evenPMTHistogram = getTileModuleHistogram(inputs, 'pmtGain_even', 'Variance/Mean')
730  setTileModuleHistogramStyle(evenPMTHistogram, markerStyle=22, markerSize=0.75, labelSize=0.08, markerColor=2, ymin=-0.2, ymax=2.2)
731 
732  oddPMTHistogram = getTileModuleHistogram(inputs, 'pmtGain_odd', 'Variance/Mean')
733  setTileModuleHistogramStyle(oddPMTHistogram, markerStyle=23, markerSize=0.75, markerColor=4, labelSize=0.08, ymin=-0.2, ymax=2.2)
734 
735  kapa = 1.30e-3
736 
737  for input in inputs:
738 
739  inputHistogram = input[1][0]
740  nEntries = inputHistogram.GetEntries()
741  if nEntries > 0:
742  channel = int(input[0]['channel'])
743  bin = int(channel) + 1
744  pmt = channelToPMT(module, channel)
745  if pmt < 0: # PMT is not connected
746  emptyPMTHistogram.SetBinContent(bin, 0.01)
747  emptyPMTHistogram.SetBinError(bin, 0.01)
748  else:
749  mean = inputHistogram.GetMean()
750  rms = inputHistogram.GetRMS()
751 
752  meanError = rms / math.sqrt(nEntries)
753  rmsError = rms / math.sqrt(2 * nEntries)
754 
755  if mean > 10e-3 and rms > 0.:
756  varianceOverMean = rms * rms / mean - kapa * mean
757  varianceOverMeanError = (rms * rms / mean) * math.sqrt(4 * (rmsError / rms) * (rmsError / rms) +
758  (meanError / mean) * (meanError / mean))
759  else:
760  varianceOverMean = -0.5
761  varianceOverMeanError = 0.001
762 
763  if pmt % 2 == 0:
764  evenPMTHistogram.SetBinContent(bin, varianceOverMean)
765  evenPMTHistogram.SetBinError(bin, varianceOverMeanError)
766  else:
767  oddPMTHistogram.SetBinContent(bin, varianceOverMean)
768  oddPMTHistogram.SetBinError(bin, varianceOverMeanError)
769 
770 
771  maxY = max(1.05 * oddPMTHistogram.GetMaximum(), 1.05 * evenPMTHistogram.GetMaximum(), 0.20)
772  minY = min(oddPMTHistogram.GetMinimum() - 0.05 * abs(oddPMTHistogram.GetMinimum()),
773  evenPMTHistogram.GetMinimum() - 0.05 * abs(evenPMTHistogram.GetMinimum()), -0.10)
774 
775  emptyPMTHistogram.GetYaxis().SetRangeUser(minY, maxY)
776 
777  return [evenPMTHistogram, oddPMTHistogram, emptyPMTHistogram]
778 
779 

◆ getTileModuleBCID()

def TilePostProcessing.getTileModuleBCID (   inputs)
This function produces 1D summary histogram per Tile module with BCID errors of all DMU in the module 

Definition at line 253 of file TilePostProcessing.py.

253 def getTileModuleBCID(inputs):
254  """ This function produces 1D summary histogram per Tile module with BCID errors of all DMU in the module """
255 
256  import ROOT
257  # Force batch mode
258  ROOT.gROOT.SetBatch(True)
259 
260  gain = inputs[0][0]['gain']
261  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
262  module = inputs[0][0]['module']
263  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
264 
265  bcidName = f'{module}_{gain}_bcid'
266  bcidTitle = f'Run {run} {module} {gainName} gain: BCID errors'
267  bcidHistogram = ROOT.TH1F(bcidName, bcidTitle, 16, 0.0, 16.0)
268 
269  for input in inputs:
270 
271  inputHistogram = input[1][0]
272  dmu = int(input[0]['dmu'])
273  bin = int(dmu) + 1
274 
275  underflow = inputHistogram.GetBinContent(0)
276  bcidZero = inputHistogram.GetBinContent(1)
277  bcidOk = inputHistogram.GetBinContent(2)
278  bcidOther = inputHistogram.GetBinContent(3)
279 
280  weight = -1
281  if (underflow + bcidOther) > 0:
282  weight = 2 # all other errors in BCID
283  else:
284  if bcidOk == 0:
285  weight = 0 # all zeros
286  elif bcidZero == 0:
287  weight = 1 # all OK
288  else:
289  # FIXME: weight = 1.0 - bcidZero / nEvents # percentage of good events
290  weight = 1
291  if weight > 0.8:
292  weight = 0.8 # to see clearly even one event with zeros
293 
294  bcidHistogram.SetBinContent(bin, weight)
295 
296  return [bcidHistogram]
297 
298 
299 

◆ getTileModuleChi2VsAmplitude()

def TilePostProcessing.getTileModuleChi2VsAmplitude (   inputs)
This function produces 2D summary histogram per Tile module with Chi2 vs amplitude of all channels in the module 

Definition at line 515 of file TilePostProcessing.py.

515 def getTileModuleChi2VsAmplitude(inputs):
516  """ This function produces 2D summary histogram per Tile module with Chi2 vs amplitude of all channels in the module """
517 
518  gain = inputs[0][0]['gain']
519  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
520  module = inputs[0][0]['module']
521  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
522 
523  chi2AmpName = f'{module}_{gain}_summary_chi2_amp'
524  chi2AmpTitle = f'Run {run} {module} {gainName} gain: Summary DSP #chi^{2} vs Amplitude'
525  inputHistogram = inputs[0][1][0]
526  chi2AmpHistogram = inputHistogram.Clone()
527  chi2AmpHistogram.Reset()
528  chi2AmpHistogram.SetTitle(chi2AmpTitle)
529  chi2AmpHistogram.SetName(chi2AmpName)
530 
531  for input in inputs:
532  inputHistogram = input[1][0]
533  if inputHistogram.GetEntries() > 0:
534  chi2AmpHistogram.Add(inputHistogram)
535 
536  setTileModuleHistogramStyle(chi2AmpHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08, ymin=-0.05, ymax=10.0)
537 
538  return [chi2AmpHistogram]
539 

◆ getTileModuleCovariance()

def TilePostProcessing.getTileModuleCovariance (   inputs)
Produce Tile 2D histograms per module with covariance and correlation of channels in the module. 

Definition at line 456 of file TilePostProcessing.py.

456 def getTileModuleCovariance(inputs):
457  """ Produce Tile 2D histograms per module with covariance and correlation of channels in the module. """
458 
459  import ROOT
460  # Force batch mode
461  ROOT.gROOT.SetBatch(True)
462 
463  import math
464 
465  from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
466 
467  gain = inputs[0][0]['gain']
468  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
469  module = inputs[0][0]['module']
470  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
471 
472  covarianceName = f'{module}_{gain}_covar'
473  covarianceTitle = f'Run {run} {module} {gainName} gain: Covariance'
474  covarianceHistogram = ROOT.TH2F(covarianceName, covarianceTitle,
475  Tile.MAX_CHAN, 0.0, Tile.MAX_CHAN,
476  Tile.MAX_CHAN, 0.0, Tile.MAX_CHAN)
477 
478  correlationName = f'{module}_{gain}_corr'
479  correlationTitle = f'Run {run} {module} {gainName} gain: Correlation'
480  correlationHistogram = ROOT.TH2F(correlationName, correlationTitle,
481  Tile.MAX_CHAN, 0.0, Tile.MAX_CHAN,
482  Tile.MAX_CHAN, 0.0, Tile.MAX_CHAN)
483 
484  meanSampleHistogram = inputs[0][1][0]
485  meanSample12Histogram = inputs[0][1][1]
486 
487  meanRMS = [0 for i in range(0,48)]
488  covariance = [[0 for i in range(0,48)] for j in range(0,48)]
489 
490  for channel1 in range(0, Tile.MAX_CHAN):
491  meanSample1 = meanSampleHistogram.GetBinContent(channel1 + 1)
492  for channel2 in range(0, Tile.MAX_CHAN):
493  meanSample2 = meanSampleHistogram.GetBinContent(channel2 + 1)
494  meanSample12 = meanSample12Histogram.GetBinContent(channel1 + 1, channel2 + 1)
495  covariance12 = meanSample12 - meanSample1*meanSample2
496  covariance[channel1][channel2] = covariance12
497 
498  covariance11 = covariance[channel1][channel1]
499  meanRMS[channel1] = 0 if covariance11 == 0 else covariance11 / math.sqrt(abs(covariance11))
500 
501  for channel1 in range(0, Tile.MAX_CHAN):
502  for channel2 in range(0, Tile.MAX_CHAN):
503  meanRMS1 = meanRMS[channel1]
504  meanRMS2 = meanRMS[channel2]
505  if (meanRMS1 == 0) or (meanRMS2 == 0):
506  correlation = 0
507  else:
508  correlation = covariance[channel1][channel2] / (meanRMS1 * meanRMS2)
509  correlationHistogram.SetBinContent(channel1 + 1, channel2 + 1, correlation)
510  covarianceHistogram.SetBinContent(channel1 + 1, channel2 + 1, covariance[channel1][channel2])
511 
512  return [covarianceHistogram, correlationHistogram]
513 
514 

◆ getTileModuleCRC()

def TilePostProcessing.getTileModuleCRC (   inputs)
This function produces 1D summary histogram per Tile module with CRC errors of all DMU in the module 

Definition at line 200 of file TilePostProcessing.py.

200 def getTileModuleCRC(inputs):
201  """ This function produces 1D summary histogram per Tile module with CRC errors of all DMU in the module """
202 
203  import ROOT
204  # Force batch mode
205  ROOT.gROOT.SetBatch(True)
206 
207  module = inputs[0][0]['module']
208  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
209 
210  crcName = f'{module}_crc'
211  crcTitle = f'Run {run} {module}: CRC errors'
212  crcHistogram = ROOT.TH1F(crcName, crcTitle, 16, 0.0, 16.0)
213 
214  for input in inputs:
215 
216  inputHistogram = input[1][0]
217  dmu = int(input[0]['dmu'])
218  bin = int(dmu) + 1
219 
220  underflow = inputHistogram.GetBinContent(0)
221  crcGlobal = inputHistogram.GetBinContent(1)
222  crcOk = inputHistogram.GetBinContent(2)
223  crcFE = inputHistogram.GetBinContent(3)
224  crcROD = inputHistogram.GetBinContent(4)
225  crcFE_ROD = inputHistogram.GetBinContent(5)
226 
227  weight = -1
228  if (underflow + crcFE + crcROD + crcFE_ROD) > 0:
229  if (crcROD == 0) and (crcFE_ROD == 0):
230  weight = 2 # FE CRC only errors
231  elif (crcFE == 0) and (crcFE_ROD == 0):
232  weight = 3 # ROD CRC only errors
233  else:
234  # If there are ROD and FE errors (not necessary at the same time), weight is 2.5
235  weight = 2.5 #ROD and FE CRC errors
236  else:
237  if crcOk == 0:
238  weight = 0 # all zeros
239  elif crcGlobal == 0:
240  weight = 1 # all OK
241  else:
242  # FIXME: weight = 1.0 - crcGlobal / nEvents # percentage of good events
243  weight = 1
244  if weight > 0.8:
245  weight = 0.8 # to see clearly even one event with zeros
246 
247  crcHistogram.SetBinContent(bin, weight)
248 
249  return [crcHistogram]
250 
251 
252 

◆ getTileModuleHFN()

def TilePostProcessing.getTileModuleHFN (   inputs)
This function produces 1D summary histogram per Tile module with HFN of all channels in the module 

Definition at line 183 of file TilePostProcessing.py.

183 def getTileModuleHFN(inputs):
184  """ This function produces 1D summary histogram per Tile module with HFN of all channels in the module """
185 
186  hfnHistogram = getTileModuleHistogram(inputs, 'rms_hfr', 'RMS noise high frequency')
187 
188  for input in inputs:
189 
190  inputHistogram = input[1][0]
191  channel = int(input[0]['channel'])
192  bin = int(channel) + 1
193 
194  hfn = inputHistogram.GetMean()
195  hfnHistogram.SetBinContent(bin, hfn)
196 
197  return [hfnHistogram]
198 
199 

◆ getTileModuleHistogram()

def TilePostProcessing.getTileModuleHistogram (   inputs,
  name,
  title 
)
This function returns 1D histogram for Tile module 

Definition at line 15 of file TilePostProcessing.py.

15 def getTileModuleHistogram(inputs, name, title):
16  """ This function returns 1D histogram for Tile module """
17 
18  import ROOT
19  # Force batch mode
20  ROOT.gROOT.SetBatch(True)
21 
22  from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
23 
24  gain = inputs[0][0]['gain']
25  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
26  module = inputs[0][0]['module']
27  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
28 
29  fullName = f'{module}_{gain}_{name}'
30  fullTitle = f'Run {run} {module} {gainName} gain: {title}'
31  histogram = ROOT.TH1F(fullName, fullTitle, Tile.MAX_CHAN, 0.0, Tile.MAX_CHAN)
32 
33  return histogram
34 
35 

◆ getTileModulePedestalsAndLFN()

def TilePostProcessing.getTileModulePedestalsAndLFN (   inputs)
This function produces 1D summary histogram per Tile module with pedestals and LFN of all channels in the module 

Definition at line 161 of file TilePostProcessing.py.

161 def getTileModulePedestalsAndLFN(inputs):
162  """ This function produces 1D summary histogram per Tile module with pedestals and LFN of all channels in the module """
163 
164  pedestalHistogram = getTileModuleHistogram(inputs, 'ped', 'Pedestal[0]')
165  lfnHistogram = getTileModuleHistogram(inputs, 'rms_lfr', 'RMS noise low frequency')
166 
167  for input in inputs:
168 
169  inputHistogram = input[1][0]
170  channel = int(input[0]['channel'])
171  bin = int(channel) + 1
172 
173  rms = inputHistogram.GetRMS()
174  pedestal = inputHistogram.GetMean()
175  pedestalHistogram.SetBinContent(bin, pedestal)
176  pedestalHistogram.SetBinError(bin, rms)
177 
178  lfnHistogram.SetBinContent(bin, rms)
179 
180  return [pedestalHistogram, lfnHistogram]
181 
182 

◆ getTileModuleStuckBits()

def TilePostProcessing.getTileModuleStuckBits (   inputs)
Produce Tile 1D summary histograms per module with stuck bits and zeros for all channels in the module 

Definition at line 426 of file TilePostProcessing.py.

426 def getTileModuleStuckBits(inputs):
427  """ Produce Tile 1D summary histograms per module with stuck bits and zeros for all channels in the module """
428 
429  bitsHistogram = getTileModuleHistogram(inputs, 'bits', 'Stuck bits and zero amplitudes')
430 
431  for input in inputs:
432 
433  inputHistogram = input[1][0]
434  channel = int(input[0]['channel'])
435  bin = int(channel) + 1
436 
437  nZeros = inputHistogram.GetBinContent(1)
438  integral = inputHistogram.Integral(2, inputHistogram.GetNbinsX()) # first bin is excluded
439 
440  weight = 0
441  if integral > 0: # if we have weight=0, then there is no non-zero amplitudes
442  if nZeros > 0:
443  weight = 0.5 # sometimes zeros
444  else:
445  weight = 1.0 # assume that all OK
446 
447  nStuckBits = getTileStuckBitsNumber(inputHistogram)
448  if nStuckBits > 0:
449  weight += 1.0 # some stuck bits
450 
451  bitsHistogram.SetBinContent(bin, weight)
452 
453  return [bitsHistogram]
454 
455 

◆ getTileModuleSumHistogram()

def TilePostProcessing.getTileModuleSumHistogram (   inputs,
  name,
  title 
)
This function produces 1D summary histogram per Tile module adding all histograms per channel in the module 

Definition at line 613 of file TilePostProcessing.py.

613 def getTileModuleSumHistogram(inputs, name, title):
614  """ This function produces 1D summary histogram per Tile module adding all histograms per channel in the module """
615 
616  gain = inputs[0][0]['gain']
617  gainName = {'hi' : 'high', 'lo' : 'low'}.get(gain)
618  module = inputs[0][0]['module']
619  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
620 
621  fullName = f'{module}_{gain}_{name}'
622  fullTitle = f'Run {run} {module} {gainName} gain: {title}'
623  inputHistogram = inputs[0][1][0]
624  sumHistogram = inputHistogram.Clone()
625  sumHistogram.Reset()
626  sumHistogram.SetTitle(fullTitle)
627  sumHistogram.SetName(fullName)
628 
629  for input in inputs:
630  inputHistogram = input[1][0]
631  nEntries = inputHistogram.GetEntries()
632  if nEntries > 0:
633  sumHistogram.Add(inputHistogram)
634 
635  return sumHistogram
636 
637 

◆ getTileModuleTime()

def TilePostProcessing.getTileModuleTime (   inputs)
This function produces 1D summary histogram per Tile module with time of all channels in the module 

Definition at line 638 of file TilePostProcessing.py.

638 def getTileModuleTime(inputs):
639  """ This function produces 1D summary histogram per Tile module with time of all channels in the module """
640 
641  timeHistogram = getTileModuleHistogram(inputs, 'time', 'Average Time and RMS')
642  fillTileModuleMeanAndRMS(timeHistogram, inputs)
643  setTileModuleHistogramStyle(timeHistogram, markerStyle=21, markerSize=0.75, ymin=-25.0, ymax=25.0, labelSize=0.08)
644 
645  return [timeHistogram]
646 
647 

◆ getTileModuleTimeCorrected()

def TilePostProcessing.getTileModuleTimeCorrected (   inputs)
This function produces 1D summary histogram per Tile module with time corrected of all channels in the module 

Definition at line 648 of file TilePostProcessing.py.

648 def getTileModuleTimeCorrected(inputs):
649  """ This function produces 1D summary histogram per Tile module with time corrected of all channels in the module """
650 
651  timeHistogram = getTileModuleHistogram(inputs, 'time_corr', 'Average Time corrected and RMS')
652  fillTileModuleMeanAndRMS(timeHistogram, inputs)
653  setTileModuleHistogramStyle(timeHistogram, markerStyle=21, markerSize=0.75, ymin=-25.0, ymax=25.0, labelSize=0.08)
654 
655  return [timeHistogram]
656 
657 

◆ getTileModuleTimeDiffBetweenOfflineAndDSP()

def TilePostProcessing.getTileModuleTimeDiffBetweenOfflineAndDSP (   inputs)
This function produces 1D summary histogram per Tile module with time difference between offline and DSP of all channels in the module 

Definition at line 679 of file TilePostProcessing.py.

680  """ This function produces 1D summary histogram per Tile module with time difference between offline and DSP of all channels in the module """
681 
682  timeDiffHistogram = getTileModuleHistogram(inputs, 'dspfit_timediff', 'DSP-OFFLINE Time and RMS')
683  fillTileModuleMeanAndRMS(timeDiffHistogram, inputs)
684  setTileModuleHistogramStyle(timeDiffHistogram, markerStyle=21, markerSize=0.75, labelSize=0.08, ymin=-0.5, ymax=0.5)
685 
686  sumTimeDiffHistogram = getTileModuleSumHistogram(inputs, 'dspfit_amphbar', 'DSP-OFFLINE Time for all channels')
687 
688  return [timeDiffHistogram, sumTimeDiffHistogram]
689 
690 

◆ getTileModuleTimeSlopeAndOffset()

def TilePostProcessing.getTileModuleTimeSlopeAndOffset (   inputs)
This function produces 1D summary histogram per Tile module with amplitude over charge ratio of all channels in the module 

Definition at line 886 of file TilePostProcessing.py.

887  """ This function produces 1D summary histogram per Tile module with amplitude over charge ratio of all channels in the module """
888 
889  import ROOT
890  # Force batch mode
891  ROOT.gROOT.SetBatch(True)
892 
893  capactior = str(inputs[0][1][0].GetName()).split('_').pop()
894  timeSlopeHistogram = getTileModuleHistogram(inputs, f'tslope_{capactior}', f'Time slope for {capactior} pF')
895  timeOffsetHistogram = getTileModuleHistogram(inputs, f'toffset_{capactior}', f'Time offset for {capactior} pF')
896 
897  fitFunction = ROOT.TF1("polfun", "pol1", 0., 25.)
898 
899  for input in inputs:
900 
901  inputHistogram = input[1][0]
902 
903  nEntries = inputHistogram.GetEntries()
904  if nEntries > 0:
905  profile = inputHistogram.ProfileX()
906  nBins = profile.GetNbinsX()
907  histogram = ROOT.TH1S("histogram", "TMP Histogram", nBins, profile.GetBinLowEdge(1), profile.GetBinLowEdge(nBins + 1))
908 
909  timeShift = 0
910  lastBin = 0
911  lastBinContent = -99.0
912  for xBin in range(1, nBins + 1):
913  if profile.GetBinError(xBin) > 1e-7:
914  binContent = profile.GetBinContent(xBin)
915  # Allow only 1 shift and only of negative sign
916  if (timeShift < 1) and (binContent - (lastBinContent + (xBin - lastBin))) < -10.0:
917  timeShift = 25.
918  lastBin = xBin
919  lastBinContent = binContent
920  histogram.SetBinContent(xBin, binContent + timeShift)
921  histogram.SetBinError(xBin, profile.GetBinError(xBin))
922 
923  if histogram.GetEntries() > 1:
924  histogram.Fit(fitFunction, "NQ")
925 
926  channel = int(input[0]['channel'])
927  bin = int(channel) + 1
928 
929  # Shift by -25 ns to be consistent with previous definition
930  timeOffset = fitFunction.GetParameter(0) - 25.0
931  timeOffsetError = min(5.0, fitFunction.GetParError(0))
932  timeOffsetHistogram.SetBinContent(bin, timeOffset)
933  timeOffsetHistogram.SetBinError(bin, timeOffsetError)
934 
935  timeSlope = fitFunction.GetParameter(1)
936  timeSlopeError = min(5.0, fitFunction.GetParError(1))
937  timeSlopeHistogram.SetBinContent(bin, timeSlope)
938  timeSlopeHistogram.SetBinError(bin, timeSlopeError)
939 
940  setTileModuleHistogramStyle(timeSlopeHistogram, markerStyle=21, markerSize=0.75, ymin=-0.1, ymax=1.4, labelSize=0.1)
941  setTileModuleHistogramStyle(timeOffsetHistogram, markerStyle=21, markerSize=0.75, ymin=-15, ymax=15, labelSize=0.1)
942 
943  return [timeSlopeHistogram, timeOffsetHistogram]
944 
945 

◆ getTilePartitionRawChannelNoise()

def TilePostProcessing.getTilePartitionRawChannelNoise (   inputs)
This function produces 2D histograms with Tile raw channel noise per partition 

Definition at line 87 of file TilePostProcessing.py.

88  """ This function produces 2D histograms with Tile raw channel noise per partition """
89 
90  import ROOT
91  # Force batch mode
92  ROOT.gROOT.SetBatch(True)
93 
94  from TileMonitoring.TileMonitoringCfgHelper import getLabels
95  from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
96 
97  def _getTilePartitionHistogram2D(name, title, partition, run):
98  fullName = 'TileRawChannelNoise_{}_{}'.format(name, partition)
99  fullTitle = 'Run {} Partition {}: {}'.format(run, partition, title)
100  histogram = ROOT.TH2F(fullName, fullTitle,
101  Tile.MAX_DRAWER, 0.5, Tile.MAX_DRAWER + 0.5,
102  Tile.MAX_CHAN, -0.5, Tile.MAX_CHAN - 0.5)
103  moduleLables = getLabels(('modules'), partition)
104  channelLables = getLabels(('channels'), partition)
105  for axis,labels in ((histogram.GetXaxis(), moduleLables), (histogram.GetYaxis(), channelLables)):
106  for bin in range(0, len(labels)):
107  axis.SetBinLabel(bin + 1, labels[bin])
108  return histogram
109 
110 
111  partition = inputs[0][0]['module'][:3]
112  run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
113 
114  rmsHistogram = _getTilePartitionHistogram2D('RMS', 'RMS of gaussians', partition, run)
115  sigmaHistogram = _getTilePartitionHistogram2D('Sigma', 'Sigma of gaussians', partition, run)
116  chi2Histogram = _getTilePartitionHistogram2D('Chi2', 'Chi2 of gaussians', partition, run)
117  probabilityHistogram = _getTilePartitionHistogram2D('Prob', 'Probability of gaussians', partition, run)
118  rmsOverSigmaHistogram = _getTilePartitionHistogram2D('RmsOverSigma', 'RMS/Sigma of gaussians', partition, run)
119 
120  fitfunction = ROOT.TF1("total", "gaus(0)")
121  fitfunction.SetLineColor(2)
122 
123  for input in inputs:
124 
125  module = int(input[0]['module'][3:])
126  channel = int(input[0]['channel'])
127 
128  plot = input[1][0]
129 
130  nEntries = plot.GetEntries()
131 
132  if nEntries > 100:
133 
134  rms = plot.GetRMS()
135  rmsHistogram.Fill(module, channel, rms)
136 
137  fitfunction.SetParameters(0.1 * nEntries, 0., 0.7 * rms)
138 
139  binWidth = plot.GetBinWidth(0)
140  lowLimit = binWidth * 0.5
141  highLimit = max(rms * 1.05, binWidth * 2.0)
142 
143  fitfunction.SetParLimits(0, 0., nEntries)
144  fitfunction.FixParameter(1, 0.)
145  fitfunction.SetParLimits(2, lowLimit, highLimit)
146 
147  plot.Fit(fitfunction, "BQ")
148 
149  sigma = fitfunction.GetParameter(2)
150  chi2 = fitfunction.GetChisquare()
151  prob = fitfunction.GetProb()
152 
153  sigmaHistogram.Fill(module, channel, sigma)
154  chi2Histogram.Fill(module, channel, chi2)
155  probabilityHistogram.Fill(module, channel, prob)
156  rmsOverSigmaHistogram.Fill(module, channel, rms/sigma)
157 
158  return [rmsHistogram, sigmaHistogram, chi2Histogram, probabilityHistogram, rmsOverSigmaHistogram]
159 
160 

◆ getTileStuckBitsNumber()

def TilePostProcessing.getTileStuckBitsNumber (   inputHistogram)
This function analyzes a histogram with samples from Tile channel and returns number of stuck bits 

Definition at line 365 of file TilePostProcessing.py.

365 def getTileStuckBitsNumber(inputHistogram):
366  """ This function analyzes a histogram with samples from Tile channel and returns number of stuck bits """
367 
368  import math
369  nStuckBits = 0
370 
371  # If all bins at given hypothetical stuck value (0,1) and stuck bit (0,...,9,...)
372  # are empty then this bin is stuck in this value. Do this procedure only for
373  # bins between the first and the last non-zeroth one.
374 
375  # Find first/last non-zero bin in the histogram
376  firstBin = inputHistogram.FindFirstBinAbove(0)
377  if firstBin < 0: # empty histogram, nothing to do
378  return 0
379 
380  lastBin = inputHistogram.FindLastBinAbove(0)
381 
382  # bins in histogram are counted from 1 to max(ADC) + 1, but actual X value for those bins are 0 ... max(ADC)
383 
384  # if there is nothing in first half of histogram
385  # or there is nothing in second half and there is a sharp edge at mid
386  # it can be that upper most bit is stuck in 0 or 1
387 
388  nBins = inputHistogram.GetNbinsX() # max(ADC) + 1
389 
390  if (firstBin == nBins / 2 + 1) or (lastBin == nBins / 2 and inputHistogram.GetBinContent(lastBin) > 3):
391  nStuckBits += 1 # "The last Bit is stuck"
392 
393  firstBin -= 1 # shift to zero bin
394  lastBin += 1 # shift to zero bin
395 
396  nBits = round(math.log2(nBins))
397  for stuckValue in (0, 1): # bit stuck at value 0 or 1
398  for stuckBit in range(0, nBits): # which bit is stuck
399  sumInBinsChecked = 0
400  nBinsChecked = 0
401 
402  windowLength = (1 << stuckBit) # length of one interval with all zeros if bit is stuck
403  beginBin = (1 - stuckValue) * windowLength # beginning of first interval to check
404 
405  while beginBin + 1 < lastBin:
406  endBin = beginBin + windowLength # end of interval to check
407 
408  if endBin > firstBin:
409  for bin in range(beginBin, endBin):
410  # bin is from 0 to max(ADC) here - must be changed in GetBinConent to (bin+1)
411  if (firstBin < bin + 1) and (bin + 1 < lastBin):
412  sumInBinsChecked += inputHistogram.GetBinContent(bin + 1)
413  nBinsChecked += 1
414 
415  beginBin = endBin + windowLength # beginning of next interval
416 
417  if sumInBinsChecked == 0 and nBinsChecked > 0:
418  nStuckBits += 1
419 
420  if (nStuckBits == 0):
421  nStuckBits = getTileStuckBitsNumber2(inputHistogram)
422 
423  return nStuckBits
424 
425 

◆ getTileStuckBitsNumber2()

def TilePostProcessing.getTileStuckBitsNumber2 (   inputHistogram)
This function analyzes a histogram with samples from Tile channel and returns number of stuck bits

New function implemented by Tibor Zenis, which checks how many bit flips happen compared to the expected ones
It works for CIS and Laser because the adc range is not sufficiently excersized in the other run types.

Definition at line 300 of file TilePostProcessing.py.

300 def getTileStuckBitsNumber2(inputHistogram):
301  """
302  This function analyzes a histogram with samples from Tile channel and returns number of stuck bits
303 
304  New function implemented by Tibor Zenis, which checks how many bit flips happen compared to the expected ones
305  It works for CIS and Laser because the adc range is not sufficiently excersized in the other run types.
306  """
307 
308  import math
309  nBins = inputHistogram.GetNbinsX()
310  nBits = round(math.log2(nBins))
311 
312  bitValue = [1 << bit for bit in range(0, nBits)]
313  nBitFlipsAtSignalRegion = [0 for bit in range(0, nBits)]
314  nBitFlipsAtSignalEdges = [0 for bit in range(0, nBits)]
315 
316  nextBinContent = inputHistogram.GetBinContent(1)
317  previousBinIsNotEmpty = nextBinContent > 0 # flip-flop of non-zero contents of previous bin
318 
319  currentBinContent = 2
320  for currentBin in range(1, nBins):
321 
322  previousBinContent = currentBinContent
323  currentBinContent = nextBinContent
324  binIsNotEmpty = currentBinContent > 0
325  nextBinContent = inputHistogram.GetBinContent(currentBin + 2) if currentBin < nBins - 1 else 0
326 
327  probability = 1.
328  expectedContent = 0.125 * (nextBinContent + previousBinContent - math.sqrt(nextBinContent) - math.sqrt(previousBinContent))
329  if binIsNotEmpty and currentBinContent < expectedContent:
330  probability = 1. - currentBinContent / expectedContent
331  binIsNotEmpty = False
332 
333  if binIsNotEmpty or previousBinIsNotEmpty: # count bit flips in bins with non-zero contents and adjacent bins
334  for bit in range(0, nBits):
335  if ((currentBin & bitValue[bit]) != ((currentBin - 1) & bitValue[bit])):
336  nBitFlipsAtSignalRegion[bit] += 1
337  else:
338  break # higher bit can flip only if the previous one does
339 
340  if (binIsNotEmpty and previousBinIsNotEmpty) or not (binIsNotEmpty or previousBinIsNotEmpty):
341  continue
342 
343  # bin content flips (zero - non-zero)
344  for bit in range(0, nBits): # count bits flipped at this position
345  if ((currentBin & bitValue[bit]) != ((currentBin - 1) & bitValue[bit])):
346  if (currentBin & bitValue[bit]):
347  nBitFlipsAtSignalEdges[bit] += probability if binIsNotEmpty else -probability
348  else:
349  nBitFlipsAtSignalEdges[bit] += -probability if binIsNotEmpty else probability
350  else:
351  break
352 
353  previousBinIsNotEmpty = not previousBinIsNotEmpty
354 
355  nStuckBits = 0
356  for bit in range(0, nBits):
357  if (((nBitFlipsAtSignalRegion[bit] > 2) and abs(nBitFlipsAtSignalEdges[bit]) == nBitFlipsAtSignalRegion[bit])
358  or (abs(nBitFlipsAtSignalEdges[bit]) > 7 and abs(nBitFlipsAtSignalEdges[bit]) * 3 > nBitFlipsAtSignalRegion[bit])):
359  nStuckBits += 1
360 
361  return nStuckBits
362 
363 
364 

◆ setTileModuleHistogramStyle()

def TilePostProcessing.setTileModuleHistogramStyle (   histogram,
  markerStyle = None,
  markerSize = None,
  markerColor = None,
  labelSize = None,
  ymin = None,
  ymax = None,
  delta = 0.1 
)
This function set up stype of Tile module monitoring histogram 

Definition at line 36 of file TilePostProcessing.py.

36 def setTileModuleHistogramStyle(histogram, markerStyle=None, markerSize=None, markerColor=None,
37  labelSize=None, ymin=None, ymax=None, delta=0.1):
38  """ This function set up stype of Tile module monitoring histogram """
39 
40  if ymin and (histogram.GetMinimum() > ymin + delta * abs(ymin)):
41  histogram.SetMinimum(ymin)
42  if ymax and (histogram.GetMaximum() < (1.0 - delta) * ymax):
43  histogram.SetMaximum(ymax)
44  if markerStyle:
45  histogram.SetMarkerStyle(markerStyle)
46  if markerColor:
47  histogram.SetMarkerColor(markerColor)
48  if markerSize:
49  histogram.SetMarkerSize(markerSize)
50  if labelSize:
51  histogram.SetLabelSize(labelSize, "X")
52  histogram.SetLabelSize(labelSize, "Y")
53 
54 

◆ sigtermHandler()

def TilePostProcessing.sigtermHandler (   signal,
  frame 
)

Definition at line 968 of file TilePostProcessing.py.

968  def sigtermHandler(signal, frame):
969  print('Terminating postporcessing ...')
970  sys.exit(0)
971 

Variable Documentation

◆ action

TilePostProcessing.action

Definition at line 951 of file TilePostProcessing.py.

◆ args

TilePostProcessing.args

Definition at line 959 of file TilePostProcessing.py.

◆ dataPath

TilePostProcessing.dataPath

Definition at line 966 of file TilePostProcessing.py.

◆ default

TilePostProcessing.default

Definition at line 955 of file TilePostProcessing.py.

◆ dest

TilePostProcessing.dest

Definition at line 953 of file TilePostProcessing.py.

◆ help

TilePostProcessing.help

Definition at line 951 of file TilePostProcessing.py.

◆ inputPath

TilePostProcessing.inputPath

Definition at line 976 of file TilePostProcessing.py.

◆ int

TilePostProcessing.int

Definition at line 955 of file TilePostProcessing.py.

◆ noiseConfigurations

TilePostProcessing.noiseConfigurations

Definition at line 995 of file TilePostProcessing.py.

◆ noisePostProcess

TilePostProcessing.noisePostProcess

Definition at line 1001 of file TilePostProcessing.py.

◆ outputPath

TilePostProcessing.outputPath

Definition at line 977 of file TilePostProcessing.py.

◆ parser

TilePostProcessing.parser

Definition at line 949 of file TilePostProcessing.py.

◆ partition

TilePostProcessing.partition

Definition at line 964 of file TilePostProcessing.py.

◆ physConfigurations

TilePostProcessing.physConfigurations

Definition at line 979 of file TilePostProcessing.py.

◆ physPostProcess

TilePostProcessing.physPostProcess

Definition at line 983 of file TilePostProcessing.py.

◆ server

TilePostProcessing.server

Definition at line 963 of file TilePostProcessing.py.

◆ type

TilePostProcessing.type

Definition at line 955 of file TilePostProcessing.py.

TilePostProcessing.getTileModuleAmplitudeOverChargeRatio
def getTileModuleAmplitudeOverChargeRatio(inputs)
Definition: TilePostProcessing.py:780
TilePostProcessing.getTileModuleAmplitudeDSP
def getTileModuleAmplitudeDSP(inputs)
Definition: TilePostProcessing.py:670
TilePostProcessing.getTileModuleAmplitudeDiffBetweenOfflineAndDSP
def getTileModuleAmplitudeDiffBetweenOfflineAndDSP(inputs)
Definition: TilePostProcessing.py:658
TilePostProcessing.getTilePartitionRawChannelNoise
def getTilePartitionRawChannelNoise(inputs)
Definition: TilePostProcessing.py:87
vtune_athena.format
format
Definition: vtune_athena.py:14
TilePostProcessing.getTileModuleSumHistogram
def getTileModuleSumHistogram(inputs, name, title)
Definition: TilePostProcessing.py:613
TilePostProcessing.getTileModuleCovariance
def getTileModuleCovariance(inputs)
Definition: TilePostProcessing.py:456
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
TilePostProcessing.getTileModuleCRC
def getTileModuleCRC(inputs)
Definition: TilePostProcessing.py:200
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
TilePostProcessing.getTileModuleTimeDiffBetweenOfflineAndDSP
def getTileModuleTimeDiffBetweenOfflineAndDSP(inputs)
Definition: TilePostProcessing.py:679
TilePostProcessing.int
int
Definition: TilePostProcessing.py:955
TilePostProcessing.getTileModuleTimeCorrected
def getTileModuleTimeCorrected(inputs)
Definition: TilePostProcessing.py:648
TilePostProcessing.getTileModuleTime
def getTileModuleTime(inputs)
Definition: TilePostProcessing.py:638
TilePostProcessing.getProfile2D_RMS
def getProfile2D_RMS(inputs, title, name)
Definition: TilePostProcessing.py:55
TilePostProcessing.getTileStuckBitsNumber2
def getTileStuckBitsNumber2(inputHistogram)
Definition: TilePostProcessing.py:300
TilePostProcessing.getTileModuleHistogram
def getTileModuleHistogram(inputs, name, title)
Definition: TilePostProcessing.py:15
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
TilePostProcessing.getTileModuleHFN
def getTileModuleHFN(inputs)
Definition: TilePostProcessing.py:183
TilePostProcessing.getTileModuleStuckBits
def getTileModuleStuckBits(inputs)
Definition: TilePostProcessing.py:426
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
TilePostProcessing.channelToPMT
def channelToPMT(module, channel)
Definition: TilePostProcessing.py:691
TilePostProcessing.getTileStuckBitsNumber
def getTileStuckBitsNumber(inputHistogram)
Definition: TilePostProcessing.py:365
TilePostProcessing.sigtermHandler
def sigtermHandler(signal, frame)
Definition: TilePostProcessing.py:968
TilePostProcessing.getTileModuleAmplitudeVarianceOverMean
def getTileModuleAmplitudeVarianceOverMean(inputs)
Definition: TilePostProcessing.py:720
TilePostProcessing.setTileModuleHistogramStyle
def setTileModuleHistogramStyle(histogram, markerStyle=None, markerSize=None, markerColor=None, labelSize=None, ymin=None, ymax=None, delta=0.1)
Definition: TilePostProcessing.py:36
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
TilePostProcessing.getTileModulePedestalsAndLFN
def getTileModulePedestalsAndLFN(inputs)
Definition: TilePostProcessing.py:161
str
Definition: BTagTrackIpAccessor.cxx:11
TilePostProcessing.getTileModuleAmplitudeAndSigmaWithRMS
def getTileModuleAmplitudeAndSigmaWithRMS(inputs)
Definition: TilePostProcessing.py:540
TilePostProcessing.getTileModuleBCID
def getTileModuleBCID(inputs)
Definition: TilePostProcessing.py:253
TilePostProcessing.getTileModuleChi2VsAmplitude
def getTileModuleChi2VsAmplitude(inputs)
Definition: TilePostProcessing.py:515
TileMonitoringCfgHelper.getLabels
def getLabels(labels, partition='')
Definition: TileMonitoringCfgHelper.py:173
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
TilePostProcessing.getTileModuleTimeSlopeAndOffset
def getTileModuleTimeSlopeAndOffset(inputs)
Definition: TilePostProcessing.py:886
TilePostProcessing.fillTileModuleMeanAndRMS
def fillTileModuleMeanAndRMS(histogram, inputs)
Definition: TilePostProcessing.py:596