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

Public Member Functions

def run (self)
 
def run (self, absent=False)
 

Detailed Description

Automatically determine DQ info (after uploading beamspot).  For reprocessing also upload absent defects to remove previosuly set ones

Definition at line 408 of file BeamSpotPostProcessing.py.

Member Function Documentation

◆ run() [1/2]

def python.BeamSpotPostProcessing.DQBeamSpotReproc.run (   self)

Definition at line 410 of file BeamSpotPostProcessing.py.

410  def run(self):
411  return DQBeamSpot.run(self, absent=True)
412 

◆ run() [2/2]

def python.BeamSpotPostProcessing.DQBeamSpot.run (   self,
  absent = False 
)
inherited

Definition at line 367 of file BeamSpotPostProcessing.py.

367  def run(self, absent=False):
368  ntFileName = self.getFileName('-nt.root','BeamSpotNt')
369  dataQualityDbFileName = self.getFileName('-dqflags.db')
370 
371  if os.path.exists('/'.join([self.taskDir,dataQualityDbFileName])):
372  self.logExec('cd %s; rm -f %s' % (self.taskDir,dataQualityDbFileName))
373 
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)
377 
378  if status:
379  raise PostProcessingError('ERROR in postprocessing step DQBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
380 
381  # Add DQ flags to results and do linking
382  self.addResult(dataQualityDbFileName)
383 
384  dataQualityTxtFileName = dataQualityDbFileName.replace('.db','.txt')
385  cmd = 'grep -c "ID_BS_NOBEAMSPOT" %s/%s' % (self.taskDir, dataQualityTxtFileName)
386  status,out = subprocess.getstatusoutput(cmd)
387 
388  # Catch errors (do it this way as the exit codes from grep are nasty)
389  try:
390  nRed=int(out)
391  except ValueError:
392  raise PostProcessingError('ERROR in postprocessing step DQBeamSpot while executing:\n\n%s\n' % (cmd),self.executedSteps)
393 
394  if nRed==0:
395  link='<a class="ok" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
396  else:
397  link='<a class="bad" href="../files?u=%s/%s/%s-dqflags.txt">DQFlags</a>' % (self.dsName,self.taskName,self.baseNameStep)
398 
399  resultLinks = self.taskDict['RESULTLINKS']
400  if resultLinks.find(link)==-1:
401  resultLinks = ' '.join([resultLinks, link])
402 
403  # Set links by hand
404  self.taskman.setValue(self.dsName,self.taskName,'RESULTLINKS',resultLinks)
405  else:
406  raise PostProcessingError('ERROR: No ntuple file %s - did BeamSpotNt step run?\n' % ntFileName,self.executedSteps)
407 

The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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