CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoJets/JetProducers/src/VirtualJetProducerHelper.cc

Go to the documentation of this file.
00001 #include "RecoJets/JetProducers/interface/VirtualJetProducerHelper.h"
00002 
00003 #include <cmath>
00004 
00005 
00006 double reco::helper::VirtualJetProducerHelper::intersection(double r12) 
00007 {
00008   if (r12 == 0)         return M_PI;
00009   if (r12 >= 2)         return 0;
00010   return 2 * acos(r12/2) - 0.5*r12*sqrt(4 - r12*r12);
00011 }
00012 
00013 double reco::helper::VirtualJetProducerHelper::intersection(double r12, double r23, double r13) 
00014 {
00015   if (r12 >= 2 || r23 >= 2 || r13 >= 2) return 0;
00016   const double          r12_2   = r12*r12;
00017   const double          r13_2   = r13*r13;
00018   const double          temp    = (r12_2 + r13_2 - r23*r23);
00019   const double          T2      = 4*r12_2*r13_2 - temp*temp;
00020   const double          common  = 0.5*( intersection(r12) + intersection(r13) + intersection(r23) - M_PI + sqrt(T2)/2 );
00021   return common;
00022 }
00023