CMS 3D CMS Logo

helicityAngle.cc

Go to the documentation of this file.
00001 // $Id: helicityAngle.cc,v 1.14 2007/12/11 08:42:53 hegner Exp $
00002 #include "PhysicsTools/CandUtils/interface/helicityAngle.h"
00003 #include "DataFormats/Candidate/interface/Candidate.h"
00004 #include "PhysicsTools/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 

Generated on Tue Jun 9 17:41:04 2009 for CMSSW by  doxygen 1.5.4