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 (const DetId &id)
 
 HGCScintillatorDetId (int type, int layer, int iradius, int iphi, bool trigger=false)
 
 HGCScintillatorDetId (uint32_t rawid)
 
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 (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. 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() [1/4]

HGCScintillatorDetId::HGCScintillatorDetId ( )

Create a null cellid

Definition at line 8 of file HGCScintillatorDetId.cc.

8 : DetId() {}

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

◆ HGCScintillatorDetId() [2/4]

HGCScintillatorDetId::HGCScintillatorDetId ( uint32_t  rawid)

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

Definition at line 10 of file HGCScintillatorDetId.cc.

10 : DetId(rawid) {}

◆ HGCScintillatorDetId() [3/4]

HGCScintillatorDetId::HGCScintillatorDetId ( int  type,
int  layer,
int  iradius,
int  iphi,
bool  trigger = false 
)

◆ HGCScintillatorDetId() [4/4]

HGCScintillatorDetId::HGCScintillatorDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 22 of file HGCScintillatorDetId.cc.

22  {
23  if (!gen.null()) {
24  if (gen.det() != HGCalHSc) {
25  throw cms::Exception("Invalid DetId")
26  << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
27  }
28  }
29  id_ = gen.rawId();
30 }

References TauDecayModes::dec, Exception, DetId::HGCalHSc, and DetId::id_.

Member Function Documentation

◆ detectorCells()

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

trigger or detector cell

Definition at line 71 of file HGCScintillatorDetId.cc.

71  {
72  std::vector<HGCScintillatorDetId> cells;
73  int irad = iradiusAbs();
74  int ifi = iphi();
75  int iz = zside();
76  if (trigger()) {
77  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi - 1, false));
78  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi - 1, false));
79  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi, false));
80  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi, false));
81  } else {
82  cells.emplace_back(HGCScintillatorDetId(type(), layer(), irad * iz, ifi, false));
83  }
84  return cells;
85 }

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

◆ geometryCell()

HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const

Converter for a geometry cell id

Definition at line 87 of file HGCScintillatorDetId.cc.

87  {
88  if (trigger()) {
89  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), false);
90  } else {
91  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), false);
92  }
93 }

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

◆ ieta()

int HGCScintillatorDetId::ieta ( ) const
inline

◆ ietaAbs()

int HGCScintillatorDetId::ietaAbs ( ) const
inline

◆ ietaphi()

std::pair<int, int> HGCScintillatorDetId::ietaphi ( ) const
inline

Definition at line 57 of file HGCScintillatorDetId.h.

57 { return std::pair<int, int>(ieta(), iphi()); }

References ieta(), and iphi().

◆ iphi()

int HGCScintillatorDetId::iphi ( ) const

◆ iphiTrigger()

int HGCScintillatorDetId::iphiTrigger ( ) const

Definition at line 64 of file HGCScintillatorDetId.cc.

64  {
65  if (trigger())
66  return ((iphi() + 1) / 2);
67  else
68  return iphi();
69 }

References iphi(), and trigger().

Referenced by geometryCell(), and triggerCell().

◆ iradius()

int HGCScintillatorDetId::iradius ( ) const
inline

Definition at line 51 of file HGCScintillatorDetId.h.

51 { return zside() * iradiusAbs(); }

References iradiusAbs(), and zside().

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

◆ iradiusAbs()

int HGCScintillatorDetId::iradiusAbs ( ) const

get the eta index

Definition at line 43 of file HGCScintillatorDetId.cc.

43  {
44  if (trigger())
45  return (2 * ((id_ >> kHGCalRadiusOffset) & kHGCalRadiusMask));
46  else
47  return ((id_ >> kHGCalRadiusOffset) & kHGCalRadiusMask);
48 }

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

Referenced by detectorCells(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), ietaAbs(), iradius(), and iradiusTriggerAbs().

◆ iradiusphi()

std::pair<int, int> HGCScintillatorDetId::iradiusphi ( ) const
inline

Definition at line 58 of file HGCScintillatorDetId.h.

58 { return std::pair<int, int>(iradius(), iphi()); }

References iphi(), and iradius().

◆ iradiusTrigger()

int HGCScintillatorDetId::iradiusTrigger ( ) const
inline

Definition at line 87 of file HGCScintillatorDetId.h.

87 { return zside() * iradiusTriggerAbs(); }

References iradiusTriggerAbs(), and zside().

Referenced by geometryCell(), and triggerCell().

◆ iradiusTriggerAbs()

int HGCScintillatorDetId::iradiusTriggerAbs ( ) const

Definition at line 50 of file HGCScintillatorDetId.cc.

50  {
51  if (trigger())
52  return ((iradiusAbs() + 1) / 2);
53  else
54  return iradiusAbs();
55 }

References iradiusAbs(), and trigger().

Referenced by iradiusTrigger().

◆ isEE()

bool HGCScintillatorDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 66 of file HGCScintillatorDetId.h.

66 { return false; }

◆ isForward()

bool HGCScintillatorDetId::isForward ( ) const
inline

Definition at line 68 of file HGCScintillatorDetId.h.

68 { return true; }

◆ isHE()

bool HGCScintillatorDetId::isHE ( ) const
inline

Definition at line 67 of file HGCScintillatorDetId.h.

67 { return true; }

◆ layer()

int HGCScintillatorDetId::layer ( ) const
inline

◆ operator=()

HGCScintillatorDetId & HGCScintillatorDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 32 of file HGCScintillatorDetId.cc.

32  {
33  if (!gen.null()) {
34  if (gen.det() != HGCalHSc) {
35  throw cms::Exception("Invalid DetId")
36  << "Cannot assign HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
37  }
38  }
39  id_ = gen.rawId();
40  return (*this);
41 }

References TauDecayModes::dec, Exception, DetId::HGCalHSc, and DetId::id_.

◆ subdet()

DetId::Detector HGCScintillatorDetId::subdet ( ) const
inline

get the subdetector

Definition at line 38 of file HGCScintillatorDetId.h.

38 { return det(); }

References DetId::det().

Referenced by HGCalTriggerNtupleHGCTriggerSums::fill(), and HGCalTriggerNtupleHGCTriggerCells::fill().

◆ trigger()

bool HGCScintillatorDetId::trigger ( ) const
inline

◆ triggerCell()

HGCScintillatorDetId HGCScintillatorDetId::triggerCell ( ) const

Definition at line 95 of file HGCScintillatorDetId.cc.

95  {
96  if (trigger())
97  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), true);
98  else
99  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), true);
100 }

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

◆ type()

int HGCScintillatorDetId::type ( ) const
inline

◆ zside()

int HGCScintillatorDetId::zside ( ) const
inline

Member Data Documentation

◆ kHGCalLayerMask

const int HGCScintillatorDetId::kHGCalLayerMask = 0x1F
static

Definition at line 78 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

◆ kHGCalLayerOffset

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
static

Definition at line 77 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

◆ kHGCalPhiMask

const int HGCScintillatorDetId::kHGCalPhiMask = 0x1FF
static

◆ kHGCalPhiOffset

const int HGCScintillatorDetId::kHGCalPhiOffset = 0
static

◆ kHGCalRadiusMask

const int HGCScintillatorDetId::kHGCalRadiusMask = 0xFF
static

◆ kHGCalRadiusOffset

const int HGCScintillatorDetId::kHGCalRadiusOffset = 9
static

◆ kHGCalTriggerMask

const int HGCScintillatorDetId::kHGCalTriggerMask = 0x1
static

Definition at line 80 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

◆ kHGCalTriggerOffset

const int HGCScintillatorDetId::kHGCalTriggerOffset = 22
static

Definition at line 79 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

◆ kHGCalTypeMask

const int HGCScintillatorDetId::kHGCalTypeMask = 0x3
static

Definition at line 84 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

◆ kHGCalTypeOffset

const int HGCScintillatorDetId::kHGCalTypeOffset = 26
static

Definition at line 83 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and type().

◆ kHGCalZsideMask

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
static

Definition at line 82 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

◆ kHGCalZsideOffset

const int HGCScintillatorDetId::kHGCalZsideOffset = 25
static

Definition at line 81 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

◆ Undefined

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 70 of file HGCScintillatorDetId.h.

HGCScintillatorDetId::iradiusAbs
int iradiusAbs() const
get the eta index
Definition: HGCScintillatorDetId.cc:43
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:57
ForwardEmpty
Definition: ForwardSubdetector.h:5
HGCScintillatorDetId::ieta
int ieta() const
Definition: HGCScintillatorDetId.h:53
HGCScintillatorDetId::kHGCalTypeOffset
static const int kHGCalTypeOffset
Definition: HGCScintillatorDetId.h:83
HGCScintillatorDetId::kHGCalTriggerOffset
static const int kHGCalTriggerOffset
Definition: HGCScintillatorDetId.h:79
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCScintillatorDetId::kHGCalTriggerMask
static const int kHGCalTriggerMask
Definition: HGCScintillatorDetId.h:80
HGCScintillatorDetId::iphiTrigger
int iphiTrigger() const
Definition: HGCScintillatorDetId.cc:64
HGCScintillatorDetId::kHGCalTypeMask
static const int kHGCalTypeMask
Definition: HGCScintillatorDetId.h:84
HGCScintillatorDetId::iradiusTrigger
int iradiusTrigger() const
Definition: HGCScintillatorDetId.h:87
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:47
HGCScintillatorDetId::iradiusTriggerAbs
int iradiusTriggerAbs() const
Definition: HGCScintillatorDetId.cc:50
HGCScintillatorDetId::trigger
bool trigger() const
Definition: HGCScintillatorDetId.h:62
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:52
HGCScintillatorDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCScintillatorDetId.h:78
gen
Definition: PythiaDecays.h:13
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:44
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCScintillatorDetId::kHGCalRadiusOffset
static const int kHGCalRadiusOffset
Definition: HGCScintillatorDetId.h:75
HGCScintillatorDetId::iradius
int iradius() const
Definition: HGCScintillatorDetId.h:51
HGCScintillatorDetId::kHGCalPhiOffset
static const int kHGCalPhiOffset
Definition: HGCScintillatorDetId.h:73
HGCScintillatorDetId::kHGCalRadiusMask
static const int kHGCalRadiusMask
Definition: HGCScintillatorDetId.h:76
HGCScintillatorDetId::type
int type() const
get the type
Definition: HGCScintillatorDetId.h:41
HGCScintillatorDetId::kHGCalPhiMask
static const int kHGCalPhiMask
Definition: HGCScintillatorDetId.h:74
HGCScintillatorDetId::HGCScintillatorDetId
HGCScintillatorDetId()
Definition: HGCScintillatorDetId.cc:8
DDAxes::phi
type
type
Definition: HCALResponse.h:21
HGCScintillatorDetId::kHGCalZsideMask
static const int kHGCalZsideMask
Definition: HGCScintillatorDetId.h:82
DetId::HGCalHSc
Definition: DetId.h:34
HGCScintillatorDetId::kHGCalZsideOffset
static const int kHGCalZsideOffset
Definition: HGCScintillatorDetId.h:81
Exception
Definition: hltDiff.cc:246
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
trigger
Definition: HLTPrescaleTableCond.h:8
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCScintillatorDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCScintillatorDetId.h:77
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143