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

std::vector< HGCScintillatorDetIddetectorCells () const
 trigger or detector cell More...
 
HGCScintillatorDetId geometryCell () const
 
 HGCScintillatorDetId ()
 
 HGCScintillatorDetId (uint32_t rawid)
 
 HGCScintillatorDetId (int type, int layer, int iradius, int iphi, bool trigger=false)
 
 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 iphiTrigger () const
 
int iradius () const
 
int iradiusAbs () const
 get the eta index More...
 
std::pair< int, int > iradiusphi () const
 
int iradiusTrigger () const
 
int iradiusTriggerAbs () 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...
 
bool trigger () const
 
HGCScintillatorDetId triggerCell () const
 
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 kHGCalTriggerMask = 0x1
 
static const int kHGCalTriggerOffset = 22
 
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 21 of file HGCScintillatorDetId.h.

Constructor & Destructor Documentation

HGCScintillatorDetId::HGCScintillatorDetId ( )

Create a null cellid

Definition at line 8 of file HGCScintillatorDetId.cc.

Referenced by detectorCells(), geometryCell(), and triggerCell().

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,
bool  trigger = false 
)

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, kHGCalTriggerMask, kHGCalTriggerOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalZsideMask, kHGCalZsideOffset, and zside().

16 
17  int zside = (radius < 0) ? 1 : 0;
18  int itrig = trigger ? 1 : 0;
19  int radiusAbs = std::abs(radius);
24  ((radiusAbs&kHGCalRadiusMask)<<kHGCalRadiusOffset) |
26 }
type
Definition: HCALResponse.h:21
static const int kHGCalTriggerOffset
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 kHGCalTriggerMask
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 28 of file HGCScintillatorDetId.cc.

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

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

Member Function Documentation

std::vector< HGCScintillatorDetId > HGCScintillatorDetId::detectorCells ( ) const

trigger or detector cell

Definition at line 67 of file HGCScintillatorDetId.cc.

References postprocess-scan-build::cells, HGCScintillatorDetId(), iphi(), iradiusAbs(), layer(), trigger(), type(), and zside().

Referenced by iradiusphi().

67  {
68 
69  std::vector<HGCScintillatorDetId> cells;
70  int irad = iradiusAbs();
71  int ifi = iphi();
72  int iz = zside();
73  if (trigger()) {
74  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2*irad-1)*iz,
75  2*ifi-1, false));
76  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2*irad*iz,
77  2*ifi-1, false));
78  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2*irad-1)*iz,
79  2*ifi, false));
80  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2*irad*iz,
81  2*ifi, false));
82  } else {
83  cells.emplace_back(HGCScintillatorDetId(type(), layer(), irad*iz, ifi,
84  false));
85 
86  }
87  return cells;
88 }
int iradiusAbs() const
get the eta index
int type() const
get the type
int iphi() const
get the phi index
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const

Converter for a geometry cell id

Definition at line 90 of file HGCScintillatorDetId.cc.

References HGCScintillatorDetId(), iphi(), iphiTrigger(), iradius(), iradiusTrigger(), layer(), trigger(), and type().

Referenced by HGCalGeometry::getGeometryDetId().

90  {
91 
92  if (trigger()) {
94  iphiTrigger(), false);
95  } else {
96  return HGCScintillatorDetId (type(), layer(), iradius(), iphi(), false);
97  }
98 }
int type() const
get the type
int iphi() const
get the phi index
int layer() const
get the layer #
int HGCScintillatorDetId::ieta ( ) const
inline

Definition at line 56 of file HGCScintillatorDetId.h.

References ietaAbs(), iphi(), and zside().

Referenced by ietaphi().

