[Rivet-svn] r3350 - in trunk: . src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Sep 13 18:00:19 BST 2011


Author: buckley
Date: Tue Sep 13 18:00:19 2011
New Revision: 3350

Log:
Removing uses of getLog, cout, etc. from all projections

Modified:
   trunk/ChangeLog
   trunk/src/Projections/Beam.cc
   trunk/src/Projections/ChargedFinalState.cc
   trunk/src/Projections/ClusteredPhotons.cc
   trunk/src/Projections/FParameter.cc
   trunk/src/Projections/FastJets.cc
   trunk/src/Projections/FinalState.cc
   trunk/src/Projections/FoxWolframMoments.cc
   trunk/src/Projections/HadronicFinalState.cc
   trunk/src/Projections/Hemispheres.cc
   trunk/src/Projections/InitialQuarks.cc
   trunk/src/Projections/JetAlg.cc
   trunk/src/Projections/LeadingParticlesFinalState.cc
   trunk/src/Projections/MergedFinalState.cc
   trunk/src/Projections/NeutralFinalState.cc
   trunk/src/Projections/PVertex.cc
   trunk/src/Projections/Sphericity.cc
   trunk/src/Projections/Thrust.cc
   trunk/src/Projections/TriggerCDFRun0Run1.cc
   trunk/src/Projections/TriggerCDFRun2.cc
   trunk/src/Projections/TriggerUA5.cc
   trunk/src/Projections/UnstableFinalState.cc
   trunk/src/Projections/VetoedFinalState.cc
   trunk/src/Projections/WFinder.cc
   trunk/src/Projections/ZFinder.cc

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/ChangeLog	Tue Sep 13 18:00:19 2011	(r3350)
@@ -1,7 +1,7 @@
 2011-09-12  Andy Buckley  <andy at insectnation.org>
 
 	* Removing uses of getLog, cout, cerr, and endl from all standard
-	analyses, except in a very few special cases.
+	analyses and projections, except in a very few special cases.
 
 2011-09-10  Andy Buckley  <andy at insectnation.org>
 

Modified: trunk/src/Projections/Beam.cc
==============================================================================
--- trunk/src/Projections/Beam.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/Beam.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -62,13 +62,13 @@
       _theBeams.first = Particle(ANY, FourMomentum());
       _theBeams.second = Particle(ANY, FourMomentum());
     }
-    //getLog() << Log::DEBUG << "Beam particle IDs = " << beamIds() << endl;
+    //MSG_DEBUG("Beam particle IDs = " << beamIds());
   }
 
 
   double Beam::sqrtS() const {
     double sqrts = Rivet::sqrtS(beams());
-    //getLog() << Log::DEBUG << "sqrt(s) = " << sqrts/GeV << " GeV" << endl;
+    //MSG_DEBUG("sqrt(s) = " << sqrts/GeV << " GeV");
     return sqrts;
   }
 

Modified: trunk/src/Projections/ChargedFinalState.cc
==============================================================================
--- trunk/src/Projections/ChargedFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/ChargedFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -25,7 +25,7 @@
     setName("ChargedFinalState");
     addProjection(FinalState(etaRanges, minpt), "FS");
   }
-  
+
 
   int ChargedFinalState::compare(const Projection& p) const {
     return mkNamedPCmp(p, "FS");
@@ -42,12 +42,10 @@
     _theParticles.clear();
     std::remove_copy_if(fs.particles().begin(), fs.particles().end(),
                         std::back_inserter(_theParticles), chargedParticleFilter);
-    getLog() << Log::DEBUG << "Number of charged final-state particles = "
-             << _theParticles.size() << endl;
+    MSG_DEBUG("Number of charged final-state particles = " << _theParticles.size());
     if (getLog().isActive(Log::TRACE)) {
       for (vector<Particle>::iterator p = _theParticles.begin(); p != _theParticles.end(); ++p) {
-        getLog() << Log::TRACE << "Selected: " << p->pdgId()
-                 << ", charge = " << PID::threeCharge(p->pdgId())/3.0 << endl;
+        MSG_TRACE("Selected: " << p->pdgId() << ", charge = " << PID::threeCharge(p->pdgId())/3.0);
       }
     }
   }

Modified: trunk/src/Projections/ClusteredPhotons.cc
==============================================================================
--- trunk/src/Projections/ClusteredPhotons.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/ClusteredPhotons.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -42,8 +42,8 @@
       }
       if (clustered) _theParticles.push_back(p);
     }
-    getLog() << Log::DEBUG << name() << " found " << _theParticles.size()
-             << " matching photons." << endl;
+    MSG_DEBUG(name() << " found " << _theParticles.size()
+             << " matching photons.");
   }
 
 }

Modified: trunk/src/Projections/FParameter.cc
==============================================================================
--- trunk/src/Projections/FParameter.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/FParameter.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -56,7 +56,7 @@
 
     // Return (with "safe nonsense" sphericity params) if there are no final state particles.
     if (fsmomenta.empty()) {
-      getLog() << Log::DEBUG << "No particles in final state..." << endl;
+      MSG_DEBUG("No particles in final state...");
       clear();
       return;
     }
@@ -69,7 +69,7 @@
 
     // Iterate over all the final state particles.
     Matrix<2> mMom;
-    getLog() << Log::DEBUG << "Number of particles = " << fsperpmomenta.size() << endl;
+    MSG_DEBUG("Number of particles = " << fsperpmomenta.size());
     foreach (const Vector3& p3, fsperpmomenta) {
 
       double prefactor = 1.0/mod(p3);
@@ -83,23 +83,23 @@
       mMom += prefactor * mMomPart;
     }
 
