CMS 3D CMS Logo

FastTimeDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
7 
9 
10 FastTimeDetId::FastTimeDetId(uint32_t rawid) : DetId(rawid) {}
11 
12 FastTimeDetId::FastTimeDetId(int module_type, int module_iz, int module_iphi, int module_zside)
13  : DetId(Forward, FastTime) {
14  int zsid = (module_zside > 0) ? (kFastTimeZsideMask) : (0);
15  id_ |= (((module_type & kFastTimeTypeMask) << kFastTimeTypeOffset) |
16  ((module_iz & kFastTimeCellZMask) << kFastTimeCellZOffset) |
17  ((module_iphi & kFastTimeCellPhiMask) << kFastTimeCellPhiOffset) | (zsid << kFastTimeZsideOffset));
18 }
19 
21  if (!gen.null()) {
23  if (gen.det() != Forward || (subdet != FastTime)) {
24  throw cms::Exception("Invalid DetId")
25  << "Cannot initialize FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
26  }
27  }
28  id_ = gen.rawId();
29 }
30 
32  if (!gen.null()) {
34  if (gen.det() != Forward || (subdet != FastTime)) {
35  throw cms::Exception("Invalid DetId")
36  << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
37  }
38  }
39  id_ = gen.rawId();
40  return (*this);
41 }
42 
43 std::ostream& operator<<(std::ostream& s, const FastTimeDetId& id) {
44  return s << "(FastTime " << id.type() << ", iz " << ((id.zside() > 0) ? ("+ ") : ("- ")) << " iz/ieta " << id.iz()
45  << ", iphi " << id.iphi() << ")";
46 }
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
FastTimeDetId.h
FastTimeDetId::operator=
FastTimeDetId & operator=(const DetId &id)
Definition: FastTimeDetId.cc:31
FastTimeDetId::kFastTimeCellPhiMask
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:13
FastTimeDetId::kFastTimeTypeMask
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:17
FastTimeDetId::FastTimeDetId
FastTimeDetId()
Definition: FastTimeDetId.cc:8
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FastTimeDetId::Undefined
static const FastTimeDetId Undefined
Definition: FastTimeDetId.h:54
operator<<
std::ostream & operator<<(std::ostream &s, const FastTimeDetId &id)
Definition: FastTimeDetId.cc:43
gen
Definition: PythiaDecays.h:13
DetId::id_
uint32_t id_
Definition: DetId.h:69
FastTime
Definition: ForwardSubdetector.h:6
FastTimeDetId::kFastTimeZsideOffset
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:14
FastTimeDetId::kFastTimeCellZMask
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
Exception
Definition: hltDiff.cc:245
FastTimeDetId
Definition: FastTimeDetId.h:8
FastTimeDetId::kFastTimeCellPhiOffset
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:12
Exception.h
DetId::Forward
Definition: DetId.h:30
FastTimeDetId::kFastTimeZsideMask
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:15
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
FastTimeDetId::kFastTimeTypeOffset
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:16
FastTimeDetId::kFastTimeCellZOffset
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
FastTimeDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:35