TotalVisibleMomentum.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Tools/Logging.hh"
00003 #include "Rivet/Projections/TotalVisibleMomentum.hh"
00004 #include "Rivet/Cmp.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   int TotalVisibleMomentum::compare(const Projection& p) const {
00010     return mkNamedPCmp(p, "FS");
00011   }
00012 
00013 
00014   void TotalVisibleMomentum::project(const Event& e) {
00015     _momentum = FourMomentum();
00016     _set = 0.0;
00017 
00018     // Project into final state
00019     const FinalState& fs = applyProjection<FinalState>(e, "FS");
00020     foreach (const Particle& p, fs.particles()) {
00021       const FourMomentum& mom = p.momentum();
00022       _momentum += mom;
00023       _set += mom.Et();
00024     }
00025   }
00026 
00027 
00028 }