#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 |
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
Definition at line 23 of file MuonBaseNumber.h.
typedef std::vector<LevelBaseNumber> MuonBaseNumber::basenumber_type [protected] |
Definition at line 38 of file MuonBaseNumber.h.
MuonBaseNumber::MuonBaseNumber | ( | ) | [inline] |
Definition at line 26 of file MuonBaseNumber.h.
{};
MuonBaseNumber::~MuonBaseNumber | ( | ) | [inline] |
Definition at line 27 of file MuonBaseNumber.h.
{};
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().
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 |
Definition at line 56 of file MuonBaseNumber.cc.
References sortedBaseNumber.
Referenced by CSCNumberingScheme::baseNumberToUnitNumber(), RPCNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::baseNumberToUnitNumber(), DTNumberingScheme::decode(), and MuonDDDNumbering::geoHistoryToBaseNumber().
{ return sortedBaseNumber.size(); }
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; }
basenumber_type MuonBaseNumber::sortedBaseNumber [protected] |
Definition at line 39 of file MuonBaseNumber.h.
Referenced by addBase(), getBaseNo(), getLevels(), and getSuperNo().