14 return weights<1>(recHit);
16 return weights<2>(recHit);
18 return weights<3>(recHit);
20 return weights<4>(recHit);
22 return weights<5>(recHit);
27 template <
unsigned int D>
33 using ROOT::Math::SMatrixNoInit;
37 edm::LogError(
"EmptyPredictedComponents") <<
"a multi state is empty. cannot compute any weight.";
42 std::vector<double> detRs;
44 std::vector<double> chi2s;
48 SMatDD
V(SMatrixNoInit{}),
R(SMatrixNoInit{});
54 double chi2Min(DBL_MAX);
66 edm::LogError(
"PosteriorWeightsCalculator") <<
"PosteriorWeightsCalculator: determinant failed";
67 return std::vector<double>();
69 detRs.push_back(detR);
73 edm::LogError(
"PosteriorWeightsCalculator") <<
"PosteriorWeightsCalculator: inversion failed";
74 return std::vector<double>();
76 double chi2 = ROOT::Math::Similarity(r, R);
77 chi2s.push_back(chi2);
83 edm::LogError(
"PosteriorWeightsCalculator") <<
"Problem in vector sizes";
84 return std::vector<double>();
92 double sumWeights(0.);
96 double chi2 = chi2s[
i] - chi2Min;
98 double tempWeight(0.);
99 if (detRs[
i] > FLT_MIN) {
106 LogDebug(
"GsfTrackFitters") <<
"PosteriorWeightsCalculator: detR < FLT_MIN !!";
108 weights.push_back(tempWeight);
109 sumWeights += tempWeight;
112 if (sumWeights < DBL_MIN) {
113 LogDebug(
"GsfTrackFitters") <<
"PosteriorWeightsCalculator: sumWeight < DBL_MIN";
114 edm::LogError(
"PosteriorWeightsCalculator") <<
"PosteriorWeightsCalculator: sumWeight < DBL_MIN";
115 return std::vector<double>();
119 edm::LogError(
"PosteriorWeightsCalculator") <<
"Problem in vector sizes (2)";
120 return std::vector<double>();
122 sumWeights = 1. / sumWeights;
123 for (
auto&
w : weights)
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.
Exp< T >::type exp(const T &t)
Log< level::Error, false > LogError
ROOT::Math::SMatrix< double, D1, D2, ROOT::Math::MatRepStd< double, D1, D2 > > Matrix
std::vector< TSOS > predictedComponents
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SVector< double, D1 > Vector