From 004e686fa2dce888d33b5636dd67c85536ce9609 Mon Sep 17 00:00:00 2001 From: mcoquet642 Date: Wed, 2 Nov 2022 10:55:00 +0100 Subject: [PATCH 1/3] Adding protection to the fwdtrack table columns --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 03b55638276b7..003af91a5bd31 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -433,7 +433,7 @@ DECLARE_SOA_EXPRESSION_COLUMN(Eta, eta, float, //! DECLARE_SOA_EXPRESSION_COLUMN(Pt, pt, float, //! ifnode(nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0, o2::constants::math::VeryBig, nabs(1.f / aod::fwdtrack::signed1Pt))); DECLARE_SOA_EXPRESSION_COLUMN(P, p, float, //! - ifnode(nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0, o2::constants::math::VeryBig, 0.5f * (ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) + 1.f / ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))) / nabs(aod::fwdtrack::signed1Pt))); + ifnode((nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0) || (nabs(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) < o2::constants::math::Almost0), o2::constants::math::VeryBig, 0.5f * (ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) + 1.f / ntan(PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))) / nabs(aod::fwdtrack::signed1Pt))); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! [](float pt, float phi) -> float { return pt * std::cos(phi); From 04b8c997846191abbe44ee04506b74d7fae4d737 Mon Sep 17 00:00:00 2001 From: mcoquet642 Date: Wed, 30 Nov 2022 17:34:55 +0100 Subject: [PATCH 2/3] Fixing MFT-MCH refit --- .../include/GlobalTracking/MatchGlobalFwd.h | 6 +++- .../GlobalTracking/MatchGlobalFwdParam.h | 2 ++ .../GlobalTracking/src/MatchGlobalFwd.cxx | 28 ++++++------------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h index 3aec606a6c5c3..e6e6985876965 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h @@ -163,6 +163,9 @@ class MatchGlobalFwd void fitGlobalMuonTrack(o2::dataformats::GlobalFwdTrack&); ///< Kalman filter fit global Forward track by attaching MFT clusters bool computeCluster(o2::dataformats::GlobalFwdTrack& track, const MFTCluster& cluster, int& startingLayerID); + void setMFTRadLength(float MFT_x2X0) { mMFTDiskThicknessInX0 = MFT_x2X0 / 5.0; } + void setAlignResiduals(Float_t res) { mAlignResidual = res; } + template bool propagateToNextClusterWithMCS(T& track, double z, int& startingLayerID, const int& newLayerID) { @@ -279,7 +282,8 @@ class MatchGlobalFwd float mBz = -5.f; ///< nominal Bz in kGauss float mMatchingPlaneZ = sLastMFTPlaneZ; ///< MCH-MFT matching plane Z position - Float_t mMFTDiskThicknessInX0 = 0.042 / 5; + Float_t mMFTDiskThicknessInX0 = 0.042 / 5; ///< MFT disk thickness in radiation length + Float_t mAlignResidual = 1; ///< Alignment residual for cluster position uncertainty o2::InteractionRecord mStartIR{0, 0}; ///< IR corresponding to the start of the TF int mMFTROFrameLengthInBC = 0; ///< MFT RO frame in BC (for MFT cont. mode only) float mMFTROFrameLengthMUS = -1.; ///< MFT RO frame in \mus diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h index 428fed0095bc8..9ba6563cec334 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h @@ -39,6 +39,8 @@ struct GlobalFwdMatchingParam : public o2::conf::ConfigurableParamHelper MFT global X coordinate (ALPIDE rows) - const auto& sigmaY2 = cluster.getSigmaZ2(); // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns) + const auto& sigmaX2 = cluster.getSigmaY2() * mAlignResidual * mAlignResidual;; // ALPIDE local Y coordinate => MFT global X coordinate (ALPIDE rows) + const auto& sigmaY2 = cluster.getSigmaZ2() * mAlignResidual * mAlignResidual;; // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns) const auto& newLayerID = mMFTMapping.ChipID2Layer[cluster.getSensorID()]; LOG(debug) << "computeCluster: X = " << clx << " Y = " << cly << " Z = " << clz << " nCluster = " << newLayerID; From 3f7753042909d0709d4d0dd9fc6b862c7d3e52ef Mon Sep 17 00:00:00 2001 From: mcoquet642 Date: Wed, 30 Nov 2022 17:39:25 +0100 Subject: [PATCH 3/3] Clang format --- .../GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h | 2 +- Detectors/GlobalTracking/src/MatchGlobalFwd.cxx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h index e6e6985876965..ef045adc5bd6f 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h @@ -283,7 +283,7 @@ class MatchGlobalFwd float mBz = -5.f; ///< nominal Bz in kGauss float mMatchingPlaneZ = sLastMFTPlaneZ; ///< MCH-MFT matching plane Z position Float_t mMFTDiskThicknessInX0 = 0.042 / 5; ///< MFT disk thickness in radiation length - Float_t mAlignResidual = 1; ///< Alignment residual for cluster position uncertainty + Float_t mAlignResidual = 1; ///< Alignment residual for cluster position uncertainty o2::InteractionRecord mStartIR{0, 0}; ///< IR corresponding to the start of the TF int mMFTROFrameLengthInBC = 0; ///< MFT RO frame in BC (for MFT cont. mode only) float mMFTROFrameLengthMUS = -1.; ///< MFT RO frame in \mus diff --git a/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx b/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx index 28d5cfccdd241..f4a8389f47165 100644 --- a/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx +++ b/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx @@ -27,7 +27,6 @@ void MatchGlobalFwd::init() setAlignResiduals(matchingParam.alignResidual); LOG(info) << "MFT Align residuals = " << mAlignResidual; - mMatchingPlaneZ = matchingParam.matchPlaneZ; LOG(info) << "MFTMCH matchingPlaneZ = " << mMatchingPlaneZ; @@ -596,8 +595,10 @@ bool MatchGlobalFwd::computeCluster(o2::dataformats::GlobalFwdTrack& track, cons const auto& clx = cluster.getX(); const auto& cly = cluster.getY(); const auto& clz = cluster.getZ(); - const auto& sigmaX2 = cluster.getSigmaY2() * mAlignResidual * mAlignResidual;; // ALPIDE local Y coordinate => MFT global X coordinate (ALPIDE rows) - const auto& sigmaY2 = cluster.getSigmaZ2() * mAlignResidual * mAlignResidual;; // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns) + const auto& sigmaX2 = cluster.getSigmaY2() * mAlignResidual * mAlignResidual; + ; // ALPIDE local Y coordinate => MFT global X coordinate (ALPIDE rows) + const auto& sigmaY2 = cluster.getSigmaZ2() * mAlignResidual * mAlignResidual; + ; // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns) const auto& newLayerID = mMFTMapping.ChipID2Layer[cluster.getSensorID()]; LOG(debug) << "computeCluster: X = " << clx << " Y = " << cly << " Z = " << clz << " nCluster = " << newLayerID;