CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 13 of file CSCRangeMapAccessor.h.

Member Function Documentation

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

Definition at line 31 of file CSCRangeMapAccessor.cc.

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

31  {
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 }
dbl * delta
Definition: mlp_gen.cc:36
#define abs(x)
Definition: mlp_lapack.h:159
int endcap() const
Definition: CSCDetId.h:95
int ring() const
Definition: CSCDetId.h:77
int station() const
Definition: CSCDetId.h:88