BmnRoot
26.10.0-233-gb9bbe585
Software framework of the BM@N experiment
Toggle main menu visibility
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
20
class
BmnHitRecord
21
{
22
private
:
23
Double_t
fX
,
fY
,
fZ
,
fWx
,
fWy
;
24
Int_t
fDetectorID
;
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
())) {};
41
BmnHitRecord
(
Double_t
x,
Double_t
y,
Double_t
z,
Double_t
dx,
Double_t
dy,
Int_t
detectorId)
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
BmnDetectorModel.h
CbmStsHit.h
Bool_t
bool Bool_t
Int_t
int Int_t
Double_t
double Double_t
kTRUE
constexpr Bool_t kTRUE
BmnDetectorModel
Definition
BmnDetectorModel.h:28
BmnHitRecord::fWx
Double_t fWx
Definition
BmnHitRecord.h:23
BmnHitRecord::GetWy
Double_t GetWy() const noexcept
Definition
BmnHitRecord.h:53
BmnHitRecord::GetY
Double_t GetY() const noexcept
Definition
BmnHitRecord.h:49
BmnHitRecord::fX
Double_t fX
Definition
BmnHitRecord.h:23
BmnHitRecord::GetX
Double_t GetX() const noexcept
Definition
BmnHitRecord.h:48
BmnHitRecord::IsEnabled
Bool_t IsEnabled() const noexcept
Definition
BmnHitRecord.h:55
BmnHitRecord::fEnabled
Bool_t fEnabled
Definition
BmnHitRecord.h:25
BmnHitRecord::fDetectorID
Int_t fDetectorID
Definition
BmnHitRecord.h:24
BmnHitRecord::BmnHitRecord
BmnHitRecord(const CbmStsHit *pHit, const BmnDetectorModel &detModel)
Definition
BmnHitRecord.h:34
BmnHitRecord::GetDetectorID
Int_t GetDetectorID() const noexcept
Definition
BmnHitRecord.h:54
BmnHitRecord::BmnHitRecord
BmnHitRecord(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy, Int_t detectorId)
Definition
BmnHitRecord.h:41
BmnHitRecord::MAX_WEIGHT
static constexpr Double_t MAX_WEIGHT
Definition
BmnHitRecord.h:28
BmnHitRecord::fWy
Double_t fWy
Definition
BmnHitRecord.h:23
BmnHitRecord::Weight
static constexpr Double_t Weight(Double_t error) noexcept
Definition
BmnHitRecord.h:29
BmnHitRecord::MIN_HIT_ERROR
static constexpr Double_t MIN_HIT_ERROR
Definition
BmnHitRecord.h:27
BmnHitRecord::fY
Double_t fY
Definition
BmnHitRecord.h:23
BmnHitRecord::GetWx
Double_t GetWx() const noexcept
Definition
BmnHitRecord.h:52
BmnHitRecord::SetEnabled
void SetEnabled(Bool_t enabled) noexcept
Definition
BmnHitRecord.h:56
BmnHitRecord::GetZ
Double_t GetZ() const noexcept
Definition
BmnHitRecord.h:50
BmnHitRecord::fZ
Double_t fZ
Definition
BmnHitRecord.h:23
CbmStsHit
Definition
CbmStsHit.h:27
align_new
src
BmnHitRecord.h
Generated on
for BmnRoot by
1.17.0