4 from libCatKernel
import *
5 from matplotlib.path
import Path
6 import matplotlib.patches
as patches
10 proc.__init__(self,cat,obj,panel,path)
12 self.panel.Bind(wx.EVT_TOGGLEBUTTON,self.
onSoftTrig,id=xrc.XRCID(
"softtrigger"))
13 self.panel.Bind(wx.EVT_TOGGLEBUTTON,self.
onTree,id=xrc.XRCID(
"tree"))
14 self.panel.Bind(wx.EVT_TOGGLEBUTTON,self.
onTrend,id=xrc.XRCID(
"trend"))
15 self.panel.Bind(wx.EVT_TOGGLEBUTTON,self.
onSample,id=xrc.XRCID(
"sample"))
16 self.panel.Bind(wx.EVT_SPINCTRL,self.
onDeadtime,id=xrc.XRCID(
"acquisition_deadtime"))
17 self.panel.Bind(wx.EVT_BUTTON,self.
onApply,id=xrc.XRCID(
"apply"))
18 self.panel.Bind(wx.EVT_SPINCTRL, self.
onDepth, id=xrc.XRCID(
"depth"))
19 self.panel.Bind(wx.EVT_SPINCTRL, self.
onNSample, id=xrc.XRCID(
"nsample"))
20 self.panel.Bind(wx.EVT_SPINCTRL, self.
onNBins, id=xrc.XRCID(
"nbins"))
21 self.panel.Bind(wx.EVT_TEXT, self.
onMin, id=xrc.XRCID(
"min"))
22 self.panel.Bind(wx.EVT_TEXT, self.
onMax, id=xrc.XRCID(
"max"))
28 if (self.getControl(
"chl0").GetValue()) : channels=channels|0b1
29 else : channels=channels&0b11111110
30 if (self.getControl(
"chl1").GetValue()) : channels=channels|0b10
31 else : channels=channels&0b11111101
32 if (self.getControl(
"chl2").GetValue()) : channels=channels|0b100
33 else : channels=channels&0b11111011
34 if (self.getControl(
"chl3").GetValue()) : channels=channels|0b1000
35 else : channels=channels&0b11110111
36 if (self.getControl(
"chl4").GetValue()) : channels=channels|0b10000
37 else : channels=channels&0b11101111
38 if (self.getControl(
"chl5").GetValue()) : channels=channels|0b100000
39 else : channels=channels&0b11011111
40 if (self.getControl(
"chl6").GetValue()) : channels=channels|0b1000000
41 else : channels=channels&0b10111111
42 if (self.getControl(
"chl7").GetValue()) : channels=channels|0b10000000
43 else : channels=channels&0b1111111
47 self.obj.
setTrigger(self.getControl(
"softtrigger").GetValue())
48 if self.getControl(
"softtrigger").GetValue():
49 self.getControl(
"softtrigger").SetValue(1)
50 self.getControl(
"softtrigger").SetLabel(
"Soft. Trig.")
52 self.getControl(
"softtrigger").SetValue(0)
53 self.getControl(
"softtrigger").SetLabel(
"Ext. Trig.")
56 self.obj.
setStoreTree(self.getControl(
"tree").GetValue())
65 self.obj.
setDeadTime(self.getControl(
"acquisition_deadtime").GetValue())
67 self.obj.
setDepth(self.getControl(
"depth").GetValue())
70 self.obj.
setSample(self.getControl(
"nsample").GetValue())
73 self.obj.
setNBins(self.getControl(
"nbins").GetValue())
76 self.obj.
setMinRange(float(self.getControl(
"min").GetValue()))
79 self.obj.
setMaxRange(float(self.getControl(
"max").GetValue()))
83 self.getControl(
"softtrigger").SetValue(1)
84 self.getControl(
"softtrigger").SetLabel(
"Soft. Trig.")
86 self.getControl(
"softtrigger").SetValue(0)
87 self.getControl(
"softtrigger").SetLabel(
"Ext. Trig.")
90 if (channels&1) : self.getControl(
"chl0").SetValue(
True)
91 else : self.getControl(
"chl0").SetValue(
False)
92 if (channels&0b10) : self.getControl(
"chl1").SetValue(
True)
93 else : self.getControl(
"chl1").SetValue(
False)
94 if (channels&0b100) : self.getControl(
"chl2").SetValue(
True)
95 else : self.getControl(
"chl2").SetValue(
False)
96 if (channels&0b1000) : self.getControl(
"chl3").SetValue(
True)
97 else : self.getControl(
"chl3").SetValue(
False)
98 if (channels&0b10000) : self.getControl(
"chl4").SetValue(
True)
99 else : self.getControl(
"chl4").SetValue(
False)
100 if (channels&0b100000) : self.getControl(
"chl5").SetValue(
True)
101 else : self.getControl(
"chl5").SetValue(
False)
102 if (channels&0b1000000) : self.getControl(
"chl6").SetValue(
True)
103 else : self.getControl(
"chl6").SetValue(
False)
104 if (channels&0b10000000) : self.getControl(
"chl7").SetValue(
True)
105 else : self.getControl(
"chl7").SetValue(
False)
106 self.getControl(
"depth").SetValue(self.obj.
depth())
107 self.getControl(
"tree").SetValue(self.obj.
storeTree())
108 self.getControl(
"trend").SetValue(self.obj.
storeTrend())
109 self.getControl(
"sample").SetValue(self.obj.
storeSample())
110 self.getControl(
"acquisition_deadtime").SetValue(self.obj.
deadTime())
111 self.getControl(
"depth").SetValue(self.obj.
depth())
112 self.getControl(
"nsample").SetValue(self.obj.
sample())
113 self.getControl(
"nbins").SetValue(self.obj.
nBins())
114 self.getControl(
"min").SetValue(str(self.obj.
minRange()))
115 self.getControl(
"max").SetValue(str(self.obj.
maxRange()))
119 def Edit (cat, obj, panel, path):
124 def Plot(cat, obj, parent, id):
126 if (
not obj.storeTrend()
and not obj.storeSample):
129 from mpl_toolkits.mplot3d
import Axes3D
130 import matplotlib.ticker
as ticker
131 from matplotlib
import cm
132 import matplotlib
as mpl
133 import matplotlib.pyplot
as plt
139 title =
'Acquisition - Channel(s) ' 141 channels=obj.channels()
148 fig.suptitle(title, fontsize=14, fontweight=
'bold')
152 if obj.storeSample() : row+=1
153 if obj.storeTrend() : row+=2
157 if obj.storeTrend() :
158 for c
in range(0,col):
159 pl=fig.add_subplot(row,col,c+1)
161 pl.plot(obj.hist1d(index).xbins(),obj.hist1d(index).bins(),
'ro',color=
'blue')
162 pl.xaxis.set_ticks([0,obj.depth()/2,obj.depth()-1])
165 pl=fig.add_subplot(row,col,c+col+1)
167 pl.plot(obj.hist1d(index).xbins(),obj.hist1d(index).bins(),
'ro',color=
'green')
168 pl.xaxis.set_ticks([0,obj.depth()/2,obj.depth()-1])
171 if (row==3): index+=1
173 if obj.storeSample() :
175 for c
in range(0,col):
176 pl=fig.add_subplot(row,col,c+(row-1)*col+1)
177 h=
h1d(pl,obj.hist1d(index), facecolor=
'red',linestyle=
'dashed')
178 pl.xaxis.set_ticks([obj.hist1d(index).minX(),(obj.hist1d(index).maxX()+obj.hist1d(index).minX())/2.,obj.hist1d(index).maxX()])
181 if (row==3): index+=2
StatusCode setChannels(unsigned int)
def onSoftTrig(self, event)
void setMaxRange(float maxrange)
StatusCode setTrigger(bool trig)
void setMinRange(float minrange)
def Plot(cat, obj, parent, id)
def h1d(fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')
void setSample(int nsample)
def onDeadtime(self, event)
def onSample(self, event)
def Edit(cat, obj, panel, path)
void setStoreTree(bool store_tree)
def onNSample(self, event)
StatusCode setDepth(unsigned int)
void setStoreSample(bool store_sample)
void setDeadTime(int deadtime)
def __init__(self, cat, obj, panel, path)
void setStoreTrend(bool store_hist)