CMS 3D CMS Logo

CSCRangeMapAccessor.cc
Go to the documentation of this file.
1 
7 #include <cstdlib>
8 
10 
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 
22  if (i1.chamberId() == i2.chamberId())
23  return false;
24 
25  return (i1 < i2);
26 }
27 
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 }
CSCRangeMapAccessor()
Constructor.
static std::pair< CSCDetId, CSCDetIdSameDetLayerComparator > cscDetLayer(CSCDetId id)
int endcap() const
Definition: CSCDetId.h:85
bool operator()(CSCDetId i1, CSCDetId i2) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCDetId chamberId() const
Definition: CSCDetId.h:47
virtual ~CSCRangeMapAccessor()
Destructor.
int ring() const
Definition: CSCDetId.h:68
bool operator()(CSCDetId i1, CSCDetId i2) const
int station() const
Definition: CSCDetId.h:79
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.