ClusteredPhotons.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Projections/ClusteredPhotons.hh" 00003 #include "Rivet/Tools/Logging.hh" 00004 #include "Rivet/Tools/ParticleIdUtils.hh" 00005 #include "Rivet/Cmp.hh" 00006 00007 namespace Rivet { 00008 00009 00010 int ClusteredPhotons::compare(const Projection& p) const { 00011 const PCmp fscmp = mkNamedPCmp(p, "Photons"); 00012 if (fscmp != EQUIVALENT) return fscmp; 00013 00014 const PCmp sigcmp = mkNamedPCmp(p, "Signal"); 00015 if (sigcmp != EQUIVALENT) return sigcmp; 00016 00017 const ClusteredPhotons& other = dynamic_cast<const ClusteredPhotons&>(p); 00018 int rcmp = cmp(_dRmax, other._dRmax); 00019 return rcmp; 00020 } 00021 00022 00023 void ClusteredPhotons::project(const Event& e) { 00024 _theParticles.clear(); 00025 if (!_dRmax > 0.0) return; 00026 00027 const FinalState& photons = applyProjection<FinalState>(e, "Photons"); 00028 const FinalState& signal = applyProjection<FinalState>(e, "Signal"); 00029 00030 foreach (const Particle& p, photons.particles()) { 00031 bool clustered = false; 00032 foreach (const Particle& l, signal.particles()) { 00033 // Only cluster photons around *charged* signal particles 00034 if (PID::threeCharge(l.pdgId()) == 0) continue; 00035 // Geometrically match momentum vectors 00036 const FourMomentum p_l = l.momentum(); 00037 const FourMomentum p_P = p.momentum(); 00038 if (deltaR(p_l.pseudorapidity(), p_l.azimuthalAngle(), 00039 p_P.pseudorapidity(), p_P.azimuthalAngle()) < _dRmax) { 00040 clustered = true; 00041 } 00042 } 00043 if (clustered) _theParticles.push_back(p); 00044 } 00045 MSG_DEBUG(name() << " found " << _theParticles.size() 00046 << " matching photons."); 00047 } 00048 00049 } Generated on Fri Dec 21 2012 15:03:40 for The Rivet MC analysis system by ![]() |