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

In This Package:

ADRecData.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 '''
00003 Usage:
00004 '''
00005 
00006 from UserTagging.UserTaggingAlg import UserTaggingAlg
00007 from GaudiPython import SUCCESS, FAILURE
00008 from GaudiPython import gbl
00009 import GaudiKernel.SystemOfUnits as units
00010 
00011 class ADRecData(UserTaggingAlg):
00012     '''Add AD Reconstruction Info to UserData'''
00013         
00014     # ----------------------------------------    
00015     def initTagList(self):   
00016         self.addTag('Dummy', ''
00017             ).addData('AdSimple', '/Event/UserData/AD/ADRecData/AdSimple'
00018             ).addInt('t_sec', 't_nsec', 'triggerType', 'detID'
00019             ).addFloat('energy', 'x', 'y', 'z')
00020 
00021     # ----------------------------------------
00022     def check(self, evt):
00023         ADTag = evt['/Event/UserTag/Detector/AD']
00024         if not ADTag:
00025             return False
00026         
00027         recHdr = evt['/Event/Rec/AdSimple']
00028         if not recHdr:
00029             self.warning('cannot find recHdr')
00030             return
00031         self.SaveRecData(recHdr)            
00032 
00033         self.tagIt('Dummy')
00034 
00035     # ----------------------------------------
00036     def SaveRecData(self, recHdr):
00037         '''Save Recon Info to UserData'''
00038 
00039         result = recHdr.recTrigger()
00040         self.getTag('Dummy').getData('AdSimple'
00041             ).set("energy", result.energy()/units.MeV
00042             ).set("x", result.position().x()/units.mm
00043             ).set("y", result.position().y()/units.mm
00044             ).set("z", result.position().z()/units.mm
00045             ).set("t_sec", recHdr.timeStamp().GetSec()
00046             ).set("t_nsec", recHdr.timeStamp().GetNanoSec()
00047             ).set("triggerType", result.triggerType()
00048             ).set("detID", result.detector().detectorId())
00049                
00050 #####  Job Configuration for nuwa.py ########################################
00051 
00052 def configure(argv=[]):
00053     pass
00054 
00055 def run(app):
00056     myAlg = ADRecData("UserData::ADRecData")
00057     app.addAlgorithm(myAlg)
00058     pass                    
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:02:01 for UserTagging by doxygen 1.7.4