Line data Source code
1 : #include "EvtGenBase/EvtPatches.hh"
2 : /*******************************************************************************
3 : * Project: BaBar detector at the SLAC PEP-II B-factory
4 : * Package: EvtGenBase
5 : * File: $Id: EvtTwoBodyVertex.cpp,v 1.3 2009-03-16 15:38:39 robbep Exp $
6 : * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
7 : *
8 : * Copyright (C) 2002 Caltech
9 : *******************************************************************************/
10 :
11 : #include <iostream>
12 : #include <math.h>
13 : #include <assert.h>
14 : #include "EvtGenBase/EvtMacros.hh"
15 : #include "EvtGenBase/EvtTwoBodyVertex.hh"
16 : using std::endl;
17 : using std::ostream;
18 :
19 :
20 : // Default ctor can sometimes be useful
21 :
22 0 : EvtTwoBodyVertex::EvtTwoBodyVertex()
23 0 : : _LL(0), _p0(0), _f(0)
24 0 : {}
25 :
26 : EvtTwoBodyVertex::EvtTwoBodyVertex(double mA, double mB, double mAB, int L)
27 0 : : _kine(), _LL(L), _p0(0), _f(0)
28 0 : {
29 : // Kinematics is initialized only if the decay is above threshold
30 :
31 0 : if(mAB > mA + mB) {
32 :
33 0 : _kine = EvtTwoBodyKine(mA,mB,mAB);
34 0 : _p0 = _kine.p();
35 0 : }
36 0 : }
37 :
38 :
39 : EvtTwoBodyVertex::EvtTwoBodyVertex(const EvtTwoBodyVertex& other)
40 0 : : _kine(other._kine), _LL(other._LL), _p0(other._p0),
41 0 : _f( (other._f) ? new EvtBlattWeisskopf(*other._f) : 0 )
42 0 : {}
43 :
44 : EvtTwoBodyVertex::~EvtTwoBodyVertex()
45 0 : {
46 0 : if(_f) delete _f;
47 0 : }
48 :
49 :
50 : void EvtTwoBodyVertex::set_f(double R)
51 : {
52 0 : if(_f) delete _f;
53 0 : _f = new EvtBlattWeisskopf(_LL,R,_p0);
54 0 : }
55 :
56 :
57 : double EvtTwoBodyVertex::widthFactor(EvtTwoBodyKine x) const
58 : {
59 0 : assert(_p0 > 0.);
60 :
61 0 : double p1 = x.p();
62 0 : double ff = formFactor(x);
63 0 : double factor = pow(p1/_p0,2*_LL+1)*mAB()/x.mAB() * ff * ff;
64 :
65 0 : return factor;
66 0 : }
67 :
68 :
69 : double EvtTwoBodyVertex::phaseSpaceFactor(EvtTwoBodyKine x,EvtTwoBodyKine::Index i) const
70 : {
71 0 : double p1 = x.p(i);
72 0 : double factor = pow(p1,_LL);
73 0 : return factor;
74 : }
75 :
76 : double EvtTwoBodyVertex::formFactor(EvtTwoBodyKine x) const
77 : {
78 : double ff = 1.;
79 :
80 0 : if(_f) {
81 :
82 0 : double p1 = x.p();
83 0 : ff = (*_f)(p1);
84 0 : }
85 :
86 0 : return ff;
87 : }
88 :
89 : void EvtTwoBodyVertex::print(ostream& os) const
90 : {
91 0 : os << " mA = " << mA() << endl;
92 0 : os << " mB = " << mB() << endl;
93 0 : os << "mAB = " << mAB() << endl;
94 0 : os << " L = " << _LL << endl;
95 0 : os << " p0 = " << _p0 << endl;
96 0 : }
97 :
98 :
99 : ostream& operator<<(ostream& os, const EvtTwoBodyVertex& v)
100 : {
101 0 : v.print(os);
102 0 : return os;
103 : }
|