[Rivet-svn] r4013 - in trunk: include/Rivet src/Analyses src/Core

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Nov 14 18:45:36 GMT 2012


Author: dgrell
Date: Wed Nov 14 18:45:36 2012
New Revision: 4013

Log:
Introduced division helper to make divide ops easier.

Modified:
   trunk/include/Rivet/Analysis.hh
   trunk/src/Analyses/ALICE_2011_S8909580.cc
   trunk/src/Analyses/ATLAS_2011_S9128077.cc
   trunk/src/Analyses/CMS_2011_S8978280.cc
   trunk/src/Analyses/D0_2008_S7719523.cc
   trunk/src/Analyses/D0_2008_S7837160.cc
   trunk/src/Analyses/MC_WJETS.cc
   trunk/src/Analyses/SLD_1999_S3743934.cc
   trunk/src/Analyses/SLD_2004_S5693039.cc
   trunk/src/Analyses/STAR_2006_S6500200.cc
   trunk/src/Analyses/STAR_2006_S6860818.cc
   trunk/src/Core/Analysis.cc

Modified: trunk/include/Rivet/Analysis.hh
==============================================================================
--- trunk/include/Rivet/Analysis.hh	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/include/Rivet/Analysis.hh	Wed Nov 14 18:45:36 2012	(r4013)
@@ -311,6 +311,24 @@
     /// Set the cross section from the generator
     Analysis& setCrossSection(double xs);
 
+    /// Helper for histogram division. Preserves the path information
+    /// of the target.
+    void divide(Histo1DPtr h1, Histo1DPtr h2, Scatter2DPtr s) const;
+
+    /// Helper for profile histogram division. Preserves the path information
+    /// of the target.
+    void divide(Profile1DPtr p1, Profile1DPtr p2, Scatter2DPtr s) const;
+
+    /// Helper for histogram division. Preserves the path information
+    /// of the target.
+    void divide(const YODA::Histo1D & h1, 
+		const YODA::Histo1D & h2, Scatter2DPtr s) const;
+
+    /// Helper for profile histogram division. Preserves the path information
+    /// of the target.
+    void divide(const YODA::Profile1D & p1, 
+		const YODA::Profile1D & p2, Scatter2DPtr s) const;
+
 
   protected:
 

Modified: trunk/src/Analyses/ALICE_2011_S8909580.cc
==============================================================================
--- trunk/src/Analyses/ALICE_2011_S8909580.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/ALICE_2011_S8909580.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -27,12 +27,13 @@
       _histPtPhi        = bookHisto1D("d05-x01-y01");
       _temp_h_Lambdas   = bookHisto1D(6, 1, 1, "temp_h_Lambdas");
       _temp_h_Kzeros    = bookHisto1D(6, 1, 1, "temp_h_Kzeros");
+      _h_LamKzero	= bookScatter2D(6, 1, 1, "_h_LamKzero");
     }
 
     void analyze(const Event& event) {
       const double weight = event.weight();
       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(event, "UFS");
-
+      
       foreach (const Particle& p, ufs.particles()) {
         const double absrap = fabs(p.momentum().rapidity());
         const double pT = p.momentum().pT()/GeV;
@@ -78,16 +79,13 @@
     }
 
     void finalize() {
-      scale(_histPtK0s,        1./(1.5*sumOfWeights()));
-      scale(_histPtLambda,     1./(1.5*sumOfWeights()));
-      scale(_histPtAntiLambda, 1./(1.5*sumOfWeights()));
-      scale(_histPtXi,         1./(1.6*sumOfWeights()));
-      scale(_histPtPhi,        1./(1.2*sumOfWeights()));
-
-      // \todo YODA divide
-      //histogramFactory().divide(histoPath("d06-x01-y01"), *_temp_h_Lambdas, *_temp_h_Kzeros);
-      //histogramFactory().destroy(_temp_h_Lambdas);
-      //histogramFactory().destroy(_temp_h_Kzeros);
+      	scale(_histPtK0s,        1./(1.5*sumOfWeights()));
+      	scale(_histPtLambda,     1./(1.5*sumOfWeights()));
+      	scale(_histPtAntiLambda, 1./(1.5*sumOfWeights()));
+      	scale(_histPtXi,         1./(1.6*sumOfWeights()));
+      	scale(_histPtPhi,        1./(1.2*sumOfWeights()));
+
+	divide(_temp_h_Lambdas, _temp_h_Kzeros, _h_LamKzero);
     }
 
 
@@ -100,6 +98,7 @@
     Histo1DPtr _histPtPhi;
     Histo1DPtr _temp_h_Lambdas;
     Histo1DPtr _temp_h_Kzeros;
+    Scatter2DPtr _h_LamKzero;
 
   };
 

Modified: trunk/src/Analyses/ATLAS_2011_S9128077.cc
==============================================================================
--- trunk/src/Analyses/ATLAS_2011_S9128077.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/ATLAS_2011_S9128077.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -71,6 +71,14 @@
       _h_tmp_HT2_R04_2 = bookHisto1D(17, 1, 1, "tmp15");
       _h_tmp_HT2_R04_3 = bookHisto1D(17, 1, 1, "tmp16");
 
+      _h_pTlead_R06_60_ratio = bookScatter2D(10, 1, 1);      
+      _h_pTlead_R06_80_ratio = bookScatter2D(11, 1, 1);
+      _h_pTlead_R06_110_ratio = bookScatter2D(12, 1, 1);
+      _h_pTlead_R04_60_ratio = bookScatter2D(13, 1, 1);
+      _h_pTlead_R04_80_ratio = bookScatter2D(14, 1, 1);
+      _h_pTlead_R04_110_ratio = bookScatter2D(15, 1, 1);
+      _h_HT2_R06_ratio = bookScatter2D(16, 1, 1);
+      _h_HT2_R04_ratio = bookScatter2D(17, 1, 1);
     }
 
 
