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