BOSS 7.0.1
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 ()
 
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

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 {
37
38}

Referenced by clone().

◆ EvtRelBreitWignerBarrierFact() [2/3]

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

Definition at line 43 of file EvtRelBreitWignerBarrierFact.cc.

43 :
44 EvtAbsLineShape(mass,width,maxRange,sp)
45{ // double mDaug1, double mDaug2, int l) {
46
49 _mass=mass;
50 _width=width;
51 _spin=sp;
52 _blatt=3.0;
53 _maxRange=maxRange;
54 _errorCond=false;
55
56 double maxdelta = 15.0*width;
57
58 if ( maxRange > 0.00001 ) {
59 _massMax=mass+maxdelta;
60 _massMin=mass-maxRange;
61 }
62 else{
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 40 of file EvtRelBreitWignerBarrierFact.cc.

40 {
41}

◆ EvtRelBreitWignerBarrierFact() [3/3]

EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact ( const EvtRelBreitWignerBarrierFact x)

Definition at line 71 of file EvtRelBreitWignerBarrierFact.cc.

71 :
73{
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
82}
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 105 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++) {
115 dTotMass+=massDau[i];
116 }
117 //report(INFO,"EvtGen") << mass << " " << massPar << " " << dTotMass << " "<< endl;
118 // if ( (mass-dTotMass)<0.0001 ) return 0.;
119 //report(INFO,"EvtGen") << mass << " " << dTotMass << endl;
120 if ( (mass<dTotMass) ) return 0.;
121
122 if ( _width< 0.0001) return 1.;
123
124 if ( massPar>0.0000000001 ) {
125 if ( mass > massPar) return 0.;
126 }
127
128 if ( _errorCond ) return 0.;
129
130 // we did all the work in getRandMass
131 return 1.;
132}
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 134 of file EvtRelBreitWignerBarrierFact.cc.

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

◆ 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 46 of file EvtRelBreitWignerBarrierFact.hh.

46{ _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: