1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtJscont.cc
13 // Description: Routine to generate e+e- --> q\barq via Jetset
15 // Modification history:
17 // PCK August 4, 1997 Module created
19 //------------------------------------------------------------------------
21 #include "EvtGenBase/EvtPatches.hh"
25 #include "EvtGenBase/EvtParticle.hh"
26 #include "EvtGenBase/EvtDecayTable.hh"
27 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenModels/EvtJscont.hh"
29 #include "EvtGenModels/EvtJetSet.hh"
30 #include "EvtGenBase/EvtId.hh"
31 #include "EvtGenBase/EvtReport.hh"
36 extern void continuum_(double *,int *,int *,int *,
37 double *,double *,double *,double *);
41 extern void lugive_(const char *cnfgstr,int length);
45 EvtJscont::~EvtJscont() {}
47 std::string EvtJscont::getName(){
53 EvtDecayBase* EvtJscont::clone(){
59 void EvtJscont::init(){
61 // check that there is 1 argument
68 void EvtJscont::initProbMax(){
75 void EvtJscont::decay( EvtParticle *p){
77 EvtJetSet::jetSetInit();
88 sprintf(vak,"PARJ(13)=%f",val);
89 std::string temp(vak);
90 lugive_(temp.c_str(),strlen(temp.c_str()));
94 double energy=p->mass();
104 flavor=(int)getArg(0);
106 double px[100],py[100],pz[100],e[100];
108 if ( p->getNDaug() != 0 ) { return;}
111 continuum_(&energy,&flavor,&ndaugjs,kf,px,py,pz,e);
113 for(i=0;i<ndaugjs;i++){
115 id[i]=EvtPDL::evtIdFromStdHep(kf[i]);
117 type[i]=EvtPDL::getSpinType(id[i]);
119 // have to protect against negative mass^2 for massless particles
120 // i.e. neutrinos and photons.
121 // this is uggly but I need to fix it right now....
123 if (px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i]>=e[i]*e[i]){
125 e[i]=sqrt(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i])+0.0000000000001;
129 p4[i].set(e[i],px[i],py[i],pz[i]);
133 int channel=EvtDecayTable::inChannelList(p->getId(),ndaugjs,id);
135 more=((channel!=-1)&&(channel!=p->getChannel()));
140 p->makeDaughters(ndaugjs,id);
142 for(i=0;i<ndaugjs;i++){
143 p->getDaug(i)->init( id[i], p4[i] );