BOSS
7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAngSam3.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of models developed at BES collaboration
5
// based on the EvtGen framework. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/BesCopyright
9
// Copyright (A) 2006 Ping Rong-Gang @IHEP
10
//
11
// Module: EvtAngSam3.cc
12
//
13
// Description: Routine to decay a particle to two bodies by sampling angular distribution in Lab
14
// system.
15
//
16
// Modification history:
17
//
18
// Ping R.-G. December, 2006 Module created
19
//
20
//------------------------------------------------------------------------
21
//
22
#include "
EvtGenBase/EvtPatches.hh
"
23
#include <stdlib.h>
24
#include "
EvtGenBase/EvtParticle.hh
"
25
#include "
EvtGenBase/EvtGenKine.hh
"
26
#include "
EvtGenBase/EvtPDL.hh
"
27
#include "
EvtGenBase/EvtVector4C.hh
"
28
#include "
EvtGenBase/EvtVector4R.hh
"
29
#include "
EvtGenBase/EvtTensor4C.hh
"
30
#include "
EvtGenBase/EvtDiracParticle.hh
"
31
#include "
EvtGenBase/EvtScalarParticle.hh
"
32
#include "
EvtGenBase/EvtVectorParticle.hh
"
33
#include "
EvtGenBase/EvtTensorParticle.hh
"
34
#include "
EvtGenBase/EvtPhotonParticle.hh
"
35
#include "
EvtGenBase/EvtNeutrinoParticle.hh
"
36
#include "
EvtGenBase/EvtStringParticle.hh
"
37
#include "
EvtGenBase/EvtRaritaSchwingerParticle.hh
"
38
#include "
EvtGenBase/EvtHighSpinParticle.hh
"
39
#include "
EvtGenBase/EvtReport.hh
"
40
#include "
EvtGenBase/EvtHelSys.hh
"
41
#include "
EvtGenModels/EvtAngSam3.hh
"
42
#include "
EvtGenBase/EvtRandom.hh
"
43
#include <string>
44
using
std::cout;
45
using
std::endl;
46
47
EvtAngSam3::~EvtAngSam3
() {}
48
49
void
EvtAngSam3::getName
(std::string& model_name){
50
51
model_name=
"AngSam3"
;
52
53
}
54
55
EvtDecayBase
*
EvtAngSam3::clone
(){
56
57
return
new
EvtAngSam3
;
58
59
}
60
61
62
void
EvtAngSam3::init
(){
63
64
// check angular distribution parameters
65
checkNDaug
(3);
66
EvtSpinType::spintype
parenttype =
EvtPDL::getSpinType
(
getParentId
());
67
68
if
(
getNArg
()>6 ||
getNArg
()<2 ) {
69
report
(
ERROR
,
"EvtGen"
)<<
" 2<= expected parameters <=6, but it is "
<<
getNArg
()<<endl;
70
::abort();
71
}
72
}
73
74
void
EvtAngSam3::initProbMax
(){
75
76
noProbMax
();
77
78
}
79
80
void
EvtAngSam3::decay
(
EvtParticle
*p ){
81
82
loop:
83
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
());
84
85
EvtParticle
*
v
,*s1,*s2;
86
EvtVector4R
pv,ps;
87
EvtVector4R
Lpt,xp;
88
89
v
=p->
getDaug
(0);
90
s1=p->
getDaug
(1);
91
s2=p->
getDaug
(2);
92
pv=
v
->getP4();
93
ps=s1->
getP4
();
94
Lpt=p->
getP4
();
95
xp=pv.
cross
(ps);
96
97
// calculate the cos (theta) between xp and Lpt
98
double
costheta
;
99
if
(Lpt.
d3mag
()<0.0001){
100
costheta
= xp.
get
(3)/xp.
d3mag
();
101
}
else
{
102
costheta
= (xp.
get
(1)*Lpt.
get
(1) + xp.
get
(2)*Lpt.
get
(2) + xp.
get
(3)*Lpt.
get
(3))/xp.
d3mag
()/Lpt.
d3mag
();
103
}
104
int
narg=
getNArg
();
105
double
c0,c2,c4,c6,c8,c10;
106
c0=0;c2=0;c4=0;c6=0;c8=0;c10=0;
107
if
(narg==2) {
108
c0=
getArg
(0);
109
c2=
getArg
(1);
110
}
else
if
(narg==3){
111
c0=
getArg
(0);
112
c2=
getArg
(1);
113
c4=
getArg
(2);
114
}
else
if
(narg==4){
115
c0=
getArg
(0);
116
c2=
getArg
(1);
117
c4=
getArg
(2);
118
c6=
getArg
(3);
119
}
else
if
(narg==5){
120
c0=
getArg
(0);
121
c2=
getArg
(1);
122
c4=
getArg
(2);
123
c6=
getArg
(3);
124
c8=
getArg
(4);
125
}
else
if
(narg==6){
126
c0=
getArg
(0);
127
c2=
getArg
(1);
128
c4=
getArg
(2);
129
c6=
getArg
(3);
130
c8=
getArg
(4);
131
c10=
getArg
(5);
132
}
133
134
double
costheta2=
costheta
*
costheta
;
135
double
costheta4= costheta2*costheta2;
136
double
costheta6= costheta4*costheta2;
137
double
costheta8= costheta6*costheta2;
138
double
costheta10= costheta8*costheta2;
139
140
double
amp1=(c0+c2*costheta2+c4*costheta4+c6*costheta6+c8*costheta8+c10*costheta10);
141
double
a0
,a2,a4,a6,a8,a10;
142
double
ampflag;
143
if
(c0<0) {
a0
=0;}
else
{
a0
=c0;}
144
if
(c2<0) {a2=0;}
else
{a2=c2;}
145
if
(c4<0) {a4=0;}
else
{a4=c4;}
146
if
(c6<0) {a6=0;}
else
{a6=c6;}
147
if
(c8<0) {a8=0;}
else
{a8=c8;}
148
if
(c10<0) {a10=0;}
else
{a10=c10;}
149
ampflag=
a0
+a2+a4+a6+a8+a10;
150
if
( ampflag<=0 ) {
151
report
(
ERROR
,
"EvtGen"
)<<
" The maxium value of amplitude square should be positive, but it is "
<< ampflag<<endl;
152
::abort();
153
}
154
ampflag = amp1/ampflag;
155
double
rd1=
EvtRandom::Flat
(0.0, 1.0);
156
if
(rd1>=ampflag)
goto
loop;
157
return ;
158
}
159
160
a0
character *LEPTONflag integer iresonances real zeta5 real a0
Definition
Ekhara/Ekhara-00-01-02/src/ekhara/common.h:4
EvtAngSam3.hh
EvtDiracParticle.hh
EvtGenKine.hh
EvtHelSys.hh
EvtHighSpinParticle.hh
EvtNeutrinoParticle.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtPhotonParticle.hh
EvtRandom.hh
EvtRaritaSchwingerParticle.hh
report
ostream & report(Severity severity, const char *facility)
Definition
EvtReport.cc:36
EvtReport.hh
ERROR
@ ERROR
Definition
EvtReport.hh:49
EvtScalarParticle.hh
EvtStringParticle.hh
EvtTensor4C.hh
EvtTensorParticle.hh
EvtVector4C.hh
EvtVector4R.hh
EvtVectorParticle.hh
v
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition
KarLud.h:35
EvtAngSam3::~EvtAngSam3
virtual ~EvtAngSam3()
Definition
EvtAngSam3.cc:47
EvtAngSam3::clone
EvtDecayBase * clone()
Definition
EvtAngSam3.cc:55
EvtAngSam3::getName
void getName(std::string &name)
Definition
EvtAngSam3.cc:49
EvtAngSam3::init
void init()
Definition
EvtAngSam3.cc:62
EvtAngSam3::EvtAngSam3
EvtAngSam3()
Definition
EvtAngSam3.hh:32
EvtAngSam3::initProbMax
void initProbMax()
Definition
EvtAngSam3.cc:74
EvtAngSam3::decay
void decay(EvtParticle *p)
Definition
EvtAngSam3.cc:80
EvtDecayBase
Definition
EvtDecayBase.hh:33
EvtDecayBase::getArg
double getArg(int j)
Definition
EvtDecayBase.cc:564
EvtDecayBase::noProbMax
void noProbMax()
Definition
EvtDecayBase.cc:304
EvtDecayBase::getParentId
EvtId getParentId()
Definition
EvtDecayBase.hh:60
EvtDecayBase::getNDaug
int getNDaug()
Definition
EvtDecayBase.hh:64
EvtDecayBase::getNArg
int getNArg()
Definition
EvtDecayBase.hh:67
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition
EvtDecayBase.cc:504
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition
EvtDecayBase.hh:65
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition
EvtPDL.hh:61
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cc:120
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition
EvtParticle.cc:84
EvtParticle::initializePhaseSpace
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition
EvtParticle.cc:1070
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cc:74
EvtSpinType::spintype
spintype
Definition
EvtSpinType.hh:31
EvtVector4R
Definition
EvtVector4R.hh:29
EvtVector4R::get
double get(int i) const
Definition
EvtVector4R.hh:179
EvtVector4R::cross
EvtVector4R cross(const EvtVector4R &v2)
Definition
EvtVector4R.cc:171
EvtVector4R::d3mag
double d3mag() const
Definition
EvtVector4R.cc:186
costheta
float costheta
Definition
prepare_data.cxx:28
7.1.2
Generator
BesEvtGen
BesEvtGen-00-04-30
src
EvtGen
EvtGenModels
EvtAngSam3.cc
Generated by
1.12.0