/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
FillGoodFile_old::GoodFileTable Class Reference

List of all members.

Public Member Functions

def __init__
def fillGoodFileTable

Public Attributes

 revision
 r is tuple whose element is dictionary, different from MySQLdb

Detailed Description

Get Rate from ROOT file

Definition at line 20 of file FillGoodFile_old.py.


Constructor & Destructor Documentation

def FillGoodFile_old::GoodFileTable::__init__ (   self,
  inputFilename,
  rev 
)

Definition at line 22 of file FillGoodFile_old.py.

00023 :
    #def __init__(self):

Member Function Documentation

def FillGoodFile_old::GoodFileTable::fillGoodFileTable (   self)
Constructor
fill good file table

Definition at line 35 of file FillGoodFile_old.py.

00036                                :
00037         """fill good file table"""
00038         #neutrino flux table
00039 
00040 
00041         #pmt table
00042         # need to consider version here!!
00043         #r=dq_db('SELECT * FROM DqPmt WHERE RunNo=%s and FileNo=%s and Quality!=1' % (self.runNo,self.fileNo))
00044         r=dq_db('SELECT COUNT(SEQNO) FROM DqPmt WHERE RunNo=%s and FileNo=%s and Quality!=1 GROUP BY SEQNO ORDER BY SEQNO DESC LIMIT 1' % (self.runNo,self.fileNo))
00045         #working pmt number
00046         if len(r)==0:# no pmt info yet
00047             #pmt info not yet dumped into DB
00048             status = 'undefined'
00049         elif r[0]['COUNT(SEQNO)']>50:
00050             status = 'bad'
00051         else:
00052             status = 'good'
00053 
00054         #detector table
00055         #r=dq_db('SELECT * FROM DqDetector WHERE RunNo=%s and FileNo=%s' % (self.runNo,self.fileNo))
00056 
00057         #trigger type table
00058 
00059 
00060         #daq raw file table
00061         r=offline_db('SELECT SEQNO,streamType,stream FROM DaqRawDataFileInfo WHERE RunNo=%s and FileNo=%s' % (self.runNo,self.fileNo))
00062         ###  r is tuple whose element is dictionary, different from MySQLdb
00063         tagid = dq_db('SELECT id FROM tags WHERE tag="%s"' % r[0]['streamType'])
00064         tagid = tagid[0]['id']
00065         fileid = r[0]['SEQNO'] #fileid from file table or DaqRawFileInfo?
00066 
00067 
00068         userid = 2  # offline robot
00069         
00070         #obtain revisionid
00071         if self.revision==None:
00072             nuwaVersion = os.getenv('SITEROOT')
00073             nuwaVersion = nuwaVersion.split('/')
00074             nuwaVersion = nuwaVersion[-1]
00075             revision = self.jobVersion+'_'+nuwaVersion
00076         else:
00077             revision = self.revision
00078         r = dq_db('SELECT id FROM revisions WHERE comment="%s"' % revision)
00079         if len(r)==0:
00080             dq_db('INSERT INTO revisions(user_id, comment) VALUES(%s, "%s")' % (userid, revision))
00081         r = dq_db('SELECT id FROM revisions WHERE comment="%s"' % revision)
00082         revisionid = r[0]['id']
00083 
00084         
00085         #fill user_file_tag table
00086         dq_db('INSERT INTO user_file_tag(user_id, file_id, tag_id, status, revision_id) VALUES(%s, %s, %s, "%s", %s)' % (userid, fileid, tagid, status, revisionid))
00087         
00088         #update most_recent file_tag table
00089         r = dq_db('SELECT * FROM most_recent_file_tag WHERE file_id=%s' % fileid)
00090         if len(r)==0:
00091             dq_db('INSERT INTO most_recent_file_tag(file_id, last_status, last_user_id, last_revision_id) VALUES(%s, "%s", %s, %s)' % (fileid, status, userid, revisionid))
00092         else:
00093             dq_db('UPDATE most_recent_file_tag SET last_status="%s", last_user_id=%s, last_date=NOW(), last_revision_id=%s where file_id=%s' % (status, userid, revisionid, fileid))
00094 
        

Member Data Documentation

r is tuple whose element is dictionary, different from MySQLdb

Definition at line 36 of file FillGoodFile_old.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:23 for DQDump by doxygen 1.7.4