CMS 3D CMS Logo

Functions | Variables
dqm_diff Namespace Reference

Functions

def collect_directory_filenames (directory, names_list)
 
def dqm_diff (filename1, filename2)
 
def get_content (root_file_name)
 

Variables

 action
 
 args
 
 default
 
 dest
 
 help
 
 options
 
 parser
 Define commandline options. More...
 
 seconds
 
 start
 Check for commandline option errors. More...
 
 usage
 

Detailed Description

Script prints out histogram names that are in one ROOT file but not in another.

Author:  Albertas Gimbutas,  Vilnius University (LT)
e-mail:  albertasgim@gmail.com

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 11 of file dqm_diff.py.

References split.

Referenced by get_content().

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

Definition at line 33 of file dqm_diff.py.

References get_content().

33 def dqm_diff(filename1, filename2):
34  """Prints file (histogram) names that are in <file1> and not in <file2>."""
35  print "Missing files:"
36  content1 = get_content(filename1)
37  content2 = get_content(filename2)
38  printed = False
39  for name in content1:
40  if name not in content2:
41  print " ->", name
42  printed = True
43  if not printed:
44  print " All files match."
45 
46 
def get_content(root_file_name)
Definition: dqm_diff.py:23
def dqm_diff(filename1, filename2)
Definition: dqm_diff.py:33
def dqm_diff.get_content (   root_file_name)
Returns all file (histogram) names, which are found in <root_file_name>.

Definition at line 23 of file dqm_diff.py.

References collect_directory_filenames().

Referenced by dqm_diff().

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

Variable Documentation

dqm_diff.action

Definition at line 49 of file dqm_diff.py.

dqm_diff.args

Definition at line 51 of file dqm_diff.py.

dqm_diff.default

Definition at line 49 of file dqm_diff.py.

dqm_diff.dest

Definition at line 50 of file dqm_diff.py.

dqm_diff.help

Definition at line 50 of file dqm_diff.py.

dqm_diff.options

Definition at line 51 of file dqm_diff.py.

dqm_diff.parser

Define commandline options.

Definition at line 48 of file dqm_diff.py.

dqm_diff.seconds

Definition at line 61 of file dqm_diff.py.

dqm_diff.start

Check for commandline option errors.

Execute the search of dismatches in two root fies.

Definition at line 58 of file dqm_diff.py.

dqm_diff.usage

Definition at line 48 of file dqm_diff.py.