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 
)

Definition at line 53 of file MuonBaseNumber.cc.

References pileupDistInMC::num.

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

53  {
55  addBase(num);
56 }
void addBase(const int level, const int super, const int base)
base
Make Sure CMSSW is Setup ##.
void MuonBaseNumber::addBase ( const LevelBaseNumber num)

Definition at line 7 of file MuonBaseNumber.cc.

References LevelBaseNumber::base(), gather_cfg::cout, end, LevelBaseNumber::level(), 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 #ifdef LOCAL_DEBUG
16  std::cout << "MuonBaseNumber::addBase was asked to add "
17  <<num.level()<<" "
18  <<num.super()<<" "
19  <<num.base()
20  <<" to existing level "
21  <<(*cur).level()<<" "
22  <<(*cur).super()<<" "
23  <<(*cur).base() << " but refused.";
24 #endif
25  return; // don't overwrite current volume stored
26  }
27  cur++;
28  }
29 
30  cur=sortedBaseNumber.begin();
31  while (cur!=end) {
32  if (num.level()<(*cur).level()) break;
33  cur++;
34  }
35  sortedBaseNumber.insert(cur,num);
36 
37 #ifdef LOCAL_DEBUG
38  cur=sortedBaseNumber.begin();
39  end=sortedBaseNumber.end();
40  std::cout << "MuonBaseNumber::AddBase ";
41  while (cur!=end) {
42  std::cout<<(*cur).level()<<" ";
43  std::cout<<(*cur).super()<<" ";
44  std::cout<<(*cur).base();
45  std::cout<<",";
46  cur++;
47  }
48  std::cout <<std::endl;
49 #endif
50 
51 }
int level() const
int base() const
#define end
Definition: vmac.h:39
int super() const
basenumber_type sortedBaseNumber
int MuonBaseNumber::getBaseNo ( int  level) const

Definition at line 74 of file MuonBaseNumber.cc.

References end, hcalDigis_cfi::level, and sortedBaseNumber.

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

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

Definition at line 62 of file MuonBaseNumber.cc.

References end, hcalDigis_cfi::level, and sortedBaseNumber.

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

62  {
63  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
64  basenumber_type::const_iterator end=sortedBaseNumber.end();
65  while (cur!=end) {
66  if ((*cur).level()==level) {
67  return (*cur).super();
68  }
69  cur++;
70  }
71  return 0;
72 }
#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().