GlobalTrackFitter methods: access to the matrix of derivatives used during the latest track fit.
45 {
46
47 if (!fitState.hasMeasurements() || !fitState.parameters) {
48 return nullptr;
49 }
50
51 int numberParameters = 5;
53 numberParameters = fitState.parameters->numberParameters();
54 }
56
57 for (const FitMeasurement* m : fitState.getMeasurements()) {
58 if (!
m->isPositionMeasurement()) {
59 continue;
60 }
61 rows +=
m->numberDoF();
62 }
63
64 if (!numberParameters || !rows) {
65 return nullptr;
66 }
67
69 << " measurement objects giving " << rows
70 << " rows and " << numberParameters
71 << " columns (parameters)");
72
73 auto derivativeMatrix =
74 std::make_unique<Amg::MatrixX>(rows, numberParameters);
76 for (const FitMeasurement* m : fitState.getMeasurements()) {
77 if (!
m->numberDoF() || !
m->isPositionMeasurement()) {
78 continue;
79 }
81 if (
m->weight() > 0.) {
82 norm = 1. /
m->weight();
83 }
84
85 for (int col = 0; col < numberParameters; ++col) {
86 (*derivativeMatrix)(
row, col) = norm *
m->derivative(col);
87 }
88
89
90 (*derivativeMatrix)(
row, 4) *= Gaudi::Units::TeV;
91 if (fitState.parameters->fitEnergyDeposit()) {
92 (*derivativeMatrix)(
row, 5) *= Gaudi::Units::TeV;
93 }
95 if (
m->numberDoF() < 2) {
96 continue;
97 }
98
99
101 if (
m->weight2() > 0.)
102 norm = 1. /
m->weight2();
103 for (int col = 0; col < numberParameters; ++col) {
104 (*derivativeMatrix)(
row, col) = norm *
m->derivative2(col);
105 }
106 (*derivativeMatrix)(
row, 4) *= Gaudi::Units::TeV;
107 if (fitState.parameters->fitEnergyDeposit()) {
108 (*derivativeMatrix)(
row, 5) *= Gaudi::Units::TeV;
109 }
111 }
112
113 if (row != rows) {
114 ATH_MSG_WARNING(
"iPatGlobalFitter: inconsistent #rows in deriv matrix ");
115 }
116
117 return derivativeMatrix;
118}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_allParameters
row
Appending html table to final .html summary file.