15 #include <boost/io/ios_state.hpp>
27 , m_assignProb(std::move(assgnProb))
37 if (ROTsHaveCommonSurface()) {
41 assignmentProbability(0) * rioOnTrack(0).localCovariance().inverse();
42 for (
unsigned int i = 1;
i < numberOfContainedROTs();
i++) {
43 meanWeightMatrix += assignmentProbability(
i) * rioOnTrack(
i).localCovariance().inverse();
48 if (meanWeightMatrix.trace() <= 1.0e-15) {
50 rioOnTrack(0).localCovariance().
cols());
51 meanWeightMatrix.setZero();
52 for (
int i = 0;
i < meanWeightMatrix.cols(); ++
i) {
53 meanWeightMatrix(
i,
i) = 1.0e-10;
57 m_localCovariance = meanWeightMatrix.inverse();
60 if (numberOfContainedROTs() == 1) {
61 m_localParams = rioOnTrack(0).localParameters();
65 assignmentProbability(0) *
weight * rioOnTrack(0).localParameters();
66 for (
unsigned int i = 1;
i < numberOfContainedROTs();
i++) {
67 weight = rioOnTrack(
i).localCovariance().inverse();
69 meanParams + assignmentProbability(
i) *
weight * rioOnTrack(
i).localParameters();
72 meanParams = localCovariance() * meanParams;
74 int paramKey = rioOnTrack(0).localParameters().parameterKey();
78 }
else if (paramKey == 3) {
83 std::cout <<
"Trk::CompetingRIOsOnTrack: can not handle parameter key " << paramKey
94 <<
"Trk::CompetingRIOsOnTrack: can not handle ROTs in different surfaces without "
95 "detector specific knowledge "
103 unsigned int index = 0;
104 double maxAssgnProb = 0;
105 for (
unsigned int i = 0;
i < numberOfContainedROTs();
i++) {
106 if (m_assignProb[
i] >= maxAssgnProb) {
108 maxAssgnProb = m_assignProb[
i];
118 boost::io::ios_all_saver ias(
out.stream());
119 out <<
" - effective pars locX : ";
126 out <<
"ill-defined! They are " << m_localParams;
132 << std::setiosflags(std::ios::fixed) << std::resetiosflags(std::ios::scientific)
133 << std::setprecision(6);
135 unsigned int indexOfMaxProb = indexOfMaxAssignProb();
136 out <<
" - Contains: |ROT# identifier locX dLocX locY dlocY "
138 for (
unsigned int i = 0;
i < this->numberOfContainedROTs(); ++
i) {
140 <<
" | " <<
i <<
" " << this->rioOnTrack(
i).identify() <<
" ";
142 out << std::setw(10) << this->rioOnTrack(
i).localParameters()[
Trk::locX] <<
" "
147 if (this->rioOnTrack(
i).localParameters().contains(
Trk::locY)) {
148 out <<
" " << std::setw(10) << this->rioOnTrack(
i).localParameters()[
Trk::locY] <<
" "
153 out <<
" " << m_assignProb.at(
i) << (indexOfMaxProb ==
i ?
" **|" :
" |");
162 boost::io::ios_all_saver ias(
out);
163 out <<
" - effective pars locX : ";
170 out <<
"ill-defined! They are " << m_localParams;
176 << std::setiosflags(std::ios::fixed) << std::resetiosflags(std::ios::scientific)
177 << std::setprecision(6);
180 unsigned int indexOfMaxProb = indexOfMaxAssignProb();
181 out <<
" - Contains: |ROT# identifier locX dLocX locY dlocY "
183 for (
unsigned int i = 0;
i < this->numberOfContainedROTs(); ++
i) {
185 <<
" | " <<
i <<
" " << this->rioOnTrack(
i).identify() <<
" ";
187 out << std::setw(10) << this->rioOnTrack(
i).localParameters()[
Trk::locX] <<
" "
192 if (this->rioOnTrack(
i).localParameters().contains(
Trk::locY)) {
193 out <<
" " << std::setw(10) << this->rioOnTrack(
i).localParameters()[
Trk::locY] <<
" "
198 out <<
" " << m_assignProb.at(
i) << (indexOfMaxProb ==
i ?
" **|" :
" |");