|
[Rivet-svn] r3445 - in trunk: bin docblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Oct 17 19:19:15 BST 2011
Author: fsiegert Date: Mon Oct 17 19:19:15 2011 New Revision: 3445 Log: Add EnvelopeRebin option to make-plots (cf. documentation). Modified: trunk/bin/make-plots trunk/doc/make-plots.txt Modified: trunk/bin/make-plots ============================================================================== --- trunk/bin/make-plots Sun Oct 16 13:53:18 2011 (r3444) +++ trunk/bin/make-plots Mon Oct 17 19:19:15 2011 (r3445) @@ -1270,6 +1270,23 @@ 'Content': foo/float(rebin), 'Error': [sqrt(barl)/float(rebin),sqrt(baru)/float(rebin)]}) self.data=newdata + if self.description.has_key('EnvelopeRebin') and self.description['EnvelopeRebin']!='': + rebin=int(self.description['EnvelopeRebin']) + newdata=[] + if rebin>=2: + for i in range(0,(len(self.data)/rebin)*rebin,rebin): + newcentral=0. + newmax=0. + newmin=0. + for j in range(rebin): + newcentral +=self.data[i+j]['Content'] + newmin +=self.data[i+j]['Content']-self.data[i+j]['Error'][0] + newmax +=self.data[i+j]['Content']+self.data[i+j]['Error'][1] + newdata.append({'LowEdge': self.data[i]['LowEdge'], + 'UpEdge': self.data[i+rebin-1]['UpEdge'], + 'Content': newcentral/float(rebin), + 'Error': [(newcentral-newmin)/float(rebin),(newmax-newcentral)/float(rebin)]}) + self.data=newdata def add(self,name): if len(self.data)!=len(name.data): Modified: trunk/doc/make-plots.txt ============================================================================== --- trunk/doc/make-plots.txt Sun Oct 16 13:53:18 2011 (r3444) +++ trunk/doc/make-plots.txt Mon Oct 17 19:19:15 2011 (r3445) @@ -566,6 +566,13 @@ (i.e. if the original histogram has 10 bins and <nbins> is 3, the plotted histogram shows three bins combining the bins 1--9 of the original histogram). +-------------------- +EnvelopeRebin=<nbins> +-------------------- +Rebin an envelope histogram where the error bars represent an envelope. Thus, +they are combined linearly instead of as sum of squares. The functionality +is the same as 'Rebin' otherwise. + FUNCTION ~~~~~~~~
More information about the Rivet-svn mailing list |