7#ifndef DETDESCR_ECALELECTRONICSID_H_
8#define DETDESCR_ECALELECTRONICSID_H_
11#include "DetDescr/DetectorID.h"
29 static const RawValue INDEX_MASK{0xFFFFFF};
33 static const unsigned int MAX_INDEX{38 * 48 * 200};
47 SUBDETECTORID_TEST(
"EcalElectronicsID", EID_ECAL);
54 SUBDETECTORID_TEST(
"EcalElectronicsID", EID_ECAL);
85 int fiber()
const {
return Index(
id_ & INDEX_MASK).field2(); }
90 int elink()
const {
return Index(
id_ & INDEX_MASK).field1(); }
95 int channel()
const {
return Index(
id_ & INDEX_MASK).field0(); }
100 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 Ecal readout chain.
int elink() const
Get the value of the elink from the ID.
static EcalElectronicsID idFromIndex(unsigned int index)
Construct an electronics id from an index.
EcalElectronicsID(RawValue rawid)
Create from raw number.
EcalElectronicsID()
Empty ECAL id (but not null!)
unsigned int index() const
Get the compact index value.
EcalElectronicsID(const DetectorID id)
Create from a DetectorID, but check.
int channel() const
Get the value of the channel from the ID.
int fiber() const
Get the value of the fiber from the ID.
EcalElectronicsID(unsigned int fiber, unsigned int elink, unsigned int channel)
Create from pieces.
A maximally-packed index of up to four different fields.