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

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 cableSvc

Detailed Description

Definition at line 10 of file PlotOneFrame.py.


Constructor & Destructor Documentation

def RollingGainAuto::PlotOneFrame::PlotOneframe::__init__ (   self,
  name 
)

Definition at line 11 of file PlotOneFrame.py.

00012                            :
00013         print "Make PlotOneframe:",name
00014         DybPythonAlg.__init__(self,name)


Member Function Documentation

def RollingGainAuto::PlotOneFrame::PlotOneframe::initialize (   self)

Definition at line 15 of file PlotOneFrame.py.

00016                         :
00017         print "Init PlotOneframe:",self.name()
00018         status = DybPythonAlg.initialize(self)
00019         if status.isFailure(): return status
00020 
00021         # Cable Svc, that is all this needs
00022         from DataSvc.DataSvcConf import StaticCableSvc
00023         self.cableSvc = self.svc('ICableSvc','CableSvc')
00024 
00025         # Init context and svc mode
00026         from GaudiPython import gbl
00027         context = gbl.Context()
00028         context.SetSite(gbl.Site.kAll)
00029         context.SetSimFlag(1)   # data
00030         context.SetDetId(gbl.DetectorId.kAll)        
00031         context.SetTimeStamp(gbl.TimeStamp(1300000000,0))   # To do: Need to figure out the time more smartly
00032         svcMode = gbl.ServiceMode(context,0);
00033 
00034         # Get pmt sensor <-> cable map
00035         adPmtSensors = self.cableSvc.adPmtSensors(svcMode)
00036         poolPmtSensors = self.cableSvc.poolPmtSensors(svcMode);
00037         print "\n\n number of AD PMT sensors =",adPmtSensors.size()
00038         print "\n\n number of pool PMT sensors =",poolPmtSensors.size()
00039 
00040         # Load one calbration table
00041         from Table import Table
00042         table = Table()
00043         table.read("../0017268-0017268/Rolling01/pmtDataTable_01.txt")
00044 
00045         # Create a TTree to hold all useful variables
00046         from CalibTree import CalibTree
00047         calibt = CalibTree("frame.root")
00048 
00049         for rowIdx in range(table.nRows):
00050             calibt.reset()
00051             calibt.Time[0] = 0
00052 
00053             pmtId = gbl.DayaBay.DetectorSensor( int(table.columns['pmtID'][rowIdx]) )
00054             calibt.Site[0] = pmtId.site()
00055             calibt.Detector[0] = pmtId.detectorId()
00056 
00057             channelId = self.cableSvc.elecChannelId( pmtId, svcMode )
00058             calibt.Board[0] = channelId.board()
00059             calibt.Channel[0] = channelId.connector()
00060             
00061             if pmtId.isAD():
00062                 adPmtId = gbl.DayaBay.AdPmtSensor( int(table.columns['pmtID'][rowIdx]) )
00063                 calibt.Ring[0] = adPmtId.ring()
00064                 calibt.Column[0] = adPmtId.column()
00065 
00066             if pmtId.isWaterShield():
00067                 poolPmtId = gbl.DayaBay.PoolPmtSensor( int(table.columns['pmtID'][rowIdx]) )
00068                 calibt.Wall[0] = poolPmtId.wallNumber()
00069                 calibt.Spot[0] = poolPmtId.wallSpot()
00070                 calibt.Inward[0] = poolPmtId.inwardFacing()
00071                                                     
00072             calibt.Spe[0]      = float( table.columns['speHigh'][rowIdx]    )
00073             calibt.SpeErr[0]   = float( table.columns['gainErr'][rowIdx]    )
00074             calibt.SpeSigma[0] = float( table.columns['sigmaSpe'][rowIdx]   )
00075             calibt.Ped[0]      = float( table.columns['preAdc'][rowIdx]     )
00076             calibt.PedErr[0]   = float( table.columns['preAdcErr'][rowIdx]  )
00077             calibt.Chi2ndf[0]  = float( table.columns['chi2ndf'][rowIdx]    )
00078             calibt.FitStat[0]  = int( table.columns['fitStat'][rowIdx]      )
00079 
00080             calibt.DarkRate[0]      = float( table.columns['darkRate'][rowIdx]     )
00081             calibt.DarkRateErr[0]   = float( table.columns['darkRateErr'][rowIdx]  )
00082             calibt.ElecRate[0]      = float( table.columns['elecNoiseRate'][rowIdx]     )
00083             calibt.ElecRateErr[0]   = float( table.columns['elecNoiseRateErr'][rowIdx]  )
00084             
00085             calibt.fill()
00086 
00087         calibt.close()
00088         return SUCCESS

def RollingGainAuto::PlotOneFrame::PlotOneframe::execute (   self)

Definition at line 89 of file PlotOneFrame.py.

00090                      :
00091         return SUCCESS

def RollingGainAuto::PlotOneFrame::PlotOneframe::finalize (   self)

Definition at line 92 of file PlotOneFrame.py.

00093                       :
00094         status = DybPythonAlg.finalize(self)
00095         return status


Member Data Documentation

Definition at line 15 of file PlotOneFrame.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:59:50 for RollingGainAuto by doxygen 1.7.4