8#ifndef DETDESCR_HCALABSTRACTID_H_
9#define DETDESCR_HCALABSTRACTID_H_
12#include "DetDescr/DetectorID.h"
31 static const RawValue BAR_TYPE_MASK{0x7};
32 static const RawValue BAR_TYPE_SHIFT{23};
33 static const RawValue HCAL_PAYLOAD_MASK{0x007FFFFF};
44 SUBDETECTORID_TEST(
"HcalAbstractID", SD_HCAL);
51 SUBDETECTORID_TEST(
"HcalAbstractID", SD_HCAL);
59 id_ |= (
bar_type & BAR_TYPE_MASK) << BAR_TYPE_SHIFT;
67 int bar_type()
const {
return (
id_ >> BAR_TYPE_SHIFT) & BAR_TYPE_MASK; }
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
int payload() const
Get the value of the payload field from the ID.
HcalBarType
Encodes whether the side of the strips of the HCal is saved.
HcalAbstractID(const DetectorID id)
Create from a DetectorID, but check.
int bar_type() const
Get the value of the bar field from the ID.
HcalAbstractID(RawValue rawid)
Create from raw number.
HcalAbstractID()
Empty HCAL id (but not null!)
HcalAbstractID(unsigned int bar_type, unsigned int payload)
Create from pieces.