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 (uint32_t rawid)
 
 HGCHEDetId (ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
 
 HGCHEDetId (const DetId &id)
 
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 (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 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.

Referenced by geometryCell().

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

◆ 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) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

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

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

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 }
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:16
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:10
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:40
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:17
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:18
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:19
uint32_t id_
Definition: DetId.h:69
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:13
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCHEDetId() [4/4]

HGCHEDetId::HGCHEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file HGCHEDetId.cc.

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

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 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37

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.

References DetId::id_, and kHGCHECellMask.

Referenced by HGCHEDetId().

40 { return id_ & kHGCHECellMask; }
uint32_t id_
Definition: DetId.h:69
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11

◆ geometryCell()

HGCHEDetId HGCHEDetId::geometryCell ( ) const

Converter for a geometry cell id

Parameters
idfull EKDetId

Definition at line 46 of file HGCHEDetId.cc.

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

46  {
47  int sub = ((subdet() == HGCHEF) ? 0 : ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask));
48  return HGCHEDetId(subdet(), zside(), layer(), sector(), sub, 0);
49 }
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
int layer() const
get the layer #
Definition: HGCHEDetId.h:49
uint32_t id_
Definition: DetId.h:69
int sector() const
get the sector #
Definition: HGCHEDetId.h:43
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:52
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37

◆ 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

get the layer #

Definition at line 49 of file HGCHEDetId.h.

References DetId::id_, kHGCHELayerMask, and kHGCHELayerOffset.

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

49 { return (id_ >> kHGCHELayerOffset) & kHGCHELayerMask; }
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:16
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:17
uint32_t id_
Definition: DetId.h:69

◆ operator=()

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

Assignment from a generic cell id

Definition at line 34 of file HGCHEDetId.cc.

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

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 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37

◆ sector()

int HGCHEDetId::sector ( ) const
inline

get the sector #

Definition at line 43 of file HGCHEDetId.h.

References DetId::id_, kHGCHESectorMask, and kHGCHESectorOffset.

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

43 { return (id_ >> kHGCHESectorOffset) & kHGCHESectorMask; }
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
uint32_t id_
Definition: DetId.h:69
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:13

◆ subdet()

ForwardSubdetector HGCHEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 37 of file HGCHEDetId.h.

References DetId::subdetId().

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

37 { return (ForwardSubdetector)(subdetId()); }
ForwardSubdetector
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ subsector()

int HGCHEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 46 of file HGCHEDetId.h.

References DetId::id_, kHGCHESubSectorMask, and kHGCHESubSectorOffset.

46 { return ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask ? 1 : -1); }
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
uint32_t id_
Definition: DetId.h:69

◆ zside()

int HGCHEDetId::zside ( ) const
inline

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

Definition at line 52 of file HGCHEDetId.h.

References DetId::id_, kHGCHEZsideMask, and kHGCHEZsideOffset.

Referenced by geometryCell().

52 { return ((id_ >> kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:18
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:19
uint32_t id_
Definition: DetId.h:69

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.