CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
SVfit_namespace Namespace Reference

Functions

reco::Candidate::Vector compCrossProduct (const reco::Candidate::Vector &p1, const reco::Candidate::Vector &p2)
 
double compScalarProduct (const reco::Candidate::Vector &p1, const reco::Candidate::Vector &p2)
 
reco::Candidate::Vector normalize (const reco::Candidate::Vector &p)
 
double phiLabFromLabMomenta (const reco::Candidate::LorentzVector &motherP4, const reco::Candidate::LorentzVector &visP4)
 
double square (double x)
 

Function Documentation

reco::Candidate::Vector SVfit_namespace::compCrossProduct ( const reco::Candidate::Vector p1,
const reco::Candidate::Vector p2 
)

Definition at line 56 of file MCEmbeddingValidationAnalyzer.cc.

Referenced by phiLabFromLabMomenta().

57  {
58  double p3_x = p1.y()*p2.z() - p1.z()*p2.y();
59  double p3_y = p1.z()*p2.x() - p1.x()*p2.z();
60  double p3_z = p1.x()*p2.y() - p1.y()*p2.x();
61  return reco::Candidate::Vector(p3_x, p3_y, p3_z);
62  }
math::XYZVector Vector
point in the space
Definition: Candidate.h:47
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
double SVfit_namespace::compScalarProduct ( const reco::Candidate::Vector p1,
const reco::Candidate::Vector p2 
)

Definition at line 51 of file MCEmbeddingValidationAnalyzer.cc.

Referenced by phiLabFromLabMomenta().

52  {
53  return (p1.x()*p2.x() + p1.y()*p2.y() + p1.z()*p2.z());
54  }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
reco::Candidate::Vector SVfit_namespace::normalize ( const reco::Candidate::Vector p)

Definition at line 40 of file MCEmbeddingValidationAnalyzer.cc.

References mag(), mag2(), AlCaHLTBitMon_ParallelJobs::p, and square().

Referenced by Rivet::CMS_2013_I1224539_DIJET::finalize(), and phiLabFromLabMomenta().

41  {
42  double p_x = p.x();
43  double p_y = p.y();
44  double p_z = p.z();
45  double mag2 = square(p_x) + square(p_y) + square(p_z);
46  if ( mag2 <= 0. ) return p;
47  double mag = TMath::Sqrt(mag2);
48  return reco::Candidate::Vector(p_x/mag, p_y/mag, p_z/mag);
49  }
math::XYZVector Vector
point in the space
Definition: Candidate.h:47
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
double square(const double a)
double SVfit_namespace::phiLabFromLabMomenta ( const reco::Candidate::LorentzVector motherP4,
const reco::Candidate::LorentzVector visP4 
)

Definition at line 64 of file MCEmbeddingValidationAnalyzer.cc.

References compCrossProduct(), compScalarProduct(), and normalize().

Referenced by MCEmbeddingValidationAnalyzer::analyze().

65  {
66  reco::Candidate::Vector u_z = normalize(reco::Candidate::Vector(visP4.px(), visP4.py(), visP4.pz()));
69 
70  reco::Candidate::Vector p3Mother_unit = normalize(reco::Candidate::Vector(motherP4.px(), motherP4.py(), motherP4.pz()));
71 
72  double phi_lab = TMath::ATan2(compScalarProduct(p3Mother_unit, u_y), compScalarProduct(p3Mother_unit, u_x));
73  return phi_lab;
74  }
math::XYZVector Vector
point in the space
Definition: Candidate.h:47
reco::Candidate::Vector compCrossProduct(const reco::Candidate::Vector &p1, const reco::Candidate::Vector &p2)
reco::Candidate::Vector normalize(const reco::Candidate::Vector &p)
double compScalarProduct(const reco::Candidate::Vector &p1, const reco::Candidate::Vector &p2)
double SVfit_namespace::square ( double  x)
inline

Definition at line 35 of file MCEmbeddingValidationAnalyzer.cc.

References x.

Referenced by normalize().

36  {
37  return x*x;
38  }
Definition: DDAxes.h:10