#include <RecoVertex/BeamSpotProducer/interface/BSpdfsFcn.h>
Public Member Functions | |
virtual double | operator() (const std::vector< double > &) const |
void | SetData (std::vector< BSTrkParameters > a_BSvector) |
void | SetPDFs (std::string usepdfs) |
virtual double | Up () const |
Private Member Functions | |
double | PDFGauss_d (double z, double d, double sigmad, double phi, const std::vector< double > &parms) const |
_________________________________________________________________ class: BSpdfsFcn.cc package: RecoVertex/BeamSpotProducer | |
double | PDFGauss_d_resolution (double z, double d, double phi, double pt, const std::vector< double > &parms) const |
double | PDFGauss_z (double z, double sigmaz, const std::vector< double > &parms) const |
Private Attributes | |
std::vector< BSTrkParameters > | fBSvector |
std::string | fusepdfs |
Static Private Attributes | |
static const int | fPar_c0 = 7 |
static const int | fPar_c1 = 8 |
static const int | fPar_dxdz = 4 |
static const int | fPar_dydz = 5 |
static const int | fPar_SigmaBeam = 6 |
static const int | fPar_SigmaZ = 3 |
static const int | fPar_X0 = 0 |
static const int | fPar_Y0 = 1 |
static const int | fPar_Z0 = 2 |
Definition at line 26 of file BSpdfsFcn.h.
double BSpdfsFcn::operator() | ( | const std::vector< double > & | params | ) | const [virtual] |
Definition at line 88 of file BSpdfsFcn.cc.
References f, fBSvector, fusepdfs, funct::log(), PDFGauss_d(), PDFGauss_d_resolution(), and PDFGauss_z().
00088 { 00089 00090 double f = 0.0; 00091 00092 //std::cout << "fusepdfs=" << fusepdfs << " params.size="<<params.size() << std::endl; 00093 00094 std::vector<BSTrkParameters>::const_iterator iparam = fBSvector.begin(); 00095 00096 double pdf = 0; 00097 00098 for( iparam = fBSvector.begin(); iparam != fBSvector.end(); ++iparam) { 00099 00100 00101 if (fusepdfs == "PDFGauss_z") { 00102 pdf = PDFGauss_z( iparam->z0(), iparam->sigz0(),params); 00103 } 00104 else if (fusepdfs == "PDFGauss_d") { 00105 pdf = PDFGauss_d( iparam->z0(), iparam->d0(), 00106 iparam->sigd0(), iparam->phi0(),params); 00107 } 00108 else if (fusepdfs == "PDFGauss_d_resolution") { 00109 pdf = PDFGauss_d_resolution( iparam->z0(), iparam->d0(), 00110 iparam->phi0(), iparam->pt(),params); 00111 } 00112 else if (fusepdfs == "PDFGauss_d*PDFGauss_z") { 00113 //std::cout << "pdf= " << pdf << std::endl; 00114 pdf = PDFGauss_d( iparam->z0(), iparam->d0(), 00115 iparam->sigd0(), iparam->phi0(),params)* 00116 PDFGauss_z( iparam->z0(), iparam->sigz0(),params); 00117 } 00118 else if (fusepdfs == "PDFGauss_d_resolution*PDFGauss_z") { 00119 pdf = PDFGauss_d_resolution( iparam->z0(), iparam->d0(), 00120 iparam->phi0(), iparam->pt(),params)* 00121 PDFGauss_z( iparam->z0(), iparam->sigz0(),params); 00122 } 00123 00124 f = log(pdf) + f; 00125 } 00126 00127 f= -2.0*f; 00128 return f; 00129 00130 }
double BSpdfsFcn::PDFGauss_d | ( | double | z, | |
double | d, | |||
double | sigmad, | |||
double | phi, | |||
const std::vector< double > & | parms | |||
) | const [private] |
_________________________________________________________________ class: BSpdfsFcn.cc package: RecoVertex/BeamSpotProducer
author: Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)
version
________________________________________________________________
Definition at line 21 of file BSpdfsFcn.cc.
References funct::cos(), funct::exp(), fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, Pi, HLT_VtxMuL3::result, funct::sin(), and funct::sqrt().
Referenced by operator()().
00022 { 00023 00024 //--------------------------------------------------------------------------- 00025 // PDF for d0 distribution. This PDF is a simple gaussian in the 00026 // beam reference frame. 00027 //--------------------------------------------------------------------------- 00028 double fsqrt2pi = sqrt(2.* TMath::Pi()); 00029 00030 double sig = sqrt(parms[fPar_SigmaBeam]*parms[fPar_SigmaBeam] + 00031 sigmad*sigmad); 00032 00033 double dprime = d - ( ( parms[fPar_X0] + z*parms[fPar_dxdz] )*sin(phi) 00034 - ( parms[fPar_Y0] + z*parms[fPar_dydz] )*cos(phi) ); 00035 00036 double result = (exp(-(dprime*dprime)/(2.0*sig*sig)))/(sig*fsqrt2pi); 00037 00038 return result; 00039 00040 }
double BSpdfsFcn::PDFGauss_d_resolution | ( | double | z, | |
double | d, | |||
double | phi, | |||
double | pt, | |||
const std::vector< double > & | parms | |||
) | const [private] |
Definition at line 43 of file BSpdfsFcn.cc.
References funct::cos(), funct::exp(), fPar_c0, fPar_c1, fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, Pi, HLT_VtxMuL3::result, funct::sin(), and funct::sqrt().
Referenced by operator()().
00043 { 00044 00045 //--------------------------------------------------------------------------- 00046 // PDF for d0 distribution. This PDF is a simple gaussian in the 00047 // beam reference frame. The IP resolution is parametrize by a linear 00048 // function as a function of 1/pt. 00049 //--------------------------------------------------------------------------- 00050 double fsqrt2pi = sqrt(2.* TMath::Pi()); 00051 00052 double sigmad = parms[fPar_c0] + parms[fPar_c1]/pt; 00053 00054 double sig = sqrt(parms[fPar_SigmaBeam]*parms[fPar_SigmaBeam] + 00055 sigmad*sigmad); 00056 00057 double dprime = d - ( ( parms[fPar_X0] + z*parms[fPar_dxdz] )*sin(phi) 00058 - ( parms[fPar_Y0] + z*parms[fPar_dydz] )*cos(phi) ); 00059 00060 double result = (exp(-(dprime*dprime)/(2.0*sig*sig)))/(sig*fsqrt2pi); 00061 00062 return result; 00063 00064 }
double BSpdfsFcn::PDFGauss_z | ( | double | z, | |
double | sigmaz, | |||
const std::vector< double > & | parms | |||
) | const [private] |
Definition at line 67 of file BSpdfsFcn.cc.
References funct::exp(), fPar_SigmaZ, fPar_Z0, Pi, HLT_VtxMuL3::result, and funct::sqrt().
Referenced by operator()().
00067 { 00068 00069 //--------------------------------------------------------------------------- 00070 // PDF for z-vertex distribution. This distribution 00071 // is parametrized by a simple normalized gaussian distribution. 00072 //--------------------------------------------------------------------------- 00073 double fsqrt2pi = sqrt(2.* TMath::Pi()); 00074 00075 double sig = sqrt(sigmaz*sigmaz+parms[fPar_SigmaZ]*parms[fPar_SigmaZ]); 00076 //double sig = sqrt(sigmaz*sigmaz+parms[1]*parms[1]); 00077 double result = (exp(-((z-parms[fPar_Z0])*(z-parms[fPar_Z0]))/(2.0*sig*sig)))/(sig*fsqrt2pi); 00078 //double result = (exp(-((z-parms[0])*(z-parms[0]))/(2.0*sig*sig)))/(sig*fsqrt2pi); 00079 00080 return result; 00081 00082 }
void BSpdfsFcn::SetData | ( | std::vector< BSTrkParameters > | a_BSvector | ) | [inline] |
Definition at line 30 of file BSpdfsFcn.h.
References fBSvector.
Referenced by BSFitter::Fit_d_likelihood(), BSFitter::Fit_d_z_likelihood(), BSFitter::Fit_dres_z_likelihood(), and BSFitter::Fit_z_likelihood().
00030 { 00031 00032 fBSvector = a_BSvector; 00033 00034 };
void BSpdfsFcn::SetPDFs | ( | std::string | usepdfs | ) | [inline] |
Definition at line 36 of file BSpdfsFcn.h.
References fusepdfs.
Referenced by BSFitter::Fit_d_likelihood(), BSFitter::Fit_d_z_likelihood(), BSFitter::Fit_dres_z_likelihood(), and BSFitter::Fit_z_likelihood().
00036 { 00037 fusepdfs = usepdfs; 00038 }
virtual double BSpdfsFcn::Up | ( | ) | const [inline, virtual] |
std::vector< BSTrkParameters > BSpdfsFcn::fBSvector [private] |
const int BSpdfsFcn::fPar_c0 = 7 [static, private] |
const int BSpdfsFcn::fPar_c1 = 8 [static, private] |
const int BSpdfsFcn::fPar_dxdz = 4 [static, private] |
const int BSpdfsFcn::fPar_dydz = 5 [static, private] |
const int BSpdfsFcn::fPar_SigmaBeam = 6 [static, private] |
const int BSpdfsFcn::fPar_SigmaZ = 3 [static, private] |
const int BSpdfsFcn::fPar_X0 = 0 [static, private] |
const int BSpdfsFcn::fPar_Y0 = 1 [static, private] |
const int BSpdfsFcn::fPar_Z0 = 2 [static, private] |
std::string BSpdfsFcn::fusepdfs [private] |