-    getLog() << Log::DEBUG << "Linearised transverse momentum tensor = " << endl << mMom << endl;
+    MSG_DEBUG("Linearised transverse momentum tensor = " << mMom);
 
     // Check that the matrix is symmetric.
     const bool isSymm = mMom.isSymm();
     if (!isSymm) {
-      getLog() << Log::ERROR << "Error: momentum tensor not symmetric:" << endl;
-      getLog() << Log::ERROR << "[0,1] vs. [1,0]: " << mMom.get(0,1) << ", " << mMom.get(1,0) << endl;
-      getLog() << Log::ERROR << "[0,2] vs. [2,0]: " << mMom.get(0,2) << ", " << mMom.get(2,0) << endl;
-      getLog() << Log::ERROR << "[1,2] vs. [2,1]: " << mMom.get(1,2) << ", " << mMom.get(2,1) << endl;
+      MSG_ERROR("Error: momentum tensor not symmetric:");
+      MSG_ERROR("[0,1] vs. [1,0]: " << mMom.get(0,1) << ", " << mMom.get(1,0));
+      MSG_ERROR("[0,2] vs. [2,0]: " << mMom.get(0,2) << ", " << mMom.get(2,0));
+      MSG_ERROR("[1,2] vs. [2,1]: " << mMom.get(1,2) << ", " << mMom.get(2,1));
     }
     // If not symmetric, something's wrong (we made sure the error msg appeared first).
     assert(isSymm);
 
     // Diagonalize momentum matrix.
     const EigenSystem<2> eigen2 = diagonalize(mMom);
-    getLog() << Log::DEBUG << "Diag momentum tensor = " << endl << eigen2.getDiagMatrix() << endl;
- 
+    MSG_DEBUG("Diag momentum tensor = " << eigen2.getDiagMatrix());
+
     // Reset and set eigenvalue parameters.
     _lambdas.clear();
     const EigenSystem<2>::EigenPairs epairs = eigen2.getEigenPairs();
@@ -109,8 +109,8 @@
     }
 
     // Debug output.
-    getLog() << Log::DEBUG << "Lambdas = ("
-             << lambda1() << ", " << lambda2() << ")" << endl;
-    getLog() << Log::DEBUG << "Sum of lambdas = " << lambda1() + lambda2() << endl;
+    MSG_DEBUG("Lambdas = ("
+             << lambda1() << ", " << lambda2() << ")");
+    MSG_DEBUG("Sum of lambdas = " << lambda1() + lambda2());
   }
 }

Modified: trunk/src/Projections/FastJets.cc
==============================================================================
--- trunk/src/Projections/FastJets.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/FastJets.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -12,6 +12,7 @@
     _init1(alg, rparameter, seed_threshold);
   }
 
+
   FastJets::FastJets(const FinalState& fsp, fastjet::JetAlgorithm type,
                      fastjet::RecombinationScheme recom, double rparameter)
     : JetAlg(fsp), _adef(0)
@@ -51,7 +52,6 @@
 
   int FastJets::compare(const Projection& p) const {
     const FastJets& other = dynamic_cast<const FastJets&>(p);
-    // cout << "CMP " << _useInvisibles << endl;
     return \
       (_useInvisibles ? mkNamedPCmp(other, "FS") : mkNamedPCmp(other, "VFS")) ||
       cmp(_jdef.jet_algorithm(), other._jdef.jet_algorithm()) ||

Modified: trunk/src/Projections/FinalState.cc
==============================================================================
--- trunk/src/Projections/FinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/FinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -12,9 +12,9 @@
     setName("FinalState");
     const bool openpt = isZero(minpt);
     const bool openeta = (mineta <= -MAXRAPIDITY && maxeta >= MAXRAPIDITY);
-    getLog() << Log::TRACE << "Check for open FS conditions:" << std::boolalpha
-             << " eta=" << openeta
-             << ", pt=" << openpt << endl;
+    MSG_TRACE("Check for open FS conditions:" << std::boolalpha
+              << " eta=" << openeta
+              << ", pt=" << openpt);
     if (!openeta || !openpt) {
       addProjection(FinalState(), "OpenFS");
       if (!openeta) {
@@ -31,9 +31,9 @@
     const bool openpt = isZero(minpt);
     /// @todo Properly check whether any of these eta ranges (or their combination) are actually open
     const bool openeta = etaRanges.empty();
-    getLog() << Log::TRACE << "Check for open FS conditions:" << std::boolalpha
-             << " eta=" << openeta
-             << ", pt=" << openpt << endl;
+    MSG_TRACE("Check for open FS conditions:" << std::boolalpha
+              << " eta=" << openeta
+              << ", pt=" << openpt);
     if (!openeta || !openpt) {
       addProjection(FinalState(), "OpenFS");
     }
@@ -44,17 +44,17 @@
   int FinalState::compare(const Projection& p) const {
     const FinalState& other = dynamic_cast<const FinalState&>(p);
 
-    //cout << "FS::compare: " << 1 << " " << this << " " << &p << endl;
+    //MSG_TRACE("FS::compare: " << 1 << " " << this << " " << &p);
     std::vector<std::pair<double, double> > eta1(_etaRanges);
     std::vector<std::pair<double, double> > eta2(other._etaRanges);
     std::sort(eta1.begin(), eta1.end());
     std::sort(eta2.begin(), eta2.end());
 
-    //cout << "FS::compare: " << 2 << " " << this << " " << &p << endl;
+    //MSG_TRACE("FS::compare: " << 2 << " " << this << " " << &p);
     if (eta1 < eta2) return ORDERED;
     else if (eta2 < eta1) return UNORDERED;
 
-    //cout << "FS::compare: " << 3 << " " << this << " " << &p << endl;
+    //MSG_TRACE("FS::compare: " << 3 << " " << this << " " << &p);
     return cmp(_ptmin, other._ptmin);
   }
 
@@ -65,11 +65,11 @@
 
     // Handle "open FS" special case
     if (_etaRanges.empty() && _ptmin == 0) {
-      //getLog() << Log::TRACE << "Open FS processing: should only see this once per event ("
-      //         << e.genEvent().event_number() << ")" << endl;
+      //MSG_TRACE("Open FS processing: should only see this once per event ("
+      //           << e.genEvent().event_number() << ")");
       foreach (const GenParticle* p, Rivet::particles(e.genEvent())) {
         if (p->status() == 1) {
-          //cout << "FS GV = " << p->production_vertex() << endl;
+          //MSG_TRACE("FS GV = " << p->production_vertex());
           _theParticles.push_back(Particle(*p));
         }
       }
@@ -81,17 +81,13 @@
     const ParticleVector allstable = applyProjection<FinalState>(e, "OpenFS").particles();
     foreach (const Particle& p, allstable) {
       const bool passed = accept(p);
-//       if (getLog().isActive(Log::TRACE)) {
-//         getLog() << Log::TRACE
-//                  << "Choosing: ID = " << p.pdgId()
-//                  << ", pT = " << p.momentum().pT()
-//                  << ", eta = " << p.momentum().eta()
-//                  << ": result = " << std::boolalpha << passed << endl;
-//       }
+      // MSG_TRACE("Choosing: ID = " << p.pdgId()
+      //           << ", pT = " << p.momentum().pT()
+      //           << ", eta = " << p.momentum().eta()
+      //           << ": result = " << std::boolalpha << passed);
       if (passed) _theParticles.push_back(p);
     }
-    //getLog() << Log::DEBUG << "Number of final-state particles = "
-    //         << _theParticles.size() << endl;
+    //MSG_DEBUG("Number of final-state particles = " << _theParticles.size());
   }
 
 
@@ -119,7 +115,7 @@
       }
       if (!eta_pass) return false;
     }
- 
+
     return true;
   }
 

Modified: trunk/src/Projections/FoxWolframMoments.cc
==============================================================================
--- trunk/src/Projections/FoxWolframMoments.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/FoxWolframMoments.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -4,91 +4,61 @@
 #include "Rivet/Cmp.hh"
 
 namespace Rivet {
- 
+
     int FoxWolframMoments::compare(const Projection& p) const {
         return mkNamedPCmp(p, "FS");
     }
- 
- 
+
+
     void FoxWolframMoments::project(const Event& e) {
-        Log log = getLog();
-     
-        // Project into final state and get total visible momentum
-        const FinalState& fs             = applyProjection<FinalState>(e, "VFS");
-
-/*        const FastJets &jetProjC4   = applyProjection<FastJets>(e, "JetsC4");
-		Jets theJetsC4  = jetProjC4.jetsByPt(20.0);
-     
-        Jets goodJetsC4;
-		foreach(const Jet& jet, theJetsC4)
-		{
-            //const double jetphi = jet.momentum().azimuthalAngle(ZERO_2PI);
-            //const double jeteta = jet.momentum().pseudorapidity();
-            const double jpt    = jet.momentum().pT();
-         
-			if( jpt > 20.0 && goodJetsC4.size() < 4 )// && fabs(jeteta) < 2.5 )
-            {
-                goodJetsC4.push_back(jet);
-            }
-		}
-  */
-        // remember: # pairs = N! / ( r! * (N-r)! )
-     
-        // N.B.: Autocorrelations are included! Treat them separately as diagonal elements.
-        // see: http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node215.html
-     
-        double sumEnergy = 0.0;
-        for (ParticleVector::const_iterator pi = fs.particles().begin(); pi != fs.particles().end(); ++pi)
-        //for ( Jets::const_iterator pi = goodJetsC4.begin() ; pi != goodJetsC4.end() ; ++pi )
-        {
-            sumEnergy += pi->momentum().E();
-
-            const FourMomentum pi_4 = pi->momentum();
-
-            for (ParticleVector::const_iterator pj = pi+1; pj != fs.particles().end(); ++pj)
-            //for ( Jets::const_iterator pj = pi + 1 ; pj != goodJetsC4.end() ; ++pj )
-            {
-                if ( pi == pj ) continue;
-             
-                const FourMomentum pj_4 = pj->momentum();
-             
-                // Calculate x_ij = cos(theta_ij)
-                double x_ij = 1.0;
-                if ( pi != pj ) {
-                    double denom =  pi_4.vector3().mod() * pj_4.vector3().mod();
-                    x_ij = pi_4.vector3().dot( pj_4.vector3() ) / denom;
-                }
-             
-                //log << Log::DEBUG << "x_ij = " << x_ij << endl;
-             
-                //const double core = fabs( pi_4 * pj_4 ); //  / sumet2 ;
-				const double core = pi_4.vector3().mod() * pi_4.vector3().mod();
-				
-                for ( int order = 0; order < MAXMOMENT ; ++order ) {
-                    // enter a factor 2.0 because ij = ji. Use symmetry to speed up!
-                    _fwmoments[order] += 2.0 * core * gsl_sf_legendre_Pl( order, x_ij ) ;
-                }
-            } // end loop over p_j
-         
-            // Now add autocorrelations
-            // Obviously cos(theta_ij) = 1.0
-            // Note that P_l(1) == 1 for each l
-            for ( int order = 0; order < MAXMOMENT ; ++order ) {
-                    _fwmoments[order] += fabs( pi_4 * pi_4 );
-            }
-        } // end loop over p_i
-     
-     
-        log << Log::DEBUG << "sumEnergy = " << sumEnergy << endl;
-     
-        for ( int order = 0; order < MAXMOMENT ; ++order ) {
-            _fwmoments[order] /= (sumEnergy*sumEnergy);
-        }
-     
-        // Normalize to H0
-        for ( int order = 1; order < MAXMOMENT ; ++order ) {
-            _fwmoments[order] /= _fwmoments[0];
+      // Project into final state and get total visible momentum
+      const FinalState& fs = applyProjection<FinalState>(e, "VFS");
+
+      // remember: # pairs = N! / ( r! * (N-r)! )
+      // N.B.: Autocorrelations are included! Treat them separately as diagonal elements.
+      // see: http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node215.html
+
+      double sumEnergy = 0.0;
+      for (ParticleVector::const_iterator pi = fs.particles().begin(); pi != fs.particles().end(); ++pi) {
+        sumEnergy += pi->momentum().E();
+        const FourMomentum pi_4 = pi->momentum();
+        for (ParticleVector::const_iterator pj = pi+1; pj != fs.particles().end(); ++pj) {
+          const FourMomentum pj_4 = pj->momentum();
+
+          // Calculate x_ij = cos(theta_ij)
+          double x_ij = 1.0;
+          if ( pi != pj ) {
+            double denom =  pi_4.vector3().mod() * pj_4.vector3().mod();
+            x_ij = pi_4.vector3().dot( pj_4.vector3() ) / denom;
+          }
+
+          //const double core = fabs( pi_4 * pj_4 ); //  / sumet2 ;
+          const double core = pi_4.vector3().mod() * pi_4.vector3().mod();
+
+          for (int order = 0; order < MAXMOMENT; ++order) {
+            // enter a factor 2.0 because ij = ji. Use symmetry to speed up!
+            _fwmoments[order] += 2.0 * core * gsl_sf_legendre_Pl( order, x_ij ) ;
+          }
+        } // end loop over p_j
+
+        // Now add autocorrelations
+        // Obviously cos(theta_ij) = 1.0
+        // Note that P_l(1) == 1 for each l
+        for (int order = 0; order < MAXMOMENT; ++order) {
+          _fwmoments[order] += fabs( pi_4 * pi_4 );
         }
+      } // end loop over p_i
+
+      MSG_DEBUG("sumEnergy = " << sumEnergy);
+
+      for (int order = 0; order < MAXMOMENT; ++order) {
+        _fwmoments[order] /= (sumEnergy*sumEnergy);
+      }
+
+      // Normalize to H0
+      for (int order = 1; order < MAXMOMENT; ++order) {
+        _fwmoments[order] /= _fwmoments[0];
+      }
     }
- 
+
 }

Modified: trunk/src/Projections/HadronicFinalState.cc
==============================================================================
--- trunk/src/Projections/HadronicFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/HadronicFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -24,8 +24,8 @@
     _theParticles.clear();
     std::remove_copy_if(fs.particles().begin(), fs.particles().end(),
                         std::back_inserter(_theParticles), hadronFilter);
-    getLog() << Log::DEBUG << "Number of hadronic final-state particles = "
-             << _theParticles.size() << endl;
+    MSG_DEBUG("Number of hadronic final-state particles = "
+             << _theParticles.size());
   }
 
 }

Modified: trunk/src/Projections/Hemispheres.cc
==============================================================================
--- trunk/src/Projections/Hemispheres.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/Hemispheres.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -8,13 +8,13 @@
     // Get thrust axes.
     const AxesDefinition& ax = applyProjection<AxesDefinition>(e, "Axes");
     const Vector3 n = ax.axis1();
-    getLog() << Log::DEBUG << "Thrust axis = " << n << endl;
+    MSG_DEBUG("Thrust axis = " << n);
 
     FourMomentum p4With, p4Against;
     double Evis(0), broadWith(0), broadAgainst(0), broadDenom(0);
     const FinalState& fs = applyProjection<FinalState>(e, ax.getProjection("FS"));
     const ParticleVector& particles = fs.particles();
-    getLog() << Log::DEBUG << "number of particles = " << particles.size() << endl;
+    MSG_DEBUG("number of particles = " << particles.size());
     foreach (const Particle& p, particles) {
       const FourMomentum p4 = p.momentum();
       const Vector3 p3 = p4.vector3();
@@ -36,7 +36,7 @@
       } else {
         // In the incredibly unlikely event that a particle goes exactly along the
         // thrust plane, add half to each hemisphere.
-        getLog() << Log::DEBUG << "Particle split between hemispheres" << endl;
+        MSG_DEBUG("Particle split between hemispheres");
         p4With += 0.5 * p4;
         p4Against += 0.5 * p4;
         broadWith += 0.5 * p3Trans;

Modified: trunk/src/Projections/InitialQuarks.cc
==============================================================================
--- trunk/src/Projections/InitialQuarks.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/InitialQuarks.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -39,30 +39,29 @@
         const int st = p->status();
         const double pT = p->momentum().perp();
         const double eta = p->momentum().eta();
-        getLog() << Log::TRACE << std::boolalpha
-                 << "ID = " << p->pdg_id() << ", status = " << st << ", pT = " << pT
-                 << ", eta = " << eta << ": result = " << passed << endl;
+        MSG_TRACE(std::boolalpha
+                  << "ID = " << p->pdg_id() << ", status = " << st << ", pT = " << pT
+                  << ", eta = " << eta << ": result = " << passed);
         if (pv != 0) {
           foreach (const GenParticle* pp, particles_in(pv)) {
-            getLog() << Log::TRACE << std::boolalpha
-                     << "     parent ID = " << pp->pdg_id() << endl;
+            MSG_TRACE(std::boolalpha << " parent ID = " << pp->pdg_id());
           }
         }
         if (dv != 0) {
           foreach (const GenParticle* pp, particles_out(dv)) {
-            getLog() << Log::TRACE << std::boolalpha
-                     << "     child ID  = " << pp->pdg_id() << endl;
+            MSG_TRACE(std::boolalpha
+                      << " child ID  = " << pp->pdg_id());
           }
         }
       }
       if (passed) _theParticles.push_back(Particle(*p));
     }
-    getLog() << Log::DEBUG << "Number of initial quarks = "
-             << _theParticles.size() << endl;
-    if (! _theParticles.empty())
-      for (size_t i=0 ; i < _theParticles.size() ; i++)
-        getLog() << Log::DEBUG << "Initial quark[" << i << "] = "
-                 << _theParticles[i].pdgId() << std::endl;
+    MSG_DEBUG("Number of initial quarks = " << _theParticles.size());
+    if (!_theParticles.empty()) {
+      for (size_t i = 0; i < _theParticles.size(); i++) {
+        MSG_DEBUG("Initial quark[" << i << "] = " << _theParticles[i].pdgId());
+      }
+    }
   }
 
 

Modified: trunk/src/Projections/JetAlg.cc
==============================================================================
--- trunk/src/Projections/JetAlg.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/JetAlg.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -12,7 +12,7 @@
     setName("JetAlg");
     addProjection(fs, "FS");
     VisibleFinalState vfs(fs);
-    getLog() << Log::DEBUG << "Making visible final state from provided FS" << endl;
+    MSG_DEBUG("Making visible final state from provided FS");
     addProjection(vfs, "VFS");
   }
 

Modified: trunk/src/Projections/LeadingParticlesFinalState.cc
==============================================================================
--- trunk/src/Projections/LeadingParticlesFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/LeadingParticlesFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -29,7 +29,7 @@
     map<long, ParticleVector::const_iterator> tmp;
 
     const ParticleVector& particles = fs.particles();
-    getLog() << Log::DEBUG << "Original final state particles size " << particles.size() << endl;
+    MSG_DEBUG("Original final state particles size " << particles.size());
     ParticleVector::const_iterator ifs;
     for (ifs = particles.begin(); ifs != particles.end(); ++ifs) {
       if (inList(*ifs) && FinalState::accept(ifs->genParticle())) {
@@ -50,8 +50,8 @@
     // Loop on the tmp container and fill _theParticles
     map<long, ParticleVector::const_iterator>::const_iterator i;
     for (i = tmp.begin(); i != tmp.end(); ++i) {
-      getLog() << Log::DEBUG << "LeadingParticlesFinalState is accepting particle ID " << i->second->pdgId()
-               << " with momentum " << i->second->momentum() << endl;
+      MSG_DEBUG("LeadingParticlesFinalState is accepting particle ID " << i->second->pdgId()
+               << " with momentum " << i->second->momentum());
       _theParticles.push_back(*(i->second));
     }
   }

Modified: trunk/src/Projections/MergedFinalState.cc
==============================================================================
--- trunk/src/Projections/MergedFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/MergedFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -35,11 +35,10 @@
         _theParticles.push_back(pb);
       }
     }
-    getLog() << Log::DEBUG << "Number of particles in the two final states to be merged: = \n"
-             << "   1st final state = " << fsa.particles().size() << endl
-             << "   2nd final state = " << fsb.particles().size() << endl;
-    getLog() << Log::DEBUG << "Number of merged final-state particles = "
-             << _theParticles.size() << endl;
+    MSG_DEBUG("Number of particles in the two final states to be merged: = \n"
+              << "   1st final state = " << fsa.particles().size() << "\n"
+              << "   2nd final state = " << fsb.particles().size());
+    MSG_DEBUG("Number of merged final-state particles = " << _theParticles.size());
   }
 
 

Modified: trunk/src/Projections/NeutralFinalState.cc
==============================================================================
--- trunk/src/Projections/NeutralFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/NeutralFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -20,17 +20,13 @@
     foreach (const Particle& p, fs.particles()){
       if ((PID::threeCharge(p.pdgId()) == 0) && (p.momentum().Et() > _Etmin)) {
         _theParticles.push_back(p);
-        if (getLog().isActive(Log::TRACE)) {
-          getLog() << Log::TRACE
-                   << "Selected: ID = " << p.pdgId()
-                   << ", Et = " << p.momentum().Et()
-                   << ", eta = " << p.momentum().eta()
-                   << ", charge = " << PID::threeCharge(p.pdgId())/3.0 << endl;
-        }
+        MSG_TRACE("Selected: ID = " << p.pdgId()
+                  << ", Et = " << p.momentum().Et()
+                  << ", eta = " << p.momentum().eta()
+                  << ", charge = " << PID::threeCharge(p.pdgId())/3.0);
       }
     }
-    getLog() << Log::DEBUG << "Number of neutral final-state particles = "
-             << _theParticles.size() << endl;
+    MSG_DEBUG("Number of neutral final-state particles = " << _theParticles.size());
   }
 
 

Modified: trunk/src/Projections/PVertex.cc
==============================================================================
--- trunk/src/Projections/PVertex.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/PVertex.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -10,7 +10,7 @@
   void PVertex::project(const Event& e) {
     // We'll *try* to do it right, in case any generators are doing the right thing...
     _thePVertex = e.genEvent().signal_process_vertex();
-    getLog() << Log::DEBUG << "PVertex ptr from HepMC = " << _thePVertex << endl;
+    MSG_DEBUG("PVertex ptr from HepMC = " << _thePVertex);
     if (!_thePVertex) {
       // Since no signal vertices are filled in existing Fortran & C++ MC's,
       // the decay vertex from first vertex in event with 2 incoming particles

Modified: trunk/src/Projections/Sphericity.cc
==============================================================================
--- trunk/src/Projections/Sphericity.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/Sphericity.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -67,11 +67,11 @@
 
   // Actually do the calculation
   void Sphericity::_calcSphericity(const vector<Vector3>& fsmomenta) {
-    getLog() << Log::DEBUG << "Calculating sphericity with r = " << _regparam << endl;
+    MSG_DEBUG("Calculating sphericity with r = " << _regparam);
 
     // Return (with "safe nonsense" sphericity params) if there are no final state particles.
     if (fsmomenta.empty()) {
-      getLog() << Log::DEBUG << "No particles in final state..." << endl;
+      MSG_DEBUG("No particles in final state...");
       clear();
       return;
     }
@@ -79,7 +79,7 @@
     // Iterate over all the final state particles.
     Matrix3 mMom;
     double totalMomentum = 0.0;
-    getLog() << Log::DEBUG << "Number of particles = " << fsmomenta.size() << endl;
+    MSG_DEBUG("Number of particles = " << fsmomenta.size());
     foreach (const Vector3& p3, fsmomenta) {
       // Build the (regulated) normalising factor.
       totalMomentum += pow(p3.mod(), _regparam);
@@ -87,7 +87,7 @@
       // Build (regulated) quadratic momentum components.
       const double regfactor = pow(p3.mod(), _regparam-2);
       if (!fuzzyEquals(regfactor, 1.0)) {
-        getLog() << Log::TRACE << "Regfactor (r=" << _regparam << ") = " << regfactor << endl;
+        MSG_TRACE("Regfactor (r=" << _regparam << ") = " << regfactor);
       }
 
       Matrix3 mMomPart;
@@ -101,23 +101,23 @@
 
     // Normalise to total (regulated) momentum.
     mMom /= totalMomentum;
-    getLog() << Log::DEBUG << "Momentum tensor = " << endl << mMom << endl;
+    MSG_DEBUG("Momentum tensor = " << "\n" << mMom);
 
     // Check that the matrix is symmetric.
     const bool isSymm = mMom.isSymm();
     if (!isSymm) {
-      getLog() << Log::ERROR << "Error: momentum tensor not symmetric (r=" << _regparam << ")" << endl;
-      getLog() << Log::ERROR << "[0,1] vs. [1,0]: " << mMom.get(0,1) << ", " << mMom.get(1,0) << endl;
-      getLog() << Log::ERROR << "[0,2] vs. [2,0]: " << mMom.get(0,2) << ", " << mMom.get(2,0) << endl;
-      getLog() << Log::ERROR << "[1,2] vs. [2,1]: " << mMom.get(1,2) << ", " << mMom.get(2,1) << endl;
+      MSG_ERROR("Error: momentum tensor not symmetric (r=" << _regparam << ")");
+      MSG_ERROR("[0,1] vs. [1,0]: " << mMom.get(0,1) << ", " << mMom.get(1,0));
+      MSG_ERROR("[0,2] vs. [2,0]: " << mMom.get(0,2) << ", " << mMom.get(2,0));
+      MSG_ERROR("[1,2] vs. [2,1]: " << mMom.get(1,2) << ", " << mMom.get(2,1));
     }
     // If not symmetric, something's wrong (we made sure the error msg appeared first).
     assert(isSymm);
 
     // Diagonalize momentum matrix.
     const EigenSystem<3> eigen3 = diagonalize(mMom);
-    getLog() << Log::DEBUG << "Diag momentum tensor = " << endl << eigen3.getDiagMatrix() << endl;
- 
+    MSG_DEBUG("Diag momentum tensor = " << "\n" << eigen3.getDiagMatrix());
+
     // Reset and set eigenvalue/vector parameters.
     _lambdas.clear();
     _sphAxes.clear();
@@ -129,13 +129,13 @@
     }
 
     // Debug output.
-    getLog() << Log::DEBUG << "Lambdas = ("
-             << lambda1() << ", " << lambda2() << ", " << lambda3() << ")" << endl;
-    getLog() << Log::DEBUG << "Sum of lambdas = " << lambda1() + lambda2() + lambda3() << endl;
-    getLog() << Log::DEBUG << "Vectors = "
+    MSG_DEBUG("Lambdas = ("
+             << lambda1() << ", " << lambda2() << ", " << lambda3() << ")");
+    MSG_DEBUG("Sum of lambdas = " << lambda1() + lambda2() + lambda3());
+    MSG_DEBUG("Vectors = "
              << sphericityAxis() << ", "
              << sphericityMajorAxis() << ", "
-             << sphericityMinorAxis() << ")" << endl;
+             << sphericityMinorAxis() << ")");
   }
 
 }

Modified: trunk/src/Projections/Thrust.cc
==============================================================================
--- trunk/src/Projections/Thrust.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/Thrust.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -106,7 +106,7 @@
     foreach (const Vector3& p3, fsmomenta) {
       momentumSum += mod(p3);
     }
-    getLog() << Log::DEBUG << "Number of particles = " << fsmomenta.size() << endl;
+    MSG_DEBUG("Number of particles = " << fsmomenta.size());
 
 
     // Clear the caches
@@ -151,12 +151,12 @@
 
     // Get thrust
     _calcT(fsmomenta, val, axis);
-    getLog() << Log::DEBUG << "Mom sum = " << momentumSum << endl;
+    MSG_DEBUG("Mom sum = " << momentumSum);
     _thrusts.push_back(val / momentumSum);
     // Make sure that thrust always points along the +ve z-axis.
     if (axis.z() < 0) axis = -axis;
     axis = axis.unit();
-    getLog() << Log::DEBUG << "Axis = " << axis << endl;
+    MSG_DEBUG("Axis = " << axis);
     _thrustAxes.push_back(axis);
 
     // Get thrust major

Modified: trunk/src/Projections/TriggerCDFRun0Run1.cc
==============================================================================
--- trunk/src/Projections/TriggerCDFRun0Run1.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/TriggerCDFRun0Run1.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -31,9 +31,9 @@
     // Require at least 4 tracks with at least one in each of the forward
     // and backward hemispheres:
     if (n_trig_1 == 0 || n_trig_2 == 0) return;
-    getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl;
+    MSG_DEBUG("Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2);
     if (n_backward + n_forward < 4 || n_backward == 0 || n_forward == 0) return;
-    getLog() << Log::DEBUG << " Num. forward: " << n_forward  << ", Num. backward: " << n_backward << endl;
+    MSG_DEBUG(" Num. forward: " << n_forward  << ", Num. backward: " << n_backward);
  
     // Trigger success:
     _decision_mb = true;

Modified: trunk/src/Projections/TriggerCDFRun2.cc
==============================================================================
--- trunk/src/Projections/TriggerCDFRun2.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/TriggerCDFRun2.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -24,7 +24,7 @@
     
     // Require at least one charged particle in both -4.7 < eta < -3.7 and 3.7 < eta < 4.7
     if (n_trig_1 == 0 || n_trig_2 == 0) return;
-    getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl;
+    MSG_DEBUG("Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2);
  
     // Trigger success:
     _decision_mb = true;

Modified: trunk/src/Projections/TriggerUA5.cc
==============================================================================
--- trunk/src/Projections/TriggerUA5.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/TriggerUA5.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -36,7 +36,7 @@
       if (inRange(eta, -5.6, -2.0)) _n_minus++;
       else if (inRange(eta, 2.0, 5.6)) _n_plus++;
     }
-    getLog() << Log::DEBUG << "Trigger -: " << _n_minus << ", Trigger +: " << _n_plus << endl;
+    MSG_DEBUG("Trigger -: " << _n_minus << ", Trigger +: " << _n_plus);
 
     // Common SD/NSD trigger requirement: must activate at least one hodoscope
     if (_n_minus == 0 && _n_plus == 0) return;

Modified: trunk/src/Projections/UnstableFinalState.cc
==============================================================================
--- trunk/src/Projections/UnstableFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/UnstableFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -29,22 +29,6 @@
         p->momentum().eta() > _etamin && p->momentum().eta() < _etamax &&
         !IS_PARTON_PDGID(p->pdg_id());
 
-      // DEBUGGING PRINTOUTS FOR HERWIG
-      // if (p->status() == 2) {
-      //   std::cout << "* "
-      //             << "pid=" << p->pdg_id()
-      //             << ", st=" << st
-      //             << ", passed=" << std::boolalpha << passed
-      //             << ", isparton=" << std::boolalpha << (IS_PARTON_PDGID(p->pdg_id())) << std::endl;
-      // }
-      // if (abs(p->pdg_id()) > 3000) {
-      //   std::cout << "% "
-      //             << "pid=" << p->pdg_id()
-      //             << ", st=" << st
-      //             << ", passed=" << std::boolalpha << passed
-      //             << ", isparton=" << std::boolalpha << (IS_PARTON_PDGID(p->pdg_id())) << std::endl;
-      // }
-
       // Avoid double counting by re-marking as unpassed if particle ID == parent ID
       const GenVertex* pv = p->production_vertex();
       const GenVertex* dv = p->end_vertex();

Modified: trunk/src/Projections/VetoedFinalState.cc
==============================================================================
--- trunk/src/Projections/VetoedFinalState.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/VetoedFinalState.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -25,20 +25,19 @@
     _theParticles.clear();
     _theParticles.reserve(fs.particles().size());
     foreach (const Particle& p, fs.particles()) {
-      if (getLog().isActive(Log::DEBUG)) {
+      if (getLog().isActive(Log::TRACE)) {
         vector<long> codes;
         for (VetoDetails::const_iterator code = _vetoCodes.begin(); code != _vetoCodes.end(); ++code) {
           codes.push_back(code->first);
         }
         const string codestr = "{ " + join(codes) + " }";
-        getLog() << Log::TRACE << p.pdgId() << " vs. veto codes = "
-                 << codestr << " (" << codes.size() << ")" << endl;
+        MSG_TRACE(p.pdgId() << " vs. veto codes = " << codestr << " (" << codes.size() << ")");
       }
       const long pdgid = p.pdgId();
       const double pt = p.momentum().pT();
       VetoDetails::iterator iter = _vetoCodes.find(pdgid);
       if (iter == _vetoCodes.end()) {
-        getLog() << Log::TRACE << "Storing with PDG code = " << pdgid << ", pT = " << pt << endl;
+        MSG_TRACE("Storing with PDG code = " << pdgid << ", pT = " << pt);
         _theParticles.push_back(p);
       } else {
         // This particle code is listed as a possible veto... check pT.
@@ -49,14 +48,14 @@
         if (ptrange.first < numeric_limits<double>::max()) rangess << ptrange.second;
         rangess << " - ";
         if (ptrange.second < numeric_limits<double>::max()) rangess << ptrange.second;
-        getLog() << Log::TRACE << "ID = " << pdgid << ", pT range = " << rangess.str();
+        MSG_TRACE("ID = " << pdgid << ", pT range = " << rangess.str());
         stringstream debugline;
         debugline << "with PDG code = " << pdgid << " pT = " << p.momentum().pT();
         if (pt < ptrange.first || pt > ptrange.second) {
-          getLog() << Log::TRACE << "Storing " << debugline.str() << endl;
+          MSG_TRACE("Storing " << debugline.str());
           _theParticles.push_back(p);
         } else {
-          getLog() << Log::TRACE << "Vetoing " << debugline.str() << endl;
+          MSG_TRACE("Vetoing " << debugline.str());
         }
       }
     }
@@ -70,7 +69,7 @@
       start.insert(_theParticles.begin());
       oldMasses.insert(pair<set<ParticleVector::iterator>, FourMomentum>
                        (start, _theParticles.begin()->momentum()));
-   
+
       for (int nParts = 1; nParts != *nIt; ++nParts) {
         for (map<set<ParticleVector::iterator>, FourMomentum>::iterator mIt = oldMasses.begin();
              mIt != oldMasses.end(); ++mIt) {
@@ -103,7 +102,7 @@
         }
       }
     }
- 
+
     for (set<ParticleVector::iterator>::reverse_iterator p = toErase.rbegin(); p != toErase.rend(); ++p) {
       _theParticles.erase(*p);
     }
@@ -125,7 +124,7 @@
         }
       }
     }
-    
+
     // Now veto on the FS
     foreach (const string& ifs, _vetofsnames) {
       const FinalState& vfs = applyProjection<FinalState>(e, ifs);
@@ -135,8 +134,8 @@
         bool found = false;
         for (ParticleVector::const_iterator ipart = vfsp.begin(); ipart != vfsp.end(); ++ipart){
           if (!ipart->hasGenParticle()) continue;
-          getLog() << Log::TRACE << "Comparing barcode " << icheck->genParticle().barcode() 
-                   << " with veto particle " << ipart->genParticle().barcode() << endl;
+          MSG_TRACE("Comparing barcode " << icheck->genParticle().barcode()
+                   << " with veto particle " << ipart->genParticle().barcode());
           if (ipart->genParticle().barcode() == icheck->genParticle().barcode()){
             found = true;
             break;
@@ -145,8 +144,8 @@
         if (found) {
           _theParticles.erase(icheck);
           --icheck;
-        }	
-      }	
+        }
+      }
     }
   }
 

Modified: trunk/src/Projections/WFinder.cc
==============================================================================
--- trunk/src/Projections/WFinder.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/WFinder.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -148,9 +148,10 @@
     stringstream msg;
     string wsign = (wcharge == 1) ? "+" : "-";
     string wstr = "W" + wsign;
