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>
6 }
7 
8 HodoscopeDetId::HodoscopeDetId(uint32_t rawid) : DetId(rawid) {
9 }
10 
11 // use the LaserPnDiode as sub-detector to avoid to create a new one
12 
13 HodoscopeDetId::HodoscopeDetId(int indexPlane, int indexFibr)
14  : DetId(Ecal,EcalLaserPnDiode)
15 {
16  int iPlane = indexPlane;
17  int iFibr = indexFibr;
18  if (iPlane < MIN_PLANE || iPlane > MAX_PLANE ||
19  iFibr < MIN_FIBR || iFibr > MAX_FIBR) {
20  throw cms::Exception("InvalidDetId") << "HodoscopeDetId: Cannot create object. Indexes out of bounds.";
21  }
22  id_ |= ((iPlane&0x3) | ((iFibr&0x3F)<<2)) ;
23 }
24 
26  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode )) {
27  throw cms::Exception("InvalidDetId");
28  }
29  id_=gen.rawId();
30 }
31 
33  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode )) {
34  throw cms::Exception("InvalidDetId");
35  }
36  id_=gen.rawId();
37  return *this;
38 }
39 
40 std::ostream& operator<<(std::ostream& s,const HodoscopeDetId& id) {
41  return s << "(Plane " << id.planeId() << ", fiber " << id.fibrId() << ')';
42 }
43 
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
HodoscopeDetId & operator=(const DetId &id)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
static const int MAX_FIBR
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
uint32_t id_
Definition: DetId.h:57
bool null() const
is this a null id ?
Definition: DetId.h:47
static const int MAX_PLANE
string s
Definition: asciidump.py:422
Detector det() const
get the detector field from this detid
Definition: DetId.h:37