@@ -172,31 +180,29 @@
       scale(_h_HT_4, crossSectionPerEvent());
 
       /// create ratio histograms
-      //\todo YODA divide
-      //histogramFactory().divide(histoDir() + "/d10-x01-y01", *_h_tmp_pTlead_R06_60_3, *_h_tmp_pTlead_R06_60_2);
-      //histogramFactory().divide(histoDir() + "/d11-x01-y01", *_h_tmp_pTlead_R06_80_3, *_h_tmp_pTlead_R06_80_2);
-      //histogramFactory().divide(histoDir() + "/d12-x01-y01", *_h_tmp_pTlead_R06_110_3, *_h_tmp_pTlead_R06_110_2);
-      //histogramFactory().divide(histoDir() + "/d13-x01-y01", *_h_tmp_pTlead_R04_60_3, *_h_tmp_pTlead_R04_60_2);
-      //histogramFactory().divide(histoDir() + "/d14-x01-y01", *_h_tmp_pTlead_R04_80_3, *_h_tmp_pTlead_R04_80_2);
-      //histogramFactory().divide(histoDir() + "/d15-x01-y01", *_h_tmp_pTlead_R04_110_3, *_h_tmp_pTlead_R04_110_2);
-      //histogramFactory().divide(histoDir() + "/d16-x01-y01", *_h_tmp_HT2_R06_3, *_h_tmp_HT2_R06_2);
-      //histogramFactory().divide(histoDir() + "/d17-x01-y01", *_h_tmp_HT2_R04_3, *_h_tmp_HT2_R04_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_60_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_80_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_110_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_60_3);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_80_3);
-      //histogramFactory().destroy(_h_tmp_pTlead_R06_110_3);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_60_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_80_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_110_2);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_60_3);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_80_3);
-      //histogramFactory().destroy(_h_tmp_pTlead_R04_110_3);
-      //histogramFactory().destroy(_h_tmp_HT2_R06_2);
-      //histogramFactory().destroy(_h_tmp_HT2_R06_3);
-      //histogramFactory().destroy(_h_tmp_HT2_R04_2);
-      //histogramFactory().destroy(_h_tmp_HT2_R04_3);
+      divide(_h_tmp_pTlead_R06_60_3,_h_tmp_pTlead_R06_60_2,
+	     _h_pTlead_R06_60_ratio);
+
+      divide(_h_tmp_pTlead_R06_80_3,_h_tmp_pTlead_R06_80_2,
+	     _h_pTlead_R06_80_ratio);
+
+      divide(_h_tmp_pTlead_R06_110_3,_h_tmp_pTlead_R06_110_2,
+	     _h_pTlead_R06_110_ratio);
+
+      divide(_h_tmp_pTlead_R04_60_3,_h_tmp_pTlead_R04_60_2,
+	     _h_pTlead_R04_60_ratio);
+
+      divide(_h_tmp_pTlead_R04_80_3,_h_tmp_pTlead_R04_80_2,
+	     _h_pTlead_R04_80_ratio);
+
+      divide(_h_tmp_pTlead_R04_110_3,_h_tmp_pTlead_R04_110_2,
+	     _h_pTlead_R04_110_ratio);
+
+      divide(_h_tmp_HT2_R06_3,_h_tmp_HT2_R06_2,
+	     _h_HT2_R06_ratio);
+
+      divide(_h_tmp_HT2_R04_3,_h_tmp_HT2_R04_2,
+	     _h_HT2_R04_ratio);
 
     }
 
@@ -238,6 +244,16 @@
     Histo1DPtr _h_tmp_HT2_R06_3;
     Histo1DPtr _h_tmp_HT2_R04_2;
     Histo1DPtr _h_tmp_HT2_R04_3;
+
+    Scatter2DPtr _h_pTlead_R06_60_ratio;
+    Scatter2DPtr _h_pTlead_R06_80_ratio;
+    Scatter2DPtr _h_pTlead_R06_110_ratio;
+    Scatter2DPtr _h_pTlead_R04_60_ratio;
+    Scatter2DPtr _h_pTlead_R04_80_ratio;
+    Scatter2DPtr _h_pTlead_R04_110_ratio;
+    Scatter2DPtr _h_HT2_R06_ratio;
+    Scatter2DPtr _h_HT2_R04_ratio;
+
     //@}
 
   };

Modified: trunk/src/Analyses/CMS_2011_S8978280.cc
==============================================================================
--- trunk/src/Analyses/CMS_2011_S8978280.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/CMS_2011_S8978280.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -22,22 +22,18 @@
       addProjection(ufs, "UFS");
 
       // Particle distributions versus rapidity and transverse momentum
-      // Only make histograms if the correct energy is used.
-      if (fuzzyEquals(sqrtS()/GeV, 900)){
-        _h_dNKshort_dy  = bookHisto1D(1, 1, 1);
-        _h_dNKshort_dpT = bookHisto1D(2, 1, 1);
-        _h_dNLambda_dy  = bookHisto1D(3, 1, 1);
-        _h_dNLambda_dpT = bookHisto1D(4, 1, 1);
-        _h_dNXi_dy      = bookHisto1D(5, 1, 1);
-        _h_dNXi_dpT     = bookHisto1D(6, 1, 1);
-      } else if (fuzzyEquals(sqrtS()/GeV, 7000)){
-        _h_dNKshort_dy  = bookHisto1D(1, 1, 2);
-        _h_dNKshort_dpT = bookHisto1D(2, 1, 2);
-        _h_dNLambda_dy  = bookHisto1D(3, 1, 2);
-        _h_dNLambda_dpT = bookHisto1D(4, 1, 2);
-        _h_dNXi_dy      = bookHisto1D(5, 1, 2);
-        _h_dNXi_dpT     = bookHisto1D(6, 1, 2);
-      }
+      _h_dNKshort_dy  = bookHisto1D(1, 1, 1);
+      _h_dNKshort_dpT = bookHisto1D(2, 1, 1);
+      _h_dNLambda_dy  = bookHisto1D(3, 1, 1);
+      _h_dNLambda_dpT = bookHisto1D(4, 1, 1);
+      _h_dNXi_dy      = bookHisto1D(5, 1, 1);
+      _h_dNXi_dpT     = bookHisto1D(6, 1, 1);
+
+      _h_LampT_KpT 	= bookScatter2D(7, 1, 1);
+      _h_XipT_LampT 	= bookScatter2D(8, 1, 1);
+      _h_Lamy_Ky 	= bookScatter2D(9, 1, 1);
+      _h_Xiy_Lamy 	= bookScatter2D(10, 1, 1);
+
     }
 
 
