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 = (eta < 0) ? 1 : 0;
18  int etaAbs = std::abs(eta);
19  id_ |= (((type&kHGCalTypeMask)<<kHGCalTypeOffset) |
22  ((etaAbs&kHGCalEtaMask)<<kHGCalEtaOffset) |
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 << " EE:HE= " << id.isEE() << ":" << id.isHE()
47  << " type= " << id.type() << " layer= " << id.layer()
48  << " eta= " << id.ieta() << " phi= " << id.iphi();
49 }
50 
51 
type
Definition: HCALResponse.h:21
constexpr bool null() const
is this a null id ?
Definition: DetId.h:49
static const int kHGCalTypeOffset
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
static const int kHGCalEtaOffset
HGCScintillatorDetId & operator=(const DetId &id)
std::ostream & operator<<(std::ostream &s, const HGCScintillatorDetId &id)
static const int kHGCalLayerMask
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalEtaMask
static const HGCScintillatorDetId Undefined
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:59
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