CMS 3D CMS Logo

HGCScintillatorDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
7 
9 }
10 
12 }
13 
15  int phi) : DetId(HGCalHSc,ForwardEmpty) {
16 
17  int zside = (radius < 0) ? 1 : 0;
18  int radiusAbs = std::abs(radius);
19  id_ |= (((type&kHGCalTypeMask)<<kHGCalTypeOffset) |
22  ((radiusAbs&kHGCalRadiusMask)<<kHGCalRadiusOffset) |
24 }
25 
27  if (!gen.null()) {
28  if (gen.det()!=HGCalHSc) {
29  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
30  }
31  }
32  id_ = gen.rawId();
33 }
34 
36  if (!gen.null()) {
37  if (gen.det()!=HGCalHSc) {
38  throw cms::Exception("Invalid DetId") << "Cannot assign HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
39  }
40  }
41  id_ = gen.rawId();
42  return (*this);
43 }
44 
45 std::ostream& operator<<(std::ostream& s,const HGCScintillatorDetId& id) {
46  return s << " HGCScintillatorDetId::EE:HE= " << id.isEE() << ":" << id.isHE()
47  << " type= " << id.type() << " layer= " << id.layer()
48  << " radius= " << id.iradius() << " phi= " << id.iphi();
49 }
type
Definition: HCALResponse.h:21
constexpr bool null() const
is this a null id ?
Definition: DetId.h:52
static const int kHGCalTypeOffset
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
HGCScintillatorDetId & operator=(const DetId &id)
std::ostream & operator<<(std::ostream &s, const HGCScintillatorDetId &id)
static const int kHGCalLayerMask
static const int kHGCalRadiusOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const HGCScintillatorDetId Undefined
Definition: DetId.h:18
static const int kHGCalRadiusMask
uint32_t id_
Definition: DetId.h:62
static const int kHGCalPhiMask
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
static const int kHGCalZsideMask
static const int kHGCalZsideOffset
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
static const int kHGCalPhiOffset
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39