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.
2 #include <algorithm>
3 
4 bool CSCBadChambers::isInBadChamber( IndexType ichamber ) const {
5 
6  if ( numberOfChambers() == 0 ) return false;
7 
8  std::vector<int>::const_iterator badbegin = chambers.begin();
9  std::vector<int>::const_iterator badend = chambers.end();
10  std::vector<int>::const_iterator it = std::find( badbegin, badend, ichamber );
11  if ( it != badend ) return true; // ichamber is in the list of bad chambers
12  else return false;
13 }
14 
15 bool CSCBadChambers::isInBadChamber( const CSCDetId& id ) const {
16 
17  if ( numberOfChambers() == 0 ) return false;
18 
19  return isInBadChamber( chamberIndex( id.endcap(), id.station(), id.ring(), id.chamber() ) );
20 }
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
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
uint16_t IndexType
Definition: CSCBadChambers.h:9
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
int numberOfChambers() const
How many bad chambers are there&gt;