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
13 // Description: Routine to decay a particle according th phase space
15 // Modification history:
17 // RYD January 8, 1997 Module created
19 //------------------------------------------------------------------------
21 #include "EvtGenBase/EvtPatches.hh"
23 #include "EvtGenBase/EvtParticle.hh"
24 #include "EvtGenBase/EvtGenKine.hh"
25 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtReport.hh"
27 #include "EvtGenModels/EvtDMix.hh"
28 #include "EvtGenBase/EvtRandom.hh"
31 EvtDMix::~EvtDMix() {}
33 std::string EvtDMix::getName(){
39 EvtDecayBase* EvtDMix::clone(){
48 // check that there are 0 arguments
55 void EvtDMix::initProbMax(){
61 void EvtDMix::decay( EvtParticle *p ){
63 //unneeded - lange - may13-02
64 //if ( p->getNDaug() != 0 ) {
65 //Will end up here because maxrate multiplies by 1.2
66 // report(DEBUG,"EvtGen") << "In EvtDMix: has "
67 // <<" daugthers should not be here!"<<endl;
71 p->initializePhaseSpace(getNDaug(),getDaugs());
73 double ctau=EvtPDL::getctau(p->getId());
74 if ( ctau==0. ) return;
77 double pdf, random, gt, weight;
79 double maxPdf=_rd + sqrt(_rd)*_ypr*50. + 2500.0*(_xpr*_xpr+_ypr*_ypr)/4.0;
82 random=EvtRandom::Flat();
85 pdf=_rd + sqrt(_rd)*_ypr*gt + gt*gt*(_xpr*_xpr+_ypr*_ypr)/4.0;
89 std::cout << pdf << " " << weight << " " << maxPdf << " " << gt << std::endl;
90 if ( pdf > maxPdf*EvtRandom::Flat()) keepGoing=false;
94 p->setLifetime(gt*ctau);