CMS 3D CMS Logo

CSCRangeMapAccessor.cc

Go to the documentation of this file.
00001 
00007 #include <DataFormats/CSCRecHit/interface/CSCRangeMapAccessor.h>
00008 
00009 CSCRangeMapAccessor::CSCRangeMapAccessor() {}
00010 
00011 CSCRangeMapAccessor::~CSCRangeMapAccessor() {}
00012 
00013 std::pair<CSCDetId,CSCDetIdSameChamberComparator> CSCRangeMapAccessor::cscChamber(CSCDetId id) {
00014   
00015   return std::make_pair(id, CSCDetIdSameChamberComparator());
00016 }
00017 
00018 std::pair<CSCDetId,CSCDetIdSameDetLayerComparator> CSCRangeMapAccessor::cscDetLayer(CSCDetId id) {
00019   
00020   return std::make_pair(id, CSCDetIdSameDetLayerComparator());
00021 }
00022 
00023 bool CSCDetIdSameChamberComparator::operator()(CSCDetId i1, CSCDetId i2) const {
00024   if (i1.chamberId() == i2.chamberId())
00025     return false;
00026 
00027   return (i1<i2);
00028 }
00029 
00030 bool CSCDetIdSameDetLayerComparator::operator()(CSCDetId i1, CSCDetId i2) const {
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 }
00053 
00054 
00055 
00056 
00057 
00058 
00059 

Generated on Tue Jun 9 17:30:41 2009 for CMSSW by  doxygen 1.5.4