ATLAS Offline Software
Public Member Functions | List of all members
python.BeamSpotPostProcessing.AveBeamSpot Class Reference
Inheritance diagram for python.BeamSpotPostProcessing.AveBeamSpot:
Collaboration diagram for python.BeamSpotPostProcessing.AveBeamSpot:

Public Member Functions

def run (self)
 

Detailed Description

Definition at line 245 of file BeamSpotPostProcessing.py.

Member Function Documentation

◆ run()

def python.BeamSpotPostProcessing.AveBeamSpot.run (   self)

Definition at line 246 of file BeamSpotPostProcessing.py.

246  def run(self):
247  ntFileName = self.getFileName('-nt.root','BeamSpotNt')
248  beamSpotDbFileName = self.getFileName('-beamspot.db')
249  #dataQualityDbFileName = self.getFileName('-dqflags.db')
250 
251  if os.path.exists('/'.join([self.taskDir,beamSpotDbFileName])):
252  self.logExec('cd %s; rm -f %s' % (self.taskDir,beamSpotDbFileName))
253  #if os.path.exists('/'.join([self.taskDir,dataQualityDbFileName])):
254  # self.logExec('cd %s; rm -f %s' % (self.taskDir,dataQualityDbFileName))
255 
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)
258  #cmd = 'cd %s; aveBeamSpot.py -b -o %s %s' % (self.taskDir,beamSpotDbFileName,ntFileName)
259  #cmd = 'cd %s; aveBeamSpot.py -b -o %s -d %s %s' % (self.taskDir,beamSpotDbFileName,dataQualityDbFileName,ntFileName)
260  status = self.logExec(cmd,doPrint=True,abortOnError=False)
261  if status and status!=2 and status!=3:
262  # Some other error than simply no beam spot data
263  raise PostProcessingError('ERROR in postprocessing step AveBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
264  resultLinks = self.taskDict['RESULTLINKS']
265  if status==0:
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])
270  if status==2:
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])
274  if status==3:
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])
278 
279 # # Add DQ flags to results and do linking
280 # self.addResult(dataQualityDbFileName)
281 #
282 # dataQualityTxtFileName = dataQualityDbFileName.replace('.db','.txt')
283 # stat,out = subprocess.getstatusoutput('grep -c "ID_BS_NOBEAMSPOT" %s/%s' % (self.taskDir, dataQualityTxtFileName) )
284 #
285 # # Catch errors (do it this way as the exit codes from grep are nasty)
286 # try:
287 # nRed=int(out)
288 # except ValueError:
289 # raise PostProcessingError('ERROR in postprocessing step AveBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
290 #
291 # if nRed==0:
292 # link='<a class="ok" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
293 # else:
294 # link='<a class="bad" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
295 #
296 # if resultLinks.find(link)==-1:
297 # resultLinks = ' '.join([resultLinks, link])
298 
299  # Set links by hand
300  self.taskman.setValue(self.dsName,self.taskName,'RESULTLINKS',resultLinks)
301  else:
302  raise PostProcessingError('ERROR: No ntuple file %s - did BeamSpotNt step run?\n' % ntFileName,self.executedSteps)
303 
304 

The documentation for this class was generated from the following file:
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10