CGEM BOSS
6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtTwoBodyKine.cc
Go to the documentation of this file.
1
#include "
EvtGenBase/EvtPatches.hh
"
2
/*******************************************************************************
3
* Project: BaBar detector at the SLAC PEP-II B-factory
4
* Package: EvtGenBase
5
* File: $Id: EvtTwoBodyKine.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
6
* Author: Alexei Dvoretskii,
[email protected]
, 2001-2002
7
*
8
* Copyright (C) 2002 Caltech
9
*******************************************************************************/
10
11
#include <iostream>
12
#include <assert.h>
13
#include <math.h>
14
#include "
EvtGenBase/EvtTwoBodyKine.hh
"
15
#include "
EvtGenBase/EvtReport.hh
"
16
using
std::endl;
17
using
std::ostream;
18
19
20
EvtTwoBodyKine::EvtTwoBodyKine
()
21
: _mA(0.), _mB(0.), _mAB(0.)
22
{}
23
24
EvtTwoBodyKine::EvtTwoBodyKine
(
double
mA,
double
mB,
double
mAB)
25
: _mA(mA), _mB(mB), _mAB(mAB)
26
{
27
if
(
mAB
<
mA
+
mB
) {
28
29
report
(
INFO
,
"EvtGen"
) <<
mAB
<<
" < "
<<
mA
<<
" + "
<<
mB
<< endl;
30
assert(0);
31
}
32
}
33
34
EvtTwoBodyKine::EvtTwoBodyKine
(
const
EvtTwoBodyKine
& other)
35
: _mA(other._mA), _mB(other._mB), _mAB(other._mAB)
36
{}
37
38
EvtTwoBodyKine::~EvtTwoBodyKine
()
39
{}
40
41
42
double
EvtTwoBodyKine::m
(
Index
i)
const
43
{
44
double
ret = _mAB;
45
if
(
A
== i) ret = _mA;
46
else
47
if
(
B
== i) ret = _mB;
48
49
return
ret;
50
}
51
52
53
double
EvtTwoBodyKine::p
(
Index
i)
const
54
{
55
double
p0 = 0.;
56
57
if
(i ==
AB
) {
58
59
double
x
= _mAB*_mAB - _mA*_mA - _mB*_mB;
60
double
y = 2*_mA*_mB;
61
p0 = sqrt(
x
*
x
- y*y)/2./_mAB;
62
}
63
else
64
if
(i ==
A
) {
65
66
double
x
= _mA*_mA - _mAB*_mAB - _mB*_mB;
67
double
y = 2*_mAB*_mB;
68
p0 = sqrt(
x
*
x
- y*y)/2./_mA;
69
}
70
else
{
71
72
double
x
= _mB*_mB - _mAB*_mAB - _mA*_mA;
73
double
y = 2*_mAB*_mA;
74
p0 = sqrt(
x
*
x
- y*y)/2./_mB;
75
}
76
77
return
p0;
78
}
79
80
81
double
EvtTwoBodyKine::e
(
Index
i,
Index
j)
const
82
{
83
double
ret =
m
(i);
84
if
(i != j) {
85
86
double
pD =
p
(j);
87
ret = sqrt(ret*ret + pD*pD);
88
}
89
return
ret;
90
}
91
92
93
void
EvtTwoBodyKine::print
(ostream& os)
const
94
{
95
os <<
" mA = "
<< _mA << endl;
96
os <<
" mB = "
<< _mB << endl;
97
os <<
"mAB = "
<< _mAB << endl;
98
}
99
100
101
ostream&
operator<<
(ostream& os,
const
EvtTwoBodyKine
& p)
102
{
103
p.
print
(os);
104
return
os;
105
}
x
Double_t x[10]
Definition:
DataBase/tau_mode.c:57
EvtPatches.hh
report
ostream & report(Severity severity, const char *facility)
Definition:
EvtReport.cc:36
EvtReport.hh
INFO
@ INFO
Definition:
EvtReport.hh:52
operator<<
ostream & operator<<(ostream &os, const EvtTwoBodyKine &p)
Definition:
EvtTwoBodyKine.cc:101
EvtTwoBodyKine.hh
EvtTwoBodyKine
Definition:
EvtTwoBodyKine.hh:17
EvtTwoBodyKine::mB
double mB() const
Definition:
EvtTwoBodyKine.hh:31
EvtTwoBodyKine::Index
Index
Definition:
EvtTwoBodyKine.hh:21
EvtTwoBodyKine::A
@ A
Definition:
EvtTwoBodyKine.hh:21
EvtTwoBodyKine::AB
@ AB
Definition:
EvtTwoBodyKine.hh:21
EvtTwoBodyKine::B
@ B
Definition:
EvtTwoBodyKine.hh:21
EvtTwoBodyKine::~EvtTwoBodyKine
~EvtTwoBodyKine()
Definition:
EvtTwoBodyKine.cc:38
EvtTwoBodyKine::mAB
double mAB() const
Definition:
EvtTwoBodyKine.hh:32
EvtTwoBodyKine::print
void print(std::ostream &os) const
Definition:
EvtTwoBodyKine.cc:93
EvtTwoBodyKine::EvtTwoBodyKine
EvtTwoBodyKine()
Definition:
EvtTwoBodyKine.cc:20
EvtTwoBodyKine::m
double m(Index i) const
Definition:
EvtTwoBodyKine.cc:42
EvtTwoBodyKine::p
double p(Index i=AB) const
Definition:
EvtTwoBodyKine.cc:53
EvtTwoBodyKine::mA
double mA() const
Definition:
EvtTwoBodyKine.hh:30
EvtTwoBodyKine::e
double e(Index i, Index j) const
Definition:
EvtTwoBodyKine.cc:81
source
Generator
BesEvtGen
BesEvtGen-00-01-96-slc6tag
src
EvtGen
EvtGenBase
EvtTwoBodyKine.cc
Generated by
1.9.6