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

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

Definition at line 34 of file MuonBaseNumber.h.

Constructor & Destructor Documentation

MuonBaseNumber::MuonBaseNumber ( )
inline

Definition at line 23 of file MuonBaseNumber.h.

23 {};
MuonBaseNumber::~MuonBaseNumber ( )
inline

Member Function Documentation

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

Definition at line 6 of file MuonBaseNumber.cc.

References LevelBaseNumber::base(), end, dqmdumpme::k, LevelBaseNumber::level(), sortedBaseNumber, and LevelBaseNumber::super().

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 LOCAL_DEBUG
15  edm::LogVerbatim("Geometry") << "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 LOCAL_DEBUG
33  cur = sortedBaseNumber.begin();
34  end = sortedBaseNumber.end();
35  edm::LogVerbatim("Geometry") << "MuonBaseNumber::AddBase ";
36  unsigned int k(0);
37  while (cur != end) {
38  edm::LogVerbatim("Geometry") << "[" << k << "] " << (*cur).level() << " " << (*cur).super() << " " << (*cur).base();
39  cur++;
40  ++k;
41  }
42 #endif
43 }
int level() const
int base() const
#define end
Definition: vmac.h:39
int super() const
basenumber_type sortedBaseNumber
int MuonBaseNumber::getBaseNo ( int  level) const
int MuonBaseNumber::getLevels ( ) const
int MuonBaseNumber::getSuperNo ( int  level) const

Member Data Documentation

basenumber_type MuonBaseNumber::sortedBaseNumber
protected

Definition at line 35 of file MuonBaseNumber.h.

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