CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (LevelBaseNumber)
 
int getBaseNo (int level) const
 
int getLevels () const
 
int getSuperNo (int level) const
 
 MuonBaseNumber ()
 
 ~MuonBaseNumber ()
 

Protected Types

typedef std::vector
< LevelBaseNumber
basenumber_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

Date:
2006/02/15 13:21:24
Revision:
1.1
Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 23 of file MuonBaseNumber.h.

Member Typedef Documentation

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

Definition at line 38 of file MuonBaseNumber.h.

Constructor & Destructor Documentation

MuonBaseNumber::MuonBaseNumber ( )
inline

Definition at line 26 of file MuonBaseNumber.h.

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

Definition at line 27 of file MuonBaseNumber.h.

27 {};

Member Function Documentation

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

Definition at line 51 of file MuonBaseNumber.cc.

Referenced by MuonDDDNumbering::geoHistoryToBaseNumber(), and MuonG4Numbering::PhysicalVolumeToBaseNumber().

51  {
53  addBase(num);
54 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
void addBase(const int level, const int super, const int base)
long long int num
Definition: procUtils.cc:71
tuple level
Definition: testEve_cfg.py:34
void MuonBaseNumber::addBase ( LevelBaseNumber  num)

Definition at line 7 of file MuonBaseNumber.cc.

References LevelBaseNumber::base(), gather_cfg::cout, end, LevelBaseNumber::level(), LogDebug, sortedBaseNumber, and LevelBaseNumber::super().

7  {
8  basenumber_type::iterator cur=sortedBaseNumber.begin();
9  basenumber_type::iterator end=sortedBaseNumber.end();
10 
11  // do a small check if level is already occupied
12 
13  while (cur!=end) {
14  if (num.level()==(*cur).level()) {
15  LogDebug("MuonBaseNumber") << "MuonBaseNumber::addBase was asked to add "
16  <<num.level()<<" "
17  <<num.super()<<" "
18  <<num.base()
19  <<" to existing level "
20  <<(*cur).level()<<" "
21  <<(*cur).super()<<" "
22  <<(*cur).base() << " but refused.";
23  return; // don't overwrite current volume stored
24  }
25  cur++;
26  }
27 
28  cur=sortedBaseNumber.begin();
29  while (cur!=end) {
30  if (num.level()<(*cur).level()) break;
31  cur++;
32  }
33  sortedBaseNumber.insert(cur,num);
34 
35 #ifdef LOCAL_DEBUG
36  cur=sortedBaseNumber.begin();
37  end=sortedBaseNumber.end();
38  std::cout << "MuonBaseNumber::AddBase ";
39  while (cur!=end) {
40  std::cout<<(*cur).level()<<" ";
41  std::cout<<(*cur).super()<<" ";
42  std::cout<<(*cur).base();
43  std::cout<<",";
44  cur++;
45  }
46  std::cout <<std::endl;
47 #endif
48 
49 }
#define LogDebug(id)
int level() const
int base() const
#define end
Definition: vmac.h:38
int super() const
basenumber_type sortedBaseNumber
tuple cout
Definition: gather_cfg.py:121
int MuonBaseNumber::getBaseNo ( int  level) const

Definition at line 72 of file MuonBaseNumber.cc.

References end, testEve_cfg::level, and sortedBaseNumber.

Referenced by CSCNumberingScheme::baseNumberToUnitNumber(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), and MuonDDDNumbering::geoHistoryToBaseNumber().

72  {
73  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
74  basenumber_type::const_iterator end=sortedBaseNumber.end();
75  while (cur!=end) {
76  if ((*cur).level()==level) {
77  return (*cur).base();
78  }
79  cur++;
80  }
81  return 0;
82 }
#define end
Definition: vmac.h:38
basenumber_type sortedBaseNumber
tuple level
Definition: testEve_cfg.py:34
int MuonBaseNumber::getLevels ( ) const
int MuonBaseNumber::getSuperNo ( int  level) const

Definition at line 60 of file MuonBaseNumber.cc.

References end, testEve_cfg::level, and sortedBaseNumber.

Referenced by CSCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), MuonDDDNumbering::geoHistoryToBaseNumber(), and MuonRpcFrameRotation::transformPoint().

60  {
61  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
62  basenumber_type::const_iterator end=sortedBaseNumber.end();
63  while (cur!=end) {
64  if ((*cur).level()==level) {
65  return (*cur).super();
66  }
67  cur++;
68  }
69  return 0;
70 }
#define end
Definition: vmac.h:38
basenumber_type sortedBaseNumber
tuple level
Definition: testEve_cfg.py:34

Member Data Documentation

basenumber_type MuonBaseNumber::sortedBaseNumber
protected

Definition at line 39 of file MuonBaseNumber.h.

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