Belle II Software  release-08-01-10
DQM Class Reference

Public Member Functions

def __init__ (self, fname='output.root')
 
def fitADC (self, xmin=8, xmax=200)
 
def getHistID (self, lay=0, wire=0)
 
def getLayerWireID (self, hid=0)
 
def drawADC (self, lay=0, w=0)
 
def drawTDC (self, lay=0, w=0)
 
def drawHit (self, lay=0)
 
def drawTDCByCell (self, i)
 
def drawADCByCell (self, i)
 
def next (self)
 
def div (self, i=1, j=1)
 
def mpv (self)
 
def xrange (self, xmin=-500, xmax=14500)
 
def xrangeHit (self, xmin=0, xmax=350)
 
def xrangeTDC (self, xmin=0, xmax=4000)
 
def xrangeADC (self, xmin=0, xmax=200)
 
def print (self, fname='test.png')
 
def ne (self)
 
def dh (self, lay)
 
def da (self, lay, w)
 
def dt (self, lay, w)
 

Public Attributes

 f
 input file name
 
 type
 plot type (adc/tdc/hit)
 
 histADC
 ADC histograms.
 
 histTDC
 TDC histograms.
 
 histHit
 Hit distribution histograms.
 
 lines
 Line for guide of TDC T0.
 
 lineMPVs
 Line for guide of ADC MPV.
 
 sig
 Fitting function for ADC histogram.
 
 ft0
 Fitting function for TDC histogram.
 
 m_fitStatus
 Fit status True if fitting has been finished.
 
 canvas
 canvas
 
 hid
 histogram ID
 
 ndiv
 Number of division for canvas.
 
 par
 MPV values.
 
 parADCinLayer
 MPV values w.r.t. More...
 
 parT0
 T0 values.
 
 h2
 histogram
 
 h2ADCvsLayer
 Set stats. More...
 
 x
 Set stats. More...
 
 l_array
 array layer
 
 graph
 TGraph.
 
 graph2
 Marker style. More...
 
 line
 Marker style. More...
 

Detailed Description

DQM class.

Definition at line 41 of file dqm.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  fname = 'output.root' 
)
call constructor of base class, required.

Definition at line 47 of file dqm.py.

47  def __init__(self, fname='output.root'):
48  """
49  call constructor of base class, required.
50  """
51 
52  super(DQM, self).__init__()
53 
54 
55  self.f = TFile(fname)
56 
57  self.type = 'adc'
58 
59  self.histADC = [self.f.Get('h' + str(100000 + i))
60  for i in range(14336)]
61 
62  self.histTDC = [self.f.Get('h' + str(200000 + i))
63  for i in range(14336)]
64 
65  self.histHit = [self.f.Get('h' + str(400000 + i))
66  for i in range(56)]
67 
68  self.lines = []
69  for h in self.histTDC:
70  y = h.GetMaximum()
71  line = TLine(refT0, 0, refT0, y)
72  line.SetLineColor(2)
73  self.lines.append(line)
74 
75 
76  self.lineMPVs = []
77  for h in self.histADC:
78  y = h.GetMaximum()
79  line = TLine(refMPV, 0, refMPV, y)
80  line.SetLineColor(2)
81  self.lineMPVs.append(line)
82  # self.histADCinLayer = [self.f.Get('h' + str(500000 + i))
83  # for i in range(56)]
84 
85 
86  self.sig = TF1("sig", "landau", 0, 200)
87  # self.sig = TF1("sig", "landau+expo(3)", 0, 200)
88  # self.sig.SetParameters(300.0,60.0,20.0,1000,-1.0)
89 
90  self.ft0 = TF1("ft0", "[0]+[1]*(exp([2]*([3]-x))/(1+exp(-([4]-x)/[5])))", 2000, 4000)
91  self.ft0.SetParameters(0, 10, 0, 0, 3800, 3.)
92  self.ft0.FixParameter(0, 0.)
93 
94  self.m_fitStatus = False
95 
96  self.canvas = TCanvas("canvas", "canvas", 800, 800)
97 
98  self.hid = 0
99 
100  self.ndiv = 1
101 
102  self.par = [-1.0 for i in range(14336)]
103 
104  self.parADCinLayer = [-1.0 for i in range(56)]
105 
106  self.parT0 = [0.0 for i in range(14336)]
107 
108  self.h2 = TH2D("h2d", "MPV of all ADCs", 15000,
109  -500, 14500, 100, 0, 200)
110 
111  self.h2.SetStats(0)
112 
113  self.h2.GetXaxis().SetTitle('Cell ID')
114 
115  self.h2.GetYaxis().SetTitle('MPV')
116 
117  self.h2ADCvsLayer = TH2D("h2dl", "MPV for every Layer", 56,
118  0, 56, 100, 0, 200)
119 
120  self.h2ADCvsLayer.SetStats(0)
121 
122  self.h2ADCvsLayer.GetXaxis().SetTitle('Layer')
123 
124  self.h2ADCvsLayer.GetYaxis().SetTitle('MPV (adc count)')
125 
126  self.x = array("d", [i for i in range(14336)])
127 
128  self.l_array = array("d", [i for i in range(56)])
129 
130  self.graph = TGraph(len(self.x))
131 
132  self.graph.SetMarkerStyle(kFullCircle)
133 
134  self.graph.SetMarkerSize(0.3)
135 
136 
137  self.graph2 = TGraph(len(self.l_array))
138 
139  self.graph2.SetMarkerStyle(kFullCircle)
140 
141  self.graph2.SetMarkerSize(1.0)
142 
143  self.line = [TLine(0, 0, 0, 200)]
144 
145  x0 = 0
146  for i in range(9):
147  x0 = x0 + nWiresSL[i]
148  line = TLine(x0, 0, x0, 200)
149  self.line.append(line)
150  for l_i in self.line:
151  l_i.SetLineColorAlpha(8, 0.5)
152  l_i.SetLineStyle(2)
153 

