CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
BSpdfsFcn Class Reference

#include <BSpdfsFcn.h>

Inheritance diagram for BSpdfsFcn:

Public Member Functions

virtual double operator() (const std::vector< double > &) const
 
void SetData (const 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
 
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< BSTrkParametersfBSvector
 
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
 

Detailed Description


class: BSpdfsFcn.h package: RecoVertex/BeamSpotProducer

author: Francisco Yumiceva, Fermilab (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov)


Definition at line 22 of file BSpdfsFcn.h.

Member Function Documentation

double BSpdfsFcn::operator() ( const std::vector< double > &  params) const
virtual

Definition at line 87 of file BSpdfsFcn.cc.

References f, fBSvector, fusepdfs, dqm-mbProfile::log, PDFGauss_d(), PDFGauss_d_resolution(), and PDFGauss_z().

87  {
88 
89  double f = 0.0;
90 
91  //std::cout << "fusepdfs=" << fusepdfs << " params.size="<<params.size() << std::endl;
92 
93  std::vector<BSTrkParameters>::const_iterator iparam = fBSvector.begin();
94 
95  double pdf = 0;
96 
97  for( iparam = fBSvector.begin(); iparam != fBSvector.end(); ++iparam) {
98 
99 
100  if (fusepdfs == "PDFGauss_z") {
101  pdf = PDFGauss_z( iparam->z0(), iparam->sigz0(),params);
102  }
103  else if (fusepdfs == "PDFGauss_d") {
104  pdf = PDFGauss_d( iparam->z0(), iparam->d0(),
105  iparam->sigd0(), iparam->phi0(),params);
106  }
107  else if (fusepdfs == "PDFGauss_d_resolution") {
108  pdf = PDFGauss_d_resolution( iparam->z0(), iparam->d0(),
109  iparam->phi0(), iparam->pt(),params);
110  }
111  else if (fusepdfs == "PDFGauss_d*PDFGauss_z") {
112  //std::cout << "pdf= " << pdf << std::endl;
113  pdf = PDFGauss_d( iparam->z0(), iparam->d0(),
114  iparam->sigd0(), iparam->phi0(),params)*
115  PDFGauss_z( iparam->z0(), iparam->sigz0(),params);
116  }
117  else if (fusepdfs == "PDFGauss_d_resolution*PDFGauss_z") {
118  pdf = PDFGauss_d_resolution( iparam->z0(), iparam->d0(),
119  iparam->phi0(), iparam->pt(),params)*
120  PDFGauss_z( iparam->z0(), iparam->sigz0(),params);
121  }
122 
123  f = log(pdf) + f;
124  }
125 
126  f= -2.0*f;
127  return f;
128 
129 }
std::vector< BSTrkParameters > fBSvector
Definition: BSpdfsFcn.h:49
double PDFGauss_d(double z, double d, double sigmad, double phi, const std::vector< double > &parms) const
Definition: BSpdfsFcn.cc:20
double PDFGauss_z(double z, double sigmaz, const std::vector< double > &parms) const
Definition: BSpdfsFcn.cc:66
double f[11][100]
double PDFGauss_d_resolution(double z, double d, double phi, double pt, const std::vector< double > &parms) const
Definition: BSpdfsFcn.cc:42
std::string fusepdfs
Definition: BSpdfsFcn.h:48
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 (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov)


Definition at line 20 of file BSpdfsFcn.cc.

References funct::cos(), create_public_lumi_plots::exp, fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, Pi, query::result, funct::sin(), and mathSSE::sqrt().

Referenced by operator()().

21  {
22 
23  //---------------------------------------------------------------------------
24  // PDF for d0 distribution. This PDF is a simple gaussian in the
25  // beam reference frame.
26  //---------------------------------------------------------------------------
27  double fsqrt2pi = sqrt(2.* TMath::Pi());
28 
29  double sig = sqrt(parms[fPar_SigmaBeam]*parms[fPar_SigmaBeam] +
30  sigmad*sigmad);
31 
32  double dprime = d - ( ( parms[fPar_X0] + z*parms[fPar_dxdz] )*sin(phi)
33  - ( parms[fPar_Y0] + z*parms[fPar_dydz] )*cos(phi) );
34 
35  double result = (exp(-(dprime*dprime)/(2.0*sig*sig)))/(sig*fsqrt2pi);
36 
37  return result;
38 
39 }
const double Pi
static const int fPar_dydz
Definition: BSpdfsFcn.h:56
static const int fPar_Y0
Definition: BSpdfsFcn.h:52
static const int fPar_X0
Definition: BSpdfsFcn.h:51
static const int fPar_dxdz
Definition: BSpdfsFcn.h:55
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static const int fPar_SigmaBeam
Definition: BSpdfsFcn.h:57
tuple d
Definition: ztail.py:151
T sqrt(T t)
Definition: SSEVec.h:18
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double BSpdfsFcn::PDFGauss_d_resolution ( double  z,
double  d,
double  phi,
double  pt,
const std::vector< double > &  parms 
) const
private

Definition at line 42 of file BSpdfsFcn.cc.

References funct::cos(), create_public_lumi_plots::exp, fPar_c0, fPar_c1, fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, Pi, EnergyCorrector::pt, query::result, funct::sin(), and mathSSE::sqrt().

Referenced by operator()().

42  {
43 
44  //---------------------------------------------------------------------------
45  // PDF for d0 distribution. This PDF is a simple gaussian in the
46  // beam reference frame. The IP resolution is parametrize by a linear
47  // function as a function of 1/pt.
48  //---------------------------------------------------------------------------
49  double fsqrt2pi = sqrt(2.* TMath::Pi());
50 
51  double sigmad = parms[fPar_c0] + parms[fPar_c1]/pt;
52 
53  double sig = sqrt(parms[fPar_SigmaBeam]*parms[fPar_SigmaBeam] +
54  sigmad*sigmad);
55 
56  double dprime = d - ( ( parms[fPar_X0] + z*parms[fPar_dxdz] )*sin(phi)
57  - ( parms[fPar_Y0] + z*parms[fPar_dydz] )*cos(phi) );
58 
59  double result = (exp(-(dprime*dprime)/(2.0*sig*sig)))/(sig*fsqrt2pi);
60 
61  return result;
62 
63 }
const double Pi
static const int fPar_dydz
Definition: BSpdfsFcn.h:56
static const int fPar_Y0
Definition: BSpdfsFcn.h:52
static const int fPar_X0
Definition: BSpdfsFcn.h:51
static const int fPar_dxdz
Definition: BSpdfsFcn.h:55
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static const int fPar_c0
Definition: BSpdfsFcn.h:58
static const int fPar_SigmaBeam
Definition: BSpdfsFcn.h:57
tuple d
Definition: ztail.py:151
T sqrt(T t)
Definition: SSEVec.h:18
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const int fPar_c1
Definition: BSpdfsFcn.h:59
double BSpdfsFcn::PDFGauss_z ( double  z,
double  sigmaz,
const std::vector< double > &  parms 
) const
private

Definition at line 66 of file BSpdfsFcn.cc.

References create_public_lumi_plots::exp, fPar_SigmaZ, fPar_Z0, Pi, query::result, and mathSSE::sqrt().

Referenced by operator()().

66  {
67 
68  //---------------------------------------------------------------------------
69  // PDF for z-vertex distribution. This distribution
70  // is parametrized by a simple normalized gaussian distribution.
71  //---------------------------------------------------------------------------
72  double fsqrt2pi = sqrt(2.* TMath::Pi());
73 
74  double sig = sqrt(sigmaz*sigmaz+parms[fPar_SigmaZ]*parms[fPar_SigmaZ]);
75  //double sig = sqrt(sigmaz*sigmaz+parms[1]*parms[1]);
76  double result = (exp(-((z-parms[fPar_Z0])*(z-parms[fPar_Z0]))/(2.0*sig*sig)))/(sig*fsqrt2pi);
77  //double result = (exp(-((z-parms[0])*(z-parms[0]))/(2.0*sig*sig)))/(sig*fsqrt2pi);
78 
79  return result;
80 
81 }
const double Pi
static const int fPar_SigmaZ
Definition: BSpdfsFcn.h:54
T sqrt(T t)
Definition: SSEVec.h:18
tuple result
Definition: query.py:137
static const int fPar_Z0
Definition: BSpdfsFcn.h:53
void BSpdfsFcn::SetData ( const std::vector< BSTrkParameters > &  a_BSvector)
inline

Definition at line 26 of file BSpdfsFcn.h.

References fBSvector.

26  {
27 
28  fBSvector = a_BSvector;
29 
30  };
std::vector< BSTrkParameters > fBSvector
Definition: BSpdfsFcn.h:49
void BSpdfsFcn::SetPDFs ( std::string  usepdfs)
inline

Definition at line 32 of file BSpdfsFcn.h.

References fusepdfs.

32  {
33  fusepdfs = usepdfs;
34  }
std::string fusepdfs
Definition: BSpdfsFcn.h:48
virtual double BSpdfsFcn::Up ( ) const
inlinevirtual

Definition at line 37 of file BSpdfsFcn.h.

37 {return 1.;}

Member Data Documentation

std::vector< BSTrkParameters > BSpdfsFcn::fBSvector
private

Definition at line 49 of file BSpdfsFcn.h.

Referenced by operator()(), and SetData().

const int BSpdfsFcn::fPar_c0 = 7
staticprivate

Definition at line 58 of file BSpdfsFcn.h.

Referenced by PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_c1 = 8
staticprivate

Definition at line 59 of file BSpdfsFcn.h.

Referenced by PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_dxdz = 4
staticprivate

Definition at line 55 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_dydz = 5
staticprivate

Definition at line 56 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_SigmaBeam = 6
staticprivate

Definition at line 57 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_SigmaZ = 3
staticprivate

Definition at line 54 of file BSpdfsFcn.h.

Referenced by PDFGauss_z().

const int BSpdfsFcn::fPar_X0 = 0
staticprivate

Definition at line 51 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_Y0 = 1
staticprivate

Definition at line 52 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

const int BSpdfsFcn::fPar_Z0 = 2
staticprivate

Definition at line 53 of file BSpdfsFcn.h.

Referenced by PDFGauss_z().

std::string BSpdfsFcn::fusepdfs
private

Definition at line 48 of file BSpdfsFcn.h.

Referenced by operator()(), and SetPDFs().