BOSS
7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSingleParticle2.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: EvtSingleParticle.cc
12
//
13
// Description: Special model to generate single particles.
14
//
15
// Modification history:
16
//
17
// RYD Febuary 17,1998 Module created
18
//
19
//------------------------------------------------------------------------
20
//
21
#include "
EvtGenBase/EvtPatches.hh
"
22
#include <stdlib.h>
23
#include "
EvtGenBase/EvtParticle.hh
"
24
#include "
EvtGenBase/EvtRandom.hh
"
25
#include "
EvtGenBase/EvtPDL.hh
"
26
#include "
EvtGenModels/EvtSingleParticle2.hh
"
27
#include "
EvtGenBase/EvtReport.hh
"
28
#include <string>
29
#include "
EvtGenBase/EvtConst.hh
"
30
using
std::endl;
31
32
EvtSingleParticle2::~EvtSingleParticle2
() {}
33
34
void
EvtSingleParticle2::getName
(std::string& model_name){
35
36
model_name=
"SINGLE2"
;
37
38
}
39
40
EvtDecayBase
*
EvtSingleParticle2::clone
(){
41
42
return
new
EvtSingleParticle2
();
43
44
}
45
46
void
EvtSingleParticle2::init
(){
47
48
49
//turn off checks for charge conservation
50
disableCheckQ
();
51
52
if
((
getNArg
()==6)||(
getNArg
()==4)||(
getNArg
()==2)) {
53
54
if
(
getNArg
()==6){
55
//copy the arguments into eaiser to remember names!
56
57
pxymin=
getArg
(0);
58
pxymax=
getArg
(1);
59
60
thetamin=
getArg
(2);
61
thetamax=
getArg
(3);
62
63
phimin=
getArg
(4);
64
phimax=
getArg
(5);
65
66
}
67
68
if
(
getNArg
()==4){
69
//copy the arguments into eaiser to remember names!
70
pxymin=
getArg
(0);
71
pxymax=
getArg
(1);
72
73
thetamin=
getArg
(2);
74
thetamax=
getArg
(3);
75
76
phimin=0.0;
77
phimax=
EvtConst::twoPi
;
78
79
}
80
81
if
(
getNArg
()==2){
82
//copy the arguments into eaiser to remember names!
83
pxymin=
getArg
(0);
84
pxymax=
getArg
(1);
85
86
thetamin=0.376383;
87
thetamax=2.76521;
//|cos(theta)|<0.93
88
89
phimin=0.0;
90
phimax=
EvtConst::twoPi
;
91
92
}
93
94
95
}
else
{
96
97
report
(
ERROR
,
"EvtGen"
) <<
"EvtSingleParticle generator expected "
98
<<
" 5, 3, or 1 arguments but found:"
<<
getNArg
()<<endl;
99
report
(
ERROR
,
"EvtGen"
) <<
"Will terminate execution!"
<<endl;
100
::abort();
101
}
102
103
104
report
(
INFO
,
"EvtGen"
) <<
"The single particle generator has been configured:"
105
<<endl;
106
report
(
INFO
,
"EvtGen"
) << thetamax <<
" > theta > "
<< thetamin <<endl;
107
report
(
INFO
,
"EvtGen"
) << phimax <<
" > phi > "
<< phimin <<endl;
108
109
}
110
111
void
EvtSingleParticle2::decay
(
EvtParticle
*p ){
112
113
EvtParticle
*d;
114
EvtVector4R
p4;
115
116
double
mass
=
EvtPDL::getMass
(
getDaug
(0));
117
118
p->
makeDaughters
(
getNDaug
(),
getDaugs
());
119
d=p->
getDaug
(0);
120
121
//generate flat distribution in p
122
//we are now in the parents restframe! This means the
123
//restframe of the e+e- collison.
124
125
double
theta;
126
if
(thetamax==thetamin) {theta=thetamax;}
else
127
theta=
EvtRandom::Flat
(thetamin,thetamax);
128
double
phi;
129
if
(phimin==phimax){phi=phimin;}
else
130
phi =
EvtRandom::Flat
(phimin,phimax);
131
double
pxy;
132
if
(pxymin==pxymax){pxy=pxymin;}
else
133
pxy =
EvtRandom::Flat
(pxymin,pxymax);
134
135
pmag=pxy/
sin
(theta);
136
cthetamax=
cos
(thetamax);
137
cthetamin=
cos
(thetamin);
138
double
cthetalab;
139
140
// do{
141
//generate flat distribution in costheta
142
143
p4.
set
(sqrt(
mass
*
mass
+pmag*pmag),pmag*
cos
(phi)*
sin
(theta),
144
pmag*
sin
(phi)*
sin
(theta),pmag*
cos
(theta));
145
d->
init
(
getDaug
(0),p4);
146
//get 4 vector in the lab frame!
147
EvtVector4R
p4lab=d->
getP4Lab
();
148
cthetalab=p4lab.
get
(3)/p4lab.
d3mag
();
149
// }while (cthetalab>cthetamax||cthetalab<cthetamin);
150
151
return ;
152
}
153
154
155
sin
double sin(const BesAngle a)
Definition:
BesAngle.h:210
cos
double cos(const BesAngle a)
Definition:
BesAngle.h:213
mass
double mass
Definition:
CosmicGenerator.cxx:138
EvtConst.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtRandom.hh
report
ostream & report(Severity severity, const char *facility)
Definition:
EvtReport.cc:36
EvtReport.hh
ERROR
@ ERROR
Definition:
EvtReport.hh:49
INFO
@ INFO
Definition:
EvtReport.hh:52
EvtSingleParticle2.hh
EvtConst::twoPi
static const double twoPi
Definition:
EvtConst.hh:29
EvtDecayBase
Definition:
EvtDecayBase.hh:33
EvtDecayBase::getArg
double getArg(int j)
Definition:
EvtDecayBase.cc:564
EvtDecayBase::disableCheckQ
void disableCheckQ()
Definition:
EvtDecayBase.hh:62
EvtDecayBase::getNDaug
int getNDaug()
Definition:
EvtDecayBase.hh:64
EvtDecayBase::getNArg
int getNArg()
Definition:
EvtDecayBase.hh:67
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition:
EvtDecayBase.hh:65
EvtDecayBase::getDaug
EvtId getDaug(int i)
Definition:
EvtDecayBase.hh:66
EvtPDL::getMass
static double getMass(EvtId i)
Definition:
EvtPDL.hh:46
EvtParticle
Definition:
EvtParticle.hh:42
EvtParticle::makeDaughters
void makeDaughters(int ndaug, EvtId *id)
Definition:
EvtParticle.cc:1177
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::getP4Lab
EvtVector4R getP4Lab()
Definition:
EvtParticle.cc:685
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition:
EvtParticle.cc:85
EvtRandom::Flat
static double Flat()
Definition:
EvtRandom.cc:74
EvtSingleParticle2::getName
void getName(std::string &name)
Definition:
EvtSingleParticle2.cc:34
EvtSingleParticle2::init
void init()
Definition:
EvtSingleParticle2.cc:46
EvtSingleParticle2::decay
void decay(EvtParticle *p)
Definition:
EvtSingleParticle2.cc:111
EvtSingleParticle2::clone
EvtDecayBase * clone()
Definition:
EvtSingleParticle2.cc:40
EvtSingleParticle2::~EvtSingleParticle2
virtual ~EvtSingleParticle2()
Definition:
EvtSingleParticle2.cc:32
EvtSingleParticle2::EvtSingleParticle2
EvtSingleParticle2()
Definition:
EvtSingleParticle2.hh:33
EvtVector4R
Definition:
EvtVector4R.hh:29
EvtVector4R::get
double get(int i) const
Definition:
EvtVector4R.hh:179
EvtVector4R::d3mag
double d3mag() const
Definition:
EvtVector4R.cc:186
EvtVector4R::set
void set(int i, double d)
Definition:
EvtVector4R.hh:183
source
Generator
BesEvtGen
BesEvtGen-00-04-08
src
EvtGen
EvtGenModels
EvtSingleParticle2.cc
Generated by
1.9.6