1#ifndef DETDESCR_HCALDIGIID_H_
2#define DETDESCR_HCALDIGIID_H_
15 static const RawValue END_MASK{0x1};
16 static const RawValue END_SHIFT{19};
17 static const RawValue SECTION_MASK{0x7};
18 static const RawValue SECTION_SHIFT{16};
19 static const RawValue LAYER_MASK{0xFF};
20 static const RawValue LAYER_SHIFT{8};
21 static const RawValue STRIP_MASK{0xFF};
22 static const RawValue STRIP_SHIFT{0};
36 "Attempted to create HcalDigiID from mismatched Hcal bar_type " +
48 "Attempted to create HcalDigiID from mismatched Hcal bar_type " +
59 id_ |= (
section & SECTION_MASK) << SECTION_SHIFT;
60 id_ |= (
layer & LAYER_MASK) << LAYER_SHIFT;
61 id_ |= (
strip & STRIP_MASK) << STRIP_SHIFT;
62 id_ |= (
end & END_MASK) << END_SHIFT;
69 int getSection()
const {
return (
id_ >> SECTION_SHIFT) & SECTION_MASK; }
75 int section()
const {
return (
id_ >> SECTION_SHIFT) & SECTION_MASK; }
81 int layer()
const {
return (
id_ >> LAYER_SHIFT) & LAYER_MASK; }
93 int getStrip()
const {
return (
id_ >> STRIP_SHIFT) & STRIP_MASK; }
99 int strip()
const {
return (
id_ >> STRIP_SHIFT) & STRIP_MASK; }
105 int end()
const {
return (
id_ >> END_SHIFT) & END_MASK; }
118 static void createInterpreters();
Class that serves as a parent for HCal detector IDs of various types.
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
int bar_type() const
Get the value of the bar field from the ID.
Extension of HcalAbstractID providing access to HCal digi information.
HcalDigiID()
Empty HCAL id (but not null!)
HcalDigiID(RawValue rawid)
Create from raw number.
HcalDigiID(const DetectorID id)
Create from a DetectorID, but check.
int getStrip() const
Get the value of the 'strip' field from the ID.
int getSection() const
Get the value of the 'section' field from the ID.
int strip() const
Get the value of the 'strip' field from the ID.
bool isNegativeEnd() const
Get whether the 'end' field from the ID is negative.
int section() const
Get the value of the 'section' field from the ID.
HcalDigiID(unsigned int section, unsigned int layer, unsigned int strip, unsigned int end)
Create from pieces.
int layer() const
Get the value of the layer field from the ID.
int getLayerID() const
Get the value of the layer field from the ID.
int end() const
Get the value of the 'end' field from the ID.