CMS 3D CMS Logo

HodoscopeDetId.cc
Go to the documentation of this file.
3 
4 #include <iostream>
6 
7 HodoscopeDetId::HodoscopeDetId(uint32_t rawid) : EBDetId(rawid) {}
8 
9 int HodoscopeDetId::planeId() const { return ieta(); }
10 
11 int HodoscopeDetId::fibrId() const { return iphi(); }
12 
13 HodoscopeDetId::HodoscopeDetId(int iPlane, int iFibr) : EBDetId(iPlane, iFibr) {
14  if (!validDetId(iPlane, iFibr)) {
15  throw cms::Exception("InvalidDetId") << "HodoscopeDetId: Cannot create object. Indices out of bounds.";
16  }
17 }
18 
20  if (!validDetId(planeId(), fibrId())) {
21  throw cms::Exception("InvalidDetId") << "HodoscopeDetId: Cannot create object. Indices out of bounds.";
22  }
23 }
24 
25 bool HodoscopeDetId::validDetId(int iPlane, int iFibr) {
26  return !(iPlane < MIN_PLANE || iPlane > MAX_PLANE || iFibr < MIN_FIBR || iFibr > MAX_FIBR);
27 }
28 
29 std::ostream& operator<<(std::ostream& s, const HodoscopeDetId& id) {
30  return s << "(Plane " << id.planeId() << ", fiber " << id.fibrId() << ')';
31 }
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
EBDetId
Definition: EBDetId.h:17
HodoscopeDetId::MAX_FIBR
static const int MAX_FIBR
Definition: HodoscopeDetId.h:38
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
gen
Definition: PythiaDecays.h:13
HodoscopeDetId::MAX_PLANE
static const int MAX_PLANE
Definition: HodoscopeDetId.h:36
HodoscopeDetId.h
HodoscopeDetId::HodoscopeDetId
HodoscopeDetId()
Definition: HodoscopeDetId.cc:5
operator<<
std::ostream & operator<<(std::ostream &s, const HodoscopeDetId &id)
Definition: HodoscopeDetId.cc:29
HodoscopeDetId::fibrId
int fibrId() const
Definition: HodoscopeDetId.cc:11
HodoscopeDetId::planeId
int planeId() const
Definition: HodoscopeDetId.cc:9
Exception
Definition: hltDiff.cc:246
HodoscopeDetId
Definition: HodoscopeDetId.h:20
Exception.h
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
HodoscopeDetId::validDetId
static bool validDetId(int iPlane, int iFibr)
Definition: HodoscopeDetId.cc:25