56 { 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 60 of file HGCScintillatorDetId.h.

References ieta(), and iphi().

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

Definition at line 62 of file HGCScintillatorDetId.cc.

References iphi(), and trigger().

Referenced by geometryCell(), iradiusTrigger(), and triggerCell().

62  {
63  if (trigger()) return ((iphi()+1)/2);
64  else return iphi();
65 }
int iphi() const
get the phi index
int HGCScintillatorDetId::iradius ( ) const
inline

Definition at line 54 of file HGCScintillatorDetId.h.

References iradiusAbs(), and zside().

Referenced by geometryCell(), iradiusphi(), and triggerCell().

54 { 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

get the eta index

Definition at line 47 of file HGCScintillatorDetId.cc.

References DetId::id_, kHGCalRadiusMask, kHGCalRadiusOffset, and trigger().

Referenced by detectorCells(), ietaAbs(), iradius(), iradiusTriggerAbs(), and layer().

47  {
48  if (trigger()) return (2*((id_>>kHGCalRadiusOffset)&kHGCalRadiusMask));
49  else return ((id_>>kHGCalRadiusOffset)&kHGCalRadiusMask);
50 }
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 61 of file HGCScintillatorDetId.h.

References detectorCells(), iphi(), and iradius().

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

Definition at line 93 of file HGCScintillatorDetId.h.

References iphiTrigger(), iradiusTriggerAbs(), operator<<(), and zside().

Referenced by geometryCell(), and triggerCell().

93 { return zside()*iradiusTriggerAbs(); }
int zside() const
get the z-side of the cell (1/-1)
int HGCScintillatorDetId::iradiusTriggerAbs ( ) const

Definition at line 52 of file HGCScintillatorDetId.cc.

References iradiusAbs(), and trigger().

Referenced by iradiusTrigger().

52  {
53  if (trigger()) return ((iradiusAbs()+1)/2);
54  else return iradiusAbs();
55 }
int iradiusAbs() const
get the eta index
bool HGCScintillatorDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 71 of file HGCScintillatorDetId.h.

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

Definition at line 73 of file HGCScintillatorDetId.h.

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

Definition at line 72 of file HGCScintillatorDetId.h.

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

Assignment from a generic cell id

Definition at line 37 of file HGCScintillatorDetId.cc.

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

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

get the subdetector

Definition at line 41 of file HGCScintillatorDetId.h.

References DetId::det().

41 { return det(); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
bool HGCScintillatorDetId::trigger ( ) const
inline

Definition at line 65 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalTriggerMask, kHGCalTriggerOffset, and triggerCell().

Referenced by detectorCells(), geometryCell(), iphi(), iphiTrigger(), iradiusAbs(), iradiusTriggerAbs(), and triggerCell().

65  {
66  return (((id_>>kHGCalTriggerOffset)&kHGCalTriggerMask) == 1);
67  }
static const int kHGCalTriggerOffset
static const int kHGCalTriggerMask
uint32_t id_
Definition: DetId.h:62
HGCScintillatorDetId HGCScintillatorDetId::triggerCell ( ) const

Definition at line 100 of file HGCScintillatorDetId.cc.

References HGCScintillatorDetId(), iphi(), iphiTrigger(), iradius(), iradiusTrigger(), layer(), trigger(), and type().

Referenced by trigger().

100  {
101 
102  if (trigger())
103  return HGCScintillatorDetId (type(), layer(), iradius(), iphi(), true);
104  else
106  iphiTrigger(), true);
107 }
int type() const
get the type
int iphi() const
get the phi index
int layer() const
get the layer #
int HGCScintillatorDetId::type ( ) const
inline
int HGCScintillatorDetId::zside ( ) const
inline

Member Data Documentation

const int HGCScintillatorDetId::kHGCalLayerMask = 0x1F
static

Definition at line 84 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
static

Definition at line 83 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::kHGCalTriggerMask = 0x1
static

Definition at line 86 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

const int HGCScintillatorDetId::kHGCalTriggerOffset = 22
static

Definition at line 85 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

const int HGCScintillatorDetId::kHGCalTypeMask = 0x3
static

Definition at line 90 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalTypeOffset = 26
static

Definition at line 89 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
static

Definition at line 88 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const int HGCScintillatorDetId::kHGCalZsideOffset = 25
static

Definition at line 87 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 75 of file HGCScintillatorDetId.h.