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

List of all members.

Public Member Functions

def initTagList
def check
def SaveSimData

Public Attributes

 target_de_name

Detailed Description

Add MC Truth Info to UserData

Definition at line 13 of file SimData.py.


Member Function Documentation

def TaggingExample::SimData::SimData::initTagList (   self)

Definition at line 17 of file SimData.py.

00018                          :
00019         
00020         # nSim should be one except for pile-up events        
00021         # Truth information, size of nSim
00022         self.addTag('Dummy', ''
00023             ).addData('SimData', '/Event/UserData/General/SimData'
00024             ).addInt('nSim'
00025             ).addIntArray('capTargetZ'
00026             ).addFloatArray('tCap', 'xCap', 'yCap', 'zCap'
00027             ).addFloatArray('QEInGdLS', 'QEInLS', 'QEInIAV', 'QEInOAV', 'QEInOIL', 'QESum')
00028     
00029         self.target_de_name = '/dd/Structure/AD/db-ade1/db-sst1/db-oil1'
        
def TaggingExample::SimData::SimData::check (   self,
  evt 
)

Definition at line 31 of file SimData.py.

00032                         :
00033 
00034         readoutHdr = evt['/Event/Readout/ReadoutHeader']
00035         if not readoutHdr:
00036             self.warning('cannot find readoutHdr')
00037             return
00038         
00039         simHdrs = readoutHdr.findHeaders(gbl.DayaBay.SimHeader.classID())
00040         self.SaveSimData(simHdrs)
00041         
00042         self.tagIt('Dummy')
        
def TaggingExample::SimData::SimData::SaveSimData (   self,
  simHdrs 
)

Definition at line 44 of file SimData.py.

00045                                   :
00046 
00047         myData = self.getTag('Dummy').getData('SimData')
00048         
00049         de = self.getDet(self.target_de_name)
00050         if not de:
00051             self.info('Failed to get DE' + self.target_de_name)
00052             return FAILURE
00053         Gaudi = PyCintex.makeNamespace('Gaudi')
00054                         
00055         nSim = len(simHdrs) 
00056                 
00057         for simHdr in simHdrs:
00058             uo_hdr = simHdr.unobservableStatistics()
00059             if not uo_hdr:
00060                 self.info("no unobservableStatistics header in sim header")
00061                 continue
00062             uo_stats = uo_hdr.stats()
00063             if not uo_stats:
00064                 self.info("no unobservableStatistics in sim header")
00065                 continue
00066             QEInGdLS = uo_stats["QEDepInGdLS"].sum()/units.MeV
00067             QEInLS   = uo_stats["QEDepInLS"].sum()/units.MeV
00068             QEInIAV  = uo_stats["QEDepInIAV"].sum()/units.MeV
00069             QEInOAV  = uo_stats["QEDepInOAV"].sum()/units.MeV
00070             QEInOIL  = uo_stats["QEDepInOIL"].sum()/units.MeV
00071             QESum = QEInGdLS+QEInLS+QEInIAV+QEInOAV+QEInOIL
00072             myData.append('QEInGdLS', QEInGdLS
00073                 ).append('QEInLS'  , QEInLS
00074                 ).append('QEInIAV' , QEInIAV
00075                 ).append('QEInOAV' , QEInOAV
00076                 ).append('QEInOIL' , QEInOIL
00077                 ).append('QESum'   , QESum
00078                 
00079                 ).append('capTargetZ', int(uo_stats["capTarget"].sum())
00080                 ).append('tCap', uo_stats["tCap"].sum()/units.microsecond
00081                 ).append('xCap', uo_stats["xCap"].sum()/units.mm
00082                 ).append('yCap', uo_stats["yCap"].sum()/units.mm
00083                 ).append('zCap', uo_stats["zCap"].sum()/units.mm)
00084             
00085         myData.set("nSim", nSim)        
00086 


Member Data Documentation

Definition at line 17 of file SimData.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:29 for TaggingExample by doxygen 1.7.4