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

List of all members.

Public Member Functions

def __init__
def initTagList
def check
def post_save

Public Attributes

 location
 pmtGeomSvc
 myTag
 myData

Detailed Description

Definition at line 16 of file CalibStats.py.


Constructor & Destructor Documentation

def Tagger::CalibStats::CalibStats::__init__ (   self,
  name 
)

Definition at line 19 of file CalibStats.py.

00020                             :
00021         UserTaggingAlg.__init__(self, name)
00022         self.location = '/Event/CalibReadout/CalibReadoutHeader'
        

Member Function Documentation

def Tagger::CalibStats::CalibStats::initTagList (   self)

Definition at line 24 of file CalibStats.py.

00025                          :
00026         self.pmtGeomSvc = self.svc('IPmtGeomInfoSvc','PmtGeomInfoSvc')
00027         if self.pmtGeomSvc == None:
00028             self.error("Failed to get PmtGeomInfoSvc")
00029             return FAILURE
00030         
00031         self.myTag = self.addTag('CalibStats', '').setBaseHeader(self.location)
00032         self.myData = self.myTag.addData('CalibStats' , '/Event/Data/CalibStats')
00033         for paraName in CalibDataHelper.DATA_STATS_INT:
00034             self.myData.addInt(paraName)
00035         for paraName in CalibDataHelper.DATA_STATS_FLOAT:
00036             self.myData.addFloat(paraName)
00037         for paraName in CalibDataHelper.DATA_DTLAST_FLOAT:
00038             self.myData.addFloat(paraName)  
00039         for paraName in CalibDataHelper.DATA_DTNEXT_FLOAT:
00040             self.myData.addFloat(paraName) 
                                  
def Tagger::CalibStats::CalibStats::check (   self,
  evt 
)

Definition at line 42 of file CalibStats.py.

00043                         :
00044         calibHdr = evt[self.location]
00045         if not calibHdr:
00046             self.warning('cannot find %s' % self.location)
00047             return FAILURE
00048         data = CalibDataHelper.stats(calibHdr)
00049         for paraName in CalibDataHelper.DATA_STATS_INT:
00050             self.myData.set(paraName, data[paraName])
00051         for paraName in CalibDataHelper.DATA_STATS_FLOAT:
00052             self.myData.set(paraName, data[paraName])        
00053                 
00054         # shall we add CalibReadoutHeader to the inputHeaders of UserData?
00055         # self.myData.addInputHeader(calibHdr)    
00056         # trigger the saving process
00057         self.myTag.tagIt()
00058         
00059         # save dt to last detector info
00060         calibAES = self.getAES(self.location)
00061         if not calibAES:
00062             self.warning("AES not found in %s" % self.location)
00063             return
00064         data = CalibDataHelper.dtLast(calibAES)
00065         for paraName in CalibDataHelper.DATA_DTLAST_FLOAT:
00066             self.myData.set(paraName, data[paraName])
00067         for paraName in CalibDataHelper.DATA_DTNEXT_FLOAT:
00068             self.myData.set(paraName, -1)
    
def Tagger::CalibStats::CalibStats::post_save (   self,
  evt 
)

Definition at line 70 of file CalibStats.py.

00070                             :        
00071         # save dt to next detector info
00072         calibStatsAES = self.getAES('/Event/Data/CalibStats')
00073         if not calibStatsAES:
00074             self.warning("AES not found at /Event/Data/CalibStats")
00075             return
00076         
00077         header = calibStatsAES[0]
00078         detId = header.context().GetDetId()
00079         paraName = 'dtNext' + CalibDataHelper.DET_NAMES.get(detId,'') + '_ms'
00080         timeStamp = header.timeStamp()
00081         # print '#', self.execNumber, paraName, timeStamp.GetSec(), timeStamp.GetNanoSec()
00082         for i in range(1, len(calibStatsAES)):
00083             aes_header = calibStatsAES[i]
00084             aes_detId = aes_header.context().GetDetId()
00085             if aes_detId == detId:
00086                 dt = gbl.TimeStamp(timeStamp)
00087                 dt.Subtract(aes_header.timeStamp())
00088                 aes_header.setFloat(paraName, dt.GetSeconds()*1e3)
00089                 # print 'break at', i
00090                 break  # subsequent aes headers already set this dtNext
00091             else:
00092                 if aes_header.getFloat(paraName) < 0:
00093                     dt = gbl.TimeStamp(timeStamp)
00094                     dt.Subtract(aes_header.timeStamp())
00095                     aes_header.setFloat(paraName, dt.GetSeconds()*1e3)
00096         
00097         # # debug
00098         # print '========='
00099         # for i in range(0, len(calibStatsAES)):   
00100         #     aes_header = calibStatsAES[i]
00101         #     print 'aes', i,  CalibDataHelper.DET_NAMES.get(aes_header.context().GetDetId(),'unknown')
00102         #     for paraName in CalibDataHelper.DATA_DTNEXT_FLOAT:  
00103         #         print paraName, aes_header.getFloat(paraName)
00104         # print
00105         

Member Data Documentation

Definition at line 19 of file CalibStats.py.

Definition at line 24 of file CalibStats.py.

Definition at line 24 of file CalibStats.py.

Definition at line 24 of file CalibStats.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