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