18#ifndef BmnHodoAddress_H
19#define BmnHodoAddress_H 1
35 static uint32_t
GetAddress(uint32_t StripId, uint32_t StripSide, uint32_t Gain)
37 assert((uint32_t)
kHODO <= fgkSystemIdLength);
38 assert(StripId <= fgkStripIdLength);
39 assert(StripSide <= fgkStripSideLength);
40 assert(Gain <= fgkGainLength);
41 return ((((uint32_t)
kHODO) << fgkSystemIdShift) | (StripId << fgkStripIdShift)
42 | (StripSide << fgkStripSideShift) | (Gain << fgkGainShift));
52 return (address & (fgkSystemIdLength << fgkSystemIdShift)) >> fgkSystemIdShift;
62 return (address & (fgkStripIdLength << fgkStripIdShift)) >> fgkStripIdShift;
72 return (address & (fgkStripSideLength << fgkStripSideShift)) >> fgkStripSideShift;
80 static uint32_t
GetGain(uint32_t address) {
return (address & (fgkGainLength << fgkGainShift)) >> fgkGainShift; }
84 static const uint32_t fgkSystemIdLength = 31;
85 static const uint32_t fgkStripIdLength = 31;
86 static const uint32_t fgkStripSideLength = 1;
87 static const uint32_t fgkGainLength = 1;
90 static const uint32_t fgkSystemIdShift = 0;
91 static const uint32_t fgkStripIdShift = 6;
92 static const uint32_t fgkStripSideShift = 11;
93 static const uint32_t fgkGainShift = 12;
BmnHodo interface class to the unique address.
static uint32_t GetStripSide(uint32_t address)
Return Strip side from address.
static uint32_t GetStripId(uint32_t address)
Return Strip id from address.
static uint32_t GetAddress(uint32_t StripId, uint32_t StripSide, uint32_t Gain)
Return address from system ID, StripId, StripSide, Gain.
static uint32_t GetSystemId(uint32_t address)
Return System identifier from address.
static uint32_t GetGain(uint32_t address)
Return Gain from address.
Defines unique identifiers (enum) for all BM@N detector systems.