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

Parent of precision and trigger EcalIDs. More...

#include <EcalAbstractID.h>

Public Types

enum  EcalCellType { PrecisionGlobal = 0 , PrecisionLocal = 1 , TriggerCell = 2 , Special = 7 }
 
- Public Types inherited from ldmx::DetectorID
typedef uint32_t RawValue
 

Public Member Functions

 EcalAbstractID ()
 Empty ECAL id (but not null!)
 
 EcalAbstractID (RawValue rawid)
 Create from raw number.
 
 EcalAbstractID (const DetectorID id)
 Create from a DetectorID, but check.
 
 EcalAbstractID (unsigned int cell_type, unsigned int payload)
 Create from pieces.
 
int cell_type () const
 Get the value of the cell field from the ID.
 
int payload () const
 Get the value of the payload field from the 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 Attributes

static const RawValue CELL_TYPE_MASK
 
static const RawValue CELL_TYPE_SHIFT {23}
 
static const RawValue ECAL_PAYLOAD_MASK {0x007FFFFF}
 
- 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

Parent of precision and trigger EcalIDs.

Definition at line 19 of file EcalAbstractID.h.

Member Enumeration Documentation

◆ EcalCellType

enum ldmx::EcalAbstractID::EcalCellType

Definition at line 21 of file EcalAbstractID.h.

21 {
22 PrecisionGlobal = 0, // full-granularity cells, transformed to a uniform
23 // grid not alternating by layer
24 PrecisionLocal = 1, // full-granularity cells, labelled by their local
25 // coordinatate system as from DAQ
26 TriggerCell = 2, // trigger cells
27 Special = 7 // common-mode, calibration cells, etc
28 };

Constructor & Destructor Documentation

◆ EcalAbstractID() [1/4]

ldmx::EcalAbstractID::EcalAbstractID ( )
inline

Empty ECAL id (but not null!)

Definition at line 38 of file EcalAbstractID.h.

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

◆ EcalAbstractID() [2/4]

ldmx::EcalAbstractID::EcalAbstractID ( RawValue  rawid)
inline

Create from raw number.

Definition at line 43 of file EcalAbstractID.h.

43 : DetectorID(rawid) {
44 SUBDETECTORID_TEST("EcalAbstractID", SD_ECAL);
45 }

◆ EcalAbstractID() [3/4]

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

Create from a DetectorID, but check.

Definition at line 50 of file EcalAbstractID.h.

50 : DetectorID(id) {
51 SUBDETECTORID_TEST("EcalAbstractID", SD_ECAL);
52 }

◆ EcalAbstractID() [4/4]

ldmx::EcalAbstractID::EcalAbstractID ( unsigned int  cell_type,
unsigned int  payload 
)
inline

Create from pieces.

Definition at line 57 of file EcalAbstractID.h.

58 : DetectorID(SD_ECAL, 0) {
59 id_ |= (cell_type & CELL_TYPE_MASK) << CELL_TYPE_SHIFT;
60 id_ |= (payload & ECAL_PAYLOAD_MASK);
61 }
RawValue id_
The raw, packed value of the ID.
Definition DetectorID.h:84
int payload() const
Get the value of the payload field from the ID.
int cell_type() const
Get the value of the cell field from the ID.

References cell_type(), ldmx::DetectorID::id_, and payload().

Member Function Documentation

◆ cell_type()

int ldmx::EcalAbstractID::cell_type ( ) const
inline

Get the value of the cell field from the ID.

Returns
The value of the cell field.

Definition at line 67 of file EcalAbstractID.h.

67{ return (id_ >> CELL_TYPE_SHIFT) & CELL_TYPE_MASK; }

References ldmx::DetectorID::id_.

Referenced by EcalAbstractID(), ldmx::EcalID::EcalID(), ldmx::EcalID::EcalID(), ldmx::EcalTriggerID::EcalTriggerID(), and ldmx::EcalTriggerID::EcalTriggerID().

◆ payload()

int ldmx::EcalAbstractID::payload ( ) const
inline

Get the value of the payload field from the ID.

Returns
The value of the payload field.

Definition at line 73 of file EcalAbstractID.h.

73{ return id_ & ECAL_PAYLOAD_MASK; }

References ldmx::DetectorID::id_.

Referenced by EcalAbstractID().

Member Data Documentation

◆ CELL_TYPE_MASK

const RawValue ldmx::EcalAbstractID::CELL_TYPE_MASK
static
Initial value:
{
0x7}

Definition at line 30 of file EcalAbstractID.h.

30 {
31 0x7}; // space for up to eight cell types

◆ CELL_TYPE_SHIFT

const RawValue ldmx::EcalAbstractID::CELL_TYPE_SHIFT {23}
static

Definition at line 32 of file EcalAbstractID.h.

32{23};

◆ ECAL_PAYLOAD_MASK

const RawValue ldmx::EcalAbstractID::ECAL_PAYLOAD_MASK {0x007FFFFF}
static

Definition at line 33 of file EcalAbstractID.h.

33{0x007FFFFF};

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