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

List of all members.

Public Member Functions

def __init__
def AddReference
def GetReference
def InitReference
def ErrorCheck
def initialize
def execute
def finalize

Public Attributes

 runMode
 PsOutput
 dbiTable
 RefInitOpt
 CommitMode
 RefInit
 Reference
 FeeIds
 cableSvc
 PmtCalibSvc

Detailed Description

Definition at line 31 of file ScanFrames.py.


Constructor & Destructor Documentation

def RollingGainAuto::ScanFrames::ScanFrames::__init__ (   self,
  name 
)

Definition at line 32 of file ScanFrames.py.

00033                            :
00034         DybPythonAlg.__init__(self,name)
00035 
00036         #self.runMode = "DbCommit"
00037         #self.runMode = "ErrorCheck"
00038         self.runMode = modeRun
00039         #self.PsOutput = True
00040         self.PsOutput = outputPs
00041         self.dbiTable = "CalibPmtFineGain"
00042         self.RefInitOpt = "Nominal"
00043         self.CommitMode = "Append"
00044         #self.CommitMode = "Insert"
00045         # Keep a record on each detector reference's initialization status
00046         DetId = gbl.DetectorId
00047         self.RefInit   = { DetId.kAD1:False, DetId.kAD2:False, DetId.kAD3:False, DetId.kAD4:False,
00048                            DetId.kIWS:False, DetId.kOWS:False }
00049         self.Reference = dict()
00050         self.FeeIds = dict()
00051         


Member Function Documentation

def RollingGainAuto::ScanFrames::ScanFrames::AddReference (   self,
  feeIdData,
  gainStat 
)

Definition at line 52 of file ScanFrames.py.

00053                                                  :
00054         self.Reference[ feeIdData ] = gainStat
00055         return

def RollingGainAuto::ScanFrames::ScanFrames::GetReference (   self,
  feeIdData 
)

Definition at line 56 of file ScanFrames.py.

00057                                        :
00058         if self.Reference.has_key( feeIdData ):
00059             return self.Reference[ feeIdData ]
00060         else:
00061             default = GainStatus("default")
00062             default.Nominal()
00063             return default
        
def RollingGainAuto::ScanFrames::ScanFrames::InitReference (   self,
  detId,
  svcMode 
)

Definition at line 64 of file ScanFrames.py.

00065                                              :
00066         self.RefInit[ detId ] = True
00067         # Initialize the refereces of all PMTs for this detector
00068         FeeIdList = self.cableSvc.feeChannelIds( svcMode )
00069         self.FeeIds[ detId ] = FeeIdList
00070         print "Info:    Init detector ",detId,FeeIdList.size()," PMTs with ",self.RefInitOpt," values"
00071 
00072         DetId = gbl.DetectorId
00073         for feeId in FeeIdList:
00074 
00075             reference = GainStatus("reference")
00076             
00077             if self.RefInitOpt == "DB":
00078                 FineGainCalibData = self.PmtCalibSvc.fineGainCalibData( feeId, svcMode )
00079                 # AD
00080                 if DetId.isAD( detId ):
00081                     adPmtId = self.cableSvc.adPmtSensor( feeId, svcMode )
00082                     PmtCalibData  = self.PmtCalibSvc.pmtCalibData( adPmtId, svcMode )
00083                 # PMT
00084                 if DetId.isWaterShield( detId ):
00085                     poolPmtId = self.cableSvc.adPmtSensor( feeId, svcMode )
00086                     PmtCalibData  = self.PmtCalibSvc.pmtCalibData( poolPmtId, svcMode )
00087                     
00088                 reference.FeeId        = feeId
00089                 reference.PmtId        = self.cableSvc.sensor( feeId, svcMode )
00090                 reference.SpeHigh      = -999
00091                 reference.SpeHighErr   = -999
00092                 reference.SpeHighSigma = -999
00093                 reference.Chi2ndf      = -999
00094 
00095                 if FineGainCalibData:
00096                     reference.Status       = FineGainCalibData.m_status
00097                     reference.SpeHigh      = FineGainCalibData.m_speHigh
00098                     reference.SpeHighErr   = FineGainCalibData.m_speHighError
00099                     reference.SpeHighSigma = FineGainCalibData.m_sigmaSpeHigh
00100                     reference.Chi2ndf      = FineGainCalibData.m_speHighFitQual
00101 
00102                     
00103                 elif PmtCalibData:
00104                     # PmtCalibSvc is in DataSvc/ICalibDataSvc.h
00105                     reference.Status       = PmtCalibData.m_status
00106                     reference.SpeHigh      = PmtCalibData.m_speHigh
00107                     reference.SpeHighErr   = 0
00108                     reference.SpeHighSigma = PmtCalibData.m_sigmaSpeHigh
00109                     reference.Chi2ndf      = 0
00110 
00111                 else:
00112                     print "warning:  no reference value"
00113                     reference.Nominal()
00114 
00115             elif self.RefInitOpt == "Nominal":
00116                 reference.FeeId        = feeId
00117                 reference.PmtId        = self.cableSvc.sensor( feeId, svcMode )
00118                 reference.Nominal()
00119                 
00120             self.AddReference( feeId.fullPackedData(), reference )

