BmnRoot
Loading...
Searching...
No Matches
BmnATestHit.h
Go to the documentation of this file.
1/*
2 BM@N alignment routine
3 BM@N experiment at NICA complex, JINR, 2025
4
5 Department: Math & Soft Group of HEP lab
6 Author: Igor Polev, polev@jinr.ru
7
8 BmnATestHit class header only implementation
9 For use in alignment algorithm test
10*/
11
12#ifndef BMNATESTHIT_H
13#define BMNATESTHIT_H
14
16#include "BmnHitRecord.h"
17#include "TPolyMarker3D.h"
18
20{
21 public:
22 BmnATestHit(const CbmStsHit* pHit, const BmnDetectorModel& detModel)
23 : BmnHitRecord(pHit, detModel) {};
24 BmnATestHit(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy, const BmnATestDetectorPlane* pDetector)
25 : BmnHitRecord(x, y, z, dx, dy, pDetector->GetDetectorID())
26 , fpDetector(pDetector) {};
27 void Draw() const; // ROOT macro mode only
28 const BmnATestDetectorPlane* GetDetector() const noexcept { return fpDetector; };
29
30 private:
31 const BmnATestDetectorPlane* fpDetector{nullptr};
32};
33
34// visualization works in ROOT macro mode only
35inline void BmnATestHit::Draw() const
36{
37 SVect3 dot{GetX(), GetY(), 0.0};
38 dot = fpDetector->GetCrdRotation() * dot + fpDetector->GetCrdShift();
39 // note: x and z axis are swapped
40 Double_t tmp;
41 tmp = dot[0];
42 dot[0] = dot[2];
43 dot[2] = tmp;
44 auto* mrk = new TPolyMarker3D(1, dot.Array(), 2);
45 mrk->SetMarkerColor(BMN_TEST_HIT_COLOR);
46 mrk->Draw();
47
48 dot(0) = GetZ();
49 dot(1) = GetY();
50 dot(2) = GetX();
51 mrk = new TPolyMarker3D(1, dot.Array(), 4);
52 mrk->SetMarkerColor(BMN_TEST_HIT_COLOR);
53 mrk->Draw();
54}
55
56#endif // BMNATESTHIT_H
ROOT::Math::SVector< Double_t, 3 > SVect3
#define BMN_TEST_HIT_COLOR
const SVect3 & GetCrdShift() const noexcept
const SMatr3x3 & GetCrdRotation() const noexcept
BmnATestHit(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy, const BmnATestDetectorPlane *pDetector)
Definition BmnATestHit.h:24
BmnATestHit(const CbmStsHit *pHit, const BmnDetectorModel &detModel)
Definition BmnATestHit.h:22
const BmnATestDetectorPlane * GetDetector() const noexcept
Definition BmnATestHit.h:28
void Draw() const
Definition BmnATestHit.h:35
Double_t GetY() const noexcept
Double_t GetX() const noexcept
Int_t GetDetectorID() const noexcept
Double_t GetZ() const noexcept