1 #include "EvtGenBase/EvtPatches.hh"
2 /*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
5 * File: $Id: EvtTwoBodyKine.cc,v 1.8 2004/12/21 19:58:50 ryd Exp $
6 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
14 #include "EvtGenBase/EvtTwoBodyKine.hh"
15 #include "EvtGenBase/EvtReport.hh"
20 EvtTwoBodyKine::EvtTwoBodyKine()
21 : _mA(0.), _mB(0.), _mAB(0.)
24 EvtTwoBodyKine::EvtTwoBodyKine(double mA, double mB, double mAB)
25 : _mA(mA), _mB(mB), _mAB(mAB)
29 report(INFO,"EvtGen") << mAB << " < " << mA << " + " << mB << endl;
34 EvtTwoBodyKine::EvtTwoBodyKine(const EvtTwoBodyKine& other)
35 : _mA(other._mA), _mB(other._mB), _mAB(other._mAB)
38 EvtTwoBodyKine::~EvtTwoBodyKine()
42 double EvtTwoBodyKine::m(Index i) const
53 double EvtTwoBodyKine::p(Index i) const
59 double x = _mAB*_mAB - _mA*_mA - _mB*_mB;
61 p0 = sqrt(x*x - y*y)/2./_mAB;
66 double x = _mA*_mA - _mAB*_mAB - _mB*_mB;
67 double y = 2*_mAB*_mB;
68 p0 = sqrt(x*x - y*y)/2./_mA;
72 double x = _mB*_mB - _mAB*_mAB - _mA*_mA;
73 double y = 2*_mAB*_mA;
74 p0 = sqrt(x*x - y*y)/2./_mB;
81 double EvtTwoBodyKine::e(Index i, Index j) const
87 ret = sqrt(ret*ret + pD*pD);
93 void EvtTwoBodyKine::print(ostream& os) const
95 os << " mA = " << _mA << endl;
96 os << " mB = " << _mB << endl;
97 os << "mAB = " << _mAB << endl;
101 ostream& operator<<(ostream& os, const EvtTwoBodyKine& p)