DISKinematics.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Rivet.hh"
00004 #include "Rivet/Projections/DISKinematics.hh"
00005 #include "Rivet/Math/Constants.hh"
00006 #include "Rivet/Cmp.hh"
00007 #include "Rivet/Tools/ParticleIdUtils.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   void DISKinematics::project(const Event& e) {
00013     // Identify beam hadron
00014     const ParticlePair& inc = applyProjection<Beam>(e, "Beam").beams();
00015     bool firstIsHadron  = PID::isHadron(inc.first.pdgId());
00016     bool secondIsHadron = PID::isHadron(inc.second.pdgId());
00017     if (firstIsHadron && !secondIsHadron) {
00018       _inHadron = inc.first;
00019     } else if (!firstIsHadron && secondIsHadron) {
00020       _inHadron = inc.second;
00021     } else {
00022       //help!
00023       throw Error("DISKinematics projector could not find the correct beam hadron");
00024     }
00025 
00026     // Get the DIS lepton and store some of its properties
00027     const DISLepton& dislep = applyProjection<DISLepton>(e, "Lepton");
00028     const FourMomentum pLepIn = dislep.in().momentum();
00029     const FourMomentum pLepOut = dislep.out().momentum();
00030     const FourMomentum pHad = _inHadron.momentum();
00031     const FourMomentum pGamma = pLepIn - pLepOut;
00032     const FourMomentum tothad = pGamma + pHad;
00033     _theQ2 = -pGamma.mass2();
00034     _theW2 = tothad.mass2();
00035     _theX = Q2()/(2.0 * pGamma * pHad);
00036     _theY = (pGamma * pHad) / (pLepIn * pHad);
00037     _theS = invariant(pLepIn + pHad);
00038 
00039     // Calculate boost vector for boost into HCM-system
00040     LorentzTransform tmp;
00041     tmp.setBoost(-tothad.boostVector());
00042 
00043     // Rotate so the photon is in x-z plane in HCM rest frame
00044     FourMomentum pGammaHCM = tmp.transform(pGamma);
00045     tmp.preMult(Matrix3(Vector3::mkZ(), -pGammaHCM.azimuthalAngle()));
00046     pGammaHCM = tmp.transform(pGamma);
00047     assert(isZero(dot(pGammaHCM.vector3(), Vector3::mkY())));
00048 
00049     // Rotate so the photon is along the positive z-axis
00050     const double rot_angle = pGammaHCM.polarAngle() * (pGammaHCM.px() >= 0 ? -1 : 1);
00051     tmp.preMult(Matrix3(Vector3::mkY(), rot_angle));
00052     // Check that final HCM photon lies along +ve z as expected
00053     pGammaHCM = tmp.transform(pGamma);
00054     assert(isZero(dot(pGammaHCM.vector3(), Vector3::mkX())));
00055     assert(isZero(dot(pGammaHCM.vector3(), Vector3::mkY())));
00056     assert(isZero(angle(pGammaHCM.vector3(), Vector3::mkZ())));
00057 
00058     // Finally rotate so outgoing lepton at phi = 0
00059     FourMomentum pLepOutHCM = tmp.transform(pLepOut);
00060     tmp.preMult(Matrix3(Vector3::mkZ(), -pLepOutHCM.azimuthalAngle()));
00061     assert(isZero(tmp.transform(pLepOut).azimuthalAngle()));
00062     _hcm = tmp;
00063 
00064     // Boost to Breit frame (use opposite convention for photon --- along *minus* z)
00065     tmp.preMult(Matrix3(Vector3::mkX(), PI));
00066     const double bz = 1 - 2*x();
00067     _breit = LorentzTransform(Vector3::mkZ() * bz).combine(tmp);
00068     assert(isZero(angle(_breit.transform(pGamma).vector3(), -Vector3::mkZ())));
00069     assert(isZero(_breit.transform(pLepOut).azimuthalAngle()));
00070   }
00071 
00072 
00073   int DISKinematics::compare(const Projection & p) const {
00074     const DISKinematics& other = pcast<DISKinematics>(p);
00075     return mkNamedPCmp(other, "Lepton");
00076   }
00077 
00078 
00079 }