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 (uint32_t rawid)
 
 HGCSiliconDetId (DetId::Detector det, int zp, int type, int layer, int waferU, int waferV, int cellU, int cellV)
 
 HGCSiliconDetId (const DetId &id)
 
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 (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 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.

Referenced by geometryCell(), and moduleId().

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

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

◆ 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.

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().

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 }
static const int kHGCalWaferVOffset
static const int kHGCalTypeMask
static const int kHGCalWaferVSignOffset
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int kHGCalCellUMask
static const int kHGCalCellVOffset
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
static const int kHGCalTypeOffset
int layer() const
get the layer #
static const int kHGCalCellVMask
static const int kHGCalZsideOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int waferU() const
static const int kHGCalLayerMask
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
int waferV() const
static const int kHGCalZsideMask
static const int kHGCalWaferVSignMask
int zside() const
get the z-side of the cell (1/-1)
uint32_t id_
Definition: DetId.h:69
static const int kHGCalCellUOffset
int cellV() const
static const int kHGCalLayerOffset
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HGCSiliconDetId() [4/4]

HGCSiliconDetId::HGCSiliconDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 28 of file HGCSiliconDetId.cc.

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

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 }
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

◆ cellU()

int HGCSiliconDetId::cellU ( ) const
inline

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

Definition at line 60 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalCellUMask, and kHGCalCellUOffset.

Referenced by HGCalTestPartialWaferRecHits::analyze(), cellUV(), cellY(), hgcal::RecHitTools::getCell(), HGCSiliconDetId(), HGCalSD::setDetUnitId(), triggerCellU(), and triggerCellV().

60 { return (id_ >> kHGCalCellUOffset) & kHGCalCellUMask; }
static const int kHGCalCellUMask
uint32_t id_
Definition: DetId.h:69
static const int kHGCalCellUOffset

◆ cellUV()

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

Definition at line 62 of file HGCSiliconDetId.h.

References cellU(), and cellV().

62 { return std::pair<int, int>(cellU(), cellV()); }
int cellU() const
get the cell #&#39;s in u,v or in x,y
int cellV() const

◆ cellV()

int HGCSiliconDetId::cellV ( ) const
inline

◆ cellX()

int HGCSiliconDetId::cellX ( ) const
inline

Definition at line 63 of file HGCSiliconDetId.h.

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

Referenced by cellXY().

63  {
64  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
65  return (3 * (cellV() - N) + 2);
66  }
static const int HGCalFineN
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
int cellV() const
int type() const
get the type

◆ cellXY()

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

Definition at line 71 of file HGCSiliconDetId.h.

References cellX(), and cellY().

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

◆ cellY()

int HGCSiliconDetId::cellY ( ) const
inline

Definition at line 67 of file HGCSiliconDetId.h.

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

Referenced by cellXY().

67  {
68  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
69  return (2 * cellU() - (N + cellV()));
70  }
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int HGCalFineN
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
int cellV() const
int type() const
get the type

◆ geometryCell()

HGCSiliconDetId HGCSiliconDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 42 of file HGCSiliconDetId.h.

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

Referenced by HGCalGeometry::getGeometryDetId().

42 { return HGCSiliconDetId(det(), zside(), 0, layer(), waferU(), waferV(), 0, 0); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int layer() const
get the layer #
int waferU() const
int waferV() const
int zside() const
get the z-side of the cell (1/-1)

◆ isEE()

bool HGCSiliconDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 101 of file HGCSiliconDetId.h.

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

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

◆ 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.

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

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

◆ layer()

int HGCSiliconDetId::layer ( ) const
inline

◆ moduleId()

HGCSiliconDetId HGCSiliconDetId::moduleId ( ) const
inline

Definition at line 43 of file HGCSiliconDetId.h.

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

Referenced by HGCSiliconDetIdToModule::getModule().

43  {
44  return HGCSiliconDetId(det(), zside(), type(), layer(), waferU(), waferV(), 0, 0);
45  }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int layer() const
get the layer #
int waferU() const
int waferV() const
int zside() const
get the z-side of the cell (1/-1)
int type() const
get the type

◆ operator=()

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

Assignment from a generic cell id

Definition at line 38 of file HGCSiliconDetId.cc.

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

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 }
uint32_t id_
Definition: DetId.h:69

◆ subdet()

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

get the subdetector

Definition at line 48 of file HGCSiliconDetId.h.

References DetId::det().

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

◆ triggerCellU()

int HGCSiliconDetId::triggerCellU ( ) const
inline

Definition at line 84 of file HGCSiliconDetId.h.

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

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

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  }
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int HGCalFineN
static const int HGCalCoarseTrigger
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
int cellV() const
int type() const
get the type
static const int HGCalFineTrigger

◆ triggerCellUV()

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

Definition at line 98 of file HGCSiliconDetId.h.

References triggerCellU(), and triggerCellV().

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

◆ triggerCellV()

int HGCSiliconDetId::triggerCellV ( ) const
inline

Definition at line 91 of file HGCSiliconDetId.h.

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

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

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  }
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int HGCalFineN
static const int HGCalCoarseTrigger
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
int cellV() const
int type() const
get the type
static const int HGCalFineTrigger

◆ 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.

References DetId::id_, kHGCalWaferUMask, and kHGCalWaferUOffset.

Referenced by waferU().

74 { return (id_ >> kHGCalWaferUOffset) & kHGCalWaferUMask; }
static const int kHGCalWaferUMask
uint32_t id_
Definition: DetId.h:69
static const int kHGCalWaferUOffset

◆ waferUV()

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

Definition at line 78 of file HGCSiliconDetId.h.

References waferU(), and waferV().

Referenced by HGCalSD::setDetUnitId().

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

◆ waferV()

int HGCSiliconDetId::waferV ( ) const
inline

◆ waferVAbs()

int HGCSiliconDetId::waferVAbs ( ) const
inline

Definition at line 75 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalWaferVMask, and kHGCalWaferVOffset.

Referenced by waferV().

75 { return (id_ >> kHGCalWaferVOffset) & kHGCalWaferVMask; }
static const int kHGCalWaferVOffset
static const int kHGCalWaferVMask
uint32_t id_
Definition: DetId.h:69

◆ waferX()

int HGCSiliconDetId::waferX ( ) const
inline

Definition at line 79 of file HGCSiliconDetId.h.

References waferU(), and waferV().

Referenced by waferXY().

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

◆ waferXY()

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

Definition at line 81 of file HGCSiliconDetId.h.

References waferX(), and waferY().

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

◆ waferY()

int HGCSiliconDetId::waferY ( ) const
inline

Definition at line 80 of file HGCSiliconDetId.h.

References waferV().

Referenced by waferXY().

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

◆ 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

Definition at line 125 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and type().

◆ kHGCalTypeOffset

const int HGCSiliconDetId::kHGCalTypeOffset = 26
static

Definition at line 124 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and type().

◆ 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.