BOSS 8.0.0
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() [2/3]

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

Definition at line 42 of file EvtAbsLineShape.cc.

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

◆ ~EvtAbsLineShape()

EvtAbsLineShape::~EvtAbsLineShape ( )
virtual

Definition at line 40 of file EvtAbsLineShape.cc.

40{}

◆ EvtAbsLineShape() [3/3]

EvtAbsLineShape::EvtAbsLineShape ( const EvtAbsLineShape & x)

Definition at line 70 of file EvtAbsLineShape.cc.

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

Member Function Documentation

◆ addFactorPn()

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

Definition at line 72 of file EvtAbsLineShape.hh.

72{ _addFactorPn = factor; }

Referenced by EvtRelBreitWignerBarrierFact::getRandMass().

◆ clone()

EvtAbsLineShape * EvtAbsLineShape::clone ( )
virtual

Reimplemented in EvtFlatLineShape, EvtManyDeltaFuncLineShape, and EvtRelBreitWignerBarrierFact.

Definition at line 97 of file EvtAbsLineShape.cc.

97{ return new EvtAbsLineShape( *this ); }

Referenced by EvtPartProp::operator=().

◆ fixForSP8()

void EvtAbsLineShape::fixForSP8 ( )
inline

Definition at line 89 of file EvtAbsLineShape.hh.

89{ _applyFixForSP8 = true; }

◆ getMass()

double EvtAbsLineShape::getMass ( )
inline

Definition at line 40 of file EvtAbsLineShape.hh.

40{ return _mass; }

◆ getMassMax()

double EvtAbsLineShape::getMassMax ( )
inline

Definition at line 42 of file EvtAbsLineShape.hh.

42{ return _massMax; }

◆ getMassMin()

double EvtAbsLineShape::getMassMin ( )
inline

Definition at line 41 of file EvtAbsLineShape.hh.

41{ return _massMin; }

◆ getMassProb()

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

Reimplemented in EvtFlatLineShape, EvtManyDeltaFuncLineShape, and EvtRelBreitWignerBarrierFact.

Definition at line 173 of file EvtAbsLineShape.cc.

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

Referenced by EvtRelBreitWignerBarrierFact::getMassProb().

◆ getMaxRange()

double EvtAbsLineShape::getMaxRange ( )
inline

Definition at line 43 of file EvtAbsLineShape.hh.

43{ return _maxRange; }

◆ 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 115 of file EvtAbsLineShape.cc.

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

Referenced by EvtRelBreitWignerBarrierFact::getRandMass().

◆ getSpinType()

EvtSpinType::spintype EvtAbsLineShape::getSpinType ( )
inline

Definition at line 45 of file EvtAbsLineShape.hh.

45{ return _spin; }

◆ getWidth()

double EvtAbsLineShape::getWidth ( )
inline

Definition at line 44 of file EvtAbsLineShape.hh.

44{ return _width; }

◆ includeBirthFactor()

void EvtAbsLineShape::includeBirthFactor ( bool yesno)
inline

Definition at line 71 of file EvtAbsLineShape.hh.

71{ _includeBirthFact = yesno; }

◆ includeDecayFactor()

void EvtAbsLineShape::includeDecayFactor ( bool yesno)
inline

Definition at line 73 of file EvtAbsLineShape.hh.

73{ _includeDecayFact = yesno; }

◆ operator=()

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

Definition at line 83 of file EvtAbsLineShape.cc.

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

◆ reSetBlatt()

virtual void EvtAbsLineShape::reSetBlatt ( double blatt)
inlinevirtual

Reimplemented in EvtRelBreitWignerBarrierFact.

Definition at line 70 of file EvtAbsLineShape.hh.

70{};

◆ reSetMass()

void EvtAbsLineShape::reSetMass ( double mass)
inline

Definition at line 49 of file EvtAbsLineShape.hh.

49{ _mass = mass; }

◆ reSetMassMax()

void EvtAbsLineShape::reSetMassMax ( double mass)
inline

Definition at line 69 of file EvtAbsLineShape.hh.

69{ _massMax = mass; }

◆ reSetMassMin()

void EvtAbsLineShape::reSetMassMin ( double mass)
inline

Definition at line 68 of file EvtAbsLineShape.hh.

68{ _massMin = mass; }

◆ reSetWidth()

void EvtAbsLineShape::reSetWidth ( double width)
inline

Definition at line 50 of file EvtAbsLineShape.hh.

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

◆ rollMass()

double EvtAbsLineShape::rollMass ( )
virtual

Definition at line 99 of file EvtAbsLineShape.cc.

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

◆ setPWForBirthL()

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

Definition at line 79 of file EvtAbsLineShape.hh.

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

◆ setPWForDecay()

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

Definition at line 74 of file EvtAbsLineShape.hh.

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

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 106 of file EvtAbsLineShape.hh.

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

◆ _userSetPWD1

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

Definition at line 105 of file EvtAbsLineShape.hh.

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

◆ _userSetPWD2

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

Definition at line 105 of file EvtAbsLineShape.hh.

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

◆ _width


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