Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
SimDataFormats
EcalTestBeam
src
HodoscopeDetId.cc
Go to the documentation of this file.
1
#include "
SimDataFormats/EcalTestBeam/interface/HodoscopeDetId.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
#include <iostream>
5
HodoscopeDetId::HodoscopeDetId
() :
EBDetId
() {}
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
19
HodoscopeDetId::HodoscopeDetId
(
const
DetId
&
gen
) :
EBDetId
(gen) {
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
}
HodoscopeDetId::validDetId
static bool validDetId(int iPlane, int iFibr)
Definition:
HodoscopeDetId.cc:25
EBDetId
Definition:
EBDetId.h:17
Exception
Definition:
hltDiff.cc:245
HodoscopeDetId
Definition:
HodoscopeDetId.h:20
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition:
ALILine.cc:167
relval_steps.gen
def gen
Definition:
relval_steps.py:517
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition:
EBDetId.h:51
HodoscopeDetId::HodoscopeDetId
HodoscopeDetId()
Definition:
HodoscopeDetId.cc:5
HodoscopeDetId::MAX_FIBR
static const int MAX_FIBR
Definition:
HodoscopeDetId.h:38
HodoscopeDetId.h
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition:
EBDetId.h:49
DetId
Definition:
DetId.h:17
Exception.h
HodoscopeDetId::fibrId
int fibrId() const
Definition:
HodoscopeDetId.cc:11
alignCSCRings.s
list s
Definition:
alignCSCRings.py:92
HodoscopeDetId::MAX_PLANE
static const int MAX_PLANE
Definition:
HodoscopeDetId.h:36
HodoscopeDetId::planeId
int planeId() const
Definition:
HodoscopeDetId.cc:9
Generated for CMSSW Reference Manual by
1.8.5