[Rivet-svn] r1738 - in trunk: data/plotinfo data/refdata include/LWH src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Aug 3 15:57:20 BST 2009


Author: fsiegert
Date: Mon Aug  3 15:57:20 2009
New Revision: 1738

Log:
Allow histograms to be divided, even if only some of their bins match (of course all other bins will get ignored).
Use this feature in D0_2008_S7719523, where that was a @todo. Only one bin in two of the histograms there can't be filled that way (because it would need to merge several 
bins from one of the input histograms). Have deleted that bin from reference data as well, to allow for plotting.

Modified:
   trunk/data/plotinfo/D0_2008_S7719523.plot
   trunk/data/refdata/D0_2008_S7719523.aida
   trunk/include/LWH/HistogramFactory.h
   trunk/src/Analyses/D0_2008_S7719523.cc

Modified: trunk/data/plotinfo/D0_2008_S7719523.plot
==============================================================================
--- trunk/data/plotinfo/D0_2008_S7719523.plot	Mon Aug  3 13:49:59 2009	(r1737)
+++ trunk/data/plotinfo/D0_2008_S7719523.plot	Mon Aug  3 15:57:20 2009	(r1738)
@@ -43,6 +43,24 @@
 XMax=400.0
 # END PLOT
 
+# BEGIN PLOT /D0_2008_S7719523/d06-x01-y01
+Title=Differential Cross Section Ratio $\frac{\mathrm{d}\sigma(|y^{\mathrm{jet}}|<0.8,\,y^\gamma \cdot y^{\mathrm{jet}}>0)}{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}>0)}$
+XLabel=$p_\perp(\gamma)$ / GeV
+YLabel=Ratio
+LogX=1
+XMin=20.0
+XMax=400.0
+# END PLOT
+
+# BEGIN PLOT /D0_2008_S7719523/d07-x01-y01
+Title=Differential Cross Section Ratio $\frac{\mathrm{d}\sigma(|y^{\mathrm{jet}}|<0.8,\,y^\gamma \cdot y^{\mathrm{jet}}>0)}{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}<0)}$
+XLabel=$p_\perp(\gamma)$ / GeV
+YLabel=Ratio
+LogX=1
+XMin=20.0
+XMax=400.0
+# END PLOT
+
 # BEGIN PLOT /D0_2008_S7719523/d08-x01-y01
 Title=Differential Cross Section Ratio $\frac{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}<0)}{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}>0)}$
 XLabel=$p_\perp(\gamma)$ / GeV
@@ -51,3 +69,21 @@
 XMin=20.0
 XMax=400.0
 # END PLOT
+
+# BEGIN PLOT /D0_2008_S7719523/d09-x01-y01
+Title=Differential Cross Section Ratio $\frac{\mathrm{d}\sigma(|y^{\mathrm{jet}}|<0.8,\,y^\gamma \cdot y^{\mathrm{jet}}<0)}{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}>0)}$
+XLabel=$p_\perp(\gamma)$ / GeV
+YLabel=Ratio
+LogX=1
+XMin=20.0
+XMax=400.0
+# END PLOT
+
+# BEGIN PLOT /D0_2008_S7719523/d10-x01-y01
+Title=Differential Cross Section Ratio $\frac{\mathrm{d}\sigma(|y^{\mathrm{jet}}|<0.8,\,y^\gamma \cdot y^{\mathrm{jet}}<0)}{\mathrm{d}\sigma(1.5<|y^{\mathrm{jet}}|<2.5,\,y^\gamma \cdot y^{\mathrm{jet}}<0)}$
+XLabel=$p_\perp(\gamma)$ / GeV
+YLabel=Ratio
+LogX=1
+XMin=20.0
+XMax=400.0
+# END PLOT

Modified: trunk/data/refdata/D0_2008_S7719523.aida
==============================================================================
--- trunk/data/refdata/D0_2008_S7719523.aida	Mon Aug  3 13:49:59 2009	(r1737)
+++ trunk/data/refdata/D0_2008_S7719523.aida	Mon Aug  3 15:57:20 2009	(r1738)
@@ -802,12 +802,6 @@
       <measurement errorPlus="2.2094936578320383"
         value="14.31" errorMinus="2.2094936578320383"/>
     </dataPoint>
