LDMX Software
EcalTriggerID.cxx
2
3#include "DetDescr/DetectorIDInterpreter.h"
4
5std::ostream& operator<<(std::ostream& s, const ldmx::EcalTriggerID& id) {
6 s << "EcalTrig(" << id.layer() << ',' << id.module() << ','
7 << id.triggercell() << ')';
8 return s;
9}
10
11namespace ldmx {
12
13void EcalTriggerID::createInterpreters() {
15 fields.push_back(new IDField("subdetector", 0, SUBDETECTORID_SHIFT, 31));
16 fields.push_back(
17 new IDField("layer", 1, LAYER_SHIFT,
18 LAYER_SHIFT + IDField::countOnes(LAYER_MASK) - 1));
19 fields.push_back(
20 new IDField("module", 2, MODULE_SHIFT,
21 MODULE_SHIFT + IDField::countOnes(MODULE_MASK) - 1));
22 fields.push_back(new IDField("cell", 3, CELL_SHIFT,
23 CELL_SHIFT + IDField::countOnes(CELL_MASK) - 1));
24
26 SD_ECAL,
27 EcalAbstractID::CELL_TYPE_MASK << EcalAbstractID::CELL_TYPE_SHIFT,
28 EcalAbstractID::TriggerCell << EcalAbstractID::CELL_TYPE_SHIFT, fields);
29}
30
31} // namespace ldmx
Class that defines an ECal 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 ECal trigger cell information.
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