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

List of all members.

Public Member Functions

def __init__
def initTagList
def check
def SaveMLRecADETWindowData

Public Attributes

 tag_data_locations
 location
 isSimulation
 daqDetailsSvc

Detailed Description

Definition at line 17 of file mlRecADETWindowData.py.


Constructor & Destructor Documentation

def Tagger::ETWindowTagger::mlRecADETWindowData::mlRecADETWindowData::__init__ (   self,
  name 
)

Definition at line 20 of file mlRecADETWindowData.py.

00021                             :
00022         UserTaggingAlg.__init__(self, name)
00023         
00024         self.tag_data_locations = {
00025             '/Event/Tag/mlRecETWindow/AD1ETWindowTag' : '/Event/Data/mlRecETWindow/AD1ETWindowData',
00026             '/Event/Tag/mlRecETWindow/AD2ETWindowTag' : '/Event/Data/mlRecETWindow/AD2ETWindowData',
00027             '/Event/Tag/mlRecETWindow/AD3ETWindowTag' : '/Event/Data/mlRecETWindow/AD3ETWindowData',
00028             '/Event/Tag/mlRecETWindow/AD4ETWindowTag' : '/Event/Data/mlRecETWindow/AD4ETWindowData',
00029         }
00030         self.location = '/Events/Rec/AdMLRec'
00031         self.isSimulation = False


Member Function Documentation

def Tagger::ETWindowTagger::mlRecADETWindowData::mlRecADETWindowData::initTagList (   self)

Definition at line 33 of file mlRecADETWindowData.py.

00033                          :        
00034         self.daqDetailsSvc = self.svc('IDaqDetailsSvc','DetailsFromRecordSvc')
00035         
00036         if self.daqDetailsSvc == None: 
00037             self.error("Failed to get IDaqDetailsSvc") 
00038             return FAILURE 
00039         
00040         # create mlRecADETWindowData 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', 'runNo', 'fileNo'
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 + CalibDataHelper.DATA_DTNEXT_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::ETWindowTagger::mlRecADETWindowData::mlRecADETWindowData::check (   self,
  evt 
)

Definition at line 78 of file mlRecADETWindowData.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 no tag events
00083             else:
00084                 myData = self.getTag(tagName).getData(dataName)
00085                 self.SaveMLRecADETWindowData(myData, tagHeader)
00086                 self.tagIt(tagName)
00087                 break  # the AD conic tags are exclusive
00088     
def Tagger::ETWindowTagger::mlRecADETWindowData::mlRecADETWindowData::SaveMLRecADETWindowData (   self,
  myData,
  tagHeader 
)
Keyword arguments:
    myData -- the Data object defined in UserTagging.Models
    tagHeader -- the AD UserTag object

Definition at line 90 of file mlRecADETWindowData.py.

00091                                                         :
00092         '''
00093         Keyword arguments:
00094             myData -- the Data object defined in UserTagging.Models
00095             tagHeader -- the AD UserTag object
00096         '''
00097 
00098         energyRecHdrs = tagHeader.inputHeaders()
00099         firstHdr = True
00100         for recHdr in energyRecHdrs:
00101             data = RecDataHelper.summary(recHdr)
00102             
00103             # save RecHeader info
00104             for paraName in RecDataHelper.DATA_SUMMARY_INT:
00105                 myData.append(paraName, data[paraName])
00106             for paraName in RecDataHelper.DATA_SUMMARY_FLOAT:
00107                 myData.append(paraName, data[paraName])
00108             if firstHdr:
00109                 t0_s = data["t_s"]
00110                 t0_ns = data["t_ns"]
00111                 firstHdr = False
00112             myData.append('dt_ns', (data["t_s"]-t0_s)*1e9 + data["t_ns"] - t0_ns)
00113                     
00114             # save calib stats
00115             calibStatsHdrs = recHdr.findHeaders(gbl.DayaBay.UserDataHeader.classID())
00116             if calibStatsHdrs and len(calibStatsHdrs) == 1:
00117                 calibStats = calibStatsHdrs[0]
00118                 for paraName in CalibDataHelper.DATA_STATS_INT:
00119                     myData.append('calib_'+paraName, calibStats.getInt(paraName))
00120                 for paraName in CalibDataHelper.DATA_STATS_FLOAT:
00121                     myData.append('calib_'+paraName, calibStats.getFloat(paraName))
00122                 for paraName in CalibDataHelper.DATA_DTLAST_FLOAT + CalibDataHelper.DATA_DTNEXT_FLOAT:
00123                     myData.append(paraName, calibStats.getFloat(paraName))
00124             else:
00125                 self.warning("no calibStats in recHeader's inputHeaders")
00126  
00127                 
00128             # save some gen/sim info for simualtion files
00129             if self.isSimulation:
00130                 # save GenHeader info
00131                 genHdrs = recHdr.findHeaders(gbl.DayaBay.GenHeader.classID())
00132                 data = GenDataHelper.summary(self, recHdr, genHdrs)
00133                 for paraName in GenDataHelper.DATA_SUMMARY_INT:
00134                     myData.append(paraName, data[paraName])
00135                 for paraName in GenDataHelper.DATA_SUMMARY_FLOAT:
00136                     myData.append(paraName, data[paraName])
00137  
00138                 # save SimHeader info
00139                 simHdrs = recHdr.findHeaders(gbl.DayaBay.SimHeader.classID())
00140                 data = SimDataHelper.summary(simHdrs)
00141                 for paraName in SimDataHelper.DATA_SUMMARY_INT:
00142                     myData.append(paraName, data[paraName])
00143                 data = SimDataHelper.nCapture(self, recHdr)
00144                 for paraName in SimDataHelper.DATA_NCAP_INT:
00145                     myData.append(paraName, data[paraName])
00146                 for paraName in SimDataHelper.DATA_NCAP_FLOAT:
00147                     myData.append(paraName, data[paraName])
00148         
00149         multiplicity = len(energyRecHdrs)
00150         myData.set("multiplicity", multiplicity)
00151         # add the pairing array trick to allow easy TTree::Draw() such as
00152         # tree.Draw("e[J]:e[I]")
00153         for i in range(0, multiplicity-1):
00154             #for j in range(i+1, multiplicity):
00155             j = multiplicity-1 # the last one
00156             myData.append('I', i).append('J', j) 
00157                      
00158         # check for every execution in case of multiple input runs/files
00159         # if self.isSimulation:
00160         #     runNo = fileNo = 0
00161         # else:
00162         #     svcMode = ServiceMode(tagHeader.context(), 0)
00163         #     runNo = self.daqDetailsSvc.runDetails(svcMode).runNumber()
00164         #     fileNo = self.daqDetailsSvc.fileDetails(svcMode).fileNumber()
00165         svcMode = ServiceMode(tagHeader.context(), 0)
00166         runDetails = self.daqDetailsSvc.runDetails(svcMode)
00167         if runDetails:
00168             runNo = runDetails.runNumber()
00169         else:
00170             runNo = 0
00171         fileDetails = self.daqDetailsSvc.fileDetails(svcMode)
00172         if fileDetails:
00173             fileNo = fileDetails.fileNumber()
00174         else:
00175             fileNo = 0
00176         myData.set("runNo", runNo)
00177         myData.set("fileNo", fileNo)
        

Member Data Documentation

Definition at line 20 of file mlRecADETWindowData.py.

Definition at line 20 of file mlRecADETWindowData.py.

Definition at line 20 of file mlRecADETWindowData.py.

Definition at line 33 of file mlRecADETWindowData.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