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 (const DetId &id)
 
 HGCEEDetId (ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
 
 HGCEEDetId (uint32_t rawid)
 
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 (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. 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.

20 { Subdet = HGCEE };

Constructor & Destructor Documentation

◆ HGCEEDetId() [1/4]

HGCEEDetId::HGCEEDetId ( )

Create a null cellid

Definition at line 8 of file HGCEEDetId.cc.

8 : DetId() {}

Referenced by geometryCell().

◆ 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) {}

◆ 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.

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 }

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

◆ HGCEEDetId() [4/4]

HGCEEDetId::HGCEEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 24 of file HGCEEDetId.cc.

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 }

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

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.

39 { return id_ & kHGCEECellMask; }

References DetId::id_, and kHGCEECellMask.

Referenced by HGCEEDetId().

◆ geometryCell()

HGCEEDetId HGCEEDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 33 of file HGCEEDetId.h.

33 { return HGCEEDetId(subdet(), zside(), layer(), sector(), 0, 0); }

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

◆ 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

◆ operator=()

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

Assignment from a generic cell id

Definition at line 35 of file HGCEEDetId.cc.

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 }

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

◆ sector()

int HGCEEDetId::sector ( ) const
inline

get the sector #

Definition at line 42 of file HGCEEDetId.h.

42 { return (id_ >> kHGCEESectorOffset) & kHGCEESectorMask; }

References DetId::id_, kHGCEESectorMask, and kHGCEESectorOffset.

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

◆ subdet()

ForwardSubdetector HGCEEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 36 of file HGCEEDetId.h.

36 { return HGCEE; }

References HGCEE.

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

◆ subsector()

int HGCEEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 45 of file HGCEEDetId.h.

45 { return ((id_ >> kHGCEESubSectorOffset) & kHGCEESubSectorMask ? 1 : -1); }

References DetId::id_, kHGCEESubSectorMask, and kHGCEESubSectorOffset.

◆ zside()

int HGCEEDetId::zside ( ) const
inline

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

Definition at line 51 of file HGCEEDetId.h.

51 { return ((id_ >> kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }

References DetId::id_, kHGCEEZsideMask, and kHGCEEZsideOffset.

Referenced by geometryCell().

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.

HGCEEDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:51
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCEEDetId::kHGCEESubSectorMask
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:15
HGCEEDetId::kHGCEEZsideOffset
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:18
HGCEEDetId::kHGCEESubSectorOffset
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:14
HGCEEDetId::kHGCEECellOffset
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:10
HGCEEDetId::layer
int layer() const
get the layer #
Definition: HGCEEDetId.h:48
HGCEEDetId::kHGCEELayerMask
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:17
gen
Definition: PythiaDecays.h:13
HGCEEDetId::kHGCEESectorOffset
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:12
HGCEE
Definition: ForwardSubdetector.h:8
HGCEEDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCEEDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCEEDetId.h:39
HGCEEDetId::kHGCEELayerOffset
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:16
HGCEEDetId::kHGCEEZsideMask
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:19
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
HGCEEDetId::kHGCEECellMask
static const int kHGCEECellMask
Definition: HGCEEDetId.h:11
HGCEEDetId::sector
int sector() const
get the sector #
Definition: HGCEEDetId.h:42
Exception
Definition: hltDiff.cc:245
HGCEEDetId::Subdet
Definition: HGCEEDetId.h:20
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HGCEEDetId::HGCEEDetId
HGCEEDetId()
Definition: HGCEEDetId.cc:8
DetId::Forward
Definition: DetId.h:30
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HGCEEDetId::kHGCEESectorMask
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:13