BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnRun8cgHalfDM.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 BmnRun8cgHalfDM class declaration
9 Run8 coarse-grained representation, single half of each station only
10*/
11
12#ifndef BMNRUN8CGHALFDM_H
13#define BMNRUN8CGHALFDM_H
14
15#include "BmnRun8cgDM.h"
16
17/*
18 * Common base for the coarse-grained half-station models. Same scheme as
19 * BmnRun8cgDM, but only one half of every station is alignable (one element
20 * per station). Top elements carry the first half of module numbers, bottom
21 * elements the second half (see BmnRun8DM). Derived classes pick the kept
22 * half via KeepBottomHalf(). Intended for data with half-station hits only.
23 */
24
26{
27 protected:
28 // selects which half of every station is alignable
29 virtual Bool_t KeepBottomHalf() const noexcept = 0;
30
31 // only the kept half of the station survives
32 virtual Int_t StationAlignables(Int_t /*station*/) const noexcept override { return 1; }
33
34 virtual void Reset() noexcept override
35 {
37 fStation = SIL_STATION_IDX[kFirst] - 1; // set iterator BEFORE first station
38 fModule = MOD_NUM_START; // recomputed per station in NextID
39 }
40
41 virtual Int_t NextID() noexcept override
42 {
43 if (-1 == fSystem)
44 return -1; // EOF marker must be negative
45
46 fStation++; // one alignable element per half-station
47
48 // EOF check
50 return fSystem = -1;
51
52 // next system check
55
56 // top halfs allways has fModule = MOD_NUM_START
57 // but bottom halfs depends on modules count
58 if (KeepBottomHalf())
60
61 return (fSystem << 24) | (fStation << 16) | (fModule << 4) | 0b0010;
62 }
63
64 public:
65 virtual Bool_t IgnoreHit(Int_t CbmDetectorID) const noexcept override
66 {
67 const Int_t module{((CbmDetectorID >> 4) & 0xFFF) - MOD_NUM_START},
68 station{((CbmDetectorID >> 16) & 0xFF) - STA_NUM_START}, half{StationModules(station) / 2};
69 return KeepBottomHalf() ? module < half : module >= half;
70 }
71 virtual Bool_t IgnoresSome() const noexcept override { return kTRUE; }
72};
73
74#endif // BMNRUN8CGHALFDM_H
bool Bool_t
int Int_t
constexpr Bool_t kTRUE
Int_t fSystem
Definition BmnRun8DM.h:43
static constexpr const Int_t SIL_STATION_IDX[2]
Definition BmnRun8DM.h:55
static constexpr const Int_t MOD_NUM_START
Definition BmnRun8DM.h:53
Int_t fStation
Definition BmnRun8DM.h:43
Int_t fModule
Definition BmnRun8DM.h:43
static constexpr const Int_t STA_NUM_START
Definition BmnRun8DM.h:52
static constexpr const Int_t GEM_STATION_IDX[2]
Definition BmnRun8DM.h:56
static constexpr const Int_t GEM_SYSTEM_ID
Definition BmnRun8DM.h:51
static constexpr const Int_t SIL_SYSTEM_ID
Definition BmnRun8DM.h:51
Int_t StationModules(Int_t station) const noexcept
Definition BmnRun8DM.h:62
virtual Int_t StationAlignables(Int_t) const noexcept override
virtual void Reset() noexcept override
virtual Int_t NextID() noexcept override
virtual Bool_t KeepBottomHalf() const noexcept=0
virtual Bool_t IgnoreHit(Int_t CbmDetectorID) const noexcept override
virtual Bool_t IgnoresSome() const noexcept override