CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::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::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::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 DetId::id_, kHGCHECellMask, kHGCHECellOffset, kHGCHELayerMask, kHGCHELayerOffset, kHGCHESectorMask, kHGCHESectorOffset, kHGCHESubSectorMask, kHGCHESubSectorOffset, kHGCHEZsideMask, and kHGCHEZsideOffset.

12  : DetId(Forward, subdet) {
14  id_ |= ((sec & kHGCHESectorMask) << kHGCHESectorOffset);
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
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:40
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:10
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::HGCHEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file HGCHEDetId.cc.

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

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

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.

40 { return id_ & kHGCHECellMask; }
uint32_t id_
Definition: DetId.h:69
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11
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
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:52
uint32_t id_
Definition: DetId.h:69
int sector() const
get the sector #
Definition: HGCHEDetId.h:43
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37
bool HGCHEDetId::isForward ( ) const
inline

Definition at line 56 of file HGCHEDetId.h.

56 { return true; }
bool HGCHEDetId::isHE ( ) const
inline

consistency check

Definition at line 55 of file HGCHEDetId.h.

55 { return true; }
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
HGCHEDetId & HGCHEDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 34 of file HGCHEDetId.cc.

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

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

const int HGCHEDetId::kHGCHECellMask = 0xFFF
static

Definition at line 11 of file HGCHEDetId.h.

Referenced by cell(), and HGCHEDetId().

const int HGCHEDetId::kHGCHECellOffset = 0
static

Definition at line 10 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const int HGCHEDetId::kHGCHELayerMask = 0x1F
static

Definition at line 17 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and layer().

const int HGCHEDetId::kHGCHELayerOffset = 19
static

Definition at line 16 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and layer().

const int HGCHEDetId::kHGCHESectorMask = 0x3F
static

Definition at line 13 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and sector().

const int HGCHEDetId::kHGCHESectorOffset = 12
static

Definition at line 12 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and sector().

const int HGCHEDetId::kHGCHESubSectorMask = 0x1
static

Definition at line 15 of file HGCHEDetId.h.

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

const int HGCHEDetId::kHGCHESubSectorOffset = 18
static

Definition at line 14 of file HGCHEDetId.h.

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

const int HGCHEDetId::kHGCHEZsideMask = 0x1
static

Definition at line 19 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

const int HGCHEDetId::kHGCHEZsideOffset = 24
static

Definition at line 18 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

const HGCHEDetId HGCHEDetId::Undefined
static

Definition at line 58 of file HGCHEDetId.h.