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 12 of file CSCRangeMapAccessor.h.

Member Function Documentation

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

Definition at line 30 of file CSCRangeMapAccessor.cc.

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

30  {
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 }
dbl * delta
Definition: mlp_gen.cc:36
int endcap() const
Definition: CSCDetId.h:95
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ring() const
Definition: CSCDetId.h:77
int station() const
Definition: CSCDetId.h:88