CMS 3D CMS Logo

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

double operator() (const std::vector< double > &) const override
 
void SetData (const std::vector< BSTrkParameters > &a_BSvector)
 
void SetPDFs (std::string usepdfs)
 
double Up () const override
 

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

◆ operator()()

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

Definition at line 76 of file BSpdfsFcn.cc.

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

76  {
77  double f = 0.0;
78 
79  //std::cout << "fusepdfs=" << fusepdfs << " params.size="<<params.size() << std::endl;
80 
81  std::vector<BSTrkParameters>::const_iterator iparam = fBSvector.begin();
82 
83  double pdf = 0;
84 
85  for (iparam = fBSvector.begin(); iparam != fBSvector.end(); ++iparam) {
86  if (fusepdfs == "PDFGauss_z") {
87  pdf = PDFGauss_z(iparam->z0(), iparam->sigz0(), params);
88  } else if (fusepdfs == "PDFGauss_d") {
89  pdf = PDFGauss_d(iparam->z0(), iparam->d0(), iparam->sigd0(), iparam->phi0(), params);
90  } else if (fusepdfs == "PDFGauss_d_resolution") {
91  pdf = PDFGauss_d_resolution(iparam->z0(), iparam->d0(), iparam->phi0(), iparam->pt(), params);
92  } else if (fusepdfs == "PDFGauss_d*PDFGauss_z") {
93  //std::cout << "pdf= " << pdf << std::endl;
94  pdf = PDFGauss_d(iparam->z0(), iparam->d0(), iparam->sigd0(), iparam->phi0(), params) *
95  PDFGauss_z(iparam->z0(), iparam->sigz0(), params);
96  } else if (fusepdfs == "PDFGauss_d_resolution*PDFGauss_z") {
97  pdf = PDFGauss_d_resolution(iparam->z0(), iparam->d0(), iparam->phi0(), iparam->pt(), params) *
98  PDFGauss_z(iparam->z0(), iparam->sigz0(), params);
99  }
100 
101  f = log(pdf) + f;
102  }
103 
104  f = -2.0 * f;
105  return f;
106 }
double PDFGauss_d_resolution(double z, double d, double phi, double pt, const std::vector< double > &parms) const
Definition: BSpdfsFcn.cc:38
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:60
double f[11][100]
std::string fusepdfs
Definition: BSpdfsFcn.h:38
std::vector< BSTrkParameters > fBSvector
Definition: BSpdfsFcn.h:39

◆ PDFGauss_d()

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(), ztail::d, JetChargeProducer_cfi::exp, fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, phi, Pi, mps_fire::result, funct::sin(), mathSSE::sqrt(), and z.

Referenced by operator()().

20  {
21  //---------------------------------------------------------------------------
22  // PDF for d0 distribution. This PDF is a simple gaussian in the
23  // beam reference frame.
24  //---------------------------------------------------------------------------
25  double fsqrt2pi = sqrt(2. * TMath::Pi());
26 
27  double sig = sqrt(parms[fPar_SigmaBeam] * parms[fPar_SigmaBeam] + sigmad * sigmad);
28 
29  double dprime =
30  d - ((parms[fPar_X0] + z * parms[fPar_dxdz]) * sin(phi) - (parms[fPar_Y0] + z * parms[fPar_dydz]) * cos(phi));
31 
32  double result = (exp(-(dprime * dprime) / (2.0 * sig * sig))) / (sig * fsqrt2pi);
33 
34  return result;
35 }
const double Pi
static const int fPar_dydz
Definition: BSpdfsFcn.h:46
static const int fPar_Y0
Definition: BSpdfsFcn.h:42
static const int fPar_X0
Definition: BSpdfsFcn.h:41
static const int fPar_dxdz
Definition: BSpdfsFcn.h:45
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static const int fPar_SigmaBeam
Definition: BSpdfsFcn.h:47
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
d
Definition: ztail.py:151

◆ PDFGauss_d_resolution()

double BSpdfsFcn::PDFGauss_d_resolution ( double  z,
double  d,
double  phi,
double  pt,
const std::vector< double > &  parms 
) const
private

Definition at line 38 of file BSpdfsFcn.cc.

References funct::cos(), ztail::d, JetChargeProducer_cfi::exp, fPar_c0, fPar_c1, fPar_dxdz, fPar_dydz, fPar_SigmaBeam, fPar_X0, fPar_Y0, phi, Pi, DiDispStaMuonMonitor_cfi::pt, mps_fire::result, funct::sin(), mathSSE::sqrt(), and z.

Referenced by operator()().

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

◆ PDFGauss_z()

double BSpdfsFcn::PDFGauss_z ( double  z,
double  sigmaz,
const std::vector< double > &  parms 
) const
private

Definition at line 60 of file BSpdfsFcn.cc.

References JetChargeProducer_cfi::exp, fPar_SigmaZ, fPar_Z0, Pi, mps_fire::result, mathSSE::sqrt(), and z.

Referenced by operator()().

60  {
61  //---------------------------------------------------------------------------
62  // PDF for z-vertex distribution. This distribution
63  // is parametrized by a simple normalized gaussian distribution.
64  //---------------------------------------------------------------------------
65  double fsqrt2pi = sqrt(2. * TMath::Pi());
66 
67  double sig = sqrt(sigmaz * sigmaz + parms[fPar_SigmaZ] * parms[fPar_SigmaZ]);
68  //double sig = sqrt(sigmaz*sigmaz+parms[1]*parms[1]);
69  double result = (exp(-((z - parms[fPar_Z0]) * (z - parms[fPar_Z0])) / (2.0 * sig * sig))) / (sig * fsqrt2pi);
70  //double result = (exp(-((z-parms[0])*(z-parms[0]))/(2.0*sig*sig)))/(sig*fsqrt2pi);
71 
72  return result;
73 }
const double Pi
static const int fPar_SigmaZ
Definition: BSpdfsFcn.h:44
T sqrt(T t)
Definition: SSEVec.h:19
static const int fPar_Z0
Definition: BSpdfsFcn.h:43

◆ SetData()

void BSpdfsFcn::SetData ( const std::vector< BSTrkParameters > &  a_BSvector)
inline

Definition at line 25 of file BSpdfsFcn.h.

References fBSvector.

25 { fBSvector = a_BSvector; };
std::vector< BSTrkParameters > fBSvector
Definition: BSpdfsFcn.h:39

◆ SetPDFs()

void BSpdfsFcn::SetPDFs ( std::string  usepdfs)
inline

Definition at line 27 of file BSpdfsFcn.h.

References fusepdfs.

27 { fusepdfs = usepdfs; }
std::string fusepdfs
Definition: BSpdfsFcn.h:38

◆ Up()

double BSpdfsFcn::Up ( ) const
inlineoverride

Definition at line 30 of file BSpdfsFcn.h.

30 { return 1.; }

Member Data Documentation

◆ fBSvector

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

Definition at line 39 of file BSpdfsFcn.h.

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

◆ fPar_c0

const int BSpdfsFcn::fPar_c0 = 7
staticprivate

Definition at line 48 of file BSpdfsFcn.h.

Referenced by PDFGauss_d_resolution().

◆ fPar_c1

const int BSpdfsFcn::fPar_c1 = 8
staticprivate

Definition at line 49 of file BSpdfsFcn.h.

Referenced by PDFGauss_d_resolution().

◆ fPar_dxdz

const int BSpdfsFcn::fPar_dxdz = 4
staticprivate

Definition at line 45 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

◆ fPar_dydz

const int BSpdfsFcn::fPar_dydz = 5
staticprivate

Definition at line 46 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

◆ fPar_SigmaBeam

const int BSpdfsFcn::fPar_SigmaBeam = 6
staticprivate

Definition at line 47 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

◆ fPar_SigmaZ

const int BSpdfsFcn::fPar_SigmaZ = 3
staticprivate

Definition at line 44 of file BSpdfsFcn.h.

Referenced by PDFGauss_z().

◆ fPar_X0

const int BSpdfsFcn::fPar_X0 = 0
staticprivate

Definition at line 41 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

◆ fPar_Y0

const int BSpdfsFcn::fPar_Y0 = 1
staticprivate

Definition at line 42 of file BSpdfsFcn.h.

Referenced by PDFGauss_d(), and PDFGauss_d_resolution().

◆ fPar_Z0

const int BSpdfsFcn::fPar_Z0 = 2
staticprivate

Definition at line 43 of file BSpdfsFcn.h.

Referenced by PDFGauss_z().

◆ fusepdfs

std::string BSpdfsFcn::fusepdfs
private

Definition at line 38 of file BSpdfsFcn.h.

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