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

List of all members.

Public Member Functions

def __init__
def initTagList
def check
def SaveADSingleData

Public Attributes

 tag_data_locations
 location
 isSimulation
 coordSvc

Detailed Description

Definition at line 20 of file ADSingleData.py.


Constructor & Destructor Documentation

def Tagger::SingleTagger::ADSingleData::ADSingleData::__init__ (   self,
  name 
)

Definition at line 23 of file ADSingleData.py.

00024                             :
00025         UserTaggingAlg.__init__(self, name)
00026         
00027         self.tag_data_locations = {
00028             '/Event/Tag/Single/AD1SingleTag' : '/Event/Data/SingleData/AD1SingleData',
00029             '/Event/Tag/Single/AD2SingleTag' : '/Event/Data/SingleData/AD2SingleData',
00030         }
00031         self.location = '/Event/Rec/AdSimple'
00032         self.isSimulation = False


Member Function Documentation

def Tagger::SingleTagger::ADSingleData::ADSingleData::initTagList (   self)

Definition at line 34 of file ADSingleData.py.

00034                          :        
00035         self.coordSvc = self.svc('ICoordSysSvc','CoordSysSvc')
00036         if self.coordSvc == None:
00037             self.error("Failed to get ICoordSysSvc")
00038             return FAILURE
00039         
00040         # create ADSingleData for each predefined tag
00041         for tagName, dataName in self.tag_data_locations.items():
00042          #   make it simple by using path as name as well
00043             myTag = self.addTag(tagName, '').setBaseHeader(self.location)
00044             myData = myTag.addData(dataName , dataName)
00045             myData.addInt('multiplicity'
00046                ).addIntArray('dt_ns', 'I', 'J')
00047             
00048             # add RecHeader info
00049             for paraName in RecDataHelper.DATA_SUMMARY_INT:
00050                 myData.addIntArray(paraName)
00051             for paraName in RecDataHelper.DATA_SUMMARY_FLOAT:
00052                 myData.addFloatArray(paraName)
00053             '''
00054             # add CalibStats info
00055             for paraName in CalibDataHelper.DATA_STATS_INT:
00056                 myData.addIntArray('calib_'+paraName)
00057             for paraName in CalibDataHelper.DATA_STATS_FLOAT:
00058                 myData.addFloatArray('calib_'+paraName)
00059             for paraName in CalibDataHelper.DATA_DTLAST_FLOAT:
00060                 myData.addFloatArray(paraName) 
00061             
00062             if self.isSimulation:
00063                 # add GenHeader info
00064                 for paraName in GenDataHelper.DATA_SUMMARY_INT:
00065                     myData.addIntArray(paraName)
00066                 for paraName in GenDataHelper.DATA_SUMMARY_FLOAT:
00067                     myData.addFloatArray(paraName)
00068 
00069                 # add SimHeader Info
00070                 for paraName in SimDataHelper.DATA_SUMMARY_INT:
00071                     myData.addIntArray(paraName)
00072                 for paraName in SimDataHelper.DATA_NCAP_INT:
00073                     myData.addIntArray(paraName)
00074                 for paraName in SimDataHelper.DATA_NCAP_FLOAT:
00075                     myData.addFloatArray(paraName)
00076               '''       
def Tagger::SingleTagger::ADSingleData::ADSingleData::check (   self,
  evt 
)

Definition at line 78 of file ADSingleData.py.

00078                         :                
00079         for tagName, dataName in self.tag_data_locations.items():
00080             tagHeader = evt[tagName]  # tagName == tagPath
00081             if not tagHeader:
00082                 continue  # skip non-single events
00083             else:
00084                 myData = self.getTag(tagName).getData(dataName)
00085                 self.SaveADSingleData(myData, tagHeader)
00086                 self.tagIt(tagName)
00087                 break  # the AD single tags are exclusive
00088     
def Tagger::SingleTagger::ADSingleData::ADSingleData::SaveADSingleData (   self,
  myData,
  tagHeader 
)
Keyword arguments:
    myData -- the Data object defined in UserTagging.Models
    tagHeader -- the AD single UserTag object

