247 ntFileName = self.getFileName(
'-nt.root',
'BeamSpotNt')
248 beamSpotDbFileName = self.getFileName(
'-beamspot.db')
251 if os.path.exists(
'/'.
join([self.taskDir,beamSpotDbFileName])):
252 self.logExec(
'cd %s; rm -f %s' % (self.taskDir,beamSpotDbFileName))
256 if os.path.exists(
'/'.
join([self.taskDir,ntFileName])):
257 cmd =
'cd %s; beamspotnt.py --tag=%s -f %s --newave ave' % (self.taskDir,beamSpotDbFileName[:-3],ntFileName)
260 status = self.logExec(cmd,doPrint=
True,abortOnError=
False)
261 if status
and status!=2
and status!=3:
263 raise PostProcessingError(
'ERROR in postprocessing step AveBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
264 resultLinks = self.taskDict[
'RESULTLINKS']
266 self.addResult(beamSpotDbFileName)
267 link =
'<a class="ok" href="../files/?u=%s/%s/%s.log">Beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
268 if resultLinks.find(link)==-1:
269 resultLinks =
' '.
join([link,resultLinks])
271 link =
'<a class="warn" href="../files/?u=%s/%s/%s.log">No beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
272 if resultLinks.find(link)==-1:
273 resultLinks =
' '.
join([link,resultLinks])
275 link =
'<a class="warn" href="../files/?u=%s/%s/%s.log">No vtx/beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
276 if resultLinks.find(link)==-1:
277 resultLinks =
' '.
join([link,resultLinks])
300 self.taskman.setValue(self.dsName,self.taskName,
'RESULTLINKS',resultLinks)
302 raise PostProcessingError(
'ERROR: No ntuple file %s - did BeamSpotNt step run?\n' % ntFileName,self.executedSteps)