CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CommonTools/CandUtils/src/helicityAngle.cc

Go to the documentation of this file.
00001 // $Id: helicityAngle.cc,v 1.1 2009/02/26 09:17:35 llista Exp $
00002 #include "CommonTools/CandUtils/interface/helicityAngle.h"
00003 #include "DataFormats/Candidate/interface/Candidate.h"
00004 #include "CommonTools/CandUtils/interface/Booster.h"
00005 #include <Math/VectorUtil.h>
00006 using namespace reco;
00007 using namespace std;
00008 
00009 double helicityAngle( const reco::Candidate & mother, const reco::Candidate & daughter) {
00010   Particle::Vector boost = mother.p4().BoostToCM();
00011   Particle::LorentzVector pdau = ROOT::Math::VectorUtil::boost( daughter.p4(), boost );
00012   double h = ROOT::Math::VectorUtil::Angle( pdau, boost );
00013   if ( h > M_PI / 2 ) h = M_PI - h;
00014   return h;  
00015 }
00016 
00017 
00018 double helicityAngle( const Candidate & cand ) {
00019   assert( cand.numberOfDaughters() == 2 );
00020   return helicityAngle( cand, *cand.daughter(0) );
00021 }
00022 
00023