1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtDecayTable.cc
15 // Modification history:
17 // DJL/RYD September 25, 1996 Module created
19 //------------------------------------------------------------------------
21 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtParticle.hh"
30 #include "EvtGenBase/EvtRandom.hh"
31 #include "EvtGenBase/EvtDecayTable.hh"
32 #include "EvtGenBase/EvtPDL.hh"
33 #include "EvtGenBase/EvtSymTable.hh"
34 #include "EvtGenBase/EvtDecayBase.hh"
35 #include "EvtGenBase/EvtModel.hh"
36 #include "EvtGenBase/EvtParser.hh"
37 #include "EvtGenBase/EvtReport.hh"
38 #include "EvtGenBase/EvtModelAlias.hh"
39 #include "EvtGenBase/EvtRadCorr.hh"
44 std::vector<EvtParticleDecayList> EvtDecayTable::_decaytable;
46 int EvtDecayTable::getNMode(int ipar){
47 return _decaytable[ipar].getNMode();
50 EvtDecayBase* EvtDecayTable::getDecay(int ipar, int imode){
51 return _decaytable[ipar].getDecayModel(imode);
54 void EvtDecayTable::printSummary(){
56 for(size_t i=0;i<EvtPDL::entries();i++){
57 _decaytable[i].printSummary();
62 EvtDecayBase* EvtDecayTable::getDecayFunc(EvtParticle *p){
65 partnum=p->getId().getAlias();
67 if ( _decaytable[partnum].getNMode()==0 ) return 0;
68 return _decaytable[partnum].getDecayModel(p);
72 void EvtDecayTable::readDecayFile(const std::string dec_name, bool verbose){
74 if ( _decaytable.size() < EvtPDL::entries() ) _decaytable.resize(EvtPDL::entries());
75 EvtModel &modelist=EvtModel::instance();
78 report(INFO,"EvtGen") << "In readDecayFile, reading:"<<dec_name.c_str()<<endl;
82 fin.open(dec_name.c_str());
84 report(ERROR,"EvtGen") << "Could not open "<<dec_name.c_str()<<endl;
89 parser.read(dec_name);
97 for(itok=0;itok<parser.getNToken();itok++){
99 token=parser.getToken(itok);
101 if (token=="End") hasend=1;
106 report(ERROR,"EvtGen") << "Could not find an 'End' in "<<dec_name.c_str()<<endl;
107 report(ERROR,"EvtGen") << "Will terminate execution."<<endl;
113 std::string model,parent,sdaug;
118 EvtId daught[MAX_DAUG];
123 std::vector<EvtModelAlias> modelAliasList;
128 token=parser.getToken(itoken++);
130 //Easy way to turn off photos... Lange September 5, 2000
131 if (token=="noPhotos"){
132 EvtRadCorr::setNeverRadCorr();
134 report(INFO,"EvtGen")
135 << "As requested, PHOTOS will be turned off."<<endl;
137 else if (token=="yesPhotos"){
138 EvtRadCorr::setAlwaysRadCorr();
140 report(INFO,"EvtGen")
141 << "As requested, PHOTOS will be turned on for all decays."<<endl;
143 else if (token=="normalPhotos"){
144 EvtRadCorr::setNormalRadCorr();
146 report(INFO,"EvtGen")
147 << "As requested, PHOTOS will be turned on only when requested."<<endl;
149 else if (token=="Alias"){
154 newname=parser.getToken(itoken++);
155 oldname=parser.getToken(itoken++);
157 EvtId id=EvtPDL::getId(oldname);
159 if (id==EvtId(-1,-1)) {
160 report(ERROR,"EvtGen") <<"Unknown particle name:"<<oldname.c_str()
161 <<" on line "<<parser.getLineofToken(itoken)<<endl;
162 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
166 EvtPDL::alias(id,newname);
167 if ( _decaytable.size() < EvtPDL::entries() ) _decaytable.resize(EvtPDL::entries());
169 } else if (token=="ModelAlias"){
170 std::vector<std::string> modelArgList;
172 std::string aliasName=parser.getToken(itoken++);
173 std::string modelName=parser.getToken(itoken++);
175 std::string nameTemp;
177 nameTemp=parser.getToken(itoken++);
179 modelArgList.push_back(nameTemp);
181 }while(nameTemp!=";");
182 EvtModelAlias newAlias(aliasName,modelName,modelArgList);
183 modelAliasList.push_back(newAlias);
184 } else if (token=="ChargeConj"){
187 std::string abarname;
189 aname=parser.getToken(itoken++);
190 abarname=parser.getToken(itoken++);
192 EvtId a=EvtPDL::getId(aname);
193 EvtId abar=EvtPDL::getId(abarname);
195 if (a==EvtId(-1,-1)) {
196 report(ERROR,"EvtGen") <<"Unknown particle name:"<<aname.c_str()
197 <<" on line "<<parser.getLineofToken(itoken)<<endl;
198 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
202 if (abar==EvtId(-1,-1)) {
203 report(ERROR,"EvtGen") <<"Unknown particle name:"<<abarname.c_str()
204 <<" on line "<<parser.getLineofToken(itoken)<<endl;
205 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
210 EvtPDL::aliasChgConj(a,abar);
212 } else if (modelist.isCommand(token)){
216 cnfgstr=parser.getToken(itoken++);
218 modelist.storeCommand(token,cnfgstr);
220 } else if (token=="CDecay"){
224 name=parser.getToken(itoken++);
225 ipar=EvtPDL::getId(name);
227 if (ipar==EvtId(-1,-1)) {
228 report(ERROR,"EvtGen") <<"Unknown particle name:"<<name.c_str()
230 <<parser.getLineofToken(itoken-1)<<endl;
231 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
235 EvtId cipar=EvtPDL::chargeConj(ipar);
237 if (_decaytable[ipar.getAlias()].getNMode()!=0) {
239 report(DEBUG,"EvtGen") <<
240 "Redefined decay of "<<name.c_str()<<" in CDecay"<<endl;
242 _decaytable[ipar.getAlias()].removeDecay();
245 //take contents of cipar and conjugate and store in ipar
246 _decaytable[ipar.getAlias()].makeChargeConj(&_decaytable[cipar.getAlias()]);
248 } else if (token=="Define"){
252 name=parser.getToken(itoken++);
253 // value=atof(parser.getToken(itoken++).c_str());
255 EvtSymTable::define(name,parser.getToken(itoken++));
257 //New code Lange April 10, 2001 - allow the user
258 //to change particle definitions of EXISTING
259 //particles on the fly
260 } else if (token=="Particle"){
263 pname=parser.getToken(itoken++);
265 report(INFO,"EvtGen") << pname.c_str() << endl;
266 //There should be at least the mass
267 double newMass=atof(parser.getToken(itoken++).c_str());
268 EvtId thisPart = EvtPDL::getId(pname);
269 double newWidth=EvtPDL::getMeanMass(thisPart);
270 if ( parser.getNToken() > 3 ) newWidth=atof(parser.getToken(itoken++).c_str());
272 //Now make the change!
273 EvtPDL::reSetMass(thisPart, newMass);
274 EvtPDL::reSetWidth(thisPart, newWidth);
277 report(INFO,"EvtGen") << "Changing particle properties of " <<
278 pname.c_str() << " Mass=" << newMass << " Width="<<newWidth<<endl;
280 } else if ( token=="ChangeMassMin") {
282 pname=parser.getToken(itoken++);
283 double tmass=atof(parser.getToken(itoken++).c_str());
285 EvtId thisPart = EvtPDL::getId(pname);
286 EvtPDL::reSetMassMin(thisPart,tmass);
288 report(DEBUG,"EvtGen") <<"Refined minimum mass for " << EvtPDL::name(thisPart).c_str() << " to be " << tmass << endl;
290 } else if ( token=="ChangeMassMax") {
292 pname=parser.getToken(itoken++);
293 double tmass=atof(parser.getToken(itoken++).c_str());
294 EvtId thisPart = EvtPDL::getId(pname);
295 EvtPDL::reSetMassMax(thisPart,tmass);
297 report(DEBUG,"EvtGen") <<"Refined maximum mass for " << EvtPDL::name(thisPart).c_str() << " to be " << tmass << endl;
299 } else if ( token=="IncludeBirthFactor") {
301 pname=parser.getToken(itoken++);
303 if ( parser.getToken(itoken++).c_str()=="yes") yesno=true;
304 EvtId thisPart = EvtPDL::getId(pname);
305 EvtPDL::includeBirthFactor(thisPart,yesno);
307 if ( yesno ) report(DEBUG,"EvtGen") <<"Include birth factor for " << EvtPDL::name(thisPart).c_str() <<endl;
308 if ( !yesno ) report(DEBUG,"EvtGen") <<"No longer include birth factor for " << EvtPDL::name(thisPart).c_str() <<endl;
311 } else if ( token=="IncludeDecayFactor") {
313 pname=parser.getToken(itoken++);
315 if ( parser.getToken(itoken++).c_str()=="yes") yesno=true;
316 EvtId thisPart = EvtPDL::getId(pname);
317 EvtPDL::includeDecayFactor(thisPart,yesno);
319 if ( yesno ) report(DEBUG,"EvtGen") <<"Include decay factor for " << EvtPDL::name(thisPart).c_str() <<endl;
320 if ( !yesno ) report(DEBUG,"EvtGen") <<"No longer include decay factor for " << EvtPDL::name(thisPart).c_str() <<endl;
322 } else if ( token=="LSNONRELBW") {
324 pname=parser.getToken(itoken++);
325 EvtId thisPart = EvtPDL::getId(pname);
326 std::string tstr="NONRELBW";
327 EvtPDL::changeLS(thisPart,tstr);
329 report(DEBUG,"EvtGen") <<"Change lineshape to non-rel BW for " << EvtPDL::name(thisPart).c_str() <<endl;
330 } else if ( token=="SP8LSFIX") {
331 //this was a bug, but preserve functionality as not to confuse people...
333 pname=parser.getToken(itoken++);
334 EvtId thisPart = EvtPDL::getId(pname);
335 EvtPDL::fixLSForSP8(thisPart);
337 report(DEBUG,"EvtGen") <<"Fixed lineshape for SP8 --from D.Lange,J.Smith " << EvtPDL::name(thisPart).c_str() <<endl;
339 } else if ( token=="SP6LSFIX") {
341 pname=parser.getToken(itoken++);
342 EvtId thisPart = EvtPDL::getId(pname);
343 EvtPDL::fixLSForSP8(thisPart);
345 report(DEBUG,"EvtGen") <<"Fixed lineshape for SP8 --from D.Lange,J.Smith " << EvtPDL::name(thisPart).c_str() <<endl;
347 } else if ( token=="LSFLAT") {
349 pname=parser.getToken(itoken++);
350 EvtId thisPart = EvtPDL::getId(pname);
351 std::string tstr="FLAT";
352 EvtPDL::changeLS(thisPart,tstr);
354 report(DEBUG,"EvtGen") <<"Change lineshape to flat for " << EvtPDL::name(thisPart).c_str() <<endl;
355 } else if ( token=="LSMANYDELTAFUNC") {
357 pname=parser.getToken(itoken++);
358 EvtId thisPart = EvtPDL::getId(pname);
359 std::string tstr="MANYDELTAFUNC";
360 EvtPDL::changeLS(thisPart,tstr);
362 report(DEBUG,"EvtGen") <<"Change lineshape to spikes for " << EvtPDL::name(thisPart).c_str() <<endl;
364 } else if ( token=="BlattWeisskopf") {
366 pname=parser.getToken(itoken++);
367 double tnum=atof(parser.getToken(itoken++).c_str());
368 EvtId thisPart = EvtPDL::getId(pname);
369 EvtPDL::reSetBlatt(thisPart,tnum);
371 report(DEBUG,"EvtGen") <<"Redefined Blatt-Weisskopf factor " << EvtPDL::name(thisPart).c_str() << " to be " << tnum << endl;
372 } else if ( token=="SetLineshapePW") {
374 pname=parser.getToken(itoken++);
375 EvtId thisPart = EvtPDL::getId(pname);
376 std::string pnameD1=parser.getToken(itoken++);
377 EvtId thisD1 = EvtPDL::getId(pnameD1);
378 std::string pnameD2=parser.getToken(itoken++);
379 EvtId thisD2 = EvtPDL::getId(pnameD2);
380 int pw=atoi(parser.getToken(itoken++).c_str());
382 report(DEBUG,"EvtGen") <<"Redefined Partial wave for " << pname.c_str() << " to " << pnameD1.c_str() << " " << pnameD2.c_str() << " ("<<pw<<")"<<endl;
383 EvtPDL::setPWForDecay(thisPart,pw,thisD1,thisD2);
384 EvtPDL::setPWForBirthL(thisD1,pw,thisPart,thisD2);
385 EvtPDL::setPWForBirthL(thisD2,pw,thisPart,thisD1);
388 } else if (token=="Decay") {
390 std::string temp_fcn_new_model;
392 EvtDecayBase* temp_fcn_new;
398 parent=parser.getToken(itoken++);
399 ipar=EvtPDL::getId(parent);
401 if (ipar==EvtId(-1,-1)) {
402 report(ERROR,"EvtGen") <<"Unknown particle name:"<<parent.c_str()
404 <<parser.getLineofToken(itoken-1)<<endl;
405 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
409 if (_decaytable[ipar.getAlias()].getNMode()!=0) {
410 report(DEBUG,"EvtGen") <<"Redefined decay of "
411 <<parent.c_str()<<endl;
412 _decaytable[ipar.getAlias()].removeDecay();
418 token=parser.getToken(itoken++);
420 if (token!="Enddecay"){
423 while (token.c_str()[i++]!=0){
424 if (isalpha(token.c_str()[i])){
425 report(ERROR,"EvtGen") <<
426 "Expected to find a branching fraction or Enddecay "<<
427 "but found:"<<token.c_str()<<" on line "<<
428 parser.getLineofToken(itoken-1)<<endl;
429 report(ERROR,"EvtGen") << "Possibly to few arguments to model "<<
430 "on previous line!"<<endl;
431 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
436 brfr=atof(token.c_str());
438 int isname=EvtPDL::getId(parser.getToken(itoken)).getId()>=0;
439 int ismodel=modelist.isModel(parser.getToken(itoken));
441 if (!(isname||ismodel)){
442 //see if this is an aliased model
443 for(size_t iAlias=0;iAlias<modelAliasList.size();iAlias++){
444 if ( modelAliasList[iAlias].matchAlias(parser.getToken(itoken)) ) {
451 if (!(isname||ismodel)){
453 report(INFO,"EvtGen") << parser.getToken(itoken).c_str()
454 << " is neither a particle name nor "
455 << "the name of a model. "<<endl;
456 report(INFO,"EvtGen") << "It was encountered on line "<<
457 parser.getLineofToken(itoken)<<" of the decay file."<<endl;
458 report(INFO,"EvtGen") << "Please fix it. Thank you."<<endl;
459 report(INFO,"EvtGen") << "Be sure to check that the "
460 << "correct case has been used. \n";
461 report(INFO,"EvtGen") << "Terminating execution. \n";
469 while(EvtPDL::getId(parser.getToken(itoken)).getId()>=0){
470 sdaug=parser.getToken(itoken++);
471 daught[n_daugh++]=EvtPDL::getId(sdaug);
472 if (daught[n_daugh-1]==EvtId(-1,-1)) {
473 report(ERROR,"EvtGen") <<"Unknown particle name:"<<sdaug.c_str()
474 <<" on line "<<parser.getLineofToken(itoken)<<endl;
475 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
481 model=parser.getToken(itoken++);
489 if (model=="PHOTOS"){
491 model=parser.getToken(itoken++);
493 if (model=="VERBOSE"){
495 model=parser.getToken(itoken++);
497 if (model=="SUMMARY"){
499 model=parser.getToken(itoken++);
501 }while(model=="PHOTOS"||
505 //see if this is an aliased model
507 for(size_t iAlias=0;iAlias<modelAliasList.size();iAlias++){
508 if ( modelAliasList[iAlias].matchAlias(model) ) {
514 if ( foundAnAlias==-1 ) {
515 if(!modelist.isModel(model)){
516 report(ERROR,"EvtGen") <<
517 "Expected to find a model name,"<<
518 "found:"<<model.c_str()<<" on line "<<
519 parser.getLineofToken(itoken)<<endl;
520 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
525 model=modelAliasList[foundAnAlias].getName();
528 temp_fcn_new_model=model;
529 temp_fcn_new=modelist.getFcn(model);
533 temp_fcn_new->setPHOTOS();
536 temp_fcn_new->setVerbose();
539 temp_fcn_new->setSummary();
543 std::vector<std::string> temp_fcn_new_args;
548 if ( foundAnAlias==-1 ) {
550 name=parser.getToken(itoken++);
552 temp_fcn_new_args.push_back(EvtSymTable::get(name,ierr));
554 report(ERROR,"EvtGen")
555 <<"Reading arguments and found:"<<
556 name.c_str()<<" on line:"<<
557 parser.getLineofToken(itoken-1)<<endl;
558 report(ERROR,"EvtGen")
559 << "Will terminate execution!"<<endl;
563 //int isname=EvtPDL::getId(name).getId()>=0;
564 int ismodel=modelist.isModel(name);
566 report(ERROR,"EvtGen")
567 <<"Expected ';' but found:"<<
568 name.c_str()<<" on line:"<<
569 parser.getLineofToken(itoken-1)<<endl;
570 report(ERROR,"EvtGen")
571 << "Most probable error is omitted ';'."<<endl;
572 report(ERROR,"EvtGen")
573 << "Will terminate execution!"<<endl;
579 std::vector<std::string> copyMe=modelAliasList[foundAnAlias].getArgList();
580 temp_fcn_new_args=copyMe;
587 temp_fcn_new->saveDecayInfo(ipar,n_daugh,
589 temp_fcn_new_args.size(),
596 // for (i=0;i<n_daugh;i++){
597 for (i=0;i<temp_fcn_new->nRealDaughters();i++){
598 if ( EvtPDL::getMinMass(daught[i])>0.0001 ){
599 massmin+=EvtPDL::getMinMass(daught[i]);
601 massmin+=EvtPDL::getMeanMass(daught[i]);
605 _decaytable[ipar.getAlias()].addMode(temp_fcn_new,brfrsum,massmin);
609 } while(token!="Enddecay");
611 _decaytable[ipar.getAlias()].finalize();
614 // Allow copying of decays from one particle to another; useful
615 // in combination with RemoveDecay
616 else if (token=="CopyDecay") {
620 newname=parser.getToken(itoken++);
621 oldname=parser.getToken(itoken++);
623 EvtId newipar=EvtPDL::getId(newname);
624 EvtId oldipar=EvtPDL::getId(oldname);
626 if (oldipar==EvtId(-1,-1)) {
627 report(ERROR,"EvtGen") <<"Unknown particle name:"<<oldname.c_str()
628 <<" on line "<<parser.getLineofToken(itoken)<<endl;
629 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
632 if (newipar==EvtId(-1,-1)) {
633 report(ERROR,"EvtGen") <<"Unknown particle name:"<<newname.c_str()
634 <<" on line "<<parser.getLineofToken(itoken)<<endl;
635 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
638 if (_decaytable[newipar.getAlias()].getNMode()!=0) {
639 report(DEBUG,"EvtGen") <<"Redefining decay of "
641 _decaytable[newipar.getAlias()].removeDecay();
643 _decaytable[newipar.getAlias()] = _decaytable[oldipar.getAlias()];
645 // Enable decay deletion; intended primarily for aliases
646 // Peter Onyisi, March 2008
647 else if (token=="RemoveDecay") {
648 parent = parser.getToken(itoken++);
649 ipar = EvtPDL::getId(parent);
651 if (ipar==EvtId(-1,-1)) {
652 report(ERROR,"EvtGen") <<"Unknown particle name:"<<parent.c_str()
654 <<parser.getLineofToken(itoken-1)<<endl;
655 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
659 if (_decaytable[ipar.getAlias()].getNMode()==0) {
660 report(DEBUG,"EvtGen") << "No decays to delete for "
661 << parent.c_str() << endl;
663 report(DEBUG,"EvtGen") <<"Deleting selected decays of "
664 <<parent.c_str()<<endl;
668 token = parser.getToken(itoken);
670 if (token != "Enddecay") {
672 while (EvtPDL::getId(parser.getToken(itoken)).getId() >= 0) {
673 sdaug = parser.getToken(itoken++);
674 daught[n_daugh++] = EvtPDL::getId(sdaug);
675 if (daught[n_daugh-1]==EvtId(-1,-1)) {
676 report(ERROR,"EvtGen") <<"Unknown particle name:"<<sdaug.c_str()
677 <<" on line "<<parser.getLineofToken(itoken)<<endl;
678 report(ERROR,"EvtGen") <<"Will terminate execution!"<<endl;
682 token = parser.getToken(itoken);
684 report(ERROR,"EvtGen")
685 <<"Expected ';' but found:"<<
686 token <<" on line:"<<
687 parser.getLineofToken(itoken-1)<<endl;
688 report(ERROR,"EvtGen")
689 << "Most probable error is omitted ';'."<<endl;
690 report(ERROR,"EvtGen")
691 << "Will terminate execution!"<<endl;
694 token = parser.getToken(itoken++);
695 EvtDecayBase* temp_fcn_new = modelist.getFcn("PHSP");
696 std::vector<std::string> temp_fcn_new_args;
697 std::string temp_fcn_new_model("PHSP");
698 temp_fcn_new->saveDecayInfo(ipar, n_daugh,
704 _decaytable[ipar.getAlias()].removeMode(temp_fcn_new);
706 } while (token != "Enddecay");
709 else if (token!="End"){
711 report(ERROR,"EvtGen") << "Found unknown command:'"<<token.c_str()<<"' on line "
712 <<parser.getLineofToken(itoken)<<endl;
713 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
718 } while ((token!="End")&&itoken!=parser.getNToken());
720 //Now we may need to reset the minimum mass for some particles????
722 for (size_t ii=0; ii<EvtPDL::entries(); ii++){
724 int nModTot=getNMode(ii);
726 if ( nModTot == 0 ) continue;
728 if ( EvtPDL::getWidth(temp) < 0.0000001 ) continue;
730 double minMass=EvtPDL::getMaxMass(temp);
731 for (jj=0; jj<nModTot; jj++) {
732 double tmass=_decaytable[ii].getDecay(jj).getMassMin();
733 if ( tmass< minMass) minMass=tmass;
735 if ( minMass > EvtPDL::getMinMass(temp) ) {
737 report(INFO,"EvtGen") << "Given allowed decays, resetting minMass " << EvtPDL::name(temp).c_str() << " "
738 << EvtPDL::getMinMass(temp) << " to " << minMass << endl;
739 EvtPDL::reSetMassMin(temp,minMass);
744 int EvtDecayTable::findChannel(EvtId parent, std::string model,
745 int ndaug, EvtId *daugs,
746 int narg, std::string *args){
749 EvtId daugs_scratch[50];
752 for(i=0;i<_decaytable[parent.getAlias()].getNMode();i++){
756 right=right&&model==_decaytable[parent.getAlias()].
757 getDecay(i).getDecayModel()->getModelName();
758 right=right&&(ndaug==_decaytable[parent.getAlias()].
759 getDecay(i).getDecayModel()->getNDaug());
760 right=right&&(narg==_decaytable[parent.getAlias()].
761 getDecay(i).getDecayModel()->getNArg());
767 for(j=0;j<ndaug;j++){
768 daugs_scratch[j]=daugs[j];
773 for(j=0;j<_decaytable[parent.getAlias()].
774 getDecay(i).getDecayModel()->getNDaug();j++){
776 for(k=0;k<ndaug;k++){
777 if (daugs_scratch[k]==_decaytable[parent.getAlias()].
778 getDecay(i).getDecayModel()->getDaug(j)){
779 daugs_scratch[k]=EvtId(-1,-1);
786 right=right&&(nmatch==ndaug);
788 for(j=0;j<_decaytable[parent.getAlias()].
789 getDecay(i).getDecayModel()->getNArg();j++){
790 right=right&&(args[j]==_decaytable[parent.getAlias()].
791 getDecay(i).getDecayModel()->getArgStr(j));
799 int EvtDecayTable::inChannelList(EvtId parent, int ndaug, EvtId *daugs){
802 EvtId daugs_scratch[MAX_DAUG];
805 for(i=0;i<ndaug;i++){
806 dsum+=daugs[i].getAlias();
811 int ipar=parent.getAlias();
813 int nmode=_decaytable[ipar].getNMode();
815 for(i=0;i<nmode;i++){
817 EvtDecayBase* thedecaymodel=_decaytable[ipar].getDecay(i).getDecayModel();
819 if (thedecaymodel->getDSum()==dsum){
821 int nd=thedecaymodel->getNDaug();
824 for(j=0;j<ndaug;j++){
825 daugs_scratch[j]=daugs[j];
829 for(k=0;k<ndaug;k++){
830 if (EvtId(daugs_scratch[k])==thedecaymodel->getDaug(j)){
831 daugs_scratch[k]=EvtId(-1,-1);
837 if ((nmatch==ndaug)&&
839 ((thedecaymodel->getModelName()=="JETSET")||
840 (thedecaymodel->getModelName()=="PYTHIA")))){