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

List of all members.

Public Member Functions

def __init__
def initialize
def initReadoutHeader
def execute
def writeReadoutHeader
def finalize

Public Attributes

 HeaderList
 cableSvc
 firstEntry
 tesTree
 hasRo
 roTimeSec
 roTimeNanoSec
 hasReadout
 roSite
 roDetector
 roTriggerNumber
 roTriggerTimeSec
 roTriggerTimeNanoSec
 nRoChannels
 nRoTdcs
 nRoAdcs
 maxRoTdcs
 roBoard
 roConnector
 roTdc
 maxRoAdcs
 roAdcClock
 roAdc
 roPed
 roAdcGain
 roRing
 roColumn

Detailed Description

Definition at line 27 of file RawEventTree.py.


Constructor & Destructor Documentation

def RawEventTree::TesToTreeAlg::__init__ (   self,
  name 
)

Definition at line 29 of file RawEventTree.py.

00030                            :
00031         DybPythonAlg.__init__(self,name)
00032         # List of headers in output tree
00033         self.HeaderList = ["Readout"]
00034         return


Member Function Documentation

def RawEventTree::TesToTreeAlg::initialize (   self)

Definition at line 35 of file RawEventTree.py.

00036                         :
00037         status = DybPythonAlg.initialize(self)
00038         if status.isFailure(): return status
00039         self.info("initialize")
00040 
00041         # Cable Service: This service provides a mapping between
00042         # electronics channels and pmts in the detector.
00043         self.cableSvc = self.svc('ICableSvc','CableSvc')
00044         if self.cableSvc == None:
00045             self.error("Failed to get CableSvc")
00046             return FAILURE
00047         
00048         self.firstEntry = True
00049         
00050         self.tesTree= TTree("eventTree","Event data converted to ROOT Tree")
00051 
00052         self.initReadoutHeader()
00053 
00054         self.stats['/file0/event/eventTree'] = self.tesTree
00055         return SUCCESS

def RawEventTree::TesToTreeAlg::initReadoutHeader (   self)

Definition at line 56 of file RawEventTree.py.

00057                                :
00058         # ReadoutEvent Data
00059         self.hasRo = array('i',[0])
00060         self.roTimeSec = array('i',[0])
00061         self.roTimeNanoSec = array('i',[0])
00062         self.hasReadout = array('i',[0])
00063         self.roSite = array('i',[0])
00064         self.roDetector = array('i',[0])
00065         self.roTriggerNumber = array('i',[0])
00066         self.roTriggerTimeSec = array('i',[0])
00067         self.roTriggerTimeNanoSec = array('i',[0])
00068         self.nRoChannels = array('i',[0])
00069         self.nRoTdcs = array('i',[0])
00070         self.nRoAdcs = array('i',[0])
00071         self.maxRoTdcs = 4096
00072         self.roBoard = array('i',self.maxRoTdcs*[0])
00073         self.roConnector = array('i',self.maxRoTdcs*[0])
00074         self.roTdc = array('i',self.maxRoTdcs*[0])
00075         self.maxRoAdcs = 4096
00076         self.roAdcClock = array('i',self.maxRoAdcs*[0])
00077         self.roAdc = array('i',self.maxRoAdcs*[0])
00078         self.roPed = array('i',self.maxRoAdcs*[0])
00079         self.roAdcGain = array('i',self.maxRoAdcs*[0])
00080         self.roRing = array('i',self.maxRoTdcs*[0])
00081         self.roColumn = array('i',self.maxRoTdcs*[0])
00082         
00083         self.tesTree.Branch('hasReadoutHeader',self.hasRo,'hasReadoutHeader/I')
00084         self.tesTree.Branch('roTimeSec',self.roTimeSec,'roTimeSec/I')
00085         self.tesTree.Branch('roTimeNanoSec',self.roTimeNanoSec,
00086                             'roTimeNanoSec/I')
00087         self.tesTree.Branch('hasReadout',self.hasReadout,'hasReadout/I')
00088         self.tesTree.Branch('site',self.roSite,'site/I')
00089         self.tesTree.Branch('detector',self.roDetector,'detector/I')
00090         self.tesTree.Branch('triggerNumber',self.roTriggerNumber,
00091                             'triggerNumber/I')
00092         self.tesTree.Branch('triggerTimeSec',self.roTriggerTimeSec,
00093                             'triggerTimeSec/I')
00094         self.tesTree.Branch('triggerTimeNanoSec',self.roTriggerTimeNanoSec,
00095                             'triggerTimeNanoSec/I')
00096         self.tesTree.Branch('nChannels',self.nRoChannels,'nChannels/I')
00097         self.tesTree.Branch('nTdcs',self.nRoTdcs,'nTdcs/I')
00098         self.tesTree.Branch('nAdcs',self.nRoAdcs,'nAdcs/I')
00099         self.tesTree.Branch('board',self.roBoard,'board[nTdcs]/I')
00100         self.tesTree.Branch('connector',self.roConnector,
00101                             'connector[nTdcs]/I')
00102         self.tesTree.Branch('tdc',self.roTdc,'tdc[nTdcs]/I')
00103         self.tesTree.Branch('adcClock',self.roAdcClock,
00104                             'adcClock[nAdcs]/I')
00105         self.tesTree.Branch('adcGain',self.roAdcGain,
00106                             'adcGain[nAdcs]/I')
00107         self.tesTree.Branch('adc',self.roAdc,'adc[nAdcs]/I')
00108         self.tesTree.Branch('ped',self.roPed,'ped[nAdcs]/I')
00109         self.tesTree.Branch('ring',self.roRing,'ring[nTdcs]/I')
00110         self.tesTree.Branch('column',self.roColumn,
00111                             'column[nTdcs]/I')

