Public Member Functions | |
def | __init__ |
def | initialize |
def | execute |
def | finalize |
Public Attributes | |
plot | |
eventNumber | |
cableSvc |
Definition at line 20 of file WaveDumper.py.
def WaveDumper::WaveDumperAlg::__init__ | ( | self, | ||
name | ||||
) |
Definition at line 22 of file WaveDumper.py.
00022 : 00023 DybPythonAlg.__init__(self,name) 00024 self.plot={} 00025 return 00026 def initialize(self):
def WaveDumper::WaveDumperAlg::initialize | ( | self | ) |
Definition at line 27 of file WaveDumper.py.
00027 : 00028 status = DybPythonAlg.initialize(self) 00029 if status.isFailure(): return status 00030 self.info("initializing") 00031 00032 self.eventNumber = 0 00033 00034 # Initialize services 00035 #self.cableSvc = self.svc('ICableSvc','StaticCableSvc') 00036 00037 #self.stats.defaultPath = "/file1/waves/" 00038 # Make the trigger time histogram 00039 #self.stats["waveform"] = TGraph 00040 00041 return SUCCESS 00042 def execute(self):
def WaveDumper::WaveDumperAlg::execute | ( | self | ) |
Definition at line 43 of file WaveDumper.py.
00043 : 00044 self.info("executing") 00045 00046 self.eventNumber+=1 00047 00048 evt = self.evtSvc() 00049 hdr = evt["/Event/Elec/ElecHeader"] 00050 00051 if (hdr.__class__ != gbl.DayaBay.ElecHeader ): 00052 self.warning("ElecHeader not found for this event") 00053 return SUCCESS 00054 00055 crateHeader = hdr.crateHeader() 00056 hitDt = 12.5 00057 energyDt = 5 00058 adcDt = 25 00059 tdcDt = 25./16 00060 for det,crate in crateHeader.crates(): 00061 self.debug("Processing " + det.detName()) 00062 crate.__class__=gbl.DayaBay.ElecFeeCrate 00063 00064 boardpath="/file1/event_%d/%s/"%(self.eventNumber, 00065 det.detName()) 00066 esumAdc = crate.esumADC() 00067 energyClock = [tick*energyDt for tick in range(esumAdc.size())] 00068 print esumAdc 00069 graph = TGraph(esumAdc.size(), 00070 array('f',energyClock), 00071 array('f',esumAdc)) 00072 graph.SetMarkerStyle(8) # large circle 00073 graph.SetMarkerColor(600) # blue 00074 graph.SetTitle("esumADC") 00075 self.stats[boardpath+"esumAdc"] = graph 00076 00077 esumUpper = crate.esumUpper() 00078 energyClock = [tick*energyDt for tick in range(esumUpper.size())] 00079 graph = TGraph(esumAdc.size(), 00080 array('f',energyClock), 00081 array('f',esumUpper)) 00082 graph.SetMarkerStyle(8) # large circle 00083 graph.SetMarkerColor(600) # blue 00084 graph.SetTitle("esumUpper") 00085 self.stats[boardpath+"esumUpper"] = graph 00086 00087 esumLower = crate.esumLower() 00088 energyClock = [tick*energyDt for tick in range(esumLower.size())] 00089 graph = TGraph(esumLower.size(), 00090 array('f',energyClock), 00091 array('f',esumLower)) 00092 graph.SetMarkerStyle(8) # large circle 00093 graph.SetMarkerColor(600) # blue 00094 graph.SetTitle("esumLower") 00095 self.stats[boardpath+"esumLower"] = graph 00096 00097 esumTotal = crate.esumTotal() 00098 energyClock = [tick*energyDt for tick in range(esumTotal.size())] 00099 graph = TGraph(esumTotal.size(), 00100 array('f',energyClock), 00101 array('f',esumTotal)) 00102 graph.SetMarkerStyle(8) # large circle 00103 graph.SetMarkerColor(600) # blue 00104 graph.SetTitle("esumTotal") 00105 self.stats[boardpath+"esumTotal"] = graph 00106 00107 00108 for chID,channel in crate.channelData(): 00109 path="/file1/" 00110 path+="event_%d/%s/board_%d/connector_%d/"%(self.eventNumber, 00111 det.detName(), 00112 chID.board(), 00113 chID.connector()) 00114 # self.debug(path) 00115 # only proceed if the channel was hit 00116 tdc = channel.tdc() 00117 if tdc.size() > 0: 00118 adcHigh = channel.adcHigh() 00119 adcHighClock = [tick*adcDt for tick in range(adcHigh.size())] 00120 graph=TGraph(adcHigh.size(), 00121 array('f',adcHighClock), 00122 array('f',adcHigh)) 00123 graph.SetMarkerStyle(8) # large circle 00124 graph.SetMarkerColor(600) # blue 00125 graph.SetTitle("adcHigh") 00126 self.stats[path+"adcHigh"] = graph 00127 00128 hit = channel.hit() 00129 hitClock = [tick*hitDt for tick in range(hit.size())] 00130 graph= TGraph(hit.size(), 00131 array('f',hitClock), 00132 array('f',hit)) 00133 graph.SetMarkerStyle(8) # large circle 00134 graph.SetMarkerColor(600) # blue 00135 graph.SetTitle("nhit") 00136 self.stats[path+"nhit"]=graph 00137 00138 adcLow = channel.adcLow() 00139 adcLowClock = [tick*adcDt for tick in range(adcLow.size())] 00140 graph = TGraph(adcLow.size(), 00141 array('f',adcLowClock), 00142 array('f',adcLow)) 00143 graph.SetMarkerStyle(8) # large circle 00144 graph.SetMarkerColor(600) # blue 00145 graph.SetTitle("adcLow") 00146 self.stats[path+"adcLow"] = graph 00147 00148 return SUCCESS 00149 def finalize(self):
def WaveDumper::WaveDumperAlg::finalize | ( | self | ) |
Definition at line 150 of file WaveDumper.py.
00150 : 00151 self.info("finalizing") 00152 status = DybPythonAlg.finalize(self) 00153 return status 00154 00155
Definition at line 24 of file WaveDumper.py.
Definition at line 32 of file WaveDumper.py.
Definition at line 35 of file WaveDumper.py.