CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public 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 iradius, int iphi)
 
 HGCScintillatorDetId (const DetId &id)
 
int ieta () const
 
int ietaAbs () const
 
std::pair< int, int > ietaphi () const
 
int iphi () const
 get the phi index More...
 
int iradius () const
 
int iradiusAbs () const
 get the eta index More...
 
std::pair< int, int > iradiusphi () const
 
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 int kHGCalLayerMask = 0x1F
 
static const int kHGCalLayerOffset = 17
 
static const int kHGCalPhiMask = 0x1FF
 
static const int kHGCalPhiOffset = 0
 
static const int kHGCalRadiusMask = 0xFF
 
static const int kHGCalRadiusOffset = 9
 
static const int kHGCalTypeMask = 0x3
 
static const int kHGCalTypeOffset = 26
 
static const int kHGCalZsideMask = 0x1
 
static const int kHGCalZsideOffset = 25
 
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
 

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  iradius,
int  iphi 
)

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

Definition at line 14 of file HGCScintillatorDetId.cc.

References funct::abs(), DetId::id_, kHGCalLayerMask, kHGCalLayerOffset, kHGCalPhiMask, kHGCalPhiOffset, kHGCalRadiusMask, kHGCalRadiusOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalZsideMask, kHGCalZsideOffset, and zside().

16 
17  int zside = (radius < 0) ? 1 : 0;
18  int radiusAbs = std::abs(radius);
22  ((radiusAbs&kHGCalRadiusMask)<<kHGCalRadiusOffset) |
24 }
type
Definition: HCALResponse.h:21
static const int kHGCalTypeOffset
static const int kHGCalLayerMask
static const int kHGCalRadiusOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalRadiusMask
uint32_t id_
Definition: DetId.h:62
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:62

Member Function Documentation

HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 35 of file HGCScintillatorDetId.h.

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

Referenced by HGCalGeometry::getGeometryDetId().

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

Definition at line 53 of file HGCScintillatorDetId.h.

References ietaAbs(), and zside().

Referenced by ietaphi().

53 { return zside()*ietaAbs(); }
int zside() const
get the z-side of the cell (1/-1)
int HGCScintillatorDetId::ietaAbs ( ) const
inline
std::pair<int,int> HGCScintillatorDetId::ietaphi ( ) const
inline

Definition at line 57 of file HGCScintillatorDetId.h.

References ieta(), and iphi().

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

Definition at line 51 of file HGCScintillatorDetId.h.

References iradiusAbs(), and zside().

Referenced by geometryCell(), and iradiusphi().

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

get the eta index

Definition at line 50 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalRadiusMask, and kHGCalRadiusOffset.

Referenced by iradius().

static const int kHGCalRadiusOffset
static const int kHGCalRadiusMask
uint32_t id_
Definition: DetId.h:62
std::pair<int,int> HGCScintillatorDetId::iradiusphi ( ) const
inline

Definition at line 58 of file HGCScintillatorDetId.h.

References iphi(), and iradius().

58 { return std::pair<int,int>(iradius(),iphi()); }
int iphi() const
get the phi index
bool HGCScintillatorDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 61 of file HGCScintillatorDetId.h.

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

Definition at line 63 of file HGCScintillatorDetId.h.

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

Definition at line 62 of file HGCScintillatorDetId.h.

62 { 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:62
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(), HGCalTriggerGeometryV9Imp1::getTriggerCellFromCell(), HGCScintillatorDetId(), ieta(), iradius(), and hgcal::RecHitTools::zside().

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

Member Data Documentation

const int HGCScintillatorDetId::kHGCalLayerMask = 0x1F
static

Definition at line 74 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
static

Definition at line 73 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalPhiMask = 0x1FF
static
const int HGCScintillatorDetId::kHGCalPhiOffset = 0
static
const int HGCScintillatorDetId::kHGCalRadiusMask = 0xFF
static
const int HGCScintillatorDetId::kHGCalRadiusOffset = 9
static
const int HGCScintillatorDetId::kHGCalTypeMask = 0x3
static

Definition at line 78 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalTypeOffset = 26
static

Definition at line 77 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
static

Definition at line 76 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const int HGCScintillatorDetId::kHGCalZsideOffset = 25
static

Definition at line 75 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 65 of file HGCScintillatorDetId.h.