CMS 3D CMS Logo

DTNumberingScheme Class Reference

implementation of MuonNumberingScheme for muon barrel, converts the MuonBaseNumber to a unit id More...

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

Inheritance diagram for DTNumberingScheme:

MuonNumberingScheme

List of all members.

Public Member Functions

virtual int baseNumberToUnitNumber (const MuonBaseNumber num)
 DTNumberingScheme (const MuonDDDConstants &muonConstants)
 DTNumberingScheme (const DDCompactView &cpv)
 ~DTNumberingScheme ()

Private Member Functions

void decode (const MuonBaseNumber &num, int &wire_id, int &layer_id, int &superlayer_id, int &sector_id, int &station_id, int &wheel_id) const
int getDetId (const MuonBaseNumber num) const
 Same as BaseNumberToUnitNumber but w/o check: used by MuBarDetBuilder class to build the geometry from DDD.
void initMe (const MuonDDDConstants &muonConstants)

Private Attributes

int theLayerLevel
int theRegionLevel
int theStationLevel
int theSuperLayerLevel
int theWheelLevel
int theWireLevel

Friends

class DTGeometryBuilderFromDDD
class DTGeometryParserFromDDD


Detailed Description

implementation of MuonNumberingScheme for muon barrel, converts the MuonBaseNumber to a unit id

Date
2007/09/13 12:33:10
Revision
1.6
Author:
Arno Straessner, CERN <arno.straessner@cern.ch>

Definition at line 22 of file DTNumberingScheme.h.


Constructor & Destructor Documentation

DTNumberingScheme::DTNumberingScheme ( const DDCompactView cpv  ) 

Definition at line 13 of file DTNumberingScheme.cc.

References initMe().

00013                                                                {
00014   MuonDDDConstants muonConstants(cpv);
00015   initMe(muonConstants);
00016 }

DTNumberingScheme::DTNumberingScheme ( const MuonDDDConstants muonConstants  ) 

Definition at line 9 of file DTNumberingScheme.cc.

References initMe().

00009                                                                             {
00010   initMe(muonConstants);
00011 }

DTNumberingScheme::~DTNumberingScheme (  )  [inline]

Definition at line 27 of file DTNumberingScheme.h.

00027 {}


Member Function Documentation

int DTNumberingScheme::baseNumberToUnitNumber ( const MuonBaseNumber  num  )  [virtual]

Reimplemented from MuonNumberingScheme.

Definition at line 37 of file DTNumberingScheme.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MuonBaseNumber::getBaseNo(), getDetId(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), level, and theWireLevel.

00037                                                                      {
00038   
00039 #ifdef LOCAL_DEBUG
00040   std::cout << "DTNumbering "<<num.getLevels()<<std::endl;
00041   for (int level=1;level<=num.getLevels();level++) {
00042     std::cout << level << " " << num.getSuperNo(level)
00043        << " " << num.getBaseNo(level) << std::endl;
00044   }
00045 #endif
00046   if (num.getLevels()!=theWireLevel) {
00047     std::cout << "DTNS::BNToUN "
00048        << "BaseNumber has " << num.getLevels() << " levels,"
00049        << "need "<<theWireLevel<<std::endl;
00050     return 0;
00051   }
00052   
00053 
00054 //   // Meaningful ranges are enforced by DTWireId, (which
00055 //   // however allows for 0 in wire, layer, superlayer!!!)
00056 // 
00057 //   if ((wire_id < 1) || (wire_id > 100)) {
00058 //     std::cout << "DTNumberingScheme: ";
00059 //     std::cout << "wire id out of range: ";
00060 //     std::cout << wire_id <<std::endl;
00061 //   }
00062     
00063 //   if ((layer_id < 1) || (layer_id > 4)) {
00064 //     std::cout << "DTNumberingScheme: ";
00065 //     std::cout << "layer id out of range: ";
00066 //     std::cout << layer_id <<std::endl;
00067 //   }
00068     
00069 //   if ((superlayer_id < 1) || (superlayer_id > 3)) {
00070 //     std::cout << "DTNumberingScheme: ";
00071 //     std::cout << "super-layer id out of range: ";
00072 //     std::cout << superlayer_id <<std::endl;
00073 //   }
00074 
00075 
00076   return getDetId(num);
00077 }

void DTNumberingScheme::decode ( const MuonBaseNumber num,
int wire_id,
int layer_id,
int superlayer_id,
int sector_id,
int station_id,
int wheel_id 
) const [private]

Definition at line 125 of file DTNumberingScheme.cc.

References MuonBaseNumber::getBaseNo(), MuonBaseNumber::getLevels(), MuonBaseNumber::getSuperNo(), level, theLayerLevel, theStationLevel, theSuperLayerLevel, theWheelLevel, and theWireLevel.

Referenced by getDetId().

