CMS 3D CMS Logo

CSCDetIdSameDetLayerComparator Class Reference

#include <DataFormats/CSCRecHit/interface/CSCRangeMapAccessor.h>

List of all members.

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 30 of file CSCRangeMapAccessor.cc.

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

00030                                                                               {
00031   bool station = false;
00032   if (i1.endcap() == i2.endcap() &&
00033       i1.station() == i2.station())
00034     station = true;
00035 
00036   // Same DetLayer for station 2,3 and 4
00037   if ((station) && (i1.station() != 1))
00038     return false;
00039   
00040   // Same DetLayer for station 1
00041   if ((station) && (i1.station() == 1)) {
00042   
00043     int delta = abs(i1.ring() - i2.ring());
00044     int sum = i1.ring() + i2.ring();
00045     
00046     // Same DetLayer: rings 1,4 or rings 2,3
00047     if ((delta == 0) || (sum == 5))
00048       return false;
00049   }
00050 
00051   return (i1<i2);
00052 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:10 2009 for CMSSW by  doxygen 1.5.4