CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes
HGCSiliconDetId Class Reference

#include <HGCSiliconDetId.h>

Inheritance diagram for HGCSiliconDetId:
DetId

Public Types

enum  waferType { HGCalFine = 0, HGCalCoarseThin = 1, HGCalCoarseThick = 2 }
 
- 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
}
 

Public Member Functions

int cellU () const
 get the cell #'s in u,v or in x,y More...
 
std::pair< int, int > cellUV () const
 
int cellV () const
 
int cellX () const
 
std::pair< int, int > cellXY () const
 
int cellY () const
 
HGCSiliconDetId geometryCell () const
 
 HGCSiliconDetId ()
 
 HGCSiliconDetId (const DetId &id)
 
 HGCSiliconDetId (DetId::Detector det, int zp, int type, int layer, int waferU, int waferV, int cellU, int cellV)
 
 HGCSiliconDetId (uint32_t rawid)
 
bool isEE () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
bool isHE () const
 
int layer () const
 get the layer # More...
 
HGCSiliconDetId moduleId () const
 
HGCSiliconDetIdoperator= (const DetId &id)
 
DetId::Detector subdet () const
 get the subdetector More...
 
int triggerCellU () const
 
std::pair< int, int > triggerCellUV () const
 
int triggerCellV () const
 
int type () const
 get the type More...
 
int waferU () const
 
int waferUAbs () const
 get the wafer #'s in u,v or in x,y More...
 
std::pair< int, int > waferUV () const
 
int waferV () const
 
int waferVAbs () const
 
int waferX () const
 
std::pair< int, int > waferXY () const
 
int waferY () const
 
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 HGCalCoarseN = 8
 
static const int HGCalCoarseTrigger = 2
 
static const int HGCalFineN = 12
 
static const int HGCalFineTrigger = 3
 
static const int kHGCalCellUMask = 0x1F
 
static const int kHGCalCellUOffset = 0
 
static const int kHGCalCellVMask = 0x1F
 
static const int kHGCalCellVOffset = 5
 
static const int kHGCalLayerMask = 0x1F
 
static const int kHGCalLayerOffset = 20
 
static const int kHGCalTypeMask = 0x3
 
static const int kHGCalTypeOffset = 26
 
static const int kHGCalWaferUMask = 0xF
 
static const int kHGCalWaferUOffset = 10
 
static const int kHGCalWaferUSignMask = 0x1
 
static const int kHGCalWaferUSignOffset = 14
 
static const int kHGCalWaferVMask = 0xF
 
static const int kHGCalWaferVOffset = 15
 
static const int kHGCalWaferVSignMask = 0x1
 
static const int kHGCalWaferVSignOffset = 19
 
static const int kHGCalZsideMask = 0x1
 
static const int kHGCalZsideOffset = 25
 
static const HGCSiliconDetId 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

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 22 of file HGCSiliconDetId.h.

Member Enumeration Documentation

◆ waferType

Enumerator
HGCalFine 
HGCalCoarseThin 
HGCalCoarseThick 

Definition at line 24 of file HGCSiliconDetId.h.

Constructor & Destructor Documentation

◆ HGCSiliconDetId() [1/4]

HGCSiliconDetId::HGCSiliconDetId ( )

Create a null cellid

Definition at line 8 of file HGCSiliconDetId.cc.

8 : DetId() {}

Referenced by geometryCell(), and moduleId().

◆ HGCSiliconDetId() [2/4]

HGCSiliconDetId::HGCSiliconDetId ( uint32_t  rawid)

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

Definition at line 10 of file HGCSiliconDetId.cc.

10 : DetId(rawid) {}

◆ HGCSiliconDetId() [3/4]

HGCSiliconDetId::HGCSiliconDetId ( DetId::Detector  det,
int  zp,
int  type,
int  layer,
int  waferU,
int  waferV,
int  cellU,
int  cellV 
)

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

Definition at line 12 of file HGCSiliconDetId.cc.

