CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTrigTowerDetId.cc
Go to the documentation of this file.
3 
5 
7 }
8 
9 
11 }
12 
14  id_|=((ieta>0)?(0x2000|(ieta<<7)):((-ieta)<<7)) |
15  (iphi&0x7F);
16 }
17 
18 HcalTrigTowerDetId::HcalTrigTowerDetId(int ieta, int iphi, int depth) : DetId(Hcal,HcalTriggerTower) {
19  id_|=((depth&0x7)<<14) |
20  ((ieta>0)?(0x2000|(ieta<<7)):((-ieta)<<7)) |
21  (iphi&0x7F);
22 }
23 
25  if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalTriggerTower)) {
26  throw cms::Exception("Invalid DetId") << "Cannot initialize HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
27  }
28  id_=gen.rawId();
29 }
30 
32  if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalTriggerTower)) {
33  throw cms::Exception("Invalid DetId") << "Cannot assign HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
34  }
35  id_=gen.rawId();
36  return *this;
37 }
38 
39 std::ostream& operator<<(std::ostream& s,const HcalTrigTowerDetId& id) {
40  s << "(HcalTrigTower " << id.ieta() << ',' << id.iphi();
41  if (id.depth()>0) s << ',' << id.depth();
42 
43  return s << ')';
44 }
45 
46 
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
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
HcalTrigTowerDetId & operator=(const DetId &id)
uint32_t id_
Definition: DetId.h:55
bool null() const
is this a null id ?
Definition: DetId.h:45
static const HcalTrigTowerDetId Undefined
Detector det() const
get the detector field from this detid
Definition: DetId.h:35