BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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 "EvtPycont.hh"
30#include "EvtPythia.hh"
31#include <iostream>
32#include <stdlib.h>
33#include <string>
34using std::endl;
35
36// common/CBBEAM/MAXIMUM
37extern "C" struct {
38 double maximum;
40
41// COMMON/ISRFLAG/myisr
42extern "C" struct {
43 int myisr;
45
46extern "C" struct {
47 int mint[400];
48 double vint[400];
50
51extern "C" struct {
52 int mstp[200];
53 double parp[200]; // parp(2) is the lowers energy allowed by pythia
54 int msti[200];
55 double pari[200];
57
58extern "C" {
59extern void pystat_( int& );
60}
61
62extern "C" struct {
63 int dc[18];
65
66extern "C" {
67extern void initpythia_( int* );
68}
69
71 // int i=1;
72 // pystat_(i);
73}
74
75void EvtPycont::getName( std::string& model_name ) { model_name = "PYCONT"; }
76
78
80 // check that there are 1 argument
81 if ( !( getNArg() == 12 || getNArg() == 0 || getNArg() == 1 ) )
82 {
83 report( ERROR, "EvtGen" )
84 << "EvtPYCONT expects "
85 << " 12 arguments (d u s c b t e nu_e mu nu_mu tau nu_tau) but found: " << getNArg()
86 << endl;
87 }
88 checkNArg( 0, 1, 12 );
89 isrflag_.myisr = 1; // default value, turn on ISR
90 for ( int i = 0; i < 18; i++ ) decaych_.dc[i] = 0;
91 if ( getNArg() == 12 )
92 {
93 decaych_.dc[0] = (int)getArg( 0 );
94 decaych_.dc[1] = (int)getArg( 1 );
95 decaych_.dc[2] = (int)getArg( 2 );
96 decaych_.dc[3] = (int)getArg( 3 );
97 decaych_.dc[4] = (int)getArg( 4 );
98 decaych_.dc[5] = (int)getArg( 5 );
99 decaych_.dc[10] = (int)getArg( 6 );
100 decaych_.dc[11] = (int)getArg( 7 );
101 decaych_.dc[12] = (int)getArg( 8 );
102 decaych_.dc[13] = (int)getArg( 9 );
103 decaych_.dc[14] = (int)getArg( 10 );
104 decaych_.dc[15] = (int)getArg( 11 );
105 }
106 else if ( getNArg() == 1 )
107 {
108 isrflag_.myisr = (int)getArg( 0 );
109 decaych_.dc[0] = 1;
110 decaych_.dc[1] = 1;
111 decaych_.dc[2] = 1;
112 decaych_.dc[3] = 1;
113 }
114}
115
117
119
120 double energy = p->mass();
121 cbbeam_.maximum = energy; // ini. parp(171), see EvtPythia.cc
122
123 // std::cout<<"energy= "<<energy<<std::endl;
124
125 if ( energy == 0 )
126 {
127 std::cout << "Particle " << EvtPDL::name( p->getId() ) << " has zero mass" << std::endl;
128 abort();
129 }
130 EvtPythia::pythiaInit( 0 ); // init. for the firt events
131 int mydummy = 0;
132 initpythia_( &mydummy ); // init. energy event by event
133
134 EvtVector4R p4[100];
135
136 int i, more, nson;
137 int ndaugjs;
138 int kf[100];
139 EvtId id[100];
140 int type[MAX_DAUG];
141
142 double px[100], py[100], pz[100], e[100];
143
144 if ( p->getNDaug() != 0 ) { return; }
145 do {
146 EvtPythia::pythiacont( &energy, &ndaugjs, kf, px, py, pz, e );
147
148 double toteng = 0;
149
150 for ( i = 0; i < ndaugjs; i++ )
151 {
152
153 id[i] = EvtPDL::evtIdFromStdHep( kf[i] );
154
155 type[i] = EvtPDL::getSpinType( id[i] );
156
157 // std::cout<<"i, id[i] "<<i<<" "<<EvtPDL::getStdHep(id[i])<<std::endl;
158
159 // have to protect against negative mass^2 for massless particles
160 // i.e. neutrinos and photons.
161 // this is uggly but I need to fix it right now....
162 toteng += e[i];
163 if ( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] >= e[i] * e[i] )
164 e[i] = sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] ) + 0.0000000000001;
165
166 p4[i].set( e[i], px[i], py[i], pz[i] );
167 }
168 // if( fabs(toteng-energy)>0.001 ) std::cout<<"Total energy of pythia decayed particle is
169 // larger than parent energy"<<std::endl;
170
171 int channel = EvtDecayTable::inChannelList( p->getId(), ndaugjs, id );
172
173 more = ( ( channel != -1 ) && ( channel != p->getChannel() ) );
174 // std::cout<<"more="<<more<<std::endl;
175
176 } while ( more );
177
178 p->makeDaughters( ndaugjs, id );
179
180 for ( i = 0; i < ndaugjs; i++ ) p->getDaug( i )->init( id[i], p4[i] );
181
182 if ( energy < 2.0 ) { EvtGlobalSet::ConExcPythia = 0; }
183 else { EvtGlobalSet::ConExcPythia = 1; } // cut off for minimum Mhad
184 return;
185}
const int MAX_DAUG
int dc[18]
Definition EvtPycont.cc:63
int myisr
Definition EvtPycont.cc:43
struct @336156322137141243302021335242306030116330202014 decaych_
int mstp[200]
Definition EvtPycont.cc:52
double maximum
Definition EvtPycont.cc:38
double parp[200]
Definition EvtPycont.cc:53
void pystat_(int &)
int mint[400]
Definition EvtPycont.cc:47
struct @354250304231140361210372001360076166325174272212 isrflag_
struct @134113124363340213221376021212264351135255032321 pypars_
double vint[400]
Definition EvtPycont.cc:48
struct @125167362051102326102214011354340031122345135231 cbbeam_
double pari[200]
Definition EvtPycont.cc:55
void initpythia_(int *)
struct @075305303341244356130100147226305371145067027363 pyint1_
int msti[200]
Definition EvtPycont.cc:54
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
************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
double getArg(int j)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
static bool ConExcPythia
Definition EvtId.hh:27
static EvtId evtIdFromStdHep(int stdhep)
Definition EvtPDL.cc:232
static std::string name(EvtId i)
Definition EvtPDL.hh:70
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtId getId() const
int getNDaug() const
EvtParticle * getDaug(int i)
double mass() const
int getChannel() const
void initProbMax()
Definition EvtPycont.cc:116
virtual ~EvtPycont()
Definition EvtPycont.cc:70
EvtDecayBase * clone()
Definition EvtPycont.cc:77
void decay(EvtParticle *p)
Definition EvtPycont.cc:118
void init()
Definition EvtPycont.cc:79
void getName(std::string &name)
Definition EvtPycont.cc:75
static void pythiaInit(int f)
Definition EvtPythia.cc:909
static void pythiacont(double *, int *, int *, double *, double *, double *, double *)
Definition EvtPythia.cc:173
void set(int i, double d)