test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
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 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 kDetOffset = 28
 
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
}
 
- 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 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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:55
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
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, HGCHET, 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 && subdet!=HGCHET)) {
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
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t id_
Definition: DetId.h:55
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:55
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().

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

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:55
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
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, HGCHET, 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 && subdet!=HGCHET)) {
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
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t id_
Definition: DetId.h:55
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_, kHGCHESectorMask, and kHGCHESectorOffset.

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

static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:13
uint32_t id_
Definition: DetId.h:55
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(), and operator=().

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

get the degree subsector

Definition at line 47 of file HGCHEDetId.h.

References DetId::id_, kHGCHESubSectorMask, and kHGCHESubSectorOffset.

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:55
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_, kHGCHEZsideMask, and kHGCHEZsideOffset.

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

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(), and layer().

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(), and sector().

const int HGCHEDetId::kHGCHESubSectorMask = 0x1
static

Definition at line 16 of file HGCHEDetId.h.

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

const int HGCHEDetId::kHGCHESubSectorOffset = 18
static

Definition at line 15 of file HGCHEDetId.h.

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

const int HGCHEDetId::kHGCHEZsideMask = 0x1
static

Definition at line 20 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

const int HGCHEDetId::kHGCHEZsideOffset = 24
static

Definition at line 19 of file HGCHEDetId.h.

Referenced by HGCHEDetId(), and zside().

const HGCHEDetId HGCHEDetId::Undefined
static

Definition at line 59 of file HGCHEDetId.h.