//-------------------------------------------------------------------------- // // Environment: // This software is part of the EvtGen package developed jointly // for the BaBar and CLEO collaborations. If you use all or part // of it, please give an appropriate acknowledgement. // // Copyright Information: See EvtGen/COPYRIGHT // Copyright (C) 1998 Caltech, UCSB // // Module: EvtGenKine.cc // // Description: Tools for generating distributions of four vectors in // phasespace // // Modification history: // // DJL/RYD September 25, 1996 Module created // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include #include "EvtGenBase/EvtGenKine.hh" #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtConst.hh" #include using std::endl; double EvtPawt(double a,double b,double c) { double temp=(a*a-(b+c)*(b+c))*(a*a-(b-c)*(b-c)); if (temp<=0) { //report(ERROR,"EvtGen")<<"Sqrt of negative number in EvtPhaseSpace\n"<< // "This seems to happen on AIX but I do not know why yet!"<wtmax) { report(ERROR,"EvtGen") << "wtmax to small in EvtPhaseSpace with " << ndaug <<" daughters"<EvtRandom::Flat()){ m12sq=EvtRandom::Flat(m12sqmin,m12sqmax); } else{ m12sq=1.0/(1.0/m12sqmin-EvtRandom::Flat()*(1.0/m12sqmin-1.0/m12sqmax)); } //kinematically allowed? double E3star=(M*M-m12sq-m3*m3)/sqrt(4*m12sq); double E1star=(m12sq+m1*m1-m2*m2)/sqrt(4*m12sq); double p3star=sqrt(E3star*E3star-m3*m3); double p1star=sqrt(E1star*E1star-m1*m1); m13max=(E3star+E1star)*(E3star+E1star)- (p3star-p1star)*(p3star-p1star); m13min=(E3star+E1star)*(E3star+E1star)- (p3star+p1star)*(p3star+p1star); }while(m13sqm13max); double E2=(M*M+m2*m2-m13sq)/(2.0*M); double E3=(M*M+m3*m3-m12sq)/(2.0*M); double E1=M-E2-E3; double p1mom=sqrt(E1*E1-m1*m1); double p3mom=sqrt(E3*E3-m3*m3); double cost13=(2.0*E1*E3+m1*m1+m3*m3-m13sq)/(2.0*p1mom*p3mom); //report(INFO,"EvtGen") << m13sq << endl; //report(INFO,"EvtGen") << m12sq << endl; //report(INFO,"EvtGen") << E1 << endl; //report(INFO,"EvtGen") << E2 << endl; //report(INFO,"EvtGen") << E3 << endl; //report(INFO,"EvtGen") << p1mom << endl; //report(INFO,"EvtGen") << p3mom << endl; //report(INFO,"EvtGen") << cost13 << endl; p4[2].set(E3,0.0,0.0,p3mom); p4[0].set(E1,p1mom*sqrt(1.0-cost13*cost13),0.0,p1mom*cost13); p4[1].set(E2,-p1mom*sqrt(1.0-cost13*cost13),0.0,-p1mom*cost13-p3mom); //report(INFO,"EvtGen") << "p4:"<