/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
Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag Class Reference
Inheritance diagram for Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag:
Inheritance graph
[legend]
Collaboration diagram for Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initTagList
def check

Public Attributes

 lowECut
 highECut
 timeWindow
 location
 ADTagNames
 inputHeaders
 timeStamps

Detailed Description

Definition at line 17 of file ADETWindowTag.py.


Constructor & Destructor Documentation

def Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag::__init__ (   self,
  name 
)

Definition at line 20 of file ADETWindowTag.py.

00021                             :
00022         UserTaggingAlg.__init__(self, name)
00023         
00024         self.lowECut = 5*units.MeV
00025         self.highECut = 15*units.MeV
00026         self.timeWindow = 400*units.microsecond
00027         self.location = "/Event/Rec/AdSimple"
            

Member Function Documentation

def Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag::initTagList (   self)

Definition at line 29 of file ADETWindowTag.py.

00030                          :
00031         self.info("Low energy cut > %.3f MeV" % (self.lowECut/units.MeV,))
00032         if self.highECut>self.lowECut:
00033             self.info("High energy cut < %.3f MeV" % (self.highECut/units.MeV,))
00034         self.info("timeWindow cut < %.3f microsecond" % (self.timeWindow/units.microsecond,))
00035             
00036         self.ADTagNames = { 
00037             gbl.DetectorId.kAD1 : 'AD1',
00038             gbl.DetectorId.kAD2 : 'AD2',
00039             gbl.DetectorId.kAD3 : 'AD3',
00040             gbl.DetectorId.kAD4 : 'AD4',
00041         }
00042         self.inputHeaders = {}
00043         self.timeStamps = {}
00044         
00045         # initialize AD ETWindow Tags
00046         # initialize inputHeaders to hold the recHeaders
00047         for tagName in self.ADTagNames.values():
00048             self.addTag(tagName , '/Event/Tag/ETWindow/'+tagName+'ETWindowTag'
00049                 ).setBaseHeader(self.location)
00050             self.inputHeaders[tagName] = []
00051             self.timeStamps[tagName] = []
        
def Tagger::ETWindowTagger::ADETWindowTag::ADETWindowTag::check (   self,
  evt 
)

Definition at line 53 of file ADETWindowTag.py.

00054                         :
00055         header = evt[self.location]
00056         if not header:
00057             self.warning('cannot find header at ' + self.location)
00058             return FAILURE
00059 
00060         timeStamp = header.timeStamp()
00061         trigger = header.recTrigger()
00062         energy = trigger.energy()
00063         detectorId = header.context().GetDetId()        
00064         self.debug("executing #%d, Det=%d, TS=%.6f ms" % (
00065             self.execNumber, detectorId, timeStamp.GetSeconds()*1e3))
00066         tagName = self.ADTagNames.get(detectorId, '')
00067         if not tagName: return  # IWS/OWS/RPC
00068         
00069         pop_counter = 0
00070         self.inputHeaders[tagName].append(header) 
00071         self.timeStamps[tagName].append(timeStamp) 
00072         for ts in self.timeStamps[tagName]:
00073             nTS = gbl.TimeStamp(timeStamp)
00074             nTS.Subtract(ts)
00075             if nTS.GetSeconds()*units.second > self.timeWindow:
00076                 pop_counter = pop_counter + 1
00077         for i in range(pop_counter):
00078             del self.inputHeaders[tagName][0]   # delete the first element
00079             del self.timeStamps[tagName][0]   # delete the first element
00080 
00081         if energy > self.lowECut and (energy < self.highECut or self.highECut < self.lowECut):
00082             if len(self.inputHeaders[tagName])>1:    
00083                 myTag = self.getTag(tagName)
00084                 myTag.setInputHeaders(self.inputHeaders[tagName])
00085                 myTag.tagIt() 
00086                 self.inputHeaders[tagName] = [] # clear for coincidence
00087                 self.timeStamps[tagName] = [] # clear for coincidence
00088             if len(self.inputHeaders[tagName])==1:    
00089                 myTag = self.getTag(tagName)
00090                 myTag.setInputHeaders(self.inputHeaders[tagName])
00091                 myTag.tagIt() 
00092                 #self.inputHeaders[tagName] = [] # not clear for sigle neutron-like signal
        

Member Data Documentation

Definition at line 20 of file ADETWindowTag.py.

Definition at line 20 of file ADETWindowTag.py.

Definition at line 20 of file ADETWindowTag.py.

Definition at line 20 of file ADETWindowTag.py.

Definition at line 29 of file ADETWindowTag.py.

Definition at line 29 of file ADETWindowTag.py.

Definition at line 29 of file ADETWindowTag.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:54:18 for Tagger by doxygen 1.7.4