CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VirtualJetProducerHelper.cc
Go to the documentation of this file.
2 
3 #include <cmath>
4 
5 
7 {
8  if (r12 == 0) return M_PI;
9  if (r12 >= 2) return 0;
10  return 2 * acos(r12/2) - 0.5*r12*sqrt(4 - r12*r12);
11 }
12 
13 double reco::helper::VirtualJetProducerHelper::intersection(double r12, double r23, double r13)
14 {
15  if (r12 >= 2 || r23 >= 2 || r13 >= 2) return 0;
16  const double r12_2 = r12*r12;
17  const double r13_2 = r13*r13;
18  const double temp = (r12_2 + r13_2 - r23*r23);
19  const double T2 = 4*r12_2*r13_2 - temp*temp;
20  const double common = 0.5*( intersection(r12) + intersection(r13) + intersection(r23) - M_PI + sqrt(T2)/2 );
21  return common;
22 }
23 
T sqrt(T t)
Definition: SSEVec.h:46
#define M_PI
Definition: BFit3D.cc:3