7#ifndef DETDESCR_HCALTRIGGERID_H_
8#define DETDESCR_HCALTRIGGERID_H_
24 enum HcalSection { BACK = 0, TOP = 1, BOTTOM = 2, LEFT = 4, RIGHT = 3 };
26 static const RawValue END_MASK{0x3};
27 static const RawValue END_SHIFT{20};
28 static const RawValue SECTION_MASK{0x7};
29 static const RawValue SECTION_SHIFT{16};
30 static const RawValue LAYER_MASK{0xFF};
31 static const RawValue LAYER_SHIFT{8};
32 static const RawValue SUPERSTRIP_MASK{0xFF};
33 static const RawValue SUPERSTRIP_SHIFT{0};
47 "Attempted to create HcalTriggerID from mismatched Hcal bar_type " +
59 "Attempted to create HcalTriggerID from mismatched Hcal bar_type " +
70 id_ |= (section & SECTION_MASK) << SECTION_SHIFT;
71 id_ |= (
layer & LAYER_MASK) << LAYER_SHIFT;
73 id_ |= (
end & END_MASK) << END_SHIFT;
80 int getSection()
const {
return (
id_ >> SECTION_SHIFT) & SECTION_MASK; }
86 int section()
const {
return (
id_ >> SECTION_SHIFT) & SECTION_MASK; }
92 int layer()
const {
return (
id_ >> LAYER_SHIFT) & LAYER_MASK; }
105 return (
id_ >> SUPERSTRIP_SHIFT) & SUPERSTRIP_MASK;
112 int superstrip()
const {
return (
id_ >> SUPERSTRIP_SHIFT) & SUPERSTRIP_MASK; }
118 int end()
const {
return (
id_ >> END_SHIFT) & END_MASK; }
132 static void createInterpreters();
Class that serves as a parent for HCal detector IDs of various types.
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 DetectorID providing access to HCal trigger cell.
int superstrip() const
Get the value of the 'superstrip' field from the ID.
HcalTriggerID()
Empty HCAL trigger id (but not null!)
int end() const
Get the value of the 'end' field from the ID.
int getLayerID() const
Get the value of the layer field from the ID.
HcalTriggerID(RawValue rawid)
Create from raw number.
HcalTriggerID(const HcalAbstractID id)
Create from a DetectorID, but check.
HcalTriggerID(unsigned int section, unsigned int layer, unsigned int superstrip, unsigned int end)
Create from pieces.
bool isComposite() const
Get whether the ID is the composite of two bar ends.
int getSuperstrip() const
Get the value of the 'superstrip' field from the ID.
bool isNegativeEnd() const
Get whether the 'end' field from the ID is negative.
HcalSection
Encodes the section of the HCal based on the 'section' field value.
int layer() const
Get the value of the layer field from the ID.