CentralEtHCM.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Projections/CentralEtHCM.hh"
00004 #include "Rivet/Cmp.hh"
00005 #include "Rivet/RivetCLHEP.hh"
00006 #include "Rivet/Rivet.hh"
00007 
00008 
00009 namespace Rivet {
00010 
00011   int CentralEtHCM::compare(const Projection& p) const {
00012     const CentralEtHCM & other = dynamic_cast<const CentralEtHCM&>(p);
00013     return pcmp(*_fshcm, *other._fshcm);
00014   }
00015 
00016 
00017   void CentralEtHCM::project(const Event& e) {
00018     const FinalStateHCM& fs = e.applyProjection(*_fshcm);
00019     _sumet = 0.0;
00020     for (int i=0, N=fs.particles().size(); i < N; ++i) {
00021       // Rapidity cut: abs rapidity < 0.5
00022       if ( fabs(fs.particles()[i].getMomentum().rapidity()) < 0.5 )
00023         _sumet += fs.particles()[i].getMomentum().et();
00024     }
00025   }
00026 
00027 }