def RollingGainAuto::ScanFrames::ScanFrames::ErrorCheck (   self,
  feeIdData,
  reference,
  thisCalib,
  statistic,
  fitStat,
  status 
)
    Return True for an error, then it will consider to use the reference value

Definition at line 121 of file ScanFrames.py.

00123                                                :
00124         '''
00125             Return True for an error, then it will consider to use the reference value
00126         '''
00127 
00128         if status!=1 or fitStat!=0 :
00129             return True
00130 
00131         feeId = gbl.DayaBay.FeeChannelId( feeIdData )
00132         DetId = gbl.DetectorId
00133         if feeId.detectorId() == DetId.kIWS:
00134             if statistic < 1000:
00135                 return True
00136         else:
00137             if statistic <2000:
00138                 return True
00139 
00140         # Change's detected
00141         if abs( thisCalib - reference.SpeHigh ) > 2.5:
00142             # No reference. This is not an error.
00143             if reference.SpeHigh<0:
00144                 return False
00145 
00146             # A few channels, due to occasional noise, should use reference value
00147             if feeIdData==67176193:  # FarAD1_R01_C03
00148                 return True
00149 
00150             # For most of the time, this is normal
00151             # No special treatment is needed. 
00152             return False
00153         
00154         return False
        
def RollingGainAuto::ScanFrames::ScanFrames::initialize (   self)

Definition at line 155 of file ScanFrames.py.

