10 #include "GaudiKernel/MsgStream.h"
33 m_containedChildRots.push_back(rot->
clone());
35 if (compROT.m_globalPosition) {
36 m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
42 std::vector<const InDet::SCT_ClusterOnTrack*>&& childrots,
43 std::vector<AssignmentProb>&& assgnProb
48 , m_containedChildRots(std::move(childrots))
58 if (
this != &compROT) {
81 if (
this != &compROT) {
85 clearChildRotVector();
86 m_containedChildRots = std::move(compROT.m_containedChildRots);
87 m_globalPosition = std::move(compROT.m_globalPosition);
110 <<
"] competing RIO_OnTrack objects" << std::endl;
113 <<
" (given prob>cut)" << std::endl;
115 out <<
" - GlobalPosition : ";
128 <<
"] competing RIO_OnTrack objects" << std::endl;
131 <<
" (given prob>cut)" << std::endl;
133 out <<
" - GlobalPosition : ";
135 out <<
"null pointer" << std::endl;
156 nNonVanishingROTs += 1;
161 meanWeightMatrix.setZero();
163 if (nNonVanishingROTs > 1) {
177 meanParams = meanWeightMatrix.inverse() * meanParams;
180 }
else if (paramKey == 3) {
181 double meanTheta = 0.;
182 double meanEigen1 = 0.;
183 double meanEigen2 = 0.;
184 double sumAssignProb = 0.;
185 double meanMeasX = 0.;
186 double meanMeasY = 0.;
191 sumAssignProb += assignProb;
192 const double trace = covMat(0, 0) + covMat(1, 1);
193 const double det = covMat(0, 0) * covMat(1, 1) - covMat(0, 1) * covMat(1, 0);
194 const double lambda1 = trace / 2. - sqrt(trace * trace / 4. -
det);
195 const double lambda2 = trace / 2. + sqrt(trace * trace / 4. -
det);
197 assignProb * 0.5 *
atan(2. * covMat(0, 1) / (covMat(0, 0) - covMat(1, 1)));
198 meanEigen1 += assignProb / lambda1;
199 meanEigen2 += assignProb / lambda2;
204 meanTheta /= sumAssignProb;
205 meanMeasX /= meanEigen1;
206 meanMeasY /= meanEigen2;
208 const double cosTheta =
cos(meanTheta);
209 const double sinTheta =
sin(meanTheta);
211 meanWeightMatrix.setZero();
212 meanWeightMatrix(0, 0) =
213 cosTheta * cosTheta * meanEigen1 + sinTheta * sinTheta * meanEigen2;
214 meanWeightMatrix(1, 1) =
215 cosTheta * cosTheta * meanEigen2 + sinTheta * sinTheta * meanEigen1;
216 meanWeightMatrix(0, 1) =
217 cosTheta * sinTheta * meanEigen1 - cosTheta * sinTheta * meanEigen2;
218 meanWeightMatrix(1, 0) = meanWeightMatrix(0, 1);
222 int orderInput = (weightMatrix_maxIndex(0, 0) > weightMatrix_maxIndex(1, 1)) ? -1 : 1;
223 int orderOutput = (meanWeightMatrix(0, 0) > meanWeightMatrix(1, 1)) ? -1 : 1;
224 if (orderInput * orderOutput < 0) {
225 std::cout <<
"Trk::CompetingSCT_ClustersOnTrack: order of dimensions "
233 std::cout <<
"Trk::CompetingSCT_ClustersOnTrack: can not handle parameter key "
234 << paramKey << std::endl;
244 if (meanWeightMatrix.trace() <= 1.0e-15) {
245 for (
int i = 0;
i < meanWeightMatrix.cols(); ++
i)
246 meanWeightMatrix(
i,
i) = 1.0e-10;
252 std::cout <<
"Trk::CompetingRIOsOnTrack: can not handle ROTs in different "
253 "surfaces without detector specific knowledge "