7#ifndef DETDESCR_TRACKERID_H_
8#define DETDESCR_TRACKERID_H_
11#include "DetDescr/DetectorID.h"
22 static const RawValue LAYER_MASK{0xFF};
23 static const RawValue LAYER_SHIFT{0};
24 static const RawValue MODULE_MASK{0x1F};
25 static const RawValue MODULE_SHIFT{8};
36 SUBDETECTORID_TEST2(
"TrackerID", SD_TRACKER_TAGGER, SD_TRACKER_RECOIL);
43 SUBDETECTORID_TEST2(
"TrackerID", SD_TRACKER_TAGGER, SD_TRACKER_RECOIL);
50 id_ |= (
layer & LAYER_MASK) << LAYER_SHIFT;
51 id_ |= (
module & MODULE_MASK) << MODULE_SHIFT;
58 int module()
const {
return (
id_ >> MODULE_SHIFT) & MODULE_MASK; }
64 int layer()
const {
return (
id_ >> LAYER_SHIFT) & LAYER_MASK; }
66 static void createInterpreters();
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
Extension of DetectorID providing access to layer and module number for tracker IDs.
int module() const
Get the value of the module field from the ID.
TrackerID(const DetectorID id)
Create from a DetectorID, but check.
TrackerID()
Create a null TrackerID (not useful)
TrackerID(SubdetectorIDType system, unsigned int layer, unsigned int module)
Create from values.
TrackerID(RawValue rawid)
Create from a raw id, but check.
int layer() const
Get the value of the layer field from the ID.