14  : DetId(det, ForwardEmpty) {
15  int waferUabs(std::abs(waferU)), waferVabs(std::abs(waferV));
16  int waferUsign = (waferU >= 0) ? 0 : 1;
17  int waferVsign = (waferV >= 0) ? 0 : 1;
18  int zside = (zp < 0) ? 1 : 0;
20  ((waferUabs & kHGCalWaferUMask) << kHGCalWaferUOffset) |
21  ((waferUsign & kHGCalWaferUSignMask) << kHGCalWaferUSignOffset) |
22  ((waferVabs & kHGCalWaferVMask) << kHGCalWaferVOffset) |
23  ((waferVsign & kHGCalWaferVSignMask) << kHGCalWaferVSignOffset) |
26 }

References funct::abs(), cellU(), cellV(), DetId::id_, kHGCalCellUMask, kHGCalCellUOffset, kHGCalCellVMask, kHGCalCellVOffset, kHGCalLayerMask, kHGCalLayerOffset, kHGCalTypeMask, kHGCalTypeOffset, kHGCalWaferUMask, kHGCalWaferUOffset, kHGCalWaferUSignMask, kHGCalWaferUSignOffset, kHGCalWaferVMask, kHGCalWaferVOffset, kHGCalWaferVSignMask, kHGCalWaferVSignOffset, kHGCalZsideMask, kHGCalZsideOffset, layer(), waferU(), waferV(), and zside().

◆ HGCSiliconDetId() [4/4]

HGCSiliconDetId::HGCSiliconDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 28 of file HGCSiliconDetId.cc.

