LDMX Software
TrigScintID.cxx
1#include "DetDescr/TrigScintID.h"
2
3#include "DetDescr/DetectorIDInterpreter.h"
4
5namespace ldmx {
6
7std::ostream& operator<<(std::ostream& s, const ldmx::TrigScintID& id) {
8 s << "TrigScint(" << id.module() << ',' << id.bar() << ')';
9 return s;
10}
11
12void TrigScintID::createInterpreters() {
14 fields.push_back(new IDField("subdetector", 0, SUBDETECTORID_SHIFT, 31));
15 fields.push_back(
16 new IDField("module", 1, MODULE_SHIFT,
17 MODULE_SHIFT + IDField::countOnes(MODULE_MASK) - 1));
18 fields.push_back(new IDField("bar", 2, BAR_SHIFT,
19 BAR_SHIFT + IDField::countOnes(BAR_MASK) - 1));
20
21 DetectorIDInterpreter::registerInterpreter(SD_TRIGGER_SCINT, fields);
22}
23} // namespace ldmx
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.
Definition IDField.cxx:33
std::vector< IDField * > IDFieldList
List of fields.
Definition IDField.h:25
Class that defines the detector ID of the trigger scintillator.
Definition TrigScintID.h:14