CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes
HGCalTriggerBackendDetId Class Reference

#include <HGCalTriggerBackendDetId.h>

Inheritance diagram for HGCalTriggerBackendDetId:
DetId

Public Types

enum  BackendType { LpGBT, Stage1FPGA, Stage1Link, Stage2FPGA }
 
- Public Types inherited from DetId
enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5, Forward = 6, VeryForward = 7, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 

Public Member Functions

int classId () const
 get the class More...
 
 HGCalTriggerBackendDetId ()
 
 HGCalTriggerBackendDetId (uint32_t rawid)
 
 HGCalTriggerBackendDetId (int zp, int type, int sector, int label)
 
 HGCalTriggerBackendDetId (const DetId &id)
 
bool isForward () const
 
bool isHGCalBackendDetId () const
 
bool isHGCalModuleDetId () const
 
bool isLpGBT () const
 
bool isStage1FPGA () const
 
bool isStage1Link () const
 
bool isStage2FPGA () const
 
int label () const
 get the value More...
 
HGCalTriggerBackendDetIdoperator= (const DetId &id)
 
int sector () const
 get the sector # More...
 
int type () const
 get the type More...
 
int zside () const
 get the z-side of the backend object (1/-1) More...
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static const int kHGCalLabelMask = 0x7FF
 
static const int kHGCalLabelOffset = 0
 
static const int kHGCalSectorMask = 0x3
 
static const int kHGCalSectorOffset = 11
 
static const int kHGCalTriggerClassIdentifierMask = 0x1
 
static const int kHGCalTriggerClassIdentifierOffset = 24
 
static const int kHGCalTypeMask = 0x7
 
static const int kHGCalTypeOffset = 13
 
static const int kHGCalZsideMask = 0x1
 
static const int kHGCalZsideOffset = 16
 
static const HGCalTriggerBackendDetId Undefined
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 22 of file HGCalTriggerBackendDetId.h.

Member Enumeration Documentation

◆ BackendType

Constructor & Destructor Documentation

◆ HGCalTriggerBackendDetId() [1/4]

HGCalTriggerBackendDetId::HGCalTriggerBackendDetId ( )

Create a null backend id

Definition at line 5 of file HGCalTriggerBackendDetId.cc.

5 : DetId() {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCalTriggerBackendDetId() [2/4]

HGCalTriggerBackendDetId::HGCalTriggerBackendDetId ( uint32_t  rawid)

Create backend id from raw id (0=invalid id)

Definition at line 7 of file HGCalTriggerBackendDetId.cc.

7 : DetId(rawid) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCalTriggerBackendDetId() [3/4]

HGCalTriggerBackendDetId::HGCalTriggerBackendDetId ( int  zp,
int  type,
int  sector,
int  label 
)

Constructor from zplus, type, sector, label

Definition at line 9 of file HGCalTriggerBackendDetId.cc.

References BackendDetId, Forward, DetId::id_, kHGCalLabelMask, kHGCalLabelOffset, kHGCalSectorMask, kHGCalSectorOffset, kHGCalTriggerClassIdentifierMask, kHGCalTriggerClassIdentifierOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalZsideMask, kHGCalZsideOffset, label(), sector(), and zside().

12  int zside = (zp < 0) ? 1 : 0;
16 }
static const int kHGCalTriggerClassIdentifierMask
int zside() const
get the z-side of the backend object (1/-1)
int sector() const
get the sector #
int label() const
get the value
uint32_t id_
Definition: DetId.h:69
static const int kHGCalTriggerClassIdentifierOffset
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCalTriggerBackendDetId() [4/4]

HGCalTriggerBackendDetId::HGCalTriggerBackendDetId ( const DetId id)

Constructor from a generic det id

Definition at line 18 of file HGCalTriggerBackendDetId.cc.

References TauDecayModes::dec, Exception, DetId::Forward, and DetId::id_.

18  {
19  if (!gen.null()) {
20  if (gen.det() != Forward) {
21  throw cms::Exception("Invalid DetId")
22  << "Cannot initialize HGCalTriggerBackendDetId from " << std::hex << gen.rawId() << std::dec;
23  }
24  }
25  id_ = gen.rawId();
26 }
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

◆ classId()

int HGCalTriggerBackendDetId::classId ( ) const
inline

◆ isForward()

bool HGCalTriggerBackendDetId::isForward ( ) const
inline

Definition at line 54 of file HGCalTriggerBackendDetId.h.

54 { return true; }

◆ isHGCalBackendDetId()

bool HGCalTriggerBackendDetId::isHGCalBackendDetId ( ) const
inline

◆ isHGCalModuleDetId()

bool HGCalTriggerBackendDetId::isHGCalModuleDetId ( ) const
inline

Definition at line 55 of file HGCalTriggerBackendDetId.h.

References classId(), and ModuleDetId.

◆ isLpGBT()

bool HGCalTriggerBackendDetId::isLpGBT ( ) const
inline

Definition at line 50 of file HGCalTriggerBackendDetId.h.

References type().

50 { return (type() == BackendType::LpGBT); }
int type() const
get the type

