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_pi0pi0pipi::nevtgen = 0;
57int EvtPhokhara_pi0pi0pipi::nphokharadecays = 0;
59int EvtPhokhara_pi0pi0pipi::ntable = 0;
61int EvtPhokhara_pi0pi0pipi::ncommand = 0;
62int EvtPhokhara_pi0pi0pipi::lcommand = 0;
63std::string* EvtPhokhara_pi0pi0pipi::commands = 0;
64int EvtPhokhara_pi0pi0pipi::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_pi0pi0pipi";
112#include "Phokhara_init_mode.txt"
118 std::string locvp = getenv(
"BESEVTGENROOT" );
119 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param" );
120 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr" );
121 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn" );
126 report(
ERROR,
"EvtGen" ) <<
"EvtPhokhara finds that you are decaying the" << endl
128 <<
" with the Phokhara model" << endl
129 <<
" this does not work, please modify decay table." << endl;
130 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
141 if ( ncommand == lcommand )
144 lcommand = 10 + 2 * lcommand;
146 std::string* newcommands =
new std::string[lcommand];
150 for ( i = 0; i < ncommand; i++ ) { newcommands[i] = commands[i]; }
154 commands = newcommands;
157 commands[ncommand] = cmd;
164 if ( p->
getId() != myvpho )
166 std::cout <<
"Parent particle is required to be vpho for Phokhara model" << std::endl;
172 std::cout <<
"PHOKHARA : pi0pi0pi+pi- mode " << std::endl;
176 tr_old[0] = (int)
maxima_.tr[0];
177 tr_old[1] = (int)
maxima_.tr[1];
178 tr_old[2] = (int)
maxima_.tr[2];
180 while ( ntrials < 1000000 )
196 GEN_1PH( 2, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
201 GEN_2PH( 2, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
205 ( tr_old[0] + tr_old[1] + tr_old[2] ) )
206 {
goto storedEvents; }
209 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate."
216 EvtId evtnumstable[100];
225 ctes_.momenta[3][5] );
230 ctes_.momenta[3][6] );
238 ctes_.momenta[3][5] );
243 ctes_.momenta[3][6] );
251 ctes_.momenta[3][5] );
256 ctes_.momenta[3][6] );
261 ctes_.momenta[3][7] );
266 ctes_.momenta[3][8] );
274 ctes_.momenta[3][5] );
279 ctes_.momenta[3][6] );
284 ctes_.momenta[3][7] );
289 ctes_.momenta[3][8] );
297 ctes_.momenta[3][5] );
302 ctes_.momenta[3][6] );
310 ctes_.momenta[3][5] );
315 ctes_.momenta[3][6] );
323 ctes_.momenta[3][5] );
328 ctes_.momenta[3][6] );
336 ctes_.momenta[3][5] );
341 ctes_.momenta[3][6] );
349 ctes_.momenta[3][5] );
354 ctes_.momenta[3][6] );
359 ctes_.momenta[3][7] );
367 ctes_.momenta[3][7] );
372 ctes_.momenta[3][8] );
377 ctes_.momenta[3][9] );
382 ctes_.momenta[3][10] );
389 ctes_.momenta[3][2] );
391 if (
ctes_.momenta[0][3] != 0 )
395 ctes_.momenta[3][3] );
400 more = ( channel != -1 );
403 std::cout <<
"Existence of mode " << channel
404 <<
" in exclusive decay list has the same final state as this one" << std::endl;
412 for (
int i = 0; i < numstable; i++ )
417 if ( ndaugFound == 0 )
419 report(
ERROR,
"EvtGen" ) <<
"Phokhara has failed to do a decay ";
429void EvtPhokhara_pi0pi0pipi::store(
EvtDecayBase* jsdecay ) {
431 if ( nphokharadecays == ntable )
436 for ( i = 0; i < ntable; i++ ) { newphokharadecays[i] = phokharadecays[i]; }
437 ntable = 2 * ntable + 10;
438 delete[] phokharadecays;
439 phokharadecays = newphokharadecays;
442 phokharadecays[nphokharadecays++] = jsdecay;
446 static int first = 1;
462#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 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)