BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnRun8DetModel.cxx
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
BmnRun8DetModel class implementation
9
*/
10
11
#include "
BmnRun8DetModel.h
"
12
13
/*
14
* CbmStsHit DetectorID layout:
15
*
16
* 27:24 ( 4 bit) System ID
17
* 23:16 ( 8 bit) Station number
18
* 15:4 (12 bit) Sector (module) number
19
* 3:1 ( 3 bit) Sensor number (not used, allways 0b001)
20
* 0:0 ( 1 bit) Unknown (not used, allways 0b0)
21
* --------------
22
* 28 bit in total
23
*
24
* See CbmStsHit.h and BmnToCbmHitConverter::Exec()
25
*/
26
27
// convertion from CbmStsHit DetectorID
28
Int_t
BmnRun8DetModel::IDfromHit
(
Int_t
CbmDetectorID)
const
noexcept
29
{
30
constexpr
static
const
Int_t
MOD_NUM_START4{
MOD_NUM_START
<< 4}, ZERO_BIT4{0xFFFFFEF};
31
32
if
(
GEM_SYSTEM_ID
== (CbmDetectorID >> 24))
33
// to skip GEM hot zone modules we need to erase the first bit
34
// of module number if modules are enumerated from zero
35
return
((CbmDetectorID - MOD_NUM_START4) & ZERO_BIT4) + MOD_NUM_START4;
36
else
37
return
CbmDetectorID;
38
}
39
40
Int_t
BmnRun8DetModel::Alignables
() const noexcept
41
{
42
Int_t
al{0},
i
;
43
for
(
i
= 0;
i
<
SIL_STATION_CNT
;
i
++)
44
al +=
SIL_MODULES
[
i
];
45
for
(
i
= 0;
i
<
GEM_STATION_CNT
;
i
++)
46
al +=
GEM_MODULES
[
i
] / 2;
// skip hot zones
47
return
al;
48
};
49
50
Int_t
BmnRun8DetModel::MaxModulesInStation
() const noexcept
51
{
52
Int_t
cnt{0},
i
;
53
for
(
i
= 0;
i
<
SIL_STATION_CNT
;
i
++)
54
if
(
SIL_MODULES
[
i
] > cnt)
55
cnt =
SIL_MODULES
[
i
];
56
for
(
i
= 0;
i
<
GEM_STATION_CNT
;
i
++)
57
if
(
GEM_MODULES
[
i
] / 2 > cnt)
58
cnt =
GEM_MODULES
[
i
] / 2;
59
return
cnt;
60
}
61
62
void
BmnRun8DetModel::Reset
() noexcept
63
{
64
fSystem
=
SIL_SYSTEM_ID
;
65
fStation
=
SIL_STATION_IDX
[
kFirst
];
66
fModule
=
MOD_NUM_START
- 1;
// must set iterator BEFORE first module
67
// according to base class definition
68
}
69
70
Int_t
BmnRun8DetModel::NextID
() noexcept
71
{
72
// out of range check
73
if
(-1 ==
fSystem
)
74
return
-1;
// EOF marker must be negative
75
76
// next module
77
if
(
fSystem
==
GEM_SYSTEM_ID
)
78
fModule
+= 2;
// skip hot zones in GEM stations
79
else
80
fModule
++;
81
82
// next station check
83
if
((
fModule
-
MOD_NUM_START
)
84
/ (
fSystem
==
GEM_SYSTEM_ID
?
GEM_MODULES
[
fStation
-
GEM_STATION_IDX
[
kFirst
]]
85
:
SIL_MODULES
[
fStation
-
SIL_STATION_IDX
[
kFirst
]]))
86
{
87
fModule
=
MOD_NUM_START
;
88
fStation
++;
89
// remember: stations has common enumeration across all systems
90
// currently only two systems are considered - silicon, then GEM
91
92
// EOF check
93
if
(
fStation
>
GEM_STATION_IDX
[
kLast
])
94
return
fSystem
= -1;
95
96
// next system check
97
if
(
fStation
>
SIL_STATION_IDX
[
kLast
])
98
fSystem
=
GEM_SYSTEM_ID
;
99
}
100
101
return
(
fSystem
<< 24) | (
fStation
<< 16) | (
fModule
<< 4) | 0b0010;
102
// constant term 0b0010 is used to match CbmStsHit DetectorID encoding
103
}
i
int i
Definition
P4_F32vec4.h:22
Int_t
int Int_t
BmnRun8DetModel.h
BmnRun8DetModel::GEM_MODULES
static constexpr const Int_t GEM_MODULES[GEM_STATION_CNT]
Definition
BmnRun8DetModel.h:43
BmnRun8DetModel::NextID
virtual Int_t NextID() noexcept override
Definition
BmnRun8DetModel.cxx:70
BmnRun8DetModel::Reset
virtual void Reset() noexcept override
Definition
BmnRun8DetModel.cxx:62
BmnRun8DetModel::SIL_SYSTEM_ID
static constexpr const Int_t SIL_SYSTEM_ID
Definition
BmnRun8DetModel.h:37
BmnRun8DetModel::MOD_NUM_START
static constexpr const Int_t MOD_NUM_START
Definition
BmnRun8DetModel.h:39
BmnRun8DetModel::SIL_MODULES
static constexpr const Int_t SIL_MODULES[SIL_STATION_CNT]
Definition
BmnRun8DetModel.h:43
BmnRun8DetModel::Alignables
virtual Int_t Alignables() const noexcept override
Definition
BmnRun8DetModel.cxx:40
BmnRun8DetModel::GEM_SYSTEM_ID
static constexpr const Int_t GEM_SYSTEM_ID
Definition
BmnRun8DetModel.h:37
BmnRun8DetModel::fStation
Int_t fStation
Definition
BmnRun8DetModel.h:29
BmnRun8DetModel::SIL_STATION_IDX
static constexpr const Int_t SIL_STATION_IDX[2]
Definition
BmnRun8DetModel.h:41
BmnRun8DetModel::IDfromHit
virtual Int_t IDfromHit(Int_t HitDetectorID) const noexcept override
Definition
BmnRun8DetModel.cxx:28
BmnRun8DetModel::fSystem
Int_t fSystem
Definition
BmnRun8DetModel.h:29
BmnRun8DetModel::kFirst
@ kFirst
Definition
BmnRun8DetModel.h:33
BmnRun8DetModel::kLast
@ kLast
Definition
BmnRun8DetModel.h:34
BmnRun8DetModel::GEM_STATION_CNT
static constexpr const Int_t GEM_STATION_CNT
Definition
BmnRun8DetModel.h:38
BmnRun8DetModel::MaxModulesInStation
virtual Int_t MaxModulesInStation() const noexcept override
Definition
BmnRun8DetModel.cxx:50
BmnRun8DetModel::SIL_STATION_CNT
static constexpr const Int_t SIL_STATION_CNT
Definition
BmnRun8DetModel.h:38
BmnRun8DetModel::fModule
Int_t fModule
Definition
BmnRun8DetModel.h:29
BmnRun8DetModel::GEM_STATION_IDX
static constexpr const Int_t GEM_STATION_IDX[2]
Definition
BmnRun8DetModel.h:42
align_new
src
BmnRun8DetModel.cxx
Generated on
for BmnRoot by
1.17.0