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,
13  int module_zside) : DetId(Forward,FastTime) {
14  int zsid = (module_zside>0) ? (kFastTimeZsideMask) : (0);
15  id_ |= (((module_type&kFastTimeTypeMask)<<kFastTimeTypeOffset) |
18  (zsid<<kFastTimeZsideOffset));
19 }
20 
22  if (!gen.null()) {
24  if (gen.det()!=Forward || (subdet!=FastTime)) {
25  throw cms::Exception("Invalid DetId") << "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") << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
36  }
37  }
38  id_ = gen.rawId();
39  return (*this);
40 }
41 
42 std::ostream& operator<<(std::ostream& s,const FastTimeDetId& id) {
43  return s << "(FastTime " << id.type() << ", iz "<< ((id.zside()>0)?("+ "):("- "))
44  << " iz/ieta " << id.iz() << ", iphi " << id.iphi() << ")";
45 }
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:18
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:17
FastTimeDetId & operator=(const DetId &id)
std::ostream & operator<<(std::ostream &s, const FastTimeDetId &id)
constexpr bool null() const
is this a null id ?
Definition: DetId.h:52
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:36
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:16
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:14
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:11
ForwardSubdetector
static const FastTimeDetId Undefined
Definition: FastTimeDetId.h:55
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:12
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:15
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:62
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:13
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39