CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
}
 

Public Member Functions

int cell () const
 get the absolute value of the cell #'s in x and y More...
 
HGCEEDetId geometryCell () const
 
 HGCEEDetId ()
 
 HGCEEDetId (uint32_t rawid)
 
 HGCEEDetId (ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
 
 HGCEEDetId (const DetId &id)
 
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
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
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 kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 9 of file HGCEEDetId.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Subdet 

Definition at line 21 of file HGCEEDetId.h.

Constructor & Destructor Documentation

HGCEEDetId::HGCEEDetId ( )

Create a null cellid

Definition at line 8 of file HGCEEDetId.cc.

Referenced by geometryCell().

8  : DetId() {
9 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
HGCEEDetId::HGCEEDetId ( uint32_t  rawid)

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

Definition at line 11 of file HGCEEDetId.cc.

11  : DetId(rawid) {
12 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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 14 of file HGCEEDetId.cc.

References DetId::id_, kHGCEECellMask, kHGCEECellOffset, kHGCEELayerMask, kHGCEELayerOffset, kHGCEESectorMask, kHGCEESectorOffset, kHGCEESubSectorMask, kHGCEESubSectorOffset, kHGCEEZsideMask, and kHGCEEZsideOffset.

14  : DetId(Forward,subdet) {
15 
17  id_ |= ((sec & kHGCEESectorMask) << kHGCEESectorOffset);
18  if (subsec<0) subsec=0;
20  id_ |= ((lay & kHGCEELayerMask) << kHGCEELayerOffset);
21  if (zp>0) id_ |= ((zp & kHGCEEZsideMask) << kHGCEEZsideOffset);
22 }
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:18
static const int kHGCEECellMask
Definition: HGCEEDetId.h:12
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:37
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCEEDetId.h:40
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:17
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:20
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:14
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:19
uint32_t id_
Definition: DetId.h:55
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:15
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:16
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:13
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:11
HGCEEDetId::HGCEEDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 24 of file HGCEEDetId.cc.

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

24  {
25  if (!gen.null()) {
27  if (gen.det()!=Forward || (subdet!=HGCEE)) {
28  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCEEDetId from " << std::hex << gen.rawId() << std::dec;
29  }
30  }
31  id_ = gen.rawId();
32 }
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:37
ForwardSubdetector
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

int HGCEEDetId::cell ( ) const
inline

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

Definition at line 40 of file HGCEEDetId.h.

References DetId::id_, and kHGCEECellMask.

40 { return id_&kHGCEECellMask; }
static const int kHGCEECellMask
Definition: HGCEEDetId.h:12
uint32_t id_
Definition: DetId.h:55
HGCEEDetId HGCEEDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 34 of file HGCEEDetId.h.

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

Referenced by HGCalGeometry::getGeometry(), HGCalGeometry::indexFor(), and HGCalGeometry::newCell().

34 {return HGCEEDetId (subdet(), zside(), layer(), sector(), 0, 0);}
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:37
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:52
int layer() const
get the layer #
Definition: HGCEEDetId.h:49
int sector() const
get the sector #
Definition: HGCEEDetId.h:43
bool HGCEEDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 55 of file HGCEEDetId.h.

55 { return true; }
bool HGCEEDetId::isForward ( ) const
inline

Definition at line 56 of file HGCEEDetId.h.

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

get the layer #

Definition at line 49 of file HGCEEDetId.h.

References DetId::id_, kHGCEELayerMask, and kHGCEELayerOffset.

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

static const int kHGCEELayerMask
Definition: HGCEEDetId.h:18
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:17
uint32_t id_
Definition: DetId.h:55
HGCEEDetId & HGCEEDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 34 of file HGCEEDetId.cc.

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

34  {
35  if (!gen.null()) {
37  if (gen.det()!=Forward || (subdet!=HGCEE)) {
38  throw cms::Exception("Invalid DetId") << "Cannot assign HGCEEDetId from " << std::hex << gen.rawId() << std::dec;
39  }
40  }
41  id_ = gen.rawId();
42  return (*this);
43 }
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:37
ForwardSubdetector
uint32_t id_
Definition: DetId.h:55
int HGCEEDetId::sector ( ) const
inline

get the sector #

Definition at line 43 of file HGCEEDetId.h.

References DetId::id_, kHGCEESectorMask, and kHGCEESectorOffset.

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

static const int kHGCEESectorMask
Definition: HGCEEDetId.h:14
uint32_t id_
Definition: DetId.h:55
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:13
ForwardSubdetector HGCEEDetId::subdet ( ) const
inline

get the subdetector

Definition at line 37 of file HGCEEDetId.h.

References HGCEE.

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

37 { return HGCEE; }
int HGCEEDetId::subsector ( ) const
inline

get the degree subsector

Definition at line 46 of file HGCEEDetId.h.

References DetId::id_, kHGCEESubSectorMask, and kHGCEESubSectorOffset.

46 { return ( (id_>>kHGCEESubSectorOffset)&kHGCEESubSectorMask ? 1 : -1); }
uint32_t id_
Definition: DetId.h:55
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:15
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:16
int HGCEEDetId::zside ( ) const
inline

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

Definition at line 52 of file HGCEEDetId.h.

References DetId::id_, kHGCEEZsideMask, and kHGCEEZsideOffset.

Referenced by geometryCell().

52 { return ((id_>>kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:20
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:19
uint32_t id_
Definition: DetId.h:55

Member Data Documentation

const int HGCEEDetId::kHGCEECellMask = 0xFFF
static

Definition at line 12 of file HGCEEDetId.h.

Referenced by cell(), and HGCEEDetId().

const int HGCEEDetId::kHGCEECellOffset = 0
static

Definition at line 11 of file HGCEEDetId.h.

Referenced by HGCEEDetId().

const int HGCEEDetId::kHGCEELayerMask = 0x1F
static

Definition at line 18 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and layer().

const int HGCEEDetId::kHGCEELayerOffset = 19
static

Definition at line 17 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and layer().

const int HGCEEDetId::kHGCEESectorMask = 0x3F
static

Definition at line 14 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and sector().

const int HGCEEDetId::kHGCEESectorOffset = 12
static

Definition at line 13 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and sector().

const int HGCEEDetId::kHGCEESubSectorMask = 0x1
static

Definition at line 16 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and subsector().

const int HGCEEDetId::kHGCEESubSectorOffset = 18
static

Definition at line 15 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and subsector().

const int HGCEEDetId::kHGCEEZsideMask = 0x1
static

Definition at line 20 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and zside().

const int HGCEEDetId::kHGCEEZsideOffset = 24
static

Definition at line 19 of file HGCEEDetId.h.

Referenced by HGCEEDetId(), and zside().

const HGCEEDetId HGCEEDetId::Undefined
static

Definition at line 58 of file HGCEEDetId.h.