CMS 3D CMS Logo

Public Member Functions | Protected Types | Protected Attributes

MuonBaseNumber Class Reference

#include <MuonBaseNumber.h>

List of all members.

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.straessner@cern.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.

{};
MuonBaseNumber::~MuonBaseNumber ( ) [inline]

Definition at line 27 of file MuonBaseNumber.h.

{};

Member Function Documentation

void MuonBaseNumber::addBase ( const int  level,
const int  super,
const int  base 
)
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().

                                               {
  basenumber_type::iterator cur=sortedBaseNumber.begin();
  basenumber_type::iterator end=sortedBaseNumber.end();

  // do a small check if level is already occupied

  while (cur!=end) {
    if (num.level()==(*cur).level()) {
      LogDebug("MuonBaseNumber") << "MuonBaseNumber::addBase was asked to add "
           <<num.level()<<" "
           <<num.super()<<" "
           <<num.base()
           <<" to existing level "
           <<(*cur).level()<<" "
           <<(*cur).super()<<" "
           <<(*cur).base() << " but refused.";
      return; // don't overwrite current volume stored
    }
    cur++;
  }

  cur=sortedBaseNumber.begin();
  while (cur!=end) {
    if (num.level()<(*cur).level()) break;
    cur++;
  }
  sortedBaseNumber.insert(cur,num);

#ifdef LOCAL_DEBUG
  cur=sortedBaseNumber.begin();
  end=sortedBaseNumber.end();
  std::cout << "MuonBaseNumber::AddBase ";
  while (cur!=end) {
    std::cout<<(*cur).level()<<" ";
    std::cout<<(*cur).super()<<" ";
    std::cout<<(*cur).base();
    std::cout<<",";
    cur++;
  }
  std::cout <<std::endl;
#endif

}
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().

                                             {
  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
  basenumber_type::const_iterator end=sortedBaseNumber.end();
  while (cur!=end) {
    if ((*cur).level()==level) {
      return (*cur).base();
    }
    cur++;
  }
  return 0;
}
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(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), MuonDDDNumbering::geoHistoryToBaseNumber(), and MuonRpcFrameRotation::transformPoint().

                                              {
  basenumber_type::const_iterator cur=sortedBaseNumber.begin();
  basenumber_type::const_iterator end=sortedBaseNumber.end();
  while (cur!=end) {
    if ((*cur).level()==level) {
      return (*cur).super();
    }
    cur++;
  }
  return 0;
}

Member Data Documentation

Definition at line 39 of file MuonBaseNumber.h.

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