Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtRelBreitWignerBarrierFact Class Reference

#include <EvtRelBreitWignerBarrierFact.hh>

Inheritance diagram for EvtRelBreitWignerBarrierFact:

EvtAbsLineShape List of all members.

Public Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact  ) 
 

00036                                                            {
00037 
00038 }

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

00043                                                                                                                              :
00044   EvtAbsLineShape(mass,width,maxRange,sp)
00045 { // double mDaug1, double mDaug2, int l) {
00046 
00047   _includeDecayFact=true;
00048   _includeBirthFact=true;
00049   _mass=mass;
00050   _width=width;
00051   _spin=sp;
00052   _blatt=3.0;
00053   _maxRange=maxRange;
00054   _errorCond=false;
00055 
00056   double maxdelta = 15.0*width;
00057 
00058   if ( maxRange > 0.00001 ) {
00059     _massMax=mass+maxdelta;
00060     _massMin=mass-maxRange;
00061   }
00062   else{
00063     _massMax=mass+maxdelta;
00064     _massMin=mass-15.0*width;
00065   }
00066  
00067   _massMax=mass+maxdelta;
00068   if ( _massMin< 0. ) _massMin=0.;
00069 }

EvtRelBreitWignerBarrierFact::~EvtRelBreitWignerBarrierFact  ) 
 

00040                                                             {
00041 }

EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact const EvtRelBreitWignerBarrierFact x  ) 
 

00071                                                                                                 :
00072   EvtAbsLineShape(x)
00073 {
00074   _massMax=x._massMax;
00075   _massMin=x._massMin;
00076   _blatt=x._blatt;
00077   _maxRange=x._maxRange;
00078   _includeDecayFact=x._includeDecayFact;
00079   _includeBirthFact=x._includeBirthFact;
00080   _errorCond=x._errorCond;
00081 
00082 }


Member Function Documentation

void EvtAbsLineShape::addFactorPn double  factor = 0.  )  [inline, inherited]
 

00056 { _addFactorPn = factor;}

EvtAbsLineShape * EvtRelBreitWignerBarrierFact::clone  )  [virtual]
 

Reimplemented from EvtAbsLineShape.

00099                                                      {
00100 
00101   return new EvtRelBreitWignerBarrierFact(*this);
00102 }

void EvtAbsLineShape::fixForSP8  )  [inline, inherited]
 

00072 { _applyFixForSP8=true;}

double EvtAbsLineShape::getMass  )  [inline, inherited]
 

00041 {return _mass;}

double EvtAbsLineShape::getMassMax  )  [inline, inherited]
 

00043 {return _massMax;}

double EvtAbsLineShape::getMassMin  )  [inline, inherited]
 

00042 {return _massMin;} 

double EvtRelBreitWignerBarrierFact::getMassProb double  mass,
double  massPar,
int  nDaug,
double *  massDau
[virtual]
 

Reimplemented from EvtAbsLineShape.

00105                                                                                                        {
00106 
00107   _errorCond=false;
00108   //return EvtAbsLineShape::getMassProb(mass,massPar,nDaug,massDau);
00109   if (nDaug!=2) return EvtAbsLineShape::getMassProb(mass,massPar,nDaug,massDau);
00110 
00111   double dTotMass=0.;
00112 
00113   int i;
00114   for (i=0; i<nDaug; i++) {
00115     dTotMass+=massDau[i];
00116   }
00117   //report(INFO,"EvtGen") << mass << " " << massPar << " " << dTotMass << " "<< endl;
00118   //    if ( (mass-dTotMass)<0.0001 ) return 0.;
00119   //report(INFO,"EvtGen") << mass << " " << dTotMass << endl;
00120   if ( (mass<dTotMass) ) return 0.;
00121 
00122   if ( _width< 0.0001) return 1.;
00123 
00124   if ( massPar>0.0000000001 ) {
00125     if ( mass > massPar) return 0.;
00126   }
00127 
00128   if ( _errorCond ) return 0.;
00129 
00130   // we did all the work in getRandMass
00131   return 1.;
00132 }

double EvtAbsLineShape::getMaxRange  )  [inline, inherited]
 

00044 {return _maxRange;}

double EvtRelBreitWignerBarrierFact::getRandMass EvtId parId,
int  nDaug,
EvtId dauId,
EvtId othDaugId,
double  maxMass,
double *  dauMasses
[virtual]
 

Reimplemented from EvtAbsLineShape.

00134                                                                                                                                           {
00135   if ( nDaug!=2) {
00136     if(fabs(_addFactorPn) >0.00000001) EvtAbsLineShape::addFactorPn(_addFactorPn);
00137     double themass = EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);
00138     return themass;
00139   }
00140 
00141   if ( _width< 0.00001) return _mass;
00142 
00143   //first figure out L - take the lowest allowed.
00144 
00145   EvtSpinType::spintype spinD1=EvtPDL::getSpinType(dauId[0]);
00146   EvtSpinType::spintype spinD2=EvtPDL::getSpinType(dauId[1]);
00147 
00148   int t1=EvtSpinType::getSpin2(spinD1);
00149   int t2=EvtSpinType::getSpin2(spinD2);
00150   int t3=EvtSpinType::getSpin2(_spin);
00151 
00152   int Lmin=-10;
00153 
00154 
00155   // the user has overridden the partial wave to use.
00156   for ( int vC=0; vC<_userSetPW.size(); vC++) {
00157     if ( dauId[0]==_userSetPWD1[vC] &&  dauId[1]==_userSetPWD2[vC] ) Lmin=2*_userSetPW[vC]; 
00158     if ( dauId[0]==_userSetPWD2[vC] &&  dauId[1]==_userSetPWD1[vC] ) Lmin=2*_userSetPW[vC]; 
00159   }
00160   
00161   // allow for special cases.
00162   if (Lmin<-1 ) {
00163     
00164     //There are some things I don't know how to deal with
00165     if ( t3>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);
00166     if ( t1>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);
00167     if ( t2>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);
00168     
00169     //figure the min and max allowwed "spins" for the daughters state
00170     Lmin=std::max(t3-t2-t1,std::max(t2-t3-t1,t1-t3-t2));
00171     if (Lmin<0) Lmin=0;
00172     assert(Lmin==0||Lmin==2||Lmin==4);
00173   }
00174 
00175   //double massD1=EvtPDL::getMeanMass(dauId[0]);
00176   //double massD2=EvtPDL::getMeanMass(dauId[1]);
00177   double massD1=dauMasses[0];
00178   double massD2=dauMasses[1];
00179 
00180   // I'm not sure how to define the vertex factor here - so retreat to nonRel code.
00181   if ( (massD1+massD2)> _mass ) return  EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);
00182 
00183   //parent vertex factor not yet implemented
00184   double massOthD=-10.;
00185   double massParent=-10.;
00186   int birthl=-10;
00187   if ( othDaugId) {
00188     EvtSpinType::spintype spinOth=EvtPDL::getSpinType(*othDaugId);
00189     EvtSpinType::spintype spinPar=EvtPDL::getSpinType(*parId);
00190     
00191     int tt1=EvtSpinType::getSpin2(spinOth);
00192     int tt2=EvtSpinType::getSpin2(spinPar);
00193     int tt3=EvtSpinType::getSpin2(_spin);
00194     
00195     
00196     //figure the min and max allowwed "spins" for the daughters state
00197     if ( (tt1<=4) && ( tt2<=4) ) {
00198       birthl=std::max(tt3-tt2-tt1,std::max(tt2-tt3-tt1,tt1-tt3-tt2));
00199       if (birthl<0) birthl=0;
00200     
00201       massOthD=EvtPDL::getMeanMass(*othDaugId);
00202       massParent=EvtPDL::getMeanMass(*parId);
00203     
00204     }
00205 
00206 
00207      // allow user to override
00208      for (size_t vC=0; vC<_userSetBirthPW.size(); vC++) {
00209        if ( *othDaugId==_userSetBirthOthD[vC] && *parId==_userSetBirthPar[vC]){
00210         birthl=2*_userSetBirthPW[vC];
00211        } 
00212      }
00213 
00214   }
00215   double massM=_massMax;
00216   if ( (maxMass > -0.5) && (maxMass < massM) ) massM=maxMass;
00217 
00218   //special case... if the parent mass is _fixed_ we can do a little better
00219   //and only for a two body decay as that seems to be where we have problems
00220 
00221   // Define relativistic propagator amplitude
00222 
00223   EvtTwoBodyVertex vd(massD1,massD2,_mass,Lmin/2);
00224   vd.set_f(_blatt);
00225   EvtPropBreitWignerRel bw(_mass,_width);
00226   EvtMassAmp amp(bw,vd);
00227   if ( _includeDecayFact) {
00228     amp.addDeathFact();
00229     amp.addDeathFactFF();
00230   }
00231 
00232   if(fabs(_addFactorPn) >0.00000001){
00233     //    std::cout<<"EvtRelBreitWignerBarrierFact "<< _addFactorPn<<std::endl;
00234     amp.addFactorPn( _addFactorPn);
00235   }
00236   if ( massParent>-1.) {
00237     if ( _includeBirthFact ) {
00238 
00239       EvtTwoBodyVertex vb(_mass,massOthD,massParent,birthl/2);
00240       if ( _applyFixForSP8 ) vb.set_f(_blatt);
00241       amp.setBirthVtx(vb);
00242       amp.addBirthFact();
00243       amp.addBirthFactFF();
00244     }
00245   }
00246 
00247 
00248 
00249   EvtAmpPdf<EvtPoint1D> pdf(amp);
00250 
00251   // Estimate maximum and create predicate for accept reject
00252 
00253 
00254   double tempMaxLoc=_mass;
00255   if ( maxMass>-0.5 && maxMass<_mass) tempMaxLoc=maxMass;
00256   double tempMax=_massMax;
00257   if ( maxMass>-0.5 && maxMass<_massMax) tempMax=maxMass;
00258   double tempMinMass=_massMin;
00259   if ( massD1+massD2 > _massMin) tempMinMass=massD1+massD2;
00260 
00261   //redo sanity check - is there a solution to our problem.
00262   //if not return an error condition that is caught by the
00263   //mass prob calculation above.
00264   if ( tempMinMass > tempMax ) {
00265     _errorCond=true;
00266     return tempMinMass;
00267   }
00268   
00269   if ( tempMaxLoc < tempMinMass) tempMaxLoc=tempMinMass;
00270 
00271   double safetyFactor=1.2;
00272   if ( _applyFixForSP8 ) safetyFactor=1.4;
00273 
00274   EvtPdfMax<EvtPoint1D> max(safetyFactor*pdf.evaluate(EvtPoint1D(tempMinMass,tempMax,tempMaxLoc)));
00275 
00276   EvtPdfPred<EvtPoint1D> pred(pdf);
00277   pred.setMax(max);
00278 
00279   EvtIntervalFlatPdf flat(tempMinMass,tempMax);
00280   EvtPdfGen<EvtPoint1D> gen(flat);
00281   EvtPredGen<EvtPdfGen<EvtPoint1D>,EvtPdfPred<EvtPoint1D> > predgen(gen,pred);
00282 
00283   EvtPoint1D point = predgen();
00284   return point.value();
00285 
00286 }

EvtSpinType::spintype EvtAbsLineShape::getSpinType  )  [inline, inherited]
 

00046 {return _spin;}

double EvtAbsLineShape::getWidth  )  [inline, inherited]
 

00045 {return _width;} 

void EvtAbsLineShape::includeBirthFactor bool  yesno  )  [inline, inherited]
 

00055 { _includeBirthFact = yesno; }

void EvtAbsLineShape::includeDecayFactor bool  yesno  )  [inline, inherited]
 

00057 { _includeDecayFact = yesno; }

EvtRelBreitWignerBarrierFact & EvtRelBreitWignerBarrierFact::operator= const EvtRelBreitWignerBarrierFact x  ) 
 

00084                                                                                                            {
00085   _mass=x._mass;
00086   _width=x._width;
00087   _spin=x._spin;
00088   _massMax=x._massMax;
00089   _massMin=x._massMin;
00090   _blatt=x._blatt;
00091   _maxRange=x._maxRange;
00092   _includeDecayFact=x._includeDecayFact;
00093   _includeBirthFact=x._includeBirthFact;
00094   _errorCond=x._errorCond;
00095 
00096   return *this;
00097 }

virtual void EvtRelBreitWignerBarrierFact::reSetBlatt double  blatt  )  [inline, virtual]
 

Reimplemented from EvtAbsLineShape.

00046 { _blatt = blatt; }

void EvtAbsLineShape::reSetMass double  mass  )  [inline, inherited]
 

00050 { _mass=mass;}

void EvtAbsLineShape::reSetMassMax double  mass  )  [inline, inherited]
 

00053 { _massMax=mass;}

void EvtAbsLineShape::reSetMassMin double  mass  )  [inline, inherited]
 

00052 { _massMin=mass;}

void EvtAbsLineShape::reSetWidth double  width  )  [inline, inherited]
 

00051 { _width=width;}

double EvtAbsLineShape::rollMass  )  [virtual, inherited]
 

00102                                  {
00103 
00104   double ymin, ymax;
00105   double temp;
00106 
00107   if ( _width < 0.0001 ) {
00108     return _mass;
00109   }
00110   else{
00111     ymin = atan( 2.0*(_massMin-_mass)/_width);
00112     ymax = atan( 2.0*(_massMax-_mass)/_width);
00113 
00114     temp= ( _mass + ((_width/2.0)*tan(EvtRandom::Flat(ymin,ymax))));
00115 
00116     return temp;
00117   }
00118 }

void EvtAbsLineShape::setPWForBirthL int  spin,
EvtId  par,
EvtId  othD
[inline, inherited]
 

00063                                                         { 
00064     _userSetBirthPW.push_back(spin);
00065     _userSetBirthOthD.push_back(othD);
00066     _userSetBirthPar.push_back(par);
00067   }

void EvtAbsLineShape::setPWForDecay int  spin,
EvtId  d1,
EvtId  d2
[inline, inherited]
 

00058                                                     { 
00059     _userSetPW.push_back(spin);
00060     _userSetPWD1.push_back(d1);
00061     _userSetPWD2.push_back(d2);
00062   }


Member Data Documentation

double EvtAbsLineShape::_addFactorPn [protected, inherited]
 

bool EvtAbsLineShape::_applyFixForSP8 [protected, inherited]
 

double EvtRelBreitWignerBarrierFact::_blatt [protected]
 

bool EvtRelBreitWignerBarrierFact::_errorCond [protected]
 

bool EvtAbsLineShape::_includeBirthFact [protected, inherited]
 

bool EvtAbsLineShape::_includeDecayFact [protected, inherited]
 

double EvtAbsLineShape::_mass [protected, inherited]
 

double EvtAbsLineShape::_massMax [protected, inherited]
 

double EvtAbsLineShape::_massMin [protected, inherited]
 

double EvtAbsLineShape::_maxRange [protected, inherited]
 

EvtSpinType::spintype EvtAbsLineShape::_spin [protected, inherited]
 

std::vector<EvtId> EvtAbsLineShape::_userSetBirthOthD [protected, inherited]
 

std::vector<EvtId> EvtAbsLineShape::_userSetBirthPar [protected, inherited]
 

std::vector<int> EvtAbsLineShape::_userSetBirthPW [protected, inherited]
 

std::vector<int> EvtAbsLineShape::_userSetPW [protected, inherited]
 

std::vector<EvtId> EvtAbsLineShape::_userSetPWD1 [protected, inherited]
 

std::vector<EvtId> EvtAbsLineShape::_userSetPWD2 [protected, inherited]
 

double EvtAbsLineShape::_width [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:10:02 2011 for BOSS6.5.5 by  doxygen 1.3.9.1