-    <dataPoint>
-      <measurement errorPlus="25.0" value="175.0"
-        errorMinus="25.0"/>
-      <measurement errorPlus="9.29154011068671" value="38.29"
-        errorMinus="9.29154011068671"/>
-    </dataPoint>
   </dataPointSet>
   <dataPointSet name="d10-x01-y01" dimension="2"
     path="/REF/D0_2008_S7719523/" title="D3(SIG(Q=1))/D3(SIG(Q=2))">
@@ -885,11 +879,5 @@
       <measurement errorPlus="1.797723272642372" value="11.55"
         errorMinus="1.797723272642372"/>
     </dataPoint>
-    <dataPoint>
-      <measurement errorPlus="25.0" value="175.0"
-        errorMinus="25.0"/>
-      <measurement errorPlus="8.615870744620068" value="35.48"
-        errorMinus="8.615870744620068"/>
-    </dataPoint>
   </dataPointSet>
 </aida>

Modified: trunk/include/LWH/HistogramFactory.h
==============================================================================
--- trunk/include/LWH/HistogramFactory.h	Mon Aug  3 13:49:59 2009	(r1737)
+++ trunk/include/LWH/HistogramFactory.h	Mon Aug  3 15:57:20 2009	(r1738)
@@ -624,15 +624,20 @@
   IDataPointSet * divide(const std::string & path,
                         const Histogram1D & h1, const Histogram1D & h2) {
     //std::cout << "!!!!!!!!!!!!" << path << std::endl;
-    if ( !checkBins(h1, h2) ) return 0;
     DataPointSet * h = new DataPointSet(2);
     h->setTitle(path.substr(path.rfind('/') + 1));
     for (int i = 0; i < h1.ax->bins(); ++i) {
-      //std::cout << "!!! " << 1 << i << std::endl;
+      for (int j = 0; j < h2.ax->bins(); ++j) {
+        if (h1.ax->binWidth(i) != h2.ax->binWidth(j) ||
+            h1.ax->binLowerEdge(i) != h2.ax->binLowerEdge(j) ||
+            h1.ax->binUpperEdge(i) != h2.ax->binUpperEdge(j)) {
+          continue;
+        }
+          
       const double binwidth = h1.ax->binWidth(i);
       const double bincentre = ( h1.ax->binLowerEdge(i) + h1.ax->binUpperEdge(i) ) / 2.0;
-      h->addPoint();
-      IMeasurement* x = h->point(i)->coordinate(0);
+      IDataPoint* point = h->addPoint();
+      IMeasurement* x = point->coordinate(0);
       x->setValue(bincentre);
       x->setErrorPlus(binwidth/2.0);
       x->setErrorMinus(binwidth/2.0);
@@ -644,33 +649,26 @@
         yerrup = 0.0;
         yerrdown = 0.0;
       } else {
-        //std::cout << h1.binHeight(i) << " / " << h2.binHeight(i) << std::endl;;
-        yval = h1.binHeight(i) / h2.binHeight(i);
+        yval = h1.binHeight(i) / h2.binHeight(j);
         double h1val = h1.binHeight(i);
         double h1min = h1val - h1.binRms(i);
         double h1max = h1val + h1.binRms(i);
-        double h2val = h2.binHeight(i);
-        double h2min = h2.binHeight(i) - h2.binRms(i);
-        double h2max = h2.binHeight(i) + h2.binRms(i);
+        double h2val = h2.binHeight(j);
+        double h2min = h2.binHeight(j) - h2.binRms(j);
+        double h2max = h2.binHeight(j) + h2.binRms(j);
         double h2invval = 1 / h2val;
         double h2invmin = 1 / h2max;
         double h2invmax = 1 / h2min;
         yerrup = (h1val/h2val) * sqrt(pow((h1max-h1val)/h1val, 2) + pow((h2invmax-h2invval)/h2invval, 2));
         yerrdown = (h1val/h2val) * sqrt(pow((h1val-h1min)/h1val, 2) + pow((h2invval-h2invmin)/h2invval, 2));
       }
-      IMeasurement* y = h->point(i)->coordinate(1);
+      IMeasurement* y = point->coordinate(1);
       y->setValue(yval);
       y->setErrorPlus(yerrup);
       y->setErrorMinus(yerrdown);
-      // h->sum[i] /= h2.sum[i];
-      // h->sumw[i] /= h2.sumw[i];
-      // h->sumw2[i] = h1.sumw2[i]/(h2.sumw[i]*h2.sumw[i]) +
-      //   h1.sumw[i]*h1.sumw[i]*h2.sumw2[i]/
-      //   (h2.sumw[i]*h2.sumw[i]*h2.sumw[i]*h2.sumw[i]);
+      }
     }