◆ isStage1FPGA()

bool HGCalTriggerBackendDetId::isStage1FPGA ( ) const
inline

Definition at line 51 of file HGCalTriggerBackendDetId.h.

References type().

51 { return (type() == BackendType::Stage1FPGA); }
int type() const
get the type

◆ isStage1Link()

bool HGCalTriggerBackendDetId::isStage1Link ( ) const
inline

Definition at line 52 of file HGCalTriggerBackendDetId.h.

References type().

52 { return (type() == BackendType::Stage1Link); }
int type() const
get the type

◆ isStage2FPGA()

bool HGCalTriggerBackendDetId::isStage2FPGA ( ) const
inline

Definition at line 53 of file HGCalTriggerBackendDetId.h.

References type().

53 { return (type() == BackendType::Stage2FPGA); }
int type() const
get the type

◆ label()

int HGCalTriggerBackendDetId::label ( ) const
inline

get the value

Definition at line 48 of file HGCalTriggerBackendDetId.h.

References DetId::id_, kHGCalLabelMask, and kHGCalLabelOffset.

Referenced by HGCalTriggerBackendDetId().

48 { return (id_ >> kHGCalLabelOffset) & kHGCalLabelMask; }
uint32_t id_
Definition: DetId.h:69

◆ operator=()

HGCalTriggerBackendDetId & HGCalTriggerBackendDetId::operator= ( const DetId id)

Assignment from a generic det id

Definition at line 28 of file HGCalTriggerBackendDetId.cc.

References TauDecayModes::dec, Exception, DetId::Forward, and DetId::id_.

28  {
29  if (!gen.null()) {
30  if (gen.det() != Forward) {
31  throw cms::Exception("Invalid DetId")
32  << "Cannot assign HGCalTriggerBackendDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36  return (*this);
37 }
uint32_t id_
Definition: DetId.h:69

◆ sector()

int HGCalTriggerBackendDetId::sector ( ) const
inline

◆ type()

int HGCalTriggerBackendDetId::type ( ) const
inline

get the type

Definition at line 39 of file HGCalTriggerBackendDetId.h.

References DetId::id_, kHGCalTypeMask, and kHGCalTypeOffset.

Referenced by isLpGBT(), isStage1FPGA(), isStage1Link(), and isStage2FPGA().

39 { return (id_ >> kHGCalTypeOffset) & kHGCalTypeMask; }
uint32_t id_
Definition: DetId.h:69

◆ zside()

int HGCalTriggerBackendDetId::zside ( ) const
inline

get the z-side of the backend object (1/-1)

Definition at line 42 of file HGCalTriggerBackendDetId.h.

References DetId::id_, kHGCalZsideMask, and kHGCalZsideOffset.

Referenced by HGCalTriggerBackendDetId().

42 { return ((id_ >> kHGCalZsideOffset) & kHGCalZsideMask ? -1 : 1); }
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

◆ kHGCalLabelMask

const int HGCalTriggerBackendDetId::kHGCalLabelMask = 0x7FF
static

Definition at line 61 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and label().

◆ kHGCalLabelOffset

const int HGCalTriggerBackendDetId::kHGCalLabelOffset = 0
static

Definition at line 60 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and label().

◆ kHGCalSectorMask

const int HGCalTriggerBackendDetId::kHGCalSectorMask = 0x3
static

Definition at line 63 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and sector().

◆ kHGCalSectorOffset

const int HGCalTriggerBackendDetId::kHGCalSectorOffset = 11
static

Definition at line 62 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and sector().

◆ kHGCalTriggerClassIdentifierMask

const int HGCalTriggerBackendDetId::kHGCalTriggerClassIdentifierMask = 0x1
static

Definition at line 69 of file HGCalTriggerBackendDetId.h.

Referenced by classId(), and HGCalTriggerBackendDetId().

◆ kHGCalTriggerClassIdentifierOffset

const int HGCalTriggerBackendDetId::kHGCalTriggerClassIdentifierOffset = 24
static

Definition at line 68 of file HGCalTriggerBackendDetId.h.

Referenced by classId(), and HGCalTriggerBackendDetId().

◆ kHGCalTypeMask

const int HGCalTriggerBackendDetId::kHGCalTypeMask = 0x7
static

Definition at line 65 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and type().

◆ kHGCalTypeOffset

const int HGCalTriggerBackendDetId::kHGCalTypeOffset = 13
static

Definition at line 64 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and type().

◆ kHGCalZsideMask

const int HGCalTriggerBackendDetId::kHGCalZsideMask = 0x1
static

Definition at line 67 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and zside().

◆ kHGCalZsideOffset

const int HGCalTriggerBackendDetId::kHGCalZsideOffset = 16
static

Definition at line 66 of file HGCalTriggerBackendDetId.h.

Referenced by HGCalTriggerBackendDetId(), and zside().

◆ Undefined

const HGCalTriggerBackendDetId HGCalTriggerBackendDetId::Undefined
static

Definition at line 58 of file HGCalTriggerBackendDetId.h.