[Rivet-svn] r3192 - in trunk: . include/LWH

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Jul 18 18:15:43 BST 2011


Author: buckley
Date: Mon Jul 18 18:15:43 2011
New Revision: 3192

Log:
include/LWH/DataPointSet.h: Fix accidental setting of errorMinus = scalefactor * error_Plus_. Thanks to Anton Karneyeu for the bug report!

Modified:
   trunk/ChangeLog
   trunk/include/LWH/DataPointSet.h

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Mon Jul 18 18:02:19 2011	(r3191)
+++ trunk/ChangeLog	Mon Jul 18 18:15:43 2011	(r3192)
@@ -1,8 +1,16 @@
+2011-07-18  Andy Buckley  <andy at insectnation.org>
+
+	* include/LWH/DataPointSet.h: Fix accidental setting of errorMinus
+	= scalefactor * error_Plus_. Thanks to Anton Karneyeu for the bug
+	report!
+
 2011-07-18  Hendrik Hoeth <hendrik.hoeth at cern.ch>
 
 	* Added CMS_2011_S8884919 (charged hadron multiplicity in NSD
 	events corrected to pT>=0).
+
 	* Added CMS_2010_S8656010 (charged hadron pT and eta in NSD events)
+
 	* Added CMS_2011_S8968497 (chi_dijet)
 
 2011-07-13  Andy Buckley  <andy at insectnation.org>

Modified: trunk/include/LWH/DataPointSet.h
==============================================================================
--- trunk/include/LWH/DataPointSet.h	Mon Jul 18 18:02:19 2011	(r3191)
+++ trunk/include/LWH/DataPointSet.h	Mon Jul 18 18:15:43 2011	(r3192)
@@ -255,10 +255,10 @@
   bool scale(double scale) {
     for ( int i = 0, N = dset.size(); i < N; ++i )
       for ( int j = 0, M = dset[i].dimension(); j < M; ++j ) {
-	IMeasurement * m = dset[i].coordinate(j);
-	m->setValue(m->value()*scale);
-	m->setErrorPlus(m->errorPlus()*scale);
-	m->setErrorMinus(m->errorPlus()*scale);
+        IMeasurement * m = dset[i].coordinate(j);
+        m->setValue(m->value()*scale);
+        m->setErrorPlus(m->errorPlus()*scale);
+        m->setErrorMinus(m->errorMinus()*scale);
       }
     return true;
   }
@@ -278,11 +278,11 @@
       IMeasurement * m = dset[i].coordinate(coord);
       m->setValue(m->value()*scale);
       m->setErrorPlus(m->errorPlus()*scale);
-      m->setErrorMinus(m->errorPlus()*scale);
+      m->setErrorMinus(m->errorMinus()*scale);
     }
     return true;
   }
-	
+
   /**
    * Scales the values of all the measurements
    * of each point by a given factor.
@@ -307,9 +307,9 @@
   bool scaleErrors(double scale) {
     for ( int i = 0, N = dset.size(); i < N; ++i )
       for ( int j = 0, M = dset[i].dimension(); j < M; ++j ) {
-	IMeasurement * m = dset[i].coordinate(j);
-	m->setErrorPlus(m->errorPlus()*scale);
-	m->setErrorMinus(m->errorPlus()*scale);
+        IMeasurement * m = dset[i].coordinate(j);
+        m->setErrorPlus(m->errorPlus()*scale);
+        m->setErrorMinus(m->errorMinus()*scale);
       }
     return true;
   }
@@ -386,9 +386,9 @@
            << "choose different file format!" << endl;
       return false;
     }
-    
+
     //Replace "-" by "_" because cint interprets - as a minus.
-    
+
     for(std::string::iterator c = name.begin();
         c != name.end(); ++c){
       if(*c == *"-"){
@@ -397,11 +397,11 @@
         name.replace(c, cEnd, "_");
       }
     }
-    
+
     //cout << "Writing out TGraph " << name.c_str() << " in ROOT file format" << endl;
-      
+
     int N = size();
-    
+
     vector<double> x, y, exl, exh, eyl, eyh;
 
     for ( int i = 0; i < N; ++i ) {
@@ -412,22 +412,22 @@
       eyl.push_back(point(i)->coordinate(1)->errorMinus());
       eyh.push_back(point(i)->coordinate(1)->errorPlus());
     }
-        
+
     TGraphAsymmErrors* graph = new TGraphAsymmErrors(N, &(x[0]), &(y[0]),
                                                      &(exl[0]), &(exh[0]),
                                                      &(eyl[0]), &(eyh[0]) );
-        
+
     graph->SetTitle(title().c_str());
     graph->SetName(name.c_str());
-        
+
     std::string DirName; //remove preceding slash from directory name, else ROOT error
     for (unsigned int i=1; i<path.size(); ++i) DirName += path[i];
     if (!file->Get(DirName.c_str())) file->mkdir(DirName.c_str());
     file->cd(DirName.c_str());
-        
+
     graph->Write();
     delete graph;
-    
+
     return true;
   }
 


More information about the Rivet-svn mailing list