|
[Rivet-svn] r1946 - trunk/binblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Oct 21 18:14:07 BST 2009
Author: hoeth Date: Wed Oct 21 18:14:06 2009 New Revision: 1946 Log: make-plots: allow global "NormalizeToIntegral", "NormalizeToSum" and "Scale" in the PLOT section. The normalization options override the corresponding options in the histogram sections, while scales are multiplied. Modified: trunk/bin/make-plots Modified: trunk/bin/make-plots ============================================================================== --- trunk/bin/make-plots Wed Oct 21 10:56:52 2009 (r1945) +++ trunk/bin/make-plots Wed Oct 21 18:14:06 2009 (r1946) @@ -170,6 +170,22 @@ def __init__(self,inputdata): pass + def set_normalization(self,inputdata): + for method in ['NormalizeToIntegral', 'NormalizeToSum']: + if inputdata.description.has_key(method): + for i in inputdata.description['DrawOnly']: + if not inputdata.histos[i].description.has_key(method): + print 'method', method, 'histo', i + inputdata.histos[i].description[method] = inputdata.description[method] + if inputdata.description.has_key('Scale'): + for i in inputdata.description['DrawOnly']: + if inputdata.histos[i].description.has_key('Scale'): + inputdata.histos[i].description['Scale'] = float(inputdata.description['Scale'])*float(inputdata.histos[i].description['Scale']) + else: + inputdata.histos[i].description['Scale'] = float(inputdata.description['Scale']) + for i in inputdata.description['DrawOnly']: + inputdata.histos[i].mangle_input() + def set_borders(self,inputdata): self.set_xmax(inputdata) self.set_xmin(inputdata) @@ -333,6 +349,7 @@ class MainPlot(Plot): def __init__(self, inputdata): + self.set_normalization(inputdata) self.set_borders(inputdata) global coors coors = Coordinates(inputdata) @@ -841,7 +858,6 @@ self.description = settings self.data = [] self.read_input_data(f) - self.read_input(f) def read_input_data(self, f): for line in f: @@ -875,7 +891,7 @@ 'Content': float(linearray[4]), 'Error': float(linearray[5])}) - def read_input(self, f): + def mangle_input(self): if (self.description.has_key('NormalizeToIntegral') and self.description['NormalizeToIntegral']=='1') or \ (self.description.has_key('NormalizeToSum') and self.description['NormalizeToSum']=='1'): if (self.description.has_key('NormalizeToIntegral') and self.description['NormalizeToIntegral']=='1') and \
More information about the Rivet-svn mailing list |