FoxWolframMoments.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Tools/Logging.hh" 00003 #include "Rivet/Projections/FoxWolframMoments.hh" 00004 #include "Rivet/Cmp.hh" 00005 00006 namespace Rivet { 00007 00008 int FoxWolframMoments::compare(const Projection& p) const { 00009 return mkNamedPCmp(p, "FS"); 00010 } 00011 00012 00013 void FoxWolframMoments::project(const Event& e) { 00014 // Project into final state and get total visible momentum 00015 const FinalState& fs = applyProjection<FinalState>(e, "VFS"); 00016 00017 // remember: # pairs = N! / ( r! * (N-r)! ) 00018 // N.B.: Autocorrelations are included! Treat them separately as diagonal elements. 00019 // see: http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node215.html 00020 00021 double sumEnergy = 0.0; 00022 for (ParticleVector::const_iterator pi = fs.particles().begin(); pi != fs.particles().end(); ++pi) { 00023 sumEnergy += pi->momentum().E(); 00024 const FourMomentum pi_4 = pi->momentum(); 00025 for (ParticleVector::const_iterator pj = pi+1; pj != fs.particles().end(); ++pj) { 00026 const FourMomentum pj_4 = pj->momentum(); 00027 00028 // Calculate x_ij = cos(theta_ij) 00029 double x_ij = 1.0; 00030 if ( pi != pj ) { 00031 double denom = pi_4.vector3().mod() * pj_4.vector3().mod(); 00032 x_ij = pi_4.vector3().dot( pj_4.vector3() ) / denom; 00033 } 00034 00035 //const double core = fabs( pi_4 * pj_4 ); // / sumet2 ; 00036 const double core = pi_4.vector3().mod() * pi_4.vector3().mod(); 00037 00038 for (int order = 0; order < MAXMOMENT; ++order) { 00039 // enter a factor 2.0 because ij = ji. Use symmetry to speed up! 00040 _fwmoments[order] += 2.0 * core * gsl_sf_legendre_Pl( order, x_ij ) ; 00041 } 00042 } // end loop over p_j 00043 00044 // Now add autocorrelations 00045 // Obviously cos(theta_ij) = 1.0 00046 // Note that P_l(1) == 1 for each l 00047 for (int order = 0; order < MAXMOMENT; ++order) { 00048 _fwmoments[order] += fabs( pi_4 * pi_4 ); 00049 } 00050 } // end loop over p_i 00051 00052 MSG_DEBUG("sumEnergy = " << sumEnergy); 00053 00054 for (int order = 0; order < MAXMOMENT; ++order) { 00055 _fwmoments[order] /= (sumEnergy*sumEnergy); 00056 } 00057 00058 // Normalize to H0 00059 for (int order = 1; order < MAXMOMENT; ++order) { 00060 _fwmoments[order] /= _fwmoments[0]; 00061 } 00062 } 00063 00064 } Generated on Fri Dec 21 2012 15:03:40 for The Rivet MC analysis system by ![]() |