CMS 3D CMS Logo

Public Member Functions

DTLayerId Class Reference

#include <DTLayerId.h>

Inheritance diagram for DTLayerId:
DTSuperLayerId DTChamberId DetId DTWireId

List of all members.

Public Member Functions

 DTLayerId ()
 DTLayerId (uint32_t id)
 DTLayerId (const DTLayerId &layerId)
 DTLayerId (const DTSuperLayerId &slId, int layer)
 Constructor from a SuperLayerId and layer number.
 DTLayerId (const DTChamberId &chId, int superlayer, int layer)
 Constructor from a camberId and SL and layer numbers.
 DTLayerId (int wheel, int station, int sector, int superlayer, int layer)
int layer () const
 Return the layer number.
DTSuperLayerId superlayerId () const
 Return the corresponding SuperLayerId.

Detailed Description

DetUnit identifier for DT layers

Date:
2006/04/12 17:52:39
Revision:
1.3
Author:
G. Cerminara - INFN Torino

Definition at line 14 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 15 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 18 of file DTLayerId.cc.

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

                                {
  // Mask the bits outside DTLayerId fields (notably, the wire number)
  id_ = id & layerIdMask_;
  // Check this is a valid id for muon DTs.
  checkMuonId();
}
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 63 of file DTLayerId.cc.

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

                                : DTSuperLayerId(wheel, station, sector, superlayer) {
                       if (layer < minLayerId || layer > maxLayerId) {
                         throw cms::Exception("InvalidDetId") << "DTLayerId ctor:" 
                                                              << " Invalid parameters: " 
                                                              << " Wh:"<< wheel
                                                              << " St:"<< station
                                                              << " Se:"<< sector
                                                              << " Sl:"<< superlayer
                                                              << " La:"<< layer
                                                              << std::endl;
                       }
                       
                       id_ |= (layer & lMask_) << layerStartBit_;
                     }
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 28 of file DTLayerId.cc.

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

                                             {
  // The mask is required for proper slicing, i.e. if layerId is
  // actually a derived class.
  id_ = (layerId.rawId() & layerIdMask_);
}
DTLayerId::DTLayerId ( const DTChamberId chId,
int  superlayer,
int  layer 
)

Constructor from a camberId and SL and layer numbers.

Definition at line 37 of file DTLayerId.cc.

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

                                                                       : DTSuperLayerId(chId, superlayer) {
  if (layer < minLayerId || layer > maxLayerId) {
    throw cms::Exception("InvalidDetId") << "DTLayerId ctor:" 
                                         << " Invalid parameters: " 
                                         << " La:"<< layer
                                         << std::endl;
  }
  id_ |= (layer & lMask_) << layerStartBit_;
}
DTLayerId::DTLayerId ( const DTSuperLayerId slId,
int  layer 
)

Constructor from a SuperLayerId and layer number.

Definition at line 50 of file DTLayerId.cc.

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

                                                          : DTSuperLayerId(slId) {
  if (layer < minLayerId || layer > maxLayerId) {
    throw cms::Exception("InvalidDetId") << "DTLayerId ctor:" 
                                         << " Invalid parameters: " 
                                         << " La:"<< layer
                                         << std::endl;
  }
  id_ |= (layer & lMask_) << layerStartBit_;
}

Member Function Documentation

int DTLayerId::layer ( ) const [inline]
DTSuperLayerId DTLayerId::superlayerId ( ) const [inline]