ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.TrigValSteering.CheckSteps.RootMergeStep Class Reference
Inheritance diagram for python.TrigValSteering.CheckSteps.RootMergeStep:
Collaboration diagram for python.TrigValSteering.CheckSteps.RootMergeStep:

Public Member Functions

def __init__ (self, name='RootMerge')
 
def configure (self, test=None)
 
def run (self, dry_run=False)
 

Public Attributes

 input_file
 
 merged_file
 
 rename_suffix
 
 executable
 
 result
 

Detailed Description

Merge root files with hadd. Parameters are:
input_file - file(s) to be merged
merged_file - output file name
rename_suffix - if merged_file exists, it is renamed by adding this suffix

Definition at line 190 of file CheckSteps.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TrigValSteering.CheckSteps.RootMergeStep.__init__ (   self,
  name = 'RootMerge' 
)

Definition at line 198 of file CheckSteps.py.

198  def __init__(self, name='RootMerge'):
199  super(RootMergeStep, self).__init__(name)
200  self.input_file = None
201  self.merged_file = None
202  self.rename_suffix = None
203  self.executable = 'hadd'
204 

Member Function Documentation

◆ configure()

def python.TrigValSteering.CheckSteps.RootMergeStep.configure (   self,
  test = None 
)

Definition at line 205 of file CheckSteps.py.

205  def configure(self, test=None):
206  self.args += ' ' + self.merged_file + ' ' + self.input_file
207  super(RootMergeStep, self).configure(test)
208 

◆ run()

def python.TrigValSteering.CheckSteps.RootMergeStep.run (   self,
  dry_run = False 
)

Definition at line 209 of file CheckSteps.py.

209  def run(self, dry_run=False):
210  file_list_to_check = self.input_file.split()
211  if os.path.isfile(self.merged_file) and self.rename_suffix:
212  old_name = os.path.splitext(self.merged_file)
213  new_name = old_name[0] + self.rename_suffix + old_name[1]
214  self.executable = 'mv {} {}; {}'.format(self.merged_file, new_name, self.executable)
215  if new_name in file_list_to_check:
216  file_list_to_check.remove(new_name)
217  file_list_to_check.append(self.merged_file)
218  self.log.debug('%s checking if the input files exist: %s', self.name, str(file_list_to_check))
219  if not dry_run:
220  for file_name in file_list_to_check:
221  if len(glob.glob(file_name)) < 1:
222  self.log.warning('%s: file %s requested to be merged but does not exist', self.name, file_name)
223  self.result = 1
224  return self.result, '# (internal) {} in={} out={} -> failed'.format(self.name, self.input_file, self.merged_file)
225  return super(RootMergeStep, self).run(dry_run)
226 
227 

Member Data Documentation

◆ executable

python.TrigValSteering.CheckSteps.RootMergeStep.executable

Definition at line 203 of file CheckSteps.py.

◆ input_file

python.TrigValSteering.CheckSteps.RootMergeStep.input_file

Definition at line 200 of file CheckSteps.py.

◆ merged_file

python.TrigValSteering.CheckSteps.RootMergeStep.merged_file

Definition at line 201 of file CheckSteps.py.

◆ rename_suffix

python.TrigValSteering.CheckSteps.RootMergeStep.rename_suffix

Definition at line 202 of file CheckSteps.py.

◆ result

python.TrigValSteering.CheckSteps.RootMergeStep.result

Definition at line 223 of file CheckSteps.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
configure
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)
Definition: TrigGlobEffCorrValidation.cxx:514
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
run
Definition: run.py:1
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
str
Definition: BTagTrackIpAccessor.cxx:11
Trk::split
@ split
Definition: LayerMaterialProperties.h:38