ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
rhadd.haddJob Class Reference
Inheritance diagram for rhadd.haddJob:
Collaboration diagram for rhadd.haddJob:

Public Member Functions

def __init__ (self, inputFiles, outputFile)
 
def outputFile (self)
 
def exitCode (self)
 
def exitCode (self, value)
 
def exe (self)
 
def __str__ (self)
 
def __call__ (self)
 

Private Attributes

 _inputFiles
 
 _outputFile
 
 _exitCode
 

Detailed Description

A single hadd job

Definition at line 41 of file rhadd.py.

Constructor & Destructor Documentation

◆ __init__()

def rhadd.haddJob.__init__ (   self,
  inputFiles,
  outputFile 
)

Definition at line 43 of file rhadd.py.

43  def __init__(self, inputFiles, outputFile):
44  self._inputFiles = inputFiles
45  self._outputFile = outputFile
46  self._exitCode = None
47 

Member Function Documentation

◆ __call__()

def rhadd.haddJob.__call__ (   self)
Wrapper to call my own exe function and return the exit code of hadd

Definition at line 79 of file rhadd.py.

79  def __call__(self):
80  '''Wrapper to call my own exe function and return the exit code of hadd'''
81  self.exe()
82  return self._exitCode
83 
84 

◆ __str__()

def rhadd.haddJob.__str__ (   self)

Definition at line 76 of file rhadd.py.

76  def __str__(self):
77  return str(self._inputFiles) + ' -> ' + str(self._outputFile)
78 

◆ exe()

def rhadd.haddJob.exe (   self)
Execute the hadd command

Definition at line 61 of file rhadd.py.

61  def exe(self):
62  '''Execute the hadd command'''
63  mergeCmd = ['hadd', '-f'] # -f because our output file was touched to be safely created
64  mergeCmd.append(self._outputFile)
65  mergeCmd.extend(self._inputFiles)
66 
67  logging.info('Will now execute merge: %s' % ' '.join(mergeCmd))
68  output = []
69  job = Popen(mergeCmd, stdout=PIPE, stderr=STDOUT, bufsize=1, close_fds=True)
70  while job.poll() is None:
71  output.append(job.stdout.readline().strip())
72  self._exitCode = job.returncode
73  if self._exitCode != 0:
74  logging.warning('Non zero return code from hadd. STDOUT/ERR follows:\n%s' % os.linesep.join(output))
75 

◆ exitCode() [1/2]

def rhadd.haddJob.exitCode (   self)

Definition at line 53 of file rhadd.py.

53  def exitCode(self):
54  return self._exitCode
55 

◆ exitCode() [2/2]

def rhadd.haddJob.exitCode (   self,
  value 
)

Definition at line 58 of file rhadd.py.

58  def exitCode(self, value):
59  self._exitCode = value
60 

◆ outputFile()

def rhadd.haddJob.outputFile (   self)

Definition at line 49 of file rhadd.py.

49  def outputFile(self):
50  return(self._outputFile)
51 

Member Data Documentation

◆ _exitCode

rhadd.haddJob._exitCode
private

Definition at line 46 of file rhadd.py.

◆ _inputFiles

rhadd.haddJob._inputFiles
private

Definition at line 44 of file rhadd.py.

◆ _outputFile

rhadd.haddJob._outputFile
private

Definition at line 45 of file rhadd.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
str
Definition: BTagTrackIpAccessor.cxx:11