00001 //-------------------------------------------------------------------------- 00002 // 00003 // Environment: 00004 // This software is part of the EvtGen package developed jointly 00005 // for the BaBar and CLEO collaborations. If you use all or part 00006 // of it, please give an appropriate acknowledgement. 00007 // 00008 // Copyright Information: See EvtGen/COPYRIGHT 00009 // Copyright (C) 1998 Caltech, UCSB 00010 // 00011 // Module: EvtPhsp.cc 00012 // 00013 // Description: Routine to decay a particle according th phase space 00014 // 00015 // Modification history: 00016 // 00017 // RYD January 8, 1997 Module created 00018 // 00019 //------------------------------------------------------------------------ 00020 // 00021 #include "EvtGenBase/EvtPatches.hh" 00022 #include <stdlib.h> 00023 #include "EvtGenBase/EvtParticle.hh" 00024 #include "EvtGenBase/EvtGenKine.hh" 00025 #include "EvtGenBase/EvtPDL.hh" 00026 #include "EvtGenBase/EvtReport.hh" 00027 #include "EvtGenModels/EvtPhsp.hh" 00028 #include "EvtGenModels/EvtGlobalSet.hh" 00029 #include <string> 00030 00031 EvtPhsp::~EvtPhsp() {} 00032 00033 void EvtPhsp::getName(std::string& model_name){ 00034 00035 model_name="PHSP"; 00036 00037 } 00038 00039 EvtDecayBase* EvtPhsp::clone(){ 00040 00041 return new EvtPhsp; 00042 00043 } 00044 00045 00046 void EvtPhsp::init(){ 00047 00048 // check that there are 0 arguments 00049 checkNArg(0); 00050 00051 } 00052 00053 void EvtPhsp::initProbMax(){ 00054 00055 noProbMax(); 00056 00057 } 00058 00059 void EvtPhsp::decay( EvtParticle *p ){ 00060 00061 //unneeded - lange - may13-02 00062 //if ( p->getNDaug() != 0 ) { 00063 //Will end up here because maxrate multiplies by 1.2 00064 // report(DEBUG,"EvtGen") << "In EvtPhsp: has " 00065 // <<" daugthers should not be here!"<<endl; 00066 // return; 00067 //} 00068 EvtFilter: 00069 double weight = p->initializePhaseSpace(getNDaug(),getDaugs()); 00070 // std::cout<<"weight= "<<weight<<std::endl; 00071 if(!EvtGlobalSet::iVV.size()) return; 00072 00073 for(int i=0;i<EvtGlobalSet::iVV.size();i++){ 00074 EvtVector4R psum(0,0,0,0); 00075 for(int j=0;j<EvtGlobalSet::iVV[i].size();j++){ 00076 int idx =EvtGlobalSet::iVV[i][j]; 00077 psum += p->getDaug(idx)->getP4(); 00078 //debugging 00079 //std::cout<<idx<<std::endl; 00080 } 00081 double xmass=psum.mass(); 00082 //std::cout<<xmass<<" "<<EvtGlobalSet::dVV[i][0]<<" "<<EvtGlobalSet::dVV[i][1]<<std::endl; 00083 if(xmass<EvtGlobalSet::dVV[i][0] || xmass>EvtGlobalSet::dVV[i][1]) goto EvtFilter; 00084 } 00085 00086 return ; 00087 } 00088 00089