BOSS
7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.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: EvtPycont.cc
12
//
13
// Description: Routine to generate e+e- --> q\barq via Jetset
14
//
15
// Modification history:
16
//
17
// PCK August 4, 1997 Module created
18
// RS October 28, 2002 copied from EvtJscont.cc
19
//
20
//------------------------------------------------------------------------
21
//
22
#include "EvtGenBase/EvtPatches.hh"
23
#include <stdlib.h>
24
#include "EvtGenBase/EvtParticle.hh"
25
#include "EvtGenBase/EvtDecayTable.hh"
26
#include "EvtGenBase/EvtPDL.hh"
27
#include "EvtGenModels/EvtPycont.hh"
28
#include "EvtGenModels/EvtPythia.hh"
29
#include "EvtGenBase/EvtId.hh"
30
#include "EvtGenBase/EvtReport.hh"
31
#include "EvtGenModels/EvtGlobalSet.hh"
32
#include <string>
33
#include <iostream>
34
using
std::endl;
35
36
//common/CBBEAM/MAXIMUM
37
extern
"C"
struct
{
38
double
maximum
;
39
}
cbbeam_
;
40
41
// COMMON/ISRFLAG/myisr
42
extern
"C"
struct
{
43
int
myisr
;
44
}
isrflag_
;
45
46
extern
"C"
struct
47
{
48
int
mint
[400];
49
double
vint
[400];
50
}
pyint1_
;
51
52
extern
"C"
struct
53
{
54
int
mstp
[200];
55
double
parp
[200];
//parp(2) is the lowers energy allowed by pythia
56
int
msti
[200];
57
double
pari
[200];
58
}
pypars_
;
59
60
extern
"C"
{
61
extern
void
pystat_
(
int
&);
62
}
63
64
extern
"C"
struct
65
{
66
int
dc
[18];
67
}
decaych_
;
68
69
70
extern
"C"
{
71
extern
void
initpythia_
(
int
*);
72
}
73
74
75
EvtPycont::~EvtPycont
() {
76
// int i=1;
77
// pystat_(i);
78
}
79
80
void
EvtPycont::getName
(std::string& model_name)
81
{
82
model_name=
"PYCONT"
;
83
}
84
85
EvtDecayBase
*
EvtPycont::clone
()
86
{
87
return
new
EvtPycont
;
88
}
89
90
void
EvtPycont::init
()
91
{
92
// check that there are 1 argument
93
if
( !(
getNArg
() == 12 ||
getNArg
() == 0 ||
getNArg
() == 1) ) {
94
report
(
ERROR
,
"EvtGen"
) <<
"EvtPYCONT expects "
95
<<
" 12 arguments (d u s c b t e nu_e mu nu_mu tau nu_tau) but found: "
96
<<
getNArg
() <<endl;
97
98
}
99
checkNArg
(0,1,12);
100
isrflag_
.myisr=1;
//default value, turn on ISR
101
for
(
int
i=0; i<18; i++)
decaych_
.dc[i]=0;
102
if (
getNArg
() == 12 ) {
103
decaych_
.dc[0]=(int)
getArg
(0);
104
decaych_
.dc[1]=(int)
getArg
(1);
105
decaych_
.dc[2]=(int)
getArg
(2);
106
decaych_
.dc[3]=(int)
getArg
(3);
107
decaych_
.dc[4]=(int)
getArg
(4);
108
decaych_
.dc[5]=(int)
getArg
(5);
109
decaych_
.dc[10]=(int)
getArg
(6);
110
decaych_
.dc[11]=(int)
getArg
(7);
111
decaych_
.dc[12]=(int)
getArg
(8);
112
decaych_
.dc[13]=(int)
getArg
(9);
113
decaych_
.dc[14]=(int)
getArg
(10);
114
decaych_
.dc[15]=(int)
getArg
(11);
115
}
else
if
(
getNArg
()==1){
116
isrflag_
.myisr=(int)
getArg
(0);
117
decaych_
.dc[0]=1;
118
decaych_
.dc[1]=1;
119
decaych_
.dc[2]=1;
120
decaych_
.dc[3]=1;
121
}
122
123
}
124
125
void
EvtPycont::initProbMax
()
126
{
127
noProbMax
();
128
}
129
130
void
EvtPycont::decay
(
EvtParticle
*p)
131
{
132
133
double
energy
=p->
mass
();
134
cbbeam_
.maximum =
energy
;
//ini. parp(171), see EvtPythia.cc
135
136
//std::cout<<"energy= "<<energy<<std::endl;
137
138
if
(
energy
==0){std::cout<<
"Particle "
<<
EvtPDL::name
(p->
getId
())<<
" has zero mass"
<<std::endl;abort();}
139
EvtPythia::pythiaInit
(0);
//init. for the firt events
140
int
mydummy=0;
141
initpythia_
(&mydummy);
//init. energy event by event
142
143
EvtVector4R
p4[100];
144
145
146
int
i,more,nson;
147
int
ndaugjs;
148
int
kf[100];
149
EvtId
id
[100];
150
int
type[
MAX_DAUG
];
151
152
double
px[100],py[100],pz[100],e[100];
153
154
if
( p->
getNDaug
() != 0 ) {
return
;}
155
do
{
156
EvtPythia::pythiacont
(&
energy
,&ndaugjs,kf,px,py,pz,e);
157
158
double
toteng=0;
159
160
for
(i=0;i<ndaugjs;i++)
161
{
162
163
id
[i]=
EvtPDL::evtIdFromStdHep
(kf[i]);
164
165
type[i]=
EvtPDL::getSpinType
(
id
[i]);
166
167
//std::cout<<"i, id[i] "<<i<<" "<<EvtPDL::getStdHep(id[i])<<std::endl;
168
169
// have to protect against negative mass^2 for massless particles
170
// i.e. neutrinos and photons.
171
// this is uggly but I need to fix it right now....
172
toteng += e[i];
173
if
(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i]>=e[i]*e[i])
174
e[i]=sqrt(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i])+0.0000000000001;
175
176
p4[i].
set
(e[i],px[i],py[i],pz[i]);
177
178
}
179
//if( fabs(toteng-energy)>0.001 ) std::cout<<"Total energy of pythia decayed particle is larger than parent energy"<<std::endl;
180
181
int
channel=
EvtDecayTable::inChannelList
(p->
getId
(),ndaugjs,
id
);
182
183
more=((channel!=-1)&&(channel!=p->
getChannel
()) );
184
//std::cout<<"more="<<more<<std::endl;
185
186
}
while
(more);
187
188
p->
makeDaughters
(ndaugjs,
id
);
189
190
for
(i=0;i<ndaugjs;i++)
191
p->
getDaug
(i)->
init
(
id
[i], p4[i] );
192
193
if
(
energy
<2.0) {
EvtGlobalSet::ConExcPythia
=0;}
else
{
EvtGlobalSet::ConExcPythia
=1;}
//cut off for minimum Mhad
194
return ;
195
}
196
dc
int dc[18]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:66
myisr
int myisr
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:43
mstp
int mstp[200]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:54
maximum
double maximum
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:38
parp
double parp[200]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:55
pyint1_
struct @40 pyint1_
pystat_
void pystat_(int &)
mint
int mint[400]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:48
pypars_
struct @41 pypars_
cbbeam_
struct @38 cbbeam_
decaych_
struct @42 decaych_
isrflag_
struct @39 isrflag_
vint
double vint[400]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:49
pari
double pari[200]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:57
initpythia_
void initpythia_(int *)
msti
int msti[200]
Definition:
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:56
energy
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition:
KK2f.h:50
MAX_DAUG
const int MAX_DAUG
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.hh:38
report
ostream & report(Severity severity, const char *facility)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.cc:36
ERROR
@ ERROR
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.hh:49
decaych_
struct @22 decaych_
isrflag_
struct @19 isrflag_
cbbeam_
struct @18 cbbeam_
initpythia_
void initpythia_(int *)
EvtDecayBase
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:33
EvtDecayBase::getArg
double getArg(int j)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:564
EvtDecayBase::noProbMax
void noProbMax()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:304
EvtDecayBase::getNArg
int getNArg()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:67
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:482
EvtDecayTable::inChannelList
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayTable.cc:795
EvtGlobalSet::ConExcPythia
static bool ConExcPythia
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtGlobalSet.hh:20
EvtId
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtId.hh:27
EvtPDL::evtIdFromStdHep
static EvtId evtIdFromStdHep(int stdhep)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.cc:244
EvtPDL::name
static std::string name(EvtId i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.hh:64
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.hh:61
EvtParticle
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.hh:42
EvtParticle::makeDaughters
void makeDaughters(int ndaug, EvtId *id)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:1177
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::getId
EvtId getId() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:113
EvtParticle::getNDaug
int getNDaug() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:125
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:85
EvtParticle::mass
double mass() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:127
EvtParticle::getChannel
int getChannel() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:123
EvtPycont::initProbMax
void initProbMax()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:125
EvtPycont::~EvtPycont
virtual ~EvtPycont()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:75
EvtPycont::clone
EvtDecayBase * clone()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:85
EvtPycont::EvtPycont
EvtPycont()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.hh:32
EvtPycont::decay
void decay(EvtParticle *p)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:130
EvtPycont::init
void init()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:90
EvtPycont::getName
void getName(std::string &name)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPycont.cc:80
EvtPythia::pythiaInit
static void pythiaInit(int f)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPythia.cc:1051
EvtPythia::pythiacont
static void pythiacont(double *, int *, int *, double *, double *, double *, double *)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPythia.cc:203
EvtVector4R
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtVector4R.hh:29
EvtVector4R::set
void set(int i, double d)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtVector4R.hh:183
source
Generator
BesEvtGen
BesEvtGen-00-04-08
src
EvtGen
EvtGenModels
EvtPycont.cc
Generated by
1.9.6