7#ifndef DETDESCR_ECALTRIGGERDETECTORID_H_
8#define DETDESCR_ECALTRIGGERDETECTORID_H_
22 static const RawValue LAYER_MASK{0x3F};
23 static const RawValue LAYER_SHIFT{12};
24 static const RawValue MODULE_MASK{0x1F};
25 static const RawValue MODULE_SHIFT{7};
26 static const RawValue CELL_MASK{
28 static const RawValue CELL_SHIFT{0};
42 "Attempted to create EcalTriggerID from mismatched Ecal cell_type " +
54 "Attempted to create EcalTriggerID from mismatched Ecal cell_type " +
64 id_ |= (
layer & LAYER_MASK) << LAYER_SHIFT;
65 id_ |= (
module & MODULE_MASK) << MODULE_SHIFT;
66 id_ |= (cell & CELL_MASK) << CELL_SHIFT;
73 int module()
const {
return (
id_ >> MODULE_SHIFT) & MODULE_MASK; }
85 int layer()
const {
return (
id_ >> LAYER_SHIFT) & LAYER_MASK; }
111 std::pair<unsigned int, unsigned int>
getCellUV()
const;
113 static void createInterpreters();
Class that serves as a parent for ECal detector IDs of various types.
Defines a 32-bit packed ID for uniquely identifying hits and detector components.
RawValue id_
The raw, packed value of the ID.
Parent of precision and trigger EcalIDs.
int cell_type() const
Get the value of the cell field from the ID.
Extension of DetectorID providing access to ECal trigger cell information.
std::pair< unsigned int, unsigned int > getCellUV() const
Get the cell u,v index assuming a CMS-standard 432-cell sensor.
int layer() const
Get the value of the layer field from the ID.
EcalTriggerID()
Empty ECAL id (but not null!)
EcalTriggerID(RawValue rawid)
Create from raw number.
int module() const
Get the value of the module field from the ID.
int getLayerID() const
Get the value of the layer field from the ID.
EcalTriggerID(const DetectorID id)
Create from a DetectorID, but check.
int triggercell() const
Get the value of the trigger cell field from the ID.
int getTriggerCellID() const
Get the value of the trigger cell field from the ID.
EcalTriggerID(unsigned int layer, unsigned int module, unsigned int cell)
Create from pieces.
int getModuleID() const
Get the value of the module field from the ID.