/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
DybAlg::FilterAlgs::FilterAlg Class Reference
Inheritance diagram for DybAlg::FilterAlgs::FilterAlg:
Inheritance graph
[legend]
Collaboration diagram for DybAlg::FilterAlgs::FilterAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 RegSeqLocation
 ClearStore
 StorePath
 Prescale
 DetectorNames
 detectors
 uniform_random
 randSvc

Detailed Description

Definition at line 25 of file FilterAlgs.py.


Constructor & Destructor Documentation

def DybAlg::FilterAlgs::FilterAlg::__init__ (   self,
  name 
)

Definition at line 27 of file FilterAlgs.py.

00028                            :
00029         DybPythonAlg.__init__(self,name)
00030         # Properties
00031         self.RegSeqLocation = RegistrationSequence.defaultLocation()
00032         self.ClearStore = True
00033         self.StorePath = ""
00034         self.Prescale = None
00035         self.DetectorNames = []
00036         # Internal variables
00037         self.detectors = []
00038         self.uniform_random = Rndm.Numbers()
00039         return


Member Function Documentation

def DybAlg::FilterAlgs::FilterAlg::initialize (   self)

Definition at line 40 of file FilterAlgs.py.

00041                         :
00042         status = DybPythonAlg.initialize(self)
00043         self.info("initializing")
00044         for detName in self.DetectorNames:
00045             self.detectors.append(Detector(detName))
00046         # Initialize random number service if applying prescale 
00047         if self.Prescale != None:
00048             self.randSvc = self.svc('IRndmGenSvc','RndmGenSvc')
00049             if self.randSvc == None:
00050                 self.error("Failed to initialize random number service.")
00051                 return FAILURE
00052             status= self.uniform_random.initialize(self.randSvc, Rndm.Flat(0,1))
00053             if not status.isSuccess():
00054                 self.error("Failed to initialize uniform random numbers.")
00055                 return status
00056         return status

def DybAlg::FilterAlgs::FilterAlg::execute (   self)

Definition at line 57 of file FilterAlgs.py.

00058                      :
00059         self.info("executing")
00060         evt = self.evtSvc()
00061         # Get Registration Sequence
00062         regSequence = evt[self.RegSeqLocation]
00063         if regSequence == None:
00064             self.error("Failed to retrieve Registration Sequence from"
00065                        + self.regseqLocation)
00066             return FAILURE
00067         # Get List of TES objects registered this execution cycle
00068         registrations = regSequence.registrations()
00069         for registration in registrations:
00070             hdrObj = registration.object()
00071             if hdrObj == None:
00072                 self.error("Failed to retrieve object at "+registration.path())
00073                 return FAILURE
00074             if self.ClearStore:
00075                 # Start by turning off storage of all items
00076                 regSequence.registration(hdrObj).setStore(False)
00077             if len(self.detectors)>0:
00078                 # Filter by detector if a detector list is defined
00079                 currentDetector = Detector(hdrObj.context().GetSite(),
00080                                            hdrObj.context().GetDetId())
00081                 if currentDetector not in self.detectors:
00082                     continue
00083             if registration.path() == self.StorePath:
00084                 # Store if it is at the selected TES path, check prescale
00085                 if self.Prescale == None:
00086                     regSequence.registration(hdrObj).setStore(True)
00087                     self.debug("Storing "+registration.path()+" in output file")
00088                 elif self.Prescale >= self.uniform_random():
00089                     regSequence.registration(hdrObj).setStore(True)
00090                     self.debug("Storing "+registration.path()+" in output file")
00091         return SUCCESS
        
def DybAlg::FilterAlgs::FilterAlg::finalize (   self)

Definition at line 92 of file FilterAlgs.py.

00093                       :
00094         self.info("finalizing")
00095         status = DybPythonAlg.finalize(self)
00096         return status
00097 
00098 
# Time-correlation Filtering algorithm

Member Data Documentation

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 27 of file FilterAlgs.py.

Definition at line 40 of file FilterAlgs.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 10:09:44 for DybAlg by doxygen 1.7.4