@@ -78,22 +74,18 @@
 
 
     void finalize() {
-      // \todo YODA divide
-      // AIDA::IHistogramFactory& hf = histogramFactory();
-      // const string dir = histoDir();
-      //
-      // // Making the Lambda/Kshort and Xi/Lambda ratios vs pT and y
-      // if (fuzzyEquals(sqrtS()/GeV, 900)) {
-      //   hf.divide(dir + "/d07-x01-y01",*_h_dNLambda_dpT, *_h_dNKshort_dpT);
-      //   hf.divide(dir + "/d08-x01-y01",*_h_dNXi_dpT, *_h_dNLambda_dpT);
-      //   hf.divide(dir + "/d09-x01-y01",*_h_dNLambda_dy, *_h_dNKshort_dy);
-      //   hf.divide(dir + "/d10-x01-y01",*_h_dNXi_dy, *_h_dNLambda_dy);
-      // } else if (fuzzyEquals(sqrtS()/GeV, 7000)) {
-      //   hf.divide(dir + "/d07-x01-y02",*_h_dNLambda_dpT, *_h_dNKshort_dpT);
-      //   hf.divide(dir + "/d08-x01-y02",*_h_dNXi_dpT, *_h_dNLambda_dpT);
-      //   hf.divide(dir + "/d09-x01-y02",*_h_dNLambda_dy, *_h_dNKshort_dy);
-      //   hf.divide(dir + "/d10-x01-y02",*_h_dNXi_dy, *_h_dNLambda_dy);
-      // }
+
+      divide(_h_dNLambda_dpT,_h_dNKshort_dpT,
+	     _h_LampT_KpT);
+      
+      divide(_h_dNXi_dpT,_h_dNLambda_dpT,
+	     _h_XipT_LampT);
+      
+      divide(_h_dNLambda_dy,_h_dNKshort_dy,
+	     _h_Lamy_Ky);
+
+      divide(_h_dNXi_dy,_h_dNLambda_dy,
+	     _h_Xiy_Lamy);
 
       double normpT = 1.0/sumOfWeights();
       double normy = 0.5*normpT; // Accounts for using |y| instead of y
@@ -116,6 +108,11 @@
     Histo1DPtr _h_dNXi_dy;
     Histo1DPtr _h_dNXi_dpT;
 
+    Scatter2DPtr _h_LampT_KpT;
+    Scatter2DPtr _h_XipT_LampT;
+    Scatter2DPtr _h_Lamy_Ky;
+    Scatter2DPtr _h_Xiy_Lamy;
+
   };
 
 

Modified: trunk/src/Analyses/D0_2008_S7719523.cc
==============================================================================
--- trunk/src/Analyses/D0_2008_S7719523.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/D0_2008_S7719523.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -59,6 +59,14 @@
       _h_central_opp_cross_section  = bookHisto1D(2, 1, 1);
       _h_forward_same_cross_section = bookHisto1D(3, 1, 1);
       _h_forward_opp_cross_section  = bookHisto1D(4, 1, 1);
+      
+      _h_cen_opp_same	= bookScatter2D(5, 1, 1);
+      _h_fwd_opp_same	= bookScatter2D(8, 1, 1);
+      _h_cen_same_fwd_same = bookScatter2D(6, 1, 1);
+      _h_cen_opp_fwd_same = bookScatter2D(7, 1, 1);
+      _h_cen_same_fwd_opp = bookScatter2D(9, 1, 1);
+      _h_cen_opp_fwd_opp = bookScatter2D(10, 1, 1);
+
     }
 
 
@@ -136,24 +144,30 @@
       const double dy_jet_central = 1.6;
       const double dy_jet_forward = 2.0;
 
-      // \todo YODA divide
+
       // Cross-section ratios (6 plots)
       // Central/central and forward/forward ratios
-      // AIDA::IHistogramFactory& hf = histogramFactory();
-      // const string dir = histoDir();
 
-      // 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);
+      divide(_h_central_opp_cross_section,_h_central_same_cross_section,
+	     _h_cen_opp_same);
+
+      divide(_h_forward_opp_cross_section,_h_forward_same_cross_section,
+	     _h_fwd_opp_same);
+
+
+      // Central/forward ratio combinations
 
