CMS 3D CMS Logo

MuonBaseNumber Class Reference

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 More...

#include <Geometry/MuonNumbering/interface/MuonBaseNumber.h>

List of all members.

Public Member Functions

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

00026 {};

MuonBaseNumber::~MuonBaseNumber (  )  [inline]

Definition at line 27 of file MuonBaseNumber.h.

00027 {};


Member Function Documentation

void MuonBaseNumber::addBase ( LevelBaseNumber  num  ) 

Definition at line 7 of file MuonBaseNumber.cc.

References LevelBaseNumber::base(), GenMuonPlsPt100GeV_cfg::cout, end, lat::endl(), LevelBaseNumber::level(), LogDebug, sortedBaseNumber, and LevelBaseNumber::super().

00007                                                {
00008   basenumber_type::iterator cur=sortedBaseNumber.begin();
00009   basenumber_type::iterator end=sortedBaseNumber.end();
00010 
00011   // do a small check if level is already occupied
00012 
00013   while (cur!=end) {
00014     if (num.level()==(*cur).level()) {
00015       LogDebug("MuonBaseNumber") << "MuonBaseNumber::addBase was asked to add "
00016            <<num.level()<<" "
00017            <<num.super()<<" "
00018            <<num.base()
00019            <<" to existing level "
00020            <<(*cur).level()<<" "
00021            <<(*cur).super()<<" "
00022            <<(*cur).base() << " but refused.";
00023       return; // don't overwrite current volume stored
00024     }
00025     cur++;
00026   }
00027 
00028   cur=sortedBaseNumber.begin();
00029   while (cur!=end) {
00030     if (num.level()<(*cur).level()) break;
00031     cur++;
00032   }
00033   sortedBaseNumber.insert(cur,num);
00034 
00035 #ifdef LOCAL_DEBUG
00036   cur=sortedBaseNumber.begin();
00037   end=sortedBaseNumber.end();
00038   std::cout << "MuonBaseNumber::AddBase ";
00039   while (cur!=end) {
00040     std::cout<<(*cur).level()<<" ";
00041     std::cout<<(*cur).super()<<" ";
00042     std::cout<<(*cur).base();
00043     std::cout<<",";
00044     cur++;
00045   }
00046   std::cout <<std::endl;
00047 #endif
00048 
00049 }

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

Definition at line 51 of file MuonBaseNumber.cc.

References funct::num().

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

00051                                                                           {
00052   LevelBaseNumber num(level,super,base);
00053   addBase(num);
00054 }

int MuonBaseNumber::getBaseNo ( int  level  )  const

Definition at line 72 of file MuonBaseNumber.cc.

References end, and sortedBaseNumber.

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

00072                                              {
00073   basenumber_type::const_iterator cur=sortedBaseNumber.begin();
00074   basenumber_type::const_iterator end=sortedBaseNumber.end();
00075   while (cur!=end) {
00076     if ((*cur).level()==level) {
00077       return (*cur).base();
00078     }
00079     cur++;
00080   }
00081   return 0;
00082 }

int MuonBaseNumber::getLevels (  )  const

Definition at line 56 of file MuonBaseNumber.cc.

References sortedBaseNumber.

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

00056                                     {
00057   return sortedBaseNumber.size();
00058 }

int MuonBaseNumber::getSuperNo ( int  level  )  const

Definition at line 60 of file MuonBaseNumber.cc.

References end, and sortedBaseNumber.

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

00060                                               {
00061   basenumber_type::const_iterator cur=sortedBaseNumber.begin();
00062   basenumber_type::const_iterator end=sortedBaseNumber.end();
00063   while (cur!=end) {
00064     if ((*cur).level()==level) {
00065       return (*cur).super();
00066     }
00067     cur++;
00068   }
00069   return 0;
00070 }


Member Data Documentation

basenumber_type MuonBaseNumber::sortedBaseNumber [protected]

Definition at line 39 of file MuonBaseNumber.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:40 2009 for CMSSW by  doxygen 1.5.4