ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RootMacros/overlayHists.py
(Generate patch)

Comparing UserCode/RootMacros/overlayHists.py (file contents):
Revision 1.10 by klukas, Fri Jan 8 20:36:24 2010 UTC vs.
Revision 1.11 by klukas, Mon Jan 11 16:02:50 2010 UTC

# Line 1 | Line 1
1   #!/usr/bin/env python
2  
3   ## Created by Jeff Klukas (klukas@wisc.edu), November 2009
4 + ## Updated January 2010
5  
6   ## For more information, use the -h option:
7   ##     ./overlayHists.py -h
# Line 10 | Line 11 | usage="""usage: %prog [options] file1.ro
11  
12   function: overlays corresponding histograms from several files, dumping the
13            images into an identical directory structure in the local directory
14 <          and also merging all images into a single file (if output is pdf)"""
14 >          and also merging all images into a single file (if output is pdf);
15 >          most style options can be controlled from your rootlogon.C macro"""
16  
17  
18   #### Define colors and styles
# Line 74 | Line 76 | group1 = optparse.OptionGroup(
76      "you choose.  To affect all plots, simply include the option on the "
77      "command line.  With the '-s' option, however, you may instead include "
78      "a keyword (such as 'Norm') in the ROOT name of a histogram and it will "
79 <    "have the option turned on regardless of the command line."
79 >    "always have that option turned on."
80      )
81   group1.add_option('-n', '--normalize', action="store_true", default=False,
82                    help="'Norm': area normalize the histograms")
# Line 187 | Line 189 | def process_hist(path, new_path, files,
189              hist.AddBinContent(1, underflow)
190          if options.normalize or (options.special and "Norm" in name):
191              integral = hist.Integral()
192 <            hist.Scale(1. / integral)
192 >            if integral: hist.Scale(1. / integral)
193          stack.Add(hist)
194          legend.AddEntry(hist)
195      #### Draw the stack and apply text overlays

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines