CGEM BOSS 6.6.5.i
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//
23#include <stdlib.h>
26#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenBase/EvtId.hh"
31#include <string>
32#include <iostream>
33using std::endl;
34
35extern "C" {
36 extern void pystat_(int &);
37}
38
39extern "C" {
40extern struct
41{
42 int dc[18];
44}
45
46
48 // int i=1;
49 // pystat_(i);
50}
51
52void EvtPycont::getName(std::string& model_name)
53{
54 model_name="PYCONT";
55}
56
58{
59 return new EvtPycont;
60}
61
63{
64 // check that there are 1 argument
65 if ( getNArg() != 12 && getNArg() != 0 ) {
66 report(ERROR,"EvtGen") << "EvtPYCONT expects "
67 << " 12 arguments (d u s c b t e nu_e mu nu_mu tau nu_tau) but found: "
68 << getNArg() <<endl;
69
70 }
71 checkNArg(0,12);
72
73 for( int i=0; i<18; i++)
74 decaych_.dc[i]=0;
75 if ( getNArg() == 12 ) {
76 decaych_.dc[0]=(int)getArg(0);
77 decaych_.dc[1]=(int)getArg(1);
78 decaych_.dc[2]=(int)getArg(2);
79 decaych_.dc[3]=(int)getArg(3);
80 decaych_.dc[4]=(int)getArg(4);
81 decaych_.dc[5]=(int)getArg(5);
82 decaych_.dc[10]=(int)getArg(6);
83 decaych_.dc[11]=(int)getArg(7);
84 decaych_.dc[12]=(int)getArg(8);
85 decaych_.dc[13]=(int)getArg(9);
86 decaych_.dc[14]=(int)getArg(10);
87 decaych_.dc[15]=(int)getArg(11);
88 }
89 else{
90 decaych_.dc[0]=1;
91 decaych_.dc[1]=1;
92 decaych_.dc[2]=1;
93 decaych_.dc[3]=1;
94 }
95
96}
97
99{
100 noProbMax();
101}
102
104{
106 EvtVector4R p4[100];
107
108 double energy=p->mass();
109
110 int i,more;
111 int ndaugjs;
112 int kf[100];
113 EvtId id[100];
114 int type[MAX_DAUG];
115
116 double px[100],py[100],pz[100],e[100];
117
118 if ( p->getNDaug() != 0 ) { return;}
119 do{
120 EvtPythia::pythiacont(&energy,&ndaugjs,kf,px,py,pz,e);
121
122 for(i=0;i<ndaugjs;i++)
123 {
124
125 id[i]=EvtPDL::evtIdFromStdHep(kf[i]);
126
127 type[i]=EvtPDL::getSpinType(id[i]);
128
129 //std::cout<<"i, id[i] "<<i<<" "<<EvtPDL::getStdHep(id[i])<<std::endl;
130
131 // have to protect against negative mass^2 for massless particles
132 // i.e. neutrinos and photons.
133 // this is uggly but I need to fix it right now....
134
135 if (px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i]>=e[i]*e[i])
136 e[i]=sqrt(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i])+0.0000000000001;
137
138 p4[i].set(e[i],px[i],py[i],pz[i]);
139
140 }
141
142 int channel=EvtDecayTable::inChannelList(p->getId(),ndaugjs,id);
143
144 more=((channel!=-1)&&(channel!=p->getChannel()));
145
146 }while(more);
147
148 p->makeDaughters(ndaugjs,id);
149
150 for(i=0;i<ndaugjs;i++)
151 p->getDaug(i)->init( id[i], p4[i] );
152
153 return ;
154}
155
const int MAX_DAUG
int dc[18]
Definition EvtPycont.cc:42
struct @9 decaych_
void pystat_(int &)
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:36
@ ERROR
Definition EvtReport.hh:49
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot 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)
Definition EvtId.hh:27
static EvtId evtIdFromStdHep(int stdhep)
Definition EvtPDL.cc:244
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:61
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:98
virtual ~EvtPycont()
Definition EvtPycont.cc:47
EvtDecayBase * clone()
Definition EvtPycont.cc:57
void decay(EvtParticle *p)
Definition EvtPycont.cc:103
void init()
Definition EvtPycont.cc:62
void getName(std::string &name)
Definition EvtPycont.cc:52
static void pythiaInit(int f)
static void pythiacont(double *, int *, int *, double *, double *, double *, double *)
Definition EvtPythia.cc:200
void set(int i, double d)