47 for ( i = 0; i <
m_ndaug; i++ ) {
55 <<
" charge to be conserved, found:" << endl;
57 <<
"Parent charge of " << ( qpar / 3 ) << endl;
59 <<
"Sum of daughter charge of " << ( q / 3 ) << endl;
62 for ( i = 0; i <
m_ndaug; i++ ) {
67 <<
"Will terminate execution!" << endl;
92 return 1000000.0 * prob;
97 <<
"prob > probmax:(" << prob <<
">" <<
m_probmax <<
")";
101 for ( i = 0; i <
m_ndaug; i++ ) {
121 <<
"prob > probmax:(" << prob <<
">" <<
m_probmax <<
")";
125 for (
int i = 0; i <
m_ndaug; i++ ) {
139 return std::string(
"" );
145 <<
"Should never call EvtDecayBase::command" << endl;
209 int narg, std::vector<std::string>& args,
210 std::string name,
double brfr )
223 for ( i = 0; i <
m_ndaug; i++ ) {
233 for ( i = 0; i <
m_narg; i++ ) {
254 for ( i = 0; i <
m_ndaug; i++ ) {
260 <<
"This is fine for development, but must be provided for production."
263 <<
"Never fear though - the decay will use the \n";
265 <<
"500 iterations to build up a good probmax \n";
267 <<
"before accepting a decay. " << endl;
288 for (
int i = 0; i <
m_ndaug; i++ ) {
311 if ( maxOkMass < 0.0000000001 )
315 maxOkMass = p->
mass();
321 double minDaugMass = 0.;
322 for ( i = 0; i < par->
getNDaug(); i++ ) {
327 minDaugMass += dau->
mass();
333 if ( maxOkMass > ( maxParMass - minDaugMass ) )
334 maxOkMass = maxParMass - minDaugMass;
356 if ( count > 10000 ) {
358 <<
"Can not find a valid mass for: "
361 <<
"Now printing parent and/or grandparent tree\n";
377 <<
"maxokmass=" << maxOkMass <<
" "
381 for ( i = 0; i < p->
getNDaug(); i++ ) {
389 <<
"taking a default value\n";
400 for ( i = 0; i < p->
getNDaug(); i++ ) {
412 if ( massSum < mass )
414 if ( mass > maxOkMass )
423 const EvtId daugs[10],
double masses[10] )
431 for ( i = 0; i < ndaugs; i++ ) {
440 masses[0] = p->
mass();
448 for ( i = 0; i < ndaugs; i++ ) {
450 mass_sum = mass_sum + masses[i];
455 if ( count == 10000 ) {
458 <<
" (m=" << p->
mass() <<
")" << endl;
460 <<
"To the following daugthers" << endl;
461 for ( i = 0; i < ndaugs; i++ ) {
466 <<
"Has been rejected " << count
467 <<
" times, will now take minimal masses "
468 <<
" of daugthers" << endl;
471 for ( i = 0; i < ndaugs; i++ ) {
473 mass_sum = mass_sum + masses[i];
475 if ( mass_sum > p->
mass() ) {
477 <<
"Parent mass=" << p->
mass()
478 <<
"to light for daugthers." << endl
479 <<
"Will throw the event away." << endl;
486 }
while ( mass_sum > p->
mass() );
496 <<
m_modelname.c_str() <<
" generator expected " << endl;
509 <<
" arguments but found:" <<
m_narg << endl;
512 <<
"Will terminate execution!" << endl;
526 <<
" daughters but found:" <<
m_ndaug << endl;
529 <<
"Will terminate execution!" << endl;
537 if ( parenttype != sp ) {
539 <<
m_modelname.c_str() <<
" did not get the correct parent spin\n";
542 <<
"Will terminate execution!" << endl;
550 if ( parenttype != sp ) {
553 <<
" did not get the correct daughter spin d=" << d1 << endl;
556 <<
"Will terminate execution!" << endl;
571 for (
int i = 0; i <
m_narg; i++ ) {
581 const char* str =
m_args[j].c_str();
583 while ( str[i] != 0 ) {
584 if ( isalpha( str[i] ) && str[i] !=
'e' ) {
586 <<
"String " << str <<
" is not a number" << endl;
593 double result = strtod(
m_args[j].c_str(), tc );
604 if (
m_ndaug != other.m_ndaug )
609 std::vector<int> useDs;
610 for (
int i = 0; i <
m_ndaug; i++ )
611 useDs.push_back( 0 );
613 for (
int i = 0; i <
m_ndaug; i++ ) {
614 bool foundIt =
false;
615 for (
int j = 0; j <
m_ndaug; j++ ) {
618 if (
m_daug[i] == other.m_daug[j] &&
619 m_daug[i].getAlias() == other.m_daug[j].getAlias() ) {
625 if ( foundIt ==
false )
628 for (
int i = 0; i <
m_ndaug; i++ )
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(unsigned int j)
void saveDecayInfo(EvtId ipar, int ndaug, const EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
double resetProbMax(double prob)
void setProbMax(double prbmx)
static void findMasses(EvtParticle *p, int ndaugs, const EvtId daugs[10], double masses[10])
virtual std::string getParamName(int i)
static void findMass(EvtParticle *p)
virtual bool matchingDecay(const EvtDecayBase &other) const
EvtId getParentId() const
static double findMaxMass(EvtParticle *p)
EvtId getDaug(int i) const
virtual void command(std::string cmd)
double getProbMax(double prob)
virtual std::string getParamDefault(int i)
void checkNDaug(int d1, int d2=-1)
std::vector< EvtId > m_daug
std::vector< double > m_storedArgs
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
virtual void initProbMax()
std::vector< std::string > m_args
virtual std::string commandName()
std::vector< double > m_argsD
void printSummary() const
static EvtSpinType::spintype getSpinType(EvtId i)
static int getStdHep(EvtId id)
static double getMaxMass(EvtId i)
static double getMass(EvtId i)
static std::string name(EvtId i)
static double getMinMass(EvtId i)
EvtParticle * getDaug(const int i)
EvtParticle * getParent() const
static void setRejectFlag()