Public Member Functions | |
def | __init__ |
def | initialize |
def | execute |
def | finalize |
Public Attributes | |
cableSvc |
Definition at line 17 of file ViktorsTest.py.
def ViktorsTest::ExampleAlg::__init__ | ( | self, | ||
name | ||||
) |
Definition at line 19 of file ViktorsTest.py.
00019 : 00020 DybPythonAlg.__init__(self,name) 00021 return 00022 def initialize(self):
def ViktorsTest::ExampleAlg::initialize | ( | self | ) |
Definition at line 23 of file ViktorsTest.py.
00023 : 00024 status = DybPythonAlg.initialize(self) 00025 if status.isFailure(): return status 00026 self.info("initializing") 00027 00028 # Initialize services 00029 #self.cableSvc = self.svc('ICableSvc','StaticCableSvc') 00030 00031 self.stats.defaultPath = "/file1/examples/" 00032 # Make the trigger time histogram 00033 self.stats["TrigTime"] = TH1F("TrigTime","Trigger Time [s]", 00034 100,0.0,10.0) 00035 # Make the TDC histogram 00036 self.stats["Tdc"] = TH1F("Tdc","TDC Values",300,0,300) 00037 00038 return SUCCESS 00039 def execute(self):
def ViktorsTest::ExampleAlg::execute | ( | self | ) |
Definition at line 40 of file ViktorsTest.py.
00040 : 00041 self.info("executing") 00042 00043 evt = self.evtSvc() 00044 hdr = evt["/Event/Readout/ReadoutHeader"] 00045 # Exercise 1: Print detector name 00046 ro = hdr.readout() 00047 if ro == None: 00048 self.info("No Readout this cycle") 00049 return SUCCESS 00050 print ro.detector().detName() 00051 # Exercise 2: Histogram the readout trigger time 00052 self.stats["TrigTime"].Fill( ro.triggerTime().GetSeconds() ) 00053 # Exercise 3: Histogram the TDC values 00054 channelIDs = ro.channels() # Get list of channel IDs in the readout 00055 for channelID in channelIDs: 00056 channel = ro.channel(channelID) # get the data from the channel 00057 for tdc in channel.tdc(): # loop over list of TDC values on channel 00058 self.stats["Tdc"].Fill( tdc ) 00059 for adcClock in channel.adcClocks(): 00060 adc = channel.adcByClock(adcClock) 00061 print adcClock, adc 00062 return SUCCESS 00063 def finalize(self):
def ViktorsTest::ExampleAlg::finalize | ( | self | ) |
Definition at line 64 of file ViktorsTest.py.
00064 : 00065 self.info("finalizing") 00066 status = DybPythonAlg.finalize(self) 00067 return status 00068
Definition at line 29 of file ViktorsTest.py.