CMS 3D CMS Logo

HcalTrigTowerDetId.cc
Go to the documentation of this file.
4 
6 
8 
9 HcalTrigTowerDetId::HcalTrigTowerDetId(uint32_t rawid) : DetId(rawid) {}
10 
12  id_ |=
13  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) | (iphi & kHcalPhiMask);
14  // Default to depth = 0 & version = 0
15 }
16 
18  const int ones = depth % 10;
19  const int tens = (depth - ones) / 10;
20  // version convension 0 : default for 3x2 TP; 1, 2, 3 : for future & currently version = 1 is for 1x1 TP
21  // Note that in this conversion, depth can take values from 0 to 9 for different purpose
22  // -> so depth should be = ones!
23  id_ |= ((ones & kHcalDepthMask) << kHcalDepthOffset) |
24  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) |
25  (iphi & kHcalPhiMask);
26 
27  const int version = tens;
28  if (version > 9) { // do NOT envision to have versions over 9...
29  edm::LogError("HcalTrigTowerDetId") << "in its ctor using depth, version larger than 9 (too many of it!)?"
30  << std::endl;
31  }
32 
34 }
35 
38  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) |
39  (iphi & kHcalPhiMask);
41 }
42 
44  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalTriggerTower)) {
45  throw cms::Exception("Invalid DetId")
46  << "Cannot initialize HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
47  }
48  id_ = gen.rawId();
49 }
50 
52 
54  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalTriggerTower)) {
55  throw cms::Exception("Invalid DetId")
56  << "Cannot assign HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
57  }
58  id_ = gen.rawId();
59  return *this;
60 }
61 
62 std::ostream& operator<<(std::ostream& s, const HcalTrigTowerDetId& id) {
63  s << "(HcalTrigTower v" << id.version() << ": " << id.ieta() << ',' << id.iphi();
64  if (id.depth() > 0)
65  s << ',' << id.depth();
66  return s << ')';
67 }
HcalTrigTowerDetId::kHcalPhiMask
static const int kHcalPhiMask
Definition: HcalTrigTowerDetId.h:16
MessageLogger.h
HcalTrigTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: HcalTrigTowerDetId.h:54
HcalTrigTowerDetId::operator=
HcalTrigTowerDetId & operator=(const DetId &id)
Definition: HcalTrigTowerDetId.cc:53
HcalTrigTowerDetId::kHcalDepthOffset
static const int kHcalDepthOffset
Definition: HcalTrigTowerDetId.h:20
DetId::Hcal
Definition: DetId.h:28
HcalTrigTowerDetId::kHcalEtaOffset
static const int kHcalEtaOffset
Definition: HcalTrigTowerDetId.h:17
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalTrigTowerDetId::HcalTrigTowerDetId
HcalTrigTowerDetId()
Definition: HcalTrigTowerDetId.cc:7
HcalTrigTowerDetId::kHcalVersOffset
static const int kHcalVersOffset
Definition: HcalTrigTowerDetId.h:22
HcalTrigTowerDetId::version
int version() const
get the version code for the trigger tower
Definition: HcalTrigTowerDetId.h:60
gen
Definition: PythiaDecays.h:13
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalTrigTowerDetId.h
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalTrigTowerDetId::setVersion
void setVersion(int version)
Definition: HcalTrigTowerDetId.cc:51
DetId::id_
uint32_t id_
Definition: DetId.h:69
HcalTrigTowerDetId::Undefined
static const HcalTrigTowerDetId Undefined
Definition: HcalTrigTowerDetId.h:62
HcalTrigTowerDetId::depth
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
Definition: HcalTrigTowerDetId.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalTrigTowerDetId::kHcalZsideMask
static const int kHcalZsideMask
Definition: HcalTrigTowerDetId.h:19
HcalTrigTowerDetId::kHcalDepthMask
static const int kHcalDepthMask
Definition: HcalTrigTowerDetId.h:21
HcalTrigTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: HcalTrigTowerDetId.h:56
Exception
Definition: hltDiff.cc:245
HcalTriggerTower
Definition: HcalAssistant.h:37
operator<<
std::ostream & operator<<(std::ostream &s, const HcalTrigTowerDetId &id)
Definition: HcalTrigTowerDetId.cc:62
Exception.h
HcalTrigTowerDetId::kHcalVersMask
static const int kHcalVersMask
Definition: HcalTrigTowerDetId.h:23
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14