2 #include "Math/SVector.h" 3 #include "Math/SMatrix.h" 33 unsigned int nVtx = 0;
37 for (vector<BeamSpotFitPVData>::const_iterator ipv =
data_.begin(); ipv !=
data_.end(); ++ipv) {
38 v1 = (*ipv).position[0];
41 v2 = (*ipv).position[1];
44 v3 = (*ipv).position[2];
61 double sigb1 = pars[3];
62 double corrb12 = pars[4];
63 double sigb2 = pars[5];
64 double dxdz = pars[6];
65 double dydz = pars[7];
66 double sigb3 = pars[8];
67 double escale = pars[9];
71 typedef ROOT::Math::SVector<double, 3> Vector3D;
72 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > Matrix3D;
74 double varb1 = sigb1 * sigb1;
75 double varb2 = sigb2 * sigb2;
76 double varb3 = sigb3 * sigb3;
79 covb(1, 0) = covb(0, 1) = corrb12 * sigb1 * sigb2;
81 covb(2, 0) = covb(0, 2) = dxdz * (varb3 - varb1) - dydz * covb(1, 0);
82 covb(2, 1) = covb(1, 2) = dydz * (varb3 - varb2) - dxdz * covb(1, 0);
107 for (vector<BeamSpotFitPVData>::const_iterator ipv =
data_.begin(); ipv !=
data_.end(); ++ipv) {
111 v1 = (*ipv).position[0];
114 v2 = (*ipv).position[1];
117 v3 = (*ipv).position[2];
123 ev1 = (*ipv).posError[0];
124 corr12 = (*ipv).posCorr[0];
125 ev2 = (*ipv).posError[1];
126 corr13 = (*ipv).posCorr[1];
127 corr23 = (*ipv).posCorr[2];
128 ev3 = (*ipv).posError[2];
135 cov(0, 0) = ev1 *
ev1;
136 cov(1, 0) = cov(0, 1) = ev1 * ev2 * corr12;
137 cov(1, 1) = ev2 *
ev2;
138 cov(2, 0) = cov(0, 2) = ev1 * ev3 * corr13;
139 cov(2, 1) = cov(1, 2) = ev2 * ev3 * corr23;
140 cov(2, 2) = ev3 * ev3;
146 wgt = cov.Inverse(ifail);
149 cout <<
"Inversion failed" << endl;
162 sumLL += ROOT::Math::Similarity(dv, wgt);
FcnBeamSpotFitPV(const std::vector< BeamSpotFitPVData > &data)
double operator()(const std::vector< double > &) const override
void setLimits(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
char data[epos_bytes_allocation]
unsigned int nrOfVerticesUsed() const
const std::vector< BeamSpotFitPVData > & data_