28  {
29  if (!gen.null()) {
30  if ((gen.det() != HGCalEE) && (gen.det() != HGCalHSi)) {
31  throw cms::Exception("Invalid DetId")
32  << "Cannot initialize HGCSiliconDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36 }

References TauDecayModes::dec, Exception, DetId::HGCalEE, DetId::HGCalHSi, and DetId::id_.

Member Function Documentation

◆ cellU()

int HGCSiliconDetId::cellU ( ) const
inline

◆ cellUV()

std::pair<int, int> HGCSiliconDetId::cellUV ( ) const
inline

Definition at line 62 of file HGCSiliconDetId.h.

62 { return std::pair<int, int>(cellU(), cellV()); }

References cellU(), and cellV().

◆ cellV()

int HGCSiliconDetId::cellV ( ) const
inline

◆ cellX()

int HGCSiliconDetId::cellX ( ) const
inline

Definition at line 63 of file HGCSiliconDetId.h.

63  {
64  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
65  return (3 * (cellV() - N) + 2);
66  }

References cellV(), HGCalCoarseN, HGCalFine, HGCalFineN, N, and type().

Referenced by cellXY().

◆ cellXY()

std::pair<int, int> HGCSiliconDetId::cellXY ( ) const
inline

Definition at line 71 of file HGCSiliconDetId.h.

71 { return std::pair<int, int>(cellX(), cellY()); }

References cellX(), and cellY().

◆ cellY()

int HGCSiliconDetId::cellY ( ) const
inline

Definition at line 67 of file HGCSiliconDetId.h.

67  {
68  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
69  return (2 * cellU() - (N + cellV()));
70  }

References cellU(), cellV(), HGCalCoarseN, HGCalFine, HGCalFineN, N, and type().

Referenced by cellXY().

◆ geometryCell()

HGCSiliconDetId HGCSiliconDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 42 of file HGCSiliconDetId.h.

42 { return HGCSiliconDetId(det(), zside(), 0, layer(), waferU(), waferV(), 0, 0); }

References DetId::det(), HGCSiliconDetId(), layer(), waferU(), waferV(), and zside().

◆ isEE()

bool HGCSiliconDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 101 of file HGCSiliconDetId.h.

101 { return (det() == HGCalEE); }

References DetId::det(), and DetId::HGCalEE.

◆ isForward()

bool HGCSiliconDetId::isForward ( ) const
inline

Definition at line 103 of file HGCSiliconDetId.h.

103 { return true; }

◆ isHE()

bool HGCSiliconDetId::isHE ( ) const
inline

Definition at line 102 of file HGCSiliconDetId.h.

102 { return (det() == HGCalHSi); }

References DetId::det(), and DetId::HGCalHSi.

◆ layer()

int HGCSiliconDetId::layer ( ) const
inline

◆ moduleId()

HGCSiliconDetId HGCSiliconDetId::moduleId ( ) const
inline

Definition at line 43 of file HGCSiliconDetId.h.

43  {
44  return HGCSiliconDetId(det(), zside(), type(), layer(), waferU(), waferV(), 0, 0);
45  }

References DetId::det(), HGCSiliconDetId(), layer(), type(), waferU(), waferV(), and zside().

Referenced by HGCSiliconDetIdToModule::getModule().

◆ operator=()

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

Assignment from a generic cell id

Definition at line 38 of file HGCSiliconDetId.cc.

38  {
39  if (!gen.null()) {
40  if ((gen.det() != HGCalEE) && (gen.det() != HGCalHSi)) {
41  throw cms::Exception("Invalid DetId")
42  << "Cannot assign HGCSiliconDetId from " << std::hex << gen.rawId() << std::dec;
43  }
44  }
45  id_ = gen.rawId();
46  return (*this);
47 }

References TauDecayModes::dec, Exception, DetId::HGCalEE, DetId::HGCalHSi, and DetId::id_.

◆ subdet()

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

get the subdetector

Definition at line 48 of file HGCSiliconDetId.h.

48 { return det(); }

References DetId::det().

◆ triggerCellU()

int HGCSiliconDetId::triggerCellU ( ) const
inline

Definition at line 84 of file HGCSiliconDetId.h.

84  {
85  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
87  return (cellU() >= N && cellV() >= N)
88  ? cellU() / NT
89  : ((cellU() < N && cellU() <= cellV()) ? cellU() / NT : (1 + (cellU() - (cellV() % NT + 1)) / NT));
90  }

References cellU(), cellV(), HGCalCoarseN, HGCalCoarseTrigger, HGCalFine, HGCalFineN, HGCalFineTrigger, N, and type().

Referenced by HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell(), and triggerCellUV().

◆ triggerCellUV()

std::pair<int, int> HGCSiliconDetId::triggerCellUV ( ) const
inline

Definition at line 98 of file HGCSiliconDetId.h.

98 { return std::pair<int, int>(triggerCellU(), triggerCellV()); }

References triggerCellU(), and triggerCellV().

◆ triggerCellV()

int HGCSiliconDetId::triggerCellV ( ) const
inline

Definition at line 91 of file HGCSiliconDetId.h.

91  {
92  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
94  return (cellU() >= N && cellV() >= N)
95  ? cellV() / NT
96  : ((cellU() < N && cellU() <= cellV()) ? ((cellV() - cellU()) / NT + cellU() / NT) : cellV() / NT);
97  }

References cellU(), cellV(), HGCalCoarseN, HGCalCoarseTrigger, HGCalFine, HGCalFineN, HGCalFineTrigger, N, and type().

Referenced by HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell(), and triggerCellUV().

◆ type()

int HGCSiliconDetId::type ( ) const
inline

◆ waferU()

int HGCSiliconDetId::waferU ( ) const
inline

◆ waferUAbs()

int HGCSiliconDetId::waferUAbs ( ) const
inline

get the wafer #'s in u,v or in x,y

Definition at line 74 of file HGCSiliconDetId.h.

74 { return (id_ >> kHGCalWaferUOffset) & kHGCalWaferUMask; }

References DetId::id_, kHGCalWaferUMask, and kHGCalWaferUOffset.

Referenced by waferU().

◆ waferUV()

std::pair<int, int> HGCSiliconDetId::waferUV ( ) const
inline

Definition at line 78 of file HGCSiliconDetId.h.

78 { return std::pair<int, int>(waferU(), waferV()); }

References waferU(), and waferV().

Referenced by HGCalSD::setDetUnitId().

◆ waferV()

int HGCSiliconDetId::waferV ( ) const
inline

◆ waferVAbs()

int HGCSiliconDetId::waferVAbs ( ) const
inline

Definition at line 75 of file HGCSiliconDetId.h.

75 { return (id_ >> kHGCalWaferVOffset) & kHGCalWaferVMask; }

References DetId::id_, kHGCalWaferVMask, and kHGCalWaferVOffset.

Referenced by waferV().

◆ waferX()

int HGCSiliconDetId::waferX ( ) const
inline

Definition at line 79 of file HGCSiliconDetId.h.

79 { return (-2 * waferU() + waferV()); }

References waferU(), and waferV().

Referenced by waferXY().

◆ waferXY()

std::pair<int, int> HGCSiliconDetId::waferXY ( ) const
inline

Definition at line 81 of file HGCSiliconDetId.h.

81 { return std::pair<int, int>(waferX(), waferY()); }

References waferX(), and waferY().

◆ waferY()

int HGCSiliconDetId::waferY ( ) const
inline

Definition at line 80 of file HGCSiliconDetId.h.

80 { return (2 * waferV()); }

References waferV().

Referenced by waferXY().

◆ zside()

int HGCSiliconDetId::zside ( ) const
inline

Member Data Documentation

◆ HGCalCoarseN

const int HGCSiliconDetId::HGCalCoarseN = 8
static

◆ HGCalCoarseTrigger

const int HGCSiliconDetId::HGCalCoarseTrigger = 2
static

◆ HGCalFineN

const int HGCSiliconDetId::HGCalFineN = 12
static

◆ HGCalFineTrigger

const int HGCSiliconDetId::HGCalFineTrigger = 3
static

◆ kHGCalCellUMask

const int HGCSiliconDetId::kHGCalCellUMask = 0x1F
static

◆ kHGCalCellUOffset

const int HGCSiliconDetId::kHGCalCellUOffset = 0
static

◆ kHGCalCellVMask

const int HGCSiliconDetId::kHGCalCellVMask = 0x1F
static

◆ kHGCalCellVOffset

const int HGCSiliconDetId::kHGCalCellVOffset = 5
static

◆ kHGCalLayerMask

const int HGCSiliconDetId::kHGCalLayerMask = 0x1F
static

◆ kHGCalLayerOffset

const int HGCSiliconDetId::kHGCalLayerOffset = 20
static

◆ kHGCalTypeMask

const int HGCSiliconDetId::kHGCalTypeMask = 0x3
static

◆ kHGCalTypeOffset

const int HGCSiliconDetId::kHGCalTypeOffset = 26
static

◆ kHGCalWaferUMask

const int HGCSiliconDetId::kHGCalWaferUMask = 0xF
static

◆ kHGCalWaferUOffset

const int HGCSiliconDetId::kHGCalWaferUOffset = 10
static

◆ kHGCalWaferUSignMask

const int HGCSiliconDetId::kHGCalWaferUSignMask = 0x1
static

◆ kHGCalWaferUSignOffset

const int HGCSiliconDetId::kHGCalWaferUSignOffset = 14
static

◆ kHGCalWaferVMask

const int HGCSiliconDetId::kHGCalWaferVMask = 0xF
static

◆ kHGCalWaferVOffset

const int HGCSiliconDetId::kHGCalWaferVOffset = 15
static

◆ kHGCalWaferVSignMask

const int HGCSiliconDetId::kHGCalWaferVSignMask = 0x1
static

◆ kHGCalWaferVSignOffset

const int HGCSiliconDetId::kHGCalWaferVSignOffset = 19
static

◆ kHGCalZsideMask

const int HGCSiliconDetId::kHGCalZsideMask = 0x1
static

Definition at line 123 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and zside().

◆ kHGCalZsideOffset

const int HGCSiliconDetId::kHGCalZsideOffset = 25
static

Definition at line 122 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and zside().

◆ Undefined

const HGCSiliconDetId HGCSiliconDetId::Undefined
static

Definition at line 105 of file HGCSiliconDetId.h.

HGCSiliconDetId::kHGCalWaferUMask
static const int kHGCalWaferUMask
Definition: HGCSiliconDetId.h:113
HGCSiliconDetId::waferY
int waferY() const
Definition: HGCSiliconDetId.h:80
HGCSiliconDetId::HGCalCoarseTrigger
static const int HGCalCoarseTrigger
Definition: HGCSiliconDetId.h:28
ForwardEmpty
Definition: ForwardSubdetector.h:5
HGCSiliconDetId::kHGCalCellVMask
static const int kHGCalCellVMask
Definition: HGCSiliconDetId.h:111
HGCSiliconDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCSiliconDetId.h:120
HGCSiliconDetId::HGCalCoarseN
static const int HGCalCoarseN
Definition: HGCSiliconDetId.h:26
HGCSiliconDetId::triggerCellV
int triggerCellV() const
Definition: HGCSiliconDetId.h:91
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCSiliconDetId::kHGCalWaferUOffset
static const int kHGCalWaferUOffset
Definition: HGCSiliconDetId.h:112
HGCSiliconDetId::kHGCalWaferUSignMask
static const int kHGCalWaferUSignMask
Definition: HGCSiliconDetId.h:115
HGCSiliconDetId::kHGCalCellUMask
static const int kHGCalCellUMask
Definition: HGCSiliconDetId.h:109
HGCSiliconDetId::kHGCalTypeMask
static const int kHGCalTypeMask
Definition: HGCSiliconDetId.h:125
HGCSiliconDetId::HGCalCoarseThin
Definition: HGCSiliconDetId.h:24
HGCSiliconDetId::HGCalFineN
static const int HGCalFineN
Definition: HGCSiliconDetId.h:25
HGCSiliconDetId::cellY
int cellY() const
Definition: HGCSiliconDetId.h:67
HGCSiliconDetId::HGCalCoarseThick
Definition: HGCSiliconDetId.h:24
HGCSiliconDetId::triggerCellU
int triggerCellU() const
Definition: HGCSiliconDetId.h:84
HGCSiliconDetId::cellX
int cellX() const
Definition: HGCSiliconDetId.h:63
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
HGCSiliconDetId::kHGCalWaferVMask
static const int kHGCalWaferVMask
Definition: HGCSiliconDetId.h:117
N
#define N
Definition: blowfish.cc:9
gen
Definition: PythiaDecays.h:13
HGCSiliconDetId::kHGCalWaferVSignOffset
static const int kHGCalWaferVSignOffset
Definition: HGCSiliconDetId.h:118
HGCSiliconDetId::HGCalFine
Definition: HGCSiliconDetId.h:24
HGCSiliconDetId::kHGCalWaferVSignMask
static const int kHGCalWaferVSignMask
Definition: HGCSiliconDetId.h:119
HGCSiliconDetId::waferVAbs
int waferVAbs() const
Definition: HGCSiliconDetId.h:75
HGCSiliconDetId::waferX
int waferX() const
Definition: HGCSiliconDetId.h:79
DetId::id_
uint32_t id_
Definition: DetId.h:69
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HGCSiliconDetId::kHGCalZsideOffset
static const int kHGCalZsideOffset
Definition: HGCSiliconDetId.h:122
HGCSiliconDetId::kHGCalWaferVOffset
static const int kHGCalWaferVOffset
Definition: HGCSiliconDetId.h:116
HGCSiliconDetId::kHGCalTypeOffset
static const int kHGCalTypeOffset
Definition: HGCSiliconDetId.h:124
HGCSiliconDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCSiliconDetId.h:54
HGCSiliconDetId::cellV
int cellV() const
Definition: HGCSiliconDetId.h:61
HGCSiliconDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HGCSiliconDetId.h:60
HGCSiliconDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCSiliconDetId.h:121
Exception
Definition: hltDiff.cc:245
HGCSiliconDetId::HGCalFineTrigger
static const int HGCalFineTrigger
Definition: HGCSiliconDetId.h:27
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
HGCSiliconDetId::kHGCalWaferUSignOffset
static const int kHGCalWaferUSignOffset
Definition: HGCSiliconDetId.h:114
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCSiliconDetId::kHGCalCellVOffset
static const int kHGCalCellVOffset
Definition: HGCSiliconDetId.h:110
HGCSiliconDetId::HGCSiliconDetId
HGCSiliconDetId()
Definition: HGCSiliconDetId.cc:8
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HGCSiliconDetId::kHGCalZsideMask
static const int kHGCalZsideMask
Definition: HGCSiliconDetId.h:123
HGCSiliconDetId::waferUAbs
int waferUAbs() const
get the wafer #'s in u,v or in x,y
Definition: HGCSiliconDetId.h:74
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCSiliconDetId::kHGCalCellUOffset
static const int kHGCalCellUOffset
Definition: HGCSiliconDetId.h:108
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57