def RawEventTree::TesToTreeAlg::execute (   self)

Definition at line 112 of file RawEventTree.py.

00113                      :
00114         self.info("executing")
00115 
00116         self.writeReadoutHeader()
00117 
00118         self.tesTree.Fill()
00119         self.firstEntry = False
00120         return SUCCESS

def RawEventTree::TesToTreeAlg::writeReadoutHeader (   self)

Definition at line 121 of file RawEventTree.py.

00122                                 :
00123         # ReadoutEvent Data
00124         self.hasRo[0] = 0
00125         self.roTimeSec[0] = 0
00126         self.roTimeNanoSec[0] = 0
00127         self.hasReadout[0] = 0
00128         self.roSite[0] = 0
00129         self.roDetector[0] = 0
00130         self.roTriggerNumber[0] = 0
00131         self.roTriggerTimeSec[0] = 0
00132         self.roTriggerTimeNanoSec[0] = 0
00133         self.nRoChannels[0] = 0
00134         self.nRoTdcs[0] = 0
00135         self.nRoAdcs[0] = 0
00136 
00137         evt = self.evtSvc()
00138         # ReadoutEvent Data
00139         roHdr = evt["/Event/Readout/ReadoutHeader"]
00140         if roHdr != None:
00141             self.hasRo[0] = 1
00142             self.roTimeSec[0] = roHdr.timeStamp().GetSec()
00143             self.roTimeNanoSec[0] = roHdr.timeStamp().GetNanoSec()
00144             svcMode = ServiceMode( roHdr.context(), 0 )
00145             readout = roHdr.readout()
00146             if readout != None:
00147                 self.hasReadout[0] = 1
00148                 self.roSite[0] = readout.detector().site()
00149                 detId = readout.detector().detectorId()
00150                 self.roDetector[0] = detId
00151                 self.roTriggerNumber[0] = readout.triggerNumber()
00152                 trigTime = readout.triggerTime()
00153                 self.roTriggerTimeSec[0] = trigTime.GetSec()
00154                 self.roTriggerTimeNanoSec[0] = trigTime.GetNanoSec()
00155                 if (detId == DetectorId.kAD1 or
00156                     detId == DetectorId.kAD2 or
00157                     detId == DetectorId.kAD3 or
00158                     detId == DetectorId.kAD4):
00159                     nRoChannels = 0
00160                     nRoTdcs = 0
00161                     nRoAdcs = 0
00162                     for channelPair in readout.channelReadout():
00163                         channel = channelPair.second
00164                         chanId = channel.channelId()
00165                         for tdcIdx in range( channel.size() ):
00166                             self.roBoard[nRoTdcs] = chanId.board()
00167                             self.roConnector[nRoTdcs] = chanId.connector()
00168                             self.roTdc[nRoTdcs] = channel.tdc( tdcIdx )
00169                             self.roAdc[nRoAdcs] = channel.adc( tdcIdx )
00170                             self.roPed[nRoAdcs] = channel.pedestal( tdcIdx )
00171                             self.roAdcGain[nRoAdcs] = channel.adcRange( tdcIdx )
00172                             self.roAdcClock[nRoAdcs] = channel.adcCycle( tdcIdx )
00173                             # PMT Ring and Column
00174                             pmtId = self.cableSvc.adPmtSensor(chanId, svcMode)
00175                             self.roRing[nRoTdcs] = pmtId.ring()
00176                             self.roColumn[nRoTdcs] = pmtId.column()
00177                             nRoTdcs += 1
00178                             nRoAdcs += 1
00179                         nRoChannels += 1
00180                     self.nRoChannels[0] = nRoChannels
00181                     self.nRoTdcs[0] = nRoTdcs
00182                     self.nRoAdcs[0] = nRoAdcs
00183         return
        
def RawEventTree::TesToTreeAlg::finalize (   self)

Definition at line 184 of file RawEventTree.py.

00184                       :        
00185         self.info("finalizing")
00186         status = DybPythonAlg.finalize(self)
00187         return status
00188 

Member Data Documentation

Definition at line 29 of file RawEventTree.py.

Definition at line 35 of file RawEventTree.py.

Definition at line 35 of file RawEventTree.py.

Definition at line 35 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.py.

Definition at line 56 of file RawEventTree.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:34 for Quickstart by doxygen 1.7.4