DataFormats
CSCRecHit
src
CSCRangeMapAccessor.cc
Go to the documentation of this file.
1
6
#include "
DataFormats/CSCRecHit/interface/CSCRangeMapAccessor.h
"
7
#include <cstdlib>
8
9
CSCRangeMapAccessor::CSCRangeMapAccessor
() {}
10
11
CSCRangeMapAccessor::~CSCRangeMapAccessor
() {}
12
13
std::pair<CSCDetId, CSCDetIdSameChamberComparator>
CSCRangeMapAccessor::cscChamber
(
CSCDetId
id
) {
14
return
std::make_pair(
id
,
CSCDetIdSameChamberComparator
());
15
}
16
17
std::pair<CSCDetId, CSCDetIdSameDetLayerComparator>
CSCRangeMapAccessor::cscDetLayer
(
CSCDetId
id
) {
18
return
std::make_pair(
id
,
CSCDetIdSameDetLayerComparator
());
19
}
20
21
bool
CSCDetIdSameChamberComparator::operator()
(
CSCDetId
i1
,
CSCDetId
i2
)
const
{
22
if
(
i1
.chamberId() ==
i2
.chamberId())
23
return
false
;
24
25
return
(
i1
<
i2
);
26
}
27
28
bool
CSCDetIdSameDetLayerComparator::operator()
(
CSCDetId
i1
,
CSCDetId
i2
)
const
{
29
bool
station
=
false
;
30
if
(
i1
.endcap() ==
i2
.endcap() &&
i1
.station() ==
i2
.station())
31
station
=
true
;
32
33
// Same DetLayer for station 2,3 and 4
34
if
((
station
) && (
i1
.station() != 1))
35
return
false
;
36
37
// Same DetLayer for station 1
38
if
((
station
) && (
i1
.station() == 1)) {
39
int
delta
=
abs
(
i1
.ring() -
i2
.ring());
40
int
sum =
i1
.ring() +
i2
.ring();
41
42
// Same DetLayer: rings 1,4 or rings 2,3
43
if
((
delta
== 0) || (sum == 5))
44
return
false
;
45
}
46
47
return
(
i1
<
i2
);
48
}
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition:
testProducerWithPsetDescEmpty_cfi.py:46
CSCDetIdSameChamberComparator
Definition:
CSCRangeMapAccessor.h:17
CSCRangeMapAccessor::~CSCRangeMapAccessor
virtual ~CSCRangeMapAccessor()
Destructor.
Definition:
CSCRangeMapAccessor.cc:11
CSCDetIdSameDetLayerComparator
Definition:
CSCRangeMapAccessor.h:12
relativeConstraints.station
station
Definition:
relativeConstraints.py:67
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition:
testProducerWithPsetDescEmpty_cfi.py:45
CSCDetIdSameDetLayerComparator::operator()
bool operator()(CSCDetId i1, CSCDetId i2) const
Definition:
CSCRangeMapAccessor.cc:28
CSCRangeMapAccessor.h
CSCDetIdSameChamberComparator::operator()
bool operator()(CSCDetId i1, CSCDetId i2) const
Definition:
CSCRangeMapAccessor.cc:21
dumpMFGeometry_cfg.delta
delta
Definition:
dumpMFGeometry_cfg.py:25
CSCDetId
Definition:
CSCDetId.h:26
CSCRangeMapAccessor::cscChamber
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.
Definition:
CSCRangeMapAccessor.cc:13
CSCRangeMapAccessor::cscDetLayer
static std::pair< CSCDetId, CSCDetIdSameDetLayerComparator > cscDetLayer(CSCDetId id)
Definition:
CSCRangeMapAccessor.cc:17
CSCRangeMapAccessor::CSCRangeMapAccessor
CSCRangeMapAccessor()
Constructor.
Definition:
CSCRangeMapAccessor.cc:9
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
Generated for CMSSW Reference Manual by
1.8.16