22#include "EvtGenBase/EvtPatches.hh"
23#include "EvtGenBase/EvtPatches.hh"
24#include "EvtGenBase/EvtParticle.hh"
25#include "EvtGenBase/EvtStringParticle.hh"
26#include "EvtGenBase/EvtDecayTable.hh"
27#include "EvtGenBase/EvtPDL.hh"
28#include "EvtGenModels/EvtPhokhara_ppbar.hh"
29#include "EvtGenModels/EvtPhokharaDef.hh"
30#include "EvtGenBase/EvtReport.hh"
32#include "EvtGenBase/EvtId.hh"
43#include "CLHEP/Random/RandomEngine.h"
44#include "cfortran/cfortran.h"
53using std::resetiosflags;
54using std::setiosflags;
57int EvtPhokhara_ppbar::nevtgen=0;
58int EvtPhokhara_ppbar::nphokharadecays=0;
60int EvtPhokhara_ppbar::ntable=0;
62int EvtPhokhara_ppbar::ncommand=0;
63int EvtPhokhara_ppbar::lcommand=0;
64std::string* EvtPhokhara_ppbar::commands=0;
65int EvtPhokhara_ppbar::nevt=0;
72 if (nphokharadecays==0) {
78 for(i=0;i<nphokharadecays;i++){
79 if (phokharadecays[i]==
this){
80 phokharadecays[i]=phokharadecays[nphokharadecays-1];
82 if (nphokharadecays==0) {
90 report(
ERROR,
"EvtGen") <<
"Error in destroying Phokhara model!"<<endl;
97 model_name=
"PHOKHARA_ppbar";
121#include "Phokhara_init_mode.txt"
129 std::string locvp=getenv(
"BESEVTGENROOT");
130 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.param>phokhara_9.1.param");
131 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.fferr>phokhara_9.1.fferr");
132 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.ffwarn>phokhara_9.1.ffwarn");
137 report(
ERROR,
"EvtGen") <<
"EvtPhokhara finds that you are decaying the"<<endl
138 <<
" aliased particle "
140 <<
" with the Phokhara model"<<endl
141 <<
" this does not work, please modify decay table."
143 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
155 return std::string(
"PhokharaPar");
161 if (ncommand==lcommand){
163 lcommand=10+2*lcommand;
165 std::string* newcommands=
new std::string[lcommand];
169 for(i=0;i<ncommand;i++){
170 newcommands[i]=commands[i];
175 commands=newcommands;
179 commands[ncommand]=cmd;
189 if(p->
getId()!=myvpho) {std::cout<<
"Parent particle is required to be vpho for Phokhara model"<<std::endl;abort();}
192 std::cout<<
"PHOKHARA : ppbar mode "<<std::endl;
198 tr_old[0] = (int)
maxima_.tr[0];
199 tr_old[1] = (
int)
maxima_.tr[1];
200 tr_old[2] = (int)
maxima_.tr[2];
202 while( ntrials < 1000000)
214 GEN_1PH(2,qqmin,qqmax,cos1min,cos1max,cos3min,cos3max);
218 GEN_2PH(2,qqmin,cos1min,cos1max,cos2min,cos2max,cos3min,cos3max);
227 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate." <<std::endl;
233 EvtId evtnumstable[100];
370 if(
ctes_.momenta[0][3] != 0 )
379 if(more) {std::cout<<
"Existence of mode "<<channel<<
" in exclusive decay list has the same final state as this one"<<std::endl;abort(); }
386 for(
int i=0;i<numstable;i++){
390 if ( ndaugFound == 0 ) {
391 report(
ERROR,
"EvtGen") <<
"Phokhara has failed to do a decay ";
405 if (nphokharadecays==ntable){
409 for(i=0;i<ntable;i++){
410 newphokharadecays[i]=phokharadecays[i];
413 delete [] phokharadecays;
414 phokharadecays=newphokharadecays;
417 phokharadecays[nphokharadecays++]=jsdecay;
443#include "Phokhara_init_evt.txt"
ostream & report(Severity severity, const char *facility)
#define GEN_1PH(I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX)
#define GEN_0PH(I, QQMIN, SP, COS3MIN, COS3MAX)
#define GEN_2PH(I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
static int getStdHep(EvtId id)
static EvtId evtIdFromStdHep(int stdhep)
static std::string name(EvtId i)
static EvtId getId(const std::string &name)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
void command(std::string cmd)
void decay(EvtParticle *p)
void init_evt(EvtParticle *p)
void getName(std::string &name)
void PhokharaInit(int dummy)
virtual ~EvtPhokhara_ppbar()
std::string commandName()
void init_mode(EvtParticle *p)
void set(int i, double d)