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_pipi::nevtgen = 0;
57int EvtPhokhara_pipi::nphokharadecays = 0;
59int EvtPhokhara_pipi::ntable = 0;
61int EvtPhokhara_pipi::ncommand = 0;
62int EvtPhokhara_pipi::lcommand = 0;
63std::string* EvtPhokhara_pipi::commands = 0;
64int EvtPhokhara_pipi::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;
109#include "Phokhara_init_mode.txt"
115 std::string locvp = getenv(
"BESEVTGENROOT" );
116 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param" );
117 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr" );
118 system(
"cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn" );
123 report(
ERROR,
"EvtGen" ) <<
"EvtPhokhara finds that you are decaying the" << endl
125 <<
" with the Phokhara model" << endl
126 <<
" this does not work, please modify decay table." << endl;
127 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
138 if ( ncommand == lcommand )
141 lcommand = 10 + 2 * lcommand;
143 std::string* newcommands =
new std::string[lcommand];
147 for ( i = 0; i < ncommand; i++ ) { newcommands[i] = commands[i]; }
151 commands = newcommands;
154 commands[ncommand] = cmd;
161 if ( p->
getId() != myvpho )
163 std::cout <<
"Parent particle is required to be vpho for Phokhara model" << std::endl;
169 std::cout <<
"PHOKHARA : pi+pi- mode " << std::endl;
173 tr_old[0] = (int)
maxima_.tr[0];
174 tr_old[1] = (int)
maxima_.tr[1];
175 tr_old[2] = (int)
maxima_.tr[2];
177 while ( ntrials < 1000000 )
193 GEN_1PH( 2, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
198 GEN_2PH( 2, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
202 ( tr_old[0] + tr_old[1] + tr_old[2] ) )
203 {
goto storedEvents; }
207 std::cout <<
"FATAL: Could not satisfy cuts after " << ntrials <<
"trials. Terminate."
214 EvtId evtnumstable[100];
223 ctes_.momenta[3][5] );
228 ctes_.momenta[3][6] );
236 ctes_.momenta[3][5] );
241 ctes_.momenta[3][6] );
249 ctes_.momenta[3][5] );
254 ctes_.momenta[3][6] );
259 ctes_.momenta[3][7] );
264 ctes_.momenta[3][8] );
272 ctes_.momenta[3][5] );
277 ctes_.momenta[3][6] );
282 ctes_.momenta[3][7] );
287 ctes_.momenta[3][8] );
295 ctes_.momenta[3][5] );
300 ctes_.momenta[3][6] );
308 ctes_.momenta[3][5] );
313 ctes_.momenta[3][6] );
321 ctes_.momenta[3][5] );
326 ctes_.momenta[3][6] );
334 ctes_.momenta[3][5] );
339 ctes_.momenta[3][6] );
347 ctes_.momenta[3][5] );
352 ctes_.momenta[3][6] );
357 ctes_.momenta[3][7] );
365 ctes_.momenta[3][7] );
370 ctes_.momenta[3][8] );
375 ctes_.momenta[3][9] );
380 ctes_.momenta[3][10] );
387 ctes_.momenta[3][2] );
389 if (
ctes_.momenta[0][3] != 0 )
393 ctes_.momenta[3][3] );
398 more = ( channel != -1 );
401 std::cout <<
"Existence of mode " << channel
402 <<
" in exclusive decay list has the same final state as this one" << std::endl;
411 for (
int i = 0; i < numstable; i++ )
416 if ( ndaugFound == 0 )
418 report(
ERROR,
"EvtGen" ) <<
"Phokhara has failed to do a decay ";
430 if ( nphokharadecays == ntable )
435 for ( i = 0; i < ntable; i++ ) { newphokharadecays[i] = phokharadecays[i]; }
436 ntable = 2 * ntable + 10;
437 delete[] phokharadecays;
438 phokharadecays = newphokharadecays;
441 phokharadecays[nphokharadecays++] = jsdecay;
445 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 PhokharaInit(int dummy)
void init_evt(EvtParticle *p)
std::string commandName()
void getName(std::string &name)
void init_mode(EvtParticle *p)
void command(std::string cmd)
virtual ~EvtPhokhara_pipi()
void decay(EvtParticle *p)
void set(int i, double d)