CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCBadChambers.cc
Go to the documentation of this file.
3 #include <algorithm>
4 
5 bool CSCBadChambers::isInBadChamber( const CSCDetId& id ) const {
6 
7  if ( numberOfChambers() == 0 ) return false;
8 
9  short int iri = id.ring();
10  //@@ Beware future ME11 changes
11  if ( iri == 4 ) iri = 1; // reset ME1A to ME11
12  CSCIndexer indexer;
13  int ilin = indexer.chamberIndex( id.endcap(), id.station(), iri, id.chamber() );
14  std::vector<int>::const_iterator badbegin = chambers.begin();
15  std::vector<int>::const_iterator badend = chambers.end();
16  std::vector<int>::const_iterator it = std::find( badbegin, badend, ilin );
17  if ( it != badend ) return true; // id is in the list of bad chambers
18  else return false;
19 }
20 
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
IndexType chamberIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:66
std::vector< int > chambers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int numberOfChambers() const
How many bad chambers are there&gt;