|
[Rivet-svn] r3842 - branches/2012-06-aidarivet/src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Jul 18 14:40:47 BST 2012
Author: richardn Date: Wed Jul 18 14:40:46 2012 New Revision: 3842 Log: improved handling of numerical percision problems Modified: branches/2012-06-aidarivet/src/Analyses/MC_VH2BB.cc Modified: branches/2012-06-aidarivet/src/Analyses/MC_VH2BB.cc ============================================================================== --- branches/2012-06-aidarivet/src/Analyses/MC_VH2BB.cc Tue Jul 17 19:20:46 2012 (r3841) +++ branches/2012-06-aidarivet/src/Analyses/MC_VH2BB.cc Wed Jul 18 14:40:46 2012 (r3842) @@ -53,7 +53,16 @@ double angle1 = b1BOOSTED.angle(virtualVBMomentumBOOSTED); double angle2 = b2BOOSTED.angle(virtualVBMomentumBOOSTED); - double anglebb = b1BOOSTED.angle(b2BOOSTED); + double cosbb = b1BOOSTED.vector3().unit().dot(b2BOOSTED.vector3().unit()); + double test = 1.+cosbb; + double anglebb; + if(test<0.&&test>-1e-10) { + cosbb=-1.; + anglebb = M_PI; + } + else { + anglebb = acos(cosbb); + } vector<double> toReturn; toReturn.push_back(angle1 < angle2 ? angle1 : angle2);
More information about the Rivet-svn mailing list |