-    //std::cout << "Inserting div histo at path: " << path << std::endl;
     if ( !tree->insert(path, h) ) return 0;
-    //std::cout << "** OK!" << std::endl;
     return h;
   }
 

Modified: trunk/src/Analyses/D0_2008_S7719523.cc
==============================================================================
--- trunk/src/Analyses/D0_2008_S7719523.cc	Mon Aug  3 13:49:59 2009	(r1737)
+++ trunk/src/Analyses/D0_2008_S7719523.cc	Mon Aug  3 15:57:20 2009	(r1738)
@@ -148,19 +148,28 @@
     hf.divide(dir + "/d05-x01-y01", *_h_central_opp_cross_section, *_h_central_same_cross_section);
     hf.divide(dir + "/d08-x01-y01", *_h_forward_opp_cross_section, *_h_forward_same_cross_section);
     // Central/forward ratio combinations
-    /// @todo Bins don't match
-    // hf.divide(dir + "/d06-x01-y01", *_h_central_same_cross_section, *_h_forward_same_cross_section);
-    // hf.divide(dir + "/d07-x01-y01", *_h_central_opp_cross_section,  *_h_forward_same_cross_section);
-    // hf.divide(dir + "/d09-x01-y01", *_h_central_same_cross_section, *_h_forward_opp_cross_section);
-    // hf.divide(dir + "/d10-x01-y01", *_h_central_opp_cross_section,  *_h_forward_opp_cross_section);
+    hf.divide(dir + "/d06-x01-y01", *_h_central_same_cross_section, *_h_forward_same_cross_section);
+    hf.divide(dir + "/d07-x01-y01", *_h_central_opp_cross_section,  *_h_forward_same_cross_section);
+    hf.divide(dir + "/d09-x01-y01", *_h_central_same_cross_section, *_h_forward_opp_cross_section);
+    hf.divide(dir + "/d10-x01-y01", *_h_central_opp_cross_section,  *_h_forward_opp_cross_section);
 
-    /// @todo Use the generator cross-section
     // Must happen *after* the divs, since otherwise the pointers are null!
-    //_h_total_cross_section->fill(crossSection());
     normalize(_h_central_same_cross_section, 347.4);
     normalize(_h_central_opp_cross_section,  281.8);
     normalize(_h_forward_same_cross_section, 164.8);
     normalize(_h_forward_opp_cross_section,   81.5);
+    // @todo test using gen cross section
+    /*
+    const double lumi_gen = sumOfWeights()/crossSection();
+    const double dy_photon = 2.0;
+    const double dy_jet_central = 1.6;
+    const double dy_jet_forward = 2.0;
+
+    scale(_h_central_same_cross_section, 1.0/lumi_gen * 1.0/dy_photon * 1.0/dy_jet_central);
+    scale(_h_central_opp_cross_section, 1.0/lumi_gen * 1.0/dy_photon * 1.0/dy_jet_central);
+    scale(_h_forward_same_cross_section, 1.0/lumi_gen * 1.0/dy_photon * 1.0/dy_jet_forward);
+    scale(_h_forward_opp_cross_section, 1.0/lumi_gen * 1.0/dy_photon * 1.0/dy_jet_forward);
+    */
   }
 
 


More information about the Rivet-svn mailing list