CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HodoscopeDetId.cc
Go to the documentation of this file.
3 
4 #include <iostream>
7 {
8 }
9 
10 HodoscopeDetId::HodoscopeDetId( uint32_t rawid ) :
11  CaloTowerDetId( rawid )
12 {
13 }
14 
15 int
17 {
18  return ieta() ;
19 }
20 
21 int
23 {
24  return iphi() ;
25 }
26 
28  int iFibr )
29  : CaloTowerDetId( iPlane, iFibr )
30 {
31  if( !validDetId( iPlane, iFibr ) )
32  {
33  throw cms::Exception("InvalidDetId")
34  << "HodoscopeDetId: Cannot create object. Indices out of bounds.";
35  }
36 }
37 
39  CaloTowerDetId( gen )
40 {
41  if( !validDetId( planeId(), fibrId() ) )
42  {
43  throw cms::Exception("InvalidDetId")
44  << "HodoscopeDetId: Cannot create object. Indices out of bounds.";
45  }
46 }
47 
48 bool
50  int iFibr )
51 {
52  return !( iPlane < MIN_PLANE ||
53  iPlane > MAX_PLANE ||
54  iFibr < MIN_FIBR ||
55  iFibr > MAX_FIBR ) ;
56 }
57 
58 std::ostream& operator<<(std::ostream& s,const HodoscopeDetId& id)
59 {
60  return s << "(Plane " << id.planeId() << ", fiber " << id.fibrId() << ')';
61 }
62 
static bool validDetId(int iPlane, int iFibr)
static const int MIN_FIBR
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int MAX_FIBR
int iphi() const
get the tower iphi
Definition: DetId.h:18
int fibrId() const
static const int MAX_PLANE
int planeId() const
int ieta() const
get the tower ieta
static const int MIN_PLANE
range constants