Definition at line 90 of file ADSingleData.py.

00091                                                  :
00092         '''
00093         Keyword arguments:
00094             myData -- the Data object defined in UserTagging.Models
00095             tagHeader -- the AD single UserTag object
00096         '''
00097 
00098         singleRecHdrs = tagHeader.inputHeaders()
00099         firstHdr = True
00100         for recHdr in singleRecHdrs:
00101             data = RecDataHelper.summary(recHdr)
00102             # save RecHeader info
00103             for paraName in RecDataHelper.DATA_SUMMARY_INT:
00104                 myData.append(paraName, data[paraName])
00105             for paraName in RecDataHelper.DATA_SUMMARY_FLOAT:
00106                 myData.append(paraName, data[paraName])
00107             if firstHdr:
00108                 t0_s = data["t_s"]
00109                 t0_ns = data["t_ns"]
00110                 firstHdr = False
00111             myData.append('dt_ns', (data["t_s"]-t0_s)*1e9 + data["t_ns"] - t0_ns)
00112             '''   
00113             # save calib stats
00114             calibStatsHdrs = recHdr.findHeaders(gbl.DayaBay.UserDataHeader.classID())
00115             if calibStatsHdrs and len(calibStatsHdrs) == 1:
00116                 calibStats = calibStatsHdrs[0]
00117                 for paraName in CalibDataHelper.DATA_STATS_INT:
00118                     myData.append('calib_'+paraName, calibStats.getInt(paraName))
00119                 for paraName in CalibDataHelper.DATA_STATS_FLOAT:
00120                     myData.append('calib_'+paraName, calibStats.getFloat(paraName))
00121                 for paraName in CalibDataHelper.DATA_DTLAST_FLOAT:
00122                     myData.append(paraName, calibStats.getFloat(paraName))
00123             else:
00124                 self.warning("no calibStats in recHeader's inputHeaders")
00125 
00126             
00127             # save some gen/sim info for simualtion files
00128             if self.isSimulation:
00129                 # save GenHeader info
00130                 genHdrs = recHdr.findHeaders(gbl.DayaBay.GenHeader.classID())
00131                 data = GenDataHelper.summary(self, recHdr, genHdrs)
00132                 for paraName in GenDataHelper.DATA_SUMMARY_INT:
00133                     myData.append(paraName, data[paraName])
00134                 for paraName in GenDataHelper.DATA_SUMMARY_FLOAT:
00135                     myData.append(paraName, data[paraName])
00136 
00137                 # save SimHeader info
00138                 simHdrs = recHdr.findHeaders(gbl.DayaBay.SimHeader.classID())
00139                 data = SimDataHelper.summary(simHdrs)
00140                 for paraName in SimDataHelper.DATA_SUMMARY_INT:
00141                     myData.append(paraName, data[paraName])
00142                 data = SimDataHelper.nCapture(self, recHdr)
00143                 for paraName in SimDataHelper.DATA_NCAP_INT:
00144                     myData.append(paraName, data[paraName])
00145                 for paraName in SimDataHelper.DATA_NCAP_FLOAT:
00146                     myData.append(paraName, data[paraName])
00147             '''          
00148         multiplicity = len(singleRecHdrs)
00149         myData.set("multiplicity", multiplicity)
00150         # add the pairing array trick to allow easy TTree::Draw() such as
00151         # tree.Draw("e[J]:e[I]")
00152         for i in range(0, multiplicity-1):
00153             for j in range(i+1, multiplicity):
00154                 myData.append('I', i).append('J', j)
00155                 
        

Member Data Documentation

Definition at line 23 of file ADSingleData.py.

Definition at line 23 of file ADSingleData.py.

Definition at line 23 of file ADSingleData.py.

Definition at line 34 of file ADSingleData.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