BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAbsLineShape Class Reference

#include <EvtAbsLineShape.hh>

+ Inheritance diagram for EvtAbsLineShape:

Public Member Functions

 EvtAbsLineShape ()
 
 EvtAbsLineShape (double mass, double width, double maxRange, EvtSpinType::spintype sp)
 
virtual ~EvtAbsLineShape ()
 
EvtAbsLineShapeoperator= (const EvtAbsLineShape &x)
 
 EvtAbsLineShape (const EvtAbsLineShape &x)
 
double getMass ()
 
double getMassMin ()
 
double getMassMax ()
 
double getMaxRange ()
 
double getWidth ()
 
EvtSpinType::spintype getSpinType ()
 
virtual double rollMass ()
 
virtual EvtAbsLineShapeclone ()
 
void reSetMass (double mass)
 
void reSetWidth (double width)
 
void reSetMassMin (double mass)
 
void reSetMassMax (double mass)
 
virtual void reSetBlatt (double blatt)
 
void includeBirthFactor (bool yesno)
 
void addFactorPn (double factor=0.)
 
void includeDecayFactor (bool yesno)
 
void setPWForDecay (int spin, EvtId d1, EvtId d2)
 
void setPWForBirthL (int spin, EvtId par, EvtId othD)
 
virtual double getRandMass (EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
 
virtual double getMassProb (double mass, double massPar, int nDaug, double *massDau)
 
void fixForSP8 ()
 

Protected Attributes

bool _includeDecayFact
 
bool _includeBirthFact
 
double _addFactorPn
 
double _mass
 
double _massMin
 
double _massMax
 
double _width
 
double _maxRange
 
std::vector< EvtId_userSetPWD1
 
std::vector< EvtId_userSetPWD2
 
std::vector< int > _userSetPW
 
std::vector< EvtId_userSetBirthPar
 
std::vector< EvtId_userSetBirthOthD
 
std::vector< int > _userSetBirthPW
 
EvtSpinType::spintype _spin
 
bool _applyFixForSP8
 

Detailed Description

Definition at line 31 of file EvtAbsLineShape.hh.

Constructor & Destructor Documentation

◆ EvtAbsLineShape() [1/3]

EvtAbsLineShape::EvtAbsLineShape ( )

Definition at line 38 of file EvtAbsLineShape.cc.

38 {
39}

Referenced by clone().

◆ EvtAbsLineShape() [2/3]

EvtAbsLineShape::EvtAbsLineShape ( double  mass,
double  width,
double  maxRange,
EvtSpinType::spintype  sp 
)

Definition at line 44 of file EvtAbsLineShape.cc.

44 {
45
46 _includeDecayFact = false;
47 _includeBirthFact = false;
48 _applyFixForSP8 = false;
49 _mass=mass;
50 _width=width;
51 _spin=sp;
52 _maxRange=maxRange;
53 double maxdelta=15.0*width;
54 //if ( width>0.001 ) {
55 // if ( 5.0*width < 0.6 ) maxdelta = 0.6;
56 //}
57 if ( maxRange > 0.00001 ) {
58 _massMax=mass+maxdelta;
59 _massMin=mass-maxRange;
60 }
61 else{
62 _massMax=mass+maxdelta;
63 _massMin=mass-15.0*width;
64 }
65 if ( _massMin< 0. ) _massMin=0.;
66 _massMax=mass+maxdelta;
67}
double mass
EvtSpinType::spintype _spin

◆ ~EvtAbsLineShape()

EvtAbsLineShape::~EvtAbsLineShape ( )
virtual

Definition at line 41 of file EvtAbsLineShape.cc.

41 {
42}

◆ EvtAbsLineShape() [3/3]

EvtAbsLineShape::EvtAbsLineShape ( const EvtAbsLineShape x)

Definition at line 69 of file EvtAbsLineShape.cc.

69 {
70
71 _includeDecayFact = x._includeDecayFact;
72 _includeBirthFact = x._includeBirthFact;
73 _mass=x._mass;
74 _massMax=x._massMax;
75 _massMin=x._massMin;
76 _width=x._width;
77 _spin=x._spin;
78 _maxRange=x._maxRange;
79 _applyFixForSP8 = x._applyFixForSP8;
80}
double x[1000]

Member Function Documentation

◆ addFactorPn()

void EvtAbsLineShape::addFactorPn ( double  factor = 0.)
inline

Definition at line 71 of file EvtAbsLineShape.hh.

71{ _addFactorPn = factor;}

Referenced by EvtPartProp::addFactorPn(), and EvtRelBreitWignerBarrierFact::getRandMass().

◆ clone()

EvtAbsLineShape * EvtAbsLineShape::clone ( )
virtual

Reimplemented in EvtFlatLineShape, EvtManyDeltaFuncLineShape, and EvtRelBreitWignerBarrierFact.

Definition at line 96 of file EvtAbsLineShape.cc.

96 {
97
98 return new EvtAbsLineShape(*this);
99}

◆ fixForSP8()

void EvtAbsLineShape::fixForSP8 ( )
inline

Definition at line 87 of file EvtAbsLineShape.hh.

87{ _applyFixForSP8=true;}

Referenced by EvtPartProp::fixLSForSP8().

◆ getMass()

double EvtAbsLineShape::getMass ( )
inline

Definition at line 41 of file EvtAbsLineShape.hh.

41{return _mass;}

Referenced by EvtPartProp::getMass(), and EvtPartProp::newLineShape().

◆ getMassMax()

double EvtAbsLineShape::getMassMax ( )
inline

Definition at line 43 of file EvtAbsLineShape.hh.

43{return _massMax;}

Referenced by EvtPartProp::getMassMax().

◆ getMassMin()

double EvtAbsLineShape::getMassMin ( )
inline

Definition at line 42 of file EvtAbsLineShape.hh.

42{return _massMin;}

Referenced by EvtPartProp::getMassMin().

◆ getMassProb()

double EvtAbsLineShape::getMassProb ( double  mass,
double  massPar,
int  nDaug,
double *  massDau 
)
virtual

Reimplemented in EvtFlatLineShape, EvtManyDeltaFuncLineShape, and EvtRelBreitWignerBarrierFact.

Definition at line 171 of file EvtAbsLineShape.cc.

171 {
172
173 double dTotMass=0.;
174 if ( nDaug>1) {
175 int i;
176 for (i=0; i<nDaug; i++) {
177 dTotMass+=massDau[i];
178 }
179 //report(INFO,"EvtGen") << mass << " " << massPar << " " << dTotMass << " "<< endl;
180 // if ( (mass-dTotMass)<0.0001 ) return 0.;
181 if ( (mass<dTotMass) ) return 0.;
182 }
183 if ( _width< 0.0001) return 1.;
184
185 // no parent - lets not panic
186 if ( massPar>0.0000000001 ) {
187 if ( mass > massPar) return 0.;
188 }
189 //Otherwise return the right value.
190 //Fortunately we have generated events according to a non-rel BW, so
191 //just return..
192 //EvtPropBreitWigner bw(_mass,_width);
193 //EvtPropFactor<EvtTwoBodyVertex> f(bw);
194 //EvtComplex fm=f.eval(mass);
195 //EvtComplex fm0=f.eval(_mass);
196 //return (abs(fm)*abs(fm))/(abs(fm0)*abs(fm0));
197 return 1.0;
198}

Referenced by EvtPartProp::getMassProb(), and EvtRelBreitWignerBarrierFact::getMassProb().

◆ getMaxRange()

double EvtAbsLineShape::getMaxRange ( )
inline

Definition at line 44 of file EvtAbsLineShape.hh.

44{return _maxRange;}

Referenced by EvtPartProp::getMaxRange(), and EvtPartProp::newLineShape().

◆ getRandMass()

double EvtAbsLineShape::getRandMass ( EvtId parId,
int  nDaug,
EvtId dauId,
EvtId othDaugId,
double  maxMass,
double *  dauMasses 
)
virtual

Reimplemented in EvtFlatLineShape, EvtManyDeltaFuncLineShape, and EvtRelBreitWignerBarrierFact.

Definition at line 119 of file EvtAbsLineShape.cc.

119 {
120
121 if ( _width< 0.0001) return _mass;
122 //its not flat - but generated according to a BW
123
124 if (maxMass>0&&maxMass<_massMin) {
125 report(ERROR,"EvtGen") << "In EvtAbsLineShape::getRandMass"<<endl;
126 report(ERROR,"EvtGen") << "Decaying particle "<<EvtPDL::name(*parId)
127 << " with mass "<<maxMass<<endl;
128 report(ERROR,"EvtGen") << " to particle"
129 << " with a minimal mass of "<< _massMin<<endl;
130 }
131
132 double mMin=_massMin;
133 double mMax=_massMax;
134 if ( maxMass>-0.5 && maxMass< mMax) mMax=maxMass;
135 double ymin = atan( 2.0*(mMin-_mass)/_width);
136 double ymax = atan( 2.0*(mMax-_mass)/_width);
137
138 loop:
139 double themass = ( _mass + ((_width/2.0)*tan(EvtRandom::Flat(ymin,ymax))));
140
141 if(fabs(_addFactorPn)>0.00000001){// addFactorPn, pingrg-2010-1-10
142 double massOthD=EvtPDL::getMeanMass(*othDaugId);
143 double massParent=EvtPDL::getMeanMass(*parId);
144 double phsp,maxp,maxp1,maxp2;
145 if(themass+massOthD <massParent ){
146 EvtTwoBodyVertex vb(themass,massOthD,massParent,1.0);
147 phsp = vb.pD();
148 } else {return themass;}
149
150 if( (massOthD + mMax)< massParent){
151 EvtTwoBodyVertex vb1(massOthD,mMax,massParent,1);
152 EvtTwoBodyVertex vb2(massOthD,mMin,massParent,1);
153 maxp = vb1.pD();
154 maxp1 = pow(maxp,_addFactorPn*2.0);
155 maxp = vb2.pD();
156 maxp2= pow(maxp,_addFactorPn*2.0);
157 maxp = max(maxp1,maxp2);
158 }else {return themass;}
159
160 double wt = pow(phsp,_addFactorPn*2.0)/maxp;
161 double rdm = EvtRandom::Flat(0.0,1.0);
162
163 if(rdm> wt ) goto loop;
164
165 }
166
167 return themass;
168 // return EvtRandom::Flat(_massMin,_massMax);
169}
double tan(const BesAngle a)
Definition: BesAngle.h:216
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
static double getMeanMass(EvtId i)
Definition: EvtPDL.hh:45
static std::string name(EvtId i)
Definition: EvtPDL.hh:64
static double Flat()
Definition: EvtRandom.cc:74

Referenced by EvtRelBreitWignerBarrierFact::getRandMass(), and EvtPartProp::getRandMass().

◆ getSpinType()

EvtSpinType::spintype EvtAbsLineShape::getSpinType ( )
inline

Definition at line 46 of file EvtAbsLineShape.hh.

46{return _spin;}

Referenced by EvtPartProp::newLineShape().

◆ getWidth()

double EvtAbsLineShape::getWidth ( )
inline

Definition at line 45 of file EvtAbsLineShape.hh.

45{return _width;}

Referenced by EvtPartProp::getWidth(), and EvtPartProp::newLineShape().

◆ includeBirthFactor()

void EvtAbsLineShape::includeBirthFactor ( bool  yesno)
inline

Definition at line 70 of file EvtAbsLineShape.hh.

70{ _includeBirthFact = yesno; }

Referenced by EvtPartProp::includeBirthFactor().

◆ includeDecayFactor()

void EvtAbsLineShape::includeDecayFactor ( bool  yesno)
inline

Definition at line 72 of file EvtAbsLineShape.hh.

72{ _includeDecayFact = yesno; }

Referenced by EvtPartProp::includeDecayFactor().

◆ operator=()

EvtAbsLineShape & EvtAbsLineShape::operator= ( const EvtAbsLineShape x)

Definition at line 82 of file EvtAbsLineShape.cc.

82 {
83
84 _includeDecayFact = x._includeDecayFact;
85 _includeBirthFact = x._includeBirthFact;
86 _mass=x._mass;
87 _massMax=x._massMax;
88 _massMin=x._massMin;
89 _width=x._width;
90 _spin=x._spin;
91 _maxRange=x._maxRange;
92 _applyFixForSP8 = x._applyFixForSP8;
93 return *this;
94}

◆ reSetBlatt()

virtual void EvtAbsLineShape::reSetBlatt ( double  blatt)
inlinevirtual

Reimplemented in EvtRelBreitWignerBarrierFact.

Definition at line 69 of file EvtAbsLineShape.hh.

69{};

Referenced by EvtPartProp::reSetBlatt().

◆ reSetMass()

void EvtAbsLineShape::reSetMass ( double  mass)
inline

Definition at line 50 of file EvtAbsLineShape.hh.

50{ _mass=mass;}

Referenced by EvtPartProp::reSetMass().

◆ reSetMassMax()

void EvtAbsLineShape::reSetMassMax ( double  mass)
inline

Definition at line 68 of file EvtAbsLineShape.hh.

68{ _massMax=mass;}

Referenced by EvtPartProp::reSetMassMax().

◆ reSetMassMin()

void EvtAbsLineShape::reSetMassMin ( double  mass)
inline

Definition at line 67 of file EvtAbsLineShape.hh.

67{ _massMin=mass;}

Referenced by EvtPartProp::reSetMassMin().

◆ reSetWidth()

void EvtAbsLineShape::reSetWidth ( double  width)
inline

Definition at line 51 of file EvtAbsLineShape.hh.

51 {
52 _width=width;
53 // <--- added by L.L. Wang to fix a bug
54 double maxdelta=15.0*width;
55 if ( _maxRange > 0.00001 ) {
56 _massMax=_mass+maxdelta;
58 }
59 else{
60 _massMax=_mass+maxdelta;
61 _massMin=_mass-15.0*width;
62 }
63 if ( _massMin< 0. ) _massMin=0.;
64 _massMax=_mass+maxdelta;
65 // ---> //
66 }

Referenced by EvtPartProp::reSetWidth().

◆ rollMass()

double EvtAbsLineShape::rollMass ( )
virtual

Definition at line 102 of file EvtAbsLineShape.cc.

102 {
103
104 double ymin, ymax;
105 double temp;
106
107 if ( _width < 0.0001 ) {
108 return _mass;
109 }
110 else{
111 ymin = atan( 2.0*(_massMin-_mass)/_width);
112 ymax = atan( 2.0*(_massMax-_mass)/_width);
113
114 temp= ( _mass + ((_width/2.0)*tan(EvtRandom::Flat(ymin,ymax))));
115
116 return temp;
117 }
118}

Referenced by EvtPartProp::rollMass().

◆ setPWForBirthL()

void EvtAbsLineShape::setPWForBirthL ( int  spin,
EvtId  par,
EvtId  othD 
)
inline

Definition at line 78 of file EvtAbsLineShape.hh.

78 {
79 _userSetBirthPW.push_back(spin);
80 _userSetBirthOthD.push_back(othD);
81 _userSetBirthPar.push_back(par);
82 }
std::vector< EvtId > _userSetBirthOthD
std::vector< int > _userSetBirthPW
std::vector< EvtId > _userSetBirthPar

Referenced by EvtPartProp::setPWForBirthL().

◆ setPWForDecay()

void EvtAbsLineShape::setPWForDecay ( int  spin,
EvtId  d1,
EvtId  d2 
)
inline

Definition at line 73 of file EvtAbsLineShape.hh.

73 {
74 _userSetPW.push_back(spin);
75 _userSetPWD1.push_back(d1);
76 _userSetPWD2.push_back(d2);
77 }
std::vector< EvtId > _userSetPWD1
std::vector< int > _userSetPW
std::vector< EvtId > _userSetPWD2

Referenced by EvtPartProp::setPWForDecay().

Member Data Documentation

◆ _addFactorPn

double EvtAbsLineShape::_addFactorPn
protected

◆ _applyFixForSP8

bool EvtAbsLineShape::_applyFixForSP8
protected

◆ _includeBirthFact

◆ _includeDecayFact

◆ _mass

◆ _massMax

◆ _massMin

◆ _maxRange

◆ _spin

◆ _userSetBirthOthD

std::vector<EvtId> EvtAbsLineShape::_userSetBirthOthD
protected

◆ _userSetBirthPar

std::vector<EvtId> EvtAbsLineShape::_userSetBirthPar
protected

◆ _userSetBirthPW

std::vector<int> EvtAbsLineShape::_userSetBirthPW
protected

◆ _userSetPW

std::vector<int> EvtAbsLineShape::_userSetPW
protected

Definition at line 104 of file EvtAbsLineShape.hh.

Referenced by EvtRelBreitWignerBarrierFact::getRandMass(), and setPWForDecay().

◆ _userSetPWD1

std::vector<EvtId> EvtAbsLineShape::_userSetPWD1
protected

Definition at line 103 of file EvtAbsLineShape.hh.

Referenced by EvtRelBreitWignerBarrierFact::getRandMass(), and setPWForDecay().

◆ _userSetPWD2

std::vector<EvtId> EvtAbsLineShape::_userSetPWD2
protected

Definition at line 103 of file EvtAbsLineShape.hh.

Referenced by EvtRelBreitWignerBarrierFact::getRandMass(), and setPWForDecay().

◆ _width


The documentation for this class was generated from the following files: