Belle II Software  release-05-02-19
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, l=0, w=0)
 
def drawTDC (self, l=0, w=0)
 
def drawHit (self, l=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, l)
 
def da (self, l, w)
 
def dt (self, l, 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 layer
 
 graph
 TGraph.
 
 graph2
 Marker style. More...
 
 line
 Marker style. More...
 

Detailed Description

DQM class.

Definition at line 37 of file dqm.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 43 of file dqm.py.

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

Member Function Documentation

◆ da()

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

Definition at line 343 of file dqm.py.

◆ dh()

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

Definition at line 337 of file dqm.py.

◆ div()

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

Definition at line 274 of file dqm.py.

◆ drawADC()

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

Definition at line 190 of file dqm.py.

◆ drawADCByCell()

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

Definition at line 244 of file dqm.py.

◆ drawHit()

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

Definition at line 218 of file dqm.py.

◆ drawTDC()

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

Definition at line 204 of file dqm.py.

◆ drawTDCByCell()

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

Definition at line 231 of file dqm.py.

◆ dt()

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

Definition at line 349 of file dqm.py.

◆ fitADC()

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

Definition at line 150 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 164 of file dqm.py.

◆ getLayerWireID()

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

Definition at line 172 of file dqm.py.

◆ mpv()

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

Definition at line 282 of file dqm.py.

◆ ne()

def ne (   self)
Alias to next()

Definition at line 331 of file dqm.py.

◆ next()

def next (   self)
Show next plots.

Definition at line 257 of file dqm.py.

◆ print()

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

Definition at line 325 of file dqm.py.

◆ xrange()

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

Definition at line 298 of file dqm.py.

◆ xrangeADC()

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

Definition at line 318 of file dqm.py.

◆ xrangeHit()

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

Definition at line 304 of file dqm.py.

◆ xrangeTDC()

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

Definition at line 311 of file dqm.py.

Member Data Documentation

◆ graph2

graph2

Marker style.

Marker size TGraph

Definition at line 133 of file dqm.py.

◆ h2ADCvsLayer

h2ADCvsLayer

Set stats.

Set title of X axis Set title of Y axis histogram

Definition at line 113 of file dqm.py.

◆ line

line

Marker style.

Marker size Reference line

Definition at line 139 of file dqm.py.

◆ parADCinLayer

parADCinLayer

MPV values w.r.t.

layer

Definition at line 100 of file dqm.py.

◆ x

x

Set stats.

Set title of X axis Set title of Y axis array cell

Definition at line 122 of file dqm.py.


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