diff --git a/Detectors/ITSMFT/MFT/CMakeLists.txt b/Detectors/ITSMFT/MFT/CMakeLists.txt index f5d6c95ff77dc..aac31e1740527 100644 --- a/Detectors/ITSMFT/MFT/CMakeLists.txt +++ b/Detectors/ITSMFT/MFT/CMakeLists.txt @@ -18,5 +18,6 @@ add_subdirectory(calibration) add_subdirectory(condition) add_subdirectory(assessment) add_subdirectory(alignment) +add_subdirectory(matching) o2_data_file(COPY data DESTINATION Detectors/Geometry/MFT/) diff --git a/Detectors/ITSMFT/MFT/matching/CMakeLists.txt b/Detectors/ITSMFT/MFT/matching/CMakeLists.txt new file mode 100644 index 0000000000000..970d01c6a6520 --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +o2_add_library(MFTMuonMatching + SOURCES src/MftMuonMatchingUtils.cxx + src/MatchingTagAndProbe.cxx + PUBLIC_LINK_LIBRARIES O2::CCDB + O2::DataFormatsMFT + O2::DetectorsCalibration + O2::DetectorsDCS + O2::GlobalTracking + O2::ReconstructionDataFormats + O2::DataFormatsGlobalTracking + Microsoft.GSL::GSL) diff --git a/Detectors/ITSMFT/MFT/matching/README.md b/Detectors/ITSMFT/MFT/matching/README.md new file mode 100644 index 0000000000000..54722cc2b8616 --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/README.md @@ -0,0 +1,4 @@ + +# MFT Matching diff --git a/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MatchingTagAndProbe.h b/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MatchingTagAndProbe.h new file mode 100644 index 0000000000000..7b3671d9e3a79 --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MatchingTagAndProbe.h @@ -0,0 +1,166 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// @file MatchingTagAndProbe.h + +#ifndef O2_MFT_MATCHING_TAG_AND_PROBE_H +#define O2_MFT_MATCHING_TAG_AND_PROBE_H + +/// @file MatchingTagAndProbe.h +/// @brief Template-based utility for finding Tag and Probe pairs in ALICE O2. + +#include + +#include "Math/SMatrix.h" +#include "Math/SVector.h" + +#include "TLorentzVector.h" + +#include "Framework/Logger.h" +#include "DetectorsBase/Propagator.h" +#include "MCHTracking/TrackExtrap.h" +#include "ReconstructionDataFormats/GlobalFwdTrack.h" +#include "GlobalTracking/MatchGlobalFwd.h" + +namespace o2 +{ +namespace mft +{ + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; + +template +class MatchingTagAndProbe +{ + private: + inline void fillCovarianceArray(MUON const& muontrack, float cov[15]) const + { + cov[0] = muontrack.cXX(); + cov[1] = muontrack.cXY(); + cov[2] = muontrack.cYY(); + cov[3] = muontrack.cPhiX(); + cov[4] = muontrack.cPhiY(); + cov[5] = muontrack.cPhiPhi(); + cov[6] = muontrack.cTglX(); + cov[7] = muontrack.cTglY(); + cov[8] = muontrack.cTglPhi(); + cov[9] = muontrack.cTglTgl(); + cov[10] = muontrack.c1PtX(); + cov[11] = muontrack.c1PtY(); + cov[12] = muontrack.c1PtPhi(); + cov[13] = muontrack.c1PtTgl(); + cov[14] = muontrack.c1Pt21Pt2(); + } + + inline void setTagAndProbe() + { + if (muontrack1.pt() > muontrack2.pt()) { + tagIdx = 0; + probeIdx = 1; + } else { + tagIdx = 1; + probeIdx = 0; + } + } + + o2::dataformats::GlobalFwdTrack muontrack_at_pv[2]; + TLorentzVector mDimuon; + MUON muontrack1; + MUON muontrack2; + Collision collision; + int tagIdx, probeIdx; + int16_t mQ; + + const float mMu = 0.105658; // Muon mass (GeV/c^2) + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV(MUON const& muontrack) const + { + const double mz = muontrack.z(); + const double mchi2 = muontrack.chi2(); + const float mx = muontrack.x(); + const float my = muontrack.y(); + const float mphi = muontrack.phi(); + const float mtgl = muontrack.tgl(); + const float m1pt = muontrack.signed1Pt(); + + float cov[15]; + + fillCovarianceArray(muontrack, cov); + + SMatrix5 tpars(mx, my, mphi, mtgl, m1pt); + SMatrix55 tcovs(cov, cov + 15); + + o2::track::TrackParCovFwd parcovmuontrack{mz, tpars, tcovs, mchi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + o2::globaltracking::MatchGlobalFwd mMatching; + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + o2::mch::TrackExtrap::extrapToVertex(mchtrack, + collision.posX(), + collision.posY(), + collision.posZ(), + collision.covXX(), + collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + public: + MatchingTagAndProbe(const MUON& muon1, const MUON& muon2, const Collision& coll) : muontrack1(muon1), muontrack2(muon2), collision(coll), tagIdx(-1), probeIdx(-1), mQ(0) + { + mQ = muontrack1.sign() + muontrack2.sign(); + setTagAndProbe(); + } + + inline void calcMuonPairAtPV() + { + muontrack_at_pv[0] = propagateMUONtoPV(muontrack1); + muontrack_at_pv[1] = propagateMUONtoPV(muontrack2); + TLorentzVector vMuon1, vMuon2; + vMuon1.SetPtEtaPhiM(muontrack_at_pv[0].getPt(), + muontrack_at_pv[0].getEta(), + muontrack_at_pv[0].getPhi(), + mMu); + vMuon2.SetPtEtaPhiM(muontrack_at_pv[1].getPt(), + muontrack_at_pv[1].getEta(), + muontrack_at_pv[1].getPhi(), + mMu); + mDimuon = vMuon1 + vMuon2; + } + + inline int getTagMuonIndex() const { return tagIdx; } + inline int getProbeMuonIndex() const { return probeIdx; } + inline float getMass() const { return mDimuon.M(); } + inline float getPt() const { return mDimuon.Pt(); } + inline float getRap() const { return mDimuon.Rapidity(); } + inline int16_t getCharge() const { return mQ; } + inline const o2::dataformats::GlobalFwdTrack& getMuonAtPV(int idx) const + { + return muontrack_at_pv[idx]; + } +}; // end of class MatchingTagAndProbe + +} // namespace mft +} // namespace o2 + +#endif // O2_MFT_MATCHING_TAG_AND_PROBE_H diff --git a/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MftMuonMatchingUtils.h b/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MftMuonMatchingUtils.h new file mode 100644 index 0000000000000..a750b6672e5de --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/include/MFTMuonMatching/MftMuonMatchingUtils.h @@ -0,0 +1,390 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// @file MftMuonMatchingUtils.h + +#ifndef O2_MFT_MUON_MATCHING_UTILS_H +#define O2_MFT_MUON_MATCHING_UTILS_H + +/// @file MftMuonMatchingUtils.h +/// @brief Template-based utilities for MFT-MUON matching in ALICE O2. + +#include +#include + +#include +#include + +#include "Math/SMatrix.h" +#include "Math/SVector.h" +#include "TGeoManager.h" +#include "TDatabasePDG.h" + +#include "Framework/Logger.h" +#include "Field/MagneticField.h" +#include "DetectorsBase/Propagator.h" +#include "DataFormatsMFT/TrackMFT.h" +#include "DataFormatsMCH/TrackMCH.h" +#include "DataFormatsMCH/ROFRecord.h" +#include "DataFormatsITSMFT/ROFRecord.h" +#include "DataFormatsITSMFT/TopologyDictionary.h" +#include "DataFormatsGlobalTracking/RecoContainer.h" +#include "ReconstructionDataFormats/TrackFwd.h" +#include "ReconstructionDataFormats/Track.h" +#include "ReconstructionDataFormats/GlobalFwdTrack.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/MatchInfoFwd.h" +#include "ReconstructionDataFormats/TrackMCHMID.h" +#include "ReconstructionDataFormats/GlobalFwdTrack.h" +#include "CommonDataFormat/InteractionRecord.h" +#include "GlobalTracking/MatchGlobalFwdParam.h" +#include "GlobalTracking/MatchGlobalFwd.h" +#include "DetectorsBase/GeometryManager.h" + +namespace o2 +{ +namespace mft +{ + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; + +constexpr double pi = 3.14159265358979323846; + +template +class MftMuonMatchingUtils +{ + private: + MUON muontrack; + MFT mfttrack; + Collision collision; + + float mDX, mDY, mDPt, mDPhi, mDEta, mDInvPt, mDTanl; + float mGlobalMuonPAtDCA, mGlobalMuonPtAtDCA, mGlobalMuonEtaAtDCA, mGlobalMuonPhiAtDCA, mGlobalMuonDCAx, mGlobalMuonDCAy; + + float mMatchingMFTX, mMatchingMFTY, mMatchingMFTEta, mMatchingMFTPhi, mMatchingMFTPt, mMatchingMFTInvPt, mMatchingMFTTanl; + float mMatchingMuonX, mMatchingMuonY, mMatchingMuonEta, mMatchingMuonPhi, mMatchingMuonPt, mMatchingMuonInvPt, mMatchingMuonTanl; + + bool mUseMuonInfoToMFTExtrap; + + int mGlobalMuonQ; + int mMatchingType; + + o2::field::MagneticField* fieldB; + o2::globaltracking::MatchGlobalFwd mMatching; + + inline o2::track::TrackParCovFwd propagateMFTtoMatchingPlane(bool usemch) + { + + double covArr[15]{0.0}; + SMatrix55 tmftcovs; + std::copy(std::begin(covArr), std::end(covArr), tmftcovs.Array()); + + float total_signed1pt = 0; + + if (usemch) { + auto muontrack_at_pv = propagateMUONtoPV(); + float total_p = muontrack_at_pv.getP(); + float mft_theta = pi / 2. - std::atan(mfttrack.tgl()); + + float total_px = total_p * std::sin(mft_theta) * std::cos(mfttrack.phi()); + float total_py = total_p * std::sin(mft_theta) * std::sin(mfttrack.phi()); + float total_pt = std::hypot(total_px, total_py); + total_signed1pt = muontrack.sign() / total_pt; + } else { + total_signed1pt = mfttrack.signed1Pt(); + } + + SMatrix5 tmftpars(mfttrack.x(), + mfttrack.y(), + mfttrack.phi(), + mfttrack.tgl(), + total_signed1pt); + + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), + tmftpars, + tmftcovs, + mfttrack.chi2()}; + + double propVec[3] = {0.}; + + float zPlane = 0.f; + if (mMatchingType == MCH_FIRST_CLUSTER) { + propVec[0] = muontrack.x() - mfttrack.x(); + propVec[1] = muontrack.y() - mfttrack.y(); + propVec[2] = muontrack.z() - mfttrack.z(); + zPlane = muontrack.z(); + } else if (mMatchingType == END_OF_ABSORBER || mMatchingType == BEGINNING_OF_ABSORBER) { + auto extrap_muontrack = propagateMUONtoMatchingPlane(); + propVec[0] = extrap_muontrack.getX() - mfttrack.x(); + propVec[1] = extrap_muontrack.getY() - mfttrack.y(); + propVec[2] = extrap_muontrack.getZ() - mfttrack.z(); + zPlane = (mMatchingType == END_OF_ABSORBER) ? -505.f : -90.f; + } else { + zPlane = mfttrack.z(); + } + + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., + mfttrack.y() + propVec[1] / 2., + mfttrack.z() + propVec[2] / 2.}; + + float Bz = fieldB->getBz(centerZ); + extrap_mfttrack.propagateToZ(zPlane, Bz); // z in cm + return extrap_mfttrack; + } + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoMatchingPlane() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), + muontrack.y(), + muontrack.phi(), + muontrack.tgl(), + muontrack.signed1Pt()); + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + if (mMatchingType == MFT_LAST_CLUSTR) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, mfttrack.z()); + } else if (mMatchingType == END_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -505.); + } else if (mMatchingType == BEGINNING_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -90.); + } else if (mMatchingType == MCH_FIRST_CLUSTER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, muontrack.z()); + } + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + return extrap_muontrack; + } + + inline o2::track::TrackParCovFwd propagateMFTtoDCA() + { + double covArr[15]{0.0}; + SMatrix55 tmftcovs(covArr, covArr + 15); + + SMatrix5 tmftpars(mfttrack.x(), + mfttrack.y(), + mfttrack.phi(), + mfttrack.tgl(), + mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), + tmftpars, + tmftcovs, + mfttrack.chi2()}; + + double propVec[3] = {}; + propVec[0] = collision.posX() - mfttrack.x(); + propVec[1] = collision.posY() - mfttrack.y(); + propVec[2] = collision.posZ() - mfttrack.z(); + + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., + mfttrack.y() + propVec[1] / 2., + mfttrack.z() + propVec[2] / 2.}; + + float Bz = fieldB->getBz(centerZ); + extrap_mfttrack.propagateToZ(collision.posZ(), Bz); // z in cm + return extrap_mfttrack; + } + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), + muontrack.y(), + muontrack.phi(), + muontrack.tgl(), + muontrack.signed1Pt()); + + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + o2::mch::TrackExtrap::extrapToVertex(mchtrack, + collision.posX(), + collision.posY(), + collision.posZ(), + collision.covXX(), + collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + public: + enum MATCHING_TYPE { MCH_FIRST_CLUSTER, + MFT_LAST_CLUSTR, + END_OF_ABSORBER, + BEGINNING_OF_ABSORBER }; + + MftMuonMatchingUtils(MUON const& muon, + MFT const& mft, + Collision const& coll, + int MType, + bool useMuon, + o2::field::MagneticField* field) + : muontrack(muon), mfttrack(mft), collision(coll), mMatchingType(MType), mUseMuonInfoToMFTExtrap(useMuon), fieldB(field) + { + } + + inline void calcMatchingParams() + { + auto mfttrack_on_matchingP = propagateMFTtoMatchingPlane(false); + auto mfttrack_on_matchingP_useMCH = propagateMFTtoMatchingPlane(true); + auto muontrack_on_matchingP = propagateMUONtoMatchingPlane(); + + float dphiRaw = 0; + float dphi = 0; + float deta = 0; + + if (mUseMuonInfoToMFTExtrap) { + dphiRaw = mfttrack_on_matchingP_useMCH.getPhi() - muontrack_on_matchingP.getPhi(); + dphi = TVector2::Phi_mpi_pi(dphiRaw); + deta = mfttrack_on_matchingP_useMCH.getEta() - muontrack_on_matchingP.getEta(); + + mDX = mfttrack_on_matchingP_useMCH.getX() - muontrack_on_matchingP.getX(); + mDY = mfttrack_on_matchingP_useMCH.getY() - muontrack_on_matchingP.getY(); + mDPt = mfttrack_on_matchingP_useMCH.getPt() - muontrack_on_matchingP.getPt(); + mDTanl = mfttrack_on_matchingP_useMCH.getTanl() - muontrack_on_matchingP.getTanl(); + mDPhi = dphi; + mDEta = deta; + + mMatchingMFTX = mfttrack_on_matchingP_useMCH.getX(); + mMatchingMFTY = mfttrack_on_matchingP_useMCH.getY(); + mMatchingMFTEta = mfttrack_on_matchingP_useMCH.getEta(); + mMatchingMFTPhi = mfttrack_on_matchingP_useMCH.getPhi(); + mMatchingMFTTanl = mfttrack_on_matchingP_useMCH.getTanl(); + } else { + dphiRaw = mfttrack_on_matchingP.getPhi() - muontrack_on_matchingP.getPhi(); + dphi = TVector2::Phi_mpi_pi(dphiRaw); + deta = mfttrack_on_matchingP.getEta() - muontrack_on_matchingP.getEta(); + + mDX = mfttrack_on_matchingP.getX() - muontrack_on_matchingP.getX(); + mDY = mfttrack_on_matchingP.getY() - muontrack_on_matchingP.getY(); + mDPt = mfttrack_on_matchingP.getPt() - muontrack_on_matchingP.getPt(); + mDTanl = mfttrack_on_matchingP.getTanl() - muontrack_on_matchingP.getTanl(); + mDPhi = dphi; + mDEta = deta; + + mMatchingMFTX = mfttrack_on_matchingP.getX(); + mMatchingMFTY = mfttrack_on_matchingP.getY(); + mMatchingMFTEta = mfttrack_on_matchingP.getEta(); + mMatchingMFTPhi = mfttrack_on_matchingP.getPhi(); + mMatchingMFTTanl = mfttrack_on_matchingP.getTanl(); + } + + mDInvPt = 1. / mfttrack_on_matchingP.getPt() - 1. / muontrack_on_matchingP.getPt(); + mMatchingMFTPt = mfttrack_on_matchingP.getPt(); + mMatchingMFTInvPt = 1. / mMatchingMFTPt; + + mMatchingMuonX = muontrack_on_matchingP.getX(); + mMatchingMuonY = muontrack_on_matchingP.getY(); + mMatchingMuonEta = muontrack_on_matchingP.getEta(); + mMatchingMuonPhi = muontrack_on_matchingP.getPhi(); + mMatchingMuonPt = muontrack_on_matchingP.getPt(); + mMatchingMuonInvPt = 1. / mMatchingMuonPt; + mMatchingMuonTanl = muontrack_on_matchingP.getTanl(); + } + + inline void calcGlobalMuonParams() + { + auto mfttrack_at_dca = propagateMFTtoDCA(); + auto muontrack_at_pv = propagateMUONtoPV(); + + float momentum = muontrack_at_pv.getP(); + float theta = mfttrack_at_dca.getTheta(); + float phiTrack = mfttrack_at_dca.getPhi(); + float px = momentum * std::sin(theta) * std::cos(phiTrack); + float py = momentum * std::sin(theta) * std::sin(phiTrack); + float pz = momentum * std::cos(theta); + + mGlobalMuonQ = muontrack.sign() + mfttrack.sign(); + mGlobalMuonPtAtDCA = std::sqrt(px * px + py * py); + mGlobalMuonPAtDCA = std::sqrt(px * px + py * py + pz * pz); + mGlobalMuonEtaAtDCA = mfttrack_at_dca.getEta(); + mGlobalMuonPhiAtDCA = mfttrack_at_dca.getPhi(); + mGlobalMuonDCAx = mfttrack_at_dca.getX() - collision.posX(); + mGlobalMuonDCAy = mfttrack_at_dca.getY() - collision.posY(); + } + + inline float getDx() const { return mDX; } + inline float getDy() const { return mDY; } + inline float getDphi() const { return mDPhi; } + inline float getDeta() const { return mDEta; } + inline float getDpt() const { return mDPt; } + inline float getDinvpt() const { return mDInvPt; } + inline float getDtanl() const { return mDTanl; } + inline float getMatchingMFTX() const { return mMatchingMFTX; } + inline float getMatchingMFTY() const { return mMatchingMFTY; } + inline float getMatchingMFTEta() const { return mMatchingMFTEta; } + inline float getMatchingMFTPhi() const { return mMatchingMFTPhi; } + inline float getMatchingMFTPt() const { return mMatchingMFTPt; } + inline float getMatchingMFTInvPt() const { return mMatchingMFTInvPt; } + inline float getMatchingMFTTanl() const { return mMatchingMFTTanl; } + inline float getMatchingMuonX() const { return mMatchingMuonX; } + inline float getMatchingMuonY() const { return mMatchingMuonY; } + inline float getMatchingMuonEta() const { return mMatchingMuonEta; } + inline float getMatchingMuonPhi() const { return mMatchingMuonPhi; } + inline float getMatchingMuonPt() const { return mMatchingMuonPt; } + inline float getMatchingMuonInvPt() const { return mMatchingMuonInvPt; } + inline float getMatchingMuonTanl() const { return mMatchingMuonTanl; } + inline float getGMPAtDCA() const { return mGlobalMuonPAtDCA; } + inline float getGMPtAtDCA() const { return mGlobalMuonPtAtDCA; } + inline float getGMEtaAtDCA() const { return mGlobalMuonEtaAtDCA; } + inline float getGMPhiAtDCA() const { return mGlobalMuonPhiAtDCA; } + inline float getGMDcaX() const { return mGlobalMuonDCAx; } + inline float getGMDcaY() const { return mGlobalMuonDCAy; } + inline float getGMDcaXY() const { return std::hypot(mGlobalMuonDCAx, mGlobalMuonDCAy); } + inline int16_t getGMQ() const { return static_cast(mGlobalMuonQ); } +}; + +} // namespace mft +} // namespace o2 + +#endif // O2_MFT_MUON_MATCHING_UTILS_H diff --git a/Detectors/ITSMFT/MFT/matching/src/MatchingTagAndProbe.cxx b/Detectors/ITSMFT/MFT/matching/src/MatchingTagAndProbe.cxx new file mode 100644 index 0000000000000..37e1243a11e0a --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/src/MatchingTagAndProbe.cxx @@ -0,0 +1,15 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "MFTMuonMatching/MatchingTagAndProbe.h" +#include "ReconstructionDataFormats/GlobalFwdTrack.h" + +using namespace o2::mft; diff --git a/Detectors/ITSMFT/MFT/matching/src/MftMuonMatchingUtils.cxx b/Detectors/ITSMFT/MFT/matching/src/MftMuonMatchingUtils.cxx new file mode 100644 index 0000000000000..85ab5716f1684 --- /dev/null +++ b/Detectors/ITSMFT/MFT/matching/src/MftMuonMatchingUtils.cxx @@ -0,0 +1,12 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "MFTMuonMatching/MftMuonMatchingUtils.h"