CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CondFormats/CSCObjects/src/CSCBadChambers.cc

Go to the documentation of this file.
00001 #include "CondFormats/CSCObjects/interface/CSCBadChambers.h"
00002 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
00003 #include <algorithm>
00004 
00005 bool CSCBadChambers::isInBadChamber( const CSCDetId& id ) const {
00006 
00007   if ( numberOfChambers() == 0 ) return false;
00008 
00009   short int iri = id.ring();
00010   //@@ Beware future ME11 changes
00011   if ( iri == 4 ) iri = 1; // reset ME1A to ME11
00012   CSCIndexer indexer;
00013   int ilin = indexer.chamberIndex( id.endcap(), id.station(), iri, id.chamber() );
00014   std::vector<int>::const_iterator badbegin = chambers.begin();
00015   std::vector<int>::const_iterator badend   = chambers.end();
00016   std::vector<int>::const_iterator it = std::find( badbegin, badend, ilin );
00017   if ( it != badend ) return true; // id is in the list of bad chambers
00018   else return false;
00019 }
00020