| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Example::ExampleAlg Class Reference

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 MyProperty
 cableSvc

Detailed Description

Definition at line 17 of file Example.py.


Member Function Documentation

def Example::ExampleAlg::__init__ (   self,
  name 
)

Definition at line 19 of file Example.py.

00019                            :
00020         DybPythonAlg.__init__(self,name)
00021         # Define Properties and default values here
00022         self.MyProperty = 1
00023         return
00024 
    def initialize(self):

def Example::ExampleAlg::initialize (   self  ) 

Definition at line 25 of file Example.py.

00025                         :
00026         status = DybPythonAlg.initialize(self)
00027         if status.isFailure(): return status
00028         self.info("initializing")
00029 
00030         # Initialize services
00031         #  Cable Service: Use for pmt and electronics channel info
00032         # self.cableSvc = self.svc('ICableSvc','StaticCableSvc')
00033 
00034         # Make a histogram
00035         self.stats["/file1/path/to/MyHist1"] = TH1F("MyHist1","Test Histogram",
00036                                                     100,0.0,10.0)
00037         return SUCCESS
00038 
    def execute(self):

def Example::ExampleAlg::execute (   self  ) 

Definition at line 39 of file Example.py.

00039                      :
00040         self.info("executing")
00041         
00042         # Access current data
00043         evt = self.evtSvc()
00044         currentHdr = evt["/Event/Readout/ReadoutHeader"]
00045         if currentHdr == None:
00046             self.error("Failed to get current readout header")
00047             return FAILURE
00048 
00049         # Access recent data in archive
00050         readoutArchive = self.getAES("/Event/Readout/ReadoutHeader")
00051         if readoutArchive == None:
00052             self.error("Failed to get recent readout headers")
00053             return FAILURE
00054         # Loop over all readouts in archive, including current readout
00055         for readoutHdr in readoutArchive:
00056             readout = readoutHdr.readout()
00057         # Access current readout (First entry in archive!)
00058         firstHdr = readoutArchive[0]
00059         # This is true: firstHdr == currentHdr
00060         # Loop over previous readouts, not including current readout
00061         for readoutHdr in readoutArchive[1:]:
00062             readout = readoutHdr.readout()
00063 
00064         # Do some calculation...
00065         # ...
00066         # ...
00067         myResult = 3.14
00068         # Add entry to histogram
00069         self.stats["/file1/path/to/MyHist1"].Fill( myResult )
00070 
00071         # Print messages to the job log
00072         self.error("an error message")
00073         self.warning("a warning")
00074         self.info("some information")
00075         self.debug("some extra debugging information")
00076         self.verbose("too much information")
00077         return SUCCESS
00078         
    def finalize(self):

def Example::ExampleAlg::finalize (   self  ) 

Definition at line 79 of file Example.py.

00079                       :
00080         self.info("finalizing")
00081         status = DybPythonAlg.finalize(self)
00082         return status
00083 
00084 
#####  Job Configuration for nuwa.py ########################################


Member Data Documentation

Example::ExampleAlg::MyProperty

Definition at line 22 of file Example.py.

Example::ExampleAlg::cableSvc

Definition at line 32 of file Example.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:05:58 2011 for DivingIn by doxygen 1.4.7