|
| 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 | +/// @file AlignmentPoint.h |
| 13 | +/// @author ruben.shahoyan@cern.ch, michael.lettrich@cern.ch |
| 14 | +/// @since 2021-02-01 |
| 15 | +/// @brief Meausered point in the sensor. |
| 16 | + |
| 17 | +/** |
| 18 | + * Compact alignment point info for debugging |
| 19 | + */ |
| 20 | + |
| 21 | +#ifndef ALGPNTDBG_H |
| 22 | +#define ALGPNTDBG_H |
| 23 | + |
| 24 | +#include "Align/AlignmentPoint.h" |
| 25 | + |
| 26 | +namespace o2 |
| 27 | +{ |
| 28 | +namespace align |
| 29 | +{ |
| 30 | + |
| 31 | +struct AlgPntDbg { |
| 32 | + public: |
| 33 | + using DetID = o2::detectors::DetID; |
| 34 | + // |
| 35 | + enum { |
| 36 | + UpperLeg = 0 |
| 37 | + }; |
| 38 | + // |
| 39 | + AlgPntDbg() = default; |
| 40 | + AlgPntDbg(const AlgPntDbg&) = default; |
| 41 | + ~AlgPntDbg() = default; |
| 42 | + AlgPntDbg& operator=(const AlgPntDbg& other) = default; |
| 43 | + AlgPntDbg(const AlignmentPoint* point) : mDetID(point->getDetID()), mSID(point->getSID()), mAlpha(point->getAlphaSens()), mX(point->getXTracking()), mY(point->getYTracking()), mZ(point->getZTracking()), mErrYY(point->getYZErrTracking()[0]), mErrZZ(point->getYZErrTracking()[2]), mErrYZ(point->getYZErrTracking()[1]) |
| 44 | + { |
| 45 | + mSinAlp = std::sin(mAlpha); |
| 46 | + mCosAlp = std::cos(mAlpha); |
| 47 | + mSnp = point->getTrParamWSA()[2]; // track Snp at the sensor |
| 48 | + if (point->isInvDir()) { |
| 49 | + setUpperLeg(); |
| 50 | + } |
| 51 | + } |
| 52 | + |
| 53 | + float getR() const { return std::sqrt(mX * mX + mY * mY); } |
| 54 | + float getYTrack() const { return mY + mYRes; } |
| 55 | + float getZTrack() const { return mZ + mZRes; } |
| 56 | + float getXTrack() const { return mX; } |
| 57 | + float getXLab() const { return mX * mCosAlp - mY * mSinAlp; } |
| 58 | + float getYLab() const { return mX * mSinAlp + mY * mCosAlp; } |
| 59 | + float getZLap() const { return mZ; } |
| 60 | + float getXTrackLab() const { return mX * mCosAlp - getYTrack() * mSinAlp; } |
| 61 | + float getYTrackLab() const { return mX * mSinAlp + getYTrack() * mCosAlp; } |
| 62 | + float getZTrackLab() const { return getZTrack(); } |
| 63 | + float getPhi() const { return std::atan2(getYLab(), getXLab()); } |
| 64 | + void setFlag(int i) { mFlags |= 0x1 << i; } |
| 65 | + bool getFlag(int i) const { return (mFlags & (0x1 << i)) != 0; } |
| 66 | + |
| 67 | + void setUpperLeg() { setFlag(int(UpperLeg)); } |
| 68 | + bool isUpperLeg() const { return getFlag(int(UpperLeg)); } |
| 69 | + |
| 70 | + int mDetID{}; // DetectorID |
| 71 | + int16_t mSID = -1; // sensor ID in the detector |
| 72 | + uint16_t mFlags = 0; // flags |
| 73 | + float mAlpha = 0.f; // Alpha of tracking frame |
| 74 | + float mSinAlp = 0.f; |
| 75 | + float mCosAlp = 0.f; |
| 76 | + float mX = 0.f; // tracking X |
| 77 | + float mY = 0.f; // tracking Y |
| 78 | + float mZ = 0.f; // Z |
| 79 | + float mYRes = 0.f; // tracking Y residual (track - point) |
| 80 | + float mZRes = 0.f; // Z residual |
| 81 | + float mErrYY = 0.f; |
| 82 | + float mErrZZ = 0.f; |
| 83 | + float mErrYZ = 0.f; |
| 84 | + float mSnp = 0.f; |
| 85 | + |
| 86 | + ClassDefNV(AlgPntDbg, 1); |
| 87 | +}; |
| 88 | + |
| 89 | +} // namespace align |
| 90 | +} // namespace o2 |
| 91 | +#endif |
0 commit comments