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,HGCHEB) {
16 
17  id_ |= ((type&kHGCalTypeMask)<<kHGCalTypeOffset) |
19  ((eta<0)?(kHGCalZsideMask2|(-eta<<kHGCalEtaOffset)):(eta<<kHGCalEtaOffset)) |
21 }
22 
24  if (!gen.null()) {
25  if ((gen.det()!=HGCalHSc) ||
27  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
28  }
29  }
30  id_ = gen.rawId();
31 }
32 
34  if (!gen.null()) {
35  if ((gen.det()!=HGCalHSc) ||
37  throw cms::Exception("Invalid DetId") << "Cannot assign HGCScintillatorDetId from " << std::hex << gen.rawId() << std::dec;
38  }
39  }
40  id_ = gen.rawId();
41  return (*this);
42 }
43 
44 std::ostream& operator<<(std::ostream& s,const HGCScintillatorDetId& id) {
45  return s << " EE:HE= " << id.isEE() << ":" << id.isHE()
46  << " type= " << id.type() << " layer= " << id.layer()
47  << " eta= " << id.ieta() << " phi= " << id.iphi();
48 }
49 
50 
type
Definition: HCALResponse.h:21
static const int kHGCalTypeOffset
ForwardSubdetector
static const int kHGCalZsideMask2
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
static const int kHGCalEtaOffset
HGCScintillatorDetId & operator=(const DetId &id)
std::ostream & operator<<(std::ostream &s, const HGCScintillatorDetId &id)
static const int kHGCalLayerMask
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
static const HGCScintillatorDetId Undefined
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:56
bool null() const
is this a null id ?
Definition: DetId.h:46
static const int kHGCalPhiMask
int layer() const
get the layer #
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
Detector det() const
get the detector field from this detid
Definition: DetId.h:36
static const int kHGCalPhiOffset