LDMX Software
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ldmx::TrigScintID Class Reference

Class that defines the detector ID of the trigger scintillator. More...

#include <TrigScintID.h>

Public Member Functions

 TrigScintID ()
 Constructor.
 
 TrigScintID (unsigned int rawid)
 Constructor with raw id.
 
 TrigScintID (const DetectorID id)
 Create from a DetectorID, but check.
 
 TrigScintID (unsigned int module, unsigned int bar)
 Create from pieces.
 
 ~TrigScintID ()
 Destructor.
 
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.
 
int bar () const
 Get the value of the bar field from the ID.
 
int getBarID () const
 Get the bar ID.
 
- Public Member Functions inherited from ldmx::DetectorID
 DetectorID ()
 Class constructor for a null DetectorID.
 
 DetectorID (RawValue rawid)
 Class constructor from a raw 32-bit integer.
 
 DetectorID (SubdetectorIDType sdtype, RawValue raw_subpayload)
 Class constructor from a subdetector id and a subdetector-specific section (masked to.
 
bool null () const
 
SubdetectorIDType subdet () const
 
RawValue raw () const
 
void setRawValue (RawValue rawValue)
 Set the raw value of the detector ID.
 
bool operator< (const DetectorID &id) const
 
bool operator== (const DetectorID &id) const
 
bool operator!= (const DetectorID &id) const
 

Static Public Member Functions

static void createInterpreters ()
 

Static Public Attributes

static const RawValue MODULE_MASK {0xFF}
 
static const RawValue MODULE_SHIFT {8}
 
static const RawValue BAR_MASK {0xFF}
 
static const RawValue BAR_SHIFT {0}
 
- Static Public Attributes inherited from ldmx::DetectorID
static const RawValue SUBDETECTORID_MASK {0x3F}
 
static const RawValue SUBDETECTORID_SHIFT {26}
 
static const RawValue SUBDETECTOR_PAYLOAD_MASK {0x3FFFFFF}
 

Additional Inherited Members

- Public Types inherited from ldmx::DetectorID
typedef uint32_t RawValue
 
- Protected Attributes inherited from ldmx::DetectorID
RawValue id_
 The raw, packed value of the ID.
 

Detailed Description

Class that defines the detector ID of the trigger scintillator.

Definition at line 14 of file TrigScintID.h.

Constructor & Destructor Documentation

◆ TrigScintID() [1/4]

ldmx::TrigScintID::TrigScintID ( )
inline

Constructor.

Definition at line 22 of file TrigScintID.h.

22: DetectorID(SD_TRIGGER_SCINT, 0) {}
DetectorID()
Class constructor for a null DetectorID.
Definition DetectorID.h:44

◆ TrigScintID() [2/4]

ldmx::TrigScintID::TrigScintID ( unsigned int  rawid)
inline

Constructor with raw id.

Definition at line 25 of file TrigScintID.h.

25 : DetectorID(rawid) {
26 SUBDETECTORID_TEST("TrigScintID", SD_TRIGGER_SCINT);
27 }

◆ TrigScintID() [3/4]

ldmx::TrigScintID::TrigScintID ( const DetectorID  id)
inline

Create from a DetectorID, but check.

Definition at line 32 of file TrigScintID.h.

32 : DetectorID(id) {
33 SUBDETECTORID_TEST("TrigScintID", SD_TRIGGER_SCINT);
34 }

◆ TrigScintID() [4/4]

ldmx::TrigScintID::TrigScintID ( unsigned int  module,
unsigned int  bar 
)
inline

Create from pieces.

Definition at line 39 of file TrigScintID.h.

40 : DetectorID(SD_TRIGGER_SCINT, 0) {
41 id_ |= (module & MODULE_MASK) << MODULE_SHIFT;
42 id_ |= (bar & BAR_MASK) << BAR_SHIFT;
43 }
RawValue id_
The raw, packed value of the ID.
Definition DetectorID.h:84
int bar() const
Get the value of the bar field from the ID.
Definition TrigScintID.h:64

References bar(), and ldmx::DetectorID::id_.

◆ ~TrigScintID()

ldmx::TrigScintID::~TrigScintID ( )
inline

Destructor.

Definition at line 46 of file TrigScintID.h.

46{}

Member Function Documentation

◆ bar()

int ldmx::TrigScintID::bar ( ) const
inline

Get the value of the bar field from the ID.

Returns
The value of the bar field.

Definition at line 64 of file TrigScintID.h.

64{ return (id_ >> BAR_SHIFT) & BAR_MASK; }

References ldmx::DetectorID::id_.

Referenced by dqm::TrigScintDQM::analyze(), trigscint::TrigScintDigiProducer::produce(), TEST_CASE(), and TrigScintID().

◆ createInterpreters()

void ldmx::TrigScintID::createInterpreters ( )
static

Definition at line 11 of file TrigScintID.cxx.

11 {
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}
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

◆ getBarID()

int ldmx::TrigScintID::getBarID ( ) const
inline

Get the bar ID.

Returns
The bar ID.

Definition at line 70 of file TrigScintID.h.

70{ return (id_ >> BAR_SHIFT) & BAR_MASK; }

References ldmx::DetectorID::id_.

Referenced by TEST_CASE().

◆ getModule()

int ldmx::TrigScintID::getModule ( ) const
inline

Get the value of the module field from the ID.

Returns
The value of the module field.

Definition at line 58 of file TrigScintID.h.

58{ return (id_ >> MODULE_SHIFT) & MODULE_MASK; }

References ldmx::DetectorID::id_.

Referenced by TEST_CASE().

◆ module()

int ldmx::TrigScintID::module ( ) const
inline

Get the value of the module field from the ID.

Returns
The value of the module field.

Definition at line 52 of file TrigScintID.h.

52{ return (id_ >> MODULE_SHIFT) & MODULE_MASK; }

References ldmx::DetectorID::id_.

Referenced by TEST_CASE().

Member Data Documentation

◆ BAR_MASK

const RawValue ldmx::TrigScintID::BAR_MASK {0xFF}
static

Definition at line 18 of file TrigScintID.h.

18{0xFF};

◆ BAR_SHIFT

const RawValue ldmx::TrigScintID::BAR_SHIFT {0}
static

Definition at line 19 of file TrigScintID.h.

19{0};

◆ MODULE_MASK

const RawValue ldmx::TrigScintID::MODULE_MASK {0xFF}
static

Definition at line 16 of file TrigScintID.h.

16{0xFF};

◆ MODULE_SHIFT

const RawValue ldmx::TrigScintID::MODULE_SHIFT {8}
static

Definition at line 17 of file TrigScintID.h.

17{8};

The documentation for this class was generated from the following files: