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 9 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() {
8 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HGCHEDetId::HGCHEDetId ( uint32_t  rawid)

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

Definition at line 10 of file HGCHEDetId.cc.

10  : DetId(rawid) {
11 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
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 13 of file HGCHEDetId.cc.

References DetId::id_, kHGCHECellMask, kHGCHECellOffset, kHGCHELayerMask, kHGCHELayerOffset, kHGCHESectorMask, kHGCHESectorOffset, kHGCHESubSectorMask, kHGCHESubSectorOffset, kHGCHEZsideMask, and kHGCHEZsideOffset.

13  : DetId(Forward,subdet) {
14 
16  id_ |= ((sec & kHGCHESectorMask) << kHGCHESectorOffset);
17  if (subsec<0) subsec=0;
19  id_ |= ((lay & kHGCHELayerMask) << kHGCHELayerOffset);
20  if(zp>0) id_ |= ((zp & kHGCHEZsideMask) << kHGCHEZsideOffset);
21 }
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:15
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:17
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:16
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:41
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:13
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:11
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:18
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:19
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:20
uint32_t id_
Definition: DetId.h:62
static const int kHGCHECellMask
Definition: HGCHEDetId.h:12
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:14
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:38
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
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) ||
27  (subdet!=HGCHEF && subdet!=HGCHEB)) {
28  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCHEDetId from " << std::hex << gen.rawId() << std::dec << " Det|SubDet " << gen.det() << "|" << subdet;
29  }
30  }
31  id_ = gen.rawId();
32 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:62
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:38

Member Function Documentation

int HGCHEDetId::cell ( ) const
inline

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

Definition at line 41 of file HGCHEDetId.h.

References DetId::id_, and kHGCHECellMask.

41 { return id_&kHGCHECellMask; }
uint32_t id_
Definition: DetId.h:62
static const int kHGCHECellMask
Definition: HGCHEDetId.h:12
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:15
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:16
int layer() const
get the layer #
Definition: HGCHEDetId.h:50
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:53
uint32_t id_
Definition: DetId.h:62
int sector() const
get the sector #
Definition: HGCHEDetId.h:44
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:38
bool HGCHEDetId::isForward ( ) const
inline

Definition at line 57 of file HGCHEDetId.h.

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

consistency check

Definition at line 56 of file HGCHEDetId.h.

56 { return true; }
int HGCHEDetId::layer ( ) const
inline

get the layer #

Definition at line 50 of file HGCHEDetId.h.

References DetId::id_, and kHGCHELayerMask.

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

static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:17
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:18
uint32_t id_
Definition: DetId.h:62
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) ||
38  (subdet!=HGCHEF && subdet!=HGCHEB)) {
39  throw cms::Exception("Invalid DetId") << "Cannot assign HGCHEDetId from " << std::hex << gen.rawId() << std::dec << " Det|SubDet " << gen.det() << "|" << subdet;
40  }
41  }
42  id_ = gen.rawId();
43  return (*this);
44 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:62
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:38
int HGCHEDetId::sector ( ) const
inline

get the sector #

Definition at line 44 of file HGCHEDetId.h.

References DetId::id_, and kHGCHESectorMask.

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

static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:13
uint32_t id_
Definition: DetId.h:62
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:14
ForwardSubdetector HGCHEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 38 of file HGCHEDetId.h.

References DetId::subdetId().

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

38 { 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:41
int HGCHEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 47 of file HGCHEDetId.h.

References DetId::id_.

47 { return ( (id_>>kHGCHESubSectorOffset)&kHGCHESubSectorMask ? 1 : -1); }
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:15
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:16
uint32_t id_
Definition: DetId.h:62
int HGCHEDetId::zside ( ) const
inline

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

Definition at line 53 of file HGCHEDetId.h.

References DetId::id_.

Referenced by geometryCell().

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

Member Data Documentation

const int HGCHEDetId::kHGCHECellMask = 0xFFF
static

Definition at line 12 of file HGCHEDetId.h.

Referenced by cell(), and HGCHEDetId().

const int HGCHEDetId::kHGCHECellOffset = 0
static

Definition at line 11 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const int HGCHEDetId::kHGCHELayerMask = 0x1F
static

Definition at line 18 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and layer().

const int HGCHEDetId::kHGCHELayerOffset = 19
static

Definition at line 17 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const int HGCHEDetId::kHGCHESectorMask = 0x3F
static

Definition at line 14 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and sector().

const int HGCHEDetId::kHGCHESectorOffset = 12
static

Definition at line 13 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const int HGCHEDetId::kHGCHESubSectorMask = 0x1
static

Definition at line 16 of file HGCHEDetId.h.

Referenced by geometryCell(), and HGCHEDetId().

const int HGCHEDetId::kHGCHESubSectorOffset = 18
static

Definition at line 15 of file HGCHEDetId.h.

Referenced by geometryCell(), and HGCHEDetId().

const int HGCHEDetId::kHGCHEZsideMask = 0x1
static

Definition at line 20 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const int HGCHEDetId::kHGCHEZsideOffset = 24
static

Definition at line 19 of file HGCHEDetId.h.

Referenced by HGCHEDetId().

const HGCHEDetId HGCHEDetId::Undefined
static

Definition at line 59 of file HGCHEDetId.h.