00001 // -*- C++ -*- 00002 00003 #include "Rivet/Rivet.hh" 00004 #include "Rivet/Projections/DISKinematics.hh" 00005 #include "Rivet/Cmp.hh" 00006 00007 00008 namespace Rivet { 00009 00010 void DISKinematics::project(const Event& e) { 00011 const DISLepton& dislep = e.applyProjection(*_lepton); 00012 const ParticlePair& inc = e.applyProjection(*_beams).getBeams(); 00013 Particle hadron; 00014 00015 if ( inc.second.getPdgId() == _idhad ) hadron = inc.second; 00016 else if ( inc.first.getPdgId() == _idhad ) hadron = inc.first; 00017 else throw runtime_error("DISKinematics projector could not find " 00018 "the correct beam."); 00019 00020 if ( &(dislep.in().getHepMCParticle()) == 00021 &(hadron.getHepMCParticle()) ) 00022 throw runtime_error("DISKinematics projector could not find the " 00023 "correct beam."); 00024 00025 LorentzVector pgam(dislep.in().getMomentum() - dislep.out().getMomentum()); 00026 _theQ2 = -pgam.m2(); 00027 LorentzVector tothad(pgam + hadron.getMomentum()); 00028 _theW2 = tothad.m2(); 00029 _theX = Q2()/(2.0*pgam*hadron.getMomentum()); 00030 _hcm.set(-tothad.boostVector()); 00031 pgam *= _hcm; 00032 _hcm.rotateX(-pgam.theta()); 00033 LorentzVector plep = dislep.out().getMomentum(); 00034 plep *= _hcm; 00035 _hcm.rotateZ(-plep.phi()); 00036 _breit = _hcm; 00037 double bz = (pgam.rho() - 0.5*x()*sqrt(W2()))/(pgam.e() + 0.5*x()*sqrt(W2())); 00038 _breit.boostZ(-bz); 00039 // @todo *** ATTENTION *** These rotations should be checked. 00040 } 00041 00042 00043 int DISKinematics::compare(const Projection & p) const { 00044 const DISKinematics& other = dynamic_cast<const DISKinematics&>(p); 00045 return \ 00046 pcmp(*_lepton, *other._lepton) || 00047 pcmp(*_beams, *other._beams) || 00048 cmp(_idhad, other._idhad); 00049 } 00050 00051 00052 }