CMS 3D CMS Logo

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

#include <HGCHEDetId.h>

Inheritance diagram for HGCHEDetId:
DetId

Public Member Functions

int cell () const
 get the absolute value of the cell #'s in x and y More...
 
HGCHEDetId geometryCell () const
 
 HGCHEDetId ()
 
 HGCHEDetId (const DetId &id)
 
 HGCHEDetId (ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
 
 HGCHEDetId (uint32_t rawid)
 
bool isForward () const
 
bool isHE () const
 consistency check More...
 
int layer () const
 get the layer # More...
 
HGCHEDetIdoperator= (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 kHGCHECellMask = 0xFFF
 
static const int kHGCHECellOffset = 0
 
static const int kHGCHELayerMask = 0x1F
 
static const int kHGCHELayerOffset = 19
 
static const int kHGCHESectorMask = 0x3F
 
static const int kHGCHESectorOffset = 12
 
static const int kHGCHESubSectorMask = 0x1
 
static const int kHGCHESubSectorOffset = 18
 
static const int kHGCHEZsideMask = 0x1
 
static const int kHGCHEZsideOffset = 24
 
static const HGCHEDetId 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

- 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
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 8 of file HGCHEDetId.h.

Constructor & Destructor Documentation

◆ HGCHEDetId() [1/4]

HGCHEDetId::HGCHEDetId ( )

Create a null cellid

Definition at line 7 of file HGCHEDetId.cc.

7 : DetId() {}

Referenced by geometryCell().

◆ HGCHEDetId() [2/4]

HGCHEDetId::HGCHEDetId ( uint32_t  rawid)

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

Definition at line 9 of file HGCHEDetId.cc.

9 : DetId(rawid) {}

◆ HGCHEDetId() [3/4]

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

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

Definition at line 11 of file HGCHEDetId.cc.

12  : DetId(Forward, subdet) {
15  if (subsec < 0)
16  subsec = 0;
18  id_ |= ((lay & kHGCHELayerMask) << kHGCHELayerOffset);
19  if (zp > 0)
20  id_ |= ((zp & kHGCHEZsideMask) << kHGCHEZsideOffset);
21 }

References cell(), DetId::id_, kHGCHECellMask, kHGCHECellOffset, kHGCHELayerMask, kHGCHELayerOffset, kHGCHESectorMask, kHGCHESectorOffset, kHGCHESubSectorMask, kHGCHESubSectorOffset, kHGCHEZsideMask, kHGCHEZsideOffset, and fileinputsource_cfi::sec.

◆ HGCHEDetId() [4/4]

HGCHEDetId::HGCHEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file HGCHEDetId.cc.

23  {
24  if (!gen.null()) {
26  if ((gen.det() != Forward) || (subdet != HGCHEF && subdet != HGCHEB)) {
27  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCHEDetId from " << std::hex << gen.rawId()
28  << std::dec << " Det|SubDet " << gen.det() << "|" << subdet;
29  }
30  }
31  id_ = gen.rawId();
32 }

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

Member Function Documentation

◆ cell()

int HGCHEDetId::cell ( ) const
inline

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

Definition at line 40 of file HGCHEDetId.h.

40 { return id_ & kHGCHECellMask; }

References DetId::id_, and kHGCHECellMask.

Referenced by HGCHEDetId().

◆ geometryCell()

HGCHEDetId HGCHEDetId::geometryCell ( ) const

Converter for a geometry cell id

Parameters
idfull EKDetId

Definition at line 46 of file HGCHEDetId.cc.

46  {
47  int sub = ((subdet() == HGCHEF) ? 0 : ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask));
48  return HGCHEDetId(subdet(), zside(), layer(), sector(), sub, 0);
49 }

References HGCHEDetId(), HGCHEF, DetId::id_, kHGCHESubSectorMask, kHGCHESubSectorOffset, layer(), sector(), subdet(), and zside().

◆ isForward()

bool HGCHEDetId::isForward ( ) const
inline

Definition at line 56 of file HGCHEDetId.h.

56 { return true; }

◆ isHE()

bool HGCHEDetId::isHE ( ) const
inline

consistency check

Definition at line 55 of file HGCHEDetId.h.

55 { return true; }

◆ layer()

int HGCHEDetId::layer ( ) const
inline

◆ operator=()

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

Assignment from a generic cell id

Definition at line 34 of file HGCHEDetId.cc.

34  {
35  if (!gen.null()) {
37  if ((gen.det() != Forward) || (subdet != HGCHEF && subdet != HGCHEB)) {
38  throw cms::Exception("Invalid DetId") << "Cannot assign HGCHEDetId from " << std::hex << gen.rawId() << std::dec
39  << " Det|SubDet " << gen.det() << "|" << subdet;
40  }
41  }
42  id_ = gen.rawId();
43  return (*this);
44 }

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

◆ sector()

int HGCHEDetId::sector ( ) const
inline

get the sector #

Definition at line 43 of file HGCHEDetId.h.

43 { return (id_ >> kHGCHESectorOffset) & kHGCHESectorMask; }

References DetId::id_, kHGCHESectorMask, and kHGCHESectorOffset.

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

◆ subdet()

ForwardSubdetector HGCHEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 37 of file HGCHEDetId.h.

37 { return (ForwardSubdetector)(subdetId()); }

References DetId::subdetId().

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

◆ subsector()

int HGCHEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 46 of file HGCHEDetId.h.

46 { return ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask ? 1 : -1); }

References DetId::id_, kHGCHESubSectorMask, and kHGCHESubSectorOffset.

◆ zside()

int HGCHEDetId::zside ( ) const
inline

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

Definition at line 52 of file HGCHEDetId.h.

52 { return ((id_ >> kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }

References DetId::id_, kHGCHEZsideMask, and kHGCHEZsideOffset.

Referenced by geometryCell().

Member Data Documentation

◆ kHGCHECellMask

const int HGCHEDetId::kHGCHECellMask = 0xFFF
static

Definition at line 11 of file HGCHEDetId.h.

Referenced by cell(), and HGCHEDetId().

◆ kHGCHECellOffset

const int HGCHEDetId::kHGCHECellOffset = 0
static

Definition at line 10 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

◆ kHGCHELayerMask

const int HGCHEDetId::kHGCHELayerMask = 0x1F
static

Definition at line 17 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and layer().

◆ kHGCHELayerOffset

const int HGCHEDetId::kHGCHELayerOffset = 19
static

Definition at line 16 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and layer().

◆ kHGCHESectorMask

const int HGCHEDetId::kHGCHESectorMask = 0x3F
static

Definition at line 13 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and sector().

◆ kHGCHESectorOffset

const int HGCHEDetId::kHGCHESectorOffset = 12
static

Definition at line 12 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and sector().

◆ kHGCHESubSectorMask

const int HGCHEDetId::kHGCHESubSectorMask = 0x1
static

Definition at line 15 of file HGCHEDetId.h.

Referenced by geometryCell(), HGCHEDetId(), and subsector().

◆ kHGCHESubSectorOffset

const int HGCHEDetId::kHGCHESubSectorOffset = 18
static

Definition at line 14 of file HGCHEDetId.h.

Referenced by geometryCell(), HGCHEDetId(), and subsector().

◆ kHGCHEZsideMask

const int HGCHEDetId::kHGCHEZsideMask = 0x1
static

Definition at line 19 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

◆ kHGCHEZsideOffset

const int HGCHEDetId::kHGCHEZsideOffset = 24
static

Definition at line 18 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

◆ Undefined

const HGCHEDetId HGCHEDetId::Undefined
static

Definition at line 58 of file HGCHEDetId.h.

HGCHEDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCHEDetId.h:40
HGCHEDetId::layer
int layer() const
get the layer #
Definition: HGCHEDetId.h:49
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCHEDetId::kHGCHESectorMask
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:13
HGCHEDetId::kHGCHEZsideOffset
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:18
HGCHEDetId::HGCHEDetId
HGCHEDetId()
Definition: HGCHEDetId.cc:7
HGCHEDetId::kHGCHEZsideMask
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:19
HGCHEDetId::sector
int sector() const
get the sector #
Definition: HGCHEDetId.h:43
HGCHEDetId::kHGCHECellMask
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11
HGCHEDetId::kHGCHESubSectorOffset
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
HGCHEDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:52
gen
Definition: PythiaDecays.h:13
HGCHEDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCHEDetId::kHGCHELayerOffset
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:16
HGCHEDetId::kHGCHECellOffset
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:10
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
HGCHEDetId::kHGCHESubSectorMask
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
Exception
Definition: hltDiff.cc:245
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HGCHEF
Definition: ForwardSubdetector.h:9
HGCHEDetId::kHGCHESectorOffset
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
DetId::Forward
Definition: DetId.h:30
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HGCHEB
Definition: ForwardSubdetector.h:10
HGCHEDetId::kHGCHELayerMask
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:17