|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +#ifndef QC_MODULE_MUON_COMMON_TRACK_H |
| 13 | +#define QC_MODULE_MUON_COMMON_TRACK_H |
| 14 | + |
| 15 | +#include <CommonDataFormat/InteractionRecord.h> |
| 16 | +#include <DataFormatsGlobalTracking/RecoContainer.h> |
| 17 | +#include <DataFormatsMCH/TrackMCH.h> |
| 18 | +#include <ReconstructionDataFormats/TrackMCHMID.h> |
| 19 | +#include <ReconstructionDataFormats/GlobalFwdTrack.h> |
| 20 | +#include <MCHTracking/TrackParam.h> |
| 21 | +#include <Math/Vector4D.h> |
| 22 | +#include <memory> |
| 23 | + |
| 24 | +namespace o2::quality_control_modules::muon |
| 25 | +{ |
| 26 | + |
| 27 | +class MuonTrack |
| 28 | +{ |
| 29 | + public: |
| 30 | + MuonTrack(const o2::mch::TrackMCH* track, const o2::globaltracking::RecoContainer& recoCont); |
| 31 | + MuonTrack(const o2::dataformats::TrackMCHMID* track, const o2::globaltracking::RecoContainer& recoCont); |
| 32 | + MuonTrack(const o2::dataformats::GlobalFwdTrack* track, const o2::globaltracking::RecoContainer& recoCont); |
| 33 | + |
| 34 | + void init(); |
| 35 | + |
| 36 | + ROOT::Math::PxPyPzMVector getMuonMomentum() const { return mMuonMomentum; } |
| 37 | + ROOT::Math::PxPyPzMVector getMuonMomentumAtVertex() const { return mMuonMomentumAtVertex; } |
| 38 | + double getP() const |
| 39 | + { |
| 40 | + return mMuonMomentum.P(); |
| 41 | + } |
| 42 | + double getDCA() const { return mDCA; } |
| 43 | + double getPDCAMCH() const { return mPDCAMCH; } |
| 44 | + double getRAbs() const { return mRAbs; } |
| 45 | + double getChi2OverNDF() const { return mChi2OverNDF; } |
| 46 | + |
| 47 | + /// get the interaction record associated to this track |
| 48 | + InteractionRecord getIR() const { return mIR; } |
| 49 | + /// get the interaction record associated to the MFT track |
| 50 | + InteractionRecord getIRMFT() const { return mIRMFT; } |
| 51 | + /// get the interaction record associated to the MCH track |
| 52 | + InteractionRecord getIRMCH() const { return mIRMCH; } |
| 53 | + /// get the interaction record associated to the MID track |
| 54 | + InteractionRecord getIRMID() const { return mIRMID; } |
| 55 | + |
| 56 | + /// get the interaction record associated to the MFT track |
| 57 | + int getTrackIdMFT() const { return mTrackIdMFT; } |
| 58 | + /// get the interaction record associated to the MCH track |
| 59 | + int getTrackIdMCH() const { return mTrackIdMCH; } |
| 60 | + /// get the interaction record associated to the MID track |
| 61 | + int getTrackIdMID() const { return mTrackIdMID; } |
| 62 | + |
| 63 | + bool hasMFT() const { return (mTrackIdMFT >= 0); } |
| 64 | + bool hasMCH() const { return (mTrackIdMCH >= 0); } |
| 65 | + bool hasMID() const { return (mTrackIdMID >= 0); } |
| 66 | + |
| 67 | + /// get the muon sign |
| 68 | + short getSign() const { return mSign; } |
| 69 | + |
| 70 | + static constexpr double sAbsZBeg = -90.; ///< Position of the begining of the absorber (cm) |
| 71 | + static constexpr double sAbsZEnd = -505.; ///< Position of the end of the absorber (cm) |
| 72 | + |
| 73 | + private: |
| 74 | + o2::mch::TrackParam mTrackParameters; |
| 75 | + o2::mch::TrackParam mTrackParametersMCH; |
| 76 | + |
| 77 | + ROOT::Math::PxPyPzMVector mMuonMomentum; |
| 78 | + ROOT::Math::PxPyPzMVector mMuonMomentumAtVertex; |
| 79 | + |
| 80 | + float mDCA{ 0 }; |
| 81 | + float mPDCAMCH{ 0 }; |
| 82 | + float mRAbs{ 0 }; |
| 83 | + float mChi2OverNDF{ 0 }; |
| 84 | + |
| 85 | + InteractionRecord mIR{}; ///< associated interaction record |
| 86 | + InteractionRecord mIRMFT{}; ///< MFT interaction record |
| 87 | + InteractionRecord mIRMCH{}; ///< MCH interaction record |
| 88 | + InteractionRecord mIRMID{}; ///< MID interaction record |
| 89 | + |
| 90 | + int mTrackIdMFT{ -1 }; |
| 91 | + int mTrackIdMCH{ -1 }; |
| 92 | + int mTrackIdMID{ -1 }; |
| 93 | + |
| 94 | + short mSign; |
| 95 | +}; |
| 96 | + |
| 97 | +} // namespace o2::quality_control_modules::muon |
| 98 | + |
| 99 | +#endif |
0 commit comments