-    msg << wstr << " reconstructed from: " << endl
-        << "   " << p1.momentum() << " " << p1.pdgId() << endl
-        << " + " << p2.momentum() << " " << p2.pdgId() << endl;
+    msg << wstr << " reconstructed from: " << "\n"
+        << "   " << p1.momentum() << " " << p1.pdgId() << "\n"
+        << " + " << p2.momentum() << " " << p2.pdgId();
+    MSG_DEBUG(msg.str());
 
     // Check missing ET
     const MissingMomentum& vismom = applyProjection<MissingMomentum>(e, "MissingET");

Modified: trunk/src/Projections/ZFinder.cc
==============================================================================
--- trunk/src/Projections/ZFinder.cc	Tue Sep 13 17:34:02 2011	(r3349)
+++ trunk/src/Projections/ZFinder.cc	Tue Sep 13 18:00:19 2011	(r3350)
@@ -98,12 +98,11 @@
     assert(z3charge == 0);
 
     stringstream msg;
-    msg << "Z reconstructed from: " << endl
-        << "   " << l1.momentum() << " " << l1.pdgId() << endl
-        << " + " << l2.momentum() << " " << l2.pdgId() << endl;
-
+    msg << "Z reconstructed from: \n"
+        << "   " << l1.momentum() << " " << l1.pdgId() << "\n"
+        << " + " << l2.momentum() << " " << l2.pdgId();
+    MSG_DEBUG(msg.str());
     _bosons.push_back(Particle(ZBOSON, pZ));
-    MSG_DEBUG(name() << " found one Z");
 
     // Find the LeptonClusters which survived the IMFS cut such that we can
     // extract their original particles


More information about the Rivet-svn mailing list