BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPyGaGa.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 "EvtPyGaGa.hh"
30#include "EvtPythia.hh"
31#include <iostream>
32#include <stdlib.h>
33#include <string.h>
34
35extern "C" {
36extern void pystat_( int& );
37}
38
39extern "C" struct {
40 int dc[18];
42
44 int i = 1;
45 pystat_( i );
46}
47
48void EvtPyGaGa::getName( std::string& model_name ) { model_name = "PYGAGA"; }
49
51
53 // check that there are 1 argument
54 checkNArg( 0 );
55 for ( int i = 0; i < 18; i++ ) decaych_.dc[i] = 0;
56}
57
59
62 EvtVector4R p4[100];
63
64 double energy = p->mass();
65
66 int i, more;
67 int ndaugjs;
68 int kf[100];
69 EvtId id[100];
70 int type[MAX_DAUG];
71
72 double px[100], py[100], pz[100], e[100];
73
74 if ( p->getNDaug() != 0 ) { return; }
75 do {
76 EvtPythia::pythiacont( &energy, &ndaugjs, kf, px, py, pz, e );
77
78 for ( i = 0; i < ndaugjs; i++ )
79 {
80
81 id[i] = EvtPDL::evtIdFromStdHep( kf[i] );
82
83 type[i] = EvtPDL::getSpinType( id[i] );
84
85 // have to protect against negative mass^2 for massless particles
86 // i.e. neutrinos and photons.
87 // this is uggly but I need to fix it right now....
88
89 if ( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] >= e[i] * e[i] )
90 e[i] = sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] ) + 0.0000000000001;
91
92 p4[i].set( e[i], px[i], py[i], pz[i] );
93 }
94
95 int channel = EvtDecayTable::inChannelList( p->getId(), ndaugjs, id );
96
97 more = ( ( channel != -1 ) && ( channel != p->getChannel() ) );
98
99 } while ( more );
100
101 p->makeDaughters( ndaugjs, id );
102
103 for ( i = 0; i < ndaugjs; i++ ) p->getDaug( i )->init( id[i], p4[i] );
104
105 return;
106}
const int MAX_DAUG
void pystat_(int &)
int dc[18]
Definition EvtPycont.cc:63
struct @336156322137141243302021335242306030116330202014 decaych_
void pystat_(int &)
************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
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
Definition EvtId.hh:27
static EvtId evtIdFromStdHep(int stdhep)
Definition EvtPDL.cc:232
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
EvtDecayBase * clone()
Definition EvtPyGaGa.cc:50
void initProbMax()
Definition EvtPyGaGa.cc:58
virtual ~EvtPyGaGa()
Definition EvtPyGaGa.cc:43
void getName(std::string &name)
Definition EvtPyGaGa.cc:48
void init()
Definition EvtPyGaGa.cc:52
void decay(EvtParticle *p)
Definition EvtPyGaGa.cc:60
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)