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