CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
15  return std::make_pair(id, CSCDetIdSameChamberComparator());
16 }
17 
18 std::pair<CSCDetId,CSCDetIdSameDetLayerComparator> CSCRangeMapAccessor::cscDetLayer(CSCDetId id) {
19 
20  return std::make_pair(id, CSCDetIdSameDetLayerComparator());
21 }
22 
24  if (i1.chamberId() == i2.chamberId())
25  return false;
26 
27  return (i1<i2);
28 }
29 
31  bool station = false;
32  if (i1.endcap() == i2.endcap() &&
33  i1.station() == i2.station())
34  station = true;
35 
36  // Same DetLayer for station 2,3 and 4
37  if ((station) && (i1.station() != 1))
38  return false;
39 
40  // Same DetLayer for station 1
41  if ((station) && (i1.station() == 1)) {
42 
43  int delta = abs(i1.ring() - i2.ring());
44  int sum = i1.ring() + i2.ring();
45 
46  // Same DetLayer: rings 1,4 or rings 2,3
47  if ((delta == 0) || (sum == 5))
48  return false;
49  }
50 
51  return (i1<i2);
52 }
53 
54 
55 
56 
57 
58 
59 
dbl * delta
Definition: mlp_gen.cc:36
CSCRangeMapAccessor()
Constructor.
static std::pair< CSCDetId, CSCDetIdSameDetLayerComparator > cscDetLayer(CSCDetId id)
int endcap() const
Definition: CSCDetId.h:106
bool operator()(CSCDetId i1, CSCDetId i2) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCDetId chamberId() const
Definition: CSCDetId.h:66
virtual ~CSCRangeMapAccessor()
Destructor.
int ring() const
Definition: CSCDetId.h:88
bool operator()(CSCDetId i1, CSCDetId i2) const
int station() const
Definition: CSCDetId.h:99
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.