CMS 3D CMS Logo

HGCTriggerDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
6 const uint32_t HGCTriggerDetId::cell_shift;
7 const uint32_t HGCTriggerDetId::cell_mask;
8 const uint32_t HGCTriggerDetId::module_mask;
9 const uint32_t HGCTriggerDetId::module_shift;
10 const uint32_t HGCTriggerDetId::sector_shift;
11 const uint32_t HGCTriggerDetId::sector_mask;
12 const uint32_t HGCTriggerDetId::layer_shift;
13 const uint32_t HGCTriggerDetId::layer_mask;
14 const uint32_t HGCTriggerDetId::zside_shift;
15 const uint32_t HGCTriggerDetId::zside_mask;
16 
18 
20 
21 HGCTriggerDetId::HGCTriggerDetId(uint32_t rawid) : DetId(rawid) {}
22 
23 HGCTriggerDetId::HGCTriggerDetId(ForwardSubdetector subdet, int zp, int lay, int sec, int mod, int cell)
24  : DetId(Forward, subdet) {
25  if (zp < 0)
26  zp = 0;
27 
33 }
34 
36  if (!gen.null()) {
38  if (gen.det() != Forward || (subdet != HGCTrigger)) {
39  throw cms::Exception("Invalid DetId")
40  << "Cannot initialize HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
41  }
42  }
43  id_ = gen.rawId();
44 }
45 
47  if (!gen.null()) {
49  if (gen.det() != Forward || (subdet != HGCTrigger)) {
50  throw cms::Exception("Invalid DetId")
51  << "Cannot assign HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
52  }
53  }
54  id_ = gen.rawId();
55  return (*this);
56 }
57 
58 std::ostream& operator<<(std::ostream& s, const HGCTriggerDetId& id) {
59  switch (id.subdet()) {
60  case (HGCTrigger):
61  return s << "isEE=" << id.isEE() << " zpos=" << id.zside() << " layer=" << id.layer() << " module=" << id.module()
62  << " sector=" << id.sector() << " cell=" << id.cell();
63  default:
64  return s << id.rawId();
65  }
66 }
HGCTriggerDetId::layer_shift
const static uint32_t layer_shift
Definition: HGCTriggerDetId.h:20
HGCTriggerDetId.h
ForwardEmpty
Definition: ForwardSubdetector.h:5
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCTriggerDetId::module_shift
const static uint32_t module_shift
Definition: HGCTriggerDetId.h:17
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
HGCTriggerDetId::cell_mask
const static uint32_t cell_mask
Definition: HGCTriggerDetId.h:15
HGCTriggerDetId::HGCTriggerDetId
HGCTriggerDetId()
Definition: HGCTriggerDetId.cc:19
HGCTriggerDetId
Definition: HGCTriggerDetId.h:8
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCTriggerDetId::module_mask
const static uint32_t module_mask
Definition: HGCTriggerDetId.h:16
gen
Definition: PythiaDecays.h:13
HGCTriggerDetId::setMaskedId
void setMaskedId(const uint32_t value, const uint32_t &shift, const uint32_t &mask)
Definition: HGCTriggerDetId.h:26
HGCTriggerDetId::zside_shift
const static uint32_t zside_shift
Definition: HGCTriggerDetId.h:22
HGCTriggerDetId::Undefined
static const HGCTriggerDetId Undefined
Definition: HGCTriggerDetId.h:74
HGCTriggerDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCTriggerDetId.h:56
DetId::id_
uint32_t id_
Definition: DetId.h:69
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
HGCTrigger
Definition: ForwardSubdetector.h:12
Exception
Definition: hltDiff.cc:245
HGCTriggerDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCTriggerDetId.h:53
HGCTriggerDetId::operator=
HGCTriggerDetId & operator=(const DetId &id)
Definition: HGCTriggerDetId.cc:46
Exception.h
HGCTriggerDetId::zside_mask
const static uint32_t zside_mask
Definition: HGCTriggerDetId.h:23
HGCTriggerDetId::sector_shift
const static uint32_t sector_shift
Definition: HGCTriggerDetId.h:18
HGCTriggerDetId::layer_mask
const static uint32_t layer_mask
Definition: HGCTriggerDetId.h:21
HGCTriggerDetId::sector_mask
const static uint32_t sector_mask
Definition: HGCTriggerDetId.h:19
DetId::Forward
Definition: DetId.h:30
HGCTriggerDetId::cell_shift
const static uint32_t cell_shift
Definition: HGCTriggerDetId.h:14
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
operator<<
std::ostream & operator<<(std::ostream &s, const HGCTriggerDetId &id)
Definition: HGCTriggerDetId.cc:58