245 ntFileName = self.getFileName('-nt.root','BeamSpotNt')
246 beamSpotDbFileName = self.getFileName('-beamspot.db')
247
248
249 if os.path.exists('/'.join([self.taskDir,beamSpotDbFileName])):
250 self.logExec('cd %s; rm -f %s' % (self.taskDir,beamSpotDbFileName))
251
252
253
254 if os.path.exists('/'.join([self.taskDir,ntFileName])):
255 cmd = 'cd %s; beamspotnt.py --tag=%s -f %s --newave ave' % (self.taskDir,beamSpotDbFileName[:-3],ntFileName)
256
257
258 status = self.logExec(cmd,doPrint=True,abortOnError=False)
259 if status and status!=2 and status!=3:
260
261 raise PostProcessingError('ERROR in postprocessing step AveBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
262 resultLinks = self.taskDict['RESULTLINKS']
263 if status==0:
264 self.addResult(beamSpotDbFileName)
265 link = '<a class="ok" href="../files/?u=%s/%s/%s.log">Beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
266 if resultLinks.find(link)==-1:
267 resultLinks = ' '.join([link,resultLinks])
268 if status==2:
269 link = '<a class="warn" href="../files/?u=%s/%s/%s.log">No beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
270 if resultLinks.find(link)==-1:
271 resultLinks = ' '.join([link,resultLinks])
272 if status==3:
273 link = '<a class="warn" href="../files/?u=%s/%s/%s.log">No vtx/beam spot</a>' % (self.dsName,self.taskName,self.baseNameStep)
274 if resultLinks.find(link)==-1:
275 resultLinks = ' '.join([link,resultLinks])
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298 self.taskman.setValue(self.dsName,self.taskName,'RESULTLINKS',resultLinks)
299 else:
300 raise PostProcessingError('ERROR: No ntuple file %s - did BeamSpotNt step run?\n' % ntFileName,self.executedSteps)
301
302