BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtRelBreitWignerBarrierFact Class Reference

#include <EvtRelBreitWignerBarrierFact.hh>

Inheritance diagram for EvtRelBreitWignerBarrierFact:

Public Member Functions

 EvtRelBreitWignerBarrierFact ()
 EvtRelBreitWignerBarrierFact (double mass, double width, double maxRange, EvtSpinType::spintype sp)
 ~EvtRelBreitWignerBarrierFact ()
EvtRelBreitWignerBarrierFactoperator= (const EvtRelBreitWignerBarrierFact &x)
 EvtRelBreitWignerBarrierFact (const EvtRelBreitWignerBarrierFact &x)
EvtAbsLineShapeclone ()
double getMassProb (double mass, double massPar, int nDaug, double *massDau)
double getRandMass (EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
virtual void reSetBlatt (double blatt)
Public Member Functions inherited from EvtAbsLineShape
 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 ()
void reSetMass (double mass)
void reSetWidth (double width)
void reSetMassMin (double mass)
void reSetMassMax (double mass)
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)
void fixForSP8 ()

Protected Attributes

double _blatt
bool _errorCond
Protected Attributes inherited from EvtAbsLineShape
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 27 of file EvtRelBreitWignerBarrierFact.hh.

Constructor & Destructor Documentation

◆ EvtRelBreitWignerBarrierFact() [1/3]

EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact ( )

Definition at line 36 of file EvtRelBreitWignerBarrierFact.cc.

36{}

Referenced by clone(), EvtRelBreitWignerBarrierFact(), and operator=().

◆ EvtRelBreitWignerBarrierFact() [2/3]

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

Definition at line 40 of file EvtRelBreitWignerBarrierFact.cc.

43 : EvtAbsLineShape( mass, width, maxRange, sp ) { // double mDaug1, double mDaug2, int l) {
44
45 _includeDecayFact = true;
46 _includeBirthFact = true;
47 _mass = mass;
48 _width = width;
49 _spin = sp;
50 _blatt = 3.0;
51 _maxRange = maxRange;
52 _errorCond = false;
53
54 double maxdelta = 15.0 * width;
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
67 _massMax = mass + maxdelta;
68 if ( _massMin < 0. ) _massMin = 0.;
69}
double mass
EvtSpinType::spintype _spin

◆ ~EvtRelBreitWignerBarrierFact()

EvtRelBreitWignerBarrierFact::~EvtRelBreitWignerBarrierFact ( )

Definition at line 38 of file EvtRelBreitWignerBarrierFact.cc.

38{}

◆ EvtRelBreitWignerBarrierFact() [3/3]

EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact ( const EvtRelBreitWignerBarrierFact & x)

Definition at line 71 of file EvtRelBreitWignerBarrierFact.cc.

73 : EvtAbsLineShape( x ) {
74 _massMax = x._massMax;
75 _massMin = x._massMin;
76 _blatt = x._blatt;
77 _maxRange = x._maxRange;
78 _includeDecayFact = x._includeDecayFact;
79 _includeBirthFact = x._includeBirthFact;
80 _errorCond = x._errorCond;
81}
Double_t x[10]

Member Function Documentation

◆ clone()

EvtAbsLineShape * EvtRelBreitWignerBarrierFact::clone ( )
virtual

Reimplemented from EvtAbsLineShape.

Definition at line 99 of file EvtRelBreitWignerBarrierFact.cc.

99 {
100
101 return new EvtRelBreitWignerBarrierFact( *this );
102}

◆ getMassProb()

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

Reimplemented from EvtAbsLineShape.

Definition at line 104 of file EvtRelBreitWignerBarrierFact.cc.

105 {
106
107 _errorCond = false;
108 // return EvtAbsLineShape::getMassProb(mass,massPar,nDaug,massDau);
109 if ( nDaug != 2 ) return EvtAbsLineShape::getMassProb( mass, massPar, nDaug, massDau );
110
111 double dTotMass = 0.;
112
113 int i;
114 for ( i = 0; i < nDaug; i++ ) { dTotMass += massDau[i]; }
115 // report(INFO,"EvtGen") << mass << " " << massPar << " " << dTotMass << " "<< endl;
116 // if ( (mass-dTotMass)<0.0001 ) return 0.;
117 // report(INFO,"EvtGen") << mass << " " << dTotMass << endl;
118 if ( ( mass < dTotMass ) ) return 0.;
119
120 if ( _width < 0.0001 ) return 1.;
121
122 if ( massPar > 0.0000000001 )
123 {
124 if ( mass > massPar ) return 0.;
125 }
126
127 if ( _errorCond ) return 0.;
128
129 // we did all the work in getRandMass
130 return 1.;
131}
virtual double getMassProb(double mass, double massPar, int nDaug, double *massDau)

◆ getRandMass()

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

Reimplemented from EvtAbsLineShape.

Definition at line 133 of file EvtRelBreitWignerBarrierFact.cc.

135 {
136 if ( nDaug != 2 )
137 {
138 if ( fabs( _addFactorPn ) > 0.00000001 ) EvtAbsLineShape::addFactorPn( _addFactorPn );
139 double themass =
140 EvtAbsLineShape::getRandMass( parId, nDaug, dauId, othDaugId, maxMass, dauMasses );
141 return themass;
142 }
143
144 if ( _width < 0.00001 ) return _mass;
145
146 // first figure out L - take the lowest allowed.
147
148 EvtSpinType::spintype spinD1 = EvtPDL::getSpinType( dauId[0] );
149 EvtSpinType::spintype spinD2 = EvtPDL::getSpinType( dauId[1] );
150
151 int t1 = EvtSpinType::getSpin2( spinD1 );
152 int t2 = EvtSpinType::getSpin2( spinD2 );
153 int t3 = EvtSpinType::getSpin2( _spin );
154
155 int Lmin = -10;
156
157 // the user has overridden the partial wave to use.
158 for ( int vC = 0; vC < _userSetPW.size(); vC++ )
159 {
160 if ( dauId[0] == _userSetPWD1[vC] && dauId[1] == _userSetPWD2[vC] )
161 Lmin = 2 * _userSetPW[vC];
162 if ( dauId[0] == _userSetPWD2[vC] && dauId[1] == _userSetPWD1[vC] )
163 Lmin = 2 * _userSetPW[vC];
164 }
165
166 // allow for special cases.
167 if ( Lmin < -1 )
168 {
169
170 // There are some things I don't know how to deal with
171 if ( t3 > 4 )
172 return EvtAbsLineShape::getRandMass( parId, nDaug, dauId, othDaugId, maxMass,
173 dauMasses );
174 if ( t1 > 4 )
175 return EvtAbsLineShape::getRandMass( parId, nDaug, dauId, othDaugId, maxMass,
176 dauMasses );
177 if ( t2 > 4 )
178 return EvtAbsLineShape::getRandMass( parId, nDaug, dauId, othDaugId, maxMass,
179 dauMasses );
180
181 // figure the min and max allowwed "spins" for the daughters state
182 Lmin = std::max( t3 - t2 - t1, std::max( t2 - t3 - t1, t1 - t3 - t2 ) );
183 if ( Lmin < 0 ) Lmin = 0;
184 assert( Lmin == 0 || Lmin == 2 || Lmin == 4 );
185 }
186
187 // double massD1=EvtPDL::getMeanMass(dauId[0]);
188 // double massD2=EvtPDL::getMeanMass(dauId[1]);
189 double massD1 = dauMasses[0];
190 double massD2 = dauMasses[1];
191
192 // I'm not sure how to define the vertex factor here - so retreat to nonRel code.
193 if ( ( massD1 + massD2 ) > _mass )
194 return EvtAbsLineShape::getRandMass( parId, nDaug, dauId, othDaugId, maxMass, dauMasses );
195
196 // parent vertex factor not yet implemented
197 double massOthD = -10.;
198 double massParent = -10.;
199 int birthl = -10;
200 if ( othDaugId )
201 {
202 EvtSpinType::spintype spinOth = EvtPDL::getSpinType( *othDaugId );
203 EvtSpinType::spintype spinPar = EvtPDL::getSpinType( *parId );
204
205 int tt1 = EvtSpinType::getSpin2( spinOth );
206 int tt2 = EvtSpinType::getSpin2( spinPar );
207 int tt3 = EvtSpinType::getSpin2( _spin );
208
209 // figure the min and max allowwed "spins" for the daughters state
210 if ( ( tt1 <= 4 ) && ( tt2 <= 4 ) )
211 {
212 birthl = std::max( tt3 - tt2 - tt1, std::max( tt2 - tt3 - tt1, tt1 - tt3 - tt2 ) );
213 if ( birthl < 0 ) birthl = 0;
214
215 massOthD = EvtPDL::getMeanMass( *othDaugId );
216 massParent = EvtPDL::getMeanMass( *parId );
217 }
218
219 // allow user to override
220 for ( size_t vC = 0; vC < _userSetBirthPW.size(); vC++ )
221 {
222 if ( *othDaugId == _userSetBirthOthD[vC] && *parId == _userSetBirthPar[vC] )
223 { birthl = 2 * _userSetBirthPW[vC]; }
224 }
225 }
226 double massM = _massMax;
227 if ( ( maxMass > -0.5 ) && ( maxMass < massM ) ) massM = maxMass;
228
229 // special case... if the parent mass is _fixed_ we can do a little better
230 // and only for a two body decay as that seems to be where we have problems
231
232 // Define relativistic propagator amplitude
233
234 EvtTwoBodyVertex vd( massD1, massD2, _mass, Lmin / 2 );
235 vd.set_f( _blatt );
236 EvtPropBreitWignerRel bw( _mass, _width );
237 EvtMassAmp amp( bw, vd );
238 if ( _includeDecayFact )
239 {
240 amp.addDeathFact();
241 amp.addDeathFactFF();
242 }
243
244 if ( fabs( _addFactorPn ) > 0.00000001 )
245 {
246 // std::cout<<"EvtRelBreitWignerBarrierFact "<< _addFactorPn<<std::endl;
247 amp.addFactorPn( _addFactorPn );
248 }
249 if ( massParent > -1. )
250 {
251 if ( _includeBirthFact )
252 {
253
254 EvtTwoBodyVertex vb( _mass, massOthD, massParent, birthl / 2 );
255 if ( _applyFixForSP8 ) vb.set_f( _blatt );
256 amp.setBirthVtx( vb );
257 amp.addBirthFact();
258 amp.addBirthFactFF();
259 }
260 }
261
262 EvtAmpPdf<EvtPoint1D> pdf( amp );
263
264 // Estimate maximum and create predicate for accept reject
265
266 double tempMaxLoc = _mass;
267 if ( maxMass > -0.5 && maxMass < _mass ) tempMaxLoc = maxMass;
268 double tempMax = _massMax;
269 if ( maxMass > -0.5 && maxMass < _massMax ) tempMax = maxMass;
270 double tempMinMass = _massMin;
271 if ( massD1 + massD2 > _massMin ) tempMinMass = massD1 + massD2;
272
273 // redo sanity check - is there a solution to our problem.
274 // if not return an error condition that is caught by the
275 // mass prob calculation above.
276 if ( tempMinMass > tempMax )
277 {
278 _errorCond = true;
279 return tempMinMass;
280 }
281
282 if ( tempMaxLoc < tempMinMass ) tempMaxLoc = tempMinMass;
283
284 double safetyFactor = 1.2;
285 if ( _applyFixForSP8 ) safetyFactor = 1.4;
286
287 EvtPdfMax<EvtPoint1D> max( safetyFactor *
288 pdf.evaluate( EvtPoint1D( tempMinMass, tempMax, tempMaxLoc ) ) );
289
290 EvtPdfPred<EvtPoint1D> pred( pdf );
291 pred.setMax( max );
292
293 EvtIntervalFlatPdf flat( tempMinMass, tempMax );
294 EvtPdfGen<EvtPoint1D> gen( flat );
295 EvtPredGen<EvtPdfGen<EvtPoint1D>, EvtPdfPred<EvtPoint1D>> predgen( gen, pred );
296
297 EvtPoint1D point = predgen();
298 return point.value();
299}
#define max(a, b)
std::vector< EvtId > _userSetBirthOthD
std::vector< EvtId > _userSetPWD1
std::vector< int > _userSetPW
void addFactorPn(double factor=0.)
virtual double getRandMass(EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
std::vector< int > _userSetBirthPW
std::vector< EvtId > _userSetPWD2
std::vector< EvtId > _userSetBirthPar
static double getMeanMass(EvtId i)
Definition EvtPDL.hh:43
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
double value() const
Definition EvtPoint1D.hh:25
static int getSpin2(spintype stype)

◆ operator=()

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

Definition at line 84 of file EvtRelBreitWignerBarrierFact.cc.

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

◆ reSetBlatt()

virtual void EvtRelBreitWignerBarrierFact::reSetBlatt ( double blatt)
inlinevirtual

Reimplemented from EvtAbsLineShape.

Definition at line 47 of file EvtRelBreitWignerBarrierFact.hh.

47{ _blatt = blatt; }

Member Data Documentation

◆ _blatt

double EvtRelBreitWignerBarrierFact::_blatt
protected

◆ _errorCond

bool EvtRelBreitWignerBarrierFact::_errorCond
protected

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