CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
DTLayerId Class Reference

#include <DTLayerId.h>

Inheritance diagram for DTLayerId:
DTSuperLayerId DTChamberId DetId DTWireId

Public Member Functions

 DTLayerId ()
 
 DTLayerId (uint32_t id)
 
 DTLayerId (int wheel, int station, int sector, int superlayer, int layer)
 
 DTLayerId (const DTLayerId &layerId)
 
 DTLayerId (const DTChamberId &chId, int superlayer, int layer)
 Constructor from a camberId and SL and layer numbers. More...
 
 DTLayerId (const DTSuperLayerId &slId, int layer)
 Constructor from a SuperLayerId and layer number. More...
 
int layer () const
 Return the layer number. More...
 
DTSuperLayerId superlayerId () const
 Return the corresponding SuperLayerId. More...
 
- Public Member Functions inherited from DTSuperLayerId
DTChamberId chamberId () const
 Return the corresponding ChamberId. More...
 
 DTSuperLayerId ()
 
 DTSuperLayerId (uint32_t id)
 
 DTSuperLayerId (int wheel, int station, int sector, int superlayer)
 
 DTSuperLayerId (const DTSuperLayerId &slId)
 
 DTSuperLayerId (const DTChamberId &chId, int superlayer)
 Constructor from a DTChamberId and SL number. More...
 
int superLayer () const
 Return the superlayer number. More...
 
int superlayer () const
 Return the superlayer number (deprecated method name) More...
 
- Public Member Functions inherited from DTChamberId
 DTChamberId ()
 
 DTChamberId (uint32_t id)
 
 DTChamberId (DetId id)
 
 DTChamberId (int wheel, int station, int sector)
 
 DTChamberId (const DTChamberId &chId)
 
int sector () const
 
int station () const
 Return the station number. More...
 
int wheel () const
 Return the wheel number. More...
 
- Public Member Functions inherited from DetId
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5
}
 
- Static Public Attributes inherited from DTChamberId
static const int maxLayerId = 4
 highest layer id More...
 
static const int maxSectorId = 14
 highest sector id. More...
 
static const int maxStationId = 4
 highest station id More...
 
static const int maxSuperLayerId = 3
 highest superlayer id More...
 
static const int maxWheelId = 2
 highest wheel number More...
 
static const int maxWireId = 97
 highest wire id (chambers have 48 to 96 wires) More...
 
static const int minLayerId = 0
 lowest layer id. 0 indicates a full SL More...
 
static const int minSectorId = 0
 lowest sector id. 0 indicates all sectors (a station) More...
 
static const int minStationId = 1
 lowest station id More...
 
static const int minSuperLayerId = 0
 loweset super layer id. 0 indicates a full chamber More...
 
static const int minWheelId = -2
 lowest wheel number More...
 
static const int minWireId = 0
 lowest wire id (numbering starts from 1 or 2). 0 indicates a full layer More...
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 
- Protected Member Functions inherited from DTChamberId
void checkMuonId ()
 
- Protected Attributes inherited from DetId
uint32_t id_
 
- Static Protected Attributes inherited from DTChamberId
static const uint32_t chamberIdMask_
 
static const uint32_t layerIdMask_ = ~(wireMask_<<wireStartBit_)
 
static const int layerNumBits_ = 3
 
static const int layerStartBit_ = wireStartBit_ + wireNumBits_
 
static const uint32_t lMask_ = 0x7
 
static const uint32_t sectorMask_ = 0xf
 
static const int sectorNumBits_ = 4
 
static const int sectorStartBit_ = wheelStartBit_ + wheelNumBits_
 
static const int slayerNumBits_ = 2
 
static const int slayerStartBit_ = layerStartBit_+ layerNumBits_
 
static const uint32_t slIdMask_
 
static const uint32_t slMask_ = 0x3
 
static const uint32_t stationMask_ = 0x7
 
static const int stationNumBits_ = 3
 two bits would be enough, but we could use the number "0" as a wildcard More...
 
static const int stationStartBit_ = sectorStartBit_ + sectorNumBits_
 
static const uint32_t wheelMask_ = 0x7
 
static const int wheelNumBits_ = 3
 
static const int wheelStartBit_ = slayerStartBit_ + slayerNumBits_
 
static const uint32_t wireMask_ = 0x7f
 
static const int wireNumBits_ = 7
 two bits would be enough, but we could use the number "0" as a wildcard More...
 
static const int wireStartBit_ = 3
 

Detailed Description

DetUnit identifier for DT layers

Author
G. Cerminara - INFN Torino

Definition at line 12 of file DTLayerId.h.

Constructor & Destructor Documentation

DTLayerId::DTLayerId ( )

Default constructor. Fills the common part in the base and leaves 0 in all other fields

Definition at line 14 of file DTLayerId.cc.

Referenced by DTWireId::layerId().

DTLayerId::DTLayerId ( uint32_t  id)
explicit

Construct from a packed id. It is required that the packed id represents a valid DT DetId (proper Detector and SubDet fields), otherwise an exception is thrown. Any bits outside the DTLayerId fields are zeroed; apart for this, no check is done on the vaildity of the values.

Definition at line 17 of file DTLayerId.cc.

References DTChamberId::checkMuonId(), DetId::id_, and DTChamberId::layerIdMask_.

17  {
18  // Mask the bits outside DTLayerId fields (notably, the wire number)
19  id_ = id & layerIdMask_;
20  // Check this is a valid id for muon DTs.
21  checkMuonId();
22 }
static const uint32_t layerIdMask_
Definition: DTChamberId.h:116
void checkMuonId()
Definition: DTChamberId.cc:57
uint32_t id_
Definition: DetId.h:55
DTLayerId::DTLayerId ( int  wheel,
int  station,
int  sector,
int  superlayer,
int  layer 
)

Construct from indexes. Input values are required to be within legal ranges, otherwise an exception is thrown.

Definition at line 62 of file DTLayerId.cc.

References edm::hlt::Exception, DetId::id_, DTChamberId::layerStartBit_, DTChamberId::lMask_, and DTChamberId::maxLayerId.

67  if (layer < minLayerId || layer > maxLayerId) {
68  throw cms::Exception("InvalidDetId") << "DTLayerId ctor:"
69  << " Invalid parameters: "
70  << " Wh:"<< wheel
71  << " St:"<< station
72  << " Se:"<< sector
73  << " Sl:"<< superlayer
74  << " La:"<< layer
75  << std::endl;
76  }
77 
78  id_ |= (layer & lMask_) << layerStartBit_;
79  }
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:85
static const int layerStartBit_
Definition: DTChamberId.h:97
int superlayer() const
Return the superlayer number (deprecated method name)
static const uint32_t lMask_
Definition: DTChamberId.h:113
uint32_t id_
Definition: DetId.h:55
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
DTLayerId::DTLayerId ( const DTLayerId layerId)

Copy Constructor. Any bits outside the DTLayerId fields are zeroed; apart for this, no check is done on the vaildity of the values.

Definition at line 27 of file DTLayerId.cc.

References DetId::id_, DTChamberId::layerIdMask_, and DetId::rawId().

27  {
28  // The mask is required for proper slicing, i.e. if layerId is
29  // actually a derived class.
30  id_ = (layerId.rawId() & layerIdMask_);
31 }
static const uint32_t layerIdMask_
Definition: DTChamberId.h:116
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
uint32_t id_
Definition: DetId.h:55
DTLayerId::DTLayerId ( const DTChamberId chId,
int  superlayer,
int  layer 
)

Constructor from a camberId and SL and layer numbers.

Definition at line 36 of file DTLayerId.cc.

References edm::hlt::Exception, DetId::id_, DTChamberId::layerStartBit_, DTChamberId::lMask_, and DTChamberId::maxLayerId.

36  : DTSuperLayerId(chId, superlayer) {
37  if (layer < minLayerId || layer > maxLayerId) {
38  throw cms::Exception("InvalidDetId") << "DTLayerId ctor:"
39  << " Invalid parameters: "
40  << " La:"<< layer
41  << std::endl;
42  }
43  id_ |= (layer & lMask_) << layerStartBit_;
44 }
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:85
static const int layerStartBit_
Definition: DTChamberId.h:97
int superlayer() const
Return the superlayer number (deprecated method name)
static const uint32_t lMask_
Definition: DTChamberId.h:113
uint32_t id_
Definition: DetId.h:55
DTLayerId::DTLayerId ( const DTSuperLayerId slId,
int  layer 
)

Constructor from a SuperLayerId and layer number.

Definition at line 49 of file DTLayerId.cc.

References edm::hlt::Exception, DetId::id_, DTChamberId::layerStartBit_, DTChamberId::lMask_, and DTChamberId::maxLayerId.

49  : DTSuperLayerId(slId) {
50  if (layer < minLayerId || layer > maxLayerId) {
51  throw cms::Exception("InvalidDetId") << "DTLayerId ctor:"
52  << " Invalid parameters: "
53  << " La:"<< layer
54  << std::endl;
55  }
56  id_ |= (layer & lMask_) << layerStartBit_;
57 }
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:85
static const int layerStartBit_
Definition: DTChamberId.h:97
static const uint32_t lMask_
Definition: DTChamberId.h:113
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

int DTLayerId::layer ( ) const
inline

Return the layer number.

Definition at line 53 of file DTLayerId.h.

References DetId::id_, DTChamberId::layerStartBit_, and DTChamberId::lMask_.

Referenced by DTSuperLayer::add(), DTPreCalibrationTask::analyze(), DTnoiseDBValidation::beginRun(), DTResidualCalibration::bookHistos(), DTt0DBValidation::bookHistos(), DTAlbertoBenvenutiTask::bookHistos(), DTTestPulsesTask::bookHistos(), DTDigiForNoiseTask::bookHistos(), DTEfficiencyTest::bookHistos(), DTDeadChannelTest::bookHistos(), DTEfficiencyTask::bookHistos(), DTCalibrationMap::checkGranularity(), DTChamber::component(), DTDigiToRaw::createFedBuffers(), DTHVStatusHandler::createSnapshot(), DTTMax::DTTMax(), DTHVStatusHandler::dumpSnapshot(), DTNoiseComputation::endJob(), DTCreateSummaryHistos::endJob(), DTDeadChannelTest::endLuminosityBlock(), DTEfficiencyTest::endLuminosityBlock(), DTMeantimerPatternReco::geometryFilter(), DTReadOutMapping::geometryToReadOut(), DTTtrig::get(), DTMtime::get(), DTNoiseCalibration::getChannelName(), DTTPAnalyzer::getHistoName(), DTT0Calibration::getHistoName(), DTT0CalibrationNew::getHistoName(), DTNoiseCalibration::getLayerName(), DTNoiseComputation::getLayerName(), DTEfficiencyTest::getMEName(), DTNoiseTest::getMEName(), DTTTrigCalibration::getOccupancyName(), DTTMax::getTMax(), MuonChamberResidual::hitlayer(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), DTClusterer::initHits(), DTHVStatusHandler::layerId(), DTHVStatusHandler::offlineList(), MuonSimHitProducer::produce(), DTTtrig::set(), and DTMtime::set().

53  {
54  return ((id_>>layerStartBit_)&lMask_);
55  }
static const int layerStartBit_
Definition: DTChamberId.h:97
static const uint32_t lMask_
Definition: DTChamberId.h:113
uint32_t id_
Definition: DetId.h:55
DTSuperLayerId DTLayerId::superlayerId ( ) const
inline

Return the corresponding SuperLayerId.

Definition at line 59 of file DTLayerId.h.

References DTSuperLayerId::DTSuperLayerId(), DetId::id_, and DTChamberId::slIdMask_.

Referenced by DTResidualCalibration::analyze(), DTT0Calibration::analyze(), DTT0CalibrationNew::analyze(), DTTTrigCalibration::analyze(), DTVDriftCalibration::analyze(), DTEfficiencyTask::analyze(), DTResolutionAnalysisTask::analyze(), DTnoiseDBValidation::beginRun(), DTNoiseComputation::beginRun(), DTt0DBValidation::bookHistos(), DTAlbertoBenvenutiTask::bookHistos(), DTTestPulsesTask::bookHistos(), DTDigiForNoiseTask::bookHistos(), DTEfficiencyTest::bookHistos(), DTDeadChannelTest::bookHistos(), DTEfficiencyTask::bookHistos(), FWDTRecHitProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), DTLinearDriftFromDBAlgo::compute(), dtCalibration::DTT0ChamberReferenceCorrection::correction(), dtCalibration::DTT0FillChamberFromDB::correction(), dtCalibration::DTT0AbsoluteReferenceCorrection::correction(), dtCalibration::DTT0WireInChamberReferenceCorrection::correction(), DTDigiToRaw::createFedBuffers(), DTTTrigSyncFromDB::emulatorOffset(), DTMeantimerPatternReco::geometryFilter(), DTRecoUncertainties::get(), DTRecoConditions::get(), DTNoiseComputation::getChamberName(), DTCalibrationMap::getKey(), DTNoiseCalibration::getLayerName(), DTNoiseComputation::getLayerName(), DTEfficiencyTest::getMEName(), DTTTrigSyncFromDB::offset(), DTRecSegment2DProducer::produce(), DTRecSegment2DExtendedProducer::produce(), DTClusterer::produce(), DTRecoUncertainties::set(), DTRecoConditions::set(), and DTTrig::triggerReco().

59  {
60  return DTSuperLayerId(id_ & slIdMask_);
61  }
static const uint32_t slIdMask_
Definition: DTChamberId.h:117
uint32_t id_
Definition: DetId.h:55