/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenModels/EvtPyGaGa.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 1998      Caltech, UCSB
00010 //
00011 // Module: EvtPycont.cc
00012 //
00013 // Description: Routine to generate e+e- --> q\barq  via Jetset
00014 //
00015 // Modification history:
00016 //
00017 //    PCK     August 4, 1997        Module created
00018 //    RS      October 28, 2002      copied from EvtJscont.cc
00019 //
00020 //------------------------------------------------------------------------
00021 // 
00022 #include "EvtGenBase/EvtPatches.hh"
00023 #include <stdlib.h>
00024 #include "EvtGenBase/EvtParticle.hh"
00025 #include "EvtGenBase/EvtDecayTable.hh"
00026 #include "EvtGenBase/EvtDecayBase.hh"
00027 #include "EvtGenBase/EvtPDL.hh"
00028 #include "EvtGenModels/EvtPyGaGa.hh"
00029 #include "EvtGenModels/EvtPythia.hh"
00030 #include "EvtGenBase/EvtId.hh"
00031 #include "EvtGenBase/EvtReport.hh"
00032 #include <string.h>
00033 #include <iostream>
00034 
00035 extern "C" {
00036   extern void pystat_(int &);
00037 }
00038 
00039 extern "C" struct
00040 {
00041   int dc[18];
00042 } decaych_;
00043 
00044 EvtPyGaGa::~EvtPyGaGa()
00045 {
00046   int i=1;
00047   pystat_(i);
00048 }
00049 
00050 void EvtPyGaGa::getName(std::string& model_name)
00051 {
00052   model_name="PYGAGA";  
00053 }
00054 
00055 EvtDecayBase* EvtPyGaGa::clone()
00056 {
00057   return new EvtPyGaGa;
00058 }
00059 
00060 void EvtPyGaGa::init()
00061 {
00062   // check that there are 1 argument
00063   checkNArg(0);
00064   for( int i=0; i<18; i++)
00065     decaych_.dc[i]=0;
00066 }
00067 
00068 void EvtPyGaGa::initProbMax()
00069 {
00070   noProbMax();
00071 }
00072 
00073 void EvtPyGaGa::decay( EvtParticle *p)
00074 {
00075   EvtPythia::pythiaInit(1);
00076   EvtVector4R p4[100];
00077   
00078   double energy=p->mass();
00079   
00080   int i,more;
00081   int ndaugjs;
00082   int kf[100];
00083   EvtId id[100];
00084   int type[MAX_DAUG];
00085   
00086   double px[100],py[100],pz[100],e[100];
00087   
00088   if ( p->getNDaug() != 0 ) { return;}
00089   do{
00090     EvtPythia::pythiacont(&energy,&ndaugjs,kf,px,py,pz,e);
00091     
00092     for(i=0;i<ndaugjs;i++)
00093       {
00094         
00095         id[i]=EvtPDL::evtIdFromStdHep(kf[i]);
00096         
00097         type[i]=EvtPDL::getSpinType(id[i]);
00098         
00099         // have to protect against negative mass^2 for massless particles
00100         // i.e. neutrinos and photons.
00101         // this is uggly but I need to fix it right now....
00102         
00103         if (px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i]>=e[i]*e[i])
00104           e[i]=sqrt(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i])+0.0000000000001;
00105         
00106         p4[i].set(e[i],px[i],py[i],pz[i]);
00107         
00108       }
00109     
00110     int channel=EvtDecayTable::inChannelList(p->getId(),ndaugjs,id);
00111     
00112     more=((channel!=-1)&&(channel!=p->getChannel()));
00113     
00114   }while(more);
00115   
00116   p->makeDaughters(ndaugjs,id);
00117   
00118   for(i=0;i<ndaugjs;i++)
00119     p->getDaug(i)->init( id[i], p4[i] );
00120   
00121   return ;
00122 }
00123 

Generated on Tue Nov 29 23:12:22 2016 for BOSS_7.0.2 by  doxygen 1.4.7