CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
helicityAngle.cc
Go to the documentation of this file.
1 // $Id: helicityAngle.cc,v 1.1 2009/02/26 09:17:35 llista Exp $
5 #include <Math/VectorUtil.h>
6 using namespace reco;
7 using namespace std;
8 
9 double helicityAngle( const reco::Candidate & mother, const reco::Candidate & daughter) {
10  Particle::Vector boost = mother.p4().BoostToCM();
11  Particle::LorentzVector pdau = ROOT::Math::VectorUtil::boost( daughter.p4(), boost );
12  double h = ROOT::Math::VectorUtil::Angle( pdau, boost );
13  if ( h > M_PI / 2 ) h = M_PI - h;
14  return h;
15 }
16 
17 
18 double helicityAngle( const Candidate & cand ) {
19  assert( cand.numberOfDaughters() == 2 );
20  return helicityAngle( cand, *cand.daughter(0) );
21 }
22 
23 
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual size_type numberOfDaughters() const =0
number of daughters
#define M_PI
Definition: BFit3D.cc:3
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
math::XYZVector Vector
point in the space
Definition: Particle.h:31
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:25
double helicityAngle(const reco::Candidate &mother, const reco::Candidate &daughter)
return the helicity angle for two particles.
Definition: helicityAngle.cc:9
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector