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 
8 #include <cstdlib>
9 
11 
13 
14 std::pair<CSCDetId,CSCDetIdSameChamberComparator> CSCRangeMapAccessor::cscChamber(CSCDetId id) {
15 
16  return std::make_pair(id, CSCDetIdSameChamberComparator());
17 }
18 
19 std::pair<CSCDetId,CSCDetIdSameDetLayerComparator> CSCRangeMapAccessor::cscDetLayer(CSCDetId id) {
20 
21  return std::make_pair(id, CSCDetIdSameDetLayerComparator());
22 }
23 
25  if (i1.chamberId() == i2.chamberId())
26  return false;
27 
28  return (i1<i2);
29 }
30 
32  bool station = false;
33  if (i1.endcap() == i2.endcap() &&
34  i1.station() == i2.station())
35  station = true;
36 
37  // Same DetLayer for station 2,3 and 4
38  if ((station) && (i1.station() != 1))
39  return false;
40 
41  // Same DetLayer for station 1
42  if ((station) && (i1.station() == 1)) {
43 
44  int delta = abs(i1.ring() - i2.ring());
45  int sum = i1.ring() + i2.ring();
46 
47  // Same DetLayer: rings 1,4 or rings 2,3
48  if ((delta == 0) || (sum == 5))
49  return false;
50  }
51 
52  return (i1<i2);
53 }
54 
55 
56 
57 
58 
59 
60 
dbl * delta
Definition: mlp_gen.cc:36
CSCRangeMapAccessor()
Constructor.
#define abs(x)
Definition: mlp_lapack.h:159
static std::pair< CSCDetId, CSCDetIdSameDetLayerComparator > cscDetLayer(CSCDetId id)
int endcap() const
Definition: CSCDetId.h:95
bool operator()(CSCDetId i1, CSCDetId i2) const
CSCDetId chamberId() const
Definition: CSCDetId.h:55
virtual ~CSCRangeMapAccessor()
Destructor.
int ring() const
Definition: CSCDetId.h:77
bool operator()(CSCDetId i1, CSCDetId i2) const
int station() const
Definition: CSCDetId.h:88
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.