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

List of all members.

Public Member Functions

def __init__
def initTagList
def check

Public Attributes

 dTCut
 location
 ADTagNames
 inputHeaders
 lastTimeStamp

Detailed Description

Definition at line 18 of file ADCoincTag.py.


Constructor & Destructor Documentation

def Tagger::CoincTagger::ADCoincTag::ADCoincTag::__init__ (   self,
  name 
)

Definition at line 21 of file ADCoincTag.py.

00022                             :
00023         UserTaggingAlg.__init__(self, name)
00024         
00025         self.dTCut = 300*units.microsecond
00026         self.location = "/Event/Rec/AdSimple"
            

Member Function Documentation

def Tagger::CoincTagger::ADCoincTag::ADCoincTag::initTagList (   self)

Definition at line 28 of file ADCoincTag.py.

00029                          :
00030         self.info("Coincidence window: %.3f microsecond" % (
00031             self.dTCut/units.microsecond,))
00032             
00033         self.ADTagNames = { 
00034             gbl.DetectorId.kAD1 : 'AD1',
00035             gbl.DetectorId.kAD2 : 'AD2',
00036             gbl.DetectorId.kAD3 : 'AD3',
00037             gbl.DetectorId.kAD4 : 'AD4',
00038         }
00039         self.inputHeaders = {}
00040         self.lastTimeStamp = {} # hold the last timestamp of sub detectors (inluding IWS, OWS, RPC)
00041         
00042         # initialize AD Coincidence Tags
00043         # initialize inputHeaders to hold the recHeaders of multiplets
00044         for tagName in self.ADTagNames.values():
00045             self.addTag(tagName , '/Event/Tag/Coinc/'+tagName+'CoincTag'
00046                 ).setBaseHeader(self.location)
00047             self.inputHeaders[tagName] = []
        
def Tagger::CoincTagger::ADCoincTag::ADCoincTag::check (   self,
  evt 
)

Definition at line 49 of file ADCoincTag.py.

00050                         :
00051         header = evt[self.location]
00052         if not header:
00053             self.warning('cannot find header at ' + self.location)
00054             return FAILURE
00055 
00056         timeStamp = header.timeStamp()
00057         detectorId = header.context().GetDetId()        
00058         self.debug("executing #%d, Det=%d, TS=%.6f ms" % (
00059             self.execNumber, detectorId, timeStamp.GetSeconds()*1e3))
00060         lastTimeStamp = self.lastTimeStamp.get(detectorId, timeStamp)
00061         self.lastTimeStamp[detectorId] = timeStamp
00062         
00063         tagName = self.ADTagNames.get(detectorId, '')
00064         if not tagName: return  # IWS/OWS/RPC
00065         
00066         dt = gbl.TimeStamp(timeStamp)
00067         dt.Subtract(lastTimeStamp)
00068         if dt.GetSeconds()*units.second > self.dTCut:
00069             multiplicity = len(self.inputHeaders[tagName])
00070             if multiplicity < 2:
00071                 # found singles, clear the inputHeaders
00072                 self.inputHeaders[tagName] = []
00073             else:
00074                 # found a gap, save last conincidence's multiplets         
00075                 # self.info('#%d: found one coinc event in %s, multiplicity %d' % 
00076                 #     (self.execNumber, tagName, multiplicity))
00077                 myTag = self.getTag(tagName)
00078                 myTag.setInputHeaders(self.inputHeaders[tagName])
00079                  
00080                 # clear the inputHeaders
00081                 self.inputHeaders[tagName] = []
00082                 
00083                 # trigger the actual saving process
00084                 myTag.tagIt()
00085         
00086         self.inputHeaders[tagName].append(header)        
        

Member Data Documentation

Definition at line 21 of file ADCoincTag.py.

Definition at line 21 of file ADCoincTag.py.

Definition at line 28 of file ADCoincTag.py.

Definition at line 28 of file ADCoincTag.py.

Definition at line 28 of file ADCoincTag.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