2 #include "Math/SVector.h"
3 #include "Math/SMatrix.h"
13 data_(data), errorDef_(1.) {
40 unsigned int nVtx = 0;
44 for ( vector<BeamSpotFitPVData>::const_iterator ipv=
data_.begin();
45 ipv!=
data_.end(); ++ipv ) {
46 v1 = (*ipv).position[0];
48 v2 = (*ipv).position[1];
50 v3 = (*ipv).position[2];
68 double sigb1 = pars[3];
69 double corrb12 = pars[4];
70 double sigb2 = pars[5];
71 double dxdz = pars[6];
72 double dydz = pars[7];
73 double sigb3 = pars[8];
74 double escale = pars[9];
78 typedef ROOT::Math::SVector<double,3> Vector3D;
79 typedef ROOT::Math::SMatrix<double,3,3,ROOT::Math::MatRepSym<double,3> > Matrix3D;
81 double varb1 = sigb1*sigb1;
82 double varb2 = sigb2*sigb2;
83 double varb3 = sigb3*sigb3;
86 covb(1,0) = covb(0,1) = corrb12*sigb1*sigb2;
88 covb(2,0) = covb(0,2) = dxdz*(varb3-varb1)-dydz*covb(1,0);
89 covb(2,1) = covb(1,2) = dydz*(varb3-varb2)-dxdz*covb(1,0);
114 for ( vector<BeamSpotFitPVData>::const_iterator ipv=
data_.begin();
115 ipv!=
data_.end(); ++ipv ) {
119 v1 = (*ipv).position[0];
121 v2 = (*ipv).position[1];
123 v3 = (*ipv).position[2];
128 ev1 = (*ipv).posError[0];
129 corr12 = (*ipv).posCorr[0];
130 ev2 = (*ipv).posError[1];
131 corr13 = (*ipv).posCorr[1];
132 corr23 = (*ipv).posCorr[2];
133 ev3 = (*ipv).posError[2];
141 cov(1,0) = cov(0,1) = ev1*ev2*corr12;
143 cov(2,0) = cov(0,2) = ev1*ev3*corr13;
144 cov(2,1) = cov(1,2) = ev2*ev3*corr23;
151 wgt = cov.Inverse(ifail);
154 cout <<
"Inversion failed" << endl;
167 sumLL += ROOT::Math::Similarity(dv,wgt);
FcnBeamSpotFitPV(const std::vector< BeamSpotFitPVData > &data)
double operator()(const std::vector< double > &) const
void setLimits(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
unsigned int nrOfVerticesUsed() const
const std::vector< BeamSpotFitPVData > & data_