BOSS
7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtHelAmp.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of the EvtGen package developed jointly
5
// for the BaBar and CLEO collaborations. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/COPYRIGHT
9
// Copyright (C) 1998 Caltech, UCSB
10
//
11
// Module: EvtHelAmp.cc
12
//
13
// Description: Decay model for implementation of generic 2 body
14
// decay specified by the helicity amplitudes
15
//
16
//
17
// Modification history:
18
//
19
// RYD March 14, 1999 Module created
20
//
21
//------------------------------------------------------------------------
22
//
23
#include "
EvtGenBase/EvtPatches.hh
"
24
#include <stdlib.h>
25
#include "
EvtGenBase/EvtParticle.hh
"
26
#include "
EvtGenBase/EvtGenKine.hh
"
27
#include "
EvtGenBase/EvtPDL.hh
"
28
#include "
EvtGenBase/EvtReport.hh
"
29
#include "
EvtGenModels/EvtHelAmp.hh
"
30
#include "
EvtGenBase/EvtId.hh
"
31
#include <string>
32
#include "
EvtGenBase/EvtConst.hh
"
33
#include "
EvtGenBase/EvtEvalHelAmp.hh
"
34
using
std::endl;
35
36
37
EvtHelAmp::~EvtHelAmp
() {
38
39
delete
_evalHelAmp;
40
41
}
42
43
void
EvtHelAmp::getName
(std::string& model_name){
44
45
model_name=
"HELAMP"
;
46
47
}
48
49
50
EvtDecayBase
*
EvtHelAmp::clone
(){
51
52
return
new
EvtHelAmp
;
53
54
}
55
56
void
EvtHelAmp::init
(){
57
58
checkNDaug
(2);
59
60
61
//find out how many states each particle have
62
int
_nA=
EvtSpinType::getSpinStates
(
EvtPDL::getSpinType
(
getParentId
()));
63
int
_nB=
EvtSpinType::getSpinStates
(
EvtPDL::getSpinType
(
getDaug
(0)));
64
int
_nC=
EvtSpinType::getSpinStates
(
EvtPDL::getSpinType
(
getDaug
(1)));
65
66
if
(
verbose
()){
67
report
(
INFO
,
"EvtGen"
)<<
"_nA,_nB,_nC:"
68
<<_nA<<
","
<<_nB<<
","
<<_nC<<endl;
69
}
70
71
//find out what 2 times the spin is
72
int
_JA2=
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getParentId
()));
73
int
_JB2=
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
(0)));
74
int
_JC2=
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
(1)));
75
76
if
(
verbose
()){
77
report
(
INFO
,
"EvtGen"
)<<
"_JA2,_JB2,_JC2:"
78
<<_JA2<<
","
<<_JB2<<
","
<<_JC2<<endl;
79
}
80
81
//allocate memory
82
int
* _lambdaA2=
new
int
[_nA];
83
int
* _lambdaB2=
new
int
[_nB];
84
int
* _lambdaC2=
new
int
[_nC];
85
86
EvtComplexPtr
* _HBC=
new
EvtComplexPtr
[_nB];
87
int
ib,ic;
88
for
(ib=0;ib<_nB;ib++){
89
_HBC[ib]=
new
EvtComplex
[_nC];
90
}
91
92
int
i;
93
//find the allowed helicities (actually 2*times the helicity!)
94
fillHelicity(_lambdaA2,_nA,_JA2,
getParentId
());
95
fillHelicity(_lambdaB2,_nB,_JB2,
getDaug
(0));
96
fillHelicity(_lambdaC2,_nC,_JC2,
getDaug
(1));
97
98
if
(
verbose
()){
99
report
(
INFO
,
"EvtGen"
)<<
"Helicity states of particle A:"
<<endl;
100
for
(i=0;i<_nA;i++){
101
report
(
INFO
,
"EvtGen"
)<<_lambdaA2[i]<<endl;
102
}
103
104
report
(
INFO
,
"EvtGen"
)<<
"Helicity states of particle B:"
<<endl;
105
for
(i=0;i<_nB;i++){
106
report
(
INFO
,
"EvtGen"
)<<_lambdaB2[i]<<endl;
107
}
108
109
report
(
INFO
,
"EvtGen"
)<<
"Helicity states of particle C:"
<<endl;
110
for
(i=0;i<_nC;i++){
111
report
(
INFO
,
"EvtGen"
)<<_lambdaC2[i]<<endl;
112
}
113
}
114
115
//now read in the helicity amplitudes
116
117
int
argcounter=0;
118
119
for
(ib=0;ib<_nB;ib++){
120
for
(ic=0;ic<_nC;ic++){
121
_HBC[ib][ic]=0.0;
122
if
(
abs
(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) argcounter+=2;
123
}
124
}
125
126
checkNArg
(argcounter);
127
128
argcounter=0;
129
130
for
(ib=0;ib<_nB;ib++){
131
for
(ic=0;ic<_nC;ic++){
132
if
(
abs
(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
133
_HBC[ib][ic]=
getArg
(argcounter)*
exp
(
EvtComplex
(0.0,
getArg
(argcounter+1)));;
134
argcounter+=2;
135
if
(
verbose
()){
136
report
(
INFO
,
"EvtGen"
)<<
"_HBC["
<<ib<<
"]["
<<ic<<
"]="
137
<<_HBC[ib][ic]<<endl;
138
}
139
}
140
}
141
}
142
143
_evalHelAmp=
new
EvtEvalHelAmp
(
EvtPDL::getSpinType
(
getParentId
()),
144
EvtPDL::getSpinType
(
getDaug
(0)),
145
EvtPDL::getSpinType
(
getDaug
(1)),
146
_HBC);
147
148
// Note: these are not class data members but local variables.
149
delete
[] _lambdaA2;
150
delete
[] _lambdaB2;
151
delete
[] _lambdaC2;
152
for
(
int
ib=0;ib<_nB;ib++){
153
delete
[] _HBC[ib];
154
}
155
delete
[] _HBC;
// _HBC is copied in ctor of EvtEvalHelAmp above.
156
157
}
158
159
160
void
EvtHelAmp::initProbMax
(){
161
162
double
maxprob=_evalHelAmp->
probMax
();
163
164
if
(
verbose
()){
165
report
(
INFO
,
"EvtGen"
)<<
"Calculated probmax"
<<maxprob<<endl;
166
}
167
168
setProbMax
(maxprob);
169
170
}
171
172
173
void
EvtHelAmp::decay
(
EvtParticle
*p){
174
175
//first generate simple phase space
176
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
());
177
178
_evalHelAmp->
evalAmp
(p,
_amp2
);
179
180
return ;
181
182
}
183
184
185
void
EvtHelAmp::fillHelicity(
int
* lambda2,
int
n,
int
J2,
EvtId
id
){
186
187
int
i;
188
189
//photon is special case!
190
if
(n==2&&J2==2) {
191
lambda2[0]=2;
192
lambda2[1]=-2;
193
return
;
194
}
195
196
//and so is the neutrino!
197
if
(n==1&&J2==1) {
198
if
(
EvtPDL::getStdHep
(
id
)>0){
199
//particle i.e. lefthanded
200
lambda2[0]=-1;
201
}
else
{
202
//anti particle i.e. righthanded
203
lambda2[0]=1;
204
}
205
return
;
206
}
207
208
assert(n==J2+1);
209
210
for
(i=0;i<n;i++){
211
lambda2[i]=n-i*2-1;
212
}
213
214
return
;
215
216
}
217
218
219
220
221
222
223
abs
#define abs(x)
Definition:
Eepipi/Eepipi-00-00-06/src/ee2eepp/basesv5.1/f2c.h:151
exp
EvtComplex exp(const EvtComplex &c)
Definition:
EvtComplex.hh:252
EvtConst.hh
EvtEvalHelAmp.hh
EvtGenKine.hh
EvtHelAmp.hh
EvtId.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
report
ostream & report(Severity severity, const char *facility)
Definition:
EvtReport.cc:36
EvtReport.hh
INFO
@ INFO
Definition:
EvtReport.hh:52
EvtComplex
Definition:
EvtComplex.hh:28
EvtDecayAmp::_amp2
EvtAmp _amp2
Definition:
EvtDecayAmp.hh:66
EvtDecayBase
Definition:
EvtDecayBase.hh:33
EvtDecayBase::getArg
double getArg(int j)
Definition:
EvtDecayBase.cc:564
EvtDecayBase::setProbMax
void setProbMax(double prbmx)
Definition:
EvtDecayBase.cc:297
EvtDecayBase::getParentId
EvtId getParentId()
Definition:
EvtDecayBase.hh:60
EvtDecayBase::verbose
int verbose()
Definition:
EvtDecayBase.hh:79
EvtDecayBase::getNDaug
int getNDaug()
Definition:
EvtDecayBase.hh:64
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition:
EvtDecayBase.cc:504
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition:
EvtDecayBase.hh:65
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition:
EvtDecayBase.cc:482
EvtDecayBase::getDaug
EvtId getDaug(int i)
Definition:
EvtDecayBase.hh:66
EvtEvalHelAmp
Definition:
EvtEvalHelAmp.hh:33
EvtEvalHelAmp::probMax
double probMax()
Definition:
EvtEvalHelAmp.cc:162
EvtEvalHelAmp::evalAmp
void evalAmp(EvtParticle *p, EvtAmp &)
Definition:
EvtEvalHelAmp.cc:202
EvtHelAmp::~EvtHelAmp
virtual ~EvtHelAmp()
Definition:
EvtHelAmp.cc:37
EvtHelAmp::EvtHelAmp
EvtHelAmp()
Definition:
EvtHelAmp.hh:39
EvtHelAmp::init
void init()
Definition:
EvtHelAmp.cc:56
EvtHelAmp::decay
void decay(EvtParticle *p)
Definition:
EvtHelAmp.cc:173
EvtHelAmp::initProbMax
void initProbMax()
Definition:
EvtHelAmp.cc:160
EvtHelAmp::clone
EvtDecayBase * clone()
Definition:
EvtHelAmp.cc:50
EvtHelAmp::getName
void getName(std::string &name)
Definition:
EvtHelAmp.cc:43
EvtId
Definition:
EvtId.hh:27
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition:
EvtPDL.hh:56
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition:
EvtPDL.hh:61
EvtParticle
Definition:
EvtParticle.hh:42
EvtParticle::initializePhaseSpace
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition:
EvtParticle.cc:1071
EvtSpinType::getSpin2
static int getSpin2(spintype stype)
Definition:
EvtSpinType.hh:34
EvtSpinType::getSpinStates
static int getSpinStates(spintype stype)
Definition:
EvtSpinType.hh:64
source
Generator
BesEvtGen
BesEvtGen-00-04-08
src
EvtGen
EvtGenModels
EvtHelAmp.cc
Generated by
1.9.6