BmnRoot 26.10.0-233-gb9bbe585
Software framework of the BM@N experiment
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.int
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 "BmnDetectorModel.h"
16#include "CbmStsHit.h"
17
18#define BMN_TEST_HIT_COLOR kRed
19
21{
22 private:
25 Bool_t fEnabled{kTRUE}; // fits into the padding after fDetectorID, the record does not grow
26 public:
27 constexpr static Double_t MIN_HIT_ERROR{1.0E-6};
28 constexpr static Double_t MAX_WEIGHT{1.0 / (MIN_HIT_ERROR * MIN_HIT_ERROR)};
29 constexpr static Double_t Weight(Double_t error) noexcept
30 {
31 return error < MIN_HIT_ERROR ? MAX_WEIGHT : 1.0 / (error * error);
32 }
33
34 BmnHitRecord(const CbmStsHit* pHit, const BmnDetectorModel& detModel)
35 : fX(pHit->GetX())
36 , fY(pHit->GetY())
37 , fZ(pHit->GetZ())
38 , fWx(Weight(pHit->GetDx()))
39 , fWy(Weight(pHit->GetDy()))
40 , fDetectorID(detModel.IDfromHit(pHit->GetDetectorID())) {};
42 : fX(x)
43 , fY(y)
44 , fZ(z)
45 , fWx(Weight(dx))
46 , fWy(Weight(dy))
47 , fDetectorID(detectorId) {};
48 Double_t GetX() const noexcept { return fX; }
49 Double_t GetY() const noexcept { return fY; }
50 Double_t GetZ() const noexcept { return fZ; }
51 // a disabled hit stays in storage with zero weight, so it takes no part in any fit
52 Double_t GetWx() const noexcept { return fEnabled ? fWx : 0.0; }
53 Double_t GetWy() const noexcept { return fEnabled ? fWy : 0.0; }
54 Int_t GetDetectorID() const noexcept { return fDetectorID; }
55 Bool_t IsEnabled() const noexcept { return fEnabled; }
56 void SetEnabled(Bool_t enabled) noexcept { fEnabled = enabled; }
57};
58
59#endif // BMNHITRECORD_H
bool Bool_t
int Int_t
double Double_t
constexpr Bool_t kTRUE
Double_t fWx
Double_t GetWy() const noexcept
Double_t GetY() const noexcept
Double_t fX
Double_t GetX() const noexcept
Bool_t IsEnabled() const noexcept
Bool_t fEnabled
Int_t fDetectorID
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)
static constexpr Double_t MAX_WEIGHT
Double_t fWy
static constexpr Double_t Weight(Double_t error) noexcept
static constexpr Double_t MIN_HIT_ERROR
Double_t fY
Double_t GetWx() const noexcept
void SetEnabled(Bool_t enabled) noexcept
Double_t GetZ() const noexcept
Double_t fZ