40#include "BesRndmGenSvc/IBesRndmGenSvc.h"
41#include "CLHEP/Random/RandomEngine.h"
42#include "GeneratorObject/McGenEvent.h"
43#include "cfortran/cfortran.h"
52using std::resetiosflags;
53using std::setiosflags;
56int EvtPhokhara_ppbar::nevtgen = 0;
57int EvtPhokhara_ppbar::nphokharadecays = 0;
59int EvtPhokhara_ppbar::ntable = 0;
61int EvtPhokhara_ppbar::ncommand = 0;
62int EvtPhokhara_ppbar::lcommand = 0;
63std::string* EvtPhokhara_ppbar::commands = 0;
64int EvtPhokhara_ppbar::nevt = 0;
71 if ( nphokharadecays == 0 )
78 for ( i = 0; i < nphokharadecays; i++ )
80 if ( phokharadecays[i] ==
this )
82 phokharadecays[i] = phokharadecays[nphokharadecays - 1];
84 if ( nphokharadecays == 0 )
93 report(
ERROR,
"EvtGen" ) <<
"Error in destroying Phokhara model!" << endl;
108#include "Phokhara_init_mode.txt"
114 std::string locvp = getenv(
"BESEVTGENROOT" );
115 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param" );
116 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr" );
117 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn" );
122 report(
ERROR,
"EvtGen" ) <<
"EvtPhokhara finds that you are decaying the" << endl
124 <<
" with the Phokhara model" << endl
125 <<
" this does not work, please modify decay table." << endl;
126 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
137 if ( ncommand == lcommand )
140 lcommand = 10 + 2 * lcommand;
142 std::string* newcommands =
new std::string[lcommand];
146 for ( i = 0; i < ncommand; i++ ) { newcommands[i] = commands[i]; }
150 commands = newcommands;
153 commands[ncommand] = cmd;
160 if ( p->
getId() != myvpho )
162 std::cout <<
"Parent particle is required to be vpho for Phokhara model" << std::endl;
167 std::cout <<
"PHOKHARA : ppbar mode " << std::endl;
172 tr_old[0] = (int)
maxima_.tr[0];
173 tr_old[1] = (int)
maxima_.tr[1];
174 tr_old[2] = (int)
maxima_.tr[2];
176 while ( ntrials < 1000000 )
192 GEN_1PH( 2, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
197 GEN_2PH( 2, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
201 ( tr_old[0] + tr_old[1] + tr_old[2] ) )
202 {
goto storedEvents; }
205 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate."
212 EvtId evtnumstable[100];
221 ctes_.momenta[3][5] );
226 ctes_.momenta[3][6] );
234 ctes_.momenta[3][5] );
239 ctes_.momenta[3][6] );
247 ctes_.momenta[3][5] );
252 ctes_.momenta[3][6] );
257 ctes_.momenta[3][7] );
262 ctes_.momenta[3][8] );
270 ctes_.momenta[3][5] );
275 ctes_.momenta[3][6] );
280 ctes_.momenta[3][7] );
285 ctes_.momenta[3][8] );
293 ctes_.momenta[3][5] );
298 ctes_.momenta[3][6] );
306 ctes_.momenta[3][5] );
311 ctes_.momenta[3][6] );
319 ctes_.momenta[3][5] );
324 ctes_.momenta[3][6] );
332 ctes_.momenta[3][5] );
337 ctes_.momenta[3][6] );
345 ctes_.momenta[3][5] );
350 ctes_.momenta[3][6] );
355 ctes_.momenta[3][7] );
363 ctes_.momenta[3][7] );
368 ctes_.momenta[3][8] );
373 ctes_.momenta[3][9] );
378 ctes_.momenta[3][10] );
385 ctes_.momenta[3][2] );
387 if (
ctes_.momenta[0][3] != 0 )
391 ctes_.momenta[3][3] );
396 more = ( channel != -1 );
399 std::cout <<
"Existence of mode " << channel
400 <<
" in exclusive decay list has the same final state as this one" << std::endl;
409 for (
int i = 0; i < numstable; i++ )
414 if ( ndaugFound == 0 )
416 report(
ERROR,
"EvtGen" ) <<
"Phokhara has failed to do a decay ";
428 if ( nphokharadecays == ntable )
433 for ( i = 0; i < ntable; i++ ) { newphokharadecays[i] = phokharadecays[i]; }
434 ntable = 2 * ntable + 10;
435 delete[] phokharadecays;
436 phokharadecays = newphokharadecays;
439 phokharadecays[nphokharadecays++] = jsdecay;
443 static int first = 1;
459#include "Phokhara_init_evt.txt"
EvtDecayBase * EvtDecayBasePtr
struct @053254170326070136226344307237142165176240334330 ctes_
struct @027003056066344010031101102046265032310161340072 maxima_
#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)
struct @366025114004024134344043225357106161032107165361 flags_
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 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)