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

Identifies a location in the Ecal readout chain. More...

#include <EcalElectronicsID.h>

Public Types

typedef PackedIndex< 38, 48, 97 > Index
 
- Public Types inherited from ldmx::DetectorID
typedef uint32_t RawValue
 

Public Member Functions

 EcalElectronicsID ()
 Empty ECAL id (but not null!)
 
 EcalElectronicsID (RawValue rawid)
 Create from raw number.
 
 EcalElectronicsID (const DetectorID id)
 Create from a DetectorID, but check.
 
 EcalElectronicsID (unsigned int fiber, unsigned int elink, unsigned int channel)
 Create from pieces.
 
int fiber () const
 Get the value of the fiber from the ID.
 
int elink () const
 Get the value of the elink from the ID.
 
int channel () const
 Get the value of the channel from the ID.
 
unsigned int index () const
 Get the compact index value.
 
- 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 EcalElectronicsID idFromIndex (unsigned int index)
 Construct an electronics id from an index.
 

Static Public Attributes

static const RawValue INDEX_MASK {0xFFFFFF}
 
static const unsigned int MAX_INDEX {38 * 48 * 200}
 
- 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

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

Detailed Description

Identifies a location in the Ecal readout chain.

– fiber : optical fiber number (backend number), range assumed O(0-96) – elink : electronic link number, range assumed O(0-47) – channel : channel-on-elink, range O(0-37)

For transient use only i.e. we use this ID to help translate the digitized data coming off the detector into spatially-important EcalIDs.

Definition at line 27 of file EcalElectronicsID.h.

Member Typedef Documentation

◆ Index

typedef PackedIndex<38, 48, 97> ldmx::EcalElectronicsID::Index

Definition at line 31 of file EcalElectronicsID.h.

Constructor & Destructor Documentation

◆ EcalElectronicsID() [1/4]

ldmx::EcalElectronicsID::EcalElectronicsID ( )
inline

Empty ECAL id (but not null!)

Definition at line 38 of file EcalElectronicsID.h.

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

◆ EcalElectronicsID() [2/4]

ldmx::EcalElectronicsID::EcalElectronicsID ( RawValue  rawid)
inline

Create from raw number.

Importantly, this is NOT the PackedIndex value, it is the entire raw value including the subsystem ID.

Definition at line 46 of file EcalElectronicsID.h.

46 : DetectorID(rawid) {
47 SUBDETECTORID_TEST("EcalElectronicsID", EID_ECAL);
48 }

◆ EcalElectronicsID() [3/4]

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

Create from a DetectorID, but check.

Definition at line 53 of file EcalElectronicsID.h.

53 : DetectorID(id) {
54 SUBDETECTORID_TEST("EcalElectronicsID", EID_ECAL);
55 }

◆ EcalElectronicsID() [4/4]

ldmx::EcalElectronicsID::EcalElectronicsID ( unsigned int  fiber,
unsigned int  elink,
unsigned int  channel 
)
inline

Create from pieces.

Definition at line 60 of file EcalElectronicsID.h.

62 : DetectorID(EID_ECAL, 0) {
63 Index index(channel, elink, fiber);
64 id_ |= index.value();
65 }
RawValue id_
The raw, packed value of the ID.
Definition DetectorID.h:84
int elink() const
Get the value of the elink from the ID.
unsigned int index() const
Get the compact index value.
int channel() const
Get the value of the channel from the ID.
int fiber() const
Get the value of the fiber from the ID.

References channel(), elink(), fiber(), ldmx::DetectorID::id_, and index().

Member Function Documentation

◆ channel()

int ldmx::EcalElectronicsID::channel ( ) const
inline

Get the value of the channel from the ID.

Returns
The value of the channel field.

Definition at line 95 of file EcalElectronicsID.h.

95{ return Index(id_ & INDEX_MASK).field0(); }

References ldmx::DetectorID::id_.

Referenced by EcalElectronicsID().

◆ elink()

int ldmx::EcalElectronicsID::elink ( ) const
inline

Get the value of the elink from the ID.

Returns
The value of the elink field.

Definition at line 90 of file EcalElectronicsID.h.

90{ return Index(id_ & INDEX_MASK).field1(); }

References ldmx::DetectorID::id_.

Referenced by EcalElectronicsID().

◆ fiber()

int ldmx::EcalElectronicsID::fiber ( ) const
inline

Get the value of the fiber from the ID.

Returns
The value of the fiber field.

Definition at line 85 of file EcalElectronicsID.h.

85{ return Index(id_ & INDEX_MASK).field2(); }

References ldmx::DetectorID::id_.

Referenced by EcalElectronicsID().

◆ idFromIndex()

static EcalElectronicsID ldmx::EcalElectronicsID::idFromIndex ( unsigned int  index)
inlinestatic

Construct an electronics id from an index.

This looks ugly (and it is) because we already have a constructor that uses the unsigned int type. This means we need a different static method for translating something we know to be an EID index rather than a full DetID raw value.

Definition at line 75 of file EcalElectronicsID.h.

75 {
77 eid.id_ |= index;
78 return eid;
79 }
EcalElectronicsID()
Empty ECAL id (but not null!)

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

◆ index()

unsigned int ldmx::EcalElectronicsID::index ( ) const
inline

Get the compact index value.

Definition at line 100 of file EcalElectronicsID.h.

100{ return id_ & INDEX_MASK; }

References ldmx::DetectorID::id_.

Referenced by EcalElectronicsID(), and idFromIndex().

Member Data Documentation

◆ INDEX_MASK

const RawValue ldmx::EcalElectronicsID::INDEX_MASK {0xFFFFFF}
static

Definition at line 29 of file EcalElectronicsID.h.

29{0xFFFFFF};

◆ MAX_INDEX

const unsigned int ldmx::EcalElectronicsID::MAX_INDEX {38 * 48 * 200}
static

Definition at line 33 of file EcalElectronicsID.h.

33{38 * 48 * 200};

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