Commit d256321b authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Adding method to geosvc for Field

parent f4513352
......@@ -35,6 +35,8 @@ public:
virtual dd4hep::Detector* detector() = 0;
virtual std::shared_ptr<const dd4hep::rec::CellIDPositionConverter> cellIDPositionConverter() const = 0;
virtual std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry() const = 0;
virtual double centralMagneticField() const = 0;
// receive Geant4 Geometry
//virtual G4VUserDetectorConstruction* getGeant4Geo() = 0;
......
......@@ -57,6 +57,13 @@ public:
*/
virtual std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry() const;
virtual double centralMagneticField() const {
return m_dd4hepgeo->field().magneticField({0,0,0}).z();
}
;
private:
/// ACTS Tracking Geometry
......
......@@ -72,7 +72,7 @@ namespace Jug::Reco {
<< "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << endmsg;
return StatusCode::FAILURE;
}
m_BField = std::make_shared<Acts::ConstantBField>(Acts::Vector3D{0.0, 0.0, 1.0_T});
m_BField = std::make_shared<Acts::ConstantBField>(Acts::Vector3D{0.0, 0.0, m_geoSvc->centralMagneticField()});
m_fieldctx = BFieldVariant(m_BField);
m_sourcelinkSelectorCfg = {
{Acts::GeometryIdentifier(), {15, 10}},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment