BmnRoot
Loading...
Searching...
No Matches
BmnHitRecord.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 BmnHitRecord header-only implementation
9 Minimalistic structure for optimezed storage in RAM
10*/
11
12#ifndef BMNHITRECORD_H
13#define BMNHITRECORD_H
14
15#include "BmnAlignDefines.h"
16#include "BmnDetectorModel.h"
17#include "CbmStsHit.h"
18
19#define BMN_TEST_HIT_COLOR kRed
20
22{
23 private:
24 Double_t fX, fY, fZ, fWx, fWy;
25 Int_t fDetectorID;
26 constexpr static Double_t MAX_WEIGHT{1.0 / (BMN_CLOSE_TO_ZERO * BMN_CLOSE_TO_ZERO)};
27
28 public:
29 BmnHitRecord(const CbmStsHit* pHit, const BmnDetectorModel& detModel)
30 : fX(pHit->GetX())
31 , fY(pHit->GetY())
32 , fZ(pHit->GetZ())
33 , fWx((pHit->GetDx() < BMN_CLOSE_TO_ZERO) ? MAX_WEIGHT : 1.0 / (pHit->GetDx() * pHit->GetDx()))
34 , fWy((pHit->GetDy() < BMN_CLOSE_TO_ZERO) ? MAX_WEIGHT : 1.0 / (pHit->GetDy() * pHit->GetDy()))
35 , fDetectorID(detModel.IDfromHit(pHit->GetDetectorID())) {};
36 BmnHitRecord(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy, Int_t detectorId)
37 : fX(x)
38 , fY(y)
39 , fZ(z)
40 , fWx((dx < BMN_CLOSE_TO_ZERO) ? MAX_WEIGHT : 1.0 / (dx * dx))
41 , fWy((dy < BMN_CLOSE_TO_ZERO) ? MAX_WEIGHT : 1.0 / (dy * dy))
42 , fDetectorID(detectorId) {};
43 Double_t GetX() const noexcept { return fX; }
44 Double_t GetY() const noexcept { return fY; }
45 Double_t GetZ() const noexcept { return fZ; }
46 Double_t GetWx() const noexcept { return fWx; }
47 Double_t GetWy() const noexcept { return fWy; }
48 Int_t GetDetectorID() const noexcept { return fDetectorID; }
49};
50
51#endif // BMNHITRECORD_H
#define BMN_CLOSE_TO_ZERO
Double_t GetWy() const noexcept
Double_t GetY() const noexcept
Double_t GetX() const noexcept
BmnHitRecord(const CbmStsHit *pHit, const BmnDetectorModel &detModel)
Int_t GetDetectorID() const noexcept
BmnHitRecord(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy, Int_t detectorId)
Double_t GetWx() const noexcept
Double_t GetZ() const noexcept