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 36 of file MuonBaseNumber.h.

Constructor & Destructor Documentation

MuonBaseNumber::MuonBaseNumber ( )
inline

Definition at line 24 of file MuonBaseNumber.h.

24 {};
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, gen::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")
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 }
int level() const
int base() const
#define end
Definition: vmac.h:39
int k[5][pyjets_maxn]
int super() const
basenumber_type sortedBaseNumber
int MuonBaseNumber::getBaseNo ( int  level) const

Definition at line 69 of file MuonBaseNumber.cc.

References end, hcalDigis_cfi::level, and sortedBaseNumber.

Referenced by GEMNumberingScheme::baseNumberToUnitNumber(), ME0NumberingScheme::baseNumberToUnitNumber(), CSCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), cms::DTNumberingScheme::decode(), MuonDDDNumbering::geoHistoryToBaseNumber(), MuonSensitiveDetector::setDetUnitId(), and ~MuonBaseNumber().

69  {
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 }
#define end
Definition: vmac.h:39
basenumber_type sortedBaseNumber
int MuonBaseNumber::getLevels ( ) const
int MuonBaseNumber::getSuperNo ( int  level) const

Definition at line 57 of file MuonBaseNumber.cc.

References end, hcalDigis_cfi::level, and sortedBaseNumber.

Referenced by GEMNumberingScheme::baseNumberToUnitNumber(), ME0NumberingScheme::baseNumberToUnitNumber(), CSCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), cms::DTNumberingScheme::decode(), MuonDDDNumbering::geoHistoryToBaseNumber(), MuonSensitiveDetector::setDetUnitId(), MuonRPCFrameRotation::transformPoint(), and ~MuonBaseNumber().

57  {
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 }
#define end
Definition: vmac.h:39
basenumber_type sortedBaseNumber

Member Data Documentation

basenumber_type MuonBaseNumber::sortedBaseNumber
protected

Definition at line 37 of file MuonBaseNumber.h.

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