00156                         :
00157         print "Info:    Init ScanFrames:",self.name()
00158         status = DybPythonAlg.initialize(self)
00159         if status.isFailure(): return status
00160 
00161         # Scan the result from all these locations. Look for the index file
00162         #objLocations = objLocationsEH1
00163         objLocations = objLocationsEH1
00164 
00165         # Cable Svc, that is all this needs
00166         self.cableSvc = self.svc('ICableSvc','CableSvc')
00167 
00168         # Pmt Calib Svc
00169         self.PmtCalibSvc = self.svc('IPmtCalibSvc','DybPmtCalibSvc')
00170 
00171         # Create a TTree to hold all useful variables
00172         from CalibTree import CalibTree
00173         calibt = CalibTree("frames.root")
00174 
00175         # ======================================
00176         
00177         # 111111111111111111111111111111111111111111111111111111111
00178         # Loop over all 'Master' tables
00179         numFrame = 0
00180         for objDir in objLocations:
00181             indexTable = Table()
00182             masterFile = objDir+'Master.pmtCalibMap.txt'
00183             assert os.path.exists( masterFile ), "path %s does not exist " %masterFile
00184             indexTable.read( masterFile )
00185             print "Info:    processing",masterFile
00186 
00187             # 222222222222222222222222222222222222222222222222222222222
00188             # Loop over all "Frame"s in one master table
00189             for frameIdx in range(indexTable.nRows):
00190                 sites     = int( indexTable.columns['Sites'][frameIdx] )
00191                 startSec  = int( indexTable.columns['StartTimeSec'][frameIdx] )
00192                 startNano = int( indexTable.columns['StartTimeNanoSec'][frameIdx] )
00193                 endSec    = int( indexTable.columns['EndTimeSec'][frameIdx] ) 
00194                 endNano   = int( indexTable.columns['EndTimeNanoSec'][frameIdx] )
00195                 dataTable = objDir+indexTable.columns['map file'][frameIdx]
00196                 assert os.path.exists( dataTable ), "path %s does not exist " %dataTable
00197 
00198                 import time
00199                 ctime = os.path.getmtime( dataTable )
00200                 print "Info:    Begin analyze",dataTable, ctime
00201 
00202                 # Load one calbration table
00203                 table = Table()
00204                 table.read(dataTable)
00205 
00206                 numFrame = numFrame + 1
00207 
00208                 # Error check, file level global check
00209                 # Pre-scan: A table may be rejected by some quality cut (statistics, ...)
00210                 det = (sites&0xff)
00211                 site = (sites&0xff00)>>8
00212                 print det, site
00213                 aveNHits = 0.0
00214                 for rowIdx in range(table.nRows):
00215                     aveNHits = aveNHits + int( table.columns['nhits'][rowIdx])
00216                 aveNHits = aveNHits / table.nRows
00217 
00218                 print "Info:    det =",det," aveHits=",aveNHits
00219                 if det==5:
00220                     if aveNHits<1000: continue
00221                 else:
00222                     if aveNHits<3000: continue
00223 
00224                 import datetime
00225                 time = datetime.datetime.fromtimestamp( startSec )
00226                 print 'Info:    Accepted: frame ',numFrame, time 
00227 
00228                 # Get reference values for error check and error restore
00229                 # Init context and svc mode
00230                 from GaudiPython import gbl
00231                 context = gbl.Context()
00232                 context.SetSite( site )
00233                 context.SetDetId( det )
00234                 context.SetSimFlag(1)   # data
00235                 context.SetTimeStamp( gbl.TimeStamp( startSec,0 ) )
00236                 svcMode = gbl.ServiceMode( context,0 )
00237 
00238                 # Need init everytime since cable map can change
00239                 #if not self.RefInit[ det ]: 
00240                 self.InitReference( det, svcMode )
00241                 
00242                 # 333333333333333333333333333333333333333333333333333333333
00243                 # Loop over all channels in one frame
00244                 # Initializa all to reference values
00245                 GainDict = dict()
00246                 FeeList = self.FeeIds[det]                
00247                 for feeId in FeeList:
00248                     reference = self.GetReference( feeId.fullPackedData() )
00249                     reference.PmtId = self.cableSvc.sensor( feeId, svcMode )
00250                     GainDict[ feeId.fullPackedData() ] = reference
00251                 
00252                 # Formal scan
00253                 for rowIdx in range(table.nRows):
00254                     calibt.reset()
00255                     calibt.Frame[0] = numFrame
00256                     calibt.Time[0] = (startSec+endSec)/2.0
00257 
00258                     # For later tables, channelID is also written out. Use this by default
00259                     DetId = gbl.DetectorId
00260                     if "channelID" in table.columns:
00261                         feeChannelId = gbl.DayaBay.FeeChannelId( int(table.columns['channelID'][rowIdx]) )
00262                         pmtId = self.cableSvc.sensor( feeChannelId, svcMode )
00263                         if DetId.isAD( feeChannelId.detectorId() ):
00264                             adPmtId = self.cableSvc.adPmtSensor( feeChannelId, svcMode)
00265                         if DetId.isWaterShield( feeChannelId.detectorId() ):
00266                             poolPmtId = self.cableSvc.poolPmtSensor( feeChannelId, svcMode)
00267 
00268                     else:
00269                         pmtId = gbl.DayaBay.DetectorSensor( int(table.columns['pmtID'][rowIdx]) )
00270                         if pmtId.isAD():
00271                             adPmtId = gbl.DayaBay.AdPmtSensor( int(table.columns['pmtID'][rowIdx]) )
00272                             feeChannelId = self.cableSvc.feeChannelId( adPmtId, svcMode )
00273                         if pmtId.isWaterShield():
00274                             poolPmtId = gbl.DayaBay.PoolPmtSensor( int(table.columns['pmtID'][rowIdx]) )
00275                             feeChannelId = self.cableSvc.feeChannelId( poolPmtId, svcMode )
00276 
00277                     # get site, det, ring, column, wall, spot and inward
00278                     calibt.Site[0] = pmtId.site()
00279                     calibt.Detector[0] = pmtId.detectorId()
00280 
00281                     if pmtId.isAD():                        
00282                         calibt.Ring[0] = adPmtId.ring()
00283                         calibt.Column[0] = adPmtId.column()
00284                         
00285                     if pmtId.isWaterShield():
00286                         calibt.Wall[0] = poolPmtId.wallNumber()
00287                         calibt.Spot[0] = poolPmtId.wallSpot()
00288                         calibt.Inward[0] = poolPmtId.inwardFacing()
00289                         
00290                     calibt.Board[0] = feeChannelId.board()
00291                     calibt.Channel[0] = feeChannelId.connector()
00292                                                     
00293                     calibt.Spe[0]      = float( table.columns['speHigh'][rowIdx]    )
00294                     calibt.SpeErr[0]   = float( table.columns['gainErr'][rowIdx]    )
00295                     calibt.SpeSigma[0] = float( table.columns['sigmaSpe'][rowIdx]   )
00296                     calibt.Ped[0]      = float( table.columns['preAdc'][rowIdx]     )
00297                     calibt.PedErr[0]   = float( table.columns['preAdcErr'][rowIdx]  )
00298                     calibt.Nhit[0]     = int( table.columns['nhits'][rowIdx]        )
00299                     calibt.Chi2ndf[0]  = float( table.columns['chi2ndf'][rowIdx]    )
00300                     calibt.FitStat[0]  = int( table.columns['fitStat'][rowIdx]      )
00301                     calibt.Status[0]   = int( table.columns['status'][rowIdx]      )
00302 
00303                     calibt.DarkRate[0]      = float( table.columns['darkRate'][rowIdx]     )
00304                     calibt.DarkRateErr[0]   = float( table.columns['darkRateErr'][rowIdx]  )
00305                     calibt.ElecRate[0]      = float( table.columns['elecNoiseRate'][rowIdx]     )
00306                     calibt.ElecRateErr[0]   = float( table.columns['elecNoiseRateErr'][rowIdx]  )
00307 
00308                     if self.runMode=="ErrorCheck" or self.runMode=="DbCommit":
00309 
00310                         # 1. Get reference
00311                         reference = self.GetReference( feeChannelId.fullPackedData() )
00312                         # 2. Error checking
00313                         Error = self.ErrorCheck( feeChannelId.fullPackedData(), reference, calibt.Spe[0],
00314                                                  calibt.Nhit[0], calibt.FitStat[0], calibt.Status[0] )
00315 
00316                         # 3. Recover from error?
00317                         if Error:
00318                             if reference.SpeHigh>0:
00319                                 calibt.Status[0]   = reference.Status
00320                                 calibt.Spe[0]      = reference.SpeHigh
00321                                 calibt.SpeErr[0]   = reference.SpeHighErr
00322                                 calibt.SpeSigma[0] = reference.SpeHighSigma 
00323                                 calibt.Chi2ndf[0]  = reference.Chi2ndf      
00324                                 
00325                             else:
00326                                 calibt.Status[0] = 0
00327                                 
00328                         # 4. Update reference record
00329                         if calibt.Status[0] == 1:
00330                             reference.Status       = calibt.Status[0]   
00331                             reference.SpeHigh      = calibt.Spe[0]      
00332                             reference.SpeHighErr   = calibt.SpeErr[0]   
00333                             reference.SpeHighSigma = calibt.SpeSigma[0] 
00334                             reference.Chi2ndf      = calibt.Chi2ndf[0]  
00335                             self.AddReference( feeChannelId.fullPackedData(), reference )
00336                             
00337                     # OK to fill, either raw data or after error checking            
00338                     calibt.fill()
00339 
00340                     Gain = GainStatus("Good")
00341                     Gain.FeeId        = feeChannelId
00342                     Gain.PmtId        = pmtId
00343                     Gain.Status       = calibt.Status[0]
00344                     Gain.SpeHigh      = calibt.Spe[0]
00345                     Gain.SpeHighErr   = calibt.SpeErr[0]
00346                     Gain.SpeHighSigma = calibt.SpeSigma[0]
00347                     Gain.Chi2ndf      = calibt.Chi2ndf[0]
00348                     GainDict[ feeChannelId.fullPackedData() ] = Gain
00349 
00350                 # Last check is for missing channels
00351                 if len( self.FeeIds[det] ) != len( GainDict ):
00352                     print "Warning: missing channels",len(self.FeeIds[det] ),"vs",len( GainDict )
00353 
00354                 # Put int database
00355                 if self.runMode == "DbCommit":
00356                     StartT = gbl.TimeStamp(startSec, startNano)
00357                     if self.CommitMode == "Append":
00358                         EndT    = gbl.TimeStamp.GetEOT()
00359                     elif self.CommitMode == "Insert":
00360                         EndT    = gbl.TimeStamp(endSec, endNano)
00361                     CalibT = gbl.TimeStamp(ctime,0)
00362                     CommitOne( GainDict, StartT, EndT, self.dbiTable, CalibT, False )
00363         # 3,2,1
00364 
00365         calibt.close()
00366         return SUCCESS

