LDMX Software
HcalTriggerID.cxx
2
3#include "DetDescr/DetectorIDInterpreter.h"
4
5std::ostream& operator<<(std::ostream& s, const ldmx::HcalTriggerID& id) {
6 s << "HcalTrig(" << id.section() << ',' << id.layer() << ','
7 << id.superstrip() << ',' << id.end() << ')';
8 return s;
9}
10
11namespace ldmx {
12
13void HcalTriggerID::createInterpreters() {
15 fields.push_back(new IDField("subdetector", 0, SUBDETECTORID_SHIFT, 31));
16 fields.push_back(
17 new IDField("section", 1, SECTION_SHIFT,
18 SECTION_SHIFT + IDField::countOnes(SECTION_MASK) - 1));
19 fields.push_back(
20 new IDField("layer", 2, LAYER_SHIFT,
21 LAYER_SHIFT + IDField::countOnes(LAYER_MASK) - 1));
22 fields.push_back(
23 new IDField("superstrip", 3, SUPERSTRIP_SHIFT,
24 SUPERSTRIP_SHIFT + IDField::countOnes(SUPERSTRIP_MASK) - 1));
25 fields.push_back(new IDField("end", 4, END_SHIFT,
26 END_SHIFT + IDField::countOnes(END_MASK) - 1));
27
29 SD_HCAL, HcalAbstractID::BAR_TYPE_MASK << HcalAbstractID::BAR_TYPE_SHIFT,
30 HcalAbstractID::Trigger << HcalAbstractID::BAR_TYPE_SHIFT, fields);
31}
32
33} // namespace ldmx
Class that defines an HCal trigger cell detector ID.
static void registerInterpreter(SubdetectorIDType idtype, const IDField::IDFieldList &fieldList)
Register a new field interpreter for a given subdetector id.
Extension of DetectorID providing access to HCal trigger cell.
static unsigned countOnes(unsigned mask)
Utility for counting number of 1 in a mask.
Definition IDField.cxx:33
std::vector< IDField * > IDFieldList
List of fields.
Definition IDField.h:25