CMS 3D CMS Logo

HFNoseDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
6 const HFNoseDetId HFNoseDetId::Undefined(0, 0, 0, 0, 0, 0, 0);
7 
9 
10 HFNoseDetId::HFNoseDetId(uint32_t rawid) : DetId(rawid) {}
11 
12 HFNoseDetId::HFNoseDetId(int zp, int type, int layer, int waferU, int waferV, int cellU, int cellV)
13  : DetId(Forward, HFNose) {
14  int waferUabs(std::abs(waferU)), waferVabs(std::abs(waferV));
15  int waferUsign = (waferU >= 0) ? 0 : 1;
16  int waferVsign = (waferV >= 0) ? 0 : 1;
17  int zside = (zp < 0) ? 1 : 0;
18  int lay = std::max(layer - 1, 0);
20  ((waferUabs & kHFNoseWaferUMask) << kHFNoseWaferUOffset) |
22  ((waferVabs & kHFNoseWaferVMask) << kHFNoseWaferVOffset) |
26 }
27 
29  if (!gen.null()) {
30  if (!((gen.det() == Forward) && (gen.subdetId() == (int)(HFNose)))) {
31  throw cms::Exception("Invalid DetId")
32  << "Cannot initialize HFNoseDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36 }
37 
39  if (!gen.null()) {
40  if (!((gen.det() == Forward) && (gen.subdetId() == (int)(HFNose)))) {
41  throw cms::Exception("Invalid DetId") << "Cannot assign HFNoseDetId from " << std::hex << gen.rawId() << std::dec;
42  }
43  }
44  id_ = gen.rawId();
45  return (*this);
46 }
47 
48 std::ostream& operator<<(std::ostream& s, const HFNoseDetId& id) {
49  return s << " HFNoseDetId::EE:HE= " << id.isEE() << ":" << id.isHE() << " type= " << id.type() << " z= " << id.zside()
50  << " layer= " << id.layer() << " wafer(u,v:x,y)= (" << id.waferU() << "," << id.waferV() << ":"
51  << id.waferX() << "," << id.waferY() << ")"
52  << " cell(u,v:x,y)= (" << id.cellU() << "," << id.cellV() << ":" << id.cellX() << "," << id.cellY() << ")";
53 }
HFNoseDetId::kHFNoseWaferUOffset
static const int kHFNoseWaferUOffset
Definition: HFNoseDetId.h:115
HFNoseDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:53
HFNoseDetId::Undefined
static const HFNoseDetId Undefined
Definition: HFNoseDetId.h:108
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
HFNoseDetId::kHFNoseCellUMask
static const int kHFNoseCellUMask
Definition: HFNoseDetId.h:112
HFNoseDetId::HFNoseDetId
HFNoseDetId()
Definition: HFNoseDetId.cc:8
HFNoseDetId::kHFNoseTypeOffset
static const int kHFNoseTypeOffset
Definition: HFNoseDetId.h:127
HFNoseDetId.h
HFNoseDetId
Definition: HFNoseDetId.h:22
HFNoseDetId::kHFNoseZsideMask
static const int kHFNoseZsideMask
Definition: HFNoseDetId.h:126
HFNoseDetId::waferU
int waferU() const
Definition: HFNoseDetId.h:75
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HFNoseDetId::kHFNoseLayerMask
static const int kHFNoseLayerMask
Definition: HFNoseDetId.h:124
HFNoseDetId::kHFNoseWaferUMask
static const int kHFNoseWaferUMask
Definition: HFNoseDetId.h:116
HFNoseDetId::kHFNoseTypeMask
static const int kHFNoseTypeMask
Definition: HFNoseDetId.h:128
HFNoseDetId::kHFNoseWaferUSignOffset
static const int kHFNoseWaferUSignOffset
Definition: HFNoseDetId.h:117
HFNoseDetId::kHFNoseWaferVOffset
static const int kHFNoseWaferVOffset
Definition: HFNoseDetId.h:119
HFNose
Definition: ForwardSubdetector.h:11
gen
Definition: PythiaDecays.h:13
HFNoseDetId::kHFNoseCellVMask
static const int kHFNoseCellVMask
Definition: HFNoseDetId.h:114
HFNoseDetId::kHFNoseZsideOffset
static const int kHFNoseZsideOffset
Definition: HFNoseDetId.h:125
DetId::id_
uint32_t id_
Definition: DetId.h:69
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
createfilelist.int
int
Definition: createfilelist.py:10
HFNoseDetId::kHFNoseWaferUSignMask
static const int kHFNoseWaferUSignMask
Definition: HFNoseDetId.h:118
HFNoseDetId::cellV
int cellV() const
Definition: HFNoseDetId.h:60
HFNoseDetId::kHFNoseWaferVSignOffset
static const int kHFNoseWaferVSignOffset
Definition: HFNoseDetId.h:121
HFNoseDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HFNoseDetId.h:59
HFNoseDetId::kHFNoseLayerOffset
static const int kHFNoseLayerOffset
Definition: HFNoseDetId.h:123
type
type
Definition: HCALResponse.h:21
HFNoseDetId::kHFNoseCellUOffset
static const int kHFNoseCellUOffset
Definition: HFNoseDetId.h:111
Exception
Definition: hltDiff.cc:246
HFNoseDetId::kHFNoseCellVOffset
static const int kHFNoseCellVOffset
Definition: HFNoseDetId.h:113
HFNoseDetId::operator=
HFNoseDetId & operator=(const DetId &id)
Definition: HFNoseDetId.cc:38
Exception.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
operator<<
std::ostream & operator<<(std::ostream &s, const HFNoseDetId &id)
Definition: HFNoseDetId.cc:48
HFNoseDetId::waferV
int waferV() const
Definition: HFNoseDetId.h:78
DetId::Forward
Definition: DetId.h:30
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HFNoseDetId::kHFNoseWaferVSignMask
static const int kHFNoseWaferVSignMask
Definition: HFNoseDetId.h:122
HFNoseDetId::kHFNoseWaferVMask
static const int kHFNoseWaferVMask
Definition: HFNoseDetId.h:120