Skip to content
Snippets Groups Projects
Commit a8761457 authored by Andreas Stefl's avatar Andreas Stefl Committed by Paul Gessinger
Browse files
parent 593b2c06
No related branches found
No related tags found
No related merge requests found
......@@ -54,34 +54,6 @@ public:
return Acts::Result<Acts::Vector3>::success(bfield);
}
Acts::Result<Acts::Vector3>
getFieldGradient(const Acts::Vector3& position,
Acts::ActsMatrix<3, 3>& gradient,
Acts::MagneticFieldProvider::Cache& gcache) const override
{
Cache& cache = gcache.as<Cache>();
double posXYZ[3];
posXYZ[0] = position.x();
posXYZ[1] = position.y();
posXYZ[2] = position.z();
double BField[3];
double grad[9];
cache.fieldCache.getField(posXYZ, BField, grad);
// Magnetic field
Acts::Vector3 bfield{BField[0], BField[1],BField[2]};
Acts::ActsMatrix<3, 3> tempGrad;
tempGrad << grad[0], grad[1], grad[2], grad[3], grad[4], grad[5], grad[6], grad[7], grad[8];
gradient = tempGrad;
bfield *= m_bFieldUnit; // kT -> T;
gradient *= m_bFieldUnit;
return Acts::Result<Acts::Vector3>::success(bfield);
}
private:
const double m_bFieldUnit = 1000.*Acts::UnitConstants::T;
};
......
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