/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
Example::ExampleAlg Class Reference
Inheritance diagram for Example::ExampleAlg:
Inheritance graph
[legend]
Collaboration diagram for Example::ExampleAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 MyProperty

Detailed Description

Definition at line 17 of file Example.py.


Constructor & Destructor Documentation

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

Definition at line 19 of file Example.py.

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


Member Function Documentation

def Example::ExampleAlg::initialize (   self)

Definition at line 25 of file Example.py.

00026                         :
00027         status = DybPythonAlg.initialize(self)
00028         if status.isFailure(): return status
00029         self.info("initializing")
00030 
00031         # Make a histogram
00032         self.stats["/file1/path/to/MyHist1"] = TH1F("MyHist1","Test Histogram",
00033                                                     100,0.0,10.0)
00034         return SUCCESS

def Example::ExampleAlg::execute (   self)

Definition at line 35 of file Example.py.

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

Definition at line 75 of file Example.py.

00076                       :
00077         self.info("finalizing")
00078         status = DybPythonAlg.finalize(self)
00079         return status
00080 


Member Data Documentation

Definition at line 19 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 Fri May 16 2014 09:49:50 for DivingIn by doxygen 1.7.4