00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "EvtGenBase/EvtPatches.hh"
00022
00023 #include "EvtGenBase/EvtPatches.hh"
00024 #include "EvtGenBase/EvtManyDeltaFuncLineShape.hh"
00025 #include "EvtGenBase/EvtRandom.hh"
00026 #include "EvtGenBase/EvtTwoBodyVertex.hh"
00027 #include "EvtGenBase/EvtBlattWeisskopf.hh"
00028 #include "EvtGenBase/EvtPropBreitWignerRel.hh"
00029 #include "EvtGenBase/EvtPropBreitWigner.hh"
00030 #include "EvtGenBase/EvtPDL.hh"
00031 #include "EvtGenBase/EvtSpinType.hh"
00032
00033 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape() {
00034
00035 }
00036
00037 EvtManyDeltaFuncLineShape::~EvtManyDeltaFuncLineShape() {
00038 }
00039
00040 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(double mass, double width, double maxRange, EvtSpinType::spintype sp) {
00041
00042 _mass=mass;
00043 _width=width;
00044 _spin=sp;
00045 _maxRange=maxRange;
00046
00047 double maxdelta = width;
00048
00049 _massMax=mass+maxdelta;
00050 _massMin=mass-maxdelta;
00051
00052 if ( _massMin< 0. ) _massMin=0.;
00053
00054 }
00055
00056 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(const EvtManyDeltaFuncLineShape& x) {
00057 _mass=x._mass;
00058 _width=x._width;
00059 _spin=x._spin;
00060 _massMax=x._massMax;
00061 _massMin=x._massMin;
00062 _maxRange=x._maxRange;
00063
00064 }
00065
00066 EvtManyDeltaFuncLineShape& EvtManyDeltaFuncLineShape::operator=(const EvtManyDeltaFuncLineShape& x){
00067 _mass=x._mass;
00068 _massMax=x._massMax;
00069 _massMin=x._massMin;
00070 _width=x._width;
00071 _maxRange=x._maxRange;
00072 _spin=x._spin;
00073 return *this;
00074
00075 }
00076
00077 EvtAbsLineShape* EvtManyDeltaFuncLineShape::clone() {
00078
00079 return new EvtManyDeltaFuncLineShape(*this);
00080 }
00081
00082
00083 double EvtManyDeltaFuncLineShape::getMassProb(double mass, double massPar,int nDaug, double *massDau) {
00084
00085
00086 double dTotMass=0.;
00087
00088 int i;
00089 for (i=0; i<nDaug; i++) {
00090 dTotMass+=massDau[i];
00091 }
00092 if ( (mass<dTotMass) ) return 0.;
00093
00094 if ( massPar>0.0000000001 ) {
00095 if ( mass > massPar) return 0.;
00096 }
00097
00098 return 1.;
00099 }
00100
00101 double EvtManyDeltaFuncLineShape::getRandMass(EvtId *parId,int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses) {
00102
00103 int nDelta = int((_massMax - _massMin)/_width);
00104 nDelta++;
00105 double rand=EvtRandom::Flat(0.,float(nDelta));
00106 int randI=int(rand);
00107 return _massMin+randI*_width;
00108 }
00109
00110
00111
00112