367 def run(self, absent=False):
368 ntFileName = self.getFileName(
'-nt.root',
'BeamSpotNt')
369 dataQualityDbFileName = self.getFileName(
'-dqflags.db')
371 if os.path.exists(
'/'.
join([self.taskDir,dataQualityDbFileName])):
372 self.logExec(
'cd %s; rm -f %s' % (self.taskDir,dataQualityDbFileName))
374 if os.path.exists(
'/'.
join([self.taskDir,ntFileName])):
375 cmd =
'cd %s; dqBeamSpot.py -b %s -o %s %s' % (self.taskDir,
'-a' if absent
else '',dataQualityDbFileName,ntFileName)
376 status = self.logExec(cmd,doPrint=
True,abortOnError=
False)
379 raise PostProcessingError(
'ERROR in postprocessing step DQBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
382 self.addResult(dataQualityDbFileName)
384 dataQualityTxtFileName = dataQualityDbFileName.replace(
'.db',
'.txt')
385 cmd =
'grep -c "ID_BS_NOBEAMSPOT" %s/%s' % (self.taskDir, dataQualityTxtFileName)
386 status,out = subprocess.getstatusoutput(cmd)
392 raise PostProcessingError(
'ERROR in postprocessing step DQBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
395 link=
'<a class="ok" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
397 link=
'<a class="bad" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
399 resultLinks = self.taskDict[
'RESULTLINKS']
400 if resultLinks.find(link)==-1:
401 resultLinks =
' '.
join([resultLinks, link])
404 self.taskman.setValue(self.dsName,self.taskName,
'RESULTLINKS',resultLinks)
406 raise PostProcessingError(
'ERROR: No ntuple file %s - did BeamSpotNt step run?\n' % ntFileName,self.executedSteps)