CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Attributes
MuonBaseNumber Class Reference

#include <MuonBaseNumber.h>

Public Member Functions

void addBase (const int level, const int super, const int base)
 
void addBase (const LevelBaseNumber &)
 
int getBaseNo (int level) const
 
int getLevels () const
 
int getSuperNo (int level) const
 
 MuonBaseNumber ()
 
 ~MuonBaseNumber ()
 

Protected Types

typedef std::vector< LevelBaseNumberbasenumber_type
 

Protected Attributes

basenumber_type sortedBaseNumber
 

Detailed Description

the muon base number collects all significant copy numbers to uniquely identify a detector unit; the information is kept in a vector of all relevant LevelBaseNumber's needed to identify the detector unit; a packed version of the MuonBaseNumber may replace the current numbering scheme in future

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 21 of file MuonBaseNumber.h.

Member Typedef Documentation

◆ basenumber_type

typedef std::vector<LevelBaseNumber> MuonBaseNumber::basenumber_type
protected

Definition at line 34 of file MuonBaseNumber.h.

Constructor & Destructor Documentation

◆ MuonBaseNumber()

MuonBaseNumber::MuonBaseNumber ( )
inline

Definition at line 23 of file MuonBaseNumber.h.

23 {};

◆ ~MuonBaseNumber()

MuonBaseNumber::~MuonBaseNumber ( )
inline

Definition at line 24 of file MuonBaseNumber.h.

24 {};

Member Function Documentation

◆ addBase() [1/2]

void MuonBaseNumber::addBase ( const int  level,
const int  super,
const int  base 
)

Definition at line 45 of file MuonBaseNumber.cc.

References edmMakeDummyCfis::base, personalPlayback::level, and EgammaValidation_cff::num.

45  {
46  LevelBaseNumber num(level, super, base);
47  addBase(num);
48 }
void addBase(const int level, const int super, const int base)

◆ addBase() [2/2]

void MuonBaseNumber::addBase ( const LevelBaseNumber num)

Definition at line 6 of file MuonBaseNumber.cc.

References mps_fire::end, dqmdumpme::k, EgammaValidation_cff::num, and sortedBaseNumber.

6  {
7  basenumber_type::iterator cur = sortedBaseNumber.begin();
8  basenumber_type::iterator end = sortedBaseNumber.end();
9 
10  // do a small check if level is already occupied
11 
12  while (cur != end) {
13  if (num.level() == (*cur).level()) {
14 #ifdef EDM_ML_DEBUG
15  edm::LogVerbatim("MuonGeom") << "MuonBaseNumber::addBase was asked to add " << num.level() << " " << num.super()
16  << " " << num.base() << " to existing level " << (*cur).level() << " "
17  << (*cur).super() << " " << (*cur).base() << " but refused.";
18 #endif
19  return; // don't overwrite current volume stored
20  }
21  cur++;
22  }
23 
24  cur = sortedBaseNumber.begin();
25  while (cur != end) {
26  if (num.level() < (*cur).level())
27  break;
28  cur++;
29  }
30  sortedBaseNumber.insert(cur, num);
31 
32 #ifdef EDM_ML_DEBUG
33  cur = sortedBaseNumber.begin();
34  end = sortedBaseNumber.end();
35  edm::LogVerbatim("MuonGeom") << "MuonBaseNumber::AddBase ";
36  unsigned int k(0);
37  while (cur != end) {
38  edm::LogVerbatim("MuonGeom") << "[" << k << "] " << (*cur).level() << " " << (*cur).super() << " " << (*cur).base();
39  cur++;
40  ++k;
41  }
42 #endif
43 }
Log< level::Info, true > LogVerbatim
basenumber_type sortedBaseNumber

◆ getBaseNo()

int MuonBaseNumber::getBaseNo ( int  level) const

Definition at line 64 of file MuonBaseNumber.cc.

References mps_fire::end, personalPlayback::level, and sortedBaseNumber.

64  {
65  basenumber_type::const_iterator cur = sortedBaseNumber.begin();
66  basenumber_type::const_iterator end = sortedBaseNumber.end();
67  while (cur != end) {
68  if ((*cur).level() == level) {
69  return (*cur).base();
70  }
71  cur++;
72  }
73  return 0;
74 }
basenumber_type sortedBaseNumber

◆ getLevels()

int MuonBaseNumber::getLevels ( ) const

Definition at line 50 of file MuonBaseNumber.cc.

References sortedBaseNumber.

50 { return sortedBaseNumber.size(); }
basenumber_type sortedBaseNumber

◆ getSuperNo()

int MuonBaseNumber::getSuperNo ( int  level) const

Definition at line 52 of file MuonBaseNumber.cc.

References mps_fire::end, personalPlayback::level, and sortedBaseNumber.

52  {
53  basenumber_type::const_iterator cur = sortedBaseNumber.begin();
54  basenumber_type::const_iterator end = sortedBaseNumber.end();
55  while (cur != end) {
56  if ((*cur).level() == level) {
57  return (*cur).super();
58  }
59  cur++;
60  }
61  return 0;
62 }
basenumber_type sortedBaseNumber

Member Data Documentation

◆ sortedBaseNumber

basenumber_type MuonBaseNumber::sortedBaseNumber
protected

Definition at line 35 of file MuonBaseNumber.h.

Referenced by addBase(), getBaseNo(), getLevels(), and getSuperNo().