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.

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

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

◆ addBase() [2/2]

void MuonBaseNumber::addBase ( const LevelBaseNumber num)

Definition at line 6 of file MuonBaseNumber.cc.

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 }

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

◆ getBaseNo()

int MuonBaseNumber::getBaseNo ( int  level) const

Definition at line 64 of file MuonBaseNumber.cc.

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 }

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

◆ getLevels()

int MuonBaseNumber::getLevels ( ) const

Definition at line 50 of file MuonBaseNumber.cc.

50 { return sortedBaseNumber.size(); }

References sortedBaseNumber.

◆ getSuperNo()

int MuonBaseNumber::getSuperNo ( int  level) const

Definition at line 52 of file MuonBaseNumber.cc.

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 }

References mps_fire::end, personalPlayback::level, and 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().

personalPlayback.level
level
Definition: personalPlayback.py:22
MuonBaseNumber::addBase
void addBase(const int level, const int super, const int base)
Definition: MuonBaseNumber.cc:45
mps_fire.end
end
Definition: mps_fire.py:242
dqmdumpme.k
k
Definition: dqmdumpme.py:60
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
LevelBaseNumber
Definition: LevelBaseNumber.h:17
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
MuonBaseNumber::sortedBaseNumber
basenumber_type sortedBaseNumber
Definition: MuonBaseNumber.h:35