Geometry
CSCGeometry
src
CSCChamber.cc
Go to the documentation of this file.
1
5
#include <
Geometry/CSCGeometry/interface/CSCChamber.h
>
6
#include <
Geometry/CSCGeometry/interface/CSCLayer.h
>
7
8
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
9
10
CSCChamber::~CSCChamber
() {
11
// Delete all layers
12
for
(std::vector<const CSCLayer*>::const_iterator
i
=
theComponents
.begin();
i
!=
theComponents
.end(); ++
i
) {
13
delete
(*i);
14
}
15
}
16
17
std::vector<const GeomDet*>
CSCChamber::components
()
const
{
18
return
std::vector<const GeomDet*>(
theComponents
.begin(),
theComponents
.end());
19
}
20
21
const
GeomDet
*
CSCChamber::component
(
DetId
id
)
const
{
return
layer
(
CSCDetId
(
id
.rawId())); }
22
23
void
CSCChamber::addComponent
(
int
n
,
const
CSCLayer
* gd) {
24
if
((
n
> 0) && (
n
< 7))
25
theComponents
[
n
- 1] = gd;
26
else
27
edm::LogError
(
"CSC"
) <<
"Each chamber has only SIX layers."
;
28
}
29
30
const
CSCLayer
*
CSCChamber::layer
(
CSCDetId
iid)
const
{
31
if
(iid.
chamberId
() !=
id
())
32
return
nullptr
;
// not in this chamber
33
return
layer
(iid.
layer
());
34
}
35
36
const
CSCLayer
*
CSCChamber::layer
(
int
ilay)
const
{
37
if
((ilay > 0) && (ilay < 7))
38
return
theComponents
[ilay - 1];
39
else
{
40
return
nullptr
;
41
}
42
}
mps_fire.i
i
Definition:
mps_fire.py:355
MessageLogger.h
CSCChamber::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition:
CSCChamber.cc:30
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
GeomDet
Definition:
GeomDet.h:27
CSCChamber::theComponents
std::vector< const CSCLayer * > theComponents
Definition:
CSCChamber.h:64
CSCChamber::addComponent
void addComponent(int n, const CSCLayer *gd)
Add a layer.
Definition:
CSCChamber.cc:23
CSCLayer
Definition:
CSCLayer.h:24
DetId
Definition:
DetId.h:17
CSCDetId::layer
int layer() const
Definition:
CSCDetId.h:56
edm::LogError
Definition:
MessageLogger.h:183
CSCDetId
Definition:
CSCDetId.h:26
CSCDetId::chamberId
CSCDetId chamberId() const
Definition:
CSCDetId.h:47
CSCChamber::~CSCChamber
~CSCChamber() override
Definition:
CSCChamber.cc:10
CSCLayer.h
CSCChamber::components
std::vector< const GeomDet * > components() const override
Return the layers in this chamber.
Definition:
CSCChamber.cc:17
CSCChamber.h
CSCChamber::id
CSCDetId id() const
Get the (concrete) DetId.
Definition:
CSCChamber.h:34
CSCChamber::component
const GeomDet * component(DetId id) const override
Return the layer with a given id in this chamber.
Definition:
CSCChamber.cc:21
Generated for CMSSW Reference Manual by
1.8.16