43#include "CLHEP/Random/RandomEngine.h"
44#include "cfortran/cfortran.h"
53using std::resetiosflags;
54using std::setiosflags;
57int EvtPhokhara_pi0pi0pipi::nevtgen=0;
58int EvtPhokhara_pi0pi0pipi::nphokharadecays=0;
60int EvtPhokhara_pi0pi0pipi::ntable=0;
62int EvtPhokhara_pi0pi0pipi::ncommand=0;
63int EvtPhokhara_pi0pi0pipi::lcommand=0;
64std::string* EvtPhokhara_pi0pi0pipi::commands=0;
65int EvtPhokhara_pi0pi0pipi::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_pi0pi0pipi";
122#include "Phokhara_init_mode.txt"
130 std::string locvp=getenv(
"BESEVTGENROOT");
131 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.param>phokhara_9.1.param");
132 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.fferr>phokhara_9.1.fferr");
133 system(
"cat $BESEVTGENROOT/share/phokhara_9.1.ffwarn>phokhara_9.1.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();}
194 std::cout<<
"PHOKHARA : pi0pi0pi+pi- 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(); }
385 for(
int i=0;i<numstable;i++){
389 if ( ndaugFound == 0 ) {
390 report(
ERROR,
"EvtGen") <<
"Phokhara has failed to do a decay ";
402void EvtPhokhara_pi0pi0pipi::store(
EvtDecayBase* jsdecay){
404 if (nphokharadecays==ntable){
408 for(i=0;i<ntable;i++){
409 newphokharadecays[i]=phokharadecays[i];
412 delete [] phokharadecays;
413 phokharadecays=newphokharadecays;
416 phokharadecays[nphokharadecays++]=jsdecay;
442#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 decay(EvtParticle *p)
virtual ~EvtPhokhara_pi0pi0pipi()
void init_mode(EvtParticle *p)
void PhokharaInit(int dummy)
void command(std::string cmd)
void init_evt(EvtParticle *p)
std::string commandName()
void getName(std::string &name)
void set(int i, double d)