CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Static Private Attributes
HGCScintillatorDetId Class Reference

#include <HGCScintillatorDetId.h>

Inheritance diagram for HGCScintillatorDetId:
DetId

Public Member Functions

HGCScintillatorDetId geometryCell () const
 
 HGCScintillatorDetId ()
 
 HGCScintillatorDetId (uint32_t rawid)
 
 HGCScintillatorDetId (int type, int layer, int ieta, int iphi)
 
 HGCScintillatorDetId (const DetId &id)
 
int ieta () const
 
int ietaAbs () const
 get the eta index More...
 
std::pair< int, int > ietaphi () const
 
int iphi () const
 get the phi index More...
 
bool isEE () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
bool isHE () const
 
int layer () const
 get the layer # More...
 
HGCScintillatorDetIdoperator= (const DetId &id)
 
ForwardSubdetector subdet () const
 get the subdetector More...
 
int type () const
 get the type 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 HGCScintillatorDetId Undefined
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Static Private Attributes

static const int kHGCalEtaMask = 0xFF
 
static const int kHGCalEtaOffset = 9
 
static const int kHGCalLayerMask = 0x1F
 
static const int kHGCalLayerOffset = 17
 
static const int kHGCalPhiMask = 0x1FF
 
static const int kHGCalPhiOffset = 0
 
static const int kHGCalTypeMask = 0x1
 
static const int kHGCalTypeOffset = 23
 
static const int kHGCalZsideMask = 0x1
 
static const int kHGCalZsideMask2 = 0x400000
 
static const int kHGCalZsideOffset = 22
 

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
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 18 of file HGCScintillatorDetId.h.

Constructor & Destructor Documentation

HGCScintillatorDetId::HGCScintillatorDetId ( )

Create a null cellid

Definition at line 8 of file HGCScintillatorDetId.cc.

Referenced by geometryCell().

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

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

Definition at line 11 of file HGCScintillatorDetId.cc.