-      // // Central/forward ratio combinations
-      // hf.divide(dir + "/d06-x01-y01", *_h_central_same_cross_section,
-      //           *_h_forward_same_cross_section)->scale(dy_jet_forward/dy_jet_central, 1);
-      // hf.divide(dir + "/d07-x01-y01", *_h_central_opp_cross_section,
-      //           *_h_forward_same_cross_section)->scale(dy_jet_forward/dy_jet_central, 1);
-      // hf.divide(dir + "/d09-x01-y01", *_h_central_same_cross_section,
-      //           *_h_forward_opp_cross_section)->scale(dy_jet_forward/dy_jet_central, 1);
-      // hf.divide(dir + "/d10-x01-y01", *_h_central_opp_cross_section,
-      //           *_h_forward_opp_cross_section)->scale(dy_jet_forward/dy_jet_central, 1);
+      divide(_h_central_same_cross_section,_h_forward_same_cross_section,
+	     _h_cen_same_fwd_same);
+
+      divide(_h_central_opp_cross_section,_h_forward_same_cross_section,
+	     _h_cen_opp_fwd_same);
+
+      divide(_h_central_same_cross_section,_h_forward_opp_cross_section,
+	     _h_cen_same_fwd_opp);
+
+      divide(_h_central_opp_cross_section,_h_forward_opp_cross_section,
+	     _h_cen_opp_fwd_opp);
 
       // Use generator cross section for remaining histograms
       // Each of these needs the additional factor 2 because the
@@ -175,6 +189,13 @@
     Histo1DPtr _h_central_opp_cross_section;
     Histo1DPtr _h_forward_same_cross_section;
     Histo1DPtr _h_forward_opp_cross_section;
+
+    Scatter2DPtr _h_cen_opp_same;
+    Scatter2DPtr _h_fwd_opp_same;
+    Scatter2DPtr _h_cen_same_fwd_same;
+    Scatter2DPtr _h_cen_opp_fwd_same;
+    Scatter2DPtr _h_cen_same_fwd_opp;
+    Scatter2DPtr _h_cen_opp_fwd_opp;   
     //@}
 
   };

Modified: trunk/src/Analyses/D0_2008_S7837160.cc
==============================================================================
--- trunk/src/Analyses/D0_2008_S7837160.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/D0_2008_S7837160.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -44,6 +44,10 @@
       _h_dsigminus_deta_35    = bookHisto1D(1,1,1,"/dsigminus_deta_35");
       _h_dsigplus_deta_25     = bookHisto1D(1,1,1,"/dsigplus_deta_25");
       _h_dsigminus_deta_25    = bookHisto1D(1,1,1,"/dsigminus_deta_25");
+
+      _h_asym1		= bookScatter2D(1, 1, 1);
+      _h_asym2		= bookScatter2D(1, 1, 2);
+      _h_asym3		= bookScatter2D(1, 1, 3);
     }
 
 
@@ -92,39 +96,21 @@
 
     /// Finalize
     void finalize() {
-      // \todo YODA divide
-      // Construct asymmetry: (dsig+/deta - dsig-/deta) / (dsig+/deta + dsig-/deta) for each Et region
-      // IHistogram1D* num25_35 = hf.subtract("/num25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
-      // num25_35->scale(100.);
-      // IHistogram1D* denom25_35 = hf.add("/denom25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
-      // assert(num25_35 && denom25_35);
-      // hf.divide(histoDir() + "/d01-x01-y01", *num25_35, *denom25_35);
-      // hf.destroy(num25_35);
-      // hf.destroy(denom25_35);
-      // //
-      // IHistogram1D* num35 = hf.subtract("/num35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
-      // num35->scale(100.);
-      // IHistogram1D* denom35 = hf.add("/denom35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
-      // assert(num35 && denom35);
-      // hf.divide(histoDir() + "/d01-x01-y02", *num35, *denom35);
-      // hf.destroy(num35);
-      // hf.destroy(denom35);
-      // //
-      // IHistogram1D* num25 = hf.subtract("/num25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
-      // num25->scale(100.);
-      // IHistogram1D* denom25 = hf.add("/denom25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
-      // assert(num25 && denom25);
-      // hf.divide(histoDir() + "/d01-x01-y03", *num25, *denom25);
-      // hf.destroy(num25);
-      // hf.destroy(denom25);
-
-      // // Delete raw histos
-      // hf.destroy(_h_dsigplus_deta_25_35);
-      // hf.destroy(_h_dsigminus_deta_25_35);
-      // hf.destroy(_h_dsigplus_deta_35);
-      // hf.destroy(_h_dsigminus_deta_35);
-      // hf.destroy(_h_dsigplus_deta_25);
-      // hf.destroy(_h_dsigminus_deta_25);
+
+      // Construct asymmetry: (dsig+/deta - dsig-/deta) / (dsig+/deta
+      // + dsig-/deta) for each Et region
+      divide(*_h_dsigplus_deta_25_35 - *_h_dsigminus_deta_25_35,
+	     *_h_dsigplus_deta_25_35 + *_h_dsigminus_deta_25_35,
+	     _h_asym1);
+
+      divide(*_h_dsigplus_deta_35 - *_h_dsigminus_deta_35,
+	     *_h_dsigplus_deta_35 + *_h_dsigminus_deta_35,
+	     _h_asym2);
+
+      divide(*_h_dsigplus_deta_25 - *_h_dsigminus_deta_25,
+	     *_h_dsigplus_deta_25 + *_h_dsigminus_deta_25,
+	     _h_asym3);
+
     }
 
     //@}
@@ -137,6 +123,11 @@
     Histo1DPtr _h_dsigplus_deta_25_35, _h_dsigminus_deta_25_35;
     Histo1DPtr _h_dsigplus_deta_35, _h_dsigminus_deta_35;
     Histo1DPtr _h_dsigplus_deta_25, _h_dsigminus_deta_25;
+
+
+    Scatter2DPtr _h_asym1;
+    Scatter2DPtr _h_asym2;
+    Scatter2DPtr _h_asym3;
     //@}
 
   };

Modified: trunk/src/Analyses/MC_WJETS.cc
==============================================================================
--- trunk/src/Analyses/MC_WJETS.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/MC_WJETS.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -5,6 +5,7 @@
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/RivetYODA.hh"
 #include "Rivet/Tools/ParticleIdUtils.hh"
