Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:03

0001 // $Id: helicityAngle.cc,v 1.14 2007/12/11 08:42:53 hegner Exp $

0002 #include "CommonTools/CandUtils/interface/helicityAngle.h"
0003 #include "DataFormats/Candidate/interface/Candidate.h"
0004 #include "CommonTools/CandUtils/interface/Booster.h"
0005 #include <Math/VectorUtil.h>
0006 using namespace reco;
0007 using namespace std;
0008 
0009 double helicityAngle(const reco::Candidate& mother, const reco::Candidate& daughter) {
0010   Particle::Vector boost = mother.p4().BoostToCM();
0011   Particle::LorentzVector pdau = ROOT::Math::VectorUtil::boost(daughter.p4(), boost);
0012   double h = ROOT::Math::VectorUtil::Angle(pdau, boost);
0013   if (h > M_PI / 2)
0014     h = M_PI - h;
0015   return h;
0016 }
0017 
0018 double helicityAngle(const Candidate& cand) {
0019   assert(cand.numberOfDaughters() == 2);
0020   return helicityAngle(cand, *cand.daughter(0));
0021 }