CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
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 (const CSCDetId &id) const
 Is the chamber with CSCDetId 'id' flagged as bad? More...
 
bool isInBadChamber (IndexType ichamber) const
 Is the chamber with index 'ichamber' 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 Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< int > chambers
 
int numberOfBadChambers
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 9 of file CSCBadChambers.h.

Member Typedef Documentation

◆ IndexType

typedef uint16_t CSCBadChambers::IndexType

Definition at line 11 of file CSCBadChambers.h.

Constructor & Destructor Documentation

◆ CSCBadChambers() [1/2]

CSCBadChambers::CSCBadChambers ( )
inline

Definition at line 13 of file CSCBadChambers.h.

13 : numberOfBadChambers(0), chambers(std::vector<int>()){};

◆ CSCBadChambers() [2/2]

CSCBadChambers::CSCBadChambers ( int  nch,
const std::vector< int > &  ch 
)
inline

Definition at line 14 of file CSCBadChambers.h.

14 : numberOfBadChambers(nch), chambers(ch){};

◆ ~CSCBadChambers()

CSCBadChambers::~CSCBadChambers ( )
inline

Definition at line 15 of file CSCBadChambers.h.

15 {};

Member Function Documentation

◆ chamberIndex()

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

Definition at line 35 of file CSCBadChambers.h.

35  {
36  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
37  }

References startChamberIndexInEndcap().

Referenced by isInBadChamber().

◆ container()

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

Return the container of bad chambers.

Definition at line 21 of file CSCBadChambers.h.

21 { return chambers; }

References chambers.

◆ isInBadChamber() [1/2]

bool CSCBadChambers::isInBadChamber ( const CSCDetId id) const

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

Definition at line 17 of file CSCBadChambers.cc.

17  {
18  if (numberOfChambers() == 0)
19  return false;
20 
21  return isInBadChamber(chamberIndex(id.endcap(), id.station(), id.ring(), id.chamber()));
22 }

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

◆ isInBadChamber() [2/2]

bool CSCBadChambers::isInBadChamber ( IndexType  ichamber) const

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

Definition at line 4 of file CSCBadChambers.cc.

4  {
5  if (numberOfChambers() == 0)
6  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)
12  return true; // ichamber is in the list of bad chambers
13  else
14  return false;
15 }

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

Referenced by CSCTriggerPrimitivesBuilder::build(), CSCTriggerPrimitivesReader::calcEfficiency(), CSCTriggerPrimitivesReader::calcResolution(), CSCTriggerPrimitivesReader::compareALCTs(), CSCTriggerPrimitivesReader::compareCLCTs(), CSCTriggerPrimitivesReader::compareLCTs(), CSCTriggerPrimitivesReader::compareMPCLCTs(), CSCTriggerPrimitivesReader::fillALCTHistos(), CSCTriggerPrimitivesReader::fillCLCTHistos(), CSCTriggerPrimitivesReader::fillLCTMPCHistos(), CSCTriggerPrimitivesReader::fillLCTTMBHistos(), MuonDetIdAssociator::getValidDetIds(), isInBadChamber(), CSCConditions::isInBadChamber(), and MuonPSimHitSelector::select().

◆ numberOfChambers()

int CSCBadChambers::numberOfChambers ( ) const
inline

How many bad chambers are there>

Definition at line 18 of file CSCBadChambers.h.

18 { return numberOfBadChambers; }

References numberOfBadChambers.

Referenced by isInBadChamber().

◆ serialize()

template<class Archive >
void CSCBadChambers::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ startChamberIndexInEndcap()

IndexType CSCBadChambers::startChamberIndexInEndcap ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

Definition at line 29 of file CSCBadChambers.h.

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

Referenced by chamberIndex().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 43 of file CSCBadChambers.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 43 of file CSCBadChambers.h.

Member Data Documentation

◆ chambers

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

Definition at line 41 of file CSCBadChambers.h.

Referenced by container(), and isInBadChamber().

◆ numberOfBadChambers

int CSCBadChambers::numberOfBadChambers
private

Definition at line 40 of file CSCBadChambers.h.

Referenced by numberOfChambers().

relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCBadChambers::IndexType
uint16_t IndexType
Definition: CSCBadChambers.h:11
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
CSCBadChambers::chambers
std::vector< int > chambers
Definition: CSCBadChambers.h:41
CSCBadChambers::numberOfBadChambers
int numberOfBadChambers
Definition: CSCBadChambers.h:40
CSCBadChambers::chamberIndex
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
Definition: CSCBadChambers.h:35
CSCBadChambers::numberOfChambers
int numberOfChambers() const
How many bad chambers are there>
Definition: CSCBadChambers.h:18
CSCBadChambers::isInBadChamber
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index 'ichamber' flagged as bad?
Definition: CSCBadChambers.cc:4
CSCBadChambers::startChamberIndexInEndcap
IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const
Definition: CSCBadChambers.h:29
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53