CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCBadChambers Class Reference

#include <CSCBadChambers.h>

List of all members.

Public Member Functions

std::vector< int > container () const
 Return the container of bad chambers.
 CSCBadChambers ()
 CSCBadChambers (int nch, std::vector< int > ch)
bool isInBadChamber (const CSCDetId &id) const
 Is the gven chamber flagged as bad?
int numberOfChambers () const
 How many bad chambers are there>
 ~CSCBadChambers ()

Private Attributes

std::vector< int > chambers
int numberOfBadChambers

Detailed Description

Definition at line 8 of file CSCBadChambers.h.


Constructor & Destructor Documentation

CSCBadChambers::CSCBadChambers ( ) [inline]

Definition at line 10 of file CSCBadChambers.h.

: numberOfBadChambers( 0 ), chambers( std::vector<int>() ) {};
CSCBadChambers::CSCBadChambers ( int  nch,
std::vector< int >  ch 
) [inline]

Definition at line 11 of file CSCBadChambers.h.

: numberOfBadChambers( nch ), chambers( ch ) {};
CSCBadChambers::~CSCBadChambers ( ) [inline]

Definition at line 12 of file CSCBadChambers.h.

{};

Member Function Documentation

std::vector<int> CSCBadChambers::container ( ) const [inline]

Return the container of bad chambers.

Definition at line 18 of file CSCBadChambers.h.

References chambers.

{ return chambers; }
bool CSCBadChambers::isInBadChamber ( const CSCDetId id) const

Is the gven chamber flagged as bad?

Definition at line 5 of file CSCBadChambers.cc.

References CSCIndexer::chamberIndex(), chambers, Reference_intrackfit_cff::endcap, spr::find(), numberOfChambers(), and relativeConstraints::station.

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

                                                              {

  if ( numberOfChambers() == 0 ) return false;

  short int iri = id.ring();
  //@@ Beware future ME11 changes
  if ( iri == 4 ) iri = 1; // reset ME1A to ME11
  CSCIndexer indexer;
  int ilin = indexer.chamberIndex( id.endcap(), id.station(), iri, id.chamber() );
  std::vector<int>::const_iterator badbegin = chambers.begin();
  std::vector<int>::const_iterator badend   = chambers.end();
  std::vector<int>::const_iterator it = std::find( badbegin, badend, ilin );
  if ( it != badend ) return true; // id is in the list of bad chambers
  else return false;
}
int CSCBadChambers::numberOfChambers ( ) const [inline]

How many bad chambers are there>

Definition at line 15 of file CSCBadChambers.h.

References numberOfBadChambers.

Referenced by isInBadChamber().

{ return numberOfBadChambers; }

Member Data Documentation

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

Definition at line 25 of file CSCBadChambers.h.

Referenced by container(), and isInBadChamber().

Definition at line 24 of file CSCBadChambers.h.

Referenced by numberOfChambers().