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
11 // Module: EvtLineShape.cc
13 // Description: Store particle properties for one particle.
15 // Modification history:
17 // Lange March 10, 2001 Module created
18 // Dvoretskii June 03, 2002 Reimplemented rollMass()
20 //------------------------------------------------------------------------
21 #include "EvtGenBase/EvtPatches.hh"
23 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtManyDeltaFuncLineShape.hh"
25 #include "EvtGenBase/EvtRandom.hh"
26 #include "EvtGenBase/EvtTwoBodyVertex.hh"
27 #include "EvtGenBase/EvtBlattWeisskopf.hh"
28 #include "EvtGenBase/EvtPropBreitWignerRel.hh"
29 #include "EvtGenBase/EvtPropBreitWigner.hh"
30 #include "EvtGenBase/EvtPDL.hh"
31 #include "EvtGenBase/EvtSpinType.hh"
33 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape() {
37 EvtManyDeltaFuncLineShape::~EvtManyDeltaFuncLineShape() {
40 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(double mass, double width, double maxRange, EvtSpinType::spintype sp) {
47 double maxdelta = width;
49 _massMax=mass+maxdelta;
50 _massMin=mass-maxdelta;
52 if ( _massMin< 0. ) _massMin=0.;
56 EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(const EvtManyDeltaFuncLineShape& x):
57 EvtAbsLineShape( x ) {
63 _maxRange=x._maxRange;
67 EvtManyDeltaFuncLineShape& EvtManyDeltaFuncLineShape::operator=(const EvtManyDeltaFuncLineShape& x){
72 _maxRange=x._maxRange;
78 EvtAbsLineShape* EvtManyDeltaFuncLineShape::clone() {
80 return new EvtManyDeltaFuncLineShape(*this);
84 double EvtManyDeltaFuncLineShape::getMassProb(double mass, double massPar,int nDaug, double *massDau) {
90 for (i=0; i<nDaug; i++) {
93 if ( (mass<dTotMass) ) return 0.;
95 if ( massPar>0.0000000001 ) {
96 if ( mass > massPar) return 0.;
102 double EvtManyDeltaFuncLineShape::getRandMass(EvtId*,int, EvtId*, EvtId*, double, double *) {
104 int nDelta = int((_massMax - _massMin)/_width);
106 double rand=EvtRandom::Flat(0.,float(nDelta));
108 return _massMin+randI*_width;