def RollingGainAuto::ScanFrames::ScanFrames::execute (   self)

Definition at line 367 of file ScanFrames.py.

00368                      :
00369         return SUCCESS

def RollingGainAuto::ScanFrames::ScanFrames::finalize (   self)

Definition at line 370 of file ScanFrames.py.

00371                       :
00372         
00373         if not self.PsOutput:
00374             return SUCCESS
00375         
00376         # Draw the ps file
00377         from ROOT import gROOT, gStyle, gDirectory, TCanvas, TFile, TTree, TPad, TLatex, TH2F, TH1F
00378         f = TFile("frames.root", "read")
00379         t = gDirectory.Get( 't' )
00380 
00381         psfile = "frames.ps"
00382 
00383         canv = TCanvas("canv","canv")
00384 
00385         # I should print a cover page
00386         canv.Print(psfile+"[")
00387         # Troublesome title pad
00388         TitlePad = TPad("TitlePad","Title pad",0,0.95,1,1)
00389         TitlePad.Draw()
00390         TitlePad.SetNumber(1)
00391         
00392         # Plots pad
00393         PlotPad  = TPad("PlotPad", "Plot pad",0,0,1,0.95)
00394         PlotPad.Draw()
00395         PlotPad.SetNumber(2)
00396 
00397         startTime = t.GetMinimum("Time")-50000
00398         endTime = t.GetMaximum("Time")+50000
00399         # All kinds of pre-defined histogram and titles
00400         t_rate = "TDC Hit Rate History  "
00401         h_rateHis= TH2F("h_rateHis", t_rate, 500,startTime,endTime, 100,200,900000)
00402         h_rateHis.GetXaxis().SetTimeDisplay(1)
00403         h_rateHis.GetXaxis().SetTimeOffset(8*60*60)
00404         h_rateHis.GetXaxis().SetTimeFormat("%b%d")
00405         h_rateHis.GetXaxis().SetNdivisions(1020)
00406         h_rateHis.GetXaxis().SetTitle("Date (Beijing)")
00407         h_rateHis.GetYaxis().SetTitle("Rate [Hz]")
00408         
00409         t_speH = "Gain History  "
00410         h_speHHis= TH2F("h_speHHis", t_speH,500,startTime,endTime,100,10,30)
00411         h_speHHis.GetXaxis().SetTimeDisplay(1)
00412         h_speHHis.GetXaxis().SetTimeOffset(8*60*60)
00413         h_speHHis.GetXaxis().SetTimeFormat("%b%d")
00414         h_speHHis.GetXaxis().SetNdivisions(1020)
00415         h_speHHis.GetXaxis().SetTitle("Date (Beijing)")
00416         h_speHHis.GetYaxis().SetTitle("SPE [ADC]")
00417         
00418         t_sgsp = "Sigma History "
00419         h_sgspHis= TH2F("h_sgspHis", t_sgsp,500,startTime,endTime,100,1,20)
00420         h_sgspHis.GetXaxis().SetTimeDisplay(1)
00421         h_sgspHis.GetXaxis().SetTimeOffset(8*60*60)
00422         h_sgspHis.GetXaxis().SetTimeFormat("%b%d")
00423         h_sgspHis.GetXaxis().SetNdivisions(1020)
00424         h_sgspHis.GetXaxis().SetTitle("Date (Beijing)")
00425         h_sgspHis.GetYaxis().SetTitle("SPE sigma [ADC]")
00426         
00427         t_sigm = "Sigma/Gain History"
00428         h_sigmHis= TH2F("h_sigmHis", t_sigm,500,startTime,endTime,100,0.1,0.55)
00429         h_sigmHis.GetXaxis().SetTimeDisplay(1)
00430         h_sigmHis.GetXaxis().SetTimeOffset(8*60*60)
00431         h_sigmHis.GetXaxis().SetTimeFormat("%b%d")
00432         h_sigmHis.GetXaxis().SetNdivisions(1020)
00433         h_sigmHis.GetXaxis().SetTitle("Date (Beijing)")
00434         h_sigmHis.GetYaxis().SetTitle("Sigma/SPE")
00435         
00436         cvsTitle = ""
00437         gStyle.SetOptStat(0)
00438         t.SetMarkerStyle(21)
00439         t.SetMarkerSize(0.3)
00440                                 
00441         pagenumber=0
00442 
00443         for det in range(1,7):
00444             if det<=4:
00445                 detName = "AD"+str(det)
00446             if det==5:
00447                 detName = "IWS"
00448             if det==6:
00449                 detName = "OWS"            
00450 
00451             # For all the ADs
00452             entries = t.GetEntries("Detector=="+str(det))
00453             if det<=4 and entries>0:
00454                 baseCut = "Ring>0 && DarkRate>=0 && Status==1"
00455                 div = 12
00456                 for ring in range(1,9):
00457                     for column in range(1,25):
00458                         channel =      baseCut+"&&Detector=="+str(det)+"&&Ring=="+str(ring)+"&&Column=="+str(column)
00459 
00460                         if column<=12:
00461                             channelRange = baseCut+"&&Detector=="+str(det)+"&&Ring=="+str(ring)+"&&Column>=1 &&Column<=12"
00462                         else:
00463                             channelRange = baseCut+"&&Detector=="+str(det)+"&&Ring=="+str(ring)+"&&Column>=13&&Column<=24"
00464                             
00465                         if column%div == 1:
00466                             info = detName+"_Ring_"+str(ring)+"_Column_"+str(column)+"-"+str(column+div-1)
00467                             # Title page
00468                             canv.cd(1)
00469                             pagenumber = pagenumber+1
00470                             cvsTitle = info+"   P."+str(pagenumber)
00471                             print cvsTitle,"   ",channel
00472                             l = TLatex()
00473                             l.DrawLatex(0.65,0.5,"#scale[12]{"+cvsTitle+"}")
00474                             
00475                             # Plots
00476                             # weird root feature, the first does show up.
00477                             PlotPad.Divide(2,2)
00478                             ratePad = PlotPad.cd(1)
00479                             t.Draw("DarkRate:Time>>h_rateHis", channel )
00480                             ratePad.SetLogy()
00481                             PlotPad.cd(2)
00482                             t.Draw("Spe:Time>>h_speHHis", channel )
00483                             PlotPad.cd(3)
00484                             t.Draw("SpeSigma:Time>>h_sgspHis", channel )
00485                             PlotPad.cd(4)
00486                             t.Draw("SpeSigma/Spe:Time>>h_sigmHis", channel )
00487                             
00488                             opt = "PLsame"
00489                         else:
00490                             opt = "PLsame"
00491                             
00492                         color = column%8
00493                         if color==0:
00494                             color = 12
00495                         t.SetMarkerColor( color )
00496                     
00497                         PlotPad.cd(1)
00498                         t.Draw("DarkRate:Time", channel, opt)
00499                         PlotPad.cd(2)
00500                         t.Draw("Spe:Time", channel, opt)                        
00501                         PlotPad.cd(3)
00502                         t.Draw("SpeSigma:Time", channel, opt)
00503                         PlotPad.cd(4)
00504                         t.Draw("SpeSigma/Spe:Time", channel, opt)
00505                         
00506                         
00507                         # print out current one and start a new one
00508                         if column%div == 0:
00509                             canv.Print(psfile)
00510                             TitlePad.Clear()
00511                             PlotPad.Clear()
00512 
00513             # For all the water pool
00514             if det>4 and entries>0:
00515                 baseCut = "DarkRate>=0"
00516                 for wall in range(1,10):
00517                     div = 12
00518                     # Title page
00519                     canv.cd(1)
00520                     pagenumber = pagenumber+1
00521                     info = detName+"_Wall_"+str(wall)
00522                     cvsTitle = info+"   P."+str(pagenumber)
00523                     print cvsTitle
00524                     l = TLatex()
00525                     l.DrawLatex(0.8,0.5,"#scale[12]{"+cvsTitle+"}")
00526                     
00527                     for spot in range(1,25):
00528                         for inward in range(0,2):
00529                             channel = baseCut+"&&Detector=="+str(det)+"&&Wall=="+str(wall)+"&&Spot=="+str(spot)+"&&Inward=="+str(inward)
00530                             if spot==1 and inward==0:
00531                                 # Plots
00532                                 # weird root feature, the first does show up.
00533                                 PlotPad.Divide(2,2)
00534                                 ratePad = PlotPad.cd(1)
00535                                 t.Draw("DarkRate:Time>>h_rateHis", channel )
00536                                 ratePad.SetLogy()
00537                                 PlotPad.cd(2)
00538                                 t.Draw("Spe:Time>>h_speHHis", channel )
00539                                 PlotPad.cd(3)
00540                                 t.Draw("SpeSigma:Time>>h_sgspHis", channel )
00541                                 PlotPad.cd(4)
00542                                 t.Draw("SpeSigma/Spe:Time>>h_sigmHis", channel )
00543                                 opt = "PLsame"
00544                             else:
00545                                 opt = "PLsame"
00546                                 
00547                             color = spot*2+inward
00548                             t.SetMarkerColor( color )
00549                             
00550                             PlotPad.cd(1)
00551                             t.Draw("DarkRate:Time", channel, opt)
00552                             PlotPad.cd(2)
00553                             t.Draw("Spe:Time", channel, opt)
00554                             PlotPad.cd(3)
00555                             t.Draw("SpeSigma:Time", channel, opt)
00556                             PlotPad.cd(4)
00557                             t.Draw("SpeSigma/Spe:Time", channel, opt)
00558                             
00559                     # print a old one
00560                     canv.Print(psfile)
00561                     TitlePad.Clear()
00562                     PlotPad.Clear()
00563                                 
00564         # close ps file
00565         canv.Print(psfile+"]")
00566         
00567         status = DybPythonAlg.finalize(self)
00568         return status    


Member Data Documentation

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 32 of file ScanFrames.py.

Definition at line 155 of file ScanFrames.py.

Definition at line 155 of file ScanFrames.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