BmnRoot
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
28Int_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
40Int_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
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
63{
66 fModule = MOD_NUM_START - 1; // must set iterator BEFORE first module
67 // according to base class definition
68}
69
71{
72 // out of range check
73 if (-1 == fSystem)
74 return -1; // EOF marker must be negative
75
76 // next module
78 fModule += 2; // skip hot zones in GEM stations
79 else
80 fModule++;
81
82 // next station check
86 {
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
94 return fSystem = -1;
95
96 // next system check
99 }
100
101 return (fSystem << 24) | (fStation << 16) | (fModule << 4) | 0b0010;
102 // constant term 0b0010 is used to match CbmStsHit DetectorID encoding
103}
int i
Definition P4_F32vec4.h:22
static constexpr const Int_t GEM_MODULES[GEM_STATION_CNT]
virtual Int_t NextID() noexcept override
virtual void Reset() noexcept override
static constexpr const Int_t SIL_SYSTEM_ID
static constexpr const Int_t MOD_NUM_START
static constexpr const Int_t SIL_MODULES[SIL_STATION_CNT]
virtual Int_t Alignables() const noexcept override
static constexpr const Int_t GEM_SYSTEM_ID
static constexpr const Int_t SIL_STATION_IDX[2]
virtual Int_t IDfromHit(Int_t HitDetectorID) const noexcept override
static constexpr const Int_t GEM_STATION_CNT
virtual Int_t MaxModulesInStation() const noexcept override
static constexpr const Int_t SIL_STATION_CNT
static constexpr const Int_t GEM_STATION_IDX[2]