+#include "Rivet/Analysis.hh"
 
 namespace Rivet {
 
@@ -44,6 +45,9 @@
       _htmp_dsigminus_deta = bookHisto1D("lepton_dsigminus_deta", 20, 0.0, 4.0);
       _htmp_dsigplus_deta  = bookHisto1D("lepton_dsigplus_deta", 20, 0.0, 4.0);
 
+      _h_asym = bookScatter2D("W_chargeasymm_eta");
+      _h_asym_pT = bookScatter2D("W_chargeasymm_pT");
+
       MC_JetAnalysis::init();
     }
 
@@ -113,19 +117,14 @@
       scale(_h_lepton_eta, crossSection()/sumOfWeights());
 
       // Construct asymmetry: (dsig+/deta - dsig-/deta) / (dsig+/deta + dsig-/deta) for each Et region
-      // \todo YODA
-      // AIDA::IHistogramFactory& hf = histogramFactory();
-      // IHistogram1D* numtmp = hf.subtract("/numtmp", *_htmp_dsigplus_deta, *_htmp_dsigminus_deta);
-      // IHistogram1D* dentmp = hf.add("/dentmp", *_htmp_dsigplus_deta, *_htmp_dsigminus_deta);
-      // assert(numtmp && dentmp);
-      // hf.divide(histoDir() + "/W_chargeasymm_eta", *numtmp, *dentmp);
-      // hf.destroy(numtmp);
-      // hf.destroy(dentmp);
-      // hf.destroy(_htmp_dsigminus_deta);
-      // hf.destroy(_htmp_dsigplus_deta);
+      divide(*_htmp_dsigplus_deta - *_htmp_dsigminus_deta,
+	     *_htmp_dsigplus_deta + *_htmp_dsigminus_deta,
+	     _h_asym);
 
       // // W charge asymmetry vs. pTW: dsig+/dpT / dsig-/dpT
-      // hf.divide(histoDir() + "/W_chargeasymm_pT", *_h_Wplus_pT, *_h_Wminus_pT);
+      divide(_h_Wplus_pT, _h_Wminus_pT, 
+	     _h_asym_pT);
+
       scale(_h_Wplus_pT, crossSection()/sumOfWeights());
       scale(_h_Wminus_pT, crossSection()/sumOfWeights());
 
@@ -153,6 +152,11 @@
 
     Histo1DPtr _htmp_dsigminus_deta;
     Histo1DPtr _htmp_dsigplus_deta;
+
+    Scatter2DPtr _h_asym;
+    Scatter2DPtr _h_asym_pT;
+
+
     //@}
 
   };

Modified: trunk/src/Analyses/SLD_1999_S3743934.cc
==============================================================================
--- trunk/src/Analyses/SLD_1999_S3743934.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/SLD_1999_S3743934.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -327,6 +327,31 @@
       _histRPBar    = bookHisto1D( 32, 1, 2);
       _histRLambda  = bookHisto1D( 34, 1, 1);
       _histRLBar    = bookHisto1D( 34, 1, 2);
+ 
+
+      _h_Xp_PiPl_Ch		= bookScatter2D(1, 1, 1);
+      _h_Xp_KPl_Ch		= bookScatter2D(2, 1, 1);
+      _h_Xp_Pr_Ch		= bookScatter2D(3, 1, 1);
+      _h_Xp_PiPlCh_PiPlLi	= bookScatter2D(11, 1, 1);
+      _h_Xp_PiPlBo_PiPlLi	= bookScatter2D(11, 1, 2);
+      _h_Xp_KPlCh_KPlLi	= bookScatter2D(13, 1, 1);
+      _h_Xp_KPlBo_KPlLi	= bookScatter2D(13, 1, 2);
+      _h_Xp_KS0Ch_KS0Li	= bookScatter2D(15, 1, 1);
+      _h_Xp_KS0Bo_KS0Li	= bookScatter2D(15, 1, 2);
+      _h_Xp_PrCh_PrLi		= bookScatter2D(17, 1, 1);
+      _h_Xp_PrBo_PrLi		= bookScatter2D(17, 1, 2);
+      _h_Xp_LaCh_LaLi		= bookScatter2D(19, 1, 1);
+      _h_Xp_LaBo_LaLi		= bookScatter2D(19, 1, 2);
+      _h_Xp_K0Ch_K0Li		= bookScatter2D(21, 1, 1);
+      _h_Xp_K0Bo_K0Li		= bookScatter2D(21, 1, 2);
+      _h_Xp_PhiCh_PhiLi	= bookScatter2D(23, 1, 1);
+      _h_Xp_PhiBo_PhiLi	= bookScatter2D(23, 1, 2);
+
+      _h_PiM_PiP		= bookScatter2D(27, 1, 1);
+      _h_KSBar0_KS0		= bookScatter2D(29, 1, 1);
+      _h_KM_KP		= bookScatter2D(31, 1, 1);
+      _h_Pr_PBar		= bookScatter2D(33, 1, 1);
+      _h_Lam_LBar		= bookScatter2D(35, 1, 1); 
 
     }
 
@@ -334,72 +359,80 @@
     /// Finalize
     void finalize() {
       // get the ratio plots sorted out first
-      // @todo YODA
-      //AIDA::IDataPointSet* h = 0;
-      //const string dir = histoDir();
-      //h = histogramFactory().divide(dir + "/d01-x01-y01", *_histXpPiPlusN , *_histXpChargedN );
-      //h = histogramFactory().divide(dir + "/d02-x01-y01", *_histXpKPlusN , *_histXpChargedN );
-      //h = histogramFactory().divide(dir + "/d03-x01-y01", *_histXpProtonN , *_histXpChargedN );
-      //h = histogramFactory().divide(dir + "/d11-x01-y01", *_histXpPiPlusCharm , *_histXpPiPlusLight);
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d11-x01-y02", *_histXpPiPlusBottom, *_histXpPiPlusLight);
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d13-x01-y01", *_tempXpKPlusCharm  , *_tempXpKPlusLight );
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d13-x01-y02", *_histXpKPlusBottom , *_histXpKPlusLight );
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d15-x01-y01", *_tempXpKStar0Charm , *_tempXpKStar0Light);
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d15-x01-y02", *_histXpKStar0Bottom, *_histXpKStar0Light);
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d17-x01-y01", *_tempXpProtonCharm , *_tempXpProtonLight);
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d17-x01-y02", *_histXpProtonBottom, *_histXpProtonLight);
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d19-x01-y01", *_histXpLambdaCharm , *_histXpLambdaLight);
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d19-x01-y02", *_histXpLambdaBottom, *_histXpLambdaLight);
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d21-x01-y01", *_histXpK0Charm     , *_histXpK0Light    );
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h = histogramFactory().divide(dir + "/d21-x01-y02", *_histXpK0Bottom    , *_histXpK0Light    );
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //h = histogramFactory().divide(dir + "/d23-x01-y01", *_histXpPhiCharm    , *_histXpPhiLight   );
-      //scale(h,_SumOfudsWeights/_SumOfcWeights);
-      //h =  histogramFactory().divide(dir + "/d23-x01-y02", *_histXpPhiBottom   , *_histXpPhiLight   );
-      //scale(h,_SumOfudsWeights/_SumOfbWeights);
-      //histogramFactory().destroy(_tempXpKPlusCharm );
-      //histogramFactory().destroy(_tempXpKPlusLight );
-      //histogramFactory().destroy(_tempXpKStar0Charm);
-      //histogramFactory().destroy(_tempXpKStar0Light);
-      //histogramFactory().destroy(_tempXpProtonCharm);
-      //histogramFactory().destroy(_tempXpProtonLight);
+      divide(_histXpPiPlusN,_histXpChargedN,
+	     _h_Xp_PiPl_Ch);
+
+      divide(_histXpKPlusN,_histXpChargedN,
+	     _h_Xp_KPl_Ch);
+
+      divide(_histXpProtonN,_histXpChargedN,
+	     _h_Xp_Pr_Ch);
+
+      divide(_histXpPiPlusCharm ,_histXpPiPlusLight,
+	     _h_Xp_PiPlCh_PiPlLi);
+
+      divide(_histXpPiPlusBottom ,_histXpPiPlusLight,
+	     _h_Xp_PiPlBo_PiPlLi);
+
+      divide(_tempXpKPlusCharm  ,_tempXpKPlusLight,
+	     _h_Xp_KPlCh_KPlLi);
+
+      divide(_histXpKPlusBottom ,_histXpKPlusLight,
+	     _h_Xp_KPlBo_KPlLi);
+
+      divide(_tempXpKStar0Charm,_tempXpKStar0Light,
+	     _h_Xp_KS0Ch_KS0Li);
+
+      divide(_histXpKStar0Bottom,_histXpKStar0Light,
+	     _h_Xp_KS0Bo_KS0Li);
+
+      divide(_tempXpProtonCharm,_tempXpProtonLight,
+	     _h_Xp_PrCh_PrLi);
+
+      divide(_histXpProtonBottom,_histXpProtonLight,
+	     _h_Xp_PrBo_PrLi);
+
+      divide(_histXpLambdaCharm ,_histXpLambdaLight,
+	     _h_Xp_LaCh_LaLi);
+
+      divide(_histXpLambdaBottom ,_histXpLambdaLight,
+	     _h_Xp_LaBo_LaLi);
+
+      divide(_histXpK0Charm ,_histXpK0Light,
+	     _h_Xp_K0Ch_K0Li);
+
+      divide(_histXpK0Bottom ,_histXpK0Light,
+	     _h_Xp_K0Bo_K0Li);
+
+      divide(_histXpPhiCharm ,_histXpPhiLight,
+	     _h_Xp_PhiCh_PhiLi);
+
+      divide(_histXpPhiBottom ,_histXpPhiLight,
+	     _h_Xp_PhiBo_PhiLi);
+
       //// leading particles
-      //Histo1DPtr * num = histogramFactory().subtract(dir + "/n1",*_histRPiMinus,*_histRPiPlus);
-      //Histo1DPtr * den = histogramFactory().add     (dir + "/n2",*_histRPiMinus,*_histRPiPlus);
-      //h   = histogramFactory().divide(dir +"/d27-x01-y01",*num,*den);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n3",*_histRKSBar0,*_histRKS0);
-      //den = histogramFactory().add     (dir + "/n4",*_histRKSBar0,*_histRKS0);
-      //h   = histogramFactory().divide(dir +"/d29-x01-y01",*num,*den);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n5",*_histRKMinus,*_histRKPlus);
-      //den = histogramFactory().add     (dir + "/n6",*_histRKMinus,*_histRKPlus);
-      //h   = histogramFactory().divide(dir +"/d31-x01-y01",*num,*den);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n7",*_histRProton,*_histRPBar);
-      //den = histogramFactory().add     (dir + "/n8",*_histRProton,*_histRPBar);
-      //h   = histogramFactory().divide(dir +"/d33-x01-y01",*num,*den);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n9" ,*_histRLambda,*_histRLBar);
-      //den = histogramFactory().add     (dir + "/n10",*_histRLambda,*_histRLBar);
-      //h   = histogramFactory().divide(dir +"/d35-x01-y01",*num,*den);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
+
+      divide(*_histRPiMinus - *_histRPiPlus,
+	     *_histRPiMinus + *_histRPiPlus,
+	     _h_PiM_PiP);
+
+      divide(*_histRKSBar0 - *_histRKS0,
+	     *_histRKSBar0 + *_histRKS0,
+	     _h_KSBar0_KS0);
+
+      divide(*_histRKMinus - *_histRKPlus,
+	     *_histRKMinus + *_histRKPlus,
+	     _h_KM_KP);
+
+      divide(*_histRProton - *_histRPBar,
+	     *_histRProton + *_histRPBar,
+	     _h_Pr_PBar);
+
+      divide(*_histRLambda - *_histRLBar,
+	     *_histRLambda + *_histRLBar,
+	     _h_Lam_LBar);
+
+
       // then the rest
       Analysis::scale(_histXpPiPlusN    ,1./sumOfWeights());
       Analysis::scale(_histXpKPlusN     ,1./sumOfWeights());
@@ -715,6 +748,31 @@
     Histo1DPtr _histRPBar   ;
     Histo1DPtr _histRLambda ;
     Histo1DPtr _histRLBar   ;
+
+    Scatter2DPtr _h_Xp_PiPl_Ch;
+    Scatter2DPtr _h_Xp_KPl_Ch;
+    Scatter2DPtr _h_Xp_Pr_Ch;
+    Scatter2DPtr _h_Xp_PiPlCh_PiPlLi;
+    Scatter2DPtr _h_Xp_PiPlBo_PiPlLi;
+    Scatter2DPtr _h_Xp_KPlCh_KPlLi;
+    Scatter2DPtr _h_Xp_KPlBo_KPlLi;
+    Scatter2DPtr _h_Xp_KS0Ch_KS0Li;
+    Scatter2DPtr _h_Xp_KS0Bo_KS0Li;
+    Scatter2DPtr _h_Xp_PrCh_PrLi;
+    Scatter2DPtr _h_Xp_PrBo_PrLi;
+    Scatter2DPtr _h_Xp_LaCh_LaLi;
+    Scatter2DPtr _h_Xp_LaBo_LaLi;
+    Scatter2DPtr _h_Xp_K0Ch_K0Li;
+    Scatter2DPtr _h_Xp_K0Bo_K0Li;
+    Scatter2DPtr _h_Xp_PhiCh_PhiLi;
+    Scatter2DPtr _h_Xp_PhiBo_PhiLi; 
+
+    Scatter2DPtr _h_PiM_PiP;
+    Scatter2DPtr _h_KSBar0_KS0;
+    Scatter2DPtr _h_KM_KP;
+    Scatter2DPtr _h_Pr_PBar;
+    Scatter2DPtr _h_Lam_LBar;
+
     //@}
 
   };

