1#ifndef DETDESCR_TRIGSCINTID_H
2#define DETDESCR_TRIGSCINTID_H
7#include "DetDescr/DetectorID.h"
16 static const RawValue MODULE_MASK{0xFF};
17 static const RawValue MODULE_SHIFT{8};
18 static const RawValue BAR_MASK{0xFF};
19 static const RawValue BAR_SHIFT{0};
26 SUBDETECTORID_TEST(
"TrigScintID", SD_TRIGGER_SCINT);
33 SUBDETECTORID_TEST(
"TrigScintID", SD_TRIGGER_SCINT);
41 id_ |= (
module & MODULE_MASK) << MODULE_SHIFT;
42 id_ |= (
bar & BAR_MASK) << BAR_SHIFT;
52 int module()
const {
return (
id_ >> MODULE_SHIFT) & MODULE_MASK; }
58 int getModule()
const {
return (
id_ >> MODULE_SHIFT) & MODULE_MASK; }
64 int bar()
const {
return (
id_ >> BAR_SHIFT) & BAR_MASK; }
70 int getBarID()
const {
return (
id_ >> BAR_SHIFT) & BAR_MASK; }
72 static void createInterpreters();
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
Class that defines the detector ID of the trigger scintillator.
TrigScintID(unsigned int module, unsigned int bar)
Create from pieces.
~TrigScintID()
Destructor.
TrigScintID()
Constructor.
int module() const
Get the value of the module field from the ID.
int getModule() const
Get the value of the module field from the ID.
TrigScintID(const DetectorID id)
Create from a DetectorID, but check.
TrigScintID(unsigned int rawid)
Constructor with raw id.
int getBarID() const
Get the bar ID.
int bar() const
Get the value of the bar field from the ID.