From 396934707ddbcf4d73d5e80ef9ac4cf0b566aa4c Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Wed, 5 Aug 2026 17:28:07 +0200 Subject: [PATCH] [PWGDQ] added configurable magnetic feield z bias The z bias parameter allows to apply a longitudinal shift to the magnetic field map, which then affects all track extrapolations and refitting. --- PWGDQ/Tasks/global-muon-matcher.cxx | 6 ++++++ PWGDQ/Tasks/muonGlobalAlignment.cxx | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PWGDQ/Tasks/global-muon-matcher.cxx b/PWGDQ/Tasks/global-muon-matcher.cxx index 46ccbfcf553..ab91c5cae70 100644 --- a/PWGDQ/Tasks/global-muon-matcher.cxx +++ b/PWGDQ/Tasks/global-muon-matcher.cxx @@ -202,6 +202,9 @@ struct GlobalMuonMatching { Configurable cfgMFTAlignmentCorrYOffsetBottom{"cfgMFTAlignmentCorrYOffsetBottom", 0.f, "MFT Y offset correction - bottom half"}; } configMftAlignmentCorrections; + // Magnetic field position bias + Configurable cfgFieldOriginBiasZ{"cfgFieldOriginBiasZ", 0.0f, "Bias applied to the magnetic field z position"}; + // Variables for CCDB objects access and retrieval struct : ConfigurableGroup { Configurable cfgCcdbUrl{"cfgCcdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -755,6 +758,9 @@ struct GlobalMuonMatching { fCCDBApi.init(configCcdb.cfgCcdbUrl); mRunNumber = 0; + // configure magnetic field position bias + o2::conf::ConfigurableParam::setValue("FieldOriginBias.z", std::to_string(cfgFieldOriginBiasZ.value)); + // Configuration for track fitter const auto& trackerParam = mch::TrackerParam::Instance(); trackFitter.setBendingVertexDispersion(trackerParam.bendingVertexDispersion); diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index bdd60ef5717..7014a0ea0c7 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -148,6 +148,8 @@ struct muonGlobalAlignment { Configurable fMftTracksMultiplicityMax{"cfgMftTracksMultiplicityMax", 0, "Maximum number of MFT tracks to be processed per event (zero means no limit)"}; + // Magnetic field position bias + Configurable cfgFieldOriginBiasZ{"cfgFieldOriginBiasZ", 0.0f, "Bias applied to the magnetic field z position"}; Configurable fVertexZshift{"cfgVertexZshift", 0.0f, "Correction to the vertex z position"}; Configurable fDipoleZshift{"cfgDipoleZshift", 0.0f, "Correction to the dipole z position"}; @@ -418,10 +420,8 @@ struct muonGlobalAlignment { ccdbApi.init(configCCDB.ccdburl); mRunNumber = 0; - if (!o2::base::GeometryManager::isGeometryLoaded()) { - LOGF(info, "Load geometry from CCDB"); - ccdbManager->get(configCCDB.geoPath); - } + // configure magnetic field position bias + o2::conf::ConfigurableParam::setValue("FieldOriginBias.z", std::to_string(cfgFieldOriginBiasZ.value)); // Configuration for track fitter const auto& trackerParam = TrackerParam::Instance(); @@ -431,6 +431,9 @@ struct muonGlobalAlignment { trackFitter.useChamberResolution(); mImproveCutChi2 = 2. * configRealign.fSigmaCutImprove * configRealign.fSigmaCutImprove; + // use the Runge-Kutta extrapolation v2 + TrackExtrap::useExtrapV2(); + // Fill table of MCH alignment corrections rapidjson::Document document; // Check that the json is parsed correctly