CMS 3D CMS Logo

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

◆ operator()()

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

Definition at line 28 of file CSCRangeMapAccessor.cc.

References funct::abs(), dumpMFGeometry_cfg::delta, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and relativeConstraints::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 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22