00131                                                             {
00132   for (int level=1;level<=num.getLevels();level++) {
00133 
00134     //decode
00135     if (level==theWheelLevel) {
00136       const int copyno=num.getBaseNo(level);      
00137       wheel_id=copyno-2;
00138 
00139     } else if (level==theStationLevel) {
00140       const int station_tag = num.getSuperNo(level);
00141       const int copyno = num.getBaseNo(level);
00142       station_id=station_tag;
00143       sector_id=copyno+1;   
00144 
00145     } else if (level==theSuperLayerLevel) {
00146       const int copyno = num.getBaseNo(level);
00147       superlayer_id = copyno + 1;
00148 
00149     } else if (level==theLayerLevel) {
00150       const int copyno = num.getBaseNo(level);
00151       layer_id=copyno+1;
00152 
00153     } else if (level==theWireLevel) {
00154       const int copyno = num.getBaseNo(level);
00155       wire_id = copyno+1;
00156     }
00157   }
00158 }

int DTNumberingScheme::getDetId ( const MuonBaseNumber  num  )  const [private]

Same as BaseNumberToUnitNumber but w/o check: used by MuBarDetBuilder class to build the geometry from DDD.

Definition at line 79 of file DTNumberingScheme.cc.

References GenMuonPlsPt100GeV_cfg::cout, decode(), lat::endl(), and id.

Referenced by baseNumberToUnitNumber(), DTGeometryBuilderFromDDD::buildLayer(), and DTGeometryBuilderFromDDD::buildSuperLayer().

00079                                                               {
00080   
00081   int wire_id=0;
00082   int layer_id=0;
00083   int superlayer_id=0;
00084   int sector_id=0;
00085   int station_id=0;
00086   int wheel_id=0;
00087 
00088   //decode significant barrel levels
00089   decode(num,
00090          wire_id,
00091          layer_id,
00092          superlayer_id,
00093          sector_id,
00094          station_id,
00095          wheel_id);
00096   
00097 // These ranges are enforced by DTWireId
00098 //   if ((sector_id < 1) || (sector_id > 14)) {
00099 //     std::cout << "DTNumberingScheme: ";
00100 //     std::cout << "sector id out of range: ";
00101 //     std::cout << sector_id <<std::endl;
00102 //   }
00103     
00104 //   if ((station_id < 1) || (station_id > 4)) {
00105 //     std::cout << "DTNumberingScheme: ";
00106 //     std::cout << "station id out of range: ";
00107 //     std::cout << station_id <<std::endl;
00108 //   }
00109     
00110 //   if ((wheel_id < -2) || (wheel_id > 2)) {
00111 //     std::cout << "DTNumberingScheme: ";
00112 //     std::cout << "wheel id out of range: ";
00113 //     std::cout << wheel_id <<std::endl;
00114 //   }
00115     
00116   DTWireId id(wheel_id,station_id,sector_id,superlayer_id,layer_id,wire_id);
00117   
00118 #ifdef LOCAL_DEBUG
00119   std::cout << "DTNumberingScheme: " << id << std::endl;
00120 #endif
00121   
00122   return id.rawId();
00123 }

void DTNumberingScheme::initMe ( const MuonDDDConstants muonConstants  )  [private]

Definition at line 18 of file DTNumberingScheme.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MuonDDDConstants::getValue(), theLayerLevel, theRegionLevel, theStationLevel, theSuperLayerLevel, theWheelLevel, and theWireLevel.

Referenced by DTNumberingScheme().

00018                                                                        {
00019   int theLevelPart=muonConstants.getValue("level");
00020   theRegionLevel=muonConstants.getValue("mb_region")/theLevelPart;
00021   theWheelLevel=muonConstants.getValue("mb_wheel")/theLevelPart;
00022   theStationLevel=muonConstants.getValue("mb_station")/theLevelPart;
00023   theSuperLayerLevel=muonConstants.getValue("mb_superlayer")/theLevelPart;
00024   theLayerLevel=muonConstants.getValue("mb_layer")/theLevelPart;
00025   theWireLevel=muonConstants.getValue("mb_wire")/theLevelPart;
00026  #ifdef LOCAL_DEBUG
00027    std::cout << "theRegionLevel " << theRegionLevel <<std::endl;
00028    std::cout << "theWheelLevel " << theWheelLevel <<std::endl;
00029    std::cout << "theStationLevel " << theStationLevel <<std::endl;
00030    std::cout << "theSuperLayerLevel " << theSuperLayerLevel <<std::endl;
00031    std::cout << "theLayerLevel " << theLayerLevel <<std::endl;
00032    std::cout << "theWireLevel " << theWireLevel <<std::endl;
00033  #endif
00034 
00035 }


Friends And Related Function Documentation

friend class DTGeometryBuilderFromDDD [friend]

Definition at line 54 of file DTNumberingScheme.h.

friend class DTGeometryParserFromDDD [friend]

Definition at line 55 of file DTNumberingScheme.h.


Member Data Documentation

int DTNumberingScheme::theLayerLevel [private]

Definition at line 48 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theRegionLevel [private]

Definition at line 44 of file DTNumberingScheme.h.

Referenced by initMe().

int DTNumberingScheme::theStationLevel [private]

Definition at line 46 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theSuperLayerLevel [private]

Definition at line 47 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWheelLevel [private]

Definition at line 45 of file DTNumberingScheme.h.

Referenced by decode(), and initMe().

int DTNumberingScheme::theWireLevel [private]

Definition at line 49 of file DTNumberingScheme.h.

Referenced by baseNumberToUnitNumber(), decode(), and initMe().


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