test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastTimeDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
6 const FastTimeDetId FastTimeDetId::Undefined(0x60000000u);
7 
9 
10 FastTimeDetId::FastTimeDetId(uint32_t rawid) : DetId(rawid) { }
11 
12 FastTimeDetId::FastTimeDetId(int module_ix, int module_iy, int iz) : DetId(Forward,FastTime) {
13  id_ |= (((module_iy&kFastTimeCellYMask)<<kFastTimeCellYOffset) |
15  ((iz>0)?(0x10000):(0)));
16 }
17 
19  if (!gen.null()) {
21  if (gen.det()!=Forward || (subdet!=FastTime)) {
22  throw cms::Exception("Invalid DetId") << "Cannot initialize FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
23  }
24  }
25  id_ = gen.rawId();
26 }
27 
29  if (!gen.null()) {
31  if (gen.det()!=Forward || (subdet!=FastTime)) {
32  throw cms::Exception("Invalid DetId") << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36  return (*this);
37 }
38 
39 std::ostream& operator<<(std::ostream& s,const FastTimeDetId& id) {
40  return s << "(FastTime iz "<< ((id.zside()>0)?("+ "):("- "))
41  << " ix " << id.ix() << ", iy " << id.iy() << ')';
42 }
FastTimeDetId & operator=(const DetId &id)
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:32
static const int kFastTimeCellXOffset
Definition: FastTimeDetId.h:11
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
ForwardSubdetector
static const int kFastTimeCellYMask
Definition: FastTimeDetId.h:14
static const FastTimeDetId Undefined
Definition: FastTimeDetId.h:47
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:55
bool null() const
is this a null id ?
Definition: DetId.h:45
static const int kFastTimeCellXMask
Definition: FastTimeDetId.h:12
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static const int kFastTimeCellYOffset
Definition: FastTimeDetId.h:13