Extension of DetectorID providing access to layer and module number for tracker IDs.
More...
#include <TrackerID.h>
|
| typedef uint32_t | RawValue |
| |
| RawValue | id_ |
| | The raw, packed value of the ID.
|
| |
Extension of DetectorID providing access to layer and module number for tracker IDs.
Definition at line 20 of file TrackerID.h.
◆ TrackerID() [1/4]
| ldmx::TrackerID::TrackerID |
( |
| ) |
|
|
inline |
◆ TrackerID() [2/4]
Create from a DetectorID, but check.
Definition at line 35 of file TrackerID.h.
36 SUBDETECTORID_TEST3("TrackerID", SD_TRACKER_TAGGER, SD_TRACKER_RECOIL,
37 SD_TRACKER_TESTSTAND);
38 }
DetectorID()
Class constructor for a null DetectorID.
◆ TrackerID() [3/4]
| ldmx::TrackerID::TrackerID |
( |
RawValue | rawid | ) |
|
|
inline |
Create from a raw id, but check.
Definition at line 43 of file TrackerID.h.
44 SUBDETECTORID_TEST3("TrackerID", SD_TRACKER_TAGGER, SD_TRACKER_RECOIL,
45 SD_TRACKER_TESTSTAND);
46 }
◆ TrackerID() [4/4]
| ldmx::TrackerID::TrackerID |
( |
SubdetectorIDType | system, |
|
|
unsigned int | layer, |
|
|
unsigned int | module ) |
|
inline |
Create from values.
Definition at line 50 of file TrackerID.h.
52 id_ |= (
layer & LAYER_MASK) << LAYER_SHIFT;
53 id_ |= (
module & MODULE_MASK) << MODULE_SHIFT;
54 }
RawValue id_
The raw, packed value of the ID.
int layer() const
Get the value of the layer field from the ID.
References ldmx::DetectorID::id_, and layer().
◆ createInterpreters()
| void ldmx::TrackerID::createInterpreters |
( |
| ) |
|
|
static |
Definition at line 22 of file TrackerID.cxx.
22 {
24 fields.push_back(new IDField("subdetector", 0, SUBDETECTORID_SHIFT, 31));
25 fields.push_back(
26 new IDField("layer", 1, LAYER_SHIFT,
28 fields.push_back(
29 new IDField("module", 2, MODULE_SHIFT,
31
35}
static void registerInterpreter(SubdetectorIDType idtype, const IDField::IDFieldList &fieldList)
Register a new field interpreter for a given subdetector id.
static unsigned countOnes(unsigned mask)
Utility for counting number of 1 in a mask.
std::vector< IDField * > IDFieldList
List of fields.
◆ layer()
| int ldmx::TrackerID::layer |
( |
| ) |
const |
|
inline |
◆ module()
| int ldmx::TrackerID::module |
( |
| ) |
const |
|
inline |
◆ operator<<
Definition at line 7 of file TrackerID.cxx.
7 {
9 s << "NULL";
10 else if (
id.
subdet() == ldmx::SD_TRACKER_RECOIL)
11 s << "Recoil(";
12 else if (
id.
subdet() == ldmx::SD_TRACKER_TAGGER)
13 s << "Tagger(";
14 else if (
id.
subdet() == ldmx::SD_TRACKER_TESTSTAND)
15 s << "Teststand(";
16 else
17 s << "UnknownTk(";
18 s << id.layer() << ',' << id.module() << ')';
19 return s;
20}
SubdetectorIDType subdet() const
◆ LAYER_MASK
| const RawValue ldmx::TrackerID::LAYER_MASK {0xFF} |
|
static |
◆ LAYER_SHIFT
| const RawValue ldmx::TrackerID::LAYER_SHIFT {0} |
|
static |
◆ MODULE_MASK
| const RawValue ldmx::TrackerID::MODULE_MASK {0x1F} |
|
static |
◆ MODULE_SHIFT
| const RawValue ldmx::TrackerID::MODULE_SHIFT {8} |
|
static |
The documentation for this class was generated from the following files: