[Rivet-svn] r1864 - in trunk: include/Rivet/Projections src/Analyses src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Oct 5 11:59:26 BST 2009


Author: buckley
Date: Mon Oct  5 11:59:26 2009
New Revision: 1864

Log:
Adding moments to OPAL event shape analysis, and interface improvement to Hemispheres proj

Modified:
   trunk/include/Rivet/Projections/Hemispheres.hh
   trunk/src/Analyses/ALEPH_1996_S3486095.cc
   trunk/src/Analyses/DELPHI_1996_S3430090.cc
   trunk/src/Analyses/Makefile.am
   trunk/src/Analyses/OPAL_2004_S6132243.cc
   trunk/src/Projections/Hemispheres.cc

Modified: trunk/include/Rivet/Projections/Hemispheres.hh
==============================================================================
--- trunk/include/Rivet/Projections/Hemispheres.hh	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/include/Rivet/Projections/Hemispheres.hh	Mon Oct  5 11:59:26 2009	(r1864)
@@ -92,23 +92,23 @@
 
     /// @name Hemisphere masses (scaled by \f$ 1 / E^2_\mathrm{vis} \f$).
     ///@{
-    const double getE2vis() const { return _E2vis; }
-    const double getM2high() const { return _M2high; }
-    const double getM2low() const { return _M2low; }
-    const double getM2diff() const { return _M2high -_M2low; }
-    const double getScaledM2high() const { 
+    const double E2vis() const { return _E2vis; }
+    const double M2high() const { return _M2high; }
+    const double M2low() const { return _M2low; }
+    const double M2diff() const { return _M2high -_M2low; }
+    const double scaledM2high() const { 
       if (_M2high == 0.0) return 0.0;
       if (_E2vis != 0.0) return _M2high/_E2vis; 
       else return std::numeric_limits<double>::max(); 
     }
-    const double getScaledM2low() const {
+    const double scaledM2low() const {
       if (_M2low == 0.0) return 0.0;
       if (_E2vis != 0.0) return _M2low/_E2vis;
       else return std::numeric_limits<double>::max(); 
     }
-    const double getScaledM2diff() const { 
-      if (getM2diff() == 0.0) return 0.0;
-      if (_E2vis != 0.0) return getM2diff()/_E2vis; 
+    const double scaledM2diff() const { 
+      if (M2diff() == 0.0) return 0.0;
+      if (_E2vis != 0.0) return M2diff()/_E2vis; 
       else return std::numeric_limits<double>::max(); 
     }
     ///@}
@@ -116,10 +116,10 @@
 
     /// @name Hemisphere broadenings.
     ///@{
-    const double getBmax() const { return _Bmax; }
-    const double getBmin() const { return _Bmin; }
-    const double getBsum() const { return _Bmax + _Bmin; }
-    const double getBdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
+    const double Bmax() const { return _Bmax; }
+    const double Bmin() const { return _Bmin; }
+    const double Bsum() const { return _Bmax + _Bmin; }
+    const double Bdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
     ///@}
 
 

Modified: trunk/src/Analyses/ALEPH_1996_S3486095.cc
==============================================================================
--- trunk/src/Analyses/ALEPH_1996_S3486095.cc	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/src/Analyses/ALEPH_1996_S3486095.cc	Mon Oct  5 11:59:26 2009	(r1864)
@@ -183,7 +183,7 @@
       // Hemispheres
       getLog() << Log::DEBUG << "Calculating hemisphere variables" << endl;
       const Hemispheres& hemi = applyProjection<Hemispheres>(e, "Hemispheres");
-      _histHeavyJetMass->fill(hemi.getScaledM2high(), weight);
+      _histHeavyJetMass->fill(hemi.scaledM2high(), weight);
 
       // Iterate over all the charged final state particles.
       double Evis = 0.0;
@@ -193,10 +193,10 @@
       double rapt20 = 0.;
       //int numChParticles = 0;
       getLog() << Log::DEBUG << "About to iterate over charged FS particles" << endl;
-      for (ParticleVector::const_iterator p = fs.particles().begin(); p != fs.particles().end(); ++p) {
+      foreach (const Particle& p, fs.particles()) {
         // Get momentum and energy of each particle.
-        const Vector3 mom3 = p->momentum().vector3();
-        const double energy = p->momentum().E();
+        const Vector3 mom3 = p.momentum().vector3();
+        const double energy = p.momentum().E();
         Evis += energy;
         _numChParticles += weight;
 
@@ -217,17 +217,17 @@
         // Calculate rapidities w.r.t. thrust.
         const double rapidityT = 0.5 * std::log((energy + momT) / (energy - momT));
         _histRapidityT->fill(rapidityT, weight);
-        if (std::fabs(rapidityT) <= .5)  {
-            rapt05 += 1.;
+        if (std::fabs(rapidityT) <= 0.5)  {
+            rapt05 += 1.0;
         }
-        if (std::fabs(rapidityT) <= 1.)  {
-            rapt10 += 1.;
+        if (std::fabs(rapidityT) <= 1.0)  {
+            rapt10 += 1.0;
         }
         if (std::fabs(rapidityT) <= 1.5) {
-            rapt15 += 1.;
+            rapt15 += 1.0;
         }
-        if (std::fabs(rapidityT) <= 2.)  {
-            rapt20 += 1.;
+        if (std::fabs(rapidityT) <= 2.0)  {
+            rapt20 += 1.0;
         } 
 
       }

Modified: trunk/src/Analyses/DELPHI_1996_S3430090.cc
==============================================================================
--- trunk/src/Analyses/DELPHI_1996_S3430090.cc	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/src/Analyses/DELPHI_1996_S3430090.cc	Mon Oct  5 11:59:26 2009	(r1864)
@@ -146,7 +146,6 @@
       // First, veto on leptonic events by requiring at least 4 charged FS particles
       const FinalState& fs = applyProjection<FinalState>(e, "FS");
       const size_t numParticles = fs.particles().size();
-
       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
       if (numParticles < 2) {
         getLog() << Log::DEBUG << "Failed leptonic event cut" << endl;
@@ -201,13 +200,13 @@
       // Hemispheres
       getLog() << Log::DEBUG << "Calculating hemisphere variables" << endl;
       const Hemispheres& hemi = applyProjection<Hemispheres>(e, "Hemispheres");
-      _histHemiMassH->fill(hemi.getScaledM2high(), weight); 
-      _histHemiMassL->fill(hemi.getScaledM2low(), weight); 
-      _histHemiMassD->fill(hemi.getScaledM2diff(), weight); 
-      _histHemiBroadW->fill(hemi.getBmax(), weight); 
-      _histHemiBroadN->fill(hemi.getBmin(), weight); 
-      _histHemiBroadT->fill(hemi.getBsum(), weight); 
-      _histHemiBroadD->fill(hemi.getBdiff(), weight); 
+      _histHemiMassH->fill(hemi.scaledM2high(), weight);
+      _histHemiMassL->fill(hemi.scaledM2low(), weight);
+      _histHemiMassD->fill(hemi.scaledM2diff(), weight);
+      _histHemiBroadW->fill(hemi.Bmax(), weight);
+      _histHemiBroadN->fill(hemi.Bmin(), weight);
+      _histHemiBroadT->fill(hemi.Bsum(), weight);
+      _histHemiBroadD->fill(hemi.Bdiff(), weight);
       
       // Iterate over all the charged final state particles.
       double Evis = 0.0;
@@ -248,7 +247,9 @@
         _histRapidityS->fill(rapidityS, weight); 
       }
       Evis2 = Evis*Evis;
-      
+
+      // (A)EEC
+      // Need iterators since second loop starts at current outer loop iterator, i.e. no "foreach" here!
       for (ParticleVector::const_iterator p_i = fs.particles().begin(); p_i != fs.particles().end(); ++p_i) {
         for (ParticleVector::const_iterator p_j = p_i; p_j != fs.particles().end(); ++p_j) {
           if (p_i == p_j) continue;

Modified: trunk/src/Analyses/Makefile.am
==============================================================================
--- trunk/src/Analyses/Makefile.am	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/src/Analyses/Makefile.am	Mon Oct  5 11:59:26 2009	(r1864)
@@ -72,8 +72,8 @@
     DELPHI_1996_S3430090.cc \
     DELPHI_2002_069_CONF_603.cc \
     DELPHI_2003_WUD_03_11.cc \
-    OPAL_1998_S3780481.cc
-    #OPAL_2004_S6132243.cc 
+    OPAL_1998_S3780481.cc \
+    OPAL_2004_S6132243.cc 
 
 
 lib_LTLIBRARIES += RivetRHICAnalyses.la

Modified: trunk/src/Analyses/OPAL_2004_S6132243.cc
==============================================================================
--- trunk/src/Analyses/OPAL_2004_S6132243.cc	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/src/Analyses/OPAL_2004_S6132243.cc	Mon Oct  5 11:59:26 2009	(r1864)
@@ -2,6 +2,13 @@
 #include "Rivet/Analysis.hh"
 #include "Rivet/RivetAIDA.hh"
 #include "Rivet/Tools/Logging.hh"
+#include "Rivet/Projections/Beam.hh"
+#include "Rivet/Projections/ChargedFinalState.hh"
+#include "Rivet/Projections/Sphericity.hh"
+#include "Rivet/Projections/Thrust.hh"
+#include "Rivet/Projections/FastJets.hh"
+#include "Rivet/Projections/ParisiTensor.hh"
+#include "Rivet/Projections/Hemispheres.hh"
 
 namespace Rivet {
 
@@ -11,7 +18,7 @@
 
     /// Constructor
     OPAL_2004_S6132243() : Analysis("OPAL_2004_S6132243") { 
-
+      //
     }
 
 
@@ -30,62 +37,54 @@
       addProjection(thrust, "Thrust");
       addProjection(Hemispheres(thrust), "Hemispheres");
 
+      // Counters
+      _sumPassedWeights = 0;
+
       // Book histograms
       // Energies: 91, 133, 177 (161-183), 197 (189-209) => index 0..4
       for (int isqrts = 0; isqrts < 4; ++isqrts) {
-        _hist1MinusT[isqrts] = bookHistogram(1, 1, isqrts+1);
-        _histHemiMassH[isqrts] = bookHistogram(2, 1, isqrts+1);
-        _histCParam[isqrts] = bookHistogram(3, 1, isqrts+1);
-        _histHemiBroadT[isqrts] = bookHistogram(4, 1, isqrts+1);
-        _histHemiBroadW[isqrts] = bookHistogram(5, 1, isqrts+1);
-        _histY23Durham[isqrts] = bookHistogram(6, 1, isqrts+1);
-        _histTMajor[isqrts] = bookHistogram(7, 1, isqrts+1);
-        _histTMinor[isqrts] = bookHistogram(8, 1, isqrts+1);
-        _histAplanarity[isqrts] = bookHistogram(9, 1, isqrts+1);
-        _histSphericity[isqrts] = bookHistogram(10, 1, isqrts+1);
-        _histOblateness[isqrts] = bookHistogram(11, 1, isqrts+1);
-        _histHemiMassL[isqrts] = bookHistogram(12, 1, isqrts+1);
-        _histHemiBroadN[isqrts] = bookHistogram(13, 1, isqrts+1);
-        _histDParam[isqrts] = bookHistogram(14, 1, isqrts+1);
+        _hist1MinusT[isqrts]    = bookHistogram1D(1, 1, isqrts+1);
+        _histHemiMassH[isqrts]  = bookHistogram1D(2, 1, isqrts+1);
+        _histCParam[isqrts]     = bookHistogram1D(3, 1, isqrts+1);
+        _histHemiBroadT[isqrts] = bookHistogram1D(4, 1, isqrts+1);
+        _histHemiBroadW[isqrts] = bookHistogram1D(5, 1, isqrts+1);
+        _histY23Durham[isqrts]  = bookHistogram1D(6, 1, isqrts+1);
+        _histTMajor[isqrts]     = bookHistogram1D(7, 1, isqrts+1);
+        _histTMinor[isqrts]     = bookHistogram1D(8, 1, isqrts+1);
+        _histAplanarity[isqrts] = bookHistogram1D(9, 1, isqrts+1);
+        _histSphericity[isqrts] = bookHistogram1D(10, 1, isqrts+1);
+        _histOblateness[isqrts] = bookHistogram1D(11, 1, isqrts+1);
+        _histHemiMassL[isqrts]  = bookHistogram1D(12, 1, isqrts+1);
+        _histHemiBroadN[isqrts] = bookHistogram1D(13, 1, isqrts+1);
+        _histDParam[isqrts]     = bookHistogram1D(14, 1, isqrts+1);
         //
-        _hist1MinusTMom[isqrts] = bookHistogram(15, 1, isqrts+1);
-        _histHemiMassHMom[isqrts] = bookHistogram(16, 1, isqrts+1);
-        _histCParamMom[isqrts] = bookHistogram(17, 1, isqrts+1);
-        _histHemiBroadTMom[isqrts] = bookHistogram(18, 1, isqrts+1);
-        _histHemiBroadWMom[isqrts] = bookHistogram(19, 1, isqrts+1);
-        _histY23DurhamMom[isqrts] = bookHistogram(20, 1, isqrts+1);
-        _histTMajorMom[isqrts] = bookHistogram(21, 1, isqrts+1);
-        _histTMinorMom[isqrts] = bookHistogram(22, 1, isqrts+1);
-        _histSphericityMom[isqrts] = bookHistogram(23, 1, isqrts+1);
-        _histOblatenessMom[isqrts] = bookHistogram(24, 1, isqrts+1);
-        _histHemiMassLMom[isqrts] = bookHistogram(25, 1, isqrts+1);
-        _histHemiBroadNMom[isqrts] = bookHistogram(26, 1, isqrts+1);
+        _hist1MinusTMom[isqrts]    = bookProfile1D(15, 1, isqrts+1);
+        _histHemiMassHMom[isqrts]  = bookProfile1D(16, 1, isqrts+1);
+        _histCParamMom[isqrts]     = bookProfile1D(17, 1, isqrts+1);
+        _histHemiBroadTMom[isqrts] = bookProfile1D(18, 1, isqrts+1);
+        _histHemiBroadWMom[isqrts] = bookProfile1D(19, 1, isqrts+1);
+        _histY23DurhamMom[isqrts]  = bookProfile1D(20, 1, isqrts+1);
+        _histTMajorMom[isqrts]     = bookProfile1D(21, 1, isqrts+1);
+        _histTMinorMom[isqrts]     = bookProfile1D(22, 1, isqrts+1);
+        _histSphericityMom[isqrts] = bookProfile1D(23, 1, isqrts+1);
+        _histOblatenessMom[isqrts] = bookProfile1D(24, 1, isqrts+1);
+        _histHemiMassLMom[isqrts]  = bookProfile1D(25, 1, isqrts+1);
+        _histHemiBroadNMom[isqrts] = bookProfile1D(26, 1, isqrts+1);
       }
-      //
-      _hist1MinusTVar[isqrts] = bookHistogram(27, 1, 1);
-      _histHemiMassHVar[isqrts] = bookHistogram(27, 1, 2);
-      _histCParamVar[isqrts] = bookHistogram(27, 1, 3);
-      _histHemiBroadTVar[isqrts] = bookHistogram(27, 1, 4);
-      _histHemiBroadWVar[isqrts] = bookHistogram(27, 1, 5);
-      _histY23DurhamVar[isqrts] = bookHistogram(27, 1, 6);
-      _histTMajorVar[isqrts] = bookHistogram(27, 1, 7);
-      _histTMinorVar[isqrts] = bookHistogram(27, 1, 8);
-      _histSphericityVar[isqrts] = bookHistogram(27, 1, 9);
-      _histOblatenessVar[isqrts] = bookHistogram(27, 1, 10);
-      _histHemiMassLVar[isqrts] = bookHistogram(27, 1, 11);
-      _histHemiBroadNVar[isqrts] = bookHistogram(27, 1, 12);
     }
 
 
-    void analyze(const Event & event) { 
-      const FinalState& cfs = applyProjection<FinalState>(e, "CFS");
+    void analyze(const Event& event) { 
+      const FinalState& cfs = applyProjection<FinalState>(event, "CFS");
       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
       if (cfs.size() < 2) vetoEvent;
-      const double weight = e.weight();
+
+      // Increment passed-cuts weight sum
+      const double weight = event.weight();
+      _sumPassedWeights += weight;
 
       // Get beams and average beam momentum
-      const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams();
-      const double sqrts = beams.sqrtS();
+      const double sqrts = applyProjection<Beam>(event, "Beams").sqrtS();
 
       // Translate sqrt(s) into a histo index for the majority of histos
       size_t ih = 5;
@@ -102,94 +101,68 @@
       }
 
       // Thrusts
-      const Thrust& thrust = applyProjection<Thrust>(e, "Thrust");
+      const Thrust& thrust = applyProjection<Thrust>(event, "Thrust");
       _hist1MinusT[ih]->fill(1-thrust.thrust(), weight);
       _histTMajor[ih]->fill(thrust.thrustMajor(), weight); 
       _histTMinor[ih]->fill(thrust.thrustMinor(), weight); 
       _histOblateness[ih]->fill(thrust.oblateness(), weight);
       for (int n = 1; n <= 5; ++n) {
         _hist1MinusTMom[ih]->fill(n, pow(n, 1-thrust.thrust()), weight);
-        _histTMajorMom[ih]->fill(n, pow(n, 1-thrust.thrustMajor()), weight);
-        _histTMinorMom[ih]->fill(n, pow(n, 1-thrust.thrustMinor()), weight);
-        _histOblatenessMom[ih]->fill(n, pow(n, 1-thrust.oblateness()), weight);
-      }
-      /// @todo Variance counters
-      // var(1-T) d27-x01-y01
-      // var(T_maj) d27-x01-y07
-      // var(T_min) d27-x01-y08
-      // var(O) d27-x01-y10
+        _histTMajorMom[ih]->fill(n, pow(n, thrust.thrustMajor()), weight);
+        _histTMinorMom[ih]->fill(n, pow(n, thrust.thrustMinor()), weight);
+        _histOblatenessMom[ih]->fill(n, pow(n, thrust.oblateness()), weight);
+      }
 
       // Jets
-      const FastJets& durjet = applyProjection<FastJets>(e, "DurhamJets");
+      const FastJets& durjet = applyProjection<FastJets>(event, "DurhamJets");
       if (durjet.clusterSeq()) {
-        _histY23Durham[ih]->fill(durjet.clusterSeq()->exclusive_ymerge(3), weight); 
+        /// @todo Need separate normalisation due to clusterseq / 3 jet requirement?
+        const double y23 = durjet.clusterSeq()->exclusive_ymerge(3);
+        _histY23Durham[ih]->fill(y23, weight);
+        for (int n = 1; n <= 5; ++n) {
+          _histY23DurhamMom[ih]->fill(n, pow(n, y23), weight);
+        }
       }
-      // Moments 1..5 of Y23 (Dur)
-      // d20-x01-y01
-      // d20-x01-y02
-      // d20-x01-y03
-      // d20-x01-y04
-      // var(Y23) d27-x01-y06
 
       // Sphericities
-      const Sphericity& sphericity = applyProjection<Sphericity>(e, "Sphericity");
-      _histSphericity[ih]->fill(sphericity.sphericity(), weight);
-      _histAplanarity[ih]->fill(sphericity.aplanarity(), weight);
-      // Moments 1..5 of S
-      // d23-x01-y01
-      // d23-x01-y02
-      // d23-x01-y03
-      // d23-x01-y04
-      // var(S) d27-x01-y09
-      
+      const Sphericity& sphericity = applyProjection<Sphericity>(event, "Sphericity");
+      const double sph = sphericity.sphericity();
+      const double apl = sphericity.aplanarity();
+      _histSphericity[ih]->fill(sph, weight);
+      _histAplanarity[ih]->fill(apl, weight);
+      for (int n = 1; n <= 5; ++n) {
+        _histSphericityMom[ih]->fill(n, pow(n, sph), weight);
+      }
+
       // C & D params
-      const ParisiTensor& parisi = applyProjection<ParisiTensor>(e, "Parisi");
-      _histCParam[ih]->fill(parisi.C(), weight);
-      _histDParam[ih]->fill(parisi.D(), weight);
-      // Moments 1..5 of C
-      // d17-x01-y01
-      // d17-x01-y02
-      // d17-x01-y03
-      // d17-x01-y04
-      // var(C) d27-x01-y03
+      const ParisiTensor& parisi = applyProjection<ParisiTensor>(event, "Parisi");
+      const double cparam = parisi.C();
+      const double dparam = parisi.D();
+      _histCParam[ih]->fill(cparam, weight);
+      _histDParam[ih]->fill(dparam, weight);
+      for (int n = 1; n <= 5; ++n) {
+        _histCParamMom[ih]->fill(n, pow(n, cparam), weight);
+      }
       
       // Hemispheres
-      const Hemispheres& hemi = applyProjection<Hemispheres>(e, "Hemispheres");
-      _histHemiMassH[ih]->fill(hemi.getScaledM2high(), weight);
-      _histHemiMassL[ih]->fill(hemi.getScaledM2low(), weight);
-      _histHemiBroadW[ih]->fill(hemi.getBmax(), weight);
-      _histHemiBroadN[ih]->fill(hemi.getBmin(), weight);
-      _histHemiBroadT[ih]->fill(hemi.getBsum(), weight);
-      // Moments 1..5 of M_H
-      // d16-x01-y01
-      // d16-x01-y02
-      // d16-x01-y03
-      // d16-x01-y04
-      // Moments 1..5 of B_T
-      // d18-x01-y01
-      // d18-x01-y02
-      // d18-x01-y03
-      // d18-x01-y04
-      // Moments 1..5 of B_W
-      // d19-x01-y01
-      // d19-x01-y02
-      // d19-x01-y03
-      // d19-x01-y04
-      // Moments 1..5 of M_L
-      // d25-x01-y01
-      // d25-x01-y02
-      // d25-x01-y03
-      // d25-x01-y04
-      // Moments 1..5 of B_N
-      // d26-x01-y01
-      // d26-x01-y02
-      // d26-x01-y03
-      // d26-x01-y04
-      // var(M_H) d27-x01-y02
-      // var(B_T) d27-x01-y04
-      // var(B_W) d27-x01-y05
-      // var(M_L) d27-x01-y11
-      // var(B_N) d27-x01-y12 
+      const Hemispheres& hemi = applyProjection<Hemispheres>(event, "Hemispheres");
+      const double hemi_mh = hemi.scaledM2high();
+      const double hemi_ml = hemi.scaledM2low();
+      const double hemi_bmax = hemi.Bmax();
+      const double hemi_bmin = hemi.Bmin();
+      const double hemi_bsum = hemi.Bsum();
+      _histHemiMassH[ih]->fill(hemi_mh, weight);
+      _histHemiMassL[ih]->fill(hemi_ml, weight);
+      _histHemiBroadW[ih]->fill(hemi_bmax, weight);
+      _histHemiBroadN[ih]->fill(hemi_bmin, weight);
+      _histHemiBroadT[ih]->fill(hemi_bsum, weight);
+      for (int n = 1; n <= 5; ++n) {
+        _histHemiMassHMom[ih]->fill(n, pow(n, hemi_mh), weight);
+        _histHemiMassLMom[ih]->fill(n, pow(n, hemi_ml), weight);
+        _histHemiBroadWMom[ih]->fill(n, pow(n, hemi_bmax), weight);
+        _histHemiBroadNMom[ih]->fill(n, pow(n, hemi_bmin), weight);
+        _histHemiBroadTMom[ih]->fill(n, pow(n, hemi_bsum), weight);
+      }
     }
 
 
@@ -209,11 +182,21 @@
         normalize(_histHemiBroadT[isqrts]); 
         normalize(_histCParam[isqrts]);
         normalize(_histDParam[isqrts]);
-        normalize(_histY23Durham[isqrts]); 
+        normalize(_histY23Durham[isqrts]);
+        //
+        // scale(_hist1MinusTMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histTMajorMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histTMinorMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histOblatenessMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histSphericityMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histHemiMassHMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histHemiMassLMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histHemiBroadWMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histHemiBroadNMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histHemiBroadTMom[isqrts], 1.0/_sumPassedWeights); 
+        // scale(_histCParamMom[isqrts], 1.0/_sumPassedWeights);
+        // scale(_histY23DurhamMom[isqrts], 1.0/_sumPassedWeights); 
       }
-      // for (int n = 1; n <= 5; ++n) {
-      //   scale(_histOneMinusTVar, 1.0/_passedCutWeightSum);
-      // }
     }
 
     //@}
@@ -221,21 +204,38 @@
 
   private:
 
+    // Counter of event weights passing the cuts
+    double _sumPassedWeights;
+
     // Event shape histos at 4 energies
-    AIDA::IHistogram1D _hist1MinusT[4];
-    AIDA::IHistogram1D _histHemiMassH[4];
-    AIDA::IHistogram1D _histCParam[4];
-    AIDA::IHistogram1D _histHemiBroadT[4];
-    AIDA::IHistogram1D _histHemiBroadW[4];
-    AIDA::IHistogram1D _histY23Durham[4];
-    AIDA::IHistogram1D _histTMajor[4];
-    AIDA::IHistogram1D _histTMinor[4];
-    AIDA::IHistogram1D _histAplanarity[4];
-    AIDA::IHistogram1D _histSphericity[4];
-    AIDA::IHistogram1D _histOblateness[4];
-    AIDA::IHistogram1D _histHemiMassL[4];
-    AIDA::IHistogram1D _histHemiBroadN[4];
-    AIDA::IHistogram1D _histDParam[4];
+    AIDA::IHistogram1D* _hist1MinusT[4];
+    AIDA::IHistogram1D* _histHemiMassH[4];
+    AIDA::IHistogram1D* _histCParam[4];
+    AIDA::IHistogram1D* _histHemiBroadT[4];
+    AIDA::IHistogram1D* _histHemiBroadW[4];
+    AIDA::IHistogram1D* _histY23Durham[4];
+    AIDA::IHistogram1D* _histTMajor[4];
+    AIDA::IHistogram1D* _histTMinor[4];
+    AIDA::IHistogram1D* _histAplanarity[4];
+    AIDA::IHistogram1D* _histSphericity[4];
+    AIDA::IHistogram1D* _histOblateness[4];
+    AIDA::IHistogram1D* _histHemiMassL[4];
+    AIDA::IHistogram1D* _histHemiBroadN[4];
+    AIDA::IHistogram1D* _histDParam[4];
+
+    // Event shape moment histos at 4 energies
+    AIDA::IProfile1D* _hist1MinusTMom[4];
+    AIDA::IProfile1D* _histHemiMassHMom[4];
+    AIDA::IProfile1D* _histCParamMom[4];
+    AIDA::IProfile1D* _histHemiBroadTMom[4];
+    AIDA::IProfile1D* _histHemiBroadWMom[4];
+    AIDA::IProfile1D* _histY23DurhamMom[4];
+    AIDA::IProfile1D* _histTMajorMom[4];
+    AIDA::IProfile1D* _histTMinorMom[4];
+    AIDA::IProfile1D* _histSphericityMom[4];
+    AIDA::IProfile1D* _histOblatenessMom[4];
+    AIDA::IProfile1D* _histHemiMassLMom[4];
+    AIDA::IProfile1D* _histHemiBroadNMom[4];
 
   };
 

Modified: trunk/src/Projections/Hemispheres.cc
==============================================================================
--- trunk/src/Projections/Hemispheres.cc	Mon Oct  5 11:58:44 2009	(r1863)
+++ trunk/src/Projections/Hemispheres.cc	Mon Oct  5 11:59:26 2009	(r1864)
@@ -3,6 +3,7 @@
 
 namespace Rivet {
 
+
   void Hemispheres::project(const Event& e) {
     // Get thrust axes.
     const AxesDefinition& ax = applyProjection<AxesDefinition>(e, "Axes");
@@ -14,8 +15,8 @@
     const FinalState& fs = applyProjection<FinalState>(e, ax.getProjection("FS"));
     const ParticleVector particles = fs.particles();
     getLog() << Log::DEBUG << "number of particles = " << particles.size() << endl;
-    for (ParticleVector::const_iterator p = particles.begin(); p != particles.end(); ++p) {
-      const FourMomentum p4 = p->momentum();
+    foreach (const Particle& p, particles) {
+      const FourMomentum p4 = p.momentum();
       const Vector3 p3 = p4.vector3();
       const double p3Mag = mod(p3);
       const double p3Para = dot(p3, n);
@@ -64,4 +65,5 @@
     _highMassEqMaxBroad = ((withIsMaxMass && withIsMaxBroad) || (!withIsMaxMass && !withIsMaxBroad));
   }
 
+
 }


More information about the Rivet-svn mailing list