CMS 3D CMS Logo

MuonBaseNumber.cc
Go to the documentation of this file.
3 
4 //#define LOCAL_DEBUG
5 
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")
16  << "MuonBaseNumber::addBase was asked to add " << num.level() << " "
17  << num.super() << " " << num.base() << " to existing level "
18  << (*cur).level() << " " << (*cur).super() << " " << (*cur).base()
19  << " but refused.";
20 #endif
21  return; // don't overwrite current volume stored
22  }
23  cur++;
24  }
25 
26  cur=sortedBaseNumber.begin();
27  while (cur!=end) {
28  if (num.level()<(*cur).level()) break;
29  cur++;
30  }
31  sortedBaseNumber.insert(cur,num);
32 
33 #ifdef LOCAL_DEBUG
34  cur=sortedBaseNumber.begin();
35  end=sortedBaseNumber.end();
36  edm::LogVerbatim("Geometry") << "MuonBaseNumber::AddBase ";
37  unsigned int k(0);
38  while (cur!=end) {
39  edm::LogVerbatim("Geometry")
40  << "[" << k << "] " << (*cur).level() << " " << (*cur).super() << " "
41  << (*cur).base();
42  cur++; ++k;
43  }
44 #endif
45 
46 }
47 
48 void MuonBaseNumber::addBase(const int level,const int super,const int base){
49  LevelBaseNumber num(level,super,base);
50  addBase(num);
51 }
52 
54  return sortedBaseNumber.size();
55 }
56 
58  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
59  basenumber_type::const_iterator end=sortedBaseNumber.end();
60  while (cur!=end) {
61  if ((*cur).level()==level) {
62  return (*cur).super();
63  }
64  cur++;
65  }
66  return 0;
67 }
68 
70  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
71  basenumber_type::const_iterator end=sortedBaseNumber.end();
72  while (cur!=end) {
73  if ((*cur).level()==level) {
74  return (*cur).base();
75  }
76  cur++;
77  }
78  return 0;
79 }
80 
81 
82 
83 
84 
void addBase(const int level, const int super, const int base)
int getBaseNo(int level) const
int level() const
int base() const
#define end
Definition: vmac.h:39
base
Make Sure CMSSW is Setup ##.
int k[5][pyjets_maxn]
int super() const
int getLevels() const
int getSuperNo(int level) const
basenumber_type sortedBaseNumber