Belle II Software development
CDCHistMakerModule Class Reference
Inheritance diagram for CDCHistMakerModule:

Public Member Functions

def __init__ (self, exp=0, run=0, dest='.')
 
def event (self)
 
def terminate (self)
 

Public Attributes

 m_exp
 Experimental number.
 
 m_run
 Run number.
 
 m_dest
 Output directory.
 
 m_outputFile
 Output file name.
 

Detailed Description

Class description.

Definition at line 83 of file CDCHistMaker.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  exp = 0,
  run = 0,
  dest = '.' 
)
call constructor of base class, required.

Definition at line 89 of file CDCHistMaker.py.

89 def __init__(self, exp=0, run=0, dest='.'):
90 """
91 call constructor of base class, required.
92 """
93
94 super().__init__()
95
96 self.m_exp = exp
97
98 self.m_run = run
99
100 self.m_dest = dest
101 if os.path.exists(self.m_dest) is False:
102 os.mkdir(self.m_dest)
103
104 self.m_outputFile = self.m_dest + f'/dqm.{self.m_exp:0>4}.{self.m_run:0>5}.root'
105

Member Function Documentation

◆ event()

def event (   self)
reimplement b2.Module::event()

Definition at line 106 of file CDCHistMaker.py.

106 def event(self):
107 """
108 reimplement b2.Module::event()
109 """
110
111 hits = Belle2.PyStoreArray('CDCHits')
112
113 for hit in hits:
114 # rawhit = hit.getRelatedTo('CDCRawHits')
115 sl = hit.getISuperLayer()
116 l_hit = hit.getILayer()
117 cl = l_hit if sl == 0 else 8 + (sl - 1) * 6 + l_hit
118 w = hit.getIWire()
119 adc = hit.getADCCount()
120 tdc = hit.getTDCCount()
121
122 # b = rawhit.getBoardId()
123 # c = rawhit.getFEChannel()
124 # B2DEBUG(99, 'sl ' + str(sl) + ' l_hit ' + str(l_hit) +
125 # ' cl ' + str(cl) + ' w ' + str(w) +
126 # ' b ' + str(b) + ' c ' + str(c))
127 hid = getHistID(cl, w)
128 histADCinLayer[cl].Fill(adc)
129 histADC[hid].Fill(adc)
130 histTDC[hid].Fill(tdc)
131 histADCTDC[cl].Fill(adc, tdc)
132 histHit[cl].Fill(w)
133
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ terminate()

def terminate (   self)
Draw histograms on canvas and save image.

Definition at line 134 of file CDCHistMaker.py.

134 def terminate(self):
135 """
136 Draw histograms on canvas and save image.
137 """
138
139 TFile(self.m_outputFile, "RECREATE")
140 for h in histADC:
141 h.Write()
142 for h in histTDC:
143 h.Write()
144 for h in histADCinLayer:
145 h.Write()
146 for h in histADCTDC:
147 h.Write()
148 for h in histHit:
149 h.Write()
150
151

Member Data Documentation

◆ m_dest

m_dest

Output directory.

Definition at line 100 of file CDCHistMaker.py.

◆ m_exp

m_exp

Experimental number.

Definition at line 96 of file CDCHistMaker.py.

◆ m_outputFile

m_outputFile

Output file name.

Definition at line 104 of file CDCHistMaker.py.

◆ m_run

m_run

Run number.

Definition at line 98 of file CDCHistMaker.py.


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