CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CSCBadChambers Class Reference

#include <CSCBadChambers.h>

Public Types

typedef uint16_t IndexType
 

Public Member Functions

IndexType chamberIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic) const
 
std::vector< int > container () const
 Return the container of bad chambers. More...
 
 CSCBadChambers ()
 
 CSCBadChambers (int nch, const std::vector< int > &ch)
 
bool isInBadChamber (IndexType ichamber) const
 Is the chamber with index 'ichamber' flagged as bad? More...
 
bool isInBadChamber (const CSCDetId &id) const
 Is the chamber with CSCDetId 'id' flagged as bad? More...
 
int numberOfChambers () const
 How many bad chambers are there> More...
 
IndexType startChamberIndexInEndcap (IndexType ie, IndexType is, IndexType ir) const
 
 ~CSCBadChambers ()
 

Private Attributes

std::vector< int > chambers
 
 COND_SERIALIZABLE
 
int numberOfBadChambers
 

Detailed Description

Definition at line 9 of file CSCBadChambers.h.

Member Typedef Documentation

typedef uint16_t CSCBadChambers::IndexType

Definition at line 11 of file CSCBadChambers.h.

Constructor & Destructor Documentation

CSCBadChambers::CSCBadChambers ( )
inline

Definition at line 13 of file CSCBadChambers.h.

13 : numberOfBadChambers( 0 ), chambers( std::vector<int>() ) {};
std::vector< int > chambers
CSCBadChambers::CSCBadChambers ( int  nch,
const std::vector< int > &  ch 
)
inline

Definition at line 14 of file CSCBadChambers.h.

14 : numberOfBadChambers( nch ), chambers( ch ) {};
std::vector< int > chambers
CSCBadChambers::~CSCBadChambers ( )
inline

Definition at line 15 of file CSCBadChambers.h.

15 {};

Member Function Documentation

IndexType CSCBadChambers::chamberIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic 
) const
inline

Definition at line 37 of file CSCBadChambers.h.

References startChamberIndexInEndcap().

Referenced by isInBadChamber().

38  {
39  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
40  }
IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const
std::vector<int> CSCBadChambers::container ( ) const
inline

Return the container of bad chambers.

Definition at line 21 of file CSCBadChambers.h.

References chambers.

21 { return chambers; }
std::vector< int > chambers
bool CSCBadChambers::isInBadChamber ( IndexType  ichamber) const

Is the chamber with index 'ichamber' flagged as bad?

Definition at line 4 of file CSCBadChambers.cc.

References chambers, spr::find(), and numberOfChambers().

Referenced by CSCTriggerPrimitivesBuilder::build(), MuonDetIdAssociator::getValidDetIds(), and isInBadChamber().

4  {
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 }
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;
bool CSCBadChambers::isInBadChamber ( const CSCDetId id) const

Is the chamber with CSCDetId 'id' flagged as bad?

Definition at line 15 of file CSCBadChambers.cc.

References chamberIndex(), Reference_intrackfit_cff::endcap, isInBadChamber(), numberOfChambers(), relativeConstraints::ring, and relativeConstraints::station.

15  {
16 
17  if ( numberOfChambers() == 0 ) return false;
18 
19  return isInBadChamber( chamberIndex( id.endcap(), id.station(), id.ring(), id.chamber() ) );
20 }
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
int numberOfChambers() const
How many bad chambers are there&gt;
int CSCBadChambers::numberOfChambers ( ) const
inline

How many bad chambers are there>

Definition at line 18 of file CSCBadChambers.h.

References numberOfBadChambers.

Referenced by isInBadChamber().

18 { return numberOfBadChambers; }
IndexType CSCBadChambers::startChamberIndexInEndcap ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

Definition at line 29 of file CSCBadChambers.h.

Referenced by chamberIndex().

30  {
31  const IndexType nschin[32] =
32  { 1,37,73,1, 109,127,0,0, 163,181,0,0, 217,469,0,0,
33  235,271,307,235, 343,361,0,0, 397,415,0,0, 451,505,0,0 };
34  return nschin[(ie - 1)*16 + (is - 1)*4 + ir - 1];
35  }
uint16_t IndexType

Member Data Documentation

std::vector<int> CSCBadChambers::chambers
private

Definition at line 44 of file CSCBadChambers.h.

Referenced by container(), and isInBadChamber().

CSCBadChambers::COND_SERIALIZABLE
private

Definition at line 46 of file CSCBadChambers.h.

int CSCBadChambers::numberOfBadChambers
private

Definition at line 43 of file CSCBadChambers.h.

Referenced by numberOfChambers().