2#ifndef DETDESCR_HCALELECTRONICSID_H_
3#define DETDESCR_HCALELECTRONICSID_H_
6#include "DetDescr/DetectorID.h"
28 static const RawValue INDEX_MASK{0xFFFFFF};
32 static const unsigned int MAX_INDEX{38 * 48 * 200};
43 SUBDETECTORID_TEST(
"HcalElectronicsID", EID_HCAL);
50 SUBDETECTORID_TEST(
"HcalElectronicsID", EID_HCAL);
81 int fiber()
const {
return Index(
id_ & INDEX_MASK).field2(); }
86 int elink()
const {
return Index(
id_ & INDEX_MASK).field1(); }
91 int channel()
const {
return Index(
id_ & INDEX_MASK).field0(); }
96 unsigned int index()
const {
return id_ & INDEX_MASK; }
Class which represents a maximally-packed index of up to four fields.
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
Identifies a location in the Hcal readout chain.
unsigned int index() const
Get the compact index value.
int elink() const
Get the value of the elink from the ID.
int fiber() const
Get the value of the fiber from the ID.
HcalElectronicsID(RawValue rawid)
Create from raw number.
HcalElectronicsID(unsigned int fiber, unsigned int elink, unsigned int channel)
Create from pieces.
int channel() const
Get the value of the channel from the ID.
static HcalElectronicsID idFromIndex(unsigned int index)
Construct an electronics id from an index.
HcalElectronicsID()
Empty HCAL id (but not null!)
HcalElectronicsID(const DetectorID id)
Create from a DetectorID, but check.
A maximally-packed index of up to four different fields.