45 for(i=0; i<_ndaug; i++ ) {
51 report(
ERROR,
"EvtGen") <<_modelname.c_str()<<
" generator expected "
52 <<
" charge to be conserved, found:"<<endl;
53 report(
ERROR,
"EvtGen") <<
"Parent charge of "<<(qpar/3)<<endl;
54 report(
ERROR,
"EvtGen") <<
"Sum of daughter charge of "<<(
q/3)<<endl;
56 for(i=0; i<_ndaug; i++ ) {
59 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
73 if (prob>max_prob) max_prob=prob;
76 if ( defaultprobmax && ntimes_prob<=500 ) {
79 if ( prob > probmax ) { probmax = prob;}
80 if (ntimes_prob==500) {
83 return 1000000.0*prob;
86 if ( prob> probmax*1.0001) {
88 report(
INFO,
"EvtGen") <<
"prob > probmax:("<<prob<<
">"<<probmax<<
")";
89 report(
INFO,
"") <<
"("<<_modelname.c_str()<<
") ";
91 for(i=0;i<_ndaug;i++){
96 if (defaultprobmax) probmax = prob;
110 report(
INFO,
"EvtGen") <<
"Reseting prob max\n";
111 report(
INFO,
"EvtGen") <<
"prob > probmax:("<<prob<<
">"<<probmax<<
")";
112 report(
INFO,
"") <<
"("<<_modelname.c_str()<<
")";
115 for(
int i=0;i<_ndaug;i++){
130 return std::string(
"");
133 report(
ERROR,
"EvtGen") <<
"Should never call EvtDecayBase::command"<<endl;
168 int narg,std::vector<std::string>& args,
182 _daug=
new EvtId [_ndaug];
183 for(i=0;i<_ndaug;i++){
193 _args=
new std::string[_narg+1];
194 for(i=0;i<_narg;i++){
213 report(
INFO,
"EvtGen") <<
"No default probmax for ";
214 report(
INFO,
"") <<
"("<<_modelname.c_str()<<
") ";
216 for(i=0;i<_ndaug;i++){
220 report(
INFO,
"") <<
"This is fine for development, but must be provided for production."<<endl;
221 report(
INFO,
"EvtGen") <<
"Never fear though - the decay will use the \n";
222 report(
INFO,
"EvtGen") <<
"500 iterations to build up a good probmax \n";
223 report(
INFO,
"EvtGen") <<
"before accepting a decay. "<<endl;
239 _parent=
EvtId(-1,-1);
245 _modelname=
"**********";
265 report(
INFO,
"EvtGen") <<
"Calls="<<ntimes_prob<<
" eff:"<<
266 sum_prob/(probmax*ntimes_prob)<<
" frac. max:"<<max_prob/probmax;
267 report(
INFO,
"") <<
" probmax:"<<probmax<<
" max:"<<max_prob<<
" : ";
271 for(i=0;i<_ndaug;i++){
274 report(
INFO,
"") <<
" ("<<_modelname.c_str()<<
"):"<< endl;
317 if ( maxOkMass < 0.0000000001 )
return 10000000.;
325 double minDaugMass=0.;
331 minDaugMass+=dau->
mass();
337 if ( maxOkMass>(maxParMass-minDaugMass)) maxOkMass=maxParMass-minDaugMass;
360 if ( count > 10000 ) {
362 report(
INFO,
"EvtGen") <<
"Now printing parent and/or grandparent tree\n";
383 report(
INFO,
"EvtGen") <<
"taking a default value\n";
404 if (massSum <
mass) massOk=
true;
405 if (
mass> maxOkMass) massOk=
false;
415 EvtId daugs[10],
double masses[10]) {
423 for (i = 0; i < ndaugs; i++ ) {
440 for (i = 0; i < ndaugs; i++ ) {
442 mass_sum = mass_sum + masses[i];
451 report(
ERROR,
"EvtGen") <<
"To the following daugthers"<<endl;
452 for (i = 0; i < ndaugs; i++ ) {
456 report(
ERROR,
"EvtGen") <<
"Has been rejected "<<count
457 <<
" times, will now take minimal masses "
458 <<
" of daugthers"<<endl;
461 for (i = 0; i < ndaugs; i++ ) {
463 mass_sum = mass_sum + masses[i];
465 if (mass_sum > p->
mass()){
467 <<
"to light for daugthers."<<endl
468 <<
"Will throw the event away."<<endl;
476 }
while ( mass_sum > p->
mass());
484 if ( _narg != a1 && _narg != a2 && _narg != a3 && _narg != a4 ) {
485 report(
ERROR,
"EvtGen") << _modelname.c_str() <<
" generator expected "<<endl;
496 report(
ERROR,
"EvtGen") <<
" arguments but found:"<< _narg << endl;
498 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
506 if ( _ndaug != d1 && _ndaug != d2 ) {
507 report(
ERROR,
"EvtGen") << _modelname.c_str() <<
" generator expected ";
512 report(
ERROR,
"EvtGen") <<
" daughters but found:"<< _ndaug << endl;
514 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
523 if ( parenttype != sp ) {
525 <<
" did not get the correct parent spin\n";
527 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
536 if ( parenttype != sp ) {
538 <<
" did not get the correct daughter spin d="
541 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
549 if ( _argsD )
return _argsD;
552 if ( _narg==0 )
return _argsD;
554 _argsD =
new double[_narg];
558 for(i=0;i<_narg;i++) {
559 _argsD[i] = strtod(_args[i].c_str(),&tc);
568 const char* str = _args[j].c_str();
571 if (isalpha(str[i]) && str[i]!=
'e') {
573 report(
INFO,
"EvtGen") <<
"String " << str <<
" is not a number" << endl;
580 return strtod(_args[j].c_str(),tc);
589 if ( _ndaug != other._ndaug)
return false;
590 if ( _parent != other._parent)
return false;
592 std::vector<int> useDs;
593 for (
unsigned int i=0; i<_ndaug; i++) useDs.push_back(0);
595 for (
unsigned int i=0; i<_ndaug; i++) {
597 for (
unsigned int j=0; j<_ndaug; j++) {
598 if ( useDs[j] == 1 )
continue;
599 if ( _daug[i] == other._daug[j] && _daug[i].
getAlias() == other._daug[j].getAlias()) {
605 if ( foundIt==
false)
return false;
607 for (
unsigned int i=0; i<_ndaug; i++)
if ( useDs[i]==0)
return false;
ostream & report(Severity severity, const char *facility)
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
double resetProbMax(double prob)
void setProbMax(double prbmx)
static void findMass(EvtParticle *p)
virtual bool matchingDecay(const EvtDecayBase &other) const
static double findMaxMass(EvtParticle *p)
void saveDecayInfo(EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
virtual void command(std::string cmd)
double getProbMax(double prob)
static void findMasses(EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
virtual void initProbMax()
virtual std::string commandName()
static int getStdHep(EvtId id)
static std::string name(EvtId i)
static double getMinMass(EvtId i)
static EvtSpinType::spintype getSpinType(EvtId i)
static double getMaxMass(EvtId i)
static double getMass(EvtId i)
EvtParticle * getParent()
EvtParticle * getDaug(int i)
static void setRejectFlag()