13 case 1:
return weights<1>(recHit);
14 case 2:
return weights<2>(recHit);
15 case 3:
return weights<3>(recHit);
16 case 4:
return weights<4>(recHit);
17 case 5:
return weights<5>(recHit);
22 template<
unsigned int D>
28 using ROOT::Math::SMatrixNoInit;
32 edm::LogError(
"EmptyPredictedComponents")<<
"a multi state is empty. cannot compute any weight.";
37 std::vector<double> detRs;
39 std::vector<double> chi2s;
43 SMatDD V(SMatrixNoInit{}),
R(SMatrixNoInit{});
49 double chi2Min(DBL_MAX);
54 holder.template setup<D>(&
r, &V, &
p, &rMeas, &
R,
62 if (! R.Det2(detR) ) {
63 edm::LogError(
"PosteriorWeightsCalculator") <<
"PosteriorWeightsCalculator: determinant failed";
64 return std::vector<double>();
66 detRs.push_back(detR);
71 <<
"PosteriorWeightsCalculator: inversion failed";
72 return std::vector<double>();
74 double chi2 = ROOT::Math::Similarity(r,R);
75 chi2s.push_back(chi2);
76 if ( chi2<chi2Min ) chi2Min =
chi2;
81 edm::LogError(
"PosteriorWeightsCalculator") <<
"Problem in vector sizes";
82 return std::vector<double>();
90 double sumWeights(0.);
94 double chi2 = chi2s[
i] - chi2Min;
96 double tempWeight(0.);
97 if ( detRs[
i]>FLT_MIN ) {
105 LogDebug(
"GsfTrackFitters") <<
"PosteriorWeightsCalculator: detR < FLT_MIN !!";
107 weights.push_back(tempWeight);
108 sumWeights += tempWeight;
111 if ( sumWeights<DBL_MIN ) {
112 LogDebug(
"GsfTrackFitters") <<
"PosteriorWeightsCalculator: sumWeight < DBL_MIN";
113 edm::LogError(
"PosteriorWeightsCalculator") <<
"PosteriorWeightsCalculator: sumWeight < DBL_MIN";
114 return std::vector<double>();
118 edm::LogError(
"PosteriorWeightsCalculator") <<
"Problem in vector sizes (2)";
119 return std::vector<double>();
121 sumWeights = 1./sumWeights;
122 for (
auto &
w : weights)
w *= sumWeights;
virtual int dimension() const =0
virtual void getKfComponents(KfComponentsHolder &holder) const
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
std::vector< TSOS > predictedComponents
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SVector< double, D1 > Vector