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

Defines a 32-bit packed ID for uniquely identifying hits and detector components. More...

#include <DetectorID.h>

Public Types

typedef uint32_t RawValue
 

Public Member Functions

 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 Attributes

static const RawValue SUBDETECTORID_MASK {0x3F}
 
static const RawValue SUBDETECTORID_SHIFT {26}
 
static const RawValue SUBDETECTOR_PAYLOAD_MASK {0x3FFFFFF}
 

Protected Attributes

RawValue id_
 The raw, packed value of the ID.
 

Detailed Description

Defines a 32-bit packed ID for uniquely identifying hits and detector components.

Note
This class has a memory footprint of a single 32-bit integer, so can be efficiently used in data structures

Definition at line 35 of file DetectorID.h.

Member Typedef Documentation

◆ RawValue

typedef uint32_t ldmx::DetectorID::RawValue

Definition at line 37 of file DetectorID.h.

Constructor & Destructor Documentation

◆ DetectorID() [1/3]

ldmx::DetectorID::DetectorID ( )
inline

Class constructor for a null DetectorID.

Definition at line 44 of file DetectorID.h.

44: id_{0} {}
RawValue id_
The raw, packed value of the ID.
Definition DetectorID.h:84

◆ DetectorID() [2/3]

ldmx::DetectorID::DetectorID ( RawValue  rawid)
inline

Class constructor from a raw 32-bit integer.

Definition at line 47 of file DetectorID.h.

47: id_{rawid} {}

◆ DetectorID() [3/3]

ldmx::DetectorID::DetectorID ( SubdetectorIDType  sdtype,
RawValue  raw_subpayload 
)
inline

Class constructor from a subdetector id and a subdetector-specific section (masked to.

Definition at line 53 of file DetectorID.h.

53 {
54 id_ = ((RawValue(sdtype) & DetectorID::SUBDETECTORID_MASK)
55 << DetectorID::SUBDETECTORID_SHIFT) |
56 (raw_subpayload & DetectorID::SUBDETECTOR_PAYLOAD_MASK);
57 }

References id_.

Member Function Documentation

◆ null()

bool ldmx::DetectorID::null ( ) const
inline

◆ operator!=()

bool ldmx::DetectorID::operator!= ( const DetectorID id) const
inline

Definition at line 80 of file DetectorID.h.

80{ return id_ != id.id_; }

◆ operator<()

bool ldmx::DetectorID::operator< ( const DetectorID id) const
inline

Definition at line 76 of file DetectorID.h.

76{ return id_ < id.id_; }

◆ operator==()

bool ldmx::DetectorID::operator== ( const DetectorID id) const
inline

Definition at line 78 of file DetectorID.h.

78{ return id_ == id.id_; }

◆ raw()

RawValue ldmx::DetectorID::raw ( ) const
inline

◆ setRawValue()

void ldmx::DetectorID::setRawValue ( RawValue  rawValue)
inline

Set the raw value of the detector ID.

Parameters
rawValueThe raw value of the ID.

Definition at line 74 of file DetectorID.h.

74{ id_ = rawValue; }

References id_.

◆ subdet()

SubdetectorIDType ldmx::DetectorID::subdet ( ) const
inline
Returns
The subdetector range.

Definition at line 63 of file DetectorID.h.

63 {
64 return SubdetectorIDType((id_ >> SUBDETECTORID_SHIFT) & SUBDETECTORID_MASK);
65 }

References id_.

Referenced by TEST_CASE().

Member Data Documentation

◆ id_

RawValue ldmx::DetectorID::id_
protected

The raw, packed value of the ID.

Definition at line 84 of file DetectorID.h.

Referenced by ldmx::TrigScintID::bar(), ldmx::HcalAbstractID::bar_type(), ldmx::EcalID::cell(), ldmx::EcalAbstractID::cell_type(), ldmx::EcalElectronicsID::channel(), ldmx::HcalElectronicsID::channel(), DetectorID(), ldmx::EcalAbstractID::EcalAbstractID(), ldmx::EcalElectronicsID::EcalElectronicsID(), ldmx::EcalID::EcalID(), ldmx::EcalID::EcalID(), ldmx::EcalTriggerID::EcalTriggerID(), ldmx::EcalElectronicsID::elink(), ldmx::HcalElectronicsID::elink(), ldmx::HcalDigiID::end(), ldmx::HcalTriggerID::end(), ldmx::EcalElectronicsID::fiber(), ldmx::HcalElectronicsID::fiber(), ldmx::TrigScintID::getBarID(), ldmx::EcalID::getCellID(), ldmx::EcalID::getLayerID(), ldmx::EcalTriggerID::getLayerID(), ldmx::HcalDigiID::getLayerID(), ldmx::HcalID::getLayerID(), ldmx::HcalTriggerID::getLayerID(), ldmx::TrigScintID::getModule(), ldmx::EcalID::getModuleID(), ldmx::EcalTriggerID::getModuleID(), ldmx::HcalDigiID::getSection(), ldmx::HcalDigiID::getStrip(), ldmx::HcalID::getStrip(), ldmx::HcalTriggerID::getSuperstrip(), ldmx::EcalTriggerID::getTriggerCellID(), ldmx::HcalAbstractID::HcalAbstractID(), ldmx::HcalDigiID::HcalDigiID(), ldmx::HcalElectronicsID::HcalElectronicsID(), ldmx::HcalID::HcalID(), ldmx::HcalTriggerID::HcalTriggerID(), ldmx::EcalElectronicsID::idFromIndex(), ldmx::HcalElectronicsID::idFromIndex(), ldmx::EcalElectronicsID::index(), ldmx::HcalElectronicsID::index(), ldmx::EcalID::layer(), ldmx::EcalTriggerID::layer(), ldmx::HcalDigiID::layer(), ldmx::HcalID::layer(), ldmx::HcalTriggerID::layer(), ldmx::TrackerID::layer(), ldmx::EcalID::module(), ldmx::EcalTriggerID::module(), ldmx::TrackerID::module(), ldmx::TrigScintID::module(), null(), ldmx::EcalAbstractID::payload(), ldmx::HcalAbstractID::payload(), ldmx::SimSpecialID::plane(), raw(), ldmx::HcalDigiID::section(), setRawValue(), ldmx::SimSpecialID::SimSpecialID(), ldmx::HcalDigiID::strip(), ldmx::HcalID::strip(), subdet(), ldmx::SimSpecialID::subtypePayload(), ldmx::HcalTriggerID::superstrip(), ldmx::TrackerID::TrackerID(), ldmx::EcalTriggerID::triggercell(), and ldmx::TrigScintID::TrigScintID().

◆ SUBDETECTOR_PAYLOAD_MASK

const RawValue ldmx::DetectorID::SUBDETECTOR_PAYLOAD_MASK {0x3FFFFFF}
static

Definition at line 41 of file DetectorID.h.

41{0x3FFFFFF};

◆ SUBDETECTORID_MASK

const RawValue ldmx::DetectorID::SUBDETECTORID_MASK {0x3F}
static

Definition at line 39 of file DetectorID.h.

39{0x3F};

◆ SUBDETECTORID_SHIFT

const RawValue ldmx::DetectorID::SUBDETECTORID_SHIFT {26}
static

Definition at line 40 of file DetectorID.h.

40{26};

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