00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "RooRarFit/rarVersion.hh"
00025
00026 #include "Riostream.h"
00027
00028 #include "RooRarFit/RooRelBreitWigner.hh"
00029 #include "RooFitCore/RooAbsReal.hh"
00030 #include "RooFitCore/RooRealVar.hh"
00031 #include "RooFitCore/RooAbsReal.hh"
00032 #include "RooFitCore/RooComplex.hh"
00033
00034 ClassImp(RooRelBreitWigner)
00035
00036
00037 RooRelBreitWigner::RooRelBreitWigner(const char *name, const char *title,
00038 RooAbsReal& _x, RooAbsReal& _mean,
00039 RooAbsReal& _width, RooAbsReal& _radius,
00040 RooAbsReal& _mass_a, RooAbsReal& _mass_b,
00041 RooAbsReal& _spin) :
00042 RooAbsPdf(name,title),
00043 x("x","Dependent",this,_x),
00044 mean("mean","Mean",this,_mean),
00045 width("width","Width",this,_width),
00046 radius("radius","Radius",this,_radius),
00047 mass_a("mass_a","Mass of first daughter",this,_mass_a),
00048 mass_b("mass_b","Mass of second daugher",this,_mass_b),
00049 spin("spin","Spin",this,_spin)
00050 {
00051 }
00052
00053
00054 RooRelBreitWigner::RooRelBreitWigner(const RooRelBreitWigner& other,
00055 const char* name) :
00056 RooAbsPdf(other,name),
00057 x("x",this,other.x),
00058 mean("mean",this,other.mean),
00059 width("width",this,other.width),
00060 radius("radius",this,other.radius),
00061 mass_a("mass_a",this,other.mass_a),
00062 mass_b("mass_b",this,other.mass_b),
00063 spin("spin",this,other.spin)
00064 {
00065 }
00066
00067
00068 Double_t RooRelBreitWigner::evaluate() const
00069 {
00070 Double_t temp = mean*getWidth();
00071 RooComplex T(x*x,0.0);
00072 RooComplex denom(mean*mean-x*x,-1*temp);
00073 T = T /denom;
00074 return(T.abs2());
00075 }
00076
00077
00078 Double_t RooRelBreitWigner::getWidth() const
00079 {
00080 Double_t q = getQ(x);
00081 Double_t q0 = getQ(mean);
00082 Double_t result(0.0);
00083
00084 if (q>0 && q0>0 && x>0 && mean>0) {
00085 result = width * getQterm(q,q0) * (mean/x)
00086 * (getFF(q) / getFF(q0));
00087 }
00088 return (result);
00089 }
00090
00091
00092 Double_t RooRelBreitWigner::getQterm(Double_t q, Double_t q0) const
00093 {
00094 Double_t result = pow(q/q0,2*spin+1);
00095 return (result);
00096 }
00097
00098
00099 Double_t RooRelBreitWigner::getFF(Double_t q) const
00100 {
00101
00102 Double_t z = q * radius;
00103 Double_t result(1.0);
00104
00105 if (spin==1) {
00106 result = 1.0/(1+z*z);
00107 } else if (spin==2) {
00108 result = 1.0/(9 + 3*z*z + z*z*z*z);
00109 }
00110
00111 return (result);
00112 }
00113
00114
00115 Double_t RooRelBreitWigner::getQ(Double_t mass) const
00116 {
00117
00118 if (mass < (mass_b+mass_a)) {return(0);}
00119
00120 const Double_t mDaugSumSq = (mass_b+mass_a)*(mass_b+mass_a);
00121 const Double_t mDaugDiffSq = (mass_b-mass_a)*(mass_b-mass_a);
00122
00123 Double_t q = sqrt((mass*mass-mDaugSumSq)*(mass*mass-mDaugDiffSq))/(2*mass);
00124 return(q);
00125 }