CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Static Private 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...
 
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 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
 

Static Private Attributes

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
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 22 of file HGCSiliconDetId.h.

Member Enumeration Documentation

Enumerator
HGCalFine 
HGCalCoarseThin 
HGCalCoarseThick 

Definition at line 26 of file HGCSiliconDetId.h.

Constructor & Destructor Documentation

HGCSiliconDetId::HGCSiliconDetId ( )

Create a null cellid

Definition at line 8 of file HGCSiliconDetId.cc.

Referenced by geometryCell().

8  : DetId() {
9 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HGCSiliconDetId::HGCSiliconDetId ( uint32_t  rawid)

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

Definition at line 11 of file HGCSiliconDetId.cc.

11  : DetId(rawid) {
12 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
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 14 of file HGCSiliconDetId.cc.

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

16  : DetId(det,ForwardEmpty) {
17 
18  int waferUabs(std::abs(waferU)), waferVabs(std::abs(waferV));
19  int waferUsign = (waferU >= 0) ? 0 : 1;
20  int waferVsign = (waferV >= 0) ? 0 : 1;
21  int zside = (zp < 0) ? 1 : 0;
24  ((waferUabs & kHGCalWaferUMask) << kHGCalWaferUOffset) |
25  ((waferUsign& kHGCalWaferUSignMask) << kHGCalWaferUSignOffset) |
26  ((waferVabs & kHGCalWaferVMask) << kHGCalWaferVOffset) |
27  ((waferVsign& kHGCalWaferVSignMask) << kHGCalWaferVSignOffset) |
29  ((zside & kHGCalZsideMask) << kHGCalZsideOffset) |
31 }
type
Definition: HCALResponse.h:21
static const int kHGCalWaferVOffset
static const int kHGCalTypeMask
int waferU() const
int cellV() const
static const int kHGCalWaferVSignOffset
static const int kHGCalCellUMask
int zside() const
get the z-side of the cell (1/-1)
static const int kHGCalCellVOffset
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int kHGCalTypeOffset
static const int kHGCalCellVMask
static const int kHGCalZsideOffset
int layer() const
get the layer #
int waferV() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalLayerMask
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
static const int kHGCalZsideMask
static const int kHGCalWaferVSignMask
uint32_t id_
Definition: DetId.h:59
static const int kHGCalCellUOffset
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:30
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
HGCSiliconDetId::HGCSiliconDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 33 of file HGCSiliconDetId.cc.

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

33  {
34  if (!gen.null()) {
35  if ((gen.det()!=HGCalEE) && (gen.det()!=HGCalHSi)) {
36  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCSiliconDetId from " << std::hex << gen.rawId() << std::dec;
37  }
38  }
39  id_ = gen.rawId();
40 }
uint32_t id_
Definition: DetId.h:59

Member Function Documentation

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 HGCalSimHitValidation::analyzeHits(), cellUV(), cellY(), triggerCellU(), and triggerCellV().

static const int kHGCalCellUMask
uint32_t id_
Definition: DetId.h:59
static const int kHGCalCellUOffset
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 cellV() const
int cellU() const
get the cell #&#39;s in u,v or in x,y
int HGCSiliconDetId::cellV ( ) const
inline

Definition at line 61 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalCellVMask, and kHGCalCellVOffset.

Referenced by HGCalSimHitValidation::analyzeHits(), cellUV(), cellX(), cellY(), triggerCellU(), and triggerCellV().

static const int kHGCalCellVOffset
static const int kHGCalCellVMask
uint32_t id_
Definition: DetId.h:59
int HGCSiliconDetId::cellX ( ) const
inline

Definition at line 63 of file HGCSiliconDetId.h.

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

Referenced by cellXY().

63  {
64  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
65  return (3*(cellV()-N)+2);
66  }
int cellV() const
static const int HGCalFineN
int type() const
get the type
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
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
int HGCSiliconDetId::cellY ( ) const
inline

Definition at line 67 of file HGCSiliconDetId.h.

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

Referenced by cellXY().

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

Converter for a geometry cell id

Definition at line 45 of file HGCSiliconDetId.h.

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

Referenced by HGCalGeometry::getGeometry(), HGCalGeometry::indexFor(), HGCalGeometry::newCell(), and HGCalGeometry::present().

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

consistency check : no bits left => no overhead

Definition at line 103 of file HGCSiliconDetId.h.

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

103 { return (det() == HGCalEE); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
bool HGCSiliconDetId::isForward ( ) const
inline

Definition at line 105 of file HGCSiliconDetId.h.

105 { return true; }
bool HGCSiliconDetId::isHE ( ) const
inline

Definition at line 104 of file HGCSiliconDetId.h.

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

104 { return (det() == HGCalHSi); }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
int HGCSiliconDetId::layer ( ) const
inline
HGCSiliconDetId & HGCSiliconDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 42 of file HGCSiliconDetId.cc.

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

42  {
43  if (!gen.null()) {
44  if ((gen.det()!=HGCalEE) && (gen.det()!=HGCalHSi)) {
45  throw cms::Exception("Invalid DetId") << "Cannot assign HGCSiliconDetId from " << std::hex << gen.rawId() << std::dec;
46  }
47  }
48  id_ = gen.rawId();
49  return (*this);
50 }
uint32_t id_
Definition: DetId.h:59
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:39
int HGCSiliconDetId::triggerCellU ( ) const
inline

Definition at line 84 of file HGCSiliconDetId.h.

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

Referenced by triggerCellUV().

84  {
85  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
87  return (cellU() >= N && cellV() >= N) ? cellU()/NT :
88  ((cellU() < N && cellU() <= cellV()) ? cellU()/NT :
89  (1+(cellU()-(cellV()%NT+1))/NT));
90  }
int cellV() const
static const int HGCalFineN
int cellU() const
get the cell #&#39;s in u,v or in x,y
int type() const
get the type
static const int HGCalCoarseTrigger
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
static const int HGCalFineTrigger
std::pair<int,int> HGCSiliconDetId::triggerCellUV ( ) const
inline

Definition at line 98 of file HGCSiliconDetId.h.

References triggerCellU(), and triggerCellV().

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

Definition at line 91 of file HGCSiliconDetId.h.

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

Referenced by triggerCellUV().

91  {
92  int N = (type() == HGCalFine) ? HGCalFineN : HGCalCoarseN;
94  return (cellU() >= N && cellV() >= N) ? cellV()/NT :
95  ((cellU() < N && cellU() <= cellV()) ? ((cellV()-cellU())/NT+cellU()/NT) :
96  cellV()/NT);
97  }
int cellV() const
static const int HGCalFineN
int cellU() const
get the cell #&#39;s in u,v or in x,y
int type() const
get the type
static const int HGCalCoarseTrigger
static const int HGCalCoarseN
#define N
Definition: blowfish.cc:9
static const int HGCalFineTrigger
int HGCSiliconDetId::type ( ) const
inline
int HGCSiliconDetId::waferU ( ) const
inline

Definition at line 76 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalWaferUSignMask, kHGCalWaferUSignOffset, and waferUAbs().

Referenced by HGCalSimHitValidation::analyzeHits(), geometryCell(), hgcal::RecHitTools::getSiThickness(), waferUV(), and waferX().

static const int kHGCalWaferUSignMask
uint32_t id_
Definition: DetId.h:59
int waferUAbs() const
get the wafer #&#39;s in u,v or in x,y
static const int kHGCalWaferUSignOffset
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().

static const int kHGCalWaferUMask
uint32_t id_
Definition: DetId.h:59
static const int kHGCalWaferUOffset
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
int HGCSiliconDetId::waferV ( ) const
inline
int HGCSiliconDetId::waferVAbs ( ) const
inline

Definition at line 75 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalWaferVMask, and kHGCalWaferVOffset.

Referenced by waferV().

static const int kHGCalWaferVOffset
static const int kHGCalWaferVMask
uint32_t id_
Definition: DetId.h:59
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
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
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
int HGCSiliconDetId::zside ( ) const
inline

get the z-side of the cell (1/-1)

Definition at line 54 of file HGCSiliconDetId.h.

References DetId::id_, kHGCalZsideMask, and kHGCalZsideOffset.

Referenced by HGCalSimHitValidation::analyzeHits(), geometryCell(), HGCSiliconDetId(), and hgcal::RecHitTools::zside().

54 { return (((id_>>kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }
static const int kHGCalZsideOffset
static const int kHGCalZsideMask
uint32_t id_
Definition: DetId.h:59

Member Data Documentation

const int HGCSiliconDetId::HGCalCoarseN =8
static

Definition at line 28 of file HGCSiliconDetId.h.

const int HGCSiliconDetId::HGCalCoarseTrigger =2
static
const int HGCSiliconDetId::HGCalFineN =12
static

Definition at line 27 of file HGCSiliconDetId.h.

const int HGCSiliconDetId::HGCalFineTrigger =3
static
const int HGCSiliconDetId::kHGCalCellUMask = 0x1F
staticprivate

Definition at line 112 of file HGCSiliconDetId.h.

Referenced by cellU(), and HGCSiliconDetId().

const int HGCSiliconDetId::kHGCalCellUOffset = 0
staticprivate

Definition at line 111 of file HGCSiliconDetId.h.

Referenced by cellU(), and HGCSiliconDetId().

const int HGCSiliconDetId::kHGCalCellVMask = 0x1F
staticprivate

Definition at line 114 of file HGCSiliconDetId.h.

Referenced by cellV(), and HGCSiliconDetId().

const int HGCSiliconDetId::kHGCalCellVOffset = 5
staticprivate

Definition at line 113 of file HGCSiliconDetId.h.

Referenced by cellV(), and HGCSiliconDetId().

const int HGCSiliconDetId::kHGCalLayerMask = 0x1F
staticprivate

Definition at line 124 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and layer().

const int HGCSiliconDetId::kHGCalLayerOffset = 20
staticprivate

Definition at line 123 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and layer().

const int HGCSiliconDetId::kHGCalTypeMask = 0x3
staticprivate

Definition at line 128 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and type().

const int HGCSiliconDetId::kHGCalTypeOffset = 26
staticprivate

Definition at line 127 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and type().

const int HGCSiliconDetId::kHGCalWaferUMask = 0xF
staticprivate

Definition at line 116 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferUAbs().

const int HGCSiliconDetId::kHGCalWaferUOffset = 10
staticprivate

Definition at line 115 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferUAbs().

const int HGCSiliconDetId::kHGCalWaferUSignMask = 0x1
staticprivate

Definition at line 118 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferU().

const int HGCSiliconDetId::kHGCalWaferUSignOffset = 14
staticprivate

Definition at line 117 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferU().

const int HGCSiliconDetId::kHGCalWaferVMask = 0xF
staticprivate

Definition at line 120 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferVAbs().

const int HGCSiliconDetId::kHGCalWaferVOffset = 15
staticprivate

Definition at line 119 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferVAbs().

const int HGCSiliconDetId::kHGCalWaferVSignMask = 0x1
staticprivate

Definition at line 122 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferV().

const int HGCSiliconDetId::kHGCalWaferVSignOffset = 19
staticprivate

Definition at line 121 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and waferV().

const int HGCSiliconDetId::kHGCalZsideMask = 0x1
staticprivate

Definition at line 126 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and zside().

const int HGCSiliconDetId::kHGCalZsideOffset = 25
staticprivate

Definition at line 125 of file HGCSiliconDetId.h.

Referenced by HGCSiliconDetId(), and zside().

const HGCSiliconDetId HGCSiliconDetId::Undefined
static

Definition at line 107 of file HGCSiliconDetId.h.