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 ring, int iphi, bool trigger=false, int sipm=0)
 
 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
 
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)
 
int ring () const
 get the eta index More...
 
std::pair< int, int > ringphi () const
 
void setSiPM (int sipm)
 
void setType (int type)
 
int sipm () const
 get/set the sipm size More...
 
DetId::Detector subdet () const
 get the subdetector More...
 
bool trigger () const
 
HGCScintillatorDetId triggerCell () const
 
int type () const
 get/set 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 kHGCalSiPMMask = 0x1
 
static const int kHGCalSiPMMask0 = 0xFF7FFFFF
 
static const int kHGCalSiPMOffset = 23
 
static const int kHGCalTriggerMask = 0x1
 
static const int kHGCalTriggerOffset = 22
 
static const int kHGCalTypeMask = 0x3
 
static const int kHGCalTypeMask0 = 0xF3FFFFFF
 
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 23 of file HGCScintillatorDetId.h.

Constructor & Destructor Documentation

◆ HGCScintillatorDetId() [1/4]

HGCScintillatorDetId::HGCScintillatorDetId ( )

Create a null cellid

Definition at line 8 of file HGCScintillatorDetId.cc.

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

8 : DetId() {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ 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) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCScintillatorDetId() [3/4]

HGCScintillatorDetId::HGCScintillatorDetId ( int  type,
int  layer,
int  ring,
int  iphi,
bool  trigger = false,
int  sipm = 0 
)

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

Definition at line 12 of file HGCScintillatorDetId.cc.

References funct::abs(), DetId::id_, kHGCalLayerMask, kHGCalLayerOffset, kHGCalPhiMask, kHGCalPhiOffset, kHGCalRadiusMask, kHGCalRadiusOffset, kHGCalSiPMMask, kHGCalSiPMOffset, kHGCalTriggerMask, kHGCalTriggerOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalZsideMask, kHGCalZsideOffset, layer(), phi, ring(), sipm(), and zside().

14  int zside = (ring < 0) ? 1 : 0;
15  int itrig = trigger ? 1 : 0;
16  int ringAbs = std::abs(ring);
21 }
static const int kHGCalTriggerOffset
static const int kHGCalTypeOffset
static const int kHGCalSiPMOffset
int layer() const
get the layer #
static const int kHGCalLayerMask
static const int kHGCalRadiusOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalTriggerMask
int zside() const
get the z-side of the cell (1/-1)
int ring() const
get the eta index
static const int kHGCalRadiusMask
uint32_t id_
Definition: DetId.h:69
static const int kHGCalPhiMask
static const int kHGCalSiPMMask
static const int kHGCalZsideMask
static const int kHGCalZsideOffset
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
int sipm() const
get/set the sipm size
static const int kHGCalPhiOffset
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCScintillatorDetId() [4/4]

HGCScintillatorDetId::HGCScintillatorDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file HGCScintillatorDetId.cc.

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

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

Member Function Documentation

◆ detectorCells()

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

trigger or detector cell

Definition at line 82 of file HGCScintillatorDetId.cc.

References hgcalTBTopologyTester_cfi::cells, HGCScintillatorDetId(), iphi(), layer(), ring(), trigger(), type(), and zside().

82  {
83  std::vector<HGCScintillatorDetId> cells;
84  int irad = ring();
85  int ifi = iphi();
86  int iz = zside();
87  if (trigger()) {
88  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi - 1, false));
89  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi - 1, false));
90  cells.emplace_back(HGCScintillatorDetId(type(), layer(), (2 * irad - 1) * iz, 2 * ifi, false));
91  cells.emplace_back(HGCScintillatorDetId(type(), layer(), 2 * irad * iz, 2 * ifi, false));
92  } else {
93  cells.emplace_back(HGCScintillatorDetId(type(), layer(), irad * iz, ifi, false));
94  }
95  return cells;
96 }
int type() const
get/set 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)
int ring() const
get the eta index

◆ geometryCell()

HGCScintillatorDetId HGCScintillatorDetId::geometryCell ( ) const

Converter for a geometry cell id

Definition at line 98 of file HGCScintillatorDetId.cc.

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

Referenced by HGCalGeometry::getGeometryDetId().

98  {
99  if (trigger()) {
100  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), false);
101  } else {
102  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), false);
103  }
104 }
int type() const
get/set the type
int iphi() const
get the phi index
int layer() const
get the layer #

◆ ieta()

int HGCScintillatorDetId::ieta ( ) const
inline

Definition at line 57 of file HGCScintillatorDetId.h.

References ring(), and zside().

Referenced by ietaphi().

57 { return zside() * ring(); }
int zside() const
get the z-side of the cell (1/-1)
int ring() const
get the eta index

◆ ietaAbs()

int HGCScintillatorDetId::ietaAbs ( ) const
inline

◆ ietaphi()

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

Definition at line 61 of file HGCScintillatorDetId.h.

References ieta(), and iphi().

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

◆ iphi()

int HGCScintillatorDetId::iphi ( ) const

◆ iphiTrigger()

int HGCScintillatorDetId::iphiTrigger ( ) const

Definition at line 65 of file HGCScintillatorDetId.cc.

References iphi(), and trigger().

Referenced by geometryCell(), and triggerCell().

65  {
66  if (trigger())
67  return ((iphi() + 1) / 2);
68  else
69  return iphi();
70 }
int iphi() const
get the phi index

◆ iradius()

int HGCScintillatorDetId::iradius ( ) const
inline

Definition at line 55 of file HGCScintillatorDetId.h.

References ring(), and zside().

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

55 { return zside() * ring(); }
int zside() const
get the z-side of the cell (1/-1)
int ring() const
get the eta index

◆ iradiusAbs()

int HGCScintillatorDetId::iradiusAbs ( ) const
inline

Definition at line 54 of file HGCScintillatorDetId.h.

References ring().

Referenced by HGCalCoarseTriggerCellMapping::getConstituentTriggerCells().

54 { return ring(); }
int ring() const
get the eta index

◆ iradiusTrigger()

int HGCScintillatorDetId::iradiusTrigger ( ) const
inline

Definition at line 99 of file HGCScintillatorDetId.h.

References iradiusTriggerAbs(), and zside().

Referenced by geometryCell(), and triggerCell().

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

◆ iradiusTriggerAbs()

int HGCScintillatorDetId::iradiusTriggerAbs ( ) const

Definition at line 51 of file HGCScintillatorDetId.cc.

References ring(), and trigger().

Referenced by iradiusTrigger().

51  {
52  if (trigger())
53  return ((ring() + 1) / 2);
54  else
55  return ring();
56 }
int ring() const
get the eta index

◆ isEE()

bool HGCScintillatorDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 74 of file HGCScintillatorDetId.h.

74 { return false; }

◆ isForward()

bool HGCScintillatorDetId::isForward ( ) const
inline

Definition at line 76 of file HGCScintillatorDetId.h.

76 { return true; }

◆ isHE()

bool HGCScintillatorDetId::isHE ( ) const
inline

Definition at line 75 of file HGCScintillatorDetId.h.

75 { return true; }

◆ layer()

int HGCScintillatorDetId::layer ( ) const
inline

get the layer #

Definition at line 50 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalLayerMask, and kHGCalLayerOffset.

Referenced by HGcalHitIdCheck::analyze(), HGCalBHValidation::analyze(), HGCalDigiValidation::analyze(), HGCalRecHitValidation::analyze(), detectorCells(), HGCalTopology::encode(), geometryCell(), FWL1THGCalProxyTemplate< l1t::HGCalMulticluster >::getCellsFromTriggerCell(), HGCalTriggerGeometryV9Imp2::getCellsFromTriggerCell(), HGCalTriggerGeometryV9Imp3::getCellsFromTriggerCell(), hgcal::RecHitTools::getLayer(), HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell(), HGCalTriggerGeometryV9Imp3::getModuleFromTriggerCell(), HGCalTriggerGeometryV9Imp2::getOrderedTriggerCellsFromModule(), HGCalGeometry::getSummary(), HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell(), HGCalTriggerGeometryV9Imp3::getTriggerCellFromCell(), HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule(), HGCScintillatorDetId(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), HGCalTriggerTools::layer(), HGCalTriggerGeometryV9Imp2::layerWithOffset(), HGCalTriggerGeometryV9Imp3::layerWithOffset(), HGCalGeometry::newCell(), HGCalSciNoiseMap::scaleByDose(), HGCalSciNoiseMap::scaleBySipmArea(), HGCScintSD::setDetUnitId(), and triggerCell().

50 { return (id_ >> kHGCalLayerOffset) & kHGCalLayerMask; }
static const int kHGCalLayerMask
uint32_t id_
Definition: DetId.h:69
static const int kHGCalLayerOffset

◆ operator=()

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

Assignment from a generic cell id

Definition at line 33 of file HGCScintillatorDetId.cc.

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

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

◆ ring()

int HGCScintillatorDetId::ring ( ) const

◆ ringphi()

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

Definition at line 62 of file HGCScintillatorDetId.h.

References iphi(), and iradius().

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

◆ setSiPM()

void HGCScintillatorDetId::setSiPM ( int  sipm)

Definition at line 77 of file HGCScintillatorDetId.cc.

References DetId::id_, kHGCalSiPMMask, kHGCalSiPMMask0, kHGCalSiPMOffset, and sipm().

Referenced by HGCalTopology::encode(), and HGCalGeometry::newCell().

77  {
80 }
static const int kHGCalSiPMOffset
static const int kHGCalSiPMMask0
uint32_t id_
Definition: DetId.h:69
static const int kHGCalSiPMMask
int sipm() const
get/set the sipm size

◆ setType()

void HGCScintillatorDetId::setType ( int  type)

Definition at line 72 of file HGCScintillatorDetId.cc.

References DetId::id_, kHGCalTypeMask, kHGCalTypeMask0, and kHGCalTypeOffset.

Referenced by HGCalTopology::encode(), and HGCalGeometry::newCell().

72  {
75 }
static const int kHGCalTypeOffset
uint32_t id_
Definition: DetId.h:69
static const int kHGCalTypeMask0
static const int kHGCalTypeMask

◆ sipm()

int HGCScintillatorDetId::sipm ( ) const
inline

get/set the sipm size

Definition at line 65 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalSiPMMask, and kHGCalSiPMOffset.

Referenced by HGCScintillatorDetId(), HGCalSciNoiseMap::scaleBySipmArea(), and setSiPM().

65 { return (id_ >> kHGCalSiPMOffset) & kHGCalSiPMMask; }
static const int kHGCalSiPMOffset
uint32_t id_
Definition: DetId.h:69
static const int kHGCalSiPMMask

◆ subdet()

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

get the subdetector

Definition at line 40 of file HGCScintillatorDetId.h.

References DetId::det().

40 { return det(); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46

◆ trigger()

bool HGCScintillatorDetId::trigger ( ) const
inline

Definition at line 70 of file HGCScintillatorDetId.h.

References DetId::id_, kHGCalTriggerMask, and kHGCalTriggerOffset.

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

70 { return (((id_ >> kHGCalTriggerOffset) & kHGCalTriggerMask) == 1); }
static const int kHGCalTriggerOffset
static const int kHGCalTriggerMask
uint32_t id_
Definition: DetId.h:69

◆ triggerCell()

HGCScintillatorDetId HGCScintillatorDetId::triggerCell ( ) const

Definition at line 106 of file HGCScintillatorDetId.cc.

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

106  {
107  if (trigger())
108  return HGCScintillatorDetId(type(), layer(), iradius(), iphi(), true);
109  else
110  return HGCScintillatorDetId(type(), layer(), iradiusTrigger(), iphiTrigger(), true);
111 }
int type() const
get/set the type
int iphi() const
get the phi index
int layer() const
get the layer #

◆ 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 86 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

◆ kHGCalLayerOffset

const int HGCScintillatorDetId::kHGCalLayerOffset = 17
static

Definition at line 85 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and layer().

◆ kHGCalPhiMask

const int HGCScintillatorDetId::kHGCalPhiMask = 0x1FF
static

Definition at line 82 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

◆ kHGCalPhiOffset

const int HGCScintillatorDetId::kHGCalPhiOffset = 0
static

Definition at line 81 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and iphi().

◆ kHGCalRadiusMask

const int HGCScintillatorDetId::kHGCalRadiusMask = 0xFF
static

Definition at line 84 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and ring().

◆ kHGCalRadiusOffset

const int HGCScintillatorDetId::kHGCalRadiusOffset = 9
static

◆ kHGCalSiPMMask

const int HGCScintillatorDetId::kHGCalSiPMMask = 0x1
static

Definition at line 90 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), setSiPM(), and sipm().

◆ kHGCalSiPMMask0

const int HGCScintillatorDetId::kHGCalSiPMMask0 = 0xFF7FFFFF
static

Definition at line 91 of file HGCScintillatorDetId.h.

Referenced by setSiPM().

◆ kHGCalSiPMOffset

const int HGCScintillatorDetId::kHGCalSiPMOffset = 23
static

Definition at line 89 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), setSiPM(), and sipm().

◆ kHGCalTriggerMask

const int HGCScintillatorDetId::kHGCalTriggerMask = 0x1
static

Definition at line 88 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

◆ kHGCalTriggerOffset

const int HGCScintillatorDetId::kHGCalTriggerOffset = 22
static

Definition at line 87 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and trigger().

◆ kHGCalTypeMask

const int HGCScintillatorDetId::kHGCalTypeMask = 0x3
static

Definition at line 95 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), setType(), and type().

◆ kHGCalTypeMask0

const int HGCScintillatorDetId::kHGCalTypeMask0 = 0xF3FFFFFF
static

Definition at line 96 of file HGCScintillatorDetId.h.

Referenced by setType().

◆ kHGCalTypeOffset

const int HGCScintillatorDetId::kHGCalTypeOffset = 26
static

Definition at line 94 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), setType(), and type().

◆ kHGCalZsideMask

const int HGCScintillatorDetId::kHGCalZsideMask = 0x1
static

Definition at line 93 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

◆ kHGCalZsideOffset

const int HGCScintillatorDetId::kHGCalZsideOffset = 25
static

Definition at line 92 of file HGCScintillatorDetId.h.

Referenced by HGCScintillatorDetId(), and zside().

◆ Undefined

const HGCScintillatorDetId HGCScintillatorDetId::Undefined
static

Definition at line 78 of file HGCScintillatorDetId.h.