Member Function Documentation

◆ da()

def da (   self,
  lay,
  w 
)
Alias to drawADC()

Definition at line 347 of file dqm.py.

◆ dh()

def dh (   self,
  lay 
)
Alias to drawHit()

Definition at line 341 of file dqm.py.

◆ div()

def div (   self,
  i = 1,
  j = 1 
)
Divide Tcanvas by (i,j).

Definition at line 278 of file dqm.py.

◆ drawADC()

def drawADC (   self,
  lay = 0,
  w = 0 
)
Draw ADC histgrams w.r.t (lay,wire).

Definition at line 194 of file dqm.py.

◆ drawADCByCell()

def drawADCByCell (   self,
  i 
)
Draw ADC histgrams w.r.t cell ID (0-14336).

Definition at line 248 of file dqm.py.

◆ drawHit()

def drawHit (   self,
  lay = 0 
)
Draw Hit histgrams w.r.t layer ID.

Definition at line 222 of file dqm.py.

◆ drawTDC()

def drawTDC (   self,
  lay = 0,
  w = 0 
)
Draw TDC histgrams w.r.t (lay,wire).

Definition at line 208 of file dqm.py.

◆ drawTDCByCell()

def drawTDCByCell (   self,
  i 
)
Draw TDC histgrams w.r.t cell ID (0-14336).

Definition at line 235 of file dqm.py.

◆ dt()

def dt (   self,
  lay,
  w 
)
Alias to drawTDC()

Definition at line 353 of file dqm.py.

◆ fitADC()

def fitADC (   self,
  xmin = 8,
  xmax = 200 
)
Fit all ADC histgrams.

Definition at line 154 of file dqm.py.

◆ getHistID()

def getHistID (   self,
  lay = 0,
  wire = 0 
)
Get Hist ID from (layer, wire) ID.
Return values : hist ID (cell ID)

Definition at line 168 of file dqm.py.

◆ getLayerWireID()

def getLayerWireID (   self,
  hid = 0 
)
Get (layer, wire) ID from cell ID.
Return values : [layer, wire]

Definition at line 176 of file dqm.py.

◆ mpv()

def mpv (   self)
Show the MPV of ADC distribution
for all wires.

Definition at line 286 of file dqm.py.

◆ ne()

def ne (   self)
Alias to next()

Definition at line 335 of file dqm.py.

◆ next()

def next (   self)
Show next plots.

Definition at line 261 of file dqm.py.

◆ print()

def print (   self,
  fname = 'test.png' 
)
Print the current plot.

Definition at line 329 of file dqm.py.

◆ xrange()

def xrange (   self,
  xmin = -500,
  xmax = 14500 
)
Set x range of MPV plot.

Definition at line 302 of file dqm.py.

◆ xrangeADC()

def xrangeADC (   self,
  xmin = 0,
  xmax = 200 
)
Set x range of ADC distributions.

Definition at line 322 of file dqm.py.

◆ xrangeHit()

def xrangeHit (   self,
  xmin = 0,
  xmax = 350 
)
Set x range of Hit distributions.

Definition at line 308 of file dqm.py.

◆ xrangeTDC()

def xrangeTDC (   self,
  xmin = 0,
  xmax = 4000 
)
Set x range of TDC distributions.

Definition at line 315 of file dqm.py.

Member Data Documentation

◆ graph2

graph2

Marker style.

Marker size

TGraph

Definition at line 137 of file dqm.py.

◆ h2ADCvsLayer

h2ADCvsLayer

Set stats.

Set title of X axis

Set title of Y axis

histogram

Definition at line 117 of file dqm.py.

◆ line

line

Marker style.

Marker size

Reference line

Definition at line 143 of file dqm.py.

◆ parADCinLayer

parADCinLayer

MPV values w.r.t.

layer

Definition at line 104 of file dqm.py.

◆ x

x

Set stats.

Set title of X axis

Set title of Y axis

array cell

Definition at line 126 of file dqm.py.


The documentation for this class was generated from the following file: