Skip to content
Snippets Groups Projects
Commit 82c67f2a authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'GsfMeasurementUpdator_unneeded_allocations' into 'master'

GsfMeasurementUpdator:Remove un-needed allocations

See merge request atlas/athena!35593
parents 907fd5cf e3c4318e
No related branches found
No related tags found
No related merge requests found
......@@ -218,39 +218,33 @@ Trk::GsfMeasurementUpdator::calculateFilterStep(
std::abs(component.first->parameters()[Trk::qOverP]) > 0.033333) {
continue;
}
auto componentFitQuality = std::make_unique<Trk::FitQualityOnSurface>();
Trk::FitQualityOnSurface componentFitQuality;
/// Update the component in place
bool updateSuccess = m_updator.filterStep(*(component.first),
*componentFitQuality,
componentFitQuality,
measurement.localParameters(),
measurement.localCovariance(),
1);
if (!updateSuccess) {
if (componentFitQuality) {
componentFitQuality.reset();
}
continue;
}
if (invalidComponent(component.first.get())) {
componentFitQuality.reset();
continue;
}
if (!componentFitQuality || componentFitQuality->chiSquared() <= 0.) {
componentFitQuality.reset();
if (componentFitQuality.chiSquared() <= 0.) {
continue;
}
double componentChi2 = componentFitQuality->chiSquared();
double componentChi2 = componentFitQuality.chiSquared();
chiSquared += component.second * componentChi2;
// The same measurement is included in each update
// so we can update the degree of freedom only
if (degreesOfFreedom == 0.0) {
degreesOfFreedom = componentFitQuality->numberDoF();
degreesOfFreedom = componentFitQuality.numberDoF();
}
componentFitQuality.reset();
// Add component to state being prepared for assembly
MultiComponentStateAssembler::addComponent(cache, std::move(component));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment