[Rivet-svn] r2396 - in trunk/src: Core Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Apr 9 11:31:44 BST 2010


Author: fsiegert
Date: Fri Apr  9 11:31:43 2010
New Revision: 2396

Log:
Re-enable continuous beam check, because it isn't that expensive in itself, just its output. Thus temporarily disable debugging output in the most used code paths, until the logging system is overhauled.

Modified:
   trunk/src/Core/AnalysisHandler.cc
   trunk/src/Core/Projection.cc
   trunk/src/Core/ProjectionHandler.cc
   trunk/src/Projections/Beam.cc
   trunk/src/Projections/FinalState.cc

Modified: trunk/src/Core/AnalysisHandler.cc
==============================================================================
--- trunk/src/Core/AnalysisHandler.cc	Fri Apr  9 10:31:28 2010	(r2395)
+++ trunk/src/Core/AnalysisHandler.cc	Fri Apr  9 11:31:43 2010	(r2396)
@@ -89,15 +89,15 @@
     }
     // Proceed with event analysis
     assert(_initialised);
-//     // Ensure that beam details match those from first event @todo This is too expensive
-//     const BeamPair beams = Rivet::beamIds(ge);
-//     const double sqrts = Rivet::sqrtS(ge);
-//     if (!compatible(beams, _beams) || !fuzzyEquals(sqrts, sqrtS())) {
-//       getLog() << Log::ERROR << "Event beams mismatch: "
-//                << beams << " @ " << sqrts/GeV << " GeV" << " vs. first beams "
-//                << this->beams() << " @ " << this->sqrtS()/GeV << " GeV" << endl;
-//       exit(1);
-//     }
+    // Ensure that beam details match those from first event
+    const BeamPair beams = Rivet::beamIds(ge);
+    const double sqrts = Rivet::sqrtS(ge);
+    if (!compatible(beams, _beams) || !fuzzyEquals(sqrts, sqrtS())) {
+      getLog() << Log::ERROR << "Event beams mismatch: "
+               << beams << " @ " << sqrts/GeV << " GeV" << " vs. first beams "
+               << this->beams() << " @ " << this->sqrtS()/GeV << " GeV" << endl;
+      exit(1);
+    }
 
     
     Event event(ge);
@@ -105,7 +105,7 @@
     // Weights
     const double weight = event.weight();
     _sumOfWeights += weight;
-    getLog() << Log::DEBUG << "Event #" << _numEvents << " weight = " << weight << endl;
+    //getLog() << Log::DEBUG << "Event #" << _numEvents << " weight = " << weight << endl;
     #ifdef HEPMC_HAS_CROSS_SECTION
     if (ge.cross_section()) {
       const double xs = ge.cross_section()->cross_section();
@@ -113,9 +113,9 @@
     }
     #endif
     foreach (Analysis* a, _analyses) {
-      getLog() << Log::DEBUG << "About to run analysis " << a->name() << endl;
+      //getLog() << Log::DEBUG << "About to run analysis " << a->name() << endl;
       a->analyze(event);
-      getLog() << Log::DEBUG << "Finished running analysis " << a->name() << endl;
+      //getLog() << Log::DEBUG << "Finished running analysis " << a->name() << endl;
     }
   }
 

Modified: trunk/src/Core/Projection.cc
==============================================================================
--- trunk/src/Core/Projection.cc	Fri Apr  9 10:31:28 2010	(r2395)
+++ trunk/src/Core/Projection.cc	Fri Apr  9 11:31:43 2010	(r2396)
@@ -11,12 +11,12 @@
     : _name("BaseProjection")
   {
     addBeamPair(ANY, ANY);
-    getLog() << Log::TRACE << "Creating " << name() << " at " << this << endl;
+    //getLog() << Log::TRACE << "Creating " << name() << " at " << this << endl;
   }
 
 
   Projection:: ~Projection() {
-    getLog() << Log::TRACE << "Destroying " << name() << " at " << this << endl;
+    //getLog() << Log::TRACE << "Destroying " << name() << " at " << this << endl;
   }
 
 

Modified: trunk/src/Core/ProjectionHandler.cc
==============================================================================
--- trunk/src/Core/ProjectionHandler.cc	Fri Apr  9 10:31:28 2010	(r2395)
+++ trunk/src/Core/ProjectionHandler.cc	Fri Apr  9 11:31:43 2010	(r2396)
@@ -265,8 +265,8 @@
 
   const Projection& ProjectionHandler::getProjection(const ProjectionApplier& parent,
                                                      const string& name) const {
-    getLog() << Log::TRACE << "Searching for child projection '"
-             << name << "' of " << &parent << endl;
+    //getLog() << Log::TRACE << "Searching for child projection '"
+    //         << name << "' of " << &parent << endl;
     NamedProjsMap::const_iterator nps = _namedprojs.find(&parent);
     if (nps == _namedprojs.end()) {
       ostringstream msg;

Modified: trunk/src/Projections/Beam.cc
==============================================================================
--- trunk/src/Projections/Beam.cc	Fri Apr  9 10:31:28 2010	(r2395)
+++ trunk/src/Projections/Beam.cc	Fri Apr  9 11:31:43 2010	(r2396)
@@ -53,13 +53,13 @@
     assert(beams.first && beams.second);
     _theBeams.first = *(beams.first);
     _theBeams.second = *(beams.second);
-    getLog() << Log::DEBUG << "Beam particle IDs = " << beamIds() << endl;
+    //getLog() << Log::DEBUG << "Beam particle IDs = " << beamIds() << endl;
   }
 
 
   double Beam::sqrtS() const {
     double sqrts = Rivet::sqrtS(beams());
-    getLog() << Log::DEBUG << "sqrt(s) = " << sqrts/GeV << " GeV" << endl;
+    //getLog() << Log::DEBUG << "sqrt(s) = " << sqrts/GeV << " GeV" << endl;
     return sqrts;
   }
   

Modified: trunk/src/Projections/FinalState.cc
==============================================================================
--- trunk/src/Projections/FinalState.cc	Fri Apr  9 10:31:28 2010	(r2395)
+++ trunk/src/Projections/FinalState.cc	Fri Apr  9 11:31:43 2010	(r2396)
@@ -65,8 +65,8 @@
 
     // 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;
+      //getLog() << Log::TRACE << "Open FS processing: should only see this once per event ("
+      //         << e.genEvent().event_number() << ")" << endl;
       foreach (const GenParticle* p, Rivet::particles(e.genEvent())) {
         if (p->status() == 1) {
           //cout << "FS GV = " << p->production_vertex() << endl;
@@ -81,17 +81,17 @@
     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;
-      }
+//       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;
+//       }
       if (passed) _theParticles.push_back(p);
     }
-    getLog() << Log::DEBUG << "Number of final-state particles = "
-             << _theParticles.size() << endl;
+    //getLog() << Log::DEBUG << "Number of final-state particles = "
+    //         << _theParticles.size() << endl;
   }
 
 


More information about the Rivet-svn mailing list