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_pipieta::nevtgen = 0;
57int EvtPhokhara_pipieta::nphokharadecays = 0;
59int EvtPhokhara_pipieta::ntable = 0;
61int EvtPhokhara_pipieta::ncommand = 0;
62int EvtPhokhara_pipieta::lcommand = 0;
63std::string* EvtPhokhara_pipieta::commands = 0;
64int EvtPhokhara_pipieta::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;
98 model_name =
"PHOKHARA_pipieta";
111#include "Phokhara_init_mode.txt"
117 std::string locvp = getenv(
"BESEVTGENROOT" );
118 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param" );
119 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr" );
120 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn" );
125 report(
ERROR,
"EvtGen" ) <<
"EvtPhokhara finds that you are decaying the" << endl
127 <<
" with the Phokhara model" << endl
128 <<
" this does not work, please modify decay table." << endl;
129 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
140 if ( ncommand == lcommand )
143 lcommand = 10 + 2 * lcommand;
145 std::string* newcommands =
new std::string[lcommand];
149 for ( i = 0; i < ncommand; i++ ) { newcommands[i] = commands[i]; }
153 commands = newcommands;
156 commands[ncommand] = cmd;
163 if ( p->
getId() != myvpho )
165 std::cout <<
"Parent particle is required to be vpho for Phokhara model" << std::endl;
170 std::cout <<
"PHOKHARA : pi+pi-eta mode " << std::endl;
175 tr_old[0] = (int)
maxima_.tr[0];
176 tr_old[1] = (int)
maxima_.tr[1];
177 tr_old[2] = (int)
maxima_.tr[2];
179 while ( ntrials < 1000000 )
195 GEN_1PH( 2, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
200 GEN_2PH( 2, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
204 ( tr_old[0] + tr_old[1] + tr_old[2] ) )
205 {
goto storedEvents; }
208 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate."
215 EvtId evtnumstable[100];
224 ctes_.momenta[3][5] );
229 ctes_.momenta[3][6] );
237 ctes_.momenta[3][5] );
242 ctes_.momenta[3][6] );
250 ctes_.momenta[3][5] );
255 ctes_.momenta[3][6] );
260 ctes_.momenta[3][7] );
265 ctes_.momenta[3][8] );
273 ctes_.momenta[3][5] );
278 ctes_.momenta[3][6] );
283 ctes_.momenta[3][7] );
288 ctes_.momenta[3][8] );
296 ctes_.momenta[3][5] );
301 ctes_.momenta[3][6] );
309 ctes_.momenta[3][5] );
314 ctes_.momenta[3][6] );
322 ctes_.momenta[3][5] );
327 ctes_.momenta[3][6] );
335 ctes_.momenta[3][5] );
340 ctes_.momenta[3][6] );
348 ctes_.momenta[3][5] );
353 ctes_.momenta[3][6] );
358 ctes_.momenta[3][7] );
366 ctes_.momenta[3][7] );
371 ctes_.momenta[3][8] );
376 ctes_.momenta[3][9] );
381 ctes_.momenta[3][10] );
389 ctes_.momenta[3][5] );
394 ctes_.momenta[3][6] );
399 ctes_.momenta[3][7] );
406 ctes_.momenta[3][2] );
408 if (
ctes_.momenta[0][3] != 0 )
412 ctes_.momenta[3][3] );
417 more = ( channel != -1 );
420 std::cout <<
"Existence of mode " << channel
421 <<
" in exclusive decay list has the same final state as this one" << std::endl;
430 for (
int i = 0; i < numstable; i++ )
435 if ( ndaugFound == 0 )
437 report(
ERROR,
"EvtGen" ) <<
"Phokhara has failed to do a decay ";
447void EvtPhokhara_pipieta::store(
EvtDecayBase* jsdecay ) {
449 if ( nphokharadecays == ntable )
454 for ( i = 0; i < ntable; i++ ) { newphokharadecays[i] = phokharadecays[i]; }
455 ntable = 2 * ntable + 10;
456 delete[] phokharadecays;
457 phokharadecays = newphokharadecays;
460 phokharadecays[nphokharadecays++] = jsdecay;
464 static int first = 1;
480#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 init_mode(EvtParticle *p)
void getName(std::string &name)
void decay(EvtParticle *p)
std::string commandName()
void command(std::string cmd)
void PhokharaInit(int dummy)
virtual ~EvtPhokhara_pipieta()
void init_evt(EvtParticle *p)
void set(int i, double d)