Modified: trunk/src/Analyses/SLD_2004_S5693039.cc
==============================================================================
--- trunk/src/Analyses/SLD_2004_S5693039.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/SLD_2004_S5693039.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -236,6 +236,10 @@
       _histRProton  = bookHisto1D(11, 1, 1);
       _histRPBar    = bookHisto1D(11, 1, 2);
 
+      _h_PiM_PiP	= bookScatter2D(9, 1, 3);
+      _h_KM_KP		= bookScatter2D(10, 1, 3);
+      _h_Pr_PBar	= bookScatter2D(11, 1, 3);
+
     }
 
 
@@ -262,25 +266,15 @@
       //AIDA::IDataPointSet * multD2 = bookDataPointSet(8, 3, 3);
       //multD2->point(0)->coordinate(1)->setValue(avgNumPartsBottom-avgNumPartsLight);
 
-      //const string dir = histoDir();
-      //Histo1DPtr * num = histogramFactory().subtract(dir + "/n1",*_histRPiMinus,*_histRPiPlus);
-      //Histo1DPtr * den = histogramFactory().add     (dir + "/n2",*_histRPiMinus,*_histRPiPlus);
-      //AIDA::IDataPointSet* h   = histogramFactory().divide(dir +"/d09-x01-y03",*num,*den);
-      //scale(h,100.);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n3",*_histRKMinus,*_histRKPlus);
-      //den = histogramFactory().add     (dir + "/n4",*_histRKMinus,*_histRKPlus);
-      //h   = histogramFactory().divide(dir +"/d10-x01-y03",*num,*den);
-      //scale(h,100.);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
-      //num = histogramFactory().subtract(dir + "/n5",*_histRProton,*_histRPBar);
-      //den = histogramFactory().add     (dir + "/n6",*_histRProton,*_histRPBar);
-      //h   = histogramFactory().divide(dir +"/d11-x01-y03",*num,*den);
-      //scale(h,100.);
-      //histogramFactory().destroy(num);
-      //histogramFactory().destroy(den);
+
+      divide(*_histRPiMinus - *_histRPiPlus,*_histRPiMinus + *_histRPiPlus,
+	     _h_PiM_PiP);
+
+      divide(*_histRKMinus - *_histRKPlus,*_histRKMinus + *_histRKPlus,
+	     _h_KM_KP);
+
+      divide(*_histRProton - *_histRPBar,*_histRProton + *_histRPBar,
+	     _h_Pr_PBar);
 
       // histograms
       Analysis::scale(_histPCharged   ,1./sumOfWeights());
@@ -379,6 +373,11 @@
     Histo1DPtr _histRKMinus ;
     Histo1DPtr _histRProton ;
     Histo1DPtr _histRPBar   ;
+
+    Scatter2DPtr _h_PiM_PiP;
+    Scatter2DPtr _h_KM_KP;
+    Scatter2DPtr _h_Pr_PBar;
+
     //@}
 
     // @todo YODA

Modified: trunk/src/Analyses/STAR_2006_S6500200.cc
==============================================================================
--- trunk/src/Analyses/STAR_2006_S6500200.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/STAR_2006_S6500200.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -37,6 +37,11 @@
       _h_pT_piminus    = bookHisto1D(1, 2, 1);
       _h_pT_proton     = bookHisto1D(1, 3, 1);
       _h_pT_antiproton = bookHisto1D(1, 4, 1);
+
+      _h_piminus_piplus	= bookScatter2D(2, 1, 1);
+      _h_antipr_pr	= bookScatter2D(2, 2, 1);
+      _h_pr_piplus	= bookScatter2D(2, 3, 1);
+      _h_antipr_piminus	= bookScatter2D(2, 4, 1);  
     }
 
 
@@ -82,14 +87,17 @@
 
     /// Finalize
     void finalize() {
-      // \todo YODA divide
-      // AIDA::IHistogramFactory& hf = histogramFactory();
-      // const string dir = histoDir();
-
-      // hf.divide(dir + "/d02-x01-y01", *_h_pT_piminus, *_h_pT_piplus);
-      // hf.divide(dir + "/d02-x02-y01", *_h_pT_antiproton, *_h_pT_proton);
-      // hf.divide(dir + "/d02-x03-y01", *_h_pT_proton, *_h_pT_piplus);
-      // hf.divide(dir + "/d02-x04-y01", *_h_pT_antiproton, *_h_pT_piminus);
+      divide(_h_pT_piminus, _h_pT_piplus,
+	     _h_piminus_piplus);
+
+      divide(_h_pT_antiproton, _h_pT_proton,
+	     _h_antipr_pr);
+
+      divide(_h_pT_proton, _h_pT_piplus,
+	     _h_pr_piplus);
+ 
+      divide(_h_pT_antiproton, _h_pT_piminus,
+	     _h_antipr_piminus);
 
       scale(_h_pT_piplus,     1./(2*M_PI*_sumWeightSelected));
       scale(_h_pT_piminus,    1./(2*M_PI*_sumWeightSelected));
@@ -108,6 +116,12 @@
     Histo1DPtr _h_pT_piminus;
     Histo1DPtr _h_pT_proton;
     Histo1DPtr _h_pT_antiproton;
+
+    Scatter2DPtr _h_piminus_piplus;
+    Scatter2DPtr _h_antipr_pr;
+    Scatter2DPtr _h_pr_piplus;
+    Scatter2DPtr _h_antipr_piminus;
+
   };
 
 

Modified: trunk/src/Analyses/STAR_2006_S6860818.cc
==============================================================================
--- trunk/src/Analyses/STAR_2006_S6860818.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Analyses/STAR_2006_S6860818.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -45,6 +45,8 @@
       _h_pT_xiplus     = bookHisto1D(1, 7, 1);
       //_h_pT_omega      = bookHisto1D(1, 8, 1);
       _h_antibaryon_baryon_ratio = bookScatter2D(2, 1, 1);
+      _h_lambar_lam	= bookScatter2D(2, 2, 1);
+      _h_xiplus_ximinus = bookScatter2D(2, 3, 1);
       _h_pT_vs_mass    = bookProfile1D(3, 1, 1);
     }
 
@@ -153,12 +155,12 @@
         }
       }
       _h_antibaryon_baryon_ratio->addPoints( points );
-
-      // \todo YODA divide
-      // AIDA::IHistogramFactory& hf = histogramFactory();
-      // const string dir = histoDir();
-      // hf.divide(dir + "/d02-x02-y01", *_h_pT_lambdabar, *_h_pT_lambda);
-      // hf.divide(dir + "/d02-x03-y01", *_h_pT_xiplus, *_h_pT_ximinus);
+ 
+      divide(_h_pT_lambdabar,_h_pT_lambda,
+	     _h_lambar_lam);
+      
+      divide(_h_pT_xiplus,_h_pT_ximinus,
+	     _h_xiplus_ximinus);
 
       scale(_h_pT_k0s,       1./(2*M_PI*_sumWeightSelected));
       scale(_h_pT_kminus,    1./(2*M_PI*_sumWeightSelected));
@@ -190,6 +192,9 @@
     //Histo1DPtr _h_pT_omega;
     Scatter2DPtr _h_antibaryon_baryon_ratio;
     Profile1DPtr   _h_pT_vs_mass;
+    Scatter2DPtr _h_lambar_lam;
+    Scatter2DPtr _h_xiplus_ximinus;
+
   };
 
 

Modified: trunk/src/Core/Analysis.cc
==============================================================================
--- trunk/src/Core/Analysis.cc	Wed Nov 14 18:40:36 2012	(r4012)
+++ trunk/src/Core/Analysis.cc	Wed Nov 14 18:45:36 2012	(r4013)
@@ -410,6 +410,38 @@
   // }
 
 
+  void Analysis::divide(Histo1DPtr h1, Histo1DPtr h2, Scatter2DPtr s) const {
+    // preserve the path info
+    std::string path = s->path();
+    *s = *h1 / *h2;
+    s->setPath( path );
+  }
+
+  void Analysis::divide(Profile1DPtr p1, Profile1DPtr p2, Scatter2DPtr s) const {
+    // preserve the path info
+    std::string path = s->path();
+    *s = *p1 / *p2;
+    s->setPath( path );
+  }
+
+  void Analysis::divide(const Histo1D & h1, 
+			const Histo1D & h2, 
+			Scatter2DPtr s) const {
+    // preserve the path info
+    std::string path = s->path();
+    *s = h1 / h2;
+    s->setPath( path );
+  }
+
+  void Analysis::divide(const Profile1D & p1, 
+			const Profile1D & p2, 
+			Scatter2DPtr s) const {
+    // preserve the path info
+    std::string path = s->path();
+    *s = p1 / p2;
+    s->setPath( path );
+  }
+
   void Analysis::normalize(Histo1DPtr histo, double norm, bool includeoverflows) {
     if (!histo) {
       MSG_ERROR("Failed to normalize histo=NULL in analysis " << name() << " (norm=" << norm << ")");


More information about the Rivet-svn mailing list