11  : DetId(rawid) {
12 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:27
HGCScintillatorDetId::HGCScintillatorDetId ( int  type,
int  layer,
int  ieta,
int  iphi 
)

Constructor from subdetector, zplus, layer, module, cell numbers

Definition at line 14 of file HGCScintillatorDetId.cc.

References DetId::id_, kHGCalEtaOffset, kHGCalLayerMask, kHGCalLayerOffset, kHGCalPhiMask, kHGCalPhiOffset, kHGCalTypeMask, kHGCalTypeOffset, and kHGCalZsideMask2.

15  : DetId(HGCalHSc,HGCHEB) {
16 
21 }
type
Definition: HCALResponse.h:21
static const int kHGCalTypeOffset
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:27
static const int kHGCalZsideMask2
static const int kHGCalEtaOffset
static const int kHGCalLayerMask
uint32_t id_
Definition: DetId.h:56
static const int kHGCalPhiMask
int layer() const
get the layer #
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
static const int kHGCalPhiOffset
HGCScintillatorDetId::HGCScintillatorDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file HGCScintillatorDetId.cc.

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

23  {
24  if (!gen.null()) {
25  if ((gen.det()!=HGCalHSc) ||
26  (ForwardSubdetector)(gen.subdetId()!=HGCHEB)) {
27  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
28  }
29  }
30  id_ = gen.rawId();
31 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:56

Member Function Documentation

HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 34 of file HGCScintillatorDetId.h.

References HGCScintillatorDetId(), ieta(), layer(), and type().

34 {return HGCScintillatorDetId (type(), layer(), ieta(), 0);}
int type() const
get the type
int layer() const
get the layer #
int HGCScintillatorDetId::ieta ( ) const
inline

Definition at line 50 of file HGCScintillatorDetId.h.

References ietaAbs(), and zside().

Referenced by geometryCell(), and ietaphi().

50 { return zside()*ietaAbs(); }
int ietaAbs() const
get the eta index
int zside() const
get the z-side of the cell (1/-1)
int HGCScintillatorDetId::ietaAbs ( ) const
inline

get the eta index

Definition at line 49 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalEtaMask, and kHGCalEtaOffset.

Referenced by ieta().

49 { return (id_>>kHGCalEtaOffset)&kHGCalEtaMask; }
static const int kHGCalEtaOffset
static const int kHGCalEtaMask
uint32_t id_
Definition: DetId.h:56
std::pair<int,int> HGCScintillatorDetId::ietaphi ( ) const
inline

Definition at line 54 of file HGCScintillatorDetId.h.

References ieta(), and iphi().

54 { return std::pair<int,int>(ieta(),iphi()); }
int iphi() const
get the phi index
int HGCScintillatorDetId::iphi ( ) const
inline

get the phi index

Definition at line 53 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalPhiMask, and kHGCalPhiOffset.

Referenced by ietaphi().

53 { return (id_>>kHGCalPhiOffset)&kHGCalPhiMask; }
uint32_t id_
Definition: DetId.h:56
static const int kHGCalPhiMask
static const int kHGCalPhiOffset
bool HGCScintillatorDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 57 of file HGCScintillatorDetId.h.

57 { return false; }
bool HGCScintillatorDetId::isForward ( ) const
inline

Definition at line 59 of file HGCScintillatorDetId.h.

59 { return true; }
bool HGCScintillatorDetId::isHE ( ) const
inline

Definition at line 58 of file HGCScintillatorDetId.h.

58 { return true; }
int HGCScintillatorDetId::layer ( ) const
inline

get the layer #

Definition at line 46 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalLayerMask, and kHGCalLayerOffset.

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

static const int kHGCalLayerMask
uint32_t id_
Definition: DetId.h:56
static const int kHGCalLayerOffset
HGCScintillatorDetId & HGCScintillatorDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 33 of file HGCScintillatorDetId.cc.

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

33  {
34  if (!gen.null()) {
35  if ((gen.det()!=HGCalHSc) ||
36  (ForwardSubdetector)(gen.subdetId()!=HGCHEB)) {
37  throw cms::Exception("Invalid DetId") << "Cannot assign HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
38  }
39  }
40  id_ = gen.rawId();
41  return (*this);
42 }
ForwardSubdetector
uint32_t id_
Definition: DetId.h:56
ForwardSubdetector HGCScintillatorDetId::subdet ( ) const
inline

get the subdetector

Definition at line 37 of file HGCScintillatorDetId.h.

References HGCHEB.

37 { return HGCHEB; }
int HGCScintillatorDetId::type ( ) const
inline
int HGCScintillatorDetId::zside ( ) const
inline

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

Definition at line 43 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalZsideMask, and kHGCalZsideOffset.

Referenced by ieta().

43 { return (((id_>>kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }
uint32_t id_
Definition: DetId.h:56
static const int kHGCalZsideMask
static const int kHGCalZsideOffset

Member Data Documentation

const int HGCScintillatorDetId::kHGCalEtaMask = 0xFF
staticprivate

Definition at line 68 of file HGCScintillatorDetId.h.

Referenced by ietaAbs().

const int HGCScintillatorDetId::kHGCalEtaOffset = 9
staticprivate

Definition at line 67 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and ietaAbs().

const int HGCScintillatorDetId::kHGCalLayerMask = 0x1F
staticprivate

Definition at line 70 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
staticprivate

Definition at line 69 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalPhiMask = 0x1FF
staticprivate

Definition at line 66 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

const int HGCScintillatorDetId::kHGCalPhiOffset = 0
staticprivate

Definition at line 65 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

const int HGCScintillatorDetId::kHGCalTypeMask = 0x1
staticprivate

Definition at line 75 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalTypeOffset = 23
staticprivate

Definition at line 74 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
staticprivate

Definition at line 72 of file HGCScintillatorDetId.h.

Referenced by zside().

const int HGCScintillatorDetId::kHGCalZsideMask2 = 0x400000
staticprivate

Definition at line 73 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId().

const int HGCScintillatorDetId::kHGCalZsideOffset = 22
staticprivate

Definition at line 71 of file HGCScintillatorDetId.h.

Referenced by zside().

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 61 of file HGCScintillatorDetId.h.