FinalStateHCM.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Projections/FinalStateHCM.hh"
00003 #include "Rivet/Cmp.hh"
00004 
00005 
00006 namespace Rivet {
00007 
00008 
00009   int FinalStateHCM::compare(const Projection& p) const {
00010     return mkNamedPCmp(p, "Kinematics");
00011   }
00012 
00013 
00014   void FinalStateHCM::project(const Event& e) {
00015     const DISKinematics& diskin = applyProjection<DISKinematics>(e, "Kinematics");
00016     const LorentzTransform hcmboost = diskin.boostHCM();
00017     const DISLepton& dislep = diskin.applyProjection<DISLepton>(e, "Lepton");
00018     const GenParticle& dislepGP = dislep.out().genParticle();
00019     const FinalState& fs = dislep.applyProjection<FinalState>(e, "FS");
00020 
00021     // Fill the particle list with all particles _other_ than the DIS scattered
00022     // lepton, with momenta boosted into the HCM frame.
00023     _theParticles.clear();
00024     _theParticles.reserve(fs.particles().size());
00025     for (ParticleVector::const_iterator p = fs.particles().begin(); p != fs.particles().end(); ++p) {
00026       const GenParticle& loopGP = p->genParticle();
00027       if (&loopGP != &dislepGP) { //< Ensure that we skip the DIS lepton
00028         Particle temp = *p;
00029         const FourMomentum hcmMom = hcmboost.transform(temp.momentum());
00030         temp.setMomentum(hcmMom);
00031         _theParticles.push_back(temp);
00032       }
00033     }
00034   }
00035 
00036 
00037 }