CMS 3D CMS Logo

CaloTowerDetId.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6 
7 CaloTowerDetId::CaloTowerDetId(uint32_t rawid) : DetId(rawid & 0xFFF0FFFFu) {}
8 
10  id_ |= ((ieta > 0) ? (0x2000 | ((ieta & 0x3F) << 7)) : (((-ieta) & 0x3f) << 7)) | (iphi & 0x7F);
11 }
12 
14  if (!gen.null() && (gen.det() != Calo || gen.subdetId() != SubdetId)) {
15  throw cms::Exception("Invalid DetId")
16  << "Cannot initialize CaloTowerDetId from " << std::hex << gen.rawId() << std::dec;
17  }
18  id_ = gen.rawId();
19 }
20 
22  if (!gen.null() && (gen.det() != Calo || gen.subdetId() != SubdetId)) {
23  throw cms::Exception("Invalid DetId")
24  << "Cannot assign CaloTowerDetId from " << std::hex << gen.rawId() << std::dec;
25  }
26  id_ = gen.rawId();
27  return *this;
28 }
29 
30 int CaloTowerDetId::iphi() const {
31  int retval = id_ & 0x7F;
32  return retval;
33 }
34 
35 std::ostream& operator<<(std::ostream& s, const CaloTowerDetId& id) {
36  return s << "Tower (" << id.ieta() << "," << id.iphi() << ")";
37 }
CaloTowerDetId::SubdetId
static const int SubdetId
Definition: CaloTowerDetId.h:34
DetId::Calo
Definition: DetId.h:29
CaloTowerDetId::operator=
CaloTowerDetId & operator=(const DetId &id)
Definition: CaloTowerDetId.cc:21
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
gen
Definition: PythiaDecays.h:13
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
DetId::id_
uint32_t id_
Definition: DetId.h:69
dumpRecoGeometry_cfg.Calo
Calo
Definition: dumpRecoGeometry_cfg.py:191
CaloTowerDetId.h
CaloTowerDetId::CaloTowerDetId
CaloTowerDetId()
Definition: CaloTowerDetId.cc:5
CaloTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: CaloTowerDetId.cc:30
CaloTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: CaloTowerDetId.h:30
operator<<
std::ostream & operator<<(std::ostream &s, const CaloTowerDetId &id)
Definition: CaloTowerDetId.cc:35
Exception
Definition: hltDiff.cc:246
Exception.h
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CaloTowerDetId
Definition: CaloTowerDetId.h:12