#include <EvtTauola.hh>
Inheritance diagram for EvtTauola:
Public Member Functions | |
void | checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1) |
void | checkNDaug (int d1, int d2=-1) |
void | checkQ () |
void | checkSpinDaughter (int d1, EvtSpinType::spintype sp) |
void | checkSpinParent (EvtSpinType::spintype sp) |
EvtDecayBase * | clone () |
void | command (std::string cmd) |
std::string | commandName () |
void | decay (EvtParticle *p) |
void | disableCheckQ () |
EvtTauola () | |
double | getArg (int j) |
double * | getArgs () |
std::string * | getArgsStr () |
std::string | getArgStr (int j) |
double | getBranchingFraction () |
EvtId | getDaug (int i) |
EvtId * | getDaugs () |
int | getDSum () |
std::string | getModelName () |
void | getName (std::string &name) |
int | getNArg () |
int | getNDaug () |
EvtId | getParentId () |
int | getPHOTOS () |
double | getProbMax (double prob) |
void | init () |
void | initProbMax () |
int | isDaughterSpinDensitySet (int daughter) |
void | makeDecay (EvtParticle *p) |
virtual bool | matchingDecay (const EvtDecayBase &other) const |
void | noProbMax () |
virtual int | nRealDaughters () |
void | printSummary () |
double | resetProbMax (double prob) |
void | saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr) |
void | setDaughterSpinDensity (int daughter) |
void | setPHOTOS () |
void | setProbMax (double prbmx) |
void | setSummary () |
void | setVerbose () |
int | summary () |
int | verbose () |
virtual | ~EvtTauola () |
Static Public Member Functions | |
void | findMass (EvtParticle *p) |
void | findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10]) |
double | findMaxMass (EvtParticle *p) |
Protected Member Functions | |
bool | daugsDecayedByParentModel () |
Protected Attributes | |
bool | _daugsDecayedByParentModel |
Private Member Functions | |
void | fixPolarizations (EvtParticle *p) |
void | store (EvtDecayBase *jsdecay) |
Static Private Attributes | |
std::string * | commands = 0 |
int | lcommand = 0 |
int | ncommand = 0 |
int | ntable = 0 |
int | ntauoladecays = 0 |
EvtDecayBasePtr * | tauoladecays = 0 |
|
00064 {}
|
|
00066 { 00067 00068 00069 int i; 00070 00071 00072 //the deletion of commands is really uggly! 00073 00074 if (ntauoladecays==0) { 00075 delete [] commands; 00076 commands=0; 00077 return; 00078 } 00079 00080 for(i=0;i<ntauoladecays;i++){ 00081 if (tauoladecays[i]==this){ 00082 tauoladecays[i]=tauoladecays[ntauoladecays-1]; 00083 ntauoladecays--; 00084 if (ntauoladecays==0) { 00085 delete [] commands; 00086 commands=0; 00087 } 00088 return; 00089 } 00090 } 00091 00092 report(ERROR,"EvtGen") << "Error in destroying Tauola model!"<<endl; 00093 00094 }
|
|
00483 { 00484 00485 if ( _narg != a1 && _narg != a2 && _narg != a3 && _narg != a4 ) { 00486 report(ERROR,"EvtGen") << _modelname.c_str() << " generator expected "<<endl; 00487 report(ERROR,"EvtGen") << a1<<endl;; 00488 if ( a2>-1) { 00489 report(ERROR,"EvtGen") << " or " << a2<<endl; 00490 } 00491 if ( a3>-1) { 00492 report(ERROR,"EvtGen") << " or " << a3<<endl; 00493 } 00494 if ( a4>-1) { 00495 report(ERROR,"EvtGen") << " or " << a4<<endl; 00496 } 00497 report(ERROR,"EvtGen") << " arguments but found:"<< _narg << endl; 00498 printSummary(); 00499 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00500 ::abort(); 00501 00502 } 00503 00504 }
|
|
00505 { 00506 00507 if ( _ndaug != d1 && _ndaug != d2 ) { 00508 report(ERROR,"EvtGen") << _modelname.c_str() << " generator expected "; 00509 report(ERROR,"EvtGen") << d1; 00510 if ( d2>-1) { 00511 report(ERROR,"EvtGen") << " or " << d2; 00512 } 00513 report(ERROR,"EvtGen") << " daughters but found:"<< _ndaug << endl; 00514 printSummary(); 00515 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00516 ::abort(); 00517 } 00518 00519 }
|
|
00035 { 00036 int i; 00037 int q=0; 00038 int qpar; 00039 00040 //If there are no daughters (jetset etc) then we do not 00041 //want to do this test. Why? Because sometimes the parent 00042 //will have a nonzero charge. 00043 00044 if ( _ndaug != 0) { 00045 for(i=0; i<_ndaug; i++ ) { 00046 q += EvtPDL::chg3(_daug[i]); 00047 } 00048 qpar = EvtPDL::chg3(_parent); 00049 00050 if ( q != qpar ) { 00051 report(ERROR,"EvtGen") <<_modelname.c_str()<< " generator expected " 00052 << " charge to be conserved, found:"<<endl; 00053 report(ERROR,"EvtGen") << "Parent charge of "<<(qpar/3)<<endl; 00054 report(ERROR,"EvtGen") << "Sum of daughter charge of "<<(q/3)<<endl; 00055 report(ERROR,"EvtGen") << "The parent is "<< EvtPDL::name(_parent).c_str()<<endl; 00056 for(i=0; i<_ndaug; i++ ) { 00057 report(ERROR,"EvtGen") << "Daughter "<< EvtPDL::name(_daug[i]).c_str()<<endl; 00058 } 00059 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00060 00061 ::abort(); 00062 } 00063 } 00064 }
|
|
00534 { 00535 00536 EvtSpinType::spintype parenttype = EvtPDL::getSpinType(getDaug(d1)); 00537 if ( parenttype != sp ) { 00538 report(ERROR,"EvtGen") << _modelname.c_str() 00539 << " did not get the correct daughter spin d=" 00540 << d1 << endl; 00541 printSummary(); 00542 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00543 ::abort(); 00544 } 00545 00546 }
|
|
00521 { 00522 00523 EvtSpinType::spintype parenttype = EvtPDL::getSpinType(getParentId()); 00524 if ( parenttype != sp ) { 00525 report(ERROR,"EvtGen") << _modelname.c_str() 00526 << " did not get the correct parent spin\n"; 00527 printSummary(); 00528 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00529 ::abort(); 00530 } 00531 00532 }
|
|
Implements EvtDecayBase. 00103 { 00104 00105 return new EvtTauola; 00106 00107 }
|
|
Reimplemented from EvtDecayBase. 00147 { 00148 00149 if (ncommand==lcommand){ 00150 00151 lcommand=10+2*lcommand; 00152 00153 std::string* newcommands=new std::string[lcommand]; 00154 00155 int i; 00156 00157 for(i=0;i<ncommand;i++){ 00158 newcommands[i]=commands[i]; 00159 } 00160 00161 delete [] commands; 00162 00163 commands=newcommands; 00164 00165 } 00166 00167 commands[ncommand]=cmd; 00168 00169 ncommand++; 00170 00171 }
|
|
Reimplemented from EvtDecayBase. 00141 { 00142 00143 return std::string("TauolaPar"); 00144 00145 }
|
|
00111 {return _daugsDecayedByParentModel;}
|
|
Implements EvtDecayBase. 00175 { 00176 00177 static int iniflag=0; 00178 00179 static EvtId STRNG=EvtPDL::getId("string"); 00180 00181 int istdheppar=EvtPDL::getStdHep(p->getId()); 00182 00183 /* 00184 if (pycomp_(&istdheppar)==0){ 00185 report(ERROR,"EvtGen") << "Tauola can not decay:" 00186 <<EvtPDL::name(p->getId()).c_str()<<endl; 00187 return; 00188 } 00189 */ 00190 00191 EvtVector4R p4[20]; 00192 00193 00194 int i,more; 00195 int idtau=EvtPDL::getStdHep(p->getId()); 00196 int ndaugjs; 00197 static int kf[20]; 00198 EvtId evtnumstable[20],evtnumparton[20]; 00199 int stableindex[20],partonindex[20]; 00200 int numstable; 00201 int numparton; 00202 static int km[20]; 00203 EvtId type[MAX_DAUG]; 00204 00205 static double px[20],py[20],pz[20],e[20]; 00206 00207 // std::cout<<"cc: inifag,idtau,taup,polt"<<iniflag<<"; "<<idtau<<"; "<<taup[0]<<"; "<<polt[3]<<endl; 00208 if (iniflag==0) dectes_(&iniflag,&idtau,&ndaugjs,kf,km,px,py,pz,e); 00209 //std::cout<<"Tauola initialized"<<endl; 00210 if ( p->getNDaug() != 0 ) { p->deleteDaughters(true);} 00211 00212 int count=0; 00213 00214 do{ 00215 //report(INFO,"EvtGen") << "calling tauola " << idtau<< " " << mp <<endl; 00216 iniflag=iniflag+1; //to count the event number 00217 dectes_(&iniflag,&idtau,&ndaugjs,kf,km,px,py,pz,e); 00218 00219 numstable=0; 00220 numparton=0; 00221 // report(INFO,"EvtGen") << "found some daughters " << ndaugjs << endl; 00222 for(i=0;i<ndaugjs;i++){ 00223 //std::cout<<"ndaugjs,kf,km,px,py,pz,e: "<<i<<", "<<km[i]<<", "<<kf[i]<<", "<<px[i]<<" ,"<<py[i]<<", "<<pz[i]<<", "<<e[i]<<std::endl; //for debugging 00224 00225 if (EvtPDL::evtIdFromStdHep(kf[i])==EvtId(-1,-1)) { 00226 report(ERROR,"EvtGen") << "Tauola returned particle:"<<kf[i]<<endl; 00227 report(ERROR,"EvtGen") << "This can not be translated to evt number"<<endl; 00228 report(ERROR,"EvtGen") << "and the decay will be rejected!"<<endl; 00229 report(ERROR,"EvtGen") << "The decay was of particle:"<<idtau<<endl; 00230 00231 } 00232 00233 //sort out the partons 00234 if (abs(kf[i])<=6||kf[i]==21){ 00235 partonindex[numparton]=i; 00236 evtnumparton[numparton]=EvtPDL::evtIdFromStdHep(kf[i]); 00237 numparton++; 00238 } 00239 else{ 00240 stableindex[numstable]=i; 00241 evtnumstable[numstable]=EvtPDL::evtIdFromStdHep(kf[i]); 00242 numstable++; 00243 } 00244 00245 00246 // have to protect against negative mass^2 for massless particles 00247 // i.e. neutrinos and photons. 00248 // this is uggly but I need to fix it right now.... 00249 00250 if (px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i]>=e[i]*e[i]){ 00251 00252 e[i]=sqrt(px[i]*px[i]+py[i]*py[i]+pz[i]*pz[i])+0.0000000001; 00253 00254 } 00255 00256 p4[i].set(e[i],px[i],py[i],pz[i]); 00257 00258 00259 } 00260 00261 int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable); 00262 00263 00264 more=(channel!=-1); 00265 00266 00267 count++; 00268 00269 }while( more && (count<10000) ); 00270 00271 if (count>9999) { 00272 report(INFO,"EvtGen") << "Too many loops in EvtTauola!!!"<<endl; 00273 report(INFO,"EvtGen") << "Parent:"<<EvtPDL::name(getParentId()).c_str()<<endl; 00274 for(i=0;i<numstable;i++){ 00275 report(INFO,"EvtGen") << "Daug("<<i<<")"<<EvtPDL::name(evtnumstable[i]).c_str()<<endl; 00276 } 00277 00278 } 00279 00280 00281 00282 if (numparton==0){ 00283 00284 p->makeDaughters(numstable,evtnumstable); 00285 int ndaugFound=0; 00286 for(i=0;i<numstable;i++){ 00287 p->getDaug(i)->init(evtnumstable[i],p4[stableindex[i]]); 00288 ndaugFound++; 00289 } 00290 if ( ndaugFound == 0 ) { 00291 report(ERROR,"EvtGen") << "Tauola has failed to do a decay "; 00292 report(ERROR,"EvtGen") << EvtPDL::name(p->getId()).c_str() << " " << p->mass()<<endl; 00293 assert(0); 00294 } 00295 00296 fixPolarizations(p); 00297 00298 return ; 00299 00300 } 00301 else{ 00302 00303 //have partons in TAUOLA 00304 00305 EvtVector4R p4string(0.0,0.0,0.0,0.0); 00306 00307 for(i=0;i<numparton;i++){ 00308 p4string+=p4[partonindex[i]]; 00309 } 00310 00311 int nprimary=1; 00312 type[0]=STRNG; 00313 for(i=0;i<numstable;i++){ 00314 if (km[stableindex[i]]==0){ 00315 type[nprimary++]=evtnumstable[i]; 00316 } 00317 } 00318 00319 p->makeDaughters(nprimary,type); 00320 00321 p->getDaug(0)->init(STRNG,p4string); 00322 00323 EvtVector4R p4partons[10]; 00324 00325 for(i=0;i<numparton;i++){ 00326 p4partons[i]=p4[partonindex[i]]; 00327 } 00328 00329 ((EvtStringParticle*)p->getDaug(0))->initPartons(numparton,p4partons,evtnumparton); 00330 00331 00332 00333 nprimary=1; 00334 00335 for(i=0;i<numstable;i++){ 00336 00337 if (km[stableindex[i]]==0){ 00338 p->getDaug(nprimary++)->init(evtnumstable[i],p4[stableindex[i]]); 00339 } 00340 } 00341 00342 00343 int nsecond=0; 00344 for(i=0;i<numstable;i++){ 00345 if (km[stableindex[i]]!=0){ 00346 type[nsecond++]=evtnumstable[i]; 00347 } 00348 } 00349 00350 00351 p->getDaug(0)->makeDaughters(nsecond,type); 00352 00353 EvtVector4R p4stringboost(p4string.get(0),-p4string.get(1), 00354 -p4string.get(2),-p4string.get(3)); 00355 00356 nsecond=0; 00357 for(i=0;i<numstable;i++){ 00358 if (km[stableindex[i]]!=0){ 00359 p4[stableindex[i]]=boostTo(p4[stableindex[i]],p4stringboost); 00360 p->getDaug(0)->getDaug(nsecond)->init(evtnumstable[i],p4[stableindex[i]]); 00361 p->getDaug(0)->getDaug(nsecond)->setDiagonalSpinDensity(); 00362 p->getDaug(0)->getDaug(nsecond)->decay(); 00363 nsecond++; 00364 } 00365 } 00366 00367 if ( nsecond == 0 ) { 00368 report(ERROR,"EvtGen") << "Jetset has failed to do a decay "; 00369 report(ERROR,"EvtGen") << EvtPDL::name(p->getId()).c_str() << " " << p->mass() <<endl; 00370 assert(0); 00371 } 00372 00373 fixPolarizations(p); 00374 00375 return ; 00376 00377 } 00378 00379 }
|
|
00062 {_chkCharge=0;};
|
|
00347 { 00348 00349 //Need to also check that this mass does not screw 00350 //up the parent 00351 //This code assumes that for the ith daughter, 0..i-1 00352 //already have a mass 00353 double maxOkMass=findMaxMass(p); 00354 00355 int count=0; 00356 double mass; 00357 bool massOk=false; 00358 int i; 00359 while (!massOk) { 00360 count++; 00361 if ( count > 10000 ) { 00362 report(INFO,"EvtGen") << "Can not find a valid mass for: " << EvtPDL::name(p->getId()).c_str() <<endl; 00363 report(INFO,"EvtGen") << "Now printing parent and/or grandparent tree\n"; 00364 if ( p->getParent() ) { 00365 if ( p->getParent()->getParent() ) { 00366 p->getParent()->getParent()->printTree(); 00367 report(INFO,"EvtGen") << p->getParent()->getParent()->mass() <<endl; 00368 report(INFO,"EvtGen") << p->getParent()->mass() <<endl; 00369 } 00370 else{ 00371 p->getParent()->printTree(); 00372 report(INFO,"EvtGen") << p->getParent()->mass() <<endl; 00373 } 00374 } 00375 else p->printTree(); 00376 report(INFO,"EvtGen") << "maxokmass=" << maxOkMass << " " << EvtPDL::getMinMass(p->getId()) << " " << EvtPDL::getMaxMass(p->getId())<<endl; 00377 if ( p->getNDaug() ) { 00378 for (i=0; i<p->getNDaug(); i++) { 00379 report(INFO,"EvtGen") << p->getDaug(i)->mass()<<" "; 00380 } 00381 report(INFO,"EvtGen") << endl; 00382 } 00383 if ( maxOkMass >= EvtPDL::getMinMass(p->getId()) ) { 00384 report(INFO,"EvtGen") << "taking a default value\n"; 00385 p->setMass(maxOkMass); 00386 return; 00387 } 00388 assert(0); 00389 } 00390 mass = EvtPDL::getMass(p->getId()); 00391 //Just need to check that this mass is > than 00392 //the mass of all daughters 00393 double massSum=0.; 00394 if ( p->getNDaug() ) { 00395 for (i=0; i<p->getNDaug(); i++) { 00396 massSum+= p->getDaug(i)->mass(); 00397 } 00398 } 00399 //some special cases are handled with 0 (stable) or 1 (k0->ks/kl) daughters 00400 if (p->getNDaug()<2) massOk=true; 00401 if ( p->getParent() ) { 00402 if ( p->getParent()->getNDaug()==1 ) massOk=true; 00403 } 00404 if ( !massOk ) { 00405 if (massSum < mass) massOk=true; 00406 if ( mass> maxOkMass) massOk=false; 00407 } 00408 } 00409 00410 p->setMass(mass); 00411 00412 }
|
|
00416 { 00417 00418 int i; 00419 double mass_sum; 00420 00421 int count=0; 00422 00423 if (!( p->firstornot() )) { 00424 for (i = 0; i < ndaugs; i++ ) { 00425 masses[i] = p->getDaug(i)->mass(); 00426 } //for 00427 } //if 00428 else { 00429 p->setFirstOrNot(); 00430 // if only one daughter do it 00431 00432 if (ndaugs==1) { 00433 masses[0]=p->mass(); 00434 return; 00435 } 00436 00437 //until we get a combo whose masses are less than _parent mass. 00438 do { 00439 mass_sum = 0.0; 00440 00441 for (i = 0; i < ndaugs; i++ ) { 00442 masses[i] = EvtPDL::getMass(daugs[i]); 00443 mass_sum = mass_sum + masses[i]; 00444 } 00445 00446 count++; 00447 00448 00449 if(count==10000) { 00450 report(ERROR,"EvtGen") <<"Decaying particle:"<< 00451 EvtPDL::name(p->getId()).c_str()<<" (m="<<p->mass()<<")"<<endl; 00452 report(ERROR,"EvtGen") <<"To the following daugthers"<<endl; 00453 for (i = 0; i < ndaugs; i++ ) { 00454 report(ERROR,"EvtGen") << 00455 EvtPDL::name(daugs[i]).c_str() << endl; 00456 } 00457 report(ERROR,"EvtGen") << "Has been rejected "<<count 00458 << " times, will now take minimal masses " 00459 << " of daugthers"<<endl; 00460 00461 mass_sum=0.; 00462 for (i = 0; i < ndaugs; i++ ) { 00463 masses[i] = EvtPDL::getMinMass(daugs[i]); 00464 mass_sum = mass_sum + masses[i]; 00465 } 00466 if (mass_sum > p->mass()){ 00467 report(ERROR,"EvtGen") << "Parent mass="<<p->mass() 00468 << "to light for daugthers."<<endl 00469 << "Will throw the event away."<<endl; 00470 //dont terminate - start over on the event. 00471 EvtStatus::setRejectFlag(); 00472 mass_sum=0.; 00473 // ::abort(); 00474 } 00475 00476 } 00477 } while ( mass_sum > p->mass()); 00478 } //else 00479 00480 return; 00481 }
|
|
00312 { 00313 00314 00315 double maxOkMass=EvtPDL::getMaxMass(p->getId()); 00316 00317 //protect against vphotons 00318 if ( maxOkMass < 0.0000000001 ) return 10000000.; 00319 //and against already determined masses 00320 if ( p->hasValidP4() ) maxOkMass=p->mass(); 00321 00322 EvtParticle *par=p->getParent(); 00323 if ( par ) { 00324 double maxParMass=findMaxMass(par); 00325 int i; 00326 double minDaugMass=0.; 00327 for(i=0;i<par->getNDaug();i++){ 00328 EvtParticle *dau=par->getDaug(i); 00329 if ( dau!=p) { 00330 // it might already have a mass 00331 if ( dau->isInitialized() || dau->hasValidP4() ) 00332 minDaugMass+=dau->mass(); 00333 else 00334 //give it a bit of phase space 00335 minDaugMass+=1.000001*EvtPDL::getMinMass(dau->getId()); 00336 } 00337 } 00338 if ( maxOkMass>(maxParMass-minDaugMass)) maxOkMass=maxParMass-minDaugMass; 00339 } 00340 return maxOkMass; 00341 }
|
|
00381 { 00382 00383 //special case for now to handle the tau polarization 00384 00385 int ndaug=p->getNDaug(); 00386 00387 int i; 00388 00389 // static EvtId tau=EvtPDL::getId("tau-"); 00390 static EvtId tau=getParentId(); 00391 00392 for(i=0;i<ndaug;i++){ 00393 if(p->getDaug(i)->getId()==tau){ 00394 00395 EvtSpinDensity rho; 00396 00397 rho.SetDim(2); 00398 rho.Set(0,0,1.0); 00399 rho.Set(0,1,0.0); 00400 00401 rho.Set(1,0,0.0); 00402 rho.Set(1,1,1.0); 00403 00404 00405 EvtVector4R p4Psi=p->getDaug(i)->getP4(); 00406 00407 double alpha=atan2(p4Psi.get(2),p4Psi.get(1)); 00408 double beta=acos(p4Psi.get(3)/p4Psi.d3mag()); 00409 00410 00411 p->getDaug(i)->setSpinDensityForwardHelicityBasis(rho,alpha,beta,0.0); 00412 setDaughterSpinDensity(i); 00413 00414 } 00415 } 00416 00417 }
|
|
00565 { 00566 00567 // Verify string 00568 00569 const char* str = _args[j].c_str(); 00570 int i = 0; 00571 while(str[i]!=0){ 00572 if (isalpha(str[i]) && str[i]!='e') { 00573 00574 report(INFO,"EvtGen") << "String " << str << " is not a number" << endl; 00575 assert(0); 00576 } 00577 i++; 00578 } 00579 00580 char** tc=0; 00581 return strtod(_args[j].c_str(),tc); 00582 }
|
|
00548 { 00549 00550 if ( _argsD ) return _argsD; 00551 //The user has asked for a list of doubles - the arguments 00552 //better all be doubles... 00553 if ( _narg==0 ) return _argsD; 00554 00555 _argsD = new double[_narg]; 00556 00557 int i; 00558 char * tc; 00559 for(i=0;i<_narg;i++) { 00560 _argsD[i] = strtod(_args[i].c_str(),&tc); 00561 } 00562 return _argsD; 00563 }
|
|
00073 {return _args;}
|
|
00075 {return _args[j];}
|
|
00061 {return _brfr;}
|
|
00066 {return _daug[i];}
|
|
00065 {return _daug;}
|
|
00077 {return _dsum; }
|
|
00076 {return _modelname; }
|
|
Implements EvtDecayBase. 00097 {
00098
00099 model_name="TAUOLA";
00100
00101 }
|
|
00067 {return _narg;}
|
|
00064 {return _ndaug;}
|
|
00060 {return _parent;}
|
|
00068 {return _photos;}
|
|
00067 { 00068 00069 int i; 00070 00071 //diagnostics 00072 sum_prob+=prob; 00073 if (prob>max_prob) max_prob=prob; 00074 00075 00076 if ( defaultprobmax && ntimes_prob<=500 ) { 00077 //We are building up probmax with this iteration 00078 ntimes_prob += 1; 00079 if ( prob > probmax ) { probmax = prob;} 00080 if (ntimes_prob==500) { 00081 probmax*=1.2; 00082 } 00083 return 1000000.0*prob; 00084 } 00085 00086 if ( prob> probmax*1.0001) { 00087 00088 report(INFO,"EvtGen") << "prob > probmax:("<<prob<<">"<<probmax<<")"; 00089 report(INFO,"") << "("<<_modelname.c_str()<<") "; 00090 report(INFO,"") << EvtPDL::name(_parent).c_str()<<" -> "; 00091 for(i=0;i<_ndaug;i++){ 00092 report(INFO,"") << EvtPDL::name(_daug[i]).c_str() << " "; 00093 } 00094 report(INFO,"") << endl; 00095 00096 if (defaultprobmax) probmax = prob; 00097 00098 } 00099 00100 ntimes_prob += 1; 00101 00102 00103 return probmax; 00104 00105 } //getProbMax
|
|
Reimplemented from EvtDecayBase. 00117 { 00118 00119 // checkNArg(1); 00120 00121 00122 if (getParentId().isAlias()){ 00123 00124 report(ERROR,"EvtGen") << "EvtTauola finds that you are decaying the"<<endl 00125 << " aliased particle " 00126 << EvtPDL::name(getParentId()).c_str() 00127 << " with the Tauola model"<<endl 00128 << " this does not work, please modify decay table." 00129 << endl; 00130 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl; 00131 ::abort(); 00132 00133 } 00134 00135 store(this); 00136 // std::cout<<"Tauola initialization"<<std::endl; 00137 00138 }
|
|
Reimplemented from EvtDecayBase. 00110 { 00111 00112 noProbMax(); 00113 00114 }
|
|
00041 {return spinDensitySet[daughter];}
|
|
Implements EvtDecayBase. 00030 { 00031 00032 int i; 00033 //initialize this the hard way.. 00034 //Lange June 26, 2000 00035 for (i=0; i<MAX_DAUG; i++ ) { spinDensitySet[i]=0;} 00036 _daugsDecayedByParentModel=false; 00037 00038 decay(p); 00039 p->setDecayProb(1.); 00040 00041 EvtSpinDensity rho; 00042 00043 rho.SetDiag(p->getSpinStates()); 00044 00045 p->setSpinDensityBackward(rho); 00046 00047 if (getPHOTOS() || EvtRadCorr::alwaysRadCorr()) { 00048 EvtRadCorr::doRadCorr(p); 00049 } 00050 00051 //Now decay the daughters. 00052 00053 if ( !daugsDecayedByParentModel()) { 00054 00055 for(i=0;i<p->getNDaug();i++){ 00056 //Need to set the spin density of the daughters to be 00057 //diagonal. 00058 rho.SetDiag(p->getDaug(i)->getSpinStates()); 00059 //if (p->getDaug(i)->getNDaug()==0){ 00060 //only do this if the user has not already set the 00061 //spin density matrix herself. 00062 //Lange June 26, 2000 00063 if ( isDaughterSpinDensitySet(i)==0 ) { 00064 p->getDaug(i)->setSpinDensityForward(rho); 00065 } 00066 else{ 00067 //report(INFO,"EvtGen") << "spinDensitymatrix already set!!!\n"; 00068 EvtSpinDensity temp=p->getDaug(i)->getSpinDensityForward(); 00069 // report(INFO,"EvtGen") <<temp<<endl; 00070 } 00071 //Now decay the daughter. Really! 00072 p->getDaug(i)->decay(); 00073 //} 00074 } 00075 } 00076 00077 }
|
|
00588 { 00589 00590 if ( _ndaug != other._ndaug) return false; 00591 if ( _parent != other._parent) return false; 00592 00593 std::vector<int> useDs; 00594 for ( unsigned int i=0; i<_ndaug; i++) useDs.push_back(0); 00595 00596 for ( unsigned int i=0; i<_ndaug; i++) { 00597 bool foundIt=false; 00598 for ( unsigned int j=0; j<_ndaug; j++) { 00599 if ( useDs[j] == 1 ) continue; 00600 if ( _daug[i] == other._daug[j] && _daug[i].getAlias() == other._daug[j].getAlias()) { 00601 foundIt=true; 00602 useDs[j]=1; 00603 break; 00604 } 00605 } 00606 if ( foundIt==false) return false; 00607 } 00608 for ( unsigned int i=0; i<_ndaug; i++) if ( useDs[i]==0) return false; 00609 00610 return true; 00611 00612 }
|
|
00305 { 00306 00307 defaultprobmax=0; 00308 00309 }
|
|
Reimplemented in EvtBtoKD3P, and EvtVSSBMixCPT. 00105 { return _ndaug;}
|
|
00259 { 00260 00261 int i; 00262 00263 if (ntimes_prob>0) { 00264 00265 report(INFO,"EvtGen") << "Calls="<<ntimes_prob<<" eff:"<< 00266 sum_prob/(probmax*ntimes_prob)<<" frac. max:"<<max_prob/probmax; 00267 report(INFO,"") <<" probmax:"<<probmax<<" max:"<<max_prob<<" : "; 00268 } 00269 00270 report(INFO,"") << EvtPDL::name(_parent).c_str()<<" -> "; 00271 for(i=0;i<_ndaug;i++){ 00272 report(INFO,"") << EvtPDL::name(_daug[i]).c_str() << " "; 00273 } 00274 report(INFO,"") << " ("<<_modelname.c_str()<<"):"<< endl; 00275 00276 00277 00278 }
|
|
00108 { 00109 00110 report(INFO,"EvtGen") << "Reseting prob max\n"; 00111 report(INFO,"EvtGen") << "prob > probmax:("<<prob<<">"<<probmax<<")"; 00112 report(INFO,"") << "("<<_modelname.c_str()<<")"; 00113 report(INFO,"") << EvtPDL::getStdHep(_parent)<<"->"; 00114 00115 for( int i=0;i<_ndaug;i++){ 00116 report(INFO,"") << EvtPDL::getStdHep(_daug[i]) << " "; 00117 } 00118 report(INFO,"") << endl; 00119 00120 probmax = 0.0; 00121 defaultprobmax = 0; 00122 ntimes_prob = 0; 00123 00124 return prob; 00125 00126 }
|
|
00170 { 00171 00172 int i; 00173 00174 _brfr=brfr; 00175 _ndaug=ndaug; 00176 _narg=narg; 00177 _parent=ipar; 00178 00179 _dsum=0; 00180 00181 if (_ndaug>0) { 00182 _daug=new EvtId [_ndaug]; 00183 for(i=0;i<_ndaug;i++){ 00184 _daug[i]=daug[i]; 00185 _dsum+=daug[i].getAlias(); 00186 } 00187 } 00188 else{ 00189 _daug=0; 00190 } 00191 00192 if (_narg>0) { 00193 _args=new std::string[_narg+1]; 00194 for(i=0;i<_narg;i++){ 00195 _args[i]=args[i]; 00196 } 00197 } 00198 else{ 00199 _args = 0; 00200 } 00201 00202 _modelname=name; 00203 00204 this->init(); 00205 this->initProbMax(); 00206 00207 if (_chkCharge){ 00208 this->checkQ(); 00209 } 00210 00211 00212 if (defaultprobmax){ 00213 report(INFO,"EvtGen") << "No default probmax for "; 00214 report(INFO,"") << "("<<_modelname.c_str()<<") "; 00215 report(INFO,"") << EvtPDL::name(_parent).c_str()<<" -> "; 00216 for(i=0;i<_ndaug;i++){ 00217 report(INFO,"") << EvtPDL::name(_daug[i]).c_str() << " "; 00218 } 00219 report(INFO,"") << endl; 00220 report(INFO,"") << "This is fine for development, but must be provided for production."<<endl; 00221 report(INFO,"EvtGen") << "Never fear though - the decay will use the \n"; 00222 report(INFO,"EvtGen") << "500 iterations to build up a good probmax \n"; 00223 report(INFO,"EvtGen") << "before accepting a decay. "<<endl; 00224 } 00225 00226 }
|
|
00038 { spinDensitySet[daughter]=1; return;}
|
|
00069 {_photos=1;}
|
|
00298 { 00299 00300 defaultprobmax=0; 00301 probmax=prbmx; 00302 00303 }
|
|
00071 {_summary=1;}
|
|
00070 {_verbose=1;}
|
|
00419 { 00420 00421 if (ntauoladecays==ntable){ 00422 00423 EvtDecayBasePtr* newtauoladecays=new EvtDecayBasePtr[2*ntable+10]; 00424 int i; 00425 for(i=0;i<ntable;i++){ 00426 newtauoladecays[i]=tauoladecays[i]; 00427 } 00428 ntable=2*ntable+10; 00429 delete [] tauoladecays; 00430 tauoladecays=newtauoladecays; 00431 } 00432 00433 tauoladecays[ntauoladecays++]=jsdecay; 00434 00435 00436 00437 }
|
|
00078 {return _summary; }
|
|
00079 {return _verbose; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|