rivet is hosted by Hepforge, IPPP Durham
BeamThrust.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Rivet.hh"
00003 #include "Rivet/Projections/BeamThrust.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 
00006 
00007 namespace Rivet {
00008 
00009 
00010   void BeamThrust::calc(const FinalState& fs) {
00011     calc(fs.particles());
00012   }
00013 
00014   void BeamThrust::calc(const vector<Particle>& fsparticles) {
00015     vector<FourMomentum> fsmomenta;
00016     fsmomenta.reserve(fsparticles.size());
00017     foreach (const Particle& p, fsparticles) {
00018       const FourMomentum p4 = p.momentum();
00019       fsmomenta.push_back(p4);
00020     }
00021     _calcBeamThrust(fsmomenta);
00022   }
00023 
00024   void BeamThrust::calc(const vector<FourMomentum>& fsmomenta) {
00025     _calcBeamThrust(fsmomenta);
00026   }
00027 
00028   /////////////////////////////////////////////////
00029 
00030   // Do the full calculation
00031   void BeamThrust::_calcBeamThrust(const vector<FourMomentum>& fsmomenta) {
00032     _beamthrust = 0.;
00033     foreach (const FourMomentum& p, fsmomenta) {
00034       _beamthrust += p.E() - fabs(p.z());
00035     }
00036   }
00037 
00038 }