BmnRoot
Loading...
Searching...
No Matches
BmnScWallAddress.h
Go to the documentation of this file.
1
16#ifndef BMNSCWALLADDRESS_H
17#define BMNSCWALLADDRESS_H 1
18
19#include "BmnDetectorList.h" // for kSCWALL
20#include <cassert> // for assert
21
23public:
28 static uint32_t GetAddress(uint32_t CellId)
29 {
30 assert((uint32_t)kSCWALL <= fgkSystemIdLength);
31 assert(CellId <= fgkCellIdLength);
32 return ( (((uint32_t)kSCWALL) << fgkSystemIdShift)
33 | (CellId << fgkCellIdShift) );
34 }
35
41 static uint32_t GetSystemId(uint32_t address)
42 {
43 return (address & (fgkSystemIdLength << fgkSystemIdShift)) >> fgkSystemIdShift;
44 }
45
51 static uint32_t GetCellId(uint32_t address)
52 {
53 return (address & (fgkCellIdLength << fgkCellIdShift)) >> fgkCellIdShift;
54 }
55
56private:
57 // Length of the index of the corresponding volume
58 static const uint32_t fgkSystemIdLength = 31; // 2^5 - 1
59 static const uint32_t fgkCellIdLength = 1023; // 2^10- 1
60
61 // Number of a start bit for each volume
62 static const uint32_t fgkSystemIdShift = 0;
63 static const uint32_t fgkCellIdShift = 5;
64
65};
66
67#endif
@ kSCWALL
BmnScWall interface class to the unique address.
static uint32_t GetCellId(uint32_t address)
Return Cell id from address.
static uint32_t GetAddress(uint32_t CellId)
Return address from system ID, Cell ID.
static uint32_t GetSystemId(uint32_t address)
Return System identifier from address.