CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
CSCDetIdSameDetLayerComparator Class Reference

#include <CSCRangeMapAccessor.h>

Public Member Functions

bool operator() (CSCDetId i1, CSCDetId i2) const
 

Detailed Description

Definition at line 12 of file CSCRangeMapAccessor.h.

Member Function Documentation

bool CSCDetIdSameDetLayerComparator::operator() ( CSCDetId  i1,
CSCDetId  i2 
) const

Definition at line 28 of file CSCRangeMapAccessor.cc.

References funct::abs(), CommonMethods::delta(), CSCDetId::endcap(), CSCDetId::ring(), relativeConstraints::station, and CSCDetId::station().

28  {
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 }
int endcap() const
Definition: CSCDetId.h:85
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ring() const
Definition: CSCDetId.h:68
int station() const
Definition: CSCDetId.h:79