CMS 3D CMS Logo

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

#include <HGCEEDetId.h>

Inheritance diagram for HGCEEDetId:
DetId

Public Types

enum  { Subdet = HGCEE }
 
- 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 cell () const
 get the absolute value of the cell #'s in x and y More...
 
HGCEEDetId geometryCell () const
 
 HGCEEDetId ()
 
 HGCEEDetId (uint32_t rawid)
 
 HGCEEDetId (ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
 
 HGCEEDetId (const DetId &id)
 
bool isEE () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
int layer () const
 get the layer # More...
 
HGCEEDetIdoperator= (const DetId &id)
 
int sector () const
 get the sector # More...
 
ForwardSubdetector subdet () const
 get the subdetector More...
 
int subsector () const
 get the degree subsector More...
 
int zside () const
 get the z-side of the cell (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 kHGCEECellMask = 0xFFF
 
static const int kHGCEECellOffset = 0
 
static const int kHGCEELayerMask = 0x1F
 
static const int kHGCEELayerOffset = 19
 
static const int kHGCEESectorMask = 0x3F
 
static const int kHGCEESectorOffset = 12
 
static const int kHGCEESubSectorMask = 0x1
 
static const int kHGCEESubSectorOffset = 18
 
static const int kHGCEEZsideMask = 0x1
 
static const int kHGCEEZsideOffset = 24
 
static const HGCEEDetId 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 8 of file HGCEEDetId.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Subdet 

Definition at line 20 of file HGCEEDetId.h.

Constructor & Destructor Documentation

◆ HGCEEDetId() [1/4]

HGCEEDetId::HGCEEDetId ( )

Create a null cellid

Definition at line 8 of file HGCEEDetId.cc.

Referenced by geometryCell().

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

◆ HGCEEDetId() [2/4]

HGCEEDetId::HGCEEDetId ( uint32_t  rawid)

Create cellid from raw id (0=invalid tower id)

Definition at line 10 of file HGCEEDetId.cc.

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

◆ HGCEEDetId() [3/4]

HGCEEDetId::HGCEEDetId ( ForwardSubdetector  subdet,
int  zp,
int  lay,
int  mod,
int  subsec,
int  cell 
)

Constructor from subdetector, zplus, layer, module, cell numbers

Definition at line 12 of file HGCEEDetId.cc.

References cell(), DetId::id_, kHGCEECellMask, kHGCEECellOffset, kHGCEELayerMask, kHGCEELayerOffset, kHGCEESectorMask, kHGCEESectorOffset, kHGCEESubSectorMask, kHGCEESubSectorOffset, kHGCEEZsideMask, kHGCEEZsideOffset, and fileinputsource_cfi::sec.

13  : DetId(Forward, subdet) {
16  if (subsec < 0)
17  subsec = 0;
19  id_ |= ((lay & kHGCEELayerMask) << kHGCEELayerOffset);
20  if (zp > 0)
21  id_ |= ((zp & kHGCEEZsideMask) << kHGCEEZsideOffset);
22 }
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:17
static const int kHGCEECellMask
Definition: HGCEEDetId.h:11
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCEEDetId.h:39
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:16
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:19
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:13
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:18
uint32_t id_
Definition: DetId.h:69
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:14
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:15
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:12
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:10
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCEEDetId() [4/4]

HGCEEDetId::HGCEEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 24 of file HGCEEDetId.cc.

References TauDecayModes::dec, Exception, DetId::Forward, HGCEE, DetId::id_, and subdet().

24  {
25  if (!gen.null()) {
27  if (gen.det() != Forward || (subdet != HGCEE)) {
28  throw cms::Exception("Invalid DetId")
29  << "Cannot initialize HGCEEDetId from " << std::hex << gen.rawId() << std::dec;
30  }
31  }
32  id_ = gen.rawId();
33 }
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

◆ cell()

int HGCEEDetId::cell ( ) const
inline

get the absolute value of the cell #'s in x and y

Definition at line 39 of file HGCEEDetId.h.

References DetId::id_, and kHGCEECellMask.

Referenced by HGCEEDetId().

39 { return id_ & kHGCEECellMask; }
static const int kHGCEECellMask
Definition: HGCEEDetId.h:11
uint32_t id_
Definition: DetId.h:69

◆ geometryCell()

HGCEEDetId HGCEEDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 33 of file HGCEEDetId.h.

References HGCEEDetId(), layer(), sector(), subdet(), and zside().

33 { return HGCEEDetId(subdet(), zside(), layer(), sector(), 0, 0); }
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
int sector() const
get the sector #
Definition: HGCEEDetId.h:42
int layer() const
get the layer #
Definition: HGCEEDetId.h:48
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:51

◆ isEE()

bool HGCEEDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 54 of file HGCEEDetId.h.

54 { return true; }

◆ isForward()

bool HGCEEDetId::isForward ( ) const
inline

Definition at line 55 of file HGCEEDetId.h.

55 { return true; }

◆ layer()

int HGCEEDetId::layer ( ) const
inline

get the layer #

Definition at line 48 of file HGCEEDetId.h.

References DetId::id_, kHGCEELayerMask, and kHGCEELayerOffset.

Referenced by geometryCell(), geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

48 { return (id_ >> kHGCEELayerOffset) & kHGCEELayerMask; }
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:17
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:16
uint32_t id_
Definition: DetId.h:69

◆ operator=()

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

Assignment from a generic cell id

Definition at line 35 of file HGCEEDetId.cc.

References TauDecayModes::dec, Exception, DetId::Forward, HGCEE, DetId::id_, and subdet().

35  {
36  if (!gen.null()) {
38  if (gen.det() != Forward || (subdet != HGCEE)) {
39  throw cms::Exception("Invalid DetId") << "Cannot assign HGCEEDetId from " << std::hex << gen.rawId() << std::dec;
40  }
41  }
42  id_ = gen.rawId();
43  return (*this);
44 }
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69

◆ sector()

int HGCEEDetId::sector ( ) const
inline

get the sector #

Definition at line 42 of file HGCEEDetId.h.

References DetId::id_, kHGCEESectorMask, and kHGCEESectorOffset.

Referenced by geometryCell(), and geometryXMLparser.DTAlignable::index().

42 { return (id_ >> kHGCEESectorOffset) & kHGCEESectorMask; }
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:13
uint32_t id_
Definition: DetId.h:69
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:12

◆ subdet()

ForwardSubdetector HGCEEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 36 of file HGCEEDetId.h.

References HGCEE.

Referenced by geometryCell(), HGCEEDetId(), and operator=().

36 { return HGCEE; }

◆ subsector()

int HGCEEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 45 of file HGCEEDetId.h.

References DetId::id_, kHGCEESubSectorMask, and kHGCEESubSectorOffset.

45 { return ((id_ >> kHGCEESubSectorOffset) & kHGCEESubSectorMask ? 1 : -1); }
uint32_t id_
Definition: DetId.h:69
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:14
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:15

◆ zside()

int HGCEEDetId::zside ( ) const
inline

get the z-side of the cell (1/-1)

Definition at line 51 of file HGCEEDetId.h.

References DetId::id_, kHGCEEZsideMask, and kHGCEEZsideOffset.

Referenced by geometryCell().

51 { return ((id_ >> kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:19
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:18
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

◆ kHGCEECellMask

const int HGCEEDetId::kHGCEECellMask = 0xFFF
static

Definition at line 11 of file HGCEEDetId.h.

Referenced by cell(), and HGCEEDetId().

◆ kHGCEECellOffset

const int HGCEEDetId::kHGCEECellOffset = 0
static

Definition at line 10 of file HGCEEDetId.h.

Referenced by HGCEEDetId().

◆ kHGCEELayerMask

const int HGCEEDetId::kHGCEELayerMask = 0x1F
static

Definition at line 17 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and layer().

◆ kHGCEELayerOffset

const int HGCEEDetId::kHGCEELayerOffset = 19
static

Definition at line 16 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and layer().

◆ kHGCEESectorMask

const int HGCEEDetId::kHGCEESectorMask = 0x3F
static

Definition at line 13 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and sector().

◆ kHGCEESectorOffset

const int HGCEEDetId::kHGCEESectorOffset = 12
static

Definition at line 12 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and sector().

◆ kHGCEESubSectorMask

const int HGCEEDetId::kHGCEESubSectorMask = 0x1
static

Definition at line 15 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and subsector().

◆ kHGCEESubSectorOffset

const int HGCEEDetId::kHGCEESubSectorOffset = 18
static

Definition at line 14 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and subsector().

◆ kHGCEEZsideMask

const int HGCEEDetId::kHGCEEZsideMask = 0x1
static

Definition at line 19 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and zside().

◆ kHGCEEZsideOffset

const int HGCEEDetId::kHGCEEZsideOffset = 24
static

Definition at line 18 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and zside().

◆ Undefined

const HGCEEDetId HGCEEDetId::Undefined
static

Definition at line 57 of file HGCEEDetId.h.