43#include "CLHEP/Random/RandomEngine.h"
44#include "cfortran/cfortran.h"
53using std::resetiosflags;
54using std::setiosflags;
57int EvtPhokhara_K0K0::nevtgen=0;
58int EvtPhokhara_K0K0::nphokharadecays=0;
60int EvtPhokhara_K0K0::ntable=0;
62int EvtPhokhara_K0K0::ncommand=0;
63int EvtPhokhara_K0K0::lcommand=0;
64std::string* EvtPhokhara_K0K0::commands=0;
65int EvtPhokhara_K0K0::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_K0K0";
122#include "Phokhara_init_mode.txt"
130 std::string locvp=getenv(
"BESEVTGENROOT");
131 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param");
132 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr");
133 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn");
138 report(
ERROR,
"EvtGen") <<
"EvtPhokhara finds that you are decaying the"<<endl
139 <<
" aliased particle "
141 <<
" with the Phokhara model"<<endl
142 <<
" this does not work, please modify decay table."
144 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
156 return std::string(
"PhokharaPar");
162 if (ncommand==lcommand){
164 lcommand=10+2*lcommand;
166 std::string* newcommands=
new std::string[lcommand];
170 for(i=0;i<ncommand;i++){
171 newcommands[i]=commands[i];
176 commands=newcommands;
180 commands[ncommand]=cmd;
190 if(p->
getId()!=myvpho) {std::cout<<
"Parent particle is required to be vpho for Phokhara model"<<std::endl;abort();}
193 std::cout<<
"PHOKHARA : K0K0bar mode "<<std::endl;
199 tr_old[0] = (int)
maxima_.tr[0];
200 tr_old[1] = (
int)
maxima_.tr[1];
201 tr_old[2] = (int)
maxima_.tr[2];
203 while( ntrials < 1000000)
215 GEN_1PH(2,qqmin,qqmax,cos1min,cos1max,cos3min,cos3max);
219 GEN_2PH(2,qqmin,cos1min,cos1max,cos2min,cos2max,cos3min,cos3max);
228 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate." <<std::endl;
234 EvtId evtnumstable[100];
371 if(
ctes_.momenta[0][3] != 0 )
380 if(more) {std::cout<<
"Existence of mode "<<channel<<
" in exclusive decay list has the same final state as this one"<<std::endl;abort(); }
387 for(
int i=0;i<numstable;i++){
391 if ( ndaugFound == 0 ) {
392 report(
ERROR,
"EvtGen") <<
"Phokhara has failed to do a decay ";
406 if (nphokharadecays==ntable){
410 for(i=0;i<ntable;i++){
411 newphokharadecays[i]=phokharadecays[i];
414 delete [] phokharadecays;
415 phokharadecays=newphokharadecays;
418 phokharadecays[nphokharadecays++]=jsdecay;
444#include "Phokhara_init_evt.txt"
#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)
ostream & report(Severity severity, const char *facility)
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 init_mode(EvtParticle *p)
void init_evt(EvtParticle *p)
std::string commandName()
void PhokharaInit(int dummy)
void getName(std::string &name)
void command(std::string cmd)
virtual ~EvtPhokhara_K0K0()
void decay(EvtParticle *p)
double double double * p4