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)
 
DetId::Detector 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
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 HGCScintillatorDetId 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
 

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 = 0x3
 
static const int kHGCalTypeOffset = 26
 
static const int kHGCalZsideMask = 0x1
 
static const int kHGCalZsideOffset = 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 19 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 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
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 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
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 funct::abs(), DetId::id_, kHGCalEtaMask, kHGCalEtaOffset, kHGCalLayerMask, kHGCalLayerOffset, kHGCalPhiMask, kHGCalPhiOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalZsideMask, kHGCalZsideOffset, and zside().

16 
17  int zside = (eta < 0) ? 1 : 0;
18  int etaAbs = std::abs(eta);
22  ((etaAbs&kHGCalEtaMask)<<kHGCalEtaOffset) |
24 }
type
Definition: HCALResponse.h:21
static const int kHGCalTypeOffset
static const int kHGCalEtaOffset
static const int kHGCalLayerMask
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalEtaMask
uint32_t id_
Definition: DetId.h:59
static const int kHGCalPhiMask
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
static const int kHGCalZsideMask
static const int kHGCalZsideOffset
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
static const int kHGCalPhiOffset
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HGCScintillatorDetId::HGCScintillatorDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 26 of file HGCScintillatorDetId.cc.

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

26  {
27  if (!gen.null()) {
28  if (gen.det()!=HGCalHSc) {
29  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
30  }
31  }
32  id_ = gen.rawId();
33 }
uint32_t id_
Definition: DetId.h:59

Member Function Documentation

HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 35 of file HGCScintillatorDetId.h.

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

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

35 {return HGCScintillatorDetId (0, layer(), ieta(), iphi());}
int iphi() const
get the phi index
int layer() const
get the layer #
int HGCScintillatorDetId::ieta ( ) const
inline

Definition at line 51 of file HGCScintillatorDetId.h.

References ietaAbs(), and zside().

Referenced by geometryCell(), and ietaphi().

51 { 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 50 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalEtaMask, and kHGCalEtaOffset.

Referenced by HGCalSimHitValidation::analyzeHits(), and ieta().

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

Definition at line 55 of file HGCScintillatorDetId.h.

References ieta(), and iphi().

55 { 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 54 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalPhiMask, and kHGCalPhiOffset.

Referenced by HGCalSimHitValidation::analyzeHits(), geometryCell(), and ietaphi().

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

consistency check : no bits left => no overhead

Definition at line 58 of file HGCScintillatorDetId.h.

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

Definition at line 60 of file HGCScintillatorDetId.h.

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

Definition at line 59 of file HGCScintillatorDetId.h.

59 { return true; }
int HGCScintillatorDetId::layer ( ) const
inline
HGCScintillatorDetId & HGCScintillatorDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 35 of file HGCScintillatorDetId.cc.

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

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

get the subdetector

Definition at line 38 of file HGCScintillatorDetId.h.

References DetId::det().

38 { return det(); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
int HGCScintillatorDetId::type ( ) const
inline
int HGCScintillatorDetId::zside ( ) const
inline

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

Definition at line 44 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalZsideMask, and kHGCalZsideOffset.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCScintillatorDetId(), ieta(), and hgcal::RecHitTools::zside().

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

Member Data Documentation

const int HGCScintillatorDetId::kHGCalEtaMask = 0xFF
staticprivate

Definition at line 69 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and ietaAbs().

const int HGCScintillatorDetId::kHGCalEtaOffset = 9
staticprivate

Definition at line 68 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and ietaAbs().

const int HGCScintillatorDetId::kHGCalLayerMask = 0x1F
staticprivate

Definition at line 71 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
staticprivate

Definition at line 70 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalPhiMask = 0x1FF
staticprivate

Definition at line 67 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

const int HGCScintillatorDetId::kHGCalPhiOffset = 0
staticprivate

Definition at line 66 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

const int HGCScintillatorDetId::kHGCalTypeMask = 0x3
staticprivate

Definition at line 75 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalTypeOffset = 26
staticprivate

Definition at line 74 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
staticprivate

Definition at line 73 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const int HGCScintillatorDetId::kHGCalZsideOffset = 25
staticprivate

Definition at line 72 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 62 of file HGCScintillatorDetId.h.