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

List of all members.

Public Member Functions

def __init__
def initTagList
def check
def SaveADCoincData

Public Attributes

 tag_data_locations
 location
 isSimulation
 coordSvc
 daqDetailsSvc

Detailed Description

Definition at line 22 of file ADCoincData.py.


Constructor & Destructor Documentation

def Tagger::CoincTagger::ADCoincData::ADCoincData::__init__ (   self,
  name 
)

Definition at line 25 of file ADCoincData.py.

00026                             :
00027         UserTaggingAlg.__init__(self, name)
00028         
00029         self.tag_data_locations = {
00030             '/Event/Tag/Coinc/AD1CoincTag' : '/Event/Data/Coinc/AD1CoincData',
00031             '/Event/Tag/Coinc/AD2CoincTag' : '/Event/Data/Coinc/AD2CoincData',
00032         }
00033         self.location = '/Events/Rec/AdSimple'
00034         self.isSimulation = False


Member Function Documentation

def Tagger::CoincTagger::ADCoincData::ADCoincData::initTagList (   self)

Definition at line 36 of file ADCoincData.py.

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

Definition at line 86 of file ADCoincData.py.

00086                         :                
00087         for tagName, dataName in self.tag_data_locations.items():
00088             tagHeader = evt[tagName]  # tagName == tagPath
00089             if not tagHeader:
00090                 continue  # skip non-coinc events
00091             else:
00092                 myData = self.getTag(tagName).getData(dataName)
00093                 self.SaveADCoincData(myData, tagHeader)
00094                 self.tagIt(tagName)
00095                 break  # the AD conic tags are exclusive
00096     
def Tagger::CoincTagger::ADCoincData::ADCoincData::SaveADCoincData (   self,
  myData,
  tagHeader 
)
Keyword arguments:
    myData -- the Data object defined in UserTagging.Models
    tagHeader -- the AD coincidence UserTag object

Definition at line 98 of file ADCoincData.py.

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

Member Data Documentation

Definition at line 25 of file ADCoincData.py.

Definition at line 25 of file ADCoincData.py.

Definition at line 25 of file ADCoincData.py.

Definition at line 36 of file ADCoincData.py.

Definition at line 36 of file ADCoincData.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