CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
dqm_diff Namespace Reference

Functions

def collect_directory_filenames
 
def dqm_diff
 
def get_content
 

Variables

string dest = 'show_exec_time'
 
tuple parser = OptionParser(usage='usage: %prog <root_file1> <root_file2> [options]')
 Define commandline options. More...
 
tuple start = datetime.now()
 Check for commandline option errors. More...
 

Function Documentation

def dqm_diff.collect_directory_filenames (   directory,
  names_list 
)
Adds current directory file (histogram) names to ``names_list``. Then
recursively calls itself for every current directory sub-directories.

Definition at line 12 of file dqm_diff.py.

References submitPVValidationJobs.split().

Referenced by get_content().

12 
13 def collect_directory_filenames(directory, names_list):
14  """Adds current directory file (histogram) names to ``names_list``. Then
15  recursively calls itself for every current directory sub-directories."""
16  for key in directory.GetListOfKeys():
17  subdir = directory.Get(key.GetName())
18  if subdir:
19  if subdir.IsFolder():
20  collect_directory_filenames(subdir, names_list)
21  else:
22  filename = directory.GetPath().split(':')[1] + ': ' + subdir.GetName()
23  names_list.add(filename)
def collect_directory_filenames
Definition: dqm_diff.py:12
def dqm_diff.dqm_diff (   filename1,
  filename2 
)
Prints file (histogram) names that are in <file1> and not in <file2>.

Definition at line 34 of file dqm_diff.py.

References get_content(), and print().

34 
35 def dqm_diff(filename1, filename2):
36  """Prints file (histogram) names that are in <file1> and not in <file2>."""
37  print("Missing files:")
38  content1 = get_content(filename1)
39  content2 = get_content(filename2)
40  printed = False
41  for name in content1:
42  if name not in content2:
43  print(" ->", name)
44  printed = True
45  if not printed:
46  print(" All files match.")
47 
def get_content
Definition: dqm_diff.py:24
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def dqm_diff
Definition: dqm_diff.py:34
def dqm_diff.get_content (   root_file_name)
Returns all file (histogram) names, which are found in <root_file_name>.

Definition at line 24 of file dqm_diff.py.

References collect_directory_filenames().

Referenced by dqm_diff().

24 
25 def get_content(root_file_name):
26  """Returns all file (histogram) names, which are found in <root_file_name>."""
27  from ROOT import TFile
28  root_file = TFile(root_file_name)
29  root_directory = root_file.GetDirectory("DQMData")
30  filename_set = set()
31  collect_directory_filenames(root_directory, filename_set)
32  root_file.Close()
33  return filename_set
def get_content
Definition: dqm_diff.py:24
def collect_directory_filenames
Definition: dqm_diff.py:12

Variable Documentation

string dqm_diff.dest = 'show_exec_time'

Definition at line 51 of file dqm_diff.py.

tuple dqm_diff.parser = OptionParser(usage='usage: %prog <root_file1> <root_file2> [options]')

Define commandline options.

Definition at line 49 of file dqm_diff.py.

tuple dqm_diff.start = datetime.now()

Check for commandline option errors.

Execute the search of dismatches in two root fies.

Definition at line 59 of file dqm_diff.py.