#!/usr/bin/env python2 # # Author: Nick Hastings # from os import path from ProcessDataDaemon import ProcessDateDirDataDaemon class DataQualityD(ProcessDateDirDataDaemon): """ Daemon to submit jobs to analyse the pedestal trigger events """ ProcessDateDirDataDaemon.conffile = path.expanduser('~/run/config/dq-dnd.cfg' ) def mkCommand( self, infile ): fgd_rootfile = self.mkOutNameDateDir( infile, 'fgd', 'dq-fgd-dn' ) c = 'source %s\n' % self.pars['setupfile'] c+= 'env\n' c+= 'CalibOffline_peddataquality.exe -r' c+= ' -O fgd-dn-root-file=' + fgd_rootfile c+= ' ' + infile self.command = c # Check if the infile is really ready and not still being generated def checkFile( self, infile ): infile_donefile = infile[:infile.rfind( self.pars['inext'] )] + 'done' return path.exists( infile_donefile ) if